:root {
  --bg: #f4efe7;
  --bg-strong: #e8dccb;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --text: #182028;
  --muted: #617183;
  --line: rgba(24, 32, 40, 0.12);
  --accent: #b1552f;
  --accent-deep: #7f3314;
  --accent-soft: #f6dfd2;
  --ok: #1e7a4d;
  --warn: #9f6a11;
  --shadow: 0 24px 50px rgba(46, 31, 18, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(177, 85, 47, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(69, 111, 148, 0.18), transparent 30%),
    linear-gradient(160deg, #fbf7f2, #efe5d8 55%, #f7f1ea);
}

body.mobile-menu-open {
  overflow: hidden;
}

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

[hidden] {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 520px);
  padding: 32px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.login-role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.login-role-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 800;
  cursor: pointer;
}

.login-role-btn.active {
  background: linear-gradient(135deg, rgba(240, 191, 143, 0.35), rgba(177, 85, 47, 0.3));
  border-color: rgba(177, 85, 47, 0.24);
  color: var(--accent-deep);
}

.login-submit-btn {
  min-height: 52px;
}

.login-helper-text,
.login-error {
  margin: 0;
  font-size: 0.88rem;
}

.login-helper-text {
  color: var(--muted);
}

.login-error {
  color: #ad392b;
  font-weight: 700;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  background: rgba(20, 27, 35, 0.9);
  color: #f5f1ea;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

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

.brand-logo-box {
  width: 82px;
  height: 82px;
  border-radius: 24px;
  overflow: hidden;
  flex: 0 0 82px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.brand-mark {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f0bf8f, #b1552f);
  color: #20130e;
  font-weight: 800;
}

#company-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-brand-chip {
  width: fit-content;
  min-width: 132px;
  height: 54px;
  padding: 8px 16px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(177, 85, 47, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(46, 31, 18, 0.08);
}

.hero-brand-chip img {
  max-width: 110px;
  max-height: 34px;
  object-fit: contain;
  display: block;
}

.hero-brand-chip span {
  font-family: "Fraunces", serif;
  font-weight: 700;
  color: var(--accent-deep);
  letter-spacing: 0.03em;
}

.brand h1,
.hero h2,
.section-head h3,
.trip-detail h3,
.empty-state h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--muted);
}

.sidebar .eyebrow {
  color: rgba(245, 241, 234, 0.65);
}

.nav {
  display: grid;
  gap: 10px;
}

.nav-link,
.primary-btn,
.secondary-btn {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.nav-link {
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: #f5f1ea;
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(240, 191, 143, 0.22), rgba(177, 85, 47, 0.3));
  box-shadow: inset 0 0 0 1px rgba(240, 191, 143, 0.25);
}

.session-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.session-panel strong {
  font-size: 1.05rem;
}

.session-role-copy {
  margin: 0;
  color: rgba(245, 241, 234, 0.78);
}

.session-logout-btn {
  justify-self: start;
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 24px;
}

.sidebar-panel {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.accent-panel {
  background: linear-gradient(160deg, rgba(177, 85, 47, 0.28), rgba(255, 255, 255, 0.08));
}

.logo-upload-field {
  margin-top: 16px;
}

.admin-logo-panel {
  margin-bottom: 20px;
}

.section-flash {
  animation: sectionFlash 1.6s ease;
}

@keyframes sectionFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(177, 85, 47, 0.34), var(--shadow);
    border-color: rgba(177, 85, 47, 0.18);
  }
  35% {
    box-shadow: 0 0 0 8px rgba(177, 85, 47, 0.14), 0 22px 40px rgba(46, 31, 18, 0.12);
    border-color: rgba(177, 85, 47, 0.45);
  }
  100% {
    box-shadow: var(--shadow);
    border-color: rgba(255, 255, 255, 0.5);
  }
}

.driver-form-helper {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.driver-form-photo-preview {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #f0bf8f, #d58b65);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  text-align: center;
  padding: 8px;
}

.driver-form-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: rgba(245, 241, 234, 0.82);
}

.feature-list li + li {
  margin-top: 8px;
}

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

.mobile-topbar,
.mobile-sidebar-overlay {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.driver-hero-logo-wrap {
  display: flex;
  align-items: center;
}

.hero h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.05;
  margin-bottom: 8px;
}

