/* ==========================================================================
   TaxiMIg Design System • Swiss Engineering & OLED Dark (No-Emoji Standard)
   ========================================================================== */

:root {
  /* Surface Tokens */
  --bg-primary: #080c14;
  --bg-surface: #0f1626;
  --bg-surface-elevated: #141d33;
  --bg-card: #141d32;
  --bg-card-hover: #1b2642;
  
  /* Brand Amber Accents */
  --brand-primary: #f59e0b;
  --brand-primary-hover: #fbbf24;
  --brand-glow: rgba(245, 158, 11, 0.28);
  --brand-subtle: rgba(245, 158, 11, 0.12);
  
  /* Semantic Tokens */
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.12);
  --color-surge: #f97316;
  --color-surge-bg: rgba(249, 115, 22, 0.14);
  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.14);
  
  /* Typography Tokens */
  --text-high: #f8fafc;
  --text-medium: #cbd5e1;
  --text-muted: #64748b;
  --text-dim: #475569;
  
  /* Borders & Dividers */
  --border-subtle: rgba(245, 158, 11, 0.16);
  --border-glass: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(245, 158, 11, 0.45);
  
  /* Geometry & Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  
  /* Fluid Typographic Scale */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --text-xs: clamp(0.6875rem, 0.65rem + 0.15vw, 0.75rem);   /* 11px - 12px */
  --text-sm: clamp(0.75rem, 0.72rem + 0.2vw, 0.8125rem);    /* 12px - 13px */
  --text-base: clamp(0.8125rem, 0.78rem + 0.25vw, 0.875rem); /* 13px - 14px */
  --text-md: clamp(0.9375rem, 0.9rem + 0.3vw, 1.0625rem);    /* 15px - 17px */
  --text-lg: clamp(1.125rem, 1.05rem + 0.45vw, 1.25rem);    /* 18px - 20px */
  --text-xl: clamp(1.375rem, 1.25rem + 0.7vw, 1.625rem);     /* 22px - 26px */
  
  /* Elevation Shadows */
  --shadow-card: 0 16px 36px -8px rgba(0, 0, 0, 0.75), 0 0 1px 1px var(--border-glass);
  --shadow-glow: 0 0 28px var(--brand-glow);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-high);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Tabular numbers for clocks, prices, coords */
.tabular-nums {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   Top Navigation & Compliance Header
   ========================================================================== */

.app-header {
  height: 68px;
  background: rgba(8, 12, 20, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon-box {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--brand-primary), #d97706);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--brand-glow);
  color: #080c14;
}

.brand-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-name {
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.brand-badge {
  font-size: var(--text-xs);
  background: var(--brand-subtle);
  color: var(--brand-primary);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.04em;
}

/* Role Navigation Tabs */
.role-tabs {
  display: flex;
  background: rgba(15, 22, 38, 0.85);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  gap: 4px;
}

.role-tab {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.role-tab svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.role-tab:hover {
  color: var(--text-high);
}

.role-tab.active {
  background: var(--brand-primary);
  color: #080c14;
  font-weight: 700;
  box-shadow: 0 2px 12px var(--brand-glow);
}

.role-tab.active svg {
  stroke: #080c14;
}

/* 580-FZ Regulatory Status Indicator */
.compliance-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-success-bg);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-success);
  letter-spacing: 0.02em;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-success);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* ==========================================================================
   Viewport Panels
   ========================================================================== */

.main-content {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

.view-panel {
  display: none;
  width: 100%;
  height: calc(100vh - 68px);
  position: relative;
}

.view-panel.active {
  display: flex;
}

.map-container {
  flex: 1;
  height: 100%;
  background: #080c14;
  position: relative;
}

#leaflet-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ==========================================================================
   Passenger Custom Control Panel
   ========================================================================== */

.passenger-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 410px;
  max-height: calc(100vh - 108px);
  background: rgba(15, 22, 38, 0.94);
  backdrop-filter: blur(28px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-card);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Address Route Inputs */
.route-card {
  background: rgba(8, 12, 20, 0.65);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.route-axis {
  position: absolute;
  left: 21px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: repeating-linear-gradient(to bottom, var(--brand-primary), var(--brand-primary) 3px, transparent 3px, transparent 6px);
}

.route-row {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
}

.pin-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.route-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-high);
  font-size: var(--text-base);
  font-weight: 500;
  font-family: var(--font-sans);
}

.route-input::placeholder {
  color: var(--text-muted);
}

/* Tariffs Carousel Grid */
.tariffs-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.tariffs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tariff-item {
  background: rgba(20, 29, 50, 0.55);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.tariff-item svg {
  width: 28px;
  height: 28px;
  stroke: var(--brand-primary);
}

.tariff-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(245, 158, 11, 0.35);
}

.tariff-item.selected {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.14), rgba(20, 29, 50, 0.95));
  border-color: var(--brand-primary);
  box-shadow: 0 0 18px var(--brand-glow);
}

