:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #667085;
  --line: #d9dee8;
  --soft-line: #edf0f5;
  --surface: #ffffff;
  --page: #f4f7fb;
  --nav: #14202b;
  --nav-soft: #203142;
  --blue: #2364d2;
  --green: #15835f;
  --amber: #b76e00;
  --red: #c43b3b;
  --teal: #0b7285;
  --shadow: 0 20px 60px rgba(25, 37, 54, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

.check-option {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
  color: var(--ink);
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.is-hidden {
  display: none !important;
}

.login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(20, 32, 43, 0.92), rgba(11, 114, 133, 0.82)),
    url("https://images.unsplash.com/photo-1487754180451-c456f719a1fc?auto=format&fit=crop&w=1600&q=80") center / cover;
}

.boot-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 22px;
  background: var(--nav);
}

.boot-card {
  border-radius: 8px;
  background: #fff;
  padding: 22px;
  box-shadow: var(--shadow);
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  border-radius: 8px;
  background: #fff;
  padding: 26px;
  box-shadow: var(--shadow);
}

.login-brand {
  color: var(--ink);
}

.login-brand span,
.login-hint {
  color: var(--muted);
}

.login-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: var(--nav);
  color: #f7f9fc;
  padding: 24px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 32, 43, 0.08);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.sidebar-footer span {
  color: #b8c5d4;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #e7edf5;
  padding: 10px 12px;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: var(--nav-soft);
}

.icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #78d5c9;
  flex: 0 0 24px;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.2;
}

.topbar-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

.search-box {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

input:focus,
select:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(35, 100, 210, 0.16);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 9px 14px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  background: var(--blue);
  color: #fff;
}

.secondary-button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost-button {
  border-color: rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #fff;
}

.danger-button {
  border-color: #ffd5d5;
  background: #fff6f6;
  color: var(--red);
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.reception-metrics {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.report-metrics {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.metric-card,
.panel {
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
  min-width: 0;
}

.metric-card-wide {
  grid-column: span 2;
}

.metric-card-center {
  display: grid;
  justify-items: center;
  text-align: center;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 30px;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.content-grid {
  display: grid;
  gap: 18px;
}

.dashboard-wide {
  margin-top: 18px;
}

.report-filter-panel {
  margin-bottom: 18px;
}

.compact-records {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-and-list {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  align-items: start;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.form-panel {
  position: sticky;
  top: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.form-grid.single-column {
  grid-template-columns: 1fr;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.wide {
  grid-column: 1 / -1;
}

.record-list,
.timeline,
.alert-list,
.report-bars {
  display: grid;
  gap: 10px;
}

.record,
.timeline-item,
.alert-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 13px;
}

.record h3,
.timeline-item h3,
.alert-item h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.record p,
.timeline-item p,
.alert-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eaf2ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.status.ok {
  background: #e7f7f0;
  color: var(--green);
}

.status.warn {
  background: #fff3dc;
  color: var(--amber);
}

.status.danger {
  background: #ffe9e9;
  color: var(--red);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.attachment-list {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 40px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 12px;
}

.attachment-list a {
  overflow-wrap: anywhere;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebf2;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2364d2, #0b7285);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 32px));
  transform: translateY(20px);
  border-radius: 8px;
  background: #17212e;
  color: #fff;
  padding: 12px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(20, 32, 43, 0.58);
  padding: 18px;
}

.modal-panel {
  display: grid;
  gap: 16px;
  width: min(720px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow);
}

.password-modal {
  width: min(460px, 100%);
}

.settlement-summary,
.settlement-total {
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.settlement-summary span,
.settlement-total span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settlement-summary strong,
.settlement-total strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.settlement-summary small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

.settlement-total {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.mobile-driver-shell {
  display: grid;
  gap: 14px;
  max-width: 680px;
}

.mobile-driver-panel {
  box-shadow: 0 12px 34px rgba(25, 37, 54, 0.1);
}

.mobile-context,
.mobile-form,
.mobile-message {
  display: grid;
  gap: 12px;
}

.mobile-message {
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.mobile-message strong {
  font-size: 18px;
}

.mobile-message p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.mobile-record .primary-button,
.mobile-form .primary-button {
  width: 100%;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 14px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sidebar-footer {
    display: none;
  }

  .metrics-grid,
  .compact-records,
  .two-columns,
  .form-and-list {
    grid-template-columns: 1fr;
  }

  .form-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .workspace {
    padding: 18px 14px;
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .settlement-total {
    grid-template-columns: 1fr;
  }

  .record,
  .timeline-item,
  .alert-item {
    grid-template-columns: 1fr;
  }

  .record-actions {
    justify-content: flex-start;
  }
}
