/* SHRM MENA Partner Order Portal — styles
   Extracted and extended from the approved prototype (shrm-partner-order-portal.html) */
:root{
  --ink:#16233F; --ink-soft:#3C4A66; --muted:#7A879E;
  --paper:#F5F3EF; --card:#FFFFFF; --line:#E3E8F0;
  --cobalt:#1F5EDC; --cobalt-dark:#1747A8; --cobalt-soft:#EAF0FD;
  --amber:#B45309; --amber-bg:#FDF0DA;      /* Ordered */
  --teal:#0E7A5F; --teal-bg:#DDF3EA;        /* Delivered */
  --violet:#6D3FC8; --violet-bg:#EFE7FB;    /* Invoiced */
  --blue:#1D6FB8; --blue-bg:#E2F0FB;        /* Partially paid */
  --green:#1B7A3D; --green-bg:#DFF3E4;      /* Paid */
  --gold:#A23B72; --gold-bg:#F9E4EE;        /* Certified — rose/plum, deliberately far from amber's orange hue */
  --red:#B3261E; --red-bg:#FCE8E6;
  --radius:12px;
  --shadow:0 1px 2px rgba(22,35,63,.06), 0 8px 24px rgba(22,35,63,.07);
}
*{box-sizing:border-box; margin:0; padding:0;}
html,body{height:100%;}
body{
  font-family:'Instrument Sans',system-ui,sans-serif;
  background:var(--paper); color:var(--ink);
  font-size:14.5px; line-height:1.5;
}
button{font-family:inherit; cursor:pointer;}
input,select,textarea{font-family:inherit; font-size:14px;}
a{color:var(--cobalt);}

