@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&family=Sora:wght@500;700;800&display=swap');

:root {
  --bg: #f0f7fb;
  --card: #ffffff;
  --ink: #083146;
  --ink-soft: #35677f;
  --line: #d2e5f1;
  --blue: #0a86c8;
  --blue-strong: #07679a;
  --teal: #22b4c7;
  --green: #16834f;
  --red: #b93545;
  --amber: #b07613;
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 0%, #d7f4ff 0%, #f0f7fb 45%, #eaf3f8 100%);
}

a { color: var(--blue-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 12px; font-family: 'Sora', sans-serif; }
p { margin: 0 0 10px; color: var(--ink-soft); }

.container { width: min(1160px, 92vw); margin: 0 auto; }

.hero {
  min-height: 72vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 26px;
  padding: 52px 0 36px;
}
.hero h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.02; }
.hero .lead { font-size: 18px; max-width: 56ch; }

.hero-card {
  background: linear-gradient(150deg, #ffffff 0%, #dcf5ff 100%);
  border: 1px solid #b6e8fb;
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 20px 45px rgba(7, 51, 76, .12);
}
.pill {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: #085f8d;
  background: #d9f3ff;
  border: 1px solid #a3dcf9;
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 16px;
}

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.kpi .big { font: 800 28px 'Sora', sans-serif; color: #0c5a84; }
.kpi small { color: var(--ink-soft); }

.section { padding: 16px 0 40px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 8px 20px rgba(7, 64, 95, .06);
}

form .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
label { display: block; font-size: 13px; font-weight: 700; color: #25556e; margin-bottom: 6px; }
input, select, textarea, button {
  width: 100%;
  border: 1px solid #b8d8e8;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #bee7fb; border-color: #86cceb; }

button {
  cursor: pointer;
  background: linear-gradient(120deg, var(--blue) 0%, var(--teal) 100%);
  border: none;
  color: #fff;
  font-weight: 700;
}
button:hover { filter: brightness(.97); }

.btn-light {
  background: #ffffff;
  color: #1b4e67;
  border: 1px solid #b7d8ea;
}
.btn-danger { background: #c63c4d; }
.btn-warning { background: #b07819; }
.btn-success { background: #16834f; }

.topbar {
  background: rgba(255,255,255,.75);
  border-bottom: 1px solid #c8e3f2;
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; }
.brand-title { font: 800 23px 'Sora', sans-serif; color: #0d557e; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: linear-gradient(190deg, #07273a 0%, #0b4e6f 100%);
  border-right: 1px solid #1a678f;
  padding: 20px;
}
.brand { color: #dbf4ff; font: 800 24px 'Sora', sans-serif; margin-bottom: 16px; }
.user-badge { color: #bee8f9; font-size: 13px; margin-bottom: 12px; }
.nav-link {
  display: block;
  color: #def4ff;
  background: transparent;
  border: 1px solid rgba(178, 223, 243, .24);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.nav-link.active, .nav-link:hover {
  text-decoration: none;
  background: rgba(34, 180, 199, .26);
  border-color: rgba(178, 223, 243, .6);
}

.content { padding: 22px; overflow: auto; }
.content h1 { margin-bottom: 16px; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #d0e5f2;
  border-radius: 12px;
  overflow: hidden;
}
th, td { padding: 10px; border-bottom: 1px solid #e6f0f6; vertical-align: top; text-align: left; font-size: 13px; }
th { background: #f1f9fd; color: #25556e; font-weight: 700; }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 8px;
}
.badge.pending { background: #fff2d8; color: #7c560a; }
.badge.approved, .badge.active, .badge.paid { background: #dff7e8; color: #17683d; }
.badge.inactive { background: #f4eef9; color: #5c3c82; }
.badge.rejected, .badge.cancelled { background: #fde1e5; color: #8d2631; }
.badge.assigned, .badge.in_route { background: #dff0ff; color: #0a5d8c; }
.badge.delivered { background: #d8f8ee; color: #0f7446; }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-card {
  background: #fff;
  border: 1px solid #d4e7f3;
  border-radius: 12px;
  padding: 14px;
}
.stat-card .value { font: 800 28px 'Sora', sans-serif; color: #0d5b85; }

.flash {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 100;
  max-width: 360px;
  border-radius: 10px;
  padding: 12px;
  color: #fff;
  box-shadow: 0 12px 32px rgba(0,0,0,.2);
}
.flash-success { background: #14754a; }
.flash-error { background: #a63242; }
.flash-info { background: #16648f; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.login-card {
  width: min(430px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid #cfe5f1;
  box-shadow: 0 20px 52px rgba(0,0,0,.12);
  padding: 22px;
}

.metrics-bars .bar {
  margin-bottom: 10px;
}
.metrics-bars .bar > span {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: #2f6078;
}
.metrics-bars .line {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(100deg, #0b83c6, #24b7ca);
}

.check-panel {
  border: 1px solid #d5e8f3;
  border-radius: 10px;
  padding: 10px;
  background: #f9fdff;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin-bottom: 8px;
}
.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
}
.check-grid label input {
  width: auto;
  margin: 0;
}
.check-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
}
.check-item input {
  width: auto;
  margin: 0;
}
.driver-action-panel {
  padding: 8px;
  background: #f5fbff;
}
.driver-action-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 0;
  align-items: center;
  margin: 8px 0;
  border: 1px solid #c9deeb;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.driver-action-label {
  margin: 0;
  color: #24586f;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
  background: #edf6fc;
  border-right: 1px solid #d6e7f2;
}
.driver-action-control {
  min-width: 0;
  padding: 10px 12px;
}
.driver-action-control select {
  margin: 0;
}
.driver-action-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
  color: #1f526a;
}
.driver-action-check input {
  width: auto;
  margin: 0;
}
.driver-confirm-btn {
  margin: 10px 0 4px;
}

.table-check-cell {
  text-align: center;
  vertical-align: middle;
  min-width: 86px;
}
.table-check-cell input {
  width: auto;
  margin: 0;
}
.table-select-cell {
  min-width: 170px;
}
.table-save-cell {
  min-width: 140px;
}
.table-save-cell small {
  display: block;
  margin-top: 6px;
  color: #17683d;
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 40, 59, .55);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.modal-panel {
  width: min(880px, 96vw);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border: 1px solid #cfe5f1;
  border-radius: 12px;
  box-shadow: 0 22px 48px rgba(0,0,0,.22);
  padding: 12px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.modal-body table th,
.modal-body table td {
  font-size: 13px;
}

.shipment-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.shipment-card {
  border: 1px solid #d6e8f3;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
}
.shipment-card p { margin: 0 0 8px; }
.shipment-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.map-box { height: 430px; border: 1px solid #c8e1ee; border-radius: 12px; overflow: hidden; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .content { padding: 14px; }
  form .grid, .grid-3 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr; }
  .driver-action-row { grid-template-columns: 1fr; }
  .driver-action-label {
    border-right: 0;
    border-bottom: 1px solid #d6e7f2;
  }
  .shipment-head { flex-direction: column; align-items: flex-start; }
}
