/* ============================================================
   M&M 통합 운송 관제 — Design System
   ============================================================ */
:root{
  --navy:#0b1e33;
  --navy-2:#102a47;
  --navy-3:#17395c;
  --blue:#1487c9;
  --blue-2:#0f6fae;
  --cyan:#22b6e8;
  --orange:#ff6a3d;
  --green:#0f9d76;
  --amber:#e9a13b;
  --red:#e0454a;
  --purple:#7a5af8;
  --ink:#16202f;
  --ink-2:#324158;
  --muted:#526278;
  --muted-2:#617187;
  --line:#e3e9f2;
  --line-2:#eef2f8;
  --bg:#f3f6fb;
  --card:#ffffff;
  --radius:14px;
  --radius-sm:10px;
  --shadow:0 1px 2px rgba(16,32,56,.04), 0 8px 24px -18px rgba(16,32,56,.28);
  --shadow-lg:0 24px 60px -24px rgba(11,30,51,.35);
  --sidebar-w:246px;
  --font:"Pretendard","Pretendard Variable",-apple-system,BlinkMacSystemFont,"Malgun Gothic","Apple SD Gothic Neo",system-ui,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{
  font-family:var(--font);
  background:var(--bg);
  color:var(--ink);
  font-size:14px;
  line-height:1.5;
  letter-spacing:-.01em;
  word-break:keep-all;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;background:none;border:0;padding:0}
img{max-width:100%}
svg{width:16px;height:16px;flex:0 0 auto;display:inline-block;vertical-align:middle}
h1,h2,h3,h4,p{margin:0}
ul{margin:0;padding:0;list-style:none}
::selection{background:rgba(20,135,201,.18)}
:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
.mono{font-variant-numeric:tabular-nums}
.num{font-variant-numeric:tabular-nums;font-feature-settings:"tnum"}
.hidden{display:none!important}
.only-mobile{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* ---------- Layout ---------- */
.app{display:flex;min-height:100vh;min-height:100dvh}
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.sidebar{
  width:var(--sidebar-w);
  flex:0 0 var(--sidebar-w);
  background:
    radial-gradient(1200px 400px at -10% -10%, rgba(34,182,232,.22), transparent 60%),
    linear-gradient(180deg,#0b1e33 0%,#0a1a2d 55%,#081726 100%);
  color:#dbe7f5;
  display:flex;flex-direction:column;
  position:sticky;top:0;height:100vh;height:100dvh;
  z-index:30;
  border-right:1px solid rgba(255,255,255,.04);
}
.brand{display:flex;align-items:center;gap:11px;padding:20px 18px 16px}
.brand-chip{
  width:44px;height:44px;border-radius:12px;background:#fff;
  display:grid;place-items:center;padding:5px;flex:0 0 auto;
  box-shadow:0 6px 18px -8px rgba(0,0,0,.6);
}
.brand-chip img{width:100%;height:100%;object-fit:contain}
.brand-text{display:flex;flex-direction:column;line-height:1.25;min-width:0}
.brand-text strong{font-size:14.5px;color:#fff;letter-spacing:-.02em;white-space:nowrap}
.brand-text small{font-size:9.5px;letter-spacing:.14em;color:#7fa6c9;margin-top:3px}
.nav{flex:1;overflow:auto;padding:6px 10px 12px;scrollbar-width:thin}
.nav::-webkit-scrollbar{width:6px}
.nav::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12);border-radius:6px}
.nav-group{margin:14px 0 4px;padding:0 10px;font-size:10.5px;font-weight:700;letter-spacing:.13em;color:#5d7fa3;text-transform:uppercase}
.nav-item{
  display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:9px;
  color:#b9cbe0;font-size:13.5px;font-weight:500;margin:2px 0;position:relative;
  transition:background .15s,color .15s;
}
.nav-item svg{width:18px;height:18px;flex:0 0 18px;opacity:.85}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}
.nav-item.active{background:linear-gradient(90deg,rgba(34,182,232,.18),rgba(34,182,232,.05));color:#fff}
.nav-item.active::before{content:"";position:absolute;left:-10px;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:var(--cyan)}
.nav-item.active svg{opacity:1;color:var(--cyan)}
.nav-badge{margin-left:auto;font-size:10.5px;font-weight:700;background:rgba(34,182,232,.18);color:#8fdcff;border-radius:20px;padding:1px 7px;min-width:20px;text-align:center}
.nav-badge.warn{background:rgba(255,106,61,.18);color:#ffb59c}
.sidebar-foot{padding:10px 12px 14px;border-top:1px solid rgba(255,255,255,.06)}
.foot-card{display:flex;align-items:center;gap:10px;width:100%;padding:10px;border-radius:11px;background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.06);text-align:left;color:#dbe7f5;transition:background .15s}
.foot-card:hover{background:rgba(255,255,255,.08)}
.foot-icon{width:30px;height:30px;border-radius:8px;background:rgba(34,182,232,.16);display:grid;place-items:center;color:#8fdcff;flex:0 0 auto}
.foot-icon svg{width:17px;height:17px}
.foot-card strong{display:block;font-size:12px;color:#fff;font-weight:600}
.foot-card small{display:block;font-size:10.5px;color:#82a2c2;margin-top:1px}
.foot-arrow{margin-left:auto;color:#5d7fa3}
.foot-meta{display:flex;align-items:center;gap:6px;padding:10px 4px 0;font-size:10.5px;color:#6b8aab}
.dot{width:6px;height:6px;border-radius:50%;background:var(--green);flex:0 0 auto}
.dot.warn{background:var(--amber)}
.dot.bad{background:var(--red)}

.topbar{
  min-height:66px;display:flex;align-items:center;gap:14px;
  padding:12px 26px;background:rgba(255,255,255,.86);
  backdrop-filter:saturate(140%) blur(10px);
  border-bottom:1px solid var(--line);
  position:sticky;top:0;z-index:20;
}
.topbar-title{min-width:0;flex:1}
.topbar-title h1{font-size:18px;font-weight:800;letter-spacing:-.03em;line-height:1.3}
.topbar-title p{font-size:11.5px;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.topbar-user{display:flex;align-items:center;gap:8px;margin-left:4px}
.chip-date{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 11px;border-radius:9px;border:1px solid var(--line);background:#fff;font-size:12px;font-weight:600;color:var(--ink-2)}
.chip-date:hover{border-color:#cbd6e6;background:#fbfcfe}
.avatar{width:34px;height:34px;border-radius:50%;background:linear-gradient(145deg,var(--navy-3),var(--blue-2));color:#fff;font-size:12px;font-weight:700;display:grid;place-items:center;box-shadow:0 4px 10px -4px rgba(11,30,51,.5)}
.view{padding:22px 26px 54px;flex:1;outline:none;max-width:1560px;width:100%;margin:0 auto}
.mobile-nav{display:none}

/* ---------- Common ---------- */
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:18px;flex-wrap:wrap}
.page-head h2{font-size:20px;font-weight:800;letter-spacing:-.03em}
.page-head p{font-size:12.5px;color:var(--muted);margin-top:4px}
.page-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.section{margin-top:22px}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:11px;flex-wrap:wrap}
.section-head h3{font-size:14.5px;font-weight:700;letter-spacing:-.02em;display:flex;align-items:center;gap:7px}
.section-head h3 .count{font-size:11px;font-weight:700;color:var(--muted);background:var(--bg);border:1px solid var(--line);border-radius:20px;padding:1px 8px}
.section-head .hint{font-size:11.5px;color:var(--muted)}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.card-pad{padding:18px}
.card-tight{padding:14px}
.grid{display:grid;gap:14px}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.split{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(280px,1fr);gap:16px;align-items:start}
.stack{display:flex;flex-direction:column;gap:14px}
.row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.row-between{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.muted{color:var(--muted)}
.small{font-size:13px}
.tiny{font-size:12px}
.strong{font-weight:700}
.right{text-align:right}
.nowrap{white-space:nowrap}
.divider{height:1px;background:var(--line-2);margin:14px 0}
.scroll-x{overflow-x:auto;scrollbar-width:thin}

/* ---------- Buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:34px;padding:0 13px;border-radius:9px;font-size:12.5px;font-weight:600;border:1px solid transparent;white-space:nowrap;transition:background .15s,border-color .15s,color .15s,transform .06s}
.btn:active{transform:translateY(1px)}
.btn svg{width:15px;height:15px}
.btn-primary{background:linear-gradient(180deg,var(--blue),var(--blue-2));color:#fff;box-shadow:0 6px 16px -8px rgba(15,111,174,.65)}
.btn-primary:hover{filter:brightness(1.05)}
.btn-dark{background:var(--navy);color:#fff}
.btn-dark:hover{background:var(--navy-2)}
.btn-ghost{background:#fff;border-color:var(--line);color:var(--ink-2)}
.btn-ghost:hover{background:#f7f9fd;border-color:#cbd6e6}
.btn-soft{background:rgba(20,135,201,.09);color:var(--blue-2)}
.btn-soft:hover{background:rgba(20,135,201,.15)}
.btn-danger{background:#fff;border-color:#f2c9cb;color:var(--red)}
.btn-danger:hover{background:#fdf3f3}
.btn-sm{height:28px;padding:0 10px;font-size:11.5px;border-radius:8px}
.btn-xs{height:24px;padding:0 8px;font-size:10.5px;border-radius:7px}
.btn-lg{height:42px;padding:0 18px;font-size:13.5px;border-radius:10px}
.btn[disabled]{opacity:.45;cursor:not-allowed}
.icon-btn{width:32px;height:32px;border-radius:8px;display:inline-grid;place-items:center;color:var(--muted);border:1px solid transparent}
.icon-btn:hover{background:#f1f5fa;color:var(--ink)}
.icon-btn svg{width:17px;height:17px}
.seg{display:inline-flex;background:#eef2f8;border-radius:9px;padding:3px;gap:2px}
.seg button{height:27px;padding:0 11px;border-radius:7px;font-size:11.5px;font-weight:600;color:var(--muted)}
.seg button.active{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(16,32,56,.12)}
.link{color:var(--blue-2);font-weight:600;font-size:12px}
.link:hover{text-decoration:underline}

/* ---------- Badges / pills ---------- */
.badge{display:inline-flex;align-items:center;gap:4px;height:21px;padding:0 7px;border-radius:6px;font-size:10.5px;font-weight:700;letter-spacing:-.01em;white-space:nowrap}
.badge.gray{background:#f0f3f8;color:#5d6d83}
.badge.blue{background:rgba(20,135,201,.1);color:#0f6fae}
.badge.green{background:rgba(15,157,118,.11);color:#0a7a5b}
.badge.amber{background:rgba(233,161,59,.14);color:#a86a10}
.badge.red{background:rgba(224,69,74,.1);color:#b62f34}
.badge.purple{background:rgba(122,90,248,.1);color:#5b3fd6}
.badge.dark{background:var(--navy);color:#fff}
.pill{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:20px;font-size:10.5px;font-weight:600;background:#f2f5fa;color:var(--ink-2);border:1px solid var(--line)}
.pill .dot{width:5px;height:5px}
.grade{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:7px;font-size:11px;font-weight:800;color:#fff;flex:0 0 auto}
.grade.S{background:linear-gradient(145deg,#f2b53d,#d8920a);box-shadow:0 3px 8px -4px rgba(216,146,10,.7)}
.grade.A{background:linear-gradient(145deg,#2d9be0,#0f6fae)}
.grade.B{background:linear-gradient(145deg,#2bb98b,#0b8261)}
.grade.C{background:linear-gradient(145deg,#e9b04f,#c48215)}
.grade.D{background:linear-gradient(145deg,#f08355,#cf5a28)}
.grade.F{background:linear-gradient(145deg,#95a3b6,#6b7a90)}
.tag{display:inline-flex;align-items:center;height:20px;padding:0 7px;border-radius:5px;font-size:10px;font-weight:600;background:#f4f6fa;color:var(--muted);border:1px solid var(--line-2)}

/* ---------- KPI ---------- */
.kpi{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:15px 16px;box-shadow:var(--shadow);position:relative;overflow:hidden}
.kpi::after{content:"";position:absolute;right:-18px;top:-26px;width:86px;height:86px;border-radius:50%;background:radial-gradient(circle,rgba(20,135,201,.09),transparent 70%)}
.kpi-label{font-size:11.5px;color:var(--muted);font-weight:600;display:flex;align-items:center;gap:6px}
.kpi-icon{width:24px;height:24px;border-radius:7px;display:grid;place-items:center;background:rgba(20,135,201,.09);color:var(--blue-2)}
.kpi-icon svg{width:14px;height:14px}
.kpi-value{font-size:26px;font-weight:800;letter-spacing:-.04em;margin-top:9px;line-height:1.1;font-variant-numeric:tabular-nums}
.kpi-value small{font-size:12px;font-weight:700;color:var(--muted);margin-left:3px;letter-spacing:0}
.kpi-foot{display:flex;align-items:center;gap:6px;margin-top:7px;font-size:10.5px;color:var(--muted);min-height:16px}
.kpi-foot b{font-weight:700;color:var(--ink-2)}
.kpi.warn .kpi-icon{background:rgba(255,106,61,.11);color:#d94d23}
.kpi.good .kpi-icon{background:rgba(15,157,118,.11);color:#0a7a5b}
.kpi.grade-kpi .kpi-value{font-size:24px}
.trend{display:inline-flex;align-items:center;gap:2px;font-weight:700;font-size:10.5px}
.trend.up{color:#0a7a5b}
.trend.down{color:#b62f34}

/* ---------- Chart ---------- */
.chart{width:100%;height:auto;display:block;overflow:visible}
.bars{display:flex;align-items:flex-end;gap:6px;height:132px;padding-top:8px}
.bar-col{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:6px;min-width:0;position:relative}
.bar{width:100%;max-width:34px;border-radius:5px 5px 3px 3px;background:linear-gradient(180deg,#3fb3e8,#1487c9);min-height:3px;transition:height .4s ease}
.bar.dim{background:#dbe5f1}
.bar-lbl{font-size:9.5px;color:var(--muted-2);white-space:nowrap}
.bar-val{font-size:9.5px;color:var(--ink-2);font-weight:700;white-space:nowrap}
.donut-wrap{display:flex;align-items:center;gap:18px}
.donut-legend{display:flex;flex-direction:column;gap:7px;min-width:0}
.legend-row{display:flex;align-items:center;gap:7px;font-size:11.5px;color:var(--ink-2)}
.legend-swatch{width:8px;height:8px;border-radius:2px;flex:0 0 auto}
.legend-row b{margin-left:auto;font-variant-numeric:tabular-nums}

/* ---------- Table ---------- */
.table-wrap{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.table-scroll{overflow:auto;max-height:calc(100vh - 300px);scrollbar-width:thin}
.table-scroll::-webkit-scrollbar{width:9px;height:9px}
.table-scroll::-webkit-scrollbar-thumb{background:#cdd8e6;border-radius:9px}
table.data{width:100%;border-collapse:separate;border-spacing:0;font-size:12.3px}
table.data thead th{position:sticky;top:0;z-index:2;background:#f8fafd;border-bottom:1px solid var(--line);text-align:left;font-size:10.5px;font-weight:700;letter-spacing:.03em;color:#64748b;padding:9px 11px;white-space:nowrap}
table.data tbody td{padding:9px 11px;border-bottom:1px solid var(--line-2);vertical-align:middle;color:var(--ink-2)}
table.data tbody tr:hover td{background:#f9fbfe}
table.data tbody tr.selected td{background:rgba(20,135,201,.055)}
table.data tbody tr.clickable{cursor:pointer}
table.data tbody tr:last-child td{border-bottom:0}
table.data .t-title{font-weight:650;color:var(--ink)}
table.data .t-sub{font-size:10.5px;color:var(--muted);margin-top:1px}
table.data td.num,table.data th.num{text-align:right;font-variant-numeric:tabular-nums}
table.data tr.row-cancelled td{color:#9aa7b8}
table.data tr.row-cancelled .t-title{color:#93a1b4;text-decoration:line-through}
table.data tr.row-support td{background:rgba(233,161,59,.035)}
.table-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 13px;border-top:1px solid var(--line);background:#fcfdff;flex-wrap:wrap}
.pager{display:flex;align-items:center;gap:4px}
.pager button{min-width:28px;height:28px;border-radius:7px;font-size:11.5px;font-weight:600;color:var(--muted);padding:0 7px}
.pager button:hover{background:#f1f5fa}
.pager button.active{background:var(--navy);color:#fff}
.pager button[disabled]{opacity:.35}
.table-empty{padding:46px 20px;text-align:center;color:var(--muted)}
.table-empty .big{font-size:30px;margin-bottom:8px;opacity:.5}

/* ---------- Toolbar / filters ---------- */
.toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:11px 13px;background:var(--card);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow)}
.date-range{display:flex;align-items:center;gap:5px;white-space:nowrap;flex:0 0 auto}
.date-range .input{width:132px}
.date-range svg{color:var(--muted-2)}
.toolbar-spacer{flex:1 1 auto;min-width:0}
.toolbar-actions{display:flex;align-items:center;gap:6px;flex-wrap:nowrap}
@media(max-width:1360px){.toolbar .search{flex:1 1 240px;max-width:none}}
@media(max-width:900px){.date-range{flex:1 1 100%}.date-range .input{flex:1;width:auto}}
.search{position:relative;display:flex;align-items:center;min-width:190px;flex:1;max-width:320px}
.search svg{position:absolute;left:10px;width:15px;height:15px;color:var(--muted-2);pointer-events:none}
.search input{width:100%;height:32px;border:1px solid var(--line);border-radius:8px;background:#fff;padding:0 10px 0 31px;font-size:12px}
.search input:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px rgba(20,135,201,.1)}
.field-inline{display:flex;align-items:center;gap:5px;font-size:11.5px;color:var(--muted)}
.input,.select,.textarea{width:100%;border:1px solid var(--line);border-radius:8px;background:#fff;padding:8px 10px;font-size:12.5px;min-height:34px;transition:border-color .15s,box-shadow .15s}
.input:focus,.select:focus,.textarea:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px rgba(20,135,201,.1)}
.select{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236f7f95' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 9px center;padding-right:28px}
.select-sm{height:30px;min-height:30px;font-size:11.5px;padding:4px 26px 4px 8px;width:auto}
.textarea{min-height:84px;resize:vertical;line-height:1.55}
.input-sm{height:30px;min-height:30px;font-size:11.5px;padding:4px 8px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px}
.form-grid .full{grid-column:1/-1}
.field{display:flex;flex-direction:column;gap:5px;min-width:0}
.field label{font-size:11px;font-weight:700;color:var(--muted)}
.field .help{font-size:10.5px;color:var(--muted-2);line-height:1.45}
.field .req{color:var(--orange)}
.check{display:inline-flex;align-items:center;gap:7px;font-size:12px;color:var(--ink-2);cursor:pointer}
.check input{width:15px;height:15px;accent-color:var(--blue)}
.switch{position:relative;display:inline-flex;align-items:center;gap:8px;font-size:12px;cursor:pointer}
.switch input{position:absolute;opacity:0}
.switch .track{width:36px;height:20px;border-radius:20px;background:#d7e0ec;transition:background .18s;flex:0 0 auto;position:relative}
.switch .track::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.2);transition:transform .18s}
.switch input:checked + .track{background:var(--blue)}
.switch input:checked + .track::after{transform:translateX(16px)}
.chips{display:flex;gap:5px;flex-wrap:wrap}
.chip-toggle{height:26px;padding:0 9px;border-radius:20px;border:1px solid var(--line);background:#fff;font-size:11px;color:var(--muted);font-weight:600}
.chip-toggle.on{background:rgba(20,135,201,.1);border-color:rgba(20,135,201,.35);color:var(--blue-2)}

/* ---------- Empty / skeleton ---------- */
.empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:44px 20px;gap:8px}
.empty .icon{width:52px;height:52px;border-radius:16px;background:#eef4fb;display:grid;place-items:center;color:#7fa6c9;margin-bottom:2px}
.empty .icon svg{width:24px;height:24px}
.empty h4{font-size:13.5px;font-weight:700}
.empty p{font-size:11.5px;color:var(--muted);max-width:340px;line-height:1.6}

/* ---------- Modal / Drawer / Toast ---------- */
.overlay{position:fixed;inset:0;background:rgba(9,20,35,.46);backdrop-filter:blur(2px);z-index:80;display:flex;align-items:center;justify-content:center;padding:22px;animation:fade .16s ease}
@keyframes fade{from{opacity:0}to{opacity:1}}
.modal{background:#fff;border-radius:16px;box-shadow:var(--shadow-lg);width:100%;max-width:560px;max-height:calc(100vh - 44px);display:flex;flex-direction:column;animation:pop .18s cubic-bezier(.2,.9,.3,1.1)}
.modal.wide{max-width:860px}
.modal.xwide{max-width:1080px}
@keyframes pop{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
.modal-head{display:flex;align-items:flex-start;gap:12px;padding:18px 20px 12px;border-bottom:1px solid var(--line-2)}
.modal-head .t{flex:1;min-width:0}
.modal-head h3{font-size:16px;font-weight:800;letter-spacing:-.02em}
.modal-head p{font-size:11.5px;color:var(--muted);margin-top:3px}
.modal-body{padding:18px 20px;overflow:auto;flex:1}
.modal-foot{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:12px 20px 17px;border-top:1px solid var(--line-2)}
.drawer-overlay{position:fixed;inset:0;background:rgba(9,20,35,.4);z-index:80;display:flex;justify-content:flex-end;animation:fade .15s ease}
.drawer{width:100%;max-width:480px;background:#fff;height:100%;display:flex;flex-direction:column;box-shadow:var(--shadow-lg);animation:slidein .2s ease}
.drawer.wide{max-width:640px}
@keyframes slidein{from{transform:translateX(24px);opacity:.6}to{transform:none;opacity:1}}
.toast-root{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);z-index:120;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none;width:min(92vw,420px)}
.toast{pointer-events:auto;background:var(--navy);color:#fff;border-radius:11px;padding:11px 15px;font-size:12.5px;box-shadow:0 16px 40px -16px rgba(11,30,51,.7);display:flex;align-items:center;gap:9px;width:100%;animation:toastin .2s ease}
.toast.success{background:#0c6b52}
.toast.warn{background:#8a5a12}
.toast.error{background:#9c2b30}
.toast svg{width:16px;height:16px;flex:0 0 auto}
@keyframes toastin{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.toast .x{margin-left:auto;color:rgba(255,255,255,.65);font-size:15px;line-height:1}
.progress{height:7px;border-radius:6px;background:#e9eff7;overflow:hidden}
.progress > span{display:block;height:100%;border-radius:6px;background:linear-gradient(90deg,var(--cyan),var(--blue));transition:width .3s}
.progress.warn > span{background:linear-gradient(90deg,#f3b34f,var(--amber))}
.progress.bad > span{background:linear-gradient(90deg,#ee7a70,var(--red))}

/* ---------- Import ---------- */
.dropzone{border:1.5px dashed #c3d3e5;border-radius:14px;background:linear-gradient(180deg,#fbfdff,#f6faff);padding:30px 20px;text-align:center;transition:border-color .15s,background .15s;cursor:pointer}
.dropzone:hover,.dropzone.over{border-color:var(--blue);background:rgba(20,135,201,.04)}
.dropzone .dz-icon{width:46px;height:46px;border-radius:14px;background:#e8f2fb;color:var(--blue-2);display:grid;place-items:center;margin:0 auto 10px}
.dropzone .dz-icon svg{width:22px;height:22px}
.dropzone h4{font-size:13.5px;font-weight:700}
.dropzone p{font-size:11.5px;color:var(--muted);margin-top:4px}
.file-card{display:flex;align-items:center;gap:11px;padding:11px 13px;border:1px solid var(--line);border-radius:10px;background:#fff}
.file-card .fi{width:34px;height:34px;border-radius:9px;background:rgba(15,157,118,.1);color:#0a7a5b;display:grid;place-items:center;flex:0 0 auto}
.file-card .fi svg{width:17px;height:17px}
.file-card .meta{flex:1;min-width:0}
.file-card .meta strong{display:block;font-size:12.5px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-card .meta small{font-size:10.5px;color:var(--muted)}
.steps{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:14px}
.step{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--muted)}
.step .n{width:19px;height:19px;border-radius:50%;background:#e8eef7;color:var(--muted);display:grid;place-items:center;font-size:10px;font-weight:700}
.step.on{color:var(--ink);font-weight:700}
.step.on .n{background:var(--navy);color:#fff}
.step.done .n{background:var(--green);color:#fff}
.step-sep{width:14px;height:1px;background:var(--line);display:inline-block}
.map-table{width:100%;border-collapse:collapse;font-size:11.5px}
.map-table th,.map-table td{padding:6px 7px;border-bottom:1px solid var(--line-2);text-align:left}
.map-table th{font-size:10px;color:var(--muted);font-weight:700;background:#f8fafd}
.map-table select{width:100%;min-width:120px;height:28px;font-size:11px;border:1px solid var(--line);border-radius:6px;background:#fff;padding:2px 22px 2px 7px}
.preview-table{width:100%;border-collapse:collapse;font-size:10.8px}
.preview-table th,.preview-table td{white-space:nowrap;padding:5px 7px;border-bottom:1px solid var(--line-2);max-width:180px;overflow:hidden;text-overflow:ellipsis}
.preview-table th{background:#f8fafd;font-size:10px;color:var(--muted);position:sticky;top:0}

/* ---------- Assign ---------- */
.plan-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:12px}
.plan{background:#fff;border:1px solid var(--line);border-radius:12px;overflow:hidden;box-shadow:var(--shadow)}
.plan-head{display:flex;align-items:center;gap:9px;padding:11px 13px;background:linear-gradient(180deg,#f8fbff,#fff);border-bottom:1px solid var(--line-2)}
.plan-head .who{flex:1;min-width:0}
.plan-head .who strong{display:block;font-size:13px;font-weight:750}
.plan-head .who small{display:block;font-size:10.5px;color:var(--muted);margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.plan-metrics{display:flex;gap:5px;flex-wrap:wrap;padding:9px 13px 4px}
.plan-orders{padding:4px 0 8px;max-height:260px;overflow:auto}
.plan-order{display:flex;align-items:center;gap:8px;padding:6px 13px;font-size:11.5px}
.plan-order:hover{background:#f8fbfe}
.plan-order .r{flex:1;min-width:0}
.plan-order .r strong{display:block;font-size:11.5px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.plan-order .r small{display:block;font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.plan-reason{display:flex;gap:4px;flex-wrap:wrap;padding:8px 13px 10px;border-top:1px dashed var(--line-2)}
.reason{font-size:9.5px;color:#5b6c83;background:#f3f7fc;border:1px solid #e6eef8;border-radius:12px;padding:2px 7px}
.unassigned{border:1px solid #f3d7c7;background:#fff9f5;border-radius:12px;padding:12px}
.unassigned h4{font-size:12.5px;font-weight:700;color:#a34a1d;margin-bottom:6px}
.unassigned ul{display:flex;flex-direction:column;gap:5px}
.unassigned li{display:flex;gap:7px;font-size:11.5px;color:#7a4a31}
.unassigned li .why{margin-left:auto;font-size:10px;color:#a86a42}
.assign-summary{display:flex;gap:16px;flex-wrap:wrap;align-items:center;padding:12px 15px;border-radius:12px;background:linear-gradient(90deg,#0b1e33,#17395c);color:#fff}
.assign-summary .as{display:flex;flex-direction:column;gap:1px;min-width:70px}
.assign-summary .as span{font-size:10.5px;color:#9db8d4}
.assign-summary .as b{font-size:18px;font-weight:800;letter-spacing:-.02em}
.assign-summary .as b small{font-size:11px;font-weight:600;color:#9db8d4}

/* ---------- Evaluation ---------- */
.metric{display:flex;flex-direction:column;gap:4px}
.metric-top{display:flex;justify-content:space-between;font-size:10.5px;color:var(--muted)}
.metric-top b{color:var(--ink-2)}
.metric-bar{height:5px;border-radius:4px;background:#edf2f9;overflow:hidden}
.metric-bar span{display:block;height:100%;border-radius:4px;background:linear-gradient(90deg,var(--cyan),var(--blue))}
.score-big{font-size:34px;font-weight:850;letter-spacing:-.05em;line-height:1}
.score-big small{font-size:12px;color:var(--muted);font-weight:600}
.driver-hero{display:flex;align-items:center;gap:14px;padding:16px;border-radius:13px;background:linear-gradient(120deg,#0e2338,#1a4570);color:#fff}
.driver-hero .avatar-lg{width:52px;height:52px;border-radius:15px;background:rgba(255,255,255,.12);display:grid;place-items:center;font-size:20px;font-weight:800;color:#fff}
.driver-hero .info{flex:1;min-width:0}
.driver-hero .info strong{font-size:16px;font-weight:800;display:block}
.driver-hero .info small{font-size:11px;color:#a9c4de}
.driver-hero .score{text-align:right}
.driver-hero .score b{font-size:28px;font-weight:850;letter-spacing:-.04em}
.driver-hero .score small{display:block;font-size:10px;color:#a9c4de}
.rank-1{background:rgba(233,161,59,.09)}
.rank-2{background:rgba(20,135,201,.05)}
.rank-3{background:rgba(15,157,118,.05)}
.insight{display:flex;gap:9px;padding:11px 13px;border-radius:10px;background:#f5f9ff;border:1px solid #e0ebf8;font-size:11.5px;color:#3c5674;line-height:1.6}
.insight svg{width:16px;height:16px;flex:0 0 auto;margin-top:1px;color:var(--blue-2)}
.insight.warn{background:#fff9f1;border-color:#f5e3c8;color:#7a5a28}
.insight.warn svg{color:#b07a1d}

/* ---------- Tabs ---------- */
.tabs{display:flex;gap:2px;border-bottom:1px solid var(--line);margin-bottom:16px;overflow-x:auto;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tabs button{position:relative;padding:9px 13px;font-size:12.5px;font-weight:600;color:var(--muted);white-space:nowrap;border-bottom:2px solid transparent;margin-bottom:-1px}
.tabs button.active{color:var(--ink);border-color:var(--blue)}
.tabs button .n{font-size:10px;background:#eef2f8;border-radius:10px;padding:1px 5px;margin-left:3px;color:var(--muted)}

/* ---------- Mobile role app ---------- */
body.role-mode{background:#eef2f7}
body.role-mode .app{display:block}
body.role-mode .sidebar,body.role-mode .topbar,body.role-mode .mobile-nav{display:none!important}
body.role-mode .view{padding:0;max-width:none}
.role-shell{max-width:560px;margin:0 auto;min-height:100vh;background:#f5f7fb;display:flex;flex-direction:column}
.role-head{background:linear-gradient(160deg,#0b1e33,#17456f);color:#fff;padding:16px 18px 22px;border-radius:0 0 22px 22px;position:relative;overflow:hidden}
.role-head::after{content:"";position:absolute;right:-40px;top:-50px;width:180px;height:180px;border-radius:50%;background:radial-gradient(circle,rgba(34,182,232,.35),transparent 65%)}
.role-head .rh-top{display:flex;align-items:center;justify-content:space-between;gap:10px;position:relative;z-index:1}
.role-head .rh-top img{height:26px;background:#fff;border-radius:6px;padding:3px 5px}
.role-head h2{font-size:19px;font-weight:800;margin-top:14px;letter-spacing:-.03em}
.role-head p{font-size:11.5px;color:#a9c4de;margin-top:3px}
.role-body{padding:14px;display:flex;flex-direction:column;gap:12px;flex:1}
.role-card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px;box-shadow:0 4px 14px -12px rgba(16,32,56,.4)}
.role-tabs{display:flex;gap:4px;padding:4px;background:#e9eef6;border-radius:11px;margin-top:12px}
.role-tabs a{flex:1;text-align:center;padding:7px 4px;border-radius:8px;font-size:11.5px;font-weight:700;color:var(--muted)}
.role-tabs a.active{background:#fff;color:var(--ink);box-shadow:0 1px 4px rgba(16,32,56,.12)}
.trip{display:flex;gap:10px;padding:11px 0;border-bottom:1px solid var(--line-2)}
.trip:last-child{border-bottom:0}
.trip .seq{width:24px;height:24px;border-radius:7px;background:#eef5fc;color:var(--blue-2);display:grid;place-items:center;font-size:10.5px;font-weight:800;flex:0 0 auto}
.trip .t-body{flex:1;min-width:0}
.trip .t-body strong{font-size:12.5px;display:block;line-height:1.4}
.trip .t-body small{font-size:10.5px;color:var(--muted);display:block;margin-top:2px;line-height:1.45}
.trip .t-act{display:flex;align-items:flex-start}
.role-fab{position:sticky;bottom:14px;margin-top:auto}
.mobile-tabbar{position:sticky;bottom:0;display:flex;background:rgba(255,255,255,.96);border-top:1px solid var(--line);backdrop-filter:blur(8px);padding:7px 6px calc(7px + env(safe-area-inset-bottom));z-index:5}
.mobile-tabbar a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:9.5px;color:var(--muted);font-weight:600;padding:3px 0;border-radius:8px}
.mobile-tabbar a.active{color:var(--blue-2)}
.mobile-tabbar svg{width:19px;height:19px}
.hub{display:grid;grid-template-columns:repeat(3,1fr);gap:11px}
.hub a{background:#fff;border:1px solid var(--line);border-radius:14px;padding:16px 10px;text-align:center;box-shadow:var(--shadow);transition:transform .15s,border-color .15s}
.hub a:hover{transform:translateY(-2px);border-color:#c8d8ea}
.hub .h-ic{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;margin:0 auto 8px;background:rgba(20,135,201,.1);color:var(--blue-2)}
.hub .h-ic svg{width:20px;height:20px}
.hub strong{font-size:12.5px;display:block}
.hub small{font-size:10px;color:var(--muted);display:block;margin-top:2px}

/* ---------- Utilities ---------- */
.mt0{margin-top:0}.mt4{margin-top:4px}.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt20{margin-top:20px}
.mb0{margin-bottom:0}.mb8{margin-bottom:8px}.mb12{margin-bottom:12px}.mb16{margin-bottom:16px}
.w-full{width:100%}
.flex1{flex:1;min-width:0}
.text-right{text-align:right}
.text-center{text-align:center}
.text-orange{color:#d94d23}
.text-red{color:var(--red)}
.text-green{color:#0a7a5b}
.text-blue{color:var(--blue-2)}
.bg-soft{background:#f8fafd}
.border-top{border-top:1px solid var(--line)}

/* ---------- Responsive ---------- */
@media (max-width:1180px){
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .split{grid-template-columns:1fr}
}
@media (max-width:980px){
  .sidebar{position:fixed;left:0;top:0;transform:translateX(-100%);transition:transform .22s ease;box-shadow:0 0 60px rgba(0,0,0,.35)}
  .sidebar.open{transform:none}
  .only-mobile{display:inline-grid!important}
  .topbar{padding:10px 16px}
  .view{padding:16px 16px 84px}
  .grid-3{grid-template-columns:1fr}
  .split{grid-template-columns:1fr}
  .form-grid{grid-template-columns:1fr}
  .table-scroll{max-height:none}
  .mobile-nav{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:40;background:rgba(255,255,255,.97);backdrop-filter:blur(10px);border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom))}
  .mobile-nav a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:9.5px;font-weight:600;color:var(--muted);padding:4px 0;border-radius:8px}
  .mobile-nav a.active{color:var(--blue-2)}
  .mobile-nav svg{width:19px;height:19px}
  .nav-backdrop{position:fixed;inset:0;background:rgba(9,20,35,.4);z-index:29}
}
@media (max-width:640px){
  table.data{min-width:820px}
  .table-scroll{overscroll-behavior-x:contain}
  .topbar-title h1{font-size:16px}
  .topbar-title p{display:none}
  .topbar-actions{display:none}
  .grid-4,.grid-2{grid-template-columns:1fr 1fr}
  .kpi{padding:12px}
  .kpi-value{font-size:22px}
  .page-head h2{font-size:18px}
  .donut-wrap{flex-direction:column;align-items:flex-start}
  .overlay{padding:10px;align-items:flex-end}
  .modal{max-height:calc(100vh - 20px);border-radius:16px}
  .modal-body{padding:14px 15px}
  .modal-head,.modal-foot{padding-left:15px;padding-right:15px}
  .drawer{max-width:none}
  .plan-list{grid-template-columns:1fr}
  .hub{gap:8px}
}

/* ---------- Print ---------- */
@media print{
  .sidebar,.topbar,.mobile-nav,.page-actions,.toolbar,.btn,.toast-root{display:none!important}
  body{background:#fff}
  .view{padding:0;max-width:none}
  .card,.table-wrap,.plan{box-shadow:none;border-color:#bbb;break-inside:avoid}
  .table-scroll{max-height:none;overflow:visible}
  table.data thead th{position:static;background:#eee}
  .print-only{display:block!important}
}
.print-only{display:none}
@media print{.no-print{display:none!important}.driver-hero,.assign-summary{color:#000!important;background:#f3f3f3!important}.assign-summary .as b{color:#000!important}}

/* ============================================================
   High-volume workspace (board / safety)
   ============================================================ */
.grid-6{grid-template-columns:repeat(6,minmax(0,1fr))}
.board-metrics{display:grid;grid-template-columns:repeat(5,minmax(0,1fr)) minmax(190px,1.25fr);gap:8px;margin-bottom:10px}
.bm{background:#fff;border:1px solid var(--line);border-radius:11px;padding:8px 11px;box-shadow:var(--shadow);min-width:0}
.bm span{display:block;font-size:10.5px;color:var(--muted);font-weight:600}
.bm b{display:block;font-size:20px;font-weight:800;letter-spacing:-.04em;line-height:1.2;margin-top:2px;font-variant-numeric:tabular-nums}
.bm b small{font-size:10.5px;color:var(--muted);font-weight:700;margin-left:2px}
.bm em{display:block;font-size:9.5px;color:var(--muted-2);font-style:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bm.good b{color:#0a7a5b}.bm.warn b{color:#b66a12}
.bm-progress{background:linear-gradient(160deg,#0b1e33,#17395c);color:#fff;border-radius:11px;padding:9px 12px;min-width:0;box-shadow:var(--shadow)}
.bm-progress .row-between{font-size:10.5px;color:#a9c4de}
.bm-progress .row-between b{color:#fff;font-size:13px}
.bm-progress .progress{background:rgba(255,255,255,.14);margin:6px 0 4px;height:6px}
.bm-progress .tiny{color:#8fadcb}

.board-toolbar{padding:9px 11px;margin-bottom:10px}
.board-toolbar-line{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.board-toolbar .search{max-width:310px;min-width:230px}
.board-toolbar-sub{padding-top:8px;margin-top:8px;border-top:1px solid var(--line-2);gap:10px}
.date-strip{display:flex;gap:4px;overflow:auto;max-width:100%;padding-bottom:2px;scrollbar-width:thin}
.date-chip{display:inline-flex;align-items:center;gap:4px;height:26px;padding:0 8px;border-radius:7px;border:1px solid var(--line);background:#fff;font-size:10.5px;color:var(--muted);white-space:nowrap}
.date-chip b{color:var(--ink-2);font-weight:700}
.date-chip span{color:var(--muted-2);font-size:9.5px}
.date-chip:hover{border-color:#c8d8ea;background:#f8fbff}
.date-chip.on{background:rgba(20,135,201,.1);border-color:rgba(20,135,201,.4);color:var(--blue-2)}
.date-chip.on b{color:var(--blue-2)}

.board-work{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;align-items:start}
.board-work.with-side{grid-template-columns:minmax(0,1fr) minmax(330px,390px)}
.board-panel{min-width:0}
.board-actionbar{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.board-side{position:sticky;top:78px;max-height:calc(100vh - 92px);overflow:auto;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);scrollbar-width:thin}
.side-head{display:flex;align-items:flex-start;gap:9px;padding:14px 14px 12px;border-bottom:1px solid var(--line-2);position:sticky;top:0;background:#fff;z-index:2;border-radius:14px 14px 0 0}
.side-body{padding:0 14px 14px}
.side-section{padding:11px 0;border-bottom:1px solid var(--line-2)}
.side-section:last-of-type{border-bottom:0}
.side-title{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;font-weight:750;color:var(--ink-2);margin-bottom:6px}
.kv{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:4px 0;font-size:11px}
.kv>span{color:var(--muted);flex:0 0 auto}
.kv>b{font-weight:600;text-align:right;max-width:65%;word-break:break-all;color:var(--ink-2)}
.side-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:11px 0 2px}
.side-stats>div{background:#f7fafd;border:1px solid var(--line-2);border-radius:8px;padding:7px 8px;text-align:center}
.side-stats span{display:block;font-size:9.5px;color:var(--muted)}
.side-stats b{display:block;font-size:16px;font-weight:800;margin-top:1px}
.side-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:5px;padding:46px 18px;color:var(--muted-2);min-height:280px}
.side-empty svg{width:30px;height:30px;color:#b9c9db}
.side-empty strong{font-size:12.5px;color:var(--ink-2)}
.side-empty span{font-size:10.5px;line-height:1.65}
.driver-mini{display:flex;align-items:center;gap:9px;padding:8px;border:1px solid var(--line-2);border-radius:9px;background:#fbfdff}
.driver-mini strong{display:block;font-size:12.5px}
.driver-mini small{display:block;font-size:10px;color:var(--muted);margin-top:1px}
.safety-mini{display:flex;flex-direction:column;gap:3px;margin-bottom:7px}
.safety-mini>div{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:10px;color:var(--muted);padding:2px 0}
.side-recent{display:flex;align-items:center;gap:7px;width:100%;text-align:left;padding:5px 0;border-bottom:1px solid var(--line-2);font-size:10.5px;color:var(--ink-2)}
.side-recent:last-child{border-bottom:0}
.side-recent span{color:var(--muted);width:40px;flex:0 0 auto}
.side-recent b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.side-recent em{font-style:normal;color:var(--muted);font-size:9.5px}
.side-recent:hover b{color:var(--blue-2)}
.side-actions{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:5px;padding-top:11px}
.side-actions .btn{padding:0 7px;font-size:10.5px}
.safety-row{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding:5px 0;border-bottom:1px solid var(--line-2)}
.safety-row:last-child{border-bottom:0}
.safety-row.sub{opacity:.72}
.safety-name{font-size:10.5px;color:var(--ink-2);font-weight:600;padding-top:2px}
.safety-val{display:flex;flex-direction:column;align-items:flex-end;gap:2px;min-width:0;max-width:66%}
.safety-val small{font-size:9.5px;color:var(--muted);max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.bulkbar{display:flex;align-items:center;gap:7px;flex-wrap:wrap;background:#edf7ff;border:1px solid #cbe6f8;border-radius:10px;padding:7px 10px;margin-bottom:8px}
.bulkbar.hidden{display:none}
.bulk-count{font-size:11.5px;color:#245b80}
.bulk-count b{font-size:14px;color:var(--blue-2)}

.board-table-wrap{overflow:hidden}
.board-table{min-width:1060px;table-layout:fixed}
.board-table th,.board-table td{padding:6px 9px}
.board-table th{height:32px}
.board-table tbody tr{height:54px}
.board-table.compact tbody tr{height:40px}
.board-table.normal tbody td{height:54px}
.board-table.compact tbody td{height:40px;padding:4px 8px}
.board-table td{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.board-table td .ellipsis,.board-table .ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.board-table th.sticky-col,.board-table td.sticky-col{position:sticky;z-index:2;background:#fff}
.board-table thead th.sticky-col{z-index:4;background:#f8fafd}
.board-table tbody tr:nth-child(even) td{background:#fbfcff}
.board-table tbody tr:hover td{background:#f4faff}
.board-table tbody tr.selected td{background:#e7f4ff}
.board-table tbody tr.selected td.sticky-col{background:#e7f4ff}
.board-table td.sel,.board-table th.sel{padding-left:8px;padding-right:2px;text-align:center}
.board-table td.sel input{width:14px;height:14px;accent-color:var(--blue)}
.board-table .th-sort{display:inline-flex;align-items:center;gap:3px;color:inherit;font:inherit;font-weight:700;white-space:nowrap}
.board-table .th-sort span{font-size:9px;color:var(--blue-2);width:8px}
.board-table.compact .tiny{display:none}
.board-table.compact .badge{height:19px;font-size:9.5px}
.board-table mark{background:#fff0a8;color:inherit;border-radius:2px;padding:0 1px}
.board-table tr.row-cancelled td{color:#9aa7b8}
.board-table tr.row-cancelled .t-title{text-decoration:line-through}
.board-table tr.row-support td{background:rgba(233,161,59,.045)}
.board-scroll{max-height:calc(100vh - 315px);min-height:260px}
body.board-focus .sidebar,body.board-focus .topbar{display:none!important}
body.board-focus .view{max-width:none;padding:8px 12px 18px}
body.board-focus .board-scroll{max-height:calc(100vh - 185px)}
body.board-focus .board-side{top:8px;max-height:calc(100vh - 18px)}
body.board-focus .page-head{margin-bottom:8px}
body.board-focus .page-head p,body.board-focus .page-head .page-actions{display:none}

.column-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px 14px;padding:2px}
.stat-tile{padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:#fbfdff}
.stat-tile span{display:block;font-size:10px;color:var(--muted)}
.stat-tile b{display:block;font-size:18px;font-weight:800;margin-top:2px}
.import-history summary{display:flex;align-items:center;gap:7px;cursor:pointer;font-size:12.5px;font-weight:700;color:var(--ink-2);list-style:none}
.import-history summary::-webkit-details-marker{display:none}
.import-history summary svg{width:16px;height:16px;color:var(--muted)}
.import-history summary .tiny{font-weight:500;margin-left:4px}

@media(max-width:1400px){
  .board-metrics{grid-template-columns:repeat(3,minmax(0,1fr)) minmax(180px,1.2fr)}
}
@media(max-width:1180px){
  .grid-6{grid-template-columns:repeat(3,minmax(0,1fr))}
  .board-work.with-side{grid-template-columns:minmax(0,1fr)}
  .board-mode .board-side{display:none}
  .board-side{position:static;max-height:none}
  .board-scroll{max-height:calc(100vh - 330px)}
}
@media(max-width:760px){
  .board-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}
  .bm b{font-size:17px}
  .bm-progress{grid-column:1/-1}
  .grid-6{grid-template-columns:repeat(2,minmax(0,1fr))}
  .board-toolbar .search{max-width:none;min-width:0;flex:1 1 100%}
  .board-toolbar .date-range{flex:1 1 100%}
  .board-toolbar .date-range .input{flex:1;width:auto}
  .board-toolbar .seg{order:5}
  .board-actionbar{justify-content:flex-start}
  .side-actions{grid-template-columns:1fr 1fr}
  .side-actions .btn:first-child{grid-column:1/-1}
  .column-grid{grid-template-columns:1fr}
  .board-scroll{max-height:none}
}

/* Dispatch dashboard: readable operational summary */
.dispatch-dashboard{font-size:15px;line-height:1.65}
.dispatch-dashboard .stack,.dispatch-dashboard .card{min-width:0}
.dispatch-dashboard .scroll-x{max-width:100%}
.dispatch-dashboard .chart{min-width:600px}
.dispatch-dashboard .page-head h2{font-size:26px}
.dispatch-dashboard .page-head p{font-size:15px;color:#43536a}
.dispatch-dashboard h3{font-size:18px;font-weight:750}
.dispatch-dashboard .small,.dispatch-dashboard .tiny,.dispatch-dashboard .hint{font-size:14px}
.dispatch-dashboard .btn{font-size:14px;min-height:38px;height:auto;padding-top:7px;padding-bottom:7px}
.dispatch-dashboard .badge,.dispatch-dashboard .pill,.dispatch-dashboard .tag{font-size:13px;min-height:26px;height:auto}
.dispatch-dashboard .link{font-size:14px}
.dispatch-dashboard .kpi{padding:20px}
.dispatch-dashboard .kpi-label{font-size:15px;color:#43536a}
.dispatch-dashboard .kpi-value{font-size:36px}
.dispatch-dashboard .kpi-value small{font-size:16px}
.dispatch-dashboard .kpi-foot{font-size:13px;flex-wrap:wrap;line-height:1.6}
.dispatch-dashboard table.data{font-size:15px}
.dispatch-dashboard table.data th{font-size:14px;color:#43536a}
.dispatch-dashboard table.data td,.dispatch-dashboard table.data th{padding:13px 14px}
.dispatch-dashboard .chart text{fill:#43536a;font-size:11px;font-weight:600}
.dispatch-dashboard .dispatch-progress{height:12px;background:#e3eaf2}
.dispatch-dashboard .dispatch-progress>span{background:#0f6fae}
.dispatch-list-row{display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding:10px 0;border-bottom:1px solid var(--line)}
.dispatch-list-row:last-child{border-bottom:0}
.dispatch-list-row span{min-width:0;overflow-wrap:anywhere}
.dispatch-list-row strong{flex-shrink:0;color:#16202f}
.dispatch-dashboard .grid.grid-2 .stat-tile{min-width:0}
.dispatch-dashboard .stat-tile span{font-size:13px}
.dispatch-dashboard .dispatch-driver-table{min-width:0}
@media(max-width:1100px){.dispatch-dashboard>.grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:680px){.dispatch-dashboard .page-head{align-items:flex-start;flex-direction:column;gap:14px}.dispatch-dashboard .page-actions{flex-wrap:wrap}.dispatch-dashboard .kpi{padding:16px}.dispatch-dashboard .kpi-value{font-size:30px}}

/* Login and browser-local administration */
body.auth-pending #app{visibility:hidden}
body.auth-mode .sidebar,body.auth-mode .topbar,body.auth-mode .mobile-nav{display:none!important}
body.auth-mode .view{padding:0;max-width:none}
body.auth-mode .main{min-height:100vh}
.login-layout{display:grid;grid-template-columns:1fr 1fr;min-height:100vh}
.login-intro{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;padding:clamp(32px,6vw,90px);background:linear-gradient(145deg,#0b1e33,#153f60);color:white}
.login-intro img{width:144px;background:white;padding:12px;border-radius:14px;margin-bottom:40px}
.login-eyebrow{font-size:13px;letter-spacing:.12em;font-weight:700;color:#496983}
.login-intro .login-eyebrow{color:#97c7e5}
.login-intro h1{font-size:clamp(30px,3.2vw,48px);line-height:1.35;margin:18px 0}
.login-intro p{font-size:17px;color:#c5d8e7;line-height:1.9}
.login-features{display:flex;gap:10px;flex-wrap:wrap;margin-top:32px}
.login-features span{border:1px solid #42617b;border-radius:30px;padding:7px 13px;font-size:14px}
.login-panel{display:grid;place-items:center;padding:32px;background:#f3f6fb}
.login-card{width:100%;max-width:420px;background:white;padding:36px;border-radius:20px;box-shadow:0 16px 60px #0b1e3312;border:1px solid #e3e9f2}
.login-card h2{font-size:28px;margin:12px 0 8px}
.login-card>p{color:#526278;font-size:15px;margin-bottom:26px}
.login-card label,.admin-form label{display:block;margin:17px 0 8px;font-size:14px;font-weight:700}
.login-card input{width:100%;height:48px;border:1px solid #bccbdc;border-radius:9px;padding:0 14px;font-size:16px;background:white}
.login-card input:focus{outline:3px solid #c5e4f5;border-color:#0f6fae}
.login-card button{width:100%;height:48px;border:0;border-radius:9px;background:#0f6fae;color:white;font-size:16px;font-weight:700;cursor:pointer}
.login-card button:disabled{opacity:.6;cursor:wait}
.login-note{margin-top:22px;font-size:13px;color:#526278;line-height:1.8}
.login-card .login-error,.login-error{color:#b4232c;min-height:22px;font-size:14px;margin:12px 0}
.admin-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px;align-items:start}
.admin-grid h3{font-size:19px;margin-bottom:10px}
.admin-grid p{line-height:1.8;font-size:14px}
.admin-grid .input{font-size:16px;min-height:44px}
.admin-counts{display:flex;flex-wrap:wrap;gap:16px;margin:22px 0;font-size:15px}
@media(max-width:800px){.login-layout{grid-template-columns:1fr}.login-intro{padding:28px}.login-intro img{width:110px;margin-bottom:15px}.login-intro h1{font-size:28px}.login-intro p,.login-features{display:none}.login-panel{padding:24px 16px}.login-card{padding:28px}.admin-grid{grid-template-columns:1fr}}
