/* ==========================================================================
   Singh Logistics — Dark Blue design system
   ========================================================================== */
:root {
  --bg: #f1f4f9;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --line: #e1e7f1;
  --line-2: #edf1f7;
  --ink: #0d1a33;
  --ink-2: #2a3957;
  --muted: #6a7894;
  --navy: #0b2a5b;
  --navy-700: #123a7c;
  --navy-800: #0d3068;
  --navy-900: #071b3d;
  --navy-100: #d6e2f7;
  --navy-50: #eaf0fb;
  --accent: #2f6feb;
  --ok: #0b8f63;      --ok-bg: #e2f6ed;
  --warn: #a8690c;    --warn-bg: #fff2d3;
  --bad: #c9302f;     --bad-bg: #fde8e8;
  --info: #1a63c7;    --info-bg: #e2edfd;
  --radius: 16px;
  --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: 272px;
  --topbar-h: 72px;
  --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: 14px; line-height: 1.5;
  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%; }
}