.tariff-item-name {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-high);
}

.tariff-item-price {
  font-size: var(--text-md);
  font-weight: 800;
  color: var(--brand-primary-hover);
}

.tariff-item-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.surge-tag {
  position: absolute;
  top: -6px;
  right: -4px;
  background: var(--color-surge);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.45);
}

/* 60s Price Lock Widget */
.lock-timer-box {
  background: var(--brand-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
}

.lock-timer-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-medium);
}

.lock-timer-label svg {
  width: 14px;
  height: 14px;
  stroke: var(--brand-primary);
}

.lock-timer-val {
  font-weight: 800;
  color: var(--brand-primary);
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Payment Selector */
.payment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.payment-chip {
  padding: 8px 4px;
  background: rgba(20, 29, 50, 0.65);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.payment-chip svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.payment-chip.selected {
  background: var(--brand-subtle);
  border-color: var(--brand-primary);
  color: #ffffff;
}

/* CTA Order Button */
.btn-submit-order {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, var(--brand-primary), #d97706);
  border: none;
  border-radius: var(--radius-md);
  color: #080c14;
  font-size: var(--text-base);
  font-weight: 800;
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px var(--brand-glow);
  transition: all 0.2s ease;
}

.btn-submit-order:hover {
  background: linear-gradient(135deg, var(--brand-primary-hover), var(--brand-primary));
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.45);
}

/* Active Trip Overlay Card */
.active-trip-panel {
  display: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--brand-primary);
  border-radius: var(--radius-lg);
  padding: 16px;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-glow);
}

.driver-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.driver-avatar-circle {
  width: 40px;
  height: 40px;
  background: #1e293b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--brand-primary);
  color: var(--brand-primary);
}

.driver-avatar-circle svg {
  width: 20px;
  height: 20px;
}

.car-plate-badge {
  background: #ffffff;
  color: #000000;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.05em;
  font-family: monospace;
}

.btn-cancel-action {
  width: 100%;
  padding: 9px;
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-sm);
  color: #f87171;
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================================================
   Driver Terminal Custom View
   ========================================================================== */

.driver-layout {
  width: 100%;
  height: 100%;
  display: flex;
  background: var(--bg-primary);
}

.driver-control-col {
  width: 380px;
  height: 100%;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-glass);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.driver-switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.toggle-input {
  position: relative;
  width: 48px;
  height: 26px;
}

.toggle-input input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  transition: 0.25s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--color-success);
}