.hero-copy {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

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

.driver-account-badge {
  min-width: 220px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(177, 85, 47, 0.12);
}

.driver-account-badge span {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

.driver-account-badge strong {
  display: block;
  font-size: 1rem;
}

.inline-field,
label {
  display: grid;
  gap: 8px;
}

.inline-field span,
label span {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.field-note {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  padding: 12px 14px;
  color: var(--text);
}

textarea {
  resize: vertical;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.driver-profile-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}

.driver-photo {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, #f0bf8f, #d58b65);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}

.driver-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.driver-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.profile-item,
.profile-note {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
}

.profile-item span,
.profile-note span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.profile-note {
  margin-top: 14px;
}

.driver-profile-mobile {
  display: none;
}

.driver-profile-desktop {
  display: block;
}

.driver-profile-summary {
  display: flex;
  gap: 14px;
  align-items: center;
}

.driver-profile-mini-photo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, #f0bf8f, #d58b65);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  flex: 0 0 72px;
}

.driver-profile-mini-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.driver-profile-mini-info h3 {
  margin-bottom: 4px;
}

.driver-profile-mobile details {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
}

.driver-profile-mobile summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 800;
}

.driver-profile-mobile summary::-webkit-details-marker {
  display: none;
}

.driver-profile-mobile details[open] summary {
  border-bottom: 1px solid var(--line);
}

.driver-profile-mobile-body {
  padding: 14px 16px 16px;
  display: grid;
  gap: 12px;
}

.stat-card {
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.94), rgba(255, 247, 240, 0.82));
  border: 1px solid rgba(177, 85, 47, 0.12);
  box-shadow: var(--shadow);
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  margin-top: 6px;
}

.two-column {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 20px;
}

.payment-summary {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.payment-highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 6px;
}

.payment-highlight-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.payment-highlight-card span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.payment-highlight-card strong {
  font-size: 1rem;
}

.payment-dropdown {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

.payment-dropdown summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 800;
}

.payment-dropdown summary::-webkit-details-marker {
  display: none;
}

.payment-dropdown[open] summary {
  border-bottom: 1px solid var(--line);
}

#driver-payment-summary {
  padding: 14px 16px 16px;
}

.sidebar-dropdown {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.sidebar-dropdown summary {
  color: #f5f1ea;
}

.sidebar-dropdown[open] summary {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.sidebar-dropdown #driver-payment-summary {
  color: #f5f1ea;
}

.sidebar-dropdown .payment-month-label,
.sidebar-dropdown .payment-day-row,
.sidebar-dropdown .payment-total-row {
  color: #f5f1ea;
}

.sidebar-dropdown .payment-day-row,
.sidebar-dropdown .payment-total-row {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.sidebar-dropdown .payment-highlight-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.sidebar-dropdown .payment-highlight-card span,
.sidebar-dropdown .payment-highlight-card strong {
  color: #f5f1ea;
}

.sidebar-dropdown #driver-payment-summary {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 10px;
}

.sidebar-dropdown #driver-payment-summary::-webkit-scrollbar {
  width: 8px;
}

.sidebar-dropdown #driver-payment-summary::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.sidebar-dropdown #driver-payment-summary::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.payment-month-label {
  margin: 0 0 8px;
  color: var(--muted);
}

.payment-day-row,
.payment-total-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.payment-day-row.zero {
  opacity: 0.72;
}

.payment-total-row {
  margin-top: 6px;
  background: linear-gradient(145deg, #f5e7da, #fff8f3);
  font-weight: 800;
}


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

.section-head.small h4 {
  margin: 0;
}

.search-input {
  max-width: 280px;
}

.trip-list,
.roster-list,
.log-list,
.photo-grid,
.trip-history-list {
  display: grid;
  gap: 14px;
}

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

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

.trip-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 2px 2px;
}

.trip-date-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 2px 2px;
}

.trip-group-header strong {
  font-size: 1rem;
}

.trip-date-group-header strong {
  font-size: 1rem;
}

.trip-group-header span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.trip-date-group-header span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.trip-card,
.roster-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: var(--surface-strong);
}

