:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #657282;
  --line: #d9e0e7;
  --panel: #ffffff;
  --page: #f5f7f4;
  --green: #1f7a59;
  --green-dark: #14523d;
  --gold: #b46f13;
  --red: #b03232;
  --blue: #276a9f;
  --charcoal: #26313b;
  --shadow: 0 14px 38px rgba(23, 33, 43, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  background: #17212b;
  color: #f8fbff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f0bc4a;
  color: #17212b;
  font-weight: 800;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.modal-head h3,
.modal-head p {
  margin: 0;
}

.brand h1 {
  font-size: 21px;
}

.brand p {
  color: #bbc7d3;
  font-size: 13px;
  margin-top: 4px;
}

.role-tabs {
  display: grid;
  gap: 10px;
}

.role-tab {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #f8fbff;
  border-radius: 8px;
  min-height: 46px;
  text-align: left;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.role-tab.active {
  background: #f8fbff;
  color: #17212b;
}

.icon {
  width: 24px;
  text-align: center;
}

.session-card {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.session-text {
  margin: 0;
  color: #bbc7d3;
  font-size: 13px;
}

.session-user {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.session-user span {
  color: #bbc7d3;
  font-size: 13px;
}

.sidebar-button {
  width: 100%;
  margin-top: 10px;
}

label,
.field-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

.session-card select {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

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

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

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

.topbar h2 {
  font-size: 28px;
  margin-top: 4px;
}

.hero-strip {
  min-height: 116px;
  background: #e9f0ec;
  border: 1px solid #d4dfd8;
  border-radius: 8px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  margin-bottom: 22px;
}

.hero-copy {
  display: grid;
  gap: 8px;
}

.hero-copy strong {
  font-size: 21px;
}

.hero-copy span {
  color: var(--muted);
}

.vehicle-visual {
  position: relative;
  width: 220px;
  height: 78px;
  flex: 0 0 auto;
}

.truck-body,
.truck-cab,
.truck-wheel {
  position: absolute;
}

.truck-body {
  right: 20px;
  top: 14px;
  width: 140px;
  height: 44px;
  border-radius: 6px;
  background: #28705a;
  box-shadow: inset 0 -10px rgba(0, 0, 0, 0.08);
}

.truck-cab {
  left: 20px;
  top: 24px;
  width: 64px;
  height: 34px;
  border-radius: 6px 14px 6px 6px;
  background: #e0a12c;
}

.truck-wheel {
  bottom: 4px;
  width: 24px;
  height: 24px;
  background: #1e2933;
  border: 5px solid #edf2f4;
  border-radius: 50%;
}

.wheel-left {
  left: 48px;
}

.wheel-right {
  right: 42px;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

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

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

.stat-card {
  padding: 18px;
}

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

.stat-card strong {
  display: block;
  font-size: 30px;
  margin-top: 6px;
}

.filters,
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.panel {
  padding: 18px;
}

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

.panel h3,
.trip-card h3 {
  margin: 0;
  font-size: 18px;
}

.login-panel {
  max-width: 520px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.form-message {
  margin: 0;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}

.trip-list {
  display: grid;
  gap: 12px;
}

.trip-card {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.trip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef2f5;
  color: var(--charcoal);
  font-size: 12px;
  font-weight: 800;
}

.badge.green {
  background: #dff1e9;
  color: var(--green-dark);
}

.badge.gold {
  background: #f7ead2;
  color: #7a4c0d;
}

.badge.red {
  background: #f5dddd;
  color: var(--red);
}

.badge.blue {
  background: #dcecf8;
  color: var(--blue);
}

.trip-note {
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

.trip-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 260px;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 13px;
  font-weight: 800;
}

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

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

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

.icon-button {
  width: 38px;
  padding: 0;
  background: #fff;
  border-color: var(--line);
  font-size: 24px;
  line-height: 1;
}

.photo-proof {
  width: 104px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.admin-list,
.compact-list {
  display: grid;
  gap: 10px;
}

.list-row {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-row span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(23, 33, 43, 0.45);
}

.modal-card {
  width: min(520px, calc(100vw - 28px));
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-actions {
  justify-content: flex-end;
}

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

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

  .sidebar {
    position: static;
  }

  .role-tabs,
  .stats-grid,
  .filters,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .hero-strip,
  .trip-card,
  .list-row {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar,
  .hero-strip,
  .trip-card {
    display: grid;
  }

  .vehicle-visual {
    width: 180px;
  }

  .role-tabs,
  .stats-grid,
  .filters,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .trip-actions {
    justify-content: flex-start;
    max-width: none;
  }
}