input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.driver-incoming-card {
  display: none;
  background: linear-gradient(145deg, #1b2640, #0f172a);
  border: 2px solid var(--brand-primary);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 0 30px var(--brand-glow);
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   Fleet Dispatcher Custom View
   ========================================================================== */

.dispatcher-layout {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  padding: 20px 28px;
  gap: 18px;
  overflow-y: auto;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.kpi-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-caption {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-figure {
  font-size: var(--text-xl);
  font-weight: 800;
  color: #ffffff;
}

.kpi-delta {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-success);
}

.dispatcher-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 16px;
  flex: 1;
}

.data-table-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: uppercase;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}
.status-badge.searching { background: var(--brand-subtle); color: var(--brand-primary); }
.status-badge.in_progress { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.status-badge.completed { background: var(--color-success-bg); color: var(--color-success); }

/* ==========================================================================
   Leaflet Custom Dark Tiles & Layer Switcher (Shawuha Self-Hosted Engine)
   ========================================================================== */

/* Leaflet Seamless Tile Overlap (Eliminates 1px tile gaps on Chromium/Retina) */
.leaflet-container {
  background: #080c14 !important;
  outline: none;
}

.leaflet-tile {
  border: none !important;
  box-shadow: none !important;
  outline: 1px solid transparent !important;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.leaflet-tile-container {
  will-change: transform;
}

.leaflet-tile-container img {
  border: none !important;
  box-shadow: none !important;
}

/* Deep OLED Dark Filter applied to the entire tile pane (prevents per-tile edge inversion seams) */
.dark-tiles .leaflet-tile-pane {
  filter: brightness(0.64) invert(1) contrast(2.5) hue-rotate(200deg) saturate(0.35);
  background: #080c14;
}

.dark-tiles .leaflet-tile {
  filter: none !important;
}

/* Map Layer Switcher Pills */
.map-layer-switcher {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  gap: 4px;
  background: rgba(15, 22, 38, 0.92);
  backdrop-filter: blur(12px);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.layer-pill {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.16s ease;
}

.layer-pill:hover {
  color: var(--text-high);
  background: rgba(255, 255, 255, 0.06);
}

.layer-pill.active {
  background: var(--brand-primary);
  color: #080c14;
  box-shadow: 0 0 12px var(--brand-glow);
}

/* ==========================================================================
   Header Profile Button & Group
   ========================================================================== */
.header-right-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  padding: 5px 12px 5px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
}
.auth-profile-btn:hover {
  border-color: var(--brand-primary);
  background: var(--bg-surface-elevated);
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #080c14;
  font-weight: 800;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-meta-sm {
  display: flex;
  flex-direction: column;
  text-align: left;
}
.user-name-sm {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-high);
  line-height: 1.2;
}
.user-role-sm {
  font-size: 10px;
  color: var(--brand-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Driver Wallet & Monetization Card
   ========================================================================== */
.driver-wallet-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.wallet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.wallet-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wallet-balance {
  font-size: var(--text-xl);
  font-weight: 900;
  color: #ffffff;
  margin-top: 2px;
}

.wallet-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.wallet-status-badge.blocked {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.shift-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-subtle);
  border: 1px solid var(--border-subtle);
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-primary);
}

.wallet-actions-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 8px;
}

.wallet-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-high);
  font-size: 11px;
  font-weight: 700;
  padding: 8px 6px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.wallet-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}
.wallet-action-btn.primary {
  background: var(--brand-primary);
  color: #080c14;
  border-color: var(--brand-primary-hover);
  box-shadow: 0 0 14px var(--brand-glow);
}
.wallet-action-btn.primary:hover {
  background: var(--brand-primary-hover);
}

.wallet-ledger {
  border-top: 1px solid var(--border-glass);
  padding-top: 10px;
}

.ledger-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.ledger-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 110px;
  overflow-y: auto;
}

.ledger-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
.ledger-item .desc {
  color: var(--text-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}
.ledger-item .amt {
  font-weight: 800;
}
.ledger-item .amt.plus { color: var(--color-success); }
.ledger-item .amt.minus { color: var(--color-danger); }

/* ==========================================================================
   Modals System (Auth, Top-Up, Shift, Payout)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 11, 0.85);
  backdrop-filter: blur(14px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-backdrop.open .modal-dialog {
  transform: scale(1);
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title {
  font-size: var(--text-md);
  font-weight: 800;
  color: var(--text-high);
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  gap: 10px;
}

/* Auth Role Picker in Modal */
.auth-role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  background: var(--bg-primary);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}
.auth-role-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.auth-role-tab.active {
  background: var(--brand-primary);
  color: #080c14;
  box-shadow: 0 0 10px var(--brand-glow);
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.auth-input {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: #ffffff;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease;
}
.auth-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px var(--brand-glow);
}

.auth-otp-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.auth-otp-box {
  width: 48px;
  height: 54px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--brand-primary);
  outline: none;
}
.auth-otp-box:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px var(--brand-glow);
}

/* Quick Amount Pills */
.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.amount-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-high);
  font-weight: 800;
  font-size: 13px;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.amount-pill:hover, .amount-pill.active {
  background: var(--brand-subtle);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

/* SBP QR Simulation Box */
.sbp-qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-md);
  margin-top: 4px;
}
.sbp-qr-container svg {
  width: 140px;
  height: 140px;
}
.sbp-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 800;
  color: #1a1a24;
}

/* Shift Plan Cards in Modal */
.shift-plans-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.shift-plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.18s ease;
}
.shift-plan-card:hover, .shift-plan-card.selected {
  border-color: var(--brand-primary);
  background: var(--bg-card-hover);
  box-shadow: 0 0 16px var(--brand-glow);
}
.shift-plan-name {
  font-weight: 800;
  font-size: var(--text-sm);
  color: var(--text-high);
}
.shift-plan-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.shift-plan-price {
  font-size: var(--text-lg);
  font-weight: 900;
  color: var(--brand-primary);
  text-align: right;
}