.roster-card {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.roster-card:hover,
.roster-card.active {
  transform: translateY(-2px);
  box-shadow: 0 18px 35px rgba(46, 31, 18, 0.1);
  border-color: rgba(177, 85, 47, 0.25);
}

.trip-card {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.trip-card:hover,
.trip-card.active {
  transform: translateY(-2px);
  box-shadow: 0 18px 35px rgba(46, 31, 18, 0.1);
  border-color: rgba(177, 85, 47, 0.25);
}

.trip-card-top,
.roster-top,
.detail-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.detail-time-block {
  display: grid;
  gap: 8px;
}

.detail-time-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-subline {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}

.trip-card h4,
.roster-card h4 {
  margin: 4px 0;
}

.roster-photo {
  width: 72px;
  height: 72px;
  margin: 14px 0 12px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #f0bf8f, #d58b65);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.4rem;
}

.roster-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.history-card h5 {
  margin: 6px 0 4px;
  font-size: 1rem;
}

.history-card-edit-note {
  margin-top: 8px;
  font-size: 0.82rem;
  color: rgba(245, 241, 234, 0.7);
}

.admin-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.admin-detail-btn {
  min-height: 52px;
}

.admin-detail-btn.is-saving {
  background: linear-gradient(135deg, #8b9e4f, #5f7630);
  color: #fff;
  box-shadow: 0 14px 28px rgba(95, 118, 48, 0.22);
  cursor: wait;
}

.admin-detail-btn.is-success {
  background: linear-gradient(135deg, #2f9a65, #1e7a4d);
  color: #fff;
  box-shadow: 0 14px 28px rgba(30, 122, 77, 0.22);
}

.admin-detail-controls {
  margin-top: 20px;
}

.admin-detail-driver-field {
  display: grid;
  gap: 8px;
}

.admin-detail-driver-field span {
  font-weight: 700;
  color: var(--muted);
}

.admin-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.danger-btn {
  border: 0;
  border-radius: 14px;
  min-height: 52px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #b94a48, #8c2421);
  box-shadow: 0 14px 28px rgba(140, 36, 33, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.danger-btn:hover {
  transform: translateY(-1px);
}

.subtle {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.trip-mini-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.empty-state {
  min-height: 540px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.detail-panel {
  min-height: 540px;
}

.detail-screen-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.detail-screen-shell.open {
  display: block;
}

.detail-screen-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 20, 0.4);
}

.detail-screen-panel {
  position: relative;
  z-index: 1;
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  margin: 16px auto;
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,241,234,0.98));
  box-shadow: 0 24px 60px rgba(20, 27, 35, 0.24);
}

.detail-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.detail-readonly-note {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff4e8;
  border: 1px solid rgba(177, 85, 47, 0.18);
  color: var(--accent-deep);
  font-weight: 700;
}

.route-card {
  margin: 22px 0;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(145deg, #f5e7da, #fff8f3);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}

.route-summary-card {
  grid-template-columns: 1fr;
}

.route-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.route-arrow {
  font-size: 1.6rem;
  color: var(--accent);
}

.meta-grid,
.detail-sections,
.admin-grid,
.form-grid {
  display: grid;
  gap: 16px;
}

.address-list {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.address-card {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
}

.address-card span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.meta-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 20px;
}

.arrival-proof-card {
  margin-bottom: 20px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.arrival-proof-status {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.arrival-status-chip {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.84rem;
}

.arrival-status-chip.open {
  background: rgba(196, 132, 70, 0.15);
  color: #9c4624;
}

.arrival-status-chip.success {
  background: rgba(30, 122, 77, 0.14);
  color: #1e7a4d;
}

.arrival-status-chip.late {
  background: rgba(173, 57, 43, 0.12);
  color: #ad392b;
}

.arrival-proof-current {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.arrival-proof-summary {
  display: grid;
  gap: 12px;
}

.arrival-proof-summary p {
  margin: 0;
}

.arrival-proof-actions {
  display: grid;
  gap: 10px;
}

.meta-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
}

.meta-item span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 6px;
}

.flight-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed rgba(177, 85, 47, 0.45);
  padding-bottom: 2px;
}

.contact-link,
.flight-link:hover {
  color: var(--accent-deep);
  border-bottom-color: rgba(177, 85, 47, 0.85);
}

.contact-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed rgba(30, 122, 77, 0.45);
  padding-bottom: 2px;
}

.contact-link:hover {
  color: var(--ok);
  border-bottom-color: rgba(30, 122, 77, 0.85);
}

.map-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed rgba(51, 79, 180, 0.45);
  padding-bottom: 2px;
}

.map-link:hover {
  color: #334fb4;
  border-bottom-color: rgba(51, 79, 180, 0.85);
}

.detail-sections,
.admin-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: 20px;
}

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

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

.full-width {
  grid-column: 1 / -1;
}

.primary-btn,
.secondary-btn {
  padding: 13px 18px;
  border-radius: 14px;
  font-weight: 800;
}

.primary-btn {
  background: linear-gradient(135deg, #c56b3f, #9c4624);
  color: #fff;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border: 1px solid var(--line);
}

.admin-manage-drivers-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-btn:hover,
.secondary-btn:hover,
.nav-link:hover {
  transform: translateY(-1px);
}

.primary-btn.trip-save-btn {
  min-height: 52px;
  box-shadow: 0 14px 28px rgba(156, 70, 36, 0.18);
}

.primary-btn.create-trip-btn {
  min-height: 52px;
  box-shadow: 0 14px 28px rgba(156, 70, 36, 0.18);
}

.primary-btn.create-trip-btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 8px 18px rgba(156, 70, 36, 0.2);
}

.primary-btn.trip-save-btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 8px 18px rgba(156, 70, 36, 0.2);
}

.primary-btn.is-saving {
  background: linear-gradient(135deg, #8b9e4f, #5f7630);
  box-shadow: 0 14px 28px rgba(95, 118, 48, 0.22);
  cursor: wait;
  filter: saturate(0.95);
}

.primary-btn:disabled {
  opacity: 0.92;
}

.primary-btn.is-success {
  background: linear-gradient(135deg, #2f9a65, #1e7a4d);
  box-shadow: 0 14px 28px rgba(30, 122, 77, 0.22);
}

.log-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
}

.log-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.photo-card {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.photo-card img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.photo-card figcaption {
  padding: 10px 12px 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.proof-file-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.proof-file-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.proof-file-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.proof-file-link {
  color: var(--accent-deep);
  font-weight: 700;
  text-decoration: none;
}

.proof-file-link:hover {
  text-decoration: underline;
}

.arrival-submit-btn {
  min-height: 52px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.arrival-submit-btn:active {
  transform: translateY(1px) scale(0.99);
}

.arrival-submit-btn.is-saving {
  background: linear-gradient(135deg, #9da7b6, #6f7d91);
  color: #fff;
  box-shadow: 0 12px 24px rgba(111, 125, 145, 0.2);
  cursor: wait;
}

.arrival-submit-btn.is-success {
  background: linear-gradient(135deg, #2f9a65, #1e7a4d);
  color: #fff;
  box-shadow: 0 14px 28px rgba(30, 122, 77, 0.22);
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tiny-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 7px 10px;
  cursor: pointer;
}

.empty-inline {
  color: var(--muted);
  padding: 16px 0;
}

@media (max-width: 1200px) {
  .stats-grid,
  .two-column,
  .admin-grid,
  .detail-sections {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
  }

  .mobile-menu-button {
    border: 0;
    background: rgba(20, 27, 35, 0.92);
    color: #fff;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 800;
    cursor: pointer;
  }

  .mobile-topbar-brand span,
  .mobile-topbar-brand strong {
    display: block;
  }

  .mobile-topbar-brand span {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .mobile-topbar-brand strong {
    font-family: "Fraunces", serif;
    font-size: 1.1rem;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(86vw, 360px);
    height: 100vh;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    overflow-y: auto;
  }

  body.mobile-menu-open .sidebar {
    transform: translateX(0);
  }

  .mobile-sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 20, 0.45);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
  }

  body.mobile-menu-open .mobile-sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .hero,
  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-grid,
  .driver-profile-grid,
  .meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-grid,
  .form-grid,
  .detail-sections,
  .two-column {
    grid-template-columns: 1fr;
  }

  .driver-profile-card {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .driver-profile-desktop {
    display: none;
  }

  .driver-profile-mobile {
    display: block;
  }

  .driver-photo {
    display: none;
  }

  .stat-card {
    padding: 16px;
    min-height: 112px;
  }

  .stat-card strong {
    font-size: 1.7rem;
  }

  .hero {
    margin-bottom: 18px;
  }

  .hero h2 {
    font-size: 2.2rem;
  }

  .hero-brand-chip {
    min-width: 0;
    max-width: 220px;
    height: 50px;
    padding: 8px 14px;
  }

  .trip-card,
  .panel {
    border-radius: 24px;
    min-width: 0;
    max-width: 100%;
  }

  .route-card {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .route-arrow {
    display: none;
  }

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

  .feature-list,
  .accent-panel {
    display: none;
  }

  .stats-grid {
    display: none;
  }

  .search-input {
    max-width: none;
  }

  .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 640px) {
  .detail-screen-panel {
    width: 100vw;
    max-height: 100vh;
    margin: 0;
    min-height: 100vh;
    border-radius: 0;
    padding: 18px;
  }

  .main-content {
    padding: 18px;
  }

  body {
    overflow-x: hidden;
  }

  .stats-grid,
  .driver-profile-grid,
  .form-grid,
  .meta-grid,
  .payment-highlight-grid {
    grid-template-columns: 1fr;
  }

  .hero h2 {
    font-size: 2rem;
  }

  .trip-card-top,
  .detail-top {
    flex-direction: column;
    align-items: stretch;
  }

  .status-pill {
    width: fit-content;
  }

  .trip-date-group-header {
    display: grid;
    align-items: start;
  }

  .admin-edit-grid,
  .admin-detail-actions {
    grid-template-columns: 1fr;
  }

  .mobile-topbar {
    gap: 10px;
  }

  .mobile-topbar-brand strong {
    font-size: 1rem;
  }

  .mobile-topbar-brand span {
    font-size: 0.75rem;
  }
}
