/* NCAQ Admin Theme (from the Oak Garden admin) */
:root{
  --og-primary:#339900;
  --og-dark:#267300;
  --og-accent:#f2c230;
  --og-sidebar:#163d0b;
  --og-sidebar-hover:#205412;
  --og-bg:#f2f4f1;
  --og-card:#ffffff;
  --og-border:#e2e6e0;
  --og-text:#243024;
  --og-muted:#6b756b;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  background:var(--og-bg);
  color:var(--og-text);
  font-size:14px;
}
a{color:var(--og-primary);text-decoration:none}
a:hover{text-decoration:underline}

/* ---- Shell ---- */
.admin-shell{display:flex;min-height:100vh}
.admin-sidebar{
  width:250px;
  background:var(--og-sidebar);
  color:#e8efe6;
  flex-shrink:0;
  position:fixed;top:0;bottom:0;left:0;
  display:flex;flex-direction:column;
  z-index:40;
}
.admin-main{margin-left:250px;flex:1;min-width:0;display:flex;flex-direction:column}

.sidebar-head{
  padding:18px 20px;
  display:flex;align-items:center;gap:10px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.sidebar-head img{width:38px;height:38px;border-radius:8px;background:#fff;padding:3px;object-fit:contain}
.sidebar-head span{font-weight:700;font-size:15px;line-height:1.2}
.sidebar-head small{display:block;color:var(--og-accent);font-weight:600;font-size:11px;letter-spacing:.05em;text-transform:uppercase}

.sidebar-nav{padding:12px 10px;overflow-y:auto;flex:1}
.sidebar-credit{padding:14px 16px;border-top:1px solid rgba(255,255,255,.1);font-size:11px;line-height:1.5;color:#9fb59a;letter-spacing:.02em}
.sidebar-credit a{color:var(--og-accent);font-weight:700;text-decoration:none}
.sidebar-credit a:hover{text-decoration:underline}
.sidebar-nav a{
  display:flex;align-items:center;gap:11px;
  padding:10px 14px;border-radius:8px;
  color:#cfe0cb;font-weight:500;margin-bottom:2px;
  transition:background .12s,color .12s;
}
.sidebar-nav a:hover{background:var(--og-sidebar-hover);color:#fff;text-decoration:none}
.sidebar-nav a.active{background:var(--og-primary);color:#fff;box-shadow:inset 3px 0 0 var(--og-accent)}
.sidebar-nav a i{font-size:17px;width:20px;text-align:center}
.sidebar-nav .nav-badge{
  margin-left:auto;background:var(--og-accent);color:#3a2600;
  font-size:11px;font-weight:700;border-radius:20px;padding:1px 8px;min-width:20px;text-align:center;
}
.sidebar-nav .nav-sep{color:#6f8a6c;font-size:11px;text-transform:uppercase;letter-spacing:.08em;padding:14px 14px 6px;font-weight:700}

/* ---- Topbar ---- */
.admin-topbar{
  background:var(--og-card);border-bottom:1px solid var(--og-border);
  padding:0 24px;height:60px;display:flex;align-items:center;gap:16px;
  position:sticky;top:0;z-index:30;
}
.admin-topbar .page-title{font-weight:700;font-size:18px;margin:0}
.admin-topbar .spacer{flex:1}
.admin-topbar .tb-user{color:var(--og-muted);font-weight:500}
.admin-topbar .tb-user b{color:var(--og-text)}
.admin-topbar a.tb-link{
  color:var(--og-primary);font-weight:600;display:inline-flex;align-items:center;gap:6px;
}
.admin-content{padding:24px;width:100%}

/* ---- Cards ---- */
.card{
  background:var(--og-card);border:1px solid var(--og-border);border-radius:12px;
  margin-bottom:20px;
}
.card-header{
  padding:14px 18px;border-bottom:1px solid var(--og-border);
  font-weight:700;display:flex;align-items:center;gap:10px;
}
.card-header .spacer{flex:1}
.card-body{padding:18px}

/* ---- Stat cards ---- */
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px;margin-bottom:22px}
.stat-card{
  background:var(--og-card);border:1px solid var(--og-border);border-radius:12px;padding:16px;
  display:flex;align-items:center;gap:14px;
  container-type:inline-size;   /* .val sizes off the CARD, not the viewport */
}
.stat-card .ico{
  width:42px;height:42px;border-radius:10px;display:flex;align-items:center;justify-content:center;
  font-size:19px;background:#e7f2e6;color:var(--og-primary);flex-shrink:0;
}
.stat-card .ico.amber{background:#fdf1dc;color:#b6790f}
.stat-card .ico.blue{background:#e2eefb;color:#1f6fc4}
.stat-card .ico.red{background:#fce4e4;color:#c0392b}
/* text column must be allowed to shrink, else long money values overflow the card */
.stat-card > div:last-child{min-width:0;flex:1}
/* Keep the figure on ONE line — shrink the type rather than wrap the number.
   cqw tracks the card's own width, which vw can't: the grid reflows columns, so a
   narrower viewport can mean wider cards (and vice versa). */
.stat-card .val{font-size:clamp(13px,8.5cqw,19px);font-weight:800;line-height:1.15;white-space:nowrap}
.stat-card .lbl{color:var(--og-muted);font-size:12.5px;font-weight:500;margin-top:2px}

/* ---- Tables ---- */
.table-wrap{overflow-x:auto}
table.admin-table{width:100%;border-collapse:collapse;font-size:13.5px}
table.admin-table th,table.admin-table td{padding:11px 14px;text-align:left;vertical-align:middle}
table.admin-table thead th{
  background:#eef2ec;color:var(--og-muted);font-weight:700;font-size:11.5px;
  text-transform:uppercase;letter-spacing:.04em;border-bottom:1px solid var(--og-border);white-space:nowrap;
}
table.admin-table tbody tr{border-bottom:1px solid var(--og-border)}
table.admin-table tbody tr:hover{background:#f7faf6}
table.admin-table tbody tr:last-child{border-bottom:none}

/* ---- Sortable columns ---- */
table.admin-table thead th a.sort-link{
  display:inline-flex;align-items:center;gap:5px;color:inherit;text-decoration:none;cursor:pointer;
}
table.admin-table thead th a.sort-link:hover{color:var(--og-primary)}
table.admin-table thead th a.sort-link .bi{font-size:11px;opacity:.35;transition:opacity .12s}
table.admin-table thead th a.sort-link:hover .bi{opacity:.75}
table.admin-table thead th a.sort-link.is-sorted{color:var(--og-primary)}
table.admin-table thead th a.sort-link.is-sorted .bi{opacity:1}
/* Phones hide the header row (the table becomes cards), so sorting moves to a select. */
.sort-mobile{display:none;align-items:center;gap:8px;margin:0 0 10px}
.sort-mobile .flabel{margin:0;white-space:nowrap}
.sort-mobile .form-select{width:auto;flex:1;min-width:0}

.thumb{width:44px;height:44px;border-radius:8px;object-fit:cover;background:#eef2ec;border:1px solid var(--og-border)}
.child-row td:first-child{padding-left:34px;position:relative}
.child-row td:first-child::before{content:"\21B3";position:absolute;left:14px;color:var(--og-muted)}

/* ---- Badges ---- */
.badge{display:inline-block;padding:3px 9px;border-radius:20px;font-size:11.5px;font-weight:700;color:#fff;line-height:1.4}
.bg-info{background:#1f8fb8!important;color:#fff}
.bg-warning{background:#f0ad2e!important}
.bg-primary{background:var(--og-primary)!important}
.bg-success{background:#2e9e4b!important}
.bg-danger{background:#c0392b!important}
.bg-secondary{background:#8a938a!important}
.text-dark{color:#3a2f16!important}
.badge-soft{background:#eef2ec;color:var(--og-muted)}
.badge-trade{background:var(--og-accent);color:#3a2600}
/* Trade account that also holds a credit account — green so it reads apart
   from a plain (orange) trade account at a glance. */
.badge-trade-c{background:#1b7a35;color:#fff}

/* ---- Buttons ---- */
.btn{
  display:inline-flex;align-items:center;gap:7px;justify-content:center;
  padding:8px 15px;border-radius:8px;font-weight:600;font-size:13.5px;
  border:1px solid transparent;cursor:pointer;background:#fff;color:var(--og-text);
  transition:.12s;text-decoration:none;line-height:1.2;
}
.btn:hover{text-decoration:none;filter:brightness(.97)}
.btn-primary{background:var(--og-primary);color:#fff}
.btn-primary:hover{background:var(--og-dark);color:#fff}
.btn-dark{background:var(--og-dark);color:#fff}
.btn-accent{background:var(--og-accent);color:#3a2600}
.btn-outline{background:#fff;border-color:var(--og-border);color:var(--og-text)}
.btn-outline:hover{border-color:var(--og-primary);color:var(--og-primary)}
.btn-danger{background:#c0392b;color:#fff}
.btn-danger:hover{background:#a5311f;color:#fff}
.btn-sm{padding:5px 10px;font-size:12.5px;border-radius:7px}
.btn-icon{padding:6px 9px}
.btn-group-inline{display:inline-flex;gap:6px}

/* ---- Forms ---- */
.form-row{margin-bottom:16px}
.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.form-grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.form-grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
label.flabel{display:block;font-weight:600;margin-bottom:6px;font-size:13px}
label.flabel .req{color:#c0392b}
.form-control,.form-select,textarea.form-control{
  width:100%;padding:9px 12px;border:1px solid var(--og-border);border-radius:8px;
  font-size:14px;font-family:inherit;background:#fff;color:var(--og-text);
}
.form-control:focus,.form-select:focus,textarea:focus{
  outline:none;border-color:var(--og-primary);box-shadow:0 0 0 3px rgba(46,125,50,.12);
}
textarea.form-control{resize:vertical;min-height:80px}
.form-hint{color:var(--og-muted);font-size:12px;margin-top:5px}
.form-check{display:flex;align-items:center;gap:9px;font-weight:500}
.form-check input{width:17px;height:17px;accent-color:var(--og-primary)}
.input-group{display:flex}
.input-group .addon{padding:9px 12px;background:#eef2ec;border:1px solid var(--og-border);border-right:none;border-radius:8px 0 0 8px;color:var(--og-muted);font-weight:600}
.input-group .form-control{border-radius:0 8px 8px 0}

/* ---- Alerts ---- */
.alert{padding:12px 16px;border-radius:9px;margin-bottom:18px;font-weight:500;display:flex;align-items:center;gap:9px}
.alert-success{background:#e4f4e6;color:#1e6b2c;border:1px solid #bfe3c4}
.alert-danger{background:#fbe6e4;color:#a5311f;border:1px solid #f0c3bd}
.alert-info{background:#e2eefb;color:#1f5c9a;border:1px solid #c2dcf5}

/* ---- Misc ---- */
.filter-bar{display:flex;gap:10px;flex-wrap:wrap;align-items:end;margin-bottom:16px}
.filter-bar .form-control,.filter-bar .form-select{width:auto;min-width:150px}
.orders-filter{display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end;margin-bottom:18px;background:#f6f9f6;border:1px solid #e6e8e6;border-radius:10px;padding:14px}
.orders-filter .of-field{display:flex;flex-direction:column;gap:4px}
.orders-filter .flabel{font-size:.74rem;font-weight:600;color:#4b5563;margin:0}
.orders-filter .form-control,.orders-filter .form-select{min-width:150px}
.orders-filter input[type=date]{min-width:140px}
.orders-filter .of-actions{display:flex;gap:8px;align-items:flex-end}
.orders-filter .of-daterange .of-dates{display:flex;gap:6px;align-items:center}
.orders-filter .of-daterange .of-dates span{color:#9aa89a}
.orders-filter .of-daterange input[type=date]{min-width:140px}
.bulk-bar{background:#f0f5ee;border:1px solid var(--og-border);border-radius:10px;padding:12px 16px;margin-bottom:16px;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.muted{color:var(--og-muted)}
.text-end{text-align:right}
.text-center{text-align:center}
.nowrap{white-space:nowrap}
.mb-0{margin-bottom:0}.mt-0{margin-top:0}
.d-flex{display:flex}.gap-2{gap:10px}.align-center{align-items:center}
.pill-toggle{display:inline-block;padding:3px 10px;border-radius:20px;font-size:11.5px;font-weight:700}
.pill-on{background:#e4f4e6;color:#1e6b2c}
.pill-off{background:#f0e2e0;color:#a5311f}
.empty-state{text-align:center;padding:48px 20px;color:var(--og-muted)}
.empty-state i{font-size:38px;display:block;margin-bottom:10px;opacity:.5}
.detail-list{list-style:none;padding:0;margin:0}
.detail-list li{display:flex;padding:7px 0;border-bottom:1px solid var(--og-border);gap:12px}
.detail-list li:last-child{border-bottom:none}
.detail-list .dk{color:var(--og-muted);width:150px;flex-shrink:0;font-weight:500}
.detail-list .dv{font-weight:600}
.two-col{display:grid;grid-template-columns:2fr 1fr;gap:20px;align-items:start}
.totals-table{width:100%;font-size:14px}
.totals-table td{padding:6px 0}
.totals-table tr.grand td{font-size:17px;font-weight:800;border-top:2px solid var(--og-border);padding-top:10px}
.pagination{display:flex;gap:6px;list-style:none;padding:0;margin:18px 0 0;flex-wrap:wrap}
.pagination a,.pagination strong{display:block;padding:7px 12px;border:1px solid var(--og-border);border-radius:8px;background:#fff;font-weight:600}
.pagination strong{background:var(--og-primary);color:#fff;border-color:var(--og-primary)}
.variation-row{display:grid;grid-template-columns:1.4fr repeat(4,1fr) 1fr 1fr .8fr auto auto;gap:8px;align-items:end;margin-bottom:10px;padding:12px;background:#f7faf6;border:1px solid var(--og-border);border-radius:9px}
.variation-row label{font-size:11px;color:var(--og-muted);font-weight:600;display:block;margin-bottom:3px}
.variation-row input{padding:7px 9px;font-size:13px}
/* Internal counter price — tinted so it never reads as one of the public prices. */
.var-pos label{color:#8a6d1f}
.var-pos input{background:#fffdf3;border-color:#e6d9a8}
/* Stock not tracked: the per-option quantity box has nothing to say. Quote-only does NOT
   change this table — it hides prices from customers, not from staff. */
#variationList.vars-no-stock .var-stock{display:none}
#variationList.vars-no-stock .variation-row{grid-template-columns:1.4fr repeat(4,1fr) 1fr 1fr auto auto}
.var-img-wrap{display:flex;align-items:center;gap:4px}
.var-img-thumb{width:38px;height:38px;object-fit:cover;border-radius:6px;border:1px solid var(--og-border)}
.var-img-btn{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border:1px solid var(--og-border);border-radius:6px;cursor:pointer;background:#fff;color:#2e7d32}
.var-img-btn:hover{background:#eef7ef}
.var-img-x{width:22px;height:22px;border:0;border-radius:50%;background:rgba(183,28,28,.9);color:#fff;cursor:pointer;padding:0;font-size:11px;line-height:1;flex:none}

/* Invoice state on the orders list Docs column: solid orange = the customer has NOT been
   sent it yet, solid green = it has gone. Solid on purpose — an outline button reads as
   "another link" and this is the one thing on the row worth spotting. */
.inv-unsent,.inv-unsent:hover{background:#f57c00;border:1px solid #ef6c00;color:#fff}
.inv-sent,.inv-sent:hover{background:#2e7d32;border:1px solid #1b5e20;color:#fff}
/* Sent tick beside an invoice number in the invoice lists. */
.inv-tick{color:#2e7d32}
.inv-tick-off{color:#c9d2c9}

/* Stock cell on the products list: one level for a simple product, one per option for a
   variable one. The state word carries the colour so a low or empty line is spotted. */
.stock-cell .so-qty{width:74px;padding:3px 6px;font-size:13px}
.stock-cell .so-state{font-size:11px;font-weight:600;margin-left:5px;white-space:nowrap}
.stock-cell .st-in{color:#2e7d32}
.stock-cell .st-low{color:#b06f00}
.stock-cell .st-out{color:#c0392b}
.stock-cell .st-untracked{color:#6b7280}
.stock-opts{border:1px solid var(--og-border);border-radius:7px;padding:6px;background:#f7faf6;min-width:230px}
.stock-opt{display:flex;align-items:center;gap:6px;margin-bottom:4px}
.stock-opt:last-of-type{margin-bottom:0}
.stock-opt .so-name{flex:1;font-size:12px}

/* ================= Responsive ================= */
/* collapse multi-column form grids on any small screen */
@media(max-width:900px){
  .form-grid,.form-grid-3,.form-grid-4,.two-col{grid-template-columns:1fr}
  .variation-row{grid-template-columns:1fr 1fr;gap:8px}
}

/* Tablet (769–900px): sidebar shrinks to an icon rail */
@media(min-width:769px) and (max-width:900px){
  .admin-sidebar{width:64px}
  .admin-main{margin-left:64px}
  .sidebar-head span,.sidebar-head small,.sidebar-nav a span,.sidebar-nav .nav-badge,.sidebar-nav .nav-sep{display:none}
  .sidebar-nav a{justify-content:center}
}

/* hamburger + backdrop (hidden until phone width) */
.admin-menu-btn{display:none;background:none;border:0;font-size:22px;color:var(--og-primary);cursor:pointer;padding:2px 6px;margin-right:2px;line-height:1}
.nav-backdrop{display:none}

/* Phone (≤768px): off-canvas drawer + kanban card tables */
@media(max-width:768px){
  .admin-menu-btn{display:inline-flex;align-items:center}
  .admin-sidebar{transform:translateX(-100%);transition:transform .25s ease;z-index:1200;box-shadow:2px 0 18px rgba(0,0,0,.25)}
  .admin-shell.nav-open .admin-sidebar{transform:none}
  .admin-main{margin-left:0}
  .nav-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:1150}
  .admin-shell.nav-open .nav-backdrop{display:block}
  .admin-topbar{padding:0 14px;gap:10px}
  .admin-topbar .tb-link span{display:none}          /* icon-only View Store / Logout */
  .admin-content{padding:16px 14px}
  .card-header{flex-wrap:wrap;row-gap:10px}

  /* filters stack full-width for easy tapping */
  .filter-bar,.orders-filter{flex-direction:column;align-items:stretch}
  .filter-bar > div,.orders-filter .of-field,.orders-filter .of-actions{width:100%}
  .filter-bar .form-control,.filter-bar .form-select,
  .orders-filter .form-control,.orders-filter .form-select{width:100%;min-width:0}
  .orders-filter .of-daterange .of-dates{display:flex;gap:8px}
  .orders-filter .of-daterange .of-dates input[type=date]{flex:1;min-width:0}
  .orders-filter .of-actions{justify-content:flex-start}

  /* the header row goes away below, so the sort select takes over */
  .sort-mobile{display:flex}

  /* ---- table → kanban cards ---- */
  .table-wrap{overflow:visible}
  .admin-table{border:0;background:transparent;font-size:14px}
  .admin-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .admin-table,.admin-table tbody{display:block;width:100%}
  .admin-table tbody tr{
    display:block;position:relative;background:var(--og-card);
    border:1px solid var(--og-border);border-radius:12px;
    box-shadow:0 1px 3px rgba(0,0,0,.06);padding:12px 14px;margin-bottom:14px;
  }
  .admin-table tbody tr:hover{background:var(--og-card)}
  /* value flows to the right; label floats left — keeps multi-element
     cells (name+SKU, customer+email) grouped instead of splitting */
  .admin-table tbody td{
    display:block;padding:8px 0;border:0;border-bottom:1px dashed var(--og-border);
    text-align:right;min-height:34px;
  }
  .admin-table tbody td::after{content:"";display:table;clear:both}
  .admin-table tbody td:last-child{border-bottom:0}
  .admin-table tbody td[data-label]::before{
    content:attr(data-label);float:left;max-width:45%;padding-top:2px;text-align:left;
    color:var(--og-muted);font-weight:700;font-size:10.5px;
    text-transform:uppercase;letter-spacing:.04em;
  }
  /* thumbnail cell → image at top, no label */
  .admin-table td.mc-media{text-align:left;padding-top:0}
  .admin-table td.mc-media::before{display:none}
  .admin-table td.mc-media .thumb{width:56px;height:56px}
  /* checkbox cell → pinned top-right of the card */
  .admin-table td.mc-check{position:absolute;top:12px;right:12px;padding:0;border:0;min-height:0}
  .admin-table td.mc-check::before{display:none}
  /* action buttons → full-width footer */
  .admin-table td.mc-actions{
    display:flex;justify-content:flex-start;flex-wrap:wrap;gap:8px;text-align:left;
    border-bottom:0;border-top:1px solid var(--og-border);margin-top:6px;padding-top:12px;
  }
  .admin-table td.mc-actions::before{display:none}
  .admin-table td.mc-actions .btn{flex:0 0 auto}
  .admin-table td.mc-actions .btn-icon{padding:7px 12px}   /* bigger tap targets */
  /* subcategory cards flagged with an accent edge */
  .admin-table tr.child-row{border-left:3px solid var(--og-accent)}
  .admin-table tr.child-row td:first-child{padding-left:0}
  .admin-table tr.child-row td:first-child::before{content:attr(data-label);position:static;left:auto}
  /* empty-state spanning cell stays full width */
  .admin-table td[colspan]{display:block;text-align:center;border:0;padding:20px 0}
  .admin-table td[colspan]::before{display:none}
}

/* ============ Dashboard: sales channel breakdown ============ */
.ch-bar{
  display:flex;height:11px;border-radius:999px;overflow:hidden;
  background:#eef1ed;margin-bottom:16px;
}
.ch-seg{height:100%;transition:width .3s}
/* One colour per reporting channel, used by both the share bar and the card icons so a
   segment and its card are recognisably the same thing. Keys match OrderModel::CHANNELS. */
.ch-website{background:#2e7d32}
.ch-backend{background:#2f6f9e}
.ch-trade{background:#f6a623}
.ch-tradecredit{background:#c2711a}
.ch-creditacct{background:#7b4fa8}
.ch-poscash{background:#1f8a7a}
.ch-poseftpos{background:#5c6bc0}

.ch-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(212px,1fr));gap:12px}
.ch-card{
  border:1px solid var(--og-border);border-radius:12px;padding:14px 15px;
  background:#fff;
}
.ch-head{display:flex;align-items:center;gap:9px;margin-bottom:9px}
.ch-dot{
  width:28px;height:28px;border-radius:8px;display:grid;place-items:center;
  color:#fff;font-size:14px;flex:0 0 auto;
}
.ch-name{
  flex:1;min-width:0;font-size:12.8px;font-weight:700;line-height:1.25;
}
.ch-share{
  font-size:11px;font-weight:800;color:var(--og-muted);
  background:#f1f4f0;border-radius:999px;padding:2px 8px;flex:0 0 auto;
}
.ch-amt{font-size:23px;font-weight:800;color:var(--og-text);line-height:1.15;margin-bottom:11px}
.ch-metrics{
  display:grid;grid-template-columns:repeat(3,1fr);gap:6px;
  border-top:1px solid var(--og-border);padding-top:10px;
}
.ch-metrics > div{display:flex;flex-direction:column;gap:1px;min-width:0}
.ch-metrics .n{font-size:14px;font-weight:800;color:var(--og-text);line-height:1.2}
.ch-metrics .l{font-size:10.2px;color:var(--og-muted);font-weight:600;line-height:1.25}
/* Five metrics need two rows; three columns keeps the numbers readable at card width. */
.ch-metrics.m5{grid-template-columns:repeat(3,1fr);row-gap:9px}

/* ============ Dashboard: takings by tender ============ */
.tender-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(158px,1fr));gap:12px}
.tender{
  border:1px solid var(--og-border);border-left-width:4px;border-radius:10px;
  padding:12px 14px;background:#fff;
}
.tender .tn-top{
  display:flex;align-items:center;gap:6px;
  font-size:11.6px;font-weight:700;color:var(--og-muted);text-transform:uppercase;letter-spacing:.03em;
}
.tender .tn-amt{font-size:21px;font-weight:800;color:var(--og-text);line-height:1.15;margin:6px 0 3px}
.tender .tn-sub{font-size:11.4px;color:var(--og-muted);font-weight:600}
.tn-cash{border-left-color:#1f8a7a}
.tn-card{border-left-color:#5c6bc0}
.tn-stripe{border-left-color:#635bff}
.tn-bank{border-left-color:#2f6f9e}
.tn-credit{border-left-color:#7b4fa8}
.tn-other{border-left-color:#9aa39a}

/* ============ Dashboard: small figure grid (account invoicing) ============ */
.mini-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(168px,1fr));gap:12px}
.mini{border:1px solid var(--og-border);border-radius:10px;padding:12px 14px;background:#fff}
/* Several of these are links into the invoice list now. They must still look and sit
   exactly like the plain tiles beside them, with only a hover to say they are clickable. */
a.mini{display:block;text-decoration:none;color:inherit;transition:border-color .12s,box-shadow .12s}
a.mini:hover,a.mini:focus-visible{border-color:var(--og-primary);box-shadow:0 1px 6px rgba(0,0,0,.07)}
a.mini:hover .mini-l{color:var(--og-primary)}
.mini-l{font-size:11.4px;font-weight:700;color:var(--og-muted);line-height:1.3}
.mini-v{font-size:20px;font-weight:800;color:var(--og-text);line-height:1.2;margin:5px 0 2px}
.mini-s{font-size:11.3px;color:var(--og-muted);line-height:1.35}
/* Money that is late reads as late without needing to be reached for. */
.mini-bad{border-color:#e9c3c3;background:#fdf6f6}
.mini-bad .mini-v{color:#b23b3b}

/* Explanatory note under a figure block. Deliberately quiet — it is there for the
   argument about where a number came from, not for the daily read. */
.fine-print{margin:12px 0 0;font-size:12.2px;color:var(--og-muted);line-height:1.55}

/* ============ Dashboard: needs-attention popover ============ */
.att-wrap{
  position:relative;cursor:pointer;
  container-type:normal;          /* the popover must not be sized by the card */
}
.att-wrap .val{font-size:19px}
/* The popover is this card's last child, so `.stat-card > div:last-child` — the rule that
   lets the text column flex — would land on the popover instead. Both are named here so
   the text column keeps flexing and the popover never shares the row with it. */
/* Both selectors carry .stat-card too: `.stat-card > div:last-child` is (0,2,1) and would
   otherwise out-specify a bare .att-wrap rule and hand the popover flex:1. */
.stat-card.att-wrap > div:nth-child(2){flex:1;min-width:0}
.stat-card.att-wrap > .att-pop{flex:0 0 100%}
.att-wrap:focus{outline:2px solid var(--og-primary);outline-offset:2px}
.att-wrap.has-items{border-color:#e8d3ac}
.att-caret{font-size:10px;margin-left:3px;opacity:.6}
.att-pop{
  /* Opens down and to the RIGHT of the tile. Anchoring it right would hang it over the
     sidebar, because this tile sits at the start of the last row of the grid. */
  display:none;position:absolute;z-index:60;top:calc(100% + 8px);left:0;
  width:min(340px,calc(100vw - 40px));background:#fff;border:1px solid var(--og-border);
  border-radius:12px;box-shadow:0 12px 34px rgba(20,32,20,.16);padding:6px;
  cursor:default;text-align:left;
}
.att-wrap:hover .att-pop,
.att-wrap:focus-within .att-pop,
.att-wrap.open .att-pop{display:block}
.att-pop-head{
  font-size:10.8px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;
  color:var(--og-muted);padding:7px 10px 6px;
}
.att-row{
  display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:8px;
  color:var(--og-text);text-decoration:none;
}
.att-row:hover{background:#f2f6f1}
.att-row > .bi-chevron-right{margin-left:auto;font-size:11px;color:var(--og-muted);flex:0 0 auto}
.att-n{
  flex:0 0 auto;min-width:26px;height:24px;padding:0 7px;border-radius:7px;
  display:grid;place-items:center;font-size:12.5px;font-weight:800;
}
.att-amber{background:#fdf1dc;color:#8a5b06}
.att-red{background:#fce4e4;color:#b23b3b}
.att-blue{background:#e2eefb;color:#1f6fc4}
.att-txt{display:flex;flex-direction:column;gap:1px;min-width:0}
.att-txt b{font-size:12.8px;font-weight:700;line-height:1.25}
.att-txt em{font-size:11.2px;font-style:normal;color:var(--og-muted);line-height:1.3}

/* ============ Dashboard: top spenders ============ */
.rank-pill{
  display:grid;place-items:center;width:24px;height:24px;border-radius:7px;
  background:#eef2ec;color:var(--og-muted);font-size:12px;font-weight:800;
}
.rank-1{background:#f6a623;color:#fff}
.rank-2{background:#c9cfc7;color:#3d453c}
.rank-3{background:#e0bb92;color:#5a3d1c}
.spend-bar{height:5px;border-radius:999px;background:#eef1ed;margin-top:5px;min-width:70px}
.spend-bar > span{display:block;height:100%;border-radius:999px;background:#2e7d32}

/* The popover would be clipped against the screen edge on a phone, and there is no
   hover to open it with — it drops in under the tile instead. */
@media (max-width:640px){
  .att-wrap{flex-wrap:wrap}
  .att-pop{position:static;width:100%;margin-top:10px;box-shadow:none}
}

/* Count on an Orders quick-filter chip — how much work is behind it. Reads as part of the
   button, not a notification: the number is the point, not an alert. */
.qf-count{
  display:inline-block;min-width:18px;margin-left:5px;padding:0 5px;
  border-radius:999px;background:rgba(0,0,0,.08);
  font-size:11px;font-weight:700;line-height:17px;text-align:center;vertical-align:1px;
}
.btn-primary .qf-count{background:rgba(255,255,255,.24)}
.qf-count.is-zero{opacity:.45}

/* ---- Notification Centre (Settings → Notifications) ---- */
.ntf-group{margin-bottom:18px}
.ntf-h{
  font-size:13px;font-weight:800;text-transform:uppercase;letter-spacing:.4px;
  color:var(--og-muted);margin:0 0 8px;display:flex;align-items:center;gap:7px;
}
.ntf-row{
  display:flex;gap:11px;align-items:flex-start;cursor:pointer;
  padding:11px 13px;border:1px solid var(--og-border);border-radius:10px;
  margin-bottom:7px;background:#fff;transition:border-color .12s,background .12s;
}
.ntf-row:hover{border-color:var(--og-primary)}
.ntf-row.is-off{background:#fafafa}
.ntf-row.is-off .ntf-title,.ntf-row.is-off .ntf-desc{color:var(--og-muted)}
.ntf-row input[type=checkbox]{margin-top:3px;width:17px;height:17px;flex:none}
.ntf-body{display:flex;flex-direction:column;gap:3px;min-width:0}
.ntf-title{font-size:14px;font-weight:700;display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.ntf-desc{font-size:12.5px;color:var(--og-muted);line-height:1.45}
.ntf-warn{font-size:12px;font-weight:600;color:#8a6d21;display:flex;align-items:center;gap:5px;margin-top:2px}
.ntf-pill{
  border-radius:999px;padding:2px 8px;font-size:10.5px;font-weight:800;
  text-transform:uppercase;letter-spacing:.3px;
}
.ntf-pill.ntf-off{background:#fdeaea;color:#c0392b}

/* ---- Part-load prices (material sold by the cubic metre) ---- */
.part-panel{
  margin:14px 0 4px;padding:14px;border:1px dashed var(--og-border);
  border-radius:10px;background:#f7faf6;
}
.part-head{
  font-size:13px;font-weight:800;color:var(--og-dark);margin-bottom:10px;
  display:flex;align-items:center;gap:7px;
}
.part-head span{font-weight:600;color:var(--og-muted)}
/* Second line inside a variation row — only for m³ products, so the row's own columns
   stay exactly as they were for everything else. */
.var-parts{
  grid-column:1/-1;display:none;align-items:end;gap:10px;flex-wrap:wrap;
  margin-top:9px;padding-top:9px;border-top:1px dashed var(--og-border);
}
#variationList.vars-cubic .var-parts{display:flex}
.var-parts-l{
  font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.4px;
  color:var(--og-muted);display:flex;align-items:center;gap:5px;padding-bottom:7px;
}
.var-parts label{display:flex;flex-direction:column;gap:3px;width:110px}

/* ============================================================
   Driver Collections — colour by MEANING, not for decoration.

   Four things sit on these screens one under another, and until
   they were tinted they read as one long white sheet:

     .dc-owed     amber  — money that is still out there
     .dc-day      amber, lighter — the day-by-day breakdown of it
     .dc-settled  green  — money that has come in and settled
     .dc-log      blue   — the by-date log, a reference view

   Each card gets a tinted header, a matching left edge and a
   table head in the same family, so a glance at the colour says
   whether you are looking at money owed, money in, or history.
   ============================================================ */
.dc-sec{border-radius:12px;overflow:hidden}
.dc-sec > .card-header{border-bottom-width:1px}
.dc-sec .table-wrap table.admin-table thead th{background:inherit}

.dc-owed{border-color:#e3cfa4;box-shadow:inset 4px 0 0 #b45309}
.dc-owed > .card-header{background:#fdf6e9;color:#7a5216}
.dc-owed .table-wrap table.admin-table thead th{background:#faf1e2;color:#7a5216}

.dc-day{border-color:#e8dcc2;box-shadow:inset 4px 0 0 #d9a441}
.dc-day > .card-header{background:#fdfaf2;color:#7a5216}
.dc-day .table-wrap table.admin-table thead th{background:#f8f2e6;color:#7a5216}

.dc-settled{border-color:#bcd9be;box-shadow:inset 4px 0 0 #2e7d32}
.dc-settled > .card-header{background:#f0f7f0;color:#1b5e20}
.dc-settled .table-wrap table.admin-table thead th{background:#e8f2e8;color:#1b5e20}

.dc-log{border-color:#c3d6e6;box-shadow:inset 4px 0 0 #2f6f9e}
.dc-log > .card-header{background:#f1f6fb;color:#245878}
.dc-log .table-wrap table.admin-table thead th{background:#e8f0f8;color:#245878}

.dc-idle{border-color:#dfe3dd;box-shadow:inset 4px 0 0 #9aa697}
.dc-idle > .card-header{background:#f6f7f5;color:#5c6b56}

/* A heading inside a card that already has its own colour. */
.dc-sub{
  margin:0 0 4px;font-size:14px;font-weight:700;
  display:flex;align-items:center;gap:7px;
}
.dc-note{margin:0 0 10px;font-size:13px;color:var(--og-muted);max-width:80ch}

/* The expanded rows under a day — inset so they read as belonging to it. */
tr.dc-detail > td{padding:0}
tr.dc-detail .dc-inset{
  background:#fbfaf6;border-left:3px solid #d9a441;padding:2px 0 2px 10px;
}
.dc-settled tr.dc-detail .dc-inset{background:#f7fbf7;border-left-color:#2e7d32}
.dc-log tr.dc-detail .dc-inset{background:#f7fafd;border-left-color:#2f6f9e}
tr.dc-detail table.admin-table thead th{background:transparent!important;font-size:11px}
tr.dc-detail table.admin-table tbody tr:hover{background:transparent}

/* ---- Linked orders --------------------------------------------------------
   Several orders that have to be delivered together. The row, the order screen
   and the driver's card all print the order NUMBERS, because "which ones" is the
   only question a link flag ever prompts. */
.link-tag{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin-top:3px;font-size:11px;color:#6b756b}
.link-tag i{color:#2e7d32}
.link-tag a{color:#2e7d32;font-weight:600;text-decoration:none;background:#eaf3ea;border:1px solid #cfe3cf;
            border-radius:4px;padding:0 5px;line-height:1.6}
.link-tag a:hover{background:#dcecdc;text-decoration:none}
.link-panel{border:1px solid #cfe3cf;background:#f4f9f4;border-radius:10px;padding:12px 14px;margin:0 0 14px}
.link-panel h4{margin:0 0 8px;font-size:12.5px;text-transform:uppercase;letter-spacing:.05em;color:#2e7d32}
.link-panel .lp-row{display:flex;align-items:center;gap:8px;padding:5px 0;border-top:1px solid #e0ece0}
.link-panel .lp-row:first-of-type{border-top:0}
.link-panel .lp-row b{font-weight:600}
.link-panel .muted{color:#6b756b}
.link-panel .lp-warn{display:flex;gap:8px;align-items:flex-start;margin-top:8px;padding:8px 11px;
                     background:#fdf6e8;border:1px solid #efdcae;border-radius:7px;
                     font-size:12.5px;color:#7a5a12;line-height:1.45}
.link-panel .lp-warn i{flex:0 0 auto;margin-top:1px}
/* NCAQ: compact sidebar — fits without scrolling on a laptop screen */
.sidebar-head{padding:12px 16px}
.sidebar-nav{padding:8px 10px}
.sidebar-nav a{padding:7px 12px;margin-bottom:1px;font-size:13.5px;gap:10px}
.sidebar-nav a i{font-size:15px}
.sidebar-nav .nav-sep{padding:10px 12px 3px;font-size:10.5px}
.sidebar-credit{padding:10px 16px}
