/* ===== Brand settings: change colors here later ===== */
:root {
  --primary: #0B2545;
  --accent: #F77F00;
  --accent-dark: #d96c00;
  --light: #f4f6fa;
  --text: #222;
  --muted: #667085;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: Arial, Helvetica, sans-serif; color: var(--text); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
.container { width: 90%; max-width: 1150px; margin: auto; }

/* ===== Buttons ===== */
.btn {
  display: inline-block; padding: 10px 22px; border-radius: 6px;
  font-weight: bold; border: 2px solid var(--accent); cursor: pointer;
  background: var(--accent); color: #fff; font-size: 15px;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }

/* ===== Top bar ===== */
.topbar { background: var(--primary); color: #cfd8e6; font-size: 13px; padding: 6px 0; }
.topbar .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }

/* ===== Header ===== */
header { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08); position: sticky; top: 0; z-index: 100; }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.logo { font-size: 24px; font-weight: bold; color: var(--primary); }
.logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 24px; list-style: none; }
.nav-links a { font-weight: 600; color: var(--primary); }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.menu-toggle { display: none; font-size: 28px; background: none; border: none; cursor: pointer; color: var(--primary); }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(rgba(11,37,69,.85), rgba(11,37,69,.85)),
              url('https://images.unsplash.com/photo-1601584115197-04ecc0da31d7?w=1600') center/cover;
  color: #fff; padding: 90px 0; text-align: center;
}
.hero h1 { font-size: 44px; margin-bottom: 14px; }
.hero p { font-size: 18px; max-width: 650px; margin: 0 auto 30px; color: #dbe4f0; }
.track-box { display: flex; max-width: 560px; margin: auto; background: #fff; border-radius: 8px; overflow: hidden; }
.track-box input { flex: 1; border: none; padding: 16px; font-size: 16px; outline: none; }
.track-box button { border: none; background: var(--accent); color: #fff; padding: 0 28px; font-weight: bold; cursor: pointer; font-size: 16px; }
.track-box button:hover { background: var(--accent-dark); }

/* ===== Sections ===== */
section { padding: 70px 0; }
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 32px; color: var(--primary); }
.section-title p { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.card { background: #fff; padding: 28px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.08); text-align: center; }
.card .icon { font-size: 40px; margin-bottom: 10px; }
.card h3 { color: var(--primary); margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15px; }
.bg-light { background: var(--light); }

.stats { background: var(--primary); color: #fff; padding: 50px 0; }
.stats .grid { text-align: center; }
.stats h3 { font-size: 36px; color: var(--accent); }

.cta { background: var(--accent); color: #fff; text-align: center; padding: 50px 0; }
.cta h2 { margin-bottom: 14px; }
.cta .btn { background: #fff; color: var(--accent); border-color: #fff; }

/* ===== Footer ===== */
footer { background: #071a30; color: #b8c4d6; padding: 55px 0 0; }
.footer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
footer h4 { color: #fff; margin-bottom: 14px; }
footer ul { list-style: none; }
footer li { margin-bottom: 8px; font-size: 14px; }
footer a:hover { color: var(--accent); }
.copyright { text-align: center; border-top: 1px solid #1c3250; margin-top: 35px; padding: 18px 0; font-size: 13px; }

/* ===== Welcome popup ===== */
.popup-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: none; align-items: center; justify-content: center; z-index: 999;
}
.popup-overlay.show { display: flex; }
.popup {
  background: #fff; max-width: 440px; width: 90%; padding: 36px 30px;
  border-radius: 12px; text-align: center; position: relative;
  animation: pop .35s ease;
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.popup h2 { color: var(--primary); margin-bottom: 10px; }
.popup p { color: var(--muted); margin-bottom: 20px; }
.popup-close { position: absolute; top: 10px; right: 16px; font-size: 28px; background: none; border: none; cursor: pointer; color: #888; }

/* ===== Mobile ===== */
@media (max-width: 800px) {
  .menu-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; flex-direction: column; padding: 20px; gap: 16px;
    box-shadow: 0 6px 10px rgba(0,0,0,.1);
  }
  .nav-links.open { display: flex; }
  .hero h1 { font-size: 30px; }
}
/* ===== Inner page banner ===== */
.page-hero { background: var(--primary); color: #fff; text-align: center; padding: 55px 0; }
.page-hero h1 { font-size: 36px; }
.page-hero p { color: #cfd8e6; }

/* ===== Two-column layout ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.two-col img { border-radius: 10px; }
.two-col h2 { color: var(--primary); margin-bottom: 12px; }
.two-col p { margin-bottom: 12px; color: var(--muted); }
.check-list { list-style: none; margin-top: 10px; }
.check-list li { margin-bottom: 8px; }
.check-list li::before { content: "✔ "; color: var(--accent); font-weight: bold; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--primary); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px; border: 1px solid #cfd6e0; border-radius: 6px;
  font-size: 15px; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.form-box { background: #fff; padding: 30px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.alert { padding: 12px; border-radius: 6px; margin-bottom: 16px; display: none; }
.alert.success { background: #e6f6ec; color: #1a7a3e; display: block; }
.alert.error { background: #fdeaea; color: #b42318; display: block; }

/* ===== Contact info ===== */
.info-item { display: flex; gap: 14px; margin-bottom: 20px; }
.info-item .icon { font-size: 26px; }
.info-item h4 { color: var(--primary); }
.info-item p { color: var(--muted); margin: 0; }
.map-frame { width: 100%; height: 320px; border: 0; border-radius: 10px; margin-top: 20px; }

@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
/* ===== Login / Register pages ===== */
.auth-wrap { max-width: 460px; margin: 50px auto; }
.auth-wrap h2 { color: var(--primary); margin-bottom: 6px; }
.auth-wrap .sub { color: var(--muted); margin-bottom: 20px; }
.auth-wrap .btn { width: 100%; }
.auth-switch { text-align: center; margin-top: 16px; color: var(--muted); }
.auth-switch a { color: var(--accent); font-weight: bold; }
/* ===== Tracking ===== */
.page-hero .track-box { margin-top: 20px; }
.result-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 28px; align-items: start; }
#map { height: 420px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.map-note { color: var(--muted); font-size: 14px; margin-top: 8px; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: bold; background: #e5e7eb; color: #374151; }
.badge.pending { background: #fff4e0; color: #b45309; }
.badge.in-transit, .badge.out-for-delivery { background: #e0edff; color: #1d4ed8; }
.badge.delivered { background: #e6f6ec; color: #1a7a3e; }
.badge.delayed { background: #fdeaea; color: #b42318; }

.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef0f4; font-size: 15px; }
.detail-row span:first-child { color: var(--muted); }
.detail-row span:last-child { text-align: right; font-weight: 600; }

.timeline { list-style: none; margin-top: 14px; border-left: 3px solid #e1e5ec; padding-left: 18px; }
.timeline li { position: relative; margin-bottom: 16px; }
.timeline li::before { content: ""; position: absolute; left: -26px; top: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); }
.timeline strong { color: var(--primary); }
.timeline small { display: block; color: var(--muted); }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
table.data th, table.data td { padding: 12px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid #eef0f4; }
table.data th { background: var(--primary); color: #fff; }
table.data a { color: var(--accent); font-weight: bold; }

@media (max-width: 800px) { .result-grid { grid-template-columns: 1fr; } }

/* ===== Admin area ===== */
.admin-bar { background: var(--primary); color: #fff; position: sticky; top: 0; z-index: 100; }
.admin-bar .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 0; }
.admin-bar .logo { color: #fff; font-size: 20px; }
.admin-links { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.admin-links a { color: #cfd8e6; padding: 8px 14px; border-radius: 6px; font-weight: 600; font-size: 14px; }
.admin-links a:hover, .admin-links a.active { background: rgba(255,255,255,.12); color: #fff; }
.admin-body { background: var(--light); min-height: 100vh; }
.admin-main { padding: 30px 0 60px; }
.admin-main h1 { color: var(--primary); margin-bottom: 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { background: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.08); border-left: 5px solid var(--accent); }
.stat-card h3 { font-size: 30px; color: var(--primary); }
.stat-card p { color: var(--muted); font-size: 14px; }
.stat-card.green { border-color: #1a7a3e; }
.stat-card.blue { border-color: #1d4ed8; }
.stat-card.red { border-color: #b42318; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input, .toolbar select { padding: 11px; border: 1px solid #cfd6e0; border-radius: 6px; font-size: 15px; }
.toolbar input { flex: 1; min-width: 220px; }
.admin-login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--primary); padding: 20px; }
.admin-login-page .form-box { width: 100%; max-width: 420px; }

/* ===== Admin step 6 ===== */
.panel { background: #fff; padding: 22px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.08); margin-bottom: 26px; }
.panel h2 { color: var(--primary); margin-bottom: 14px; font-size: 20px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; align-items: end; }
.grid-form .form-group { margin-bottom: 0; }
.code-chip { font-family: Consolas, monospace; background: #fff4e0; color: #b45309; padding: 4px 10px; border-radius: 6px; font-weight: bold; letter-spacing: 1px; white-space: nowrap; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.table-select { padding: 6px; border: 1px solid #cfd6e0; border-radius: 6px; font-size: 14px; }
.badge.inactive { background: #e5e7eb; color: #6b7280; }
.badge.active, .badge.available { background: #e6f6ec; color: #1a7a3e; }
.badge.maintenance { background: #fdeaea; color: #b42318; }
.badge.on-trip { background: #e0edff; color: #1d4ed8; }
@media print { .admin-bar, .no-print { display: none !important; } }

/* ===== Driver portal ===== */
.driver-bar { background: var(--primary); color: #fff; padding: 12px 0; position: sticky; top: 0; z-index: 100; }
.driver-bar .container { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.driver-bar small { color: #cfd8e6; display: block; }
.driver-main { padding: 20px 0 60px; }
#driverMap { height: 300px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.08); margin-bottom: 10px; }
.gps-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.gps-status { color: var(--muted); font-size: 14px; }
.job-card { background: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.08); margin-bottom: 18px; border-left: 5px solid var(--accent); }
.job-card h3 { color: var(--primary); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.job-card .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.deliver-box { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #d5dbe5; }
.deliver-box input[type=file], .deliver-box input[type=text] { width: 100%; padding: 10px; border: 1px solid #cfd6e0; border-radius: 6px; margin-bottom: 10px; font-size: 15px; }
.call-link { color: var(--accent); font-weight: bold; }

/* ===== Admin step 8 ===== */
.live-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; align-items: start; }
#liveMap { height: 540px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.live-item { padding: 12px; border: 1px solid #e5e9f0; border-radius: 8px; margin-bottom: 10px; cursor: pointer; }
.live-item:hover { background: #f4f6fa; border-color: var(--accent); }
.live-item small { color: var(--muted); }
.proof-img { max-width: 100%; border-radius: 8px; margin-top: 8px; border: 1px solid #e5e9f0; }
.section-gap { margin-top: 34px; }
@media (max-width: 900px) { .live-grid { grid-template-columns: 1fr; } #liveMap { height: 380px; } }

/* ===== Profile and password reset ===== */
.forgot-link { display: block; text-align: right; margin: -6px 0 14px; font-size: 14px; color: var(--accent); font-weight: 600; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; max-width: 950px; margin: auto; }
.profile-grid h2 { color: var(--primary); margin-bottom: 14px; font-size: 22px; }
@media (max-width: 800px) { .profile-grid { grid-template-columns: 1fr; } }

/* ===== Address picker ===== */
.addr-wrap { position: relative; }
.addr-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 500; background: #fff; border: 1px solid #cfd6e0; border-radius: 6px; box-shadow: 0 8px 20px rgba(0,0,0,.12); max-height: 240px; overflow-y: auto; display: none; }
.addr-list div { padding: 10px 12px; cursor: pointer; font-size: 14px; border-bottom: 1px solid #f0f2f6; }
.addr-list div:last-child { border-bottom: none; }
.addr-list div:hover { background: #fff4e0; }
.addr-list .addr-msg { color: var(--muted); cursor: default; }
.addr-list .addr-msg:hover { background: #fff; }
.addr-map { height: 230px; border-radius: 8px; margin-top: 10px; border: 1px solid #cfd6e0; display: none; }
.addr-hint { font-size: 13px; color: var(--muted); margin-top: 6px; display: none; }
.addr-hint.ok { color: #1a7a3e; }

/* ===== Country selector for addresses ===== */
.country-select { margin-bottom: 10px; }
.addr-wrap input:disabled { background: #f1f3f7; cursor: not-allowed; }

/* ===== Containers (Phase 1) ===== */
.badge.booked, .badge.loaded { background: #fff4e0; color: #b45309; }
.badge.in-transit-by-sea { background: #e0edff; color: #1d4ed8; }
.badge.arrived-at-port, .badge.customs-clearance { background: #efe7ff; color: #6d28d9; }
.notice { background: #fff4e0; border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 6px; font-size: 14px; margin-bottom: 16px; color: #7a4a00; }
.two-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .two-panels { grid-template-columns: 1fr; } }