* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}

body.ops-body {
  background: #f5f7fa;
  color: #0f172a;
}

.ops-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.ops-sidebar {
  width: 245px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.ops-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 16px;
}

.ops-brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #0b132b;
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.ops-brand-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: #0f172a;
}

.ops-brand-sub {
  font-size: 0.76rem;
  color: #10b981;
  font-weight: 600;
}

.ops-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ops-nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 14px 10px 6px;
}

.nav-item {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: #f1f5f9;
}

.nav-item.active {
  background: #0b132b;
  color: #ffffff;
}

.role-pill,
.nav-count {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.role-pill {
  background: #ccfbf1;
  color: #0f766e;
}

.nav-count {
  background: #fef3c7;
  color: #b45309;
}

.nav-item.active .role-pill,
.nav-item.active .nav-count {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.ops-key-box {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.ops-key-box label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 6px;
}

.ops-key-box input[type="text"],
.ops-key-box input[type="password"] {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #0f172a;
  background: #ffffff;
}

.pw-toggle-btn {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 600;
}

.modal-primary-btn {
  width: 100%;
  background: #0b132b;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-primary-btn:hover {
  background: #162347;
}

.modal-secondary-btn {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.modal-secondary-btn:hover {
  background: #f8fafc;
}

/* Main Content */
.ops-main {
  flex: 1;
  padding: 22px 28px;
  max-width: 1440px;
  min-width: 0;
}

.ops-header-bar,
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.ops-header-bar h2,
.section-header-row h2,
.ops-view > h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 14px;
}

.ops-header-bar h2,
.section-header-row h2 {
  margin-bottom: 0;
}

.ops-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.launch-game-link {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 600;
}

.launch-game-link:hover {
  background: #f8fafc;
}

.system-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.system-live-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

/* 4-Column KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
}

.kpi-card:nth-child(3) {
  border-color: #fde68a;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.08);
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 10px;
}

.kpi-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.84rem;
  color: #64748b;
  flex-wrap: wrap;
}

.kpi-value strong {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.kpi-card:nth-child(3) .kpi-value strong {
  color: #d97706;
}

.kpi-sub {
  font-size: 0.76rem;
  color: #64748b;
}

.kpi-sub em {
  font-style: normal;
  font-weight: 600;
  color: #334155;
}

/* Settlement Banner */
.settlement-banner {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.settlement-banner strong {
  font-size: 0.88rem;
  color: #0f172a;
}

.muted-sub {
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 2px;
}

.settlement-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: #475569;
}

.settlement-stats strong {
  color: #0f172a;
}

/* 2-Column Queues & Cards */
.queues-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 960px) {
  .queues-grid {
    grid-template-columns: 1fr;
  }
}

.queue-card,
.panel-card,
.admin-card,
.table-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
}

.queue-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 10px;
}

.queue-card-head h3 {
  font-size: 0.94rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-card-head h3 span {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
}

.queue-card-head a {
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.queue-card-head a:hover {
  color: #0f172a;
}

.queue-list {
  min-height: 120px;
}

.queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  gap: 10px;
}

.queue-item:last-child {
  border-bottom: none;
}

.tx-amount {
  font-weight: 800;
  font-size: 0.92rem;
  color: #0f172a;
  margin-left: 6px;
}

.queue-meta {
  font-size: 0.78rem;
  color: #334155;
}

.tx-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 2px;
}

