/* ==========================================================================
   Singh Logistics — Navy + Orange design system (colours taken from the logo)
   ========================================================================== */
:root {
  --bg: #f2f5fa;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --line: #e1e7f1;
  --line-2: #edf1f7;
  --ink: #0d1a33;
  --ink-2: #2a3957;
  --muted: #6a7894;
  --navy: #0a2d52;
  --navy-700: #134078;
  --navy-800: #0b3566;
  --navy-900: #061f3f;
  --navy-100: #d3dff2;
  --navy-50: #eaf0f9;
  --accent: #f29213;
  --orange: #f29213;  --orange-600: #d97f06;  --orange-100: #fde3b8;  --orange-50: #fff5e3;
  --ok: #0b8f63;      --ok-bg: #e2f6ed;
  --warn: #a8690c;    --warn-bg: #fff2d3;
  --bad: #c9302f;     --bad-bg: #fde8e8;
  --info: #1a63c7;    --info-bg: #e2edfd;
  --radius: 12px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(13, 26, 51, .05);
  --shadow: 0 8px 28px rgba(13, 26, 51, .07);
  --shadow-lg: 0 24px 60px rgba(7, 27, 61, .28);
  --sidebar-w: 232px;
  --topbar-h: 54px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 13px; line-height: 1.45;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 650; letter-spacing: -.01em; color: var(--ink); }
p { margin: 0 0 .75rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
::selection { background: var(--navy-100); }

/* ---------- App shell ---------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--surface);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 50;
  transition: transform .25s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); margin: 0 4px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, var(--navy-700), var(--navy-900)); color: #fff; font-size: 22px;
  box-shadow: 0 6px 16px rgba(11, 42, 91, .35);
}
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--navy); line-height: 1; }
.brand-name small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; color: var(--muted); margin-top: 4px; text-transform: uppercase; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 8px 16px 20px; scrollbar-width: thin; }
.nav-title { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 22px 14px 8px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 11px 14px; margin: 2px 0;
  border-radius: 12px; color: var(--ink-2); font-weight: 550; font-size: 14.5px; transition: background .15s, color .15s;
}
.nav-link i { font-size: 19px; color: var(--muted); width: 22px; text-align: center; flex: none; }
.nav-link:hover { background: var(--surface-2); color: var(--navy); }
.nav-link.active { background: var(--navy-50); color: var(--navy); font-weight: 650; }
.nav-link.active i { color: var(--navy); }
.nav-link.active::before { content: ''; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--navy); }
.nav-count {
  margin-left: auto; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 700; background: var(--navy); color: #fff;
}
.nav-count.warn { background: #c9302f; }
.nav-sub { display: none; margin: 2px 0 6px 22px; padding-left: 14px; border-left: 2px solid var(--line); }
.nav-group.open > .nav-sub { display: block; }
.nav-group > .nav-link .chev { margin-left: auto; font-size: 18px; transition: transform .2s; }
.nav-group.open > .nav-link .chev { transform: rotate(180deg); }
.nav-sub .nav-link { padding: 8px 12px; font-size: 13.5px; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid var(--line); }
.sidebar-foot form { margin: 0; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin .25s ease; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 16px;
  padding: 0 32px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.icon-btn {
  width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  display: inline-grid; place-items: center; font-size: 20px; color: var(--ink-2); cursor: pointer; position: relative;
  transition: border-color .15s, background .15s;
}
.icon-btn:hover { border-color: var(--navy-700); background: var(--navy-50); color: var(--navy); }
.icon-btn .dot { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 99px; background: #c9302f; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.topbar-title { font-weight: 650; color: var(--ink-2); display: none; }
.topbar-spacer { flex: 1; }
.search-box { position: relative; width: 340px; max-width: 36vw; }
.search-box i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; }
.search-box input { padding-left: 42px; background: var(--surface-2); }
.user-chip {
  display: flex; align-items: center; gap: 12px; padding: 7px 16px 7px 8px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); cursor: pointer; transition: border-color .15s;
}
.user-chip:hover { border-color: var(--navy-700); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.soft { background: var(--navy-50); color: var(--navy); }
.user-chip .who { line-height: 1.2; }
.user-chip .who b { display: block; font-size: 14px; font-weight: 650; }
.user-chip .who small { color: var(--muted); font-size: 12px; text-transform: capitalize; }

.content { padding: 28px 32px 48px; flex: 1; max-width: 1680px; width: 100%; }
.footer { padding: 18px 32px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); background: var(--surface); }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-title { font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.page-sub { color: var(--muted); margin: 4px 0 0; font-size: 14.5px; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--navy); }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 14px;
  border: 1.5px solid transparent; font: inherit; font-weight: 650; font-size: 14.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s; text-decoration: none; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn i { font-size: 18px; }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 6px 16px rgba(11, 42, 91, .22); }
.btn-primary:hover { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.btn-outline { background: var(--surface); color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy-50); color: var(--navy); }
.btn-soft { background: var(--navy-50); color: var(--navy); }
.btn-soft:hover { background: var(--navy-100); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-danger:hover { background: #a82524; color: #fff; }
.btn-danger-soft { background: var(--bad-bg); color: var(--bad); }
.btn-success { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn-success:hover { background: #087a54; color: #fff; }
.btn-light { background: #fff; color: var(--navy); border-color: #fff; }
.btn-light:hover { background: var(--navy-50); color: var(--navy); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn-sm i { font-size: 16px; }
.btn-xs { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-xs { width: 30px; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 6px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm); margin-bottom: 24px; }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 6px; flex-wrap: wrap; }
.card-title { font-size: 19px; font-weight: 650; letter-spacing: -.015em; }
.card-sub { color: var(--muted); font-size: 12.5px; }
.card-body { padding: 18px 24px 24px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 14px 24px; border-top: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-link { font-weight: 600; font-size: 13.5px; color: var(--navy); }

/* ---------- Stat tiles ---------- */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 24px; }
.stat { display: flex; align-items: center; gap: 16px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm); min-width: 0; }
.stat-ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; flex: none; background: var(--navy-50); color: var(--navy); font-size: 25px; }
.stat-ico.ok { background: var(--ok-bg); color: var(--ok); }
.stat-ico.warn { background: var(--warn-bg); color: var(--warn); }
.stat-ico.bad { background: var(--bad-bg); color: var(--bad); }
.stat-ico.info { background: var(--info-bg); color: var(--info); }
.stat-label { color: var(--ink-2); font-size: 13.5px; font-weight: 500; line-height: 1.25; }
.stat-value { font-size: 26px; font-weight: 750; letter-spacing: -.025em; line-height: 1.15; color: var(--ink); white-space: nowrap; }
.stat-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat > div:last-child { min-width: 0; }