/* ---------- App shell ---------- */
.app{display:flex; min-height:100vh;}
.sidebar{
  width:248px; flex-shrink:0; background:linear-gradient(190deg,#182545 0%,var(--ink) 55%,#111A30 100%); color:#fff;
  display:flex; flex-direction:column; padding:22px 16px;
  position:sticky; top:0; height:100vh;
}
.brand{display:flex; align-items:center; gap:10px; padding:0 8px 20px; border-bottom:1px solid rgba(255,255,255,.12); margin-bottom:18px;}
.brand-mark{
  width:38px; height:38px; border-radius:9px; background:linear-gradient(135deg,#3672E9,var(--cobalt-dark));
  box-shadow:0 3px 10px rgba(23,71,168,.45), inset 0 1px 0 rgba(255,255,255,.2);
  display:grid; place-items:center; font-family:'Space Grotesk'; font-weight:700; font-size:15px; letter-spacing:.5px;
}
.brand h1{font-family:'Space Grotesk'; font-size:15px; font-weight:600; line-height:1.25;}
.brand small{display:block; font-size:11px; font-weight:400; color:#9DAAC4; letter-spacing:.4px; text-transform:uppercase;}
.side-label{font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:#8E9BB6; padding:6px 8px 8px;}
.role-btn{
  display:flex; align-items:center; gap:11px; width:100%;
  background:none; border:none; color:#C9D2E4; text-align:left;
  padding:10px 10px; border-radius:9px; font-size:13.5px; margin-bottom:3px;
  transition:background .15s, color .15s; text-decoration:none;
}
.role-btn:hover{background:rgba(255,255,255,.07); color:#fff;}
.role-btn.active{background:linear-gradient(135deg,#3672E9,var(--cobalt-dark)); color:#fff; box-shadow:0 2px 8px rgba(0,0,0,.25);}
.role-ic{
  width:30px; height:30px; border-radius:8px; flex-shrink:0;
  display:grid; place-items:center; font-family:'Space Grotesk'; font-weight:600; font-size:12px;
  background:rgba(255,255,255,.12);
}
.role-btn.active .role-ic{background:rgba(255,255,255,.22);}
.role-btn span b{display:block; font-weight:600; font-size:13.5px;}
.role-btn span i{font-style:normal; font-size:11px; opacity:.75;}
.side-foot{margin-top:auto; padding:14px 8px 0; border-top:1px solid rgba(255,255,255,.12); font-size:11px; color:#8E9BB6; line-height:1.6;}
.side-foot a{color:#C9D2E4;}

/* ---------- Main ---------- */
.main{flex:1; min-width:0; display:flex; flex-direction:column;}
.topbar{
  background:var(--card); border-bottom:1px solid var(--line);
  padding:14px 28px; display:flex; align-items:center; gap:16px;
  position:sticky; top:0; z-index:30;
}
.topbar h2{font-family:'Space Grotesk'; font-size:19px; font-weight:600;}
.topbar .sub{font-size:12.5px; color:var(--muted); margin-top:1px;}
.top-right{margin-left:auto; display:flex; align-items:center; gap:10px;}
.mail-btn{
  position:relative; background:var(--card); border:1px solid var(--line);
  border-radius:9px; padding:8px 14px; font-size:13px; font-weight:600; color:var(--ink-soft);
  display:flex; align-items:center; gap:8px;
}
.mail-btn:hover{border-color:var(--cobalt); color:var(--cobalt);}
.mail-badge{
  position:absolute; top:-7px; right:-7px; background:var(--red); color:#fff;
  font-size:10.5px; font-weight:700; min-width:18px; height:18px; border-radius:9px;
  display:grid; place-items:center; padding:0 5px;
}
.logout-btn{
  background:var(--card); border:1px solid var(--line); border-radius:9px; padding:8px 14px;
  font-size:13px; font-weight:600; color:var(--ink-soft);
}
.logout-btn:hover{border-color:var(--red); color:var(--red);}
.content{padding:26px 28px 60px; max-width:1180px; width:100%; margin:0 auto;}

/* ---------- Cards / stats ---------- */
.stat-row{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:22px;}
.stat{
  background:linear-gradient(165deg,#FFFFFF 0%,#FAFBFE 65%,#F5F8FD 100%);
  border:1px solid var(--line); border-top:2px solid var(--cobalt-soft); border-radius:var(--radius);
  padding:14px 16px; box-shadow:var(--shadow);
  transition:box-shadow .15s, transform .15s;
}
.stat:hover{box-shadow:0 2px 4px rgba(22,35,63,.08), 0 14px 30px rgba(22,35,63,.1); transform:translateY(-1px);}
.stat .n{font-family:'Space Grotesk'; font-size:26px; font-weight:700; line-height:1.1;
  background:linear-gradient(135deg,var(--ink) 0%,var(--cobalt-dark) 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.stat .l{font-size:11.5px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; margin-top:3px;}
.card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow); margin-bottom:22px; overflow:hidden;
}
.card-head{padding:16px 20px 14px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:12px; flex-wrap:wrap;}
.card-head h3{font-family:'Space Grotesk'; font-size:15.5px; font-weight:600;}
.card-head p{font-size:12.5px; color:var(--muted); width:100%;}
.card-body{padding:18px 20px;}

/* ---------- Tables ---------- */
table{width:100%; border-collapse:collapse;}
th{
  text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.08em;
  color:var(--muted); font-weight:600; padding:10px 14px; border-bottom:1px solid var(--line);
  white-space:nowrap;
}
td{padding:12px 14px; border-bottom:1px solid var(--line); vertical-align:middle; font-size:13.5px;}
tr:last-child td{border-bottom:none;}
tbody tr:hover{background:#FAFBFE;}
.mono{font-family:'IBM Plex Mono',monospace; font-size:12.5px; font-weight:500;}
.empty{padding:34px 20px; text-align:center; color:var(--muted); font-size:13.5px;}

/* ---------- Badges & pipeline ---------- */
.badge{
  display:inline-flex; align-items:center; gap:6px; padding:3px 10px 4px;
  border-radius:999px; font-size:12px; font-weight:600; white-space:nowrap;
}
.badge::before{content:""; width:6px; height:6px; border-radius:50%; background:currentColor;}
.b-ordered{background:var(--amber-bg); color:var(--amber);}
.b-delivered{background:var(--teal-bg); color:var(--teal);}
.b-invoiced{background:var(--violet-bg); color:var(--violet);}
.b-partial{background:var(--blue-bg); color:var(--blue);}
.b-paid{background:var(--green-bg); color:var(--green);}
.b-certified{background:var(--gold-bg); color:var(--gold);}
.b-active{background:var(--green-bg); color:var(--green);}
.b-inactive{background:var(--red-bg); color:var(--red);}
.pipe{display:flex; align-items:center; gap:0;}
.pipe .dot{
  width:11px; height:11px; border-radius:50%; background:#D8DFEB; flex-shrink:0;
  position:relative;
}
.pipe .dot.done{background:var(--cobalt);}
.pipe .dot.now{background:var(--cobalt); box-shadow:0 0 0 3px var(--cobalt-soft);}
.pipe .seg{width:20px; height:2px; background:#D8DFEB;}
.pipe .seg.done{background:var(--cobalt);}
.pipe-labels{font-size:10.5px; color:var(--muted); margin-top:4px;}

/* ---------- Forms ---------- */
.form-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px;}
.field label{display:block; font-size:12px; font-weight:600; color:var(--ink-soft); margin-bottom:5px;}
.field .req{color:var(--red);}
.field input,.field select,.field textarea{
  width:100%; padding:9px 11px; border:1px solid #CBD4E1; border-radius:8px;
  background:#fff; color:var(--ink); outline:none; transition:border .15s, box-shadow .15s;
}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--cobalt); box-shadow:0 0 0 3px var(--cobalt-soft);}
.field input[readonly]{background:#F1F4F9; color:var(--ink-soft); font-family:'IBM Plex Mono',monospace; font-size:12.5px;}
.field .hint{font-size:11.5px; color:var(--muted); margin-top:4px;}
.form-foot{display:flex; align-items:center; gap:12px; margin-top:18px; flex-wrap:wrap;}
.btn{
  border:none; border-radius:9px; padding:10px 20px; font-size:13.5px; font-weight:600;
  transition:background .15s, transform .12s, box-shadow .15s; display:inline-flex; align-items:center; gap:6px;
}
.btn:active{transform:translateY(1px);}
.btn-primary{
  background:linear-gradient(135deg,#2E6BEE 0%,var(--cobalt) 55%,var(--cobalt-dark) 100%); color:#fff;
  box-shadow:0 1px 2px rgba(23,71,168,.3), 0 1px 0 rgba(255,255,255,.15) inset;
}
.btn-primary:hover{
  background:linear-gradient(135deg,#3A78F5 0%,#2560DC 55%,var(--cobalt-dark) 100%);
  box-shadow:0 6px 16px rgba(23,71,168,.35), 0 1px 0 rgba(255,255,255,.15) inset;
  transform:translateY(-1px);
}
.btn-primary:active{transform:translateY(1px); box-shadow:0 1px 2px rgba(23,71,168,.3);}
.btn-ghost{background:none; border:1px solid var(--line); color:var(--ink-soft);}
.btn-ghost:hover{border-color:var(--cobalt); color:var(--cobalt);}
.btn-danger{background:none; border:1px solid var(--line); color:var(--red);}
.btn-danger:hover{border-color:var(--red); background:var(--red-bg);}
.btn-sm{padding:6px 13px; font-size:12.5px; border-radius:7px;}
.btn-block{width:100%; justify-content:center;}
.email-note{font-size:12px; color:var(--muted); display:flex; align-items:center; gap:7px;}
.email-note svg{flex-shrink:0;}
.locked{font-size:12px; color:var(--muted); font-style:italic;}

/* ---------- File drop ---------- */
.dropzone{
  border:1.5px dashed #B9C4D6; border-radius:10px; padding:16px; text-align:center;
  color:var(--muted); font-size:12.5px; background:#FAFBFE; cursor:pointer;
  transition:border-color .15s, background .15s;
}
.dropzone:hover{border-color:var(--cobalt); background:var(--cobalt-soft);}
.dropzone.hasfile{border-style:solid; border-color:var(--teal); color:var(--teal); background:var(--teal-bg); font-weight:600;}

/* ---------- Progress bar ---------- */
.paybar{background:#E6EBF3; border-radius:99px; height:8px; overflow:hidden; width:110px;}
.paybar i{display:block; height:100%; background:var(--green); border-radius:99px; transition:width .3s;}

/* ---------- Drawer (email log) ---------- */
.drawer-mask{position:fixed; inset:0; background:rgba(22,35,63,.35); z-index:60; opacity:0; pointer-events:none; transition:opacity .2s;}
.drawer-mask.open{opacity:1; pointer-events:auto;}
.drawer{
  position:fixed; top:0; right:-420px; width:400px; max-width:92vw; height:100vh;
  background:var(--card); z-index:70; box-shadow:-12px 0 40px rgba(22,35,63,.18);
  transition:right .25s ease; display:flex; flex-direction:column;
}
.drawer.open{right:0;}
.drawer-head{padding:18px 20px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:10px;}
.drawer-head h3{font-family:'Space Grotesk'; font-size:16px;}
.drawer-head button{margin-left:auto; background:none; border:none; font-size:20px; color:var(--muted); line-height:1;}
.drawer-body{flex:1; overflow-y:auto; padding:16px 20px;}
.mail{
  border:1px solid var(--line); border-radius:10px; padding:12px 14px; margin-bottom:12px;
  background:#FBFCFE;
}
.mail .m-sub{font-weight:600; font-size:13px; margin-bottom:3px;}
.mail .m-to{font-size:11.5px; color:var(--muted); margin-bottom:7px;}
.mail .m-body{font-size:12.5px; color:var(--ink-soft); white-space:pre-line; border-top:1px dashed var(--line); padding-top:7px;}
.mail .m-time{font-size:10.5px; color:var(--muted); margin-top:7px; text-align:right;}

/* ---------- Toast ---------- */
.toast-wrap{position:fixed; bottom:22px; left:50%; transform:translateX(-50%); z-index:90; display:flex; flex-direction:column; gap:8px; align-items:center;}
.toast{
  background:var(--ink); color:#fff; border-radius:10px; padding:11px 18px;
  font-size:13px; font-weight:500; box-shadow:0 10px 30px rgba(22,35,63,.3);
  display:flex; align-items:center; gap:9px; animation:pop .25s ease;
}
.toast.error{background:var(--red);}
.toast .tick{width:18px; height:18px; border-radius:50%; background:var(--green); display:grid; place-items:center; font-size:11px; flex-shrink:0;}
.toast.error .tick{background:rgba(255,255,255,.25);}
@keyframes pop{from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:none;}}

/* ---------- Modal ---------- */
.modal-mask{position:fixed; inset:0; background:rgba(22,35,63,.4); z-index:80; display:none; align-items:flex-start; justify-content:center; padding:3vh 16px; overflow-y:auto;}
.modal-mask.open{display:flex;}
.modal{background:var(--card); border-radius:14px; width:640px; max-width:100%; box-shadow:0 24px 70px rgba(22,35,63,.3); animation:pop .2s ease;}
.modal-wide{width:900px;}
.modal .card-head{border-radius:14px 14px 0 0;}
.modal-close{margin-left:auto; background:none; border:none; font-size:22px; color:var(--muted); line-height:1;}

/* ---------- Role banner ---------- */
.role-banner{
  border-radius:var(--radius); padding:14px 18px; margin-bottom:20px;
  background:linear-gradient(120deg,#16233F,#24406F);
  color:#fff; display:flex; align-items:center; gap:14px; box-shadow:var(--shadow);
}
.role-banner .rb-ic{width:40px; height:40px; border-radius:10px; background:rgba(255,255,255,.14); display:grid; place-items:center; font-family:'Space Grotesk'; font-weight:700; font-size:14px; flex-shrink:0;}
.role-banner b{font-family:'Space Grotesk'; font-size:15px; display:block;}
.role-banner span{font-size:12.5px; color:#C7D2E6;}

/* ---------- Login page ---------- */
.login-body{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:radial-gradient(circle at top,#1c2c50,var(--ink) 60%); padding:24px;
}
.login-card{
  background:var(--card); border-radius:16px; width:400px; max-width:100%;
  box-shadow:0 30px 80px rgba(0,0,0,.35); padding:30px 30px 26px;
}
.login-brand{display:flex; align-items:center; gap:12px; margin-bottom:22px;}
.login-brand h1{font-family:'Space Grotesk'; font-size:16px; font-weight:600; line-height:1.3;}
.login-brand small{display:block; font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.4px;}
.login-card h2{font-family:'Space Grotesk'; font-size:19px; margin-bottom:4px;}
.login-card .sub{font-size:12.5px; color:var(--muted); margin-bottom:20px;}
.login-error{
  background:var(--red-bg); color:var(--red); border-radius:9px; padding:10px 13px;
  font-size:12.5px; font-weight:600; margin-bottom:16px;
}
.login-card .field{margin-bottom:14px;}
.cred-box{
  margin-top:22px; padding:12px 14px; border:1px dashed var(--line); border-radius:10px;
  background:#FAFBFE; font-size:11.5px; color:var(--muted); line-height:1.7;
}
.cred-box b{color:var(--ink-soft); font-family:'IBM Plex Mono',monospace; font-weight:600;}

/* ---------- Misc ---------- */
.toggle-pill{
  display:inline-flex; align-items:center; gap:6px; padding:3px 10px 4px; border-radius:999px;
  font-size:12px; font-weight:600; border:none;
}
.section-title{font-family:'Space Grotesk'; font-size:15.5px; font-weight:600; margin:26px 0 12px;}

@media (max-width:880px){
  .app{flex-direction:column;}
  .sidebar{width:100%; height:auto; position:static; flex-direction:row; flex-wrap:wrap; gap:6px; padding:14px;}
  .brand{border:none; padding:0 6px; margin:0; width:100%;}
  .side-label,.side-foot{display:none;}
  .role-btn{width:auto; flex:1; min-width:150px;}
  .content{padding:18px 14px 50px;}
  .topbar{padding:12px 14px;}
}

/* ================================================================
   World-class additions: dispatch, partial delivery, SLA alerts,
   filters, pagination, order timeline, audit trail.
   ================================================================ */

/* ---------- New status badges ---------- */
.b-partial-delivered{background:#E8F1FA; color:#1E5B8F;}
.b-cancelled{background:#ECEEF2; color:#5A657A;}

/* ---------- Chips (SLA alerts, dispatch modes, statuses) ---------- */
.chip{
  display:inline-block; padding:2px 9px 3px; border-radius:999px;
  font-size:11px; font-weight:600; white-space:nowrap; line-height:1.5;
}
.chip-neutral{background:#EEF1F6; color:var(--ink-soft);}
.chip-ok{background:var(--green-bg); color:var(--green);}
.chip-due-soon{background:var(--amber-bg); color:var(--amber);}
.chip-overdue{background:var(--red-bg); color:var(--red);}
.alert-chips{display:flex; flex-wrap:wrap; gap:5px; margin-top:5px;}

/* ---------- Order links ---------- */
.order-link{text-decoration:none; font-weight:600;}
.order-link:hover{text-decoration:underline;}

/* ---------- Stat row alert state ---------- */
.stat-alert{border-color:var(--red)!important; background:var(--red-bg);}
.stat-alert .n{color:var(--red);}

/* ---------- Filter bar ---------- */
.filter-card{margin-bottom:18px;}
.filter-bar{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
  gap:12px; padding:16px 20px; align-items:end;
}
.filter-bar .field label{font-size:11px; text-transform:uppercase; letter-spacing:.06em;}
.filter-actions{display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
.filter-actions .btn{white-space:nowrap;}

/* ---------- Pagination ---------- */
.pager{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:12px 20px; border-top:1px solid var(--line); flex-wrap:wrap;
}
.pager-links{display:flex; align-items:center; gap:10px;}
.pager-current{font-size:12.5px; color:var(--muted);}

/* ---------- Table extras ---------- */
.row-actions{display:flex; gap:6px; flex-wrap:wrap; align-items:center;}
.row-voided{opacity:.55;}
.row-voided td{text-decoration:line-through;}
.row-voided td:last-child{text-decoration:none;}
.muted-inline{font-size:12px; color:var(--muted);}
.cancelled-note{color:var(--red); font-weight:600;}
.totals-line{margin-top:14px; padding-top:14px; border-top:1px solid var(--line); font-size:13px;}

/* ---------- Dispatch summary ---------- */
.dispatch-summary{display:flex; flex-direction:column; gap:6px;}
.dispatch-line{font-size:12.5px; display:flex; align-items:center; gap:6px; flex-wrap:wrap;}

/* ---------- Form section divider ---------- */
.field-divider{
  grid-column:1/-1; font-size:11px; font-weight:700; text-transform:uppercase;
  letter-spacing:.08em; color:var(--muted); padding-top:6px; margin-top:2px;
  border-top:1px solid var(--line);
}
.form-grid .field-divider:first-child{border-top:none; padding-top:0; margin-top:0;}

/* ---------- Partial delivery bar ---------- */
.paybar i.partial{background:var(--blue);}

/* ---------- Order line items ----------
   The line block sits outside .form-grid so its rows can keep their own column
   proportions (program wide, qty narrow) instead of inheriting the header
   grid's equal-width tracks. */
.form-grid + .field-divider{margin-top:20px;}
.lines{display:flex; flex-direction:column; gap:12px; margin-top:12px;}
.line-row{
  display:grid; grid-template-columns:minmax(220px,3fr) minmax(90px,1fr) minmax(120px,1.2fr) minmax(110px,1fr) auto;
  gap:12px; align-items:end;
}
/* Hidden, not removed: the slot keeps its place so revealing it needs no DOM
   surgery, and its inputs are cleared on remove so an unfilled row submits
   nothing the server would read as a line. */
.line-hidden{display:none;}
.line-total-value{padding:8px 0; font-weight:600; font-size:13.5px;}
.line-actions{padding-bottom:1px;}
.line-remove{color:var(--red);}
.line-remove:hover{background:var(--red-bg);}
.lines-order-total{display:flex; align-items:center; justify-content:flex-end; gap:10px; margin-top:12px; padding-top:12px; border-top:1px solid var(--line); font-size:14px;}
.lines-order-total span{color:var(--muted);}
.lines-order-total b{font-size:17px;}
.lines-foot{display:flex; align-items:center; gap:12px; margin-top:12px; flex-wrap:wrap;}
.lines-foot .hint{font-size:11.5px; color:var(--muted); flex:1; min-width:220px;}
@media (max-width:720px){
  .line-row{grid-template-columns:1fr 1fr; }
  .line-row .line-program{grid-column:1/-1;}
}

/* Delivery form — one row per program, a quantity box against each. */
.delivery-line-row{grid-template-columns:minmax(220px,3fr) minmax(120px,1fr);}
.delivery-line-row label{font-weight:600;}

/* Admin price grid — one cell per trading currency. */
.price-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px; margin-top:12px;}
.price-grid .field label{display:flex; align-items:baseline; gap:6px;}

/* Programs listed inside a table cell or a read-only panel. */
.program-lines{display:flex; flex-direction:column; gap:3px;}
.program-line{font-size:13px; line-height:1.4;}
.readonly-list{
  background:#F1F4F9; border:1px solid var(--line); border-radius:8px;
  padding:10px 12px; display:flex; flex-direction:column; gap:4px;
}
.mini-table th{padding:6px 10px; font-size:10.5px;}
.mini-table td{padding:7px 10px; font-size:12.5px;}

/* ---------- Banners ---------- */
.banner{
  border-radius:var(--radius); padding:14px 18px; margin-bottom:20px;
  display:flex; flex-direction:column; gap:3px; font-size:13.5px;
}
.banner-danger{background:var(--red-bg); border:1px solid var(--red); color:var(--red);}
.banner span{font-size:12.5px; opacity:.9;}

/* ---------- Order detail page ---------- */
.detail-head{display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:16px; flex-wrap:wrap;}
.detail-title h3{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
.detail-grid{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:16px; margin-top:20px; padding-top:18px; border-top:1px solid var(--line);
}
.detail-cell{display:flex; flex-direction:column; gap:4px;}
.detail-cell .dl{
  font-size:10.5px; text-transform:uppercase; letter-spacing:.08em;
  color:var(--muted); font-weight:600;
}
.detail-cell b{font-size:14.5px; font-family:'Space Grotesk',sans-serif;}

/* ---------- Timeline ---------- */
.timeline{list-style:none; position:relative; padding-left:26px;}
.timeline::before{
  content:""; position:absolute; left:5px; top:6px; bottom:6px;
  width:2px; background:var(--line);
}
.tl{position:relative; padding-bottom:20px;}
.tl:last-child{padding-bottom:0;}
.tl-dot{
  position:absolute; left:-26px; top:3px; width:12px; height:12px;
  border-radius:50%; background:var(--cobalt); border:2px solid var(--card);
  box-shadow:0 0 0 2px var(--cobalt-soft);
}
.tl-shipment .tl-dot{background:var(--teal); box-shadow:0 0 0 2px var(--teal-bg);}
.tl-invoice .tl-dot{background:var(--violet); box-shadow:0 0 0 2px var(--violet-bg);}
.tl-payment .tl-dot{background:var(--green); box-shadow:0 0 0 2px var(--green-bg);}
.tl-certificate .tl-dot{background:var(--gold); box-shadow:0 0 0 2px var(--gold-bg);}
.tl-invoice-void .tl-dot,.tl-certificate-revoke .tl-dot,.tl-cancelled .tl-dot{
  background:var(--red); box-shadow:0 0 0 2px var(--red-bg);
}
.tl-title{font-weight:600; font-size:13.5px;}
.tl-when{font-size:11.5px; color:var(--muted); margin-bottom:4px;}
.tl-line{font-size:12.5px; color:var(--ink-soft); white-space:pre-wrap; word-break:break-word;}

/* ---------- Notification errors ---------- */
.m-error{
  font-size:12px; color:var(--red); background:var(--red-bg);
  border-radius:6px; padding:6px 9px; margin:6px 0;
}

@media (max-width:900px){
  .filter-bar{grid-template-columns:1fr 1fr;}
  .detail-grid{grid-template-columns:1fr 1fr;}
}