.queue-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-approve {
  background: #16a34a;
  color: #ffffff;
  border: none;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-approve:hover {
  background: #15803d;
}

.btn-reject {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 6px 10px;
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-reject:hover {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.empty-queue {
  text-align: center;
  padding: 44px 16px;
  color: #64748b;
  font-size: 0.84rem;
}

/* Crash Monitor & Cockpit */
.admin-card h3 {
  font-size: 0.96rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.crash-monitor-grid,
.cockpit-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}

.crash-monitor-grid > div,
.cockpit-stats > div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.crash-monitor-grid span {
  font-size: 0.8rem;
  color: #64748b;
}

.crash-monitor-grid strong,
.cockpit-stats strong {
  font-size: 0.92rem;
  color: #0f172a;
}

/* Toolbars, Forms & Tables */
.daily-toolbar,
.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-form {
  margin: 8px 0 12px;
}

.daily-toolbar input,
.daily-toolbar select,
.inline-form input,
.inline-form select,
.role-select {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.84rem;
  background: #ffffff;
  color: #0f172a;
}

.inline-form button[type="submit"] {
  width: auto;
}

.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.ops-table th,
.ops-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #f1f5f9;
}

.ops-table th {
  color: #64748b;
  font-weight: 700;
  font-size: 0.75rem;
}

/* Notices */
.ops-notice {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 0.83rem;
  margin-bottom: 14px;
}

.ops-notice.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.hidden {
  display: none !important;
}
/* Ensure flight stage & plane canvas remain visible */
.game-stage, .flight-stage, .stage-wrap, .canvas-wrap, .chart-wrap, #gameStage, #flightStage {
  position: relative;
  min-height: 260px;
  width: 100%;
  overflow: hidden;
}
.game-stage canvas, .flight-stage canvas, .stage-wrap canvas, .canvas-wrap canvas, #gameCanvas, #flightCanvas, canvas.plane-canvas {
  display: block;
  width: 100%;
  min-height: 240px;
}

/* === PILOTCASH GAME & FLIGHT STAGE STYLES === */
body:not(.ops-body) {
  background: #0b0f19;
  color: #f8fafc;
  min-height: 100vh;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: #131a2a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  position: relative;
  z-index: 20;
}

.topbar-left,
.topbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.brand {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin-right: 6px;
}

.topbar button,
.topbar input {
  background: #1b2438;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 0.82rem;
}

.topbar button {
  cursor: pointer;
  font-weight: 600;
}

#walletBtn {
  background: #10b981;
  color: #052e16;
  border: none;
  font-weight: 700;
}

.balance-pill {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.game-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 16px 24px;
}

.right-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 10px;
  background: #131a2a;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  min-height: 38px;
  font-size: 0.78rem;
  font-weight: 700;
}

.history-strip span,
.history-pill {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  white-space: nowrap;
}

.stage {
  position: relative;
  width: 100%;
  height: 340px;
  min-height: 280px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at 80% 25%, rgba(225, 29, 72, 0.24), transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(56, 189, 248, 0.15), transparent 50%),
    linear-gradient(180deg, #0f172a 0%, #090d16 100%);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}

#flightCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.stage-status-label {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 5;
}

.multiplier-readout {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 5;
}

.game-notice {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  font-size: 0.84rem;
  font-weight: 600;
}

.bet-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 12px;
}

.bet-box {
  background: #131a2a;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bet-slot-header {
  font-size: 0.75rem;
  color: #94a3b8;
  letter-spacing: 0.06em;
}

.bet-main-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.stake-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stepper-bar {
  display: flex;
  align-items: center;
  background: #1b2438;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.stepper-bar button {
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 8px 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.stepper-bar input {
  width: 100%;
  background: transparent;
  border: none;
  color: #ffffff;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  outline: none;
}

.quick-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.quick-amounts button {
  background: #1b2438;
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 5px 0;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.primary-bet-btn {
  min-width: 130px;
  border: none;
  border-radius: 10px;
  background: #10b981;
  color: #052e16;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 12px 14px;
  cursor: pointer;
}

.auto-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: #94a3b8;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auto-out-input {
  width: 64px;
  background: #1b2438;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.78rem;
}

.side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  height: 100vh;
  background: #131a2a;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
}

.side-drawer a,
.drawer-nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  background: #1b2438;
  color: #ffffff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: #131a2a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 18px;
  color: #ffffff;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.wallet-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallet-form input {
  background: #1b2438;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px;
}