/* ---------- Banner ---------- */
.banner {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; padding: 24px 28px; margin-bottom: 24px;
  background: linear-gradient(120deg, var(--navy-900), var(--navy-800) 60%, var(--navy-700)); color: #fff; border-radius: 22px;
}
.banner::before, .banner::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.07); pointer-events: none; }
.banner::before { width: 340px; height: 340px; right: -60px; top: -170px; }
.banner::after { width: 200px; height: 200px; right: 180px; bottom: -120px; }
.banner-ico { width: 56px; height: 56px; border-radius: 16px; background: rgba(255,255,255,.12); display: grid; place-items: center; font-size: 26px; flex: none; position: relative; z-index: 1; }
.banner-body { flex: 1; position: relative; z-index: 1; min-width: 0; }
.banner h3 { color: #fff; font-size: 19px; font-weight: 650; }
.banner p { color: rgba(255,255,255,.78); margin: 4px 0 0; font-size: 14px; }
.banner .btn { position: relative; z-index: 1; }

/* ---------- Layout helpers ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split-5-7 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-8-4 { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.grid-7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.grid-9-3 { grid-template-columns: minmax(0, 9fr) minmax(0, 3fr); }
.grid > .card, .grid > div > .card:last-child { margin-bottom: 0; }
.row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 18px; }
.col-1 { grid-column: span 1; } .col-2 { grid-column: span 2; } .col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; } .col-12 { grid-column: span 12; }
.flex { display: flex; } .inline-flex { display: inline-flex; } .flex-wrap { flex-wrap: wrap; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .items-start { align-items: flex-start; } .items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; } .justify-end { justify-content: flex-end; } .justify-center { justify-content: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.flex-1 { flex: 1; } .min-w-0 { min-width: 0; } .w-100 { width: 100%; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.text-muted { color: var(--muted); } .text-ink { color: var(--ink); } .text-navy { color: var(--navy); }
.text-ok { color: var(--ok); } .text-bad { color: var(--bad); } .text-warn { color: var(--warn); } .text-info { color: var(--info); }
.text-right { text-align: right; } .text-center { text-align: center; } .text-sm { font-size: 12.5px; } .text-xs { font-size: 11.5px; } .text-lg { font-size: 17px; } .text-xl { font-size: 22px; }
.fw-5 { font-weight: 500; } .fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; }
.nowrap { white-space: nowrap; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upper { text-transform: uppercase; letter-spacing: .06em; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.pill-nav { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl thead th {
  text-align: left; padding: 13px 18px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl thead th:first-child { padding-left: 24px; } .tbl tbody td:first-child { padding-left: 24px; }
.tbl thead th:last-child, .tbl tbody td:last-child { padding-right: 24px; }
.tbl tbody td { padding: 14px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafcff; }
.tbl .num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .actions { text-align: right; white-space: nowrap; }
.tbl .sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.tbl tfoot td { padding: 14px 18px; font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
.tbl tfoot td:first-child { padding-left: 24px; }
.tbl.compact tbody td { padding: 9px 14px; }
.tbl.compact thead th { padding: 10px 14px; }
.route { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.route i { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty i { display: block; font-size: 38px; color: var(--navy-100); margin-bottom: 8px; }
.empty b { display: block; color: var(--ink-2); margin-bottom: 4px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; font-size: 12px; font-weight: 650; line-height: 1.2; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-navy { background: var(--navy); color: #fff; }
.b-muted { background: #eef1f6; color: #566280; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field > label .req, .req { color: var(--bad); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface);
  font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s; outline: none; appearance: none; -webkit-appearance: none;
}
.textarea { height: auto; padding: 11px 14px; resize: vertical; min-height: 88px; }
.select {
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236a7894' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.input:hover, .select:hover, .textarea:hover { border-color: #c3cde0; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--navy-700); box-shadow: 0 0 0 4px rgba(18, 58, 124, .12); }
.input[readonly], .input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--muted); }
.input.sm, .select.sm { height: 38px; border-radius: 10px; font-size: 13.5px; }
.input::placeholder, .textarea::placeholder { color: #9aa6bd; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--bad); }
.field-hint { font-size: 12px; color: var(--muted); }
.field-error { font-size: 12px; color: var(--bad); font-weight: 500; }
.input-group { display: flex; }
.input-group .addon { display: inline-flex; align-items: center; padding: 0 14px; background: var(--surface-2); border: 1.5px solid var(--line); color: var(--muted); font-weight: 600; }
.input-group .addon:first-child { border-radius: 12px 0 0 12px; border-right: 0; }
.input-group .addon:last-child { border-radius: 0 12px 12px 0; border-left: 0; }
.input-group .input { border-radius: 0; }
.input-group .input:first-child { border-radius: 12px 0 0 12px; } .input-group .input:last-child { border-radius: 0 12px 12px 0; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); }
.form-section { margin: 26px 0 14px; display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--navy); }
.form-section::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.form-section:first-child { margin-top: 0; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 18px 24px; border-bottom: 1px solid var(--line-2); }
.filters .field { min-width: 160px; flex: 1; max-width: 260px; }
.filters .field.grow { max-width: 360px; flex: 2; }
.upload-zone { border: 2px dashed var(--navy-100); border-radius: 16px; padding: 24px; text-align: center; background: var(--navy-50); cursor: pointer; transition: border-color .15s, background .15s; }
.upload-zone:hover { border-color: var(--navy-700); }
.upload-zone i { font-size: 32px; color: var(--navy); }
.upload-zone input[type=file] { display: none; }
.upload-zone .fname { margin-top: 6px; font-weight: 600; color: var(--navy); }

/* ---------- Alerts / toast ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 14px; margin-bottom: 20px; font-weight: 500; border: 1px solid transparent; }
.alert i { font-size: 20px; margin-top: 1px; }
.alert-ok { background: var(--ok-bg); color: #066a49; border-color: #bfe8d6; }
.alert-bad { background: var(--bad-bg); color: #9d2323; border-color: #f5c3c3; }
.alert-warn { background: var(--warn-bg); color: #7d4d06; border-color: #f2dba1; }
.alert-info { background: var(--info-bg); color: #134c99; border-color: #bcd5f6; }
.alert ul { margin: 4px 0 0 18px; padding: 0; font-weight: 400; }
.alert .x { margin-left: auto; background: none; border: 0; cursor: pointer; font-size: 18px; color: inherit; opacity: .6; }
.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 280px; max-width: 420px; padding: 14px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); color: #fff; font-weight: 550; display: flex; gap: 10px; align-items: center; animation: toast-in .25s ease; }
.toast.ok { background: var(--ok); } .toast.bad { background: var(--bad); } .toast.info { background: var(--navy); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------- Modal / dropdown / tabs ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; background: rgba(7, 27, 61, .55); backdrop-filter: blur(3px); }
.modal.open { display: flex; }
.modal-dialog { width: 100%; max-width: 760px; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); animation: modal-in .2s ease; }
.modal-dialog.sm { max-width: 480px; } .modal-dialog.md { max-width: 640px; } .modal-dialog.lg { max-width: 980px; } .modal-dialog.xl { max-width: 1180px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 28px 14px; }
.modal-head h3 { font-size: 20px; }
.modal-body { padding: 8px 28px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 28px 22px; border-top: 1px solid var(--line-2); }
.modal-x { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--surface-2); cursor: pointer; font-size: 18px; color: var(--ink-2); }
.modal-x:hover { background: var(--navy-50); }
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 60; }
.dropdown.open > .dropdown-menu { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--ink-2); font-weight: 550; font-size: 13.5px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; font-family: inherit; }
.dropdown-item:hover { background: var(--navy-50); color: var(--navy); }
.dropdown-item i { font-size: 17px; color: var(--muted); }
.dropdown-item.danger, .dropdown-item.danger i { color: var(--bad); }
.dropdown-sep { height: 1px; background: var(--line-2); margin: 5px 4px; }
.tabs { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 14px 16px; font-weight: 600; color: var(--muted); cursor: pointer; border: 0; background: none; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; font: inherit; font-weight: 600; }
.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-panel { display: none; } .tab-panel.active { display: block; }
.segmented { display: inline-flex; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; gap: 2px; }
.segmented a, .segmented button { padding: 7px 14px; border-radius: 9px; color: var(--ink-2); font-weight: 600; border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; font-size: 13px; }
.segmented .active { background: var(--navy); color: #fff; }

/* ---------- Detail lists / timeline / progress ---------- */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px 24px; }
.kv .k { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.kv .v { font-weight: 600; color: var(--ink); word-break: break-word; }
.dl { display: flex; flex-direction: column; }
.dl-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.dl-row:last-child { border-bottom: 0; }
.dl-row span:first-child { color: var(--muted); }
.dl-row span:last-child { font-weight: 650; text-align: right; }
.dl-row.total { font-size: 16px; border-top: 2px solid var(--line); border-bottom: 0; margin-top: 4px; padding-top: 14px; }
.timeline { position: relative; margin: 0; padding: 0 0 0 28px; list-style: none; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 20px; }
.timeline li::before { content: ''; position: absolute; left: -26px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--navy); }
.timeline li.done::before { background: var(--navy); }
.timeline li.muted::before { border-color: var(--line); }
.progress { height: 8px; border-radius: 99px; background: var(--navy-50); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--navy-700), var(--accent)); }
.steps { display: flex; gap: 0; margin-bottom: 22px; }
.step { flex: 1; text-align: center; position: relative; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.step::before { content: ''; display: block; width: 14px; height: 14px; margin: 0 auto 6px; border-radius: 50%; background: var(--line); position: relative; z-index: 1; }
.step::after { content: ''; position: absolute; top: 6px; left: 50%; width: 100%; height: 2px; background: var(--line); }
.step:last-child::after { display: none; }
.step.done, .step.current { color: var(--navy); }
.step.done::before, .step.current::before { background: var(--navy); }
.step.done::after { background: var(--navy); }
.step.current::before { box-shadow: 0 0 0 5px var(--navy-100); }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row b { display: block; font-weight: 650; }
.list-row small { color: var(--muted); }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink-2); font-weight: 600; font-size: 13px; text-align: center; transition: all .15s; background: var(--surface); }
.quick i { font-size: 26px; color: var(--navy); }
.quick:hover { border-color: var(--navy); background: var(--navy-50); transform: translateY(-2px); color: var(--navy); }
.chart-box { position: relative; height: 300px; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.map-box { height: 380px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.doc-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; gap: 12px; align-items: center; background: var(--surface); }
.doc-card .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--navy-50); color: var(--navy); display: grid; place-items: center; font-size: 22px; flex: none; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 36px; height: 36px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 13px; }
.pagination a:hover { border-color: var(--navy); color: var(--navy); }
.pagination .active span { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination .disabled span { opacity: .45; }
.pager-info { color: var(--muted); font-size: 13px; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-art { position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: radial-gradient(circle at 20% 15%, #1a4a9a 0, transparent 45%), linear-gradient(150deg, var(--navy-700), var(--navy-900) 70%); }
.auth-art::before { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 70px solid rgba(255,255,255,.05); right: -200px; bottom: -180px; }
.auth-art::after { content: ''; position: absolute; width: 280px; height: 280px; border-radius: 50%; background: rgba(255,255,255,.05); left: -90px; top: 46%; }
.auth-art .brand-mark { background: rgba(255,255,255,.14); box-shadow: none; }
.auth-art .brand-name { color: #fff; } .auth-art .brand-name small { color: rgba(255,255,255,.65); }
.auth-art h2 { color: #fff; font-size: 40px; line-height: 1.12; letter-spacing: -.03em; max-width: 520px; position: relative; z-index: 1; }
.auth-art p { color: rgba(255,255,255,.75); font-size: 16px; max-width: 460px; position: relative; z-index: 1; }
.auth-points { display: grid; gap: 14px; position: relative; z-index: 1; }
.auth-points div { display: flex; gap: 14px; align-items: center; color: rgba(255,255,255,.9); font-weight: 550; }
.auth-points i { width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.12); display: grid; place-items: center; font-size: 19px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 30px; letter-spacing: -.03em; }
.pw-wrap { position: relative; } .pw-wrap .input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 18px; border-radius: 8px; }
.public-shell { min-height: 100vh; background: var(--bg); }
.public-top { background: linear-gradient(120deg, var(--navy-900), var(--navy-700)); color: #fff; padding: 18px 24px; }
.public-top .brand-name { color: #fff; } .public-top .brand-name small { color: rgba(255,255,255,.7); }
.public-wrap { max-width: 880px; margin: 0 auto; padding: 28px 18px 60px; }

/* ---------- Print ---------- */
.print-sheet { max-width: 820px; margin: 0 auto; background: #fff; padding: 36px; border: 1px solid var(--line); border-radius: 12px; }
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print, .footer, .page-actions, .toast-wrap { display: none !important; }
  .main { margin: 0 !important; } .content { padding: 0 !important; max-width: none; }
  .card, .print-sheet { box-shadow: none !important; border: 0 !important; }
  .tbl tbody tr:hover td { background: none; }
}

/* ---------- Responsive ---------- */
.sidebar-backdrop { display: none; }
@media (max-width: 1180px) {
  .grid-8-4, .grid-7-5, .grid-9-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(7,27,61,.45); z-index: 45; }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; } .content { padding: 20px 16px 40px; } .search-box { display: none; }
  .user-chip .who { display: none; } .user-chip { padding: 5px; border-radius: 50%; }
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .row > [class*="col-"] { grid-column: span 6; }
  .row > .col-12 { grid-column: span 12; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .split-5-7 { grid-template-columns: 1fr; }
  .row > [class*="col-"] { grid-column: span 12; }
  .page-title { font-size: 24px; }
  .banner { flex-wrap: wrap; } .stat-value { font-size: 22px; }
  .modal { padding: 0; } .modal-dialog { border-radius: 0; min-height: 100vh; }
  .filters .field { max-width: none; min-width: 100%; }
}

/* ==========================================================================
   v2 — compact scale, logo colours, phone-first behaviour (overrides above)
   ========================================================================== */
:root { --safe-b: env(safe-area-inset-bottom, 0px); --bottom-nav-h: 58px; }
body { font-size: 13px; }
h1, h2, h3, h4 { letter-spacing: -.01em; }

/* shell */
.sidebar-brand { padding: 14px 16px 12px; margin: 0; justify-content: center; }
.sidebar-brand .brand-logo { width: 100%; max-width: 172px; height: auto; display: block; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; font-size: 18px; }
.brand-name { font-size: 16px; }
.sidebar-scroll { padding: 4px 10px 14px; }
.nav-title { font-size: 10px; padding: 14px 10px 5px; letter-spacing: .12em; }
.nav-link { gap: 10px; padding: 7px 10px; margin: 1px 0; border-radius: 9px; font-size: 13px; }
.nav-link i { font-size: 17px; width: 20px; }
.nav-link.active { background: var(--navy); color: #fff; }
.nav-link.active i { color: var(--orange); }
.nav-link.active::before { display: none; }
.nav-sub { margin: 2px 0 4px 18px; padding-left: 10px; }
.nav-sub .nav-link { padding: 6px 10px; font-size: 12.5px; }
.nav-sub .nav-link.active { background: var(--orange-50); color: var(--navy); font-weight: 700; }
.nav-count { min-width: 20px; height: 20px; font-size: 11px; background: var(--orange); color: var(--navy-900); }
.nav-count.warn { background: #c9302f; color: #fff; }
.sidebar-foot { padding: 10px 12px; }
.topbar { padding: 0 20px; gap: 10px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; font-size: 18px; }
.icon-btn .dot { top: -5px; right: -5px; min-width: 18px; height: 18px; font-size: 10px; }
.search-box { width: 300px; }
.search-box input { padding-left: 36px; }
.search-box i { left: 11px; font-size: 16px; }
.user-chip { padding: 4px 10px 4px 4px; border-radius: 12px; gap: 8px; }
.avatar { width: 30px; height: 30px; font-size: 12px; background: var(--navy); }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.user-chip .who b { font-size: 12.5px; } .user-chip .who small { font-size: 11px; }
.content { padding: 18px 20px 36px; }
.footer { padding: 12px 20px; font-size: 11.5px; }

/* page header */
.page-head { margin-bottom: 14px; gap: 10px; align-items: center; }
.page-title { font-size: 20px; letter-spacing: -.02em; position: relative; padding-left: 12px; }
.page-title::before { content: ''; position: absolute; left: 0; top: 14%; bottom: 14%; width: 4px; border-radius: 3px; background: var(--orange); }
.page-sub { font-size: 12.5px; margin-top: 2px; padding-left: 12px; }
.crumbs { font-size: 11.5px; margin-bottom: 2px; padding-left: 12px; }
.page-actions { gap: 8px; }

/* buttons */
.btn { height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13px; gap: 6px; }
.btn i { font-size: 16px; }
.btn-primary { box-shadow: 0 4px 12px rgba(10, 45, 82, .2); }
.btn-primary:hover { background: var(--navy-700); border-color: var(--navy-700); }
.btn-accent, .btn-orange { background: var(--orange); border-color: var(--orange); color: var(--navy-900); }
.btn-accent:hover, .btn-orange:hover { background: var(--orange-600); border-color: var(--orange-600); color: #fff; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 11.5px; border-radius: 7px; }
.btn-icon { width: 30px; padding: 0; } .btn-icon.btn-xs { width: 26px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14px; }

/* cards */
.card { border-radius: 14px; margin-bottom: 14px; }
.card-head { padding: 12px 16px 2px; }
.card-title { font-size: 14.5px; }
.card-sub { font-size: 11.5px; }
.card-body { padding: 12px 16px 16px; }
.card-foot { padding: 10px 16px; }
.grid { gap: 14px; }
.row { gap: 12px 14px; }

/* stat tiles — compact so six fit on one row */
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px; border-radius: 14px; position: relative; overflow: hidden; }
.stat::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--orange), transparent 70%); opacity: .0; transition: opacity .2s; }
.stat:hover::after { opacity: 1; }
.stat-ico { width: 32px; height: 32px; border-radius: 10px; font-size: 17px; }
.stat-label { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.stat-value { font-size: 18px; letter-spacing: -.02em; }
.stat-hint { font-size: 10.5px; }
.stat > div:last-child { width: 100%; }
@media (min-width: 1000px) {
  .stats:has(> :nth-child(6):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .stats:has(> :nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 999px) {
  .stats:has(> :nth-child(5)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* banner */
.banner { padding: 14px 18px; margin-bottom: 14px; border-radius: 16px; gap: 12px; }
.banner-ico { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; }
.banner h3 { font-size: 15px; } .banner p { font-size: 12.5px; }

/* tables */
.tbl { font-size: 12.5px; }
.tbl thead th { padding: 9px 12px; font-size: 10.5px; }
.tbl tbody td { padding: 9px 12px; }
.tbl thead th:first-child, .tbl tbody td:first-child { padding-left: 16px; }
.tbl thead th:last-child, .tbl tbody td:last-child { padding-right: 16px; }
.tbl .sub { font-size: 11.5px; }
.tbl tfoot td, .tbl tfoot th { padding: 9px 12px; }
.badge { padding: 3px 9px; font-size: 11px; }
.badge::before { width: 5px; height: 5px; }
.chip { padding: 3px 8px; font-size: 11.5px; border-radius: 7px; }

/* forms */
.field { gap: 4px; }
.field > label, .label { font-size: 12px; }
.input, .select, .textarea { height: 38px; padding: 0 11px; border-radius: 10px; font-size: 13px; }
.textarea { min-height: 70px; padding: 8px 11px; }
.input.sm, .select.sm { height: 32px; font-size: 12.5px; border-radius: 8px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(242, 146, 19, .22); }
.input-group .addon { padding: 0 11px; }
.form-section { margin: 18px 0 10px; font-size: 11px; }
.form-actions { padding-top: 14px; margin-top: 14px; }
.filters { padding: 12px 16px; gap: 10px; }
.check input { width: 16px; height: 16px; accent-color: var(--orange); }

/* upload field */
.upload { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px dashed #b9c9e3; border-radius: 12px; background: var(--navy-50); cursor: pointer; transition: border-color .15s, background .15s; min-height: 62px; }
.upload:hover, .upload.drag { border-color: var(--orange); background: var(--orange-50); }
.upload input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.upload-ico { width: 38px; height: 38px; border-radius: 10px; background: #fff; color: var(--navy); display: grid; place-items: center; font-size: 20px; flex: none; border: 1px solid var(--line); }
.upload-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.upload-text b { font-size: 12.5px; color: var(--navy); }
.upload-text small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }
.upload.has-file .upload-ico { background: var(--ok); color: #fff; border-color: var(--ok); }
.upload.has-file .upload-text b { color: #066a49; }
.upload.is-invalid { border-color: var(--bad); }
.upload-thumb { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.upload-clear { position: relative; z-index: 2; margin-left: auto; width: 26px; height: 26px; border-radius: 8px; border: 0; background: rgba(10, 45, 82, .08); color: var(--navy); cursor: pointer; display: none; place-items: center; font-size: 15px; }
.upload.has-file .upload-clear { display: grid; }
.upload-zone { border-radius: 12px; padding: 16px; }

/* alerts, toast, modal */
.alert { padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 12.5px; }
.toast { min-width: 240px; padding: 10px 14px; border-radius: 12px; font-size: 12.5px; }
.modal-dialog { border-radius: 16px; max-width: 700px; }
.modal-head { padding: 14px 18px 8px; } .modal-head h3 { font-size: 16px; }
.modal-body { padding: 6px 18px 16px; }
.modal-foot { padding: 12px 18px 14px; }
.modal-x { width: 30px; height: 30px; border-radius: 8px; font-size: 16px; }
.dropdown-menu { border-radius: 12px; min-width: 190px; }
.dropdown-item { padding: 7px 10px; font-size: 12.5px; }
.tabs { padding: 0 16px; } .tab { padding: 10px 12px; font-size: 12.5px; }
.tab.active { border-bottom-color: var(--orange); }
.segmented .active { background: var(--navy); }

/* detail blocks */
.kv { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 18px; }
.kv .k { font-size: 10.5px; } .kv .v { font-size: 13px; }
.dl-row { padding: 8px 0; }
.dl-row.total { font-size: 14px; }
.list-row { padding: 10px 0; }
.quick { padding: 12px 8px; font-size: 12px; border-radius: 12px; }
.quick i { font-size: 22px; color: var(--orange); }
.quick:hover { border-color: var(--orange); background: var(--orange-50); }
.chart-box { height: 240px; }
.progress > span { background: linear-gradient(90deg, var(--navy-700), var(--orange)); }
.timeline li::before { border-color: var(--navy); }
.timeline li.done::before { background: var(--orange); border-color: var(--orange); }
.step.done::before, .step.current::before { background: var(--orange); }
.step.done::after { background: var(--orange); }
.step.current::before { box-shadow: 0 0 0 4px var(--orange-100); }
.pagination a, .pagination span { min-width: 30px; height: 30px; border-radius: 8px; font-size: 12px; }
.pagination .active span { background: var(--navy); border-color: var(--navy); }

/* empty state with illustration */
.empty { padding: 26px 16px; }
.empty img { display: block; width: 150px; max-width: 60%; margin: 0 auto 6px; }
.empty i { display: none; }
.empty b { font-size: 13.5px; }
.empty span { display: block; font-size: 12px; max-width: 360px; margin: 0 auto; }

/* auth + public */
.auth-art { background: radial-gradient(circle at 15% 10%, #164a8a 0, transparent 46%), linear-gradient(160deg, var(--navy-900), var(--navy) 60%, #0d3d73); padding: 40px; }
.auth-art h2 { font-size: 32px; }
.auth-art .hero-img { width: 100%; max-width: 520px; position: relative; z-index: 1; margin: 6px 0; }
.auth-logo { display: block; width: 210px; max-width: 70%; background: #fff; border-radius: 16px; padding: 10px 14px; position: relative; z-index: 1; }
.auth-card h1 { font-size: 24px; }
.auth-card .auth-logo-sm { display: none; }
.public-top { background: linear-gradient(120deg, var(--navy-900), var(--navy)); padding: 10px 16px; border-bottom: 3px solid var(--orange); }
.public-top .brand-logo { height: 38px; width: auto; background: #fff; padding: 4px 10px; border-radius: 10px; display: block; }
.public-wrap { padding: 18px 14px 50px; }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; background: var(--bg); }
.error-page img { width: min(340px, 80vw); }
.error-page h1 { font-size: 22px; margin: 6px 0 4px; }
.error-page .code { font-size: 54px; font-weight: 800; color: var(--navy); line-height: 1; }
.error-page .code span { color: var(--orange); }

/* mobile bottom bar */
.bottom-nav { display: none; }

/* ---------- Tablet / phone ---------- */
@media (max-width: 991px) {
  :root { --sidebar-w: 262px; }
  .topbar { padding: 0 12px; }
  .content { padding: 14px 12px calc(var(--bottom-nav-h) + var(--safe-b) + 18px); }
  .footer { display: none; }
  .bottom-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 44;
    background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + var(--safe-b)); height: calc(var(--bottom-nav-h) + var(--safe-b));
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; font: inherit;
    font-size: 10.5px; font-weight: 600; color: var(--muted); border-radius: 10px; cursor: pointer; position: relative;
  }
  .bottom-nav i { font-size: 20px; }
  .bottom-nav .on { color: var(--navy); }
  .bottom-nav .on i { color: var(--orange); }
  .bottom-nav .on::before { content: ''; position: absolute; top: -5px; width: 22px; height: 3px; border-radius: 3px; background: var(--orange); }
  .bottom-nav .bn-dot { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 15px; height: 15px; border-radius: 9px; background: #c9302f; color: #fff; font-size: 9px; display: grid; place-items: center; padding: 0 3px; }
  .sidebar { z-index: 60; }
  body.nav-open .sidebar-backdrop { z-index: 55; }
  .toast-wrap { top: auto; bottom: calc(var(--bottom-nav-h) + var(--safe-b) + 10px); left: 12px; right: 12px; }
  .toast { min-width: 0; max-width: none; }
  .auth-card .auth-logo-sm { display: block; width: 190px; margin: 0 auto 18px; }
}
@media (max-width: 640px) {
  body { font-size: 13px; }
  .page-head { align-items: flex-start; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .page-title { font-size: 18px; }
  .stats, .stats:has(> :nth-child(5)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 10px 12px; }
  .stat-value { font-size: 17px; }
  .card-head { padding: 10px 12px 2px; } .card-body { padding: 10px 12px 14px; }
  .tbl thead th:first-child, .tbl tbody td:first-child { padding-left: 12px; }
  .tbl thead th:last-child, .tbl tbody td:last-child { padding-right: 12px; }
  .tbl tbody td, .tbl thead th { padding-left: 9px; padding-right: 9px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .input, .select, .textarea { font-size: 16px; }   /* stops iOS zoom on focus */
  .input.sm, .select.sm { font-size: 14px; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-dialog { border-radius: 18px 18px 0 0; min-height: 0; max-height: 94vh; overflow-y: auto; animation: sheet-in .22s ease; }
  .filters { padding: 10px 12px; }
  .filters .field { min-width: 100%; max-width: none; }
  .form-actions .btn { flex: 1; }
  .banner { flex-wrap: wrap; }
  .search-box { display: none; }
  .map-box, .track-map { height: 300px; }
  .split-5-7 { grid-template-columns: 1fr !important; }
  .card-head .select.sm, .card-head .input.sm { width: 100% !important; }
  .card-head > .flex { width: 100%; }
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media print { .bottom-nav { display: none !important; } }
.public-top > div { display: flex; align-items: center; gap: 12px; }
.public-tag { color: #cfe0f7; font-size: 12px; font-weight: 600; margin-left: auto; }

/* picker list (FASTag) */
.pick-list { display: flex; flex-direction: column; margin: 0 -4px; }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); color: inherit; border-radius: 10px; }
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: var(--orange-50); }
.pick-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--navy-50); color: var(--navy); display: grid; place-items: center; font-size: 18px; flex: none; }
.pick-main { display: flex; flex-direction: column; min-width: 0; flex: 0 0 190px; line-height: 1.25; }
.pick-main b { font-size: 13.5px; color: var(--navy); } .pick-main small { color: var(--muted); font-size: 11.5px; }
.pick-route { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-route i { color: var(--orange); }
.search-inline .input { width: 240px; }
@media (max-width: 640px) {
  .pick-row { flex-wrap: wrap; } .pick-main { flex: 1 1 auto; } .pick-route { order: 5; flex: 1 0 100%; padding-left: 46px; white-space: normal; }
  .search-inline, .search-inline .input { width: 100%; }
}
.stat > div:last-child { min-width: 0; }
.stat-value, .stat-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1000px) and (max-width: 1300px) { .stat-value { font-size: 16px; } .stat { padding: 11px 12px; } }

/* ---------- AI assistant ---------- */
.ai-card { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - 150px); min-height: 460px; overflow: hidden; }
.ai-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: linear-gradient(180deg, var(--navy-50), #fff 40%); }
.ai-hello { margin: auto; text-align: center; max-width: 380px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; align-items: center; }
.ai-hello img { width: 130px; } .ai-hello b { color: var(--navy); font-size: 15px; }
.ai-msg { display: flex; gap: 8px; max-width: 92%; }
.ai-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.ai-av { width: 28px; height: 28px; border-radius: 9px; background: var(--navy); color: var(--orange); display: grid; place-items: center; flex: none; font-size: 15px; }
.ai-bub { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 9px 13px; min-width: 0; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(10, 45, 82, .05); }
.ai-msg.me .ai-bub { background: var(--navy); color: #fff; border-color: var(--navy); border-bottom-right-radius: 4px; }
.ai-msg.bot .ai-bub { border-top-left-radius: 4px; }
.ai-bub p { margin: 0 0 4px; } .ai-bub p:last-child { margin: 0; } .ai-bub ul { margin: 4px 0 4px 16px; padding: 0; }
.ai-bub .table-wrap { margin: 6px -4px; max-width: 100%; overflow-x: auto; } .ai-bub code { background: var(--navy-50); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.ai-tools { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-top: 8px; font-size: 10.5px; color: var(--muted); }
.ai-tools span { background: var(--navy-50); border-radius: 99px; padding: 1px 8px; text-transform: capitalize; }
.ai-confirm { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--orange-50); border: 1px solid var(--orange-100); display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 12.5px; }
.ai-confirm i { color: var(--orange-600); } .ai-confirm.done { background: var(--ok-bg); border-color: var(--ok); display: block; } .ai-confirm.fail { background: #fdecec; display: block; }
.ai-confirm-btns { display: flex; gap: 6px; }
.ai-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px 0; }
.chip-btn { border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 99px; padding: 5px 12px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.chip-btn:hover { border-color: var(--orange); background: var(--orange-50); }
.ai-form { display: flex; gap: 8px; padding: 10px 14px; align-items: flex-end; border-top: 1px solid var(--line); }
.ai-form .textarea { flex: 1; resize: none; min-height: 38px; max-height: 130px; padding-top: 9px; }
.ai-foot { padding: 0 14px 10px; font-size: 10.5px; color: var(--muted); }
.ai-typing { display: inline-flex; gap: 4px; padding: 4px 2px; } .ai-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--navy-700); opacity: .35; animation: aib 1s infinite; }
.ai-typing i:nth-child(2) { animation-delay: .15s; } .ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aib { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.ai-fab { position: fixed; right: 18px; bottom: 18px; z-index: 43; width: 48px; height: 48px; border-radius: 16px; background: var(--navy); color: var(--orange); display: grid; place-items: center; font-size: 22px; box-shadow: 0 8px 22px rgba(10, 45, 82, .35); transition: transform .15s; }
.ai-fab:hover { transform: translateY(-2px) scale(1.04); }
@media (max-width: 991px) { .ai-fab { bottom: calc(var(--bottom-nav-h) + var(--safe-b) + 12px); right: 14px; width: 44px; height: 44px; } .ai-card { height: calc(100vh - var(--topbar-h) - var(--bottom-nav-h) - 130px); } }
@media (max-width: 640px) { .hide-sm { display: none; } .ai-msg { max-width: 100%; } }

.ai-det { margin-top: 6px; font-size: 12px; border-collapse: collapse; } .ai-det td { padding: 2px 10px 2px 0; vertical-align: top; } .ai-det td:first-child { color: var(--muted); white-space: nowrap; } .ai-det td:last-child { font-weight: 600; word-break: break-word; }
