:root {
    --navy: #0b2b4a;
    --navy-2: #123a63;
    --gold: #e8a317;
    --gold-2: #c98a0c;
    --bg: #f4f6f9;
    --ink: #1c2430;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
}
.app-wrap { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--navy) 0%, #071d33 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
    width: 40px; height: 40px; border-radius: 8px;
    background: var(--gold); color: var(--navy);
    font-weight: 800; display: flex; align-items: center; justify-content: center;
    font-size: 13px; letter-spacing: .4px;
}
.brand strong { display: block; font-size: 13px; line-height: 1.2; }
.brand small { color: #c5d4e6; font-size: 11px; }
.sidebar .nav { padding: 10px 8px; flex: 1; }
.sidebar .nav-link {
    color: #d7e4f2;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 13.5px;
}
.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background: rgba(232,163,23,.18);
    color: #fff;
}
.sidebar .nav-link .nav-badge {
    background: #dc3545;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
}
.nav-section {
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #8aa0b8;
    padding: 14px 12px 4px;
}
.sidebar-foot { padding: 12px 16px; font-size: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot a { color: var(--gold); text-decoration: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    background: var(--navy-2);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 22px;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 600; }
.topbar-user { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.content { padding: 20px 22px 40px; }
.card-soft {
    background: #fff;
    border: 0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(11,43,74,.08);
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat {
    background: #fff;
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(11,43,74,.08);
    border-top: 3px solid var(--gold);
}
.stat .n { font-size: 22px; font-weight: 700; color: var(--navy); }
.stat .l { font-size: 12px; color: #5b6b7c; text-transform: uppercase; letter-spacing: .04em; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #5b6b7c; }
.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.filter-bar .form-control,
.filter-bar .form-select { font-size: 13px; }
.table-compact {
    font-size: 13px;
    margin: 0;
}
.table-compact thead th {
    padding: 7px 10px;
    white-space: nowrap;
    background: #f6f8fb;
    border-bottom: 1px solid #e4eaf1;
    font-weight: 700;
    vertical-align: middle;
}
.table-compact td {
    padding: 5px 10px;
    vertical-align: middle;
    border-color: #eef2f6;
}
.table-compact .cell-sub {
    font-size: 11px;
    color: #8a97a6;
    font-weight: 500;
    line-height: 1.2;
}
.table-compact .cell-clip {
    max-width: 168px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table-compact .row-actions a {
    display: inline-block;
    margin-right: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--navy);
    text-decoration: none;
}
.table-compact .row-actions a:last-child { margin-right: 0; }
.table-compact .row-actions a:hover { color: var(--gold-2); }
.table-compact .badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 7px;
    letter-spacing: .02em;
}
.table-compact .awb-num { font-size: 13px; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1a1304; font-weight: 600; }
.btn-gold:hover { background: var(--gold-2); color: #fff; }
.awb-num { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .04em; color: var(--navy); }
.login-body {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #071d33, #123a63 55%, #0b2b4a);
}
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 12px; padding: 32px; }
.login-card h1 { font-size: 22px; color: var(--navy); }
.rate-feed input { min-width: 0; }
.booking-form { display: flex; flex-direction: column; gap: 14px; }
.booking-form .bk-sec {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(11,43,74,.08);
    padding: 14px 16px 16px;
}
.booking-form .bk-h {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #5b6b7c;
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e8edf2;
}
.booking-form .bk-party { padding: 0 16px 16px; overflow: hidden; }
.booking-form .bk-party .bk-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 -16px 14px;
    padding: 10px 16px;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
}
.booking-form .bk-party .bk-h span {
    font-size: 10px;
    letter-spacing: .12em;
    opacity: .85;
}
.booking-form .bk-consignor .bk-h { background: var(--navy); color: #fff; }
.booking-form .bk-consignee .bk-h { background: var(--gold); color: #1a1304; }
.booking-form:not(.bill-consignee) .bk-consignor .bk-h::after,
.booking-form.bill-consignee .bk-consignee .bk-h::after {
    content: 'Billed';
    font-size: 9px;
    letter-spacing: .14em;
    text-transform: uppercase;
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 1px 7px;
    opacity: .9;
}
.booking-form .form-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #3d4d5c;
}
.booking-form .form-control,
.booking-form .form-select { font-size: 14px; }
.booking-form .bk-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 12px 16px;
    margin: 0;
    border-radius: 10px;
    box-shadow: 0 -4px 16px rgba(11,43,74,.08);
    z-index: 2;
}
.suggest-wrap { position: relative; }
.suggest-list {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    max-height: 240px;
    overflow: auto;
    box-shadow: 0 8px 20px rgba(11, 43, 74, .12);
}
.suggest-list button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: #fff;
    padding: 7px 10px;
    font-size: 13px;
    color: #1c2430;
    cursor: pointer;
}
.suggest-list button small { display: block; color: #5b6b7c; font-size: 11px; }
.suggest-list button:hover,
.suggest-list button.active { background: #f4ead4; }
@media (max-width: 900px) {
    .app-wrap { flex-direction: column; }
    .sidebar { width: 100%; }
    .sidebar .nav { flex-direction: row; flex-wrap: wrap; }
}
.dash-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.dash-head > div:first-child { min-width: 0; flex: 1; }
.dash-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold-2);
}
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
a.dash-kpi {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    padding: 14px 16px 12px;
    box-shadow: 0 1px 3px rgba(11,43,74,.08);
    border-top: 3px solid var(--navy);
    text-decoration: none;
    color: inherit;
    min-height: 96px;
    transition: transform .12s ease, box-shadow .12s ease;
}
a.dash-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(11,43,74,.12);
    color: inherit;
}
a.dash-kpi.tone-gold { border-top-color: var(--gold); }
a.dash-kpi.tone-money { border-top-color: #2f6f4e; }
a.dash-kpi.tone-ok { border-top-color: #198754; }
a.dash-kpi.tone-alert { border-top-color: #dc3545; }
.dash-kpi-l {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #5b6b7c;
}
.dash-kpi-n {
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.2;
    margin-top: 4px;
}
.dash-kpi-n.sm { font-size: 18px; }
.dash-kpi-h { font-size: 12px; color: #8a97a6; margin-top: 4px; }
.dash-kpi-h a, a.dash-kpi-h { color: var(--navy); text-decoration: none; font-weight: 600; }
.dash-trend { font-weight: 700; }
.dash-trend.up { color: #198754; }
.dash-trend.down { color: #dc3545; }
.dash-panel { overflow: hidden; }
.dash-panel-h {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f6;
    background: #fff;
}
.dash-panel-h a { font-size: 12px; font-weight: 600; color: var(--navy); text-decoration: none; }
.dash-panel-h a:hover { color: var(--gold-2); }
.dash-pipe {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
}
a.dash-pipe-step {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f6f8fb;
    text-decoration: none;
    color: inherit;
}
a.dash-pipe-step:hover { background: #eef3f8; color: inherit; }
a.dash-pipe-step.done { background: #eef8f1; }
.dash-pipe-l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #5b6b7c; }
.dash-pipe-n { font-size: 22px; font-weight: 700; color: var(--navy); }
.dash-pipe-bar { height: 4px; background: #dbe3ec; border-radius: 4px; overflow: hidden; }
.dash-pipe-bar span { display: block; height: 100%; background: var(--gold); }
a.dash-pipe-step.done .dash-pipe-bar span { background: #198754; }
.dash-mix { padding: 6px 0; }
a.dash-mix-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 9px 14px;
    text-decoration: none;
    color: inherit;
    font-size: 13px;
    border-bottom: 1px solid #eef2f6;
}
a.dash-mix-row:last-child { border-bottom: 0; }
a.dash-mix-row:hover { background: #f6f8fb; color: inherit; }
a.dash-mix-row.accent { background: #fff8ea; }
.dash-month {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 14px;
}
.dash-dest { padding: 10px 14px 14px; }
.dash-dest-row {
    display: grid;
    grid-template-columns: 110px 1fr 36px 88px;
    gap: 8px;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}
.dash-dest-city { font-weight: 600; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-dest-track { height: 8px; background: #e8edf2; border-radius: 6px; overflow: hidden; }
.dash-dest-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--gold)); border-radius: 6px; }
.dash-dest-n { font-weight: 700; text-align: right; }
.dash-dest-amt { text-align: right; color: #5b6b7c; font-size: 12px; }
.dash-alert small { display: block; }
.dash-ewb-bad { color: #dc3545; font-weight: 700; }
.dash-ewb-warn { color: #c98a0c; font-weight: 700; }
.dash-days {
    display: inline-block;
    min-width: 28px;
    text-align: center;
    font-weight: 700;
    color: var(--navy);
}
.dash-days.late { color: #dc3545; }
@media (max-width: 1100px) {
    .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .dash-kpis, .dash-pipe, .dash-month { grid-template-columns: 1fr; }
    .dash-dest-row { grid-template-columns: 1fr auto; }
    .dash-dest-track, .dash-dest-amt { display: none; }
}
