:root {
  color-scheme: dark;
  --bg: #061423;
  --surface: rgba(9, 31, 51, 0.88);
  --surface-2: #0d2942;
  --line: rgba(187, 218, 235, 0.16);
  --text: #f4f9fc;
  --muted: #9eb4c3;
  --brand: #39d9c5;
  --brand-strong: #12ad9d;
  --danger: #ff7c87;
  --warning: #ffc46b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 85% 8%, rgba(20, 173, 157, 0.24), transparent 34rem),
    radial-gradient(circle at 10% 90%, rgba(24, 92, 143, 0.28), transparent 35rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
a { color: inherit; }

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  color: #05231f;
  background: linear-gradient(135deg, #74f3e3, #20b9a7);
  box-shadow: 0 10px 30px rgba(32, 185, 167, 0.25);
}

.brand span { color: var(--brand); }

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #04211d;
  background: var(--brand);
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.button:hover { transform: translateY(-1px); background: #5de4d4; }
.button:disabled { cursor: not-allowed; opacity: 0.65; transform: none; }
.button-secondary { color: var(--text); border-color: var(--line); background: rgba(255,255,255,.04); }
.button-secondary:hover { background: rgba(255,255,255,.08); }
.button-danger { color: white; background: #c8394c; }
.button-danger:hover { background: #dd4c60; }

.hero {
  display: grid;
  min-height: calc(100vh - 80px);
  align-items: center;
  padding: 50px 0 100px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.6rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.hero h1 span { color: var(--brand); }
.hero-copy { max-width: 760px; margin: 28px 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.3rem); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 46px; }
.tag { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: #c7d7e1; font-size: .82rem; }

.auth-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
}

.auth-story {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px clamp(28px, 7vw, 96px);
}

.auth-story-copy { margin: auto 0; max-width: 650px; }
.auth-story h1 { margin: 0; font-size: clamp(3rem, 6vw, 6rem); line-height: 1; letter-spacing: -.055em; }
.auth-story h1 span { color: var(--brand); }
.auth-story p { max-width: 580px; color: var(--muted); font-size: 1.1rem; }

.auth-panel {
  display: grid;
  place-items: center;
  padding: 28px;
  border-left: 1px solid var(--line);
  background: rgba(2, 13, 24, 0.42);
  backdrop-filter: blur(14px);
}

.card {
  width: min(450px, 100%);
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card h2 { margin: 0; font-size: 1.75rem; letter-spacing: -.035em; }
.card-subtitle { margin: 8px 0 26px; color: var(--muted); }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { color: #d9e6ee; font-size: .88rem; font-weight: 700; }
.field input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: #071b2d;
}
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(57,217,197,.12); }
.card .button { width: 100%; }
.message { min-height: 24px; margin: 14px 0 0; color: var(--muted); font-size: .9rem; }
.message.error { color: var(--danger); }
.message.success { color: var(--brand); }
.password-rules { margin: -5px 0 20px; padding-left: 20px; color: var(--muted); font-size: .82rem; }
.hidden { display: none !important; }

.dashboard-page { min-height: 100vh; background: #071522; }
.dashboard-layout { display: grid; min-height: 100vh; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { padding: 26px 20px; border-right: 1px solid var(--line); background: #06111d; }
.sidebar .brand { margin-bottom: 38px; }
.nav-label { margin: 24px 12px 8px; color: #6f899b; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; margin: 4px 0; border-radius: 10px; color: #9fb4c3; text-decoration: none; }
.nav-item.active { color: var(--text); background: rgba(57,217,197,.11); }
.dashboard-main { padding: 24px clamp(22px, 4vw, 52px) 50px; overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.topbar h1 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.25rem); letter-spacing: -.04em; }
.user-chip { color: var(--muted); font-size: .9rem; text-align: right; }
.user-chip strong { display: block; color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat, .panel { border: 1px solid var(--line); border-radius: 18px; background: #0a1e31; }
.stat { padding: 22px; }
.stat span { color: var(--muted); font-size: .82rem; }
.stat strong { display: block; margin-top: 10px; font-size: 2rem; }
.dashboard-grid { display: grid; grid-template-columns: 1.45fr .8fr; gap: 16px; margin-top: 16px; }
.panel { padding: 22px; overflow: hidden; }
.panel h2 { margin: 0 0 18px; font-size: 1.05rem; }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.module { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); }
.module strong { display: block; }
.module span { color: var(--muted); font-size: .8rem; }
.status-line { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 18px var(--brand); }

.management-main { overflow: visible; }
.page-intro { max-width: 680px; margin: 8px 0 0; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.compact-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 880px; }
.management-panel { margin-top: 18px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-heading h2 { margin-bottom: 2px; }
.panel-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: .9rem; }
.toolbar { display: flex; gap: 10px; margin: 22px 0 14px; }
.toolbar label { display: block; }
.search-field { flex: 1; }
.toolbar input, .toolbar select, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: #071b2d;
}
.toolbar input, .toolbar select { height: 44px; padding: 0 13px; }
.toolbar select { min-width: 160px; }
.toolbar input:focus, .toolbar select:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(57,217,197,.12);
}
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: #7895a8; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
td { color: #d8e6ee; font-size: .86rem; }
td strong, td span { display: block; }
td small { display: block; margin-top: 3px; color: var(--muted); font-size: .74rem; }
tbody tr { transition: background 140ms ease; }
tbody tr:hover, .selected-row { background: rgba(57,217,197,.055); }
.address-cell { max-width: 320px; white-space: normal; }
.empty-state { padding: 30px 12px; color: var(--muted); text-align: center; }
.status-badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .04em; }
.status-active { color: #6eeee0; background: rgba(57,217,197,.11); }
.status-inactive { color: #b5c1c9; background: rgba(181,193,201,.1); }
.status-suspended { color: var(--warning); background: rgba(255,196,107,.11); }
.table-actions { display: flex; justify-content: flex-end; gap: 6px; }
.table-action { padding: 7px 10px; border: 1px solid rgba(57,217,197,.25); border-radius: 8px; color: var(--brand); background: rgba(57,217,197,.06); cursor: pointer; }
.table-action.secondary { color: #b9cbd6; border-color: var(--line); background: transparent; }
.form-dialog { width: min(820px, calc(100% - 24px)); max-height: calc(100vh - 30px); padding: 0; border: 1px solid var(--line); border-radius: 22px; color: var(--text); background: #0a1e31; box-shadow: var(--shadow); }
.form-dialog::backdrop { background: rgba(1, 8, 15, .76); backdrop-filter: blur(5px); }
.form-dialog form { padding: 24px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.dialog-heading h2 { margin: 0; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: rgba(255,255,255,.04); font-size: 1.5rem; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.field-wide { grid-column: 1 / -1; }
.field textarea { min-height: 72px; padding: 12px 14px; resize: vertical; }
.field select { height: 50px; padding: 0 14px; }
.field > span { color: #d9e6ee; font-size: .88rem; font-weight: 700; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mobile-nav { display: none; }

.travel-assistant { position: fixed; right: 22px; bottom: 22px; z-index: 1000; }
.assistant-toggle { display: flex; align-items: center; gap: 9px; min-height: 50px; padding: 0 17px; border: 1px solid rgba(110,238,224,.32); border-radius: 999px; color: #04211d; background: var(--brand); box-shadow: 0 16px 50px rgba(0,0,0,.38); font-weight: 800; cursor: pointer; }
.assistant-toggle > span:first-child { font-size: 1.45rem; }
.assistant-panel { position: absolute; right: 0; bottom: 62px; display: flex; width: min(390px, calc(100vw - 28px)); height: min(600px, calc(100vh - 110px)); flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #091d30; box-shadow: 0 26px 80px rgba(0,0,0,.58); }
.assistant-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 17px; border-bottom: 1px solid var(--line); background: #0b253b; }
.assistant-header strong, .assistant-header small { display: block; }
.assistant-header small { color: var(--muted); }
.assistant-close { width: 34px; height: 34px; border: 0; border-radius: 9px; color: var(--text); background: rgba(255,255,255,.06); font-size: 1.35rem; cursor: pointer; }
.assistant-messages { display: flex; flex: 1; flex-direction: column; gap: 9px; padding: 16px; overflow-y: auto; }
.assistant-message { align-self: flex-start; max-width: 88%; margin: 0; padding: 10px 12px; border-radius: 14px 14px 14px 4px; color: #dceaf1; background: #102c45; font-size: .86rem; }
.assistant-message.user { align-self: flex-end; border-radius: 14px 14px 4px 14px; color: #05231f; background: var(--brand); }
.assistant-message.system { color: var(--muted); background: rgba(255,255,255,.035); font-size: .76rem; }
.assistant-destination { display: grid; gap: 5px; padding: 0 16px 10px; color: var(--muted); font-size: .72rem; }
.assistant-destination select { width: 100%; height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #071827; }
.assistant-location { margin: 0 16px 5px; min-height: 44px; border: 0; border-radius: 11px; color: #04211d; background: var(--brand); font-weight: 800; cursor: pointer; }
.assistant-location:disabled { cursor: wait; opacity: .65; }
.assistant-privacy { margin: 2px 18px 10px; color: #7895a8; font-size: .69rem; text-align: center; }
.assistant-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #081827; }
.assistant-form input { min-width: 0; height: 44px; flex: 1; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; outline: none; color: var(--text); background: #061522; }
.assistant-form input:focus { border-color: var(--brand); }
.assistant-form button { padding: 0 13px; border: 0; border-radius: 10px; color: #04211d; background: var(--brand); font-weight: 800; cursor: pointer; }

.fleet-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: none; }
.fleet-selector { max-width: 620px; margin-top: 22px; }
.fleet-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mobile-record-list { display: grid; gap: 10px; margin-top: 18px; }
.mobile-record { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); }
.mobile-record strong, .mobile-record span, .mobile-record small { display: block; }
.mobile-record span { margin-top: 3px; color: #c5d6df; font-size: .84rem; }
.mobile-record small { margin-top: 5px; color: var(--muted); }
.compact-dialog { width: min(560px, calc(100% - 24px)); }

.share-page { min-height: 100vh; padding: max(18px, env(safe-area-inset-top)) 16px max(30px, env(safe-area-inset-bottom)); }
.share-shell { width: min(720px, 100%); margin: 0 auto; }
.share-brand { display: flex; align-items: center; gap: 12px; margin: 10px 0 26px; font-size: 1.1rem; }
.share-brand span { color: var(--brand); }
.notification-gate, .travel-card { padding: clamp(22px, 6vw, 38px); border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.notification-gate h1, .travel-card h1 { margin: 0; font-size: clamp(1.8rem, 7vw, 2.8rem); line-height: 1.05; letter-spacing: -.045em; }
.notification-gate > p:not(.eyebrow) { color: var(--muted); }
.travel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.trip-code { color: var(--muted); }
.route-card { display: grid; gap: 12px; margin: 24px 0; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: #071827; }
.route-card small, .route-card strong, .route-card span { display: block; }
.route-card small, .share-grid small, .identity-card small { color: var(--muted); }
.route-card span { color: #adc1cd; font-size: .84rem; }
.route-line { width: 2px; height: 24px; margin-left: 5px; background: linear-gradient(var(--brand),#2f6b91); }
.share-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.share-grid article { padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
.share-grid strong { display: block; margin-top: 4px; }
#audience-details { margin-top: 26px; }
#audience-details h2 { font-size: 1.05rem; }
.identity-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; }
.identity-card strong, .identity-card span { display: block; }
.identity-card span { color: var(--muted); font-size: .82rem; }
.share-call { min-height: 40px; padding: 0 14px; white-space: nowrap; }
.detail-line { padding: 12px 14px; border-left: 3px solid var(--brand); color: #c8dae3; background: rgba(57,217,197,.045); }
.share-note { margin-top: 25px; color: #7895a8; font-size: .75rem; }
.status-assigned { color: #8cd5ff; background: rgba(76,174,229,.12); }
.status-in-progress { color: var(--warning); background: rgba(255,196,107,.11); }
.status-completed { color: var(--brand); background: rgba(57,217,197,.11); }
.status-cancelled, .status-no-show { color: var(--danger); background: rgba(255,124,135,.1); }
.operations-filter { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.operations-filter .filter-grid { display: grid; flex: 1; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.operations-filter .field { margin: 0; }
.operations-stats { grid-template-columns: repeat(5,minmax(0,1fr)); }
.operations-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.operations-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.record-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.record-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.table-action.danger { color: var(--danger); border-color: rgba(255,124,135,.3); }
.incident-critical { border-color: rgba(255,124,135,.55); box-shadow: inset 3px 0 var(--danger); }
.incident-high { border-color: rgba(255,196,107,.42); box-shadow: inset 3px 0 var(--warning); }
.secret-code { display: block; margin: 16px 0; padding: 14px; overflow-wrap: anywhere; border: 1px dashed var(--brand); border-radius: 12px; color: var(--brand); background: #061522; font-size: 1rem; letter-spacing: .08em; }
.fallback-box { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.sos-button { width: 100%; margin-top: 24px; }
.driver-duty-shell { width: min(900px, 100%); margin: 0 auto; padding: 24px; display: grid; gap: 18px; }
.driver-duty-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.duty-indicator { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.duty-indicator span { width: 12px; height: 12px; border-radius: 50%; background: currentColor; box-shadow: 0 0 18px currentColor; }
.duty-on { color: #62ead5; background: rgba(54,214,196,.12); }
.duty-off { color: #ff9b9b; background: rgba(255,100,100,.1); }
.driver-duty-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-story { min-height: 40vh; }
  .auth-panel { border-top: 1px solid var(--line); border-left: 0; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .mobile-nav { display: flex; gap: 8px; margin-bottom: 20px; }
  .mobile-nav { max-width: 100%; overflow-x: auto; }
  .mobile-nav a { padding: 8px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; }
  .mobile-nav a.active { color: var(--text); background: rgba(57,217,197,.11); }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 28px, 1180px); }
  .site-header { min-height: 68px; }
  .hero { min-height: calc(100vh - 68px); padding-top: 20px; }
  .hero h1 { font-size: clamp(2.75rem, 15vw, 4.4rem); }
  .auth-story { display: none; }
  .auth-panel { min-height: 100vh; padding: 16px; }
  .card { padding: 24px 20px; }
  .dashboard-main { padding: 20px 14px 40px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 16px; }
  .stat strong { font-size: 1.55rem; }
  .module-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
  .topbar-actions { align-items: flex-end; flex-direction: column; }
  .compact-stats { grid-template-columns: 1fr 1fr; }
  .compact-stats .stat:last-child { grid-column: 1 / -1; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .toolbar { flex-direction: column; }
  .toolbar select { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-dialog form { padding: 20px 16px; }
  .travel-assistant { right: 14px; bottom: 14px; }
  .assistant-toggle > span:last-child { display: none; }
  .assistant-toggle { width: 52px; padding: 0; justify-content: center; }
  .assistant-panel { bottom: 62px; }
  .fleet-columns { grid-template-columns: 1fr; }
  .fleet-stats { grid-template-columns: 1fr 1fr; }
  .mobile-record { align-items: flex-start; flex-direction: column; }
  .mobile-record .table-action { width: 100%; }
  .travel-heading { flex-direction: column; }
  .operations-filter { align-items: stretch; flex-direction: column; }
  .operations-filter .filter-grid { grid-template-columns: 1fr; width: 100%; }
  .operations-stats { grid-template-columns: 1fr 1fr; }
  .operations-stats .stat:last-child { grid-column: 1 / -1; }
  .operations-grid { grid-template-columns: 1fr; }
  .record-actions { width: 100%; justify-content: flex-start; }
  .driver-duty-shell { padding: 14px; }
  .driver-duty-hero { align-items: flex-start; flex-direction: column; }
}
