/* Ascent Select - UI
   Soft-grey canvas, white cards, Ascent blue accent, Inter. Compact + professional.
   Aesthetic aligned with the Ascent console design system. */

:root {
  --bg:         #fafafa;
  --surface:    #ffffff;
  --soft:       #fafafa;
  --text:       #1a1a1a;
  --head:       #111827;
  --muted:      #6b7280;
  --muted-2:    #9ca3af;
  --line:       #e5e7eb;
  --line-2:     #d1d5db;
  --brand:      #005bea;
  --brand-ink:  #0050cf;
  --brand-soft: #eaf1ff;
  --ok:         #0a7d33;
  --ok-bg:      #e7f6ec;
  --warn:       #8a6d00;
  --warn-bg:    #fbf3d8;
  --err:        #b42318;
  --err-bg:     #fdecea;
  --radius:     8px;
  --radius-sm:  6px;
  --sidebar-w:  224px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 600; color: var(--head); margin: 0; }
h1 { font-size: 18px; letter-spacing: -0.01em; }
h2 { font-size: 15px; }
h3 { font-size: 13px; }

/* ---------- layout shell (Ascent Kanban / Repo) ---------- */
body.has-sidebar .shell { margin-left: var(--sidebar-w); min-width: 0; }
.shell { display: flex; flex-direction: column; min-height: 100vh; }
.wrap { padding: 22px 26px; flex: 1; max-width: 1180px; width: 100%; }
.wrap-narrow { max-width: 560px; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--surface);
  border-right: .5px solid var(--line); display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
}
.sidebar .brand, .sidebar-brand { padding: 9px 18px 8px; border-bottom: .5px solid var(--line); display: block; }
.sidebar-brand img { height: 45px; width: auto; display: block; }
.sidenav { padding: 4px 10px; flex: 1; overflow-y: auto; }
.sidenav a {
  display: flex; align-items: center; gap: 9px; padding: 4px 10px; border-radius: 6px;
  color: #374151; font-size: 13px; margin-bottom: 1px;
}
.sidenav a:hover { background: var(--soft); text-decoration: none; }
.sidenav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.sidenav a svg { width: 16px; height: 16px; flex: 0 0 16px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.sidenav a .badge { margin-left: auto; }
.navgroup { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); padding: 6px 10px 2px; }
.navgroup:first-child { padding-top: 2px; }

.whoami { padding: 6px 16px 5px; border-top: .5px solid var(--line); }
.whoami-name { font-weight: 500; font-size: 13px; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whoami-mail { font-size: 11.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .signout { padding: 2px 10px 6px; }
.sidebar .signout a { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 6px; color: #374151; font-size: 13.5px; }
.sidebar .signout a:hover { background: var(--err-bg); color: var(--err); text-decoration: none; }
.sidebar .signout a svg { width: 16px; height: 16px; flex: 0 0 16px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.sidebar .powered { padding: 9px 18px; border-top: .5px solid var(--line); }
.sidebar .powered img { height: 28px; width: auto; display: block; }

/* ---------- mobile top bar (checkbox toggle) ---------- */
.navtoggle { display: none; }
.mobilebar { display: none; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: .5px solid var(--line); position: sticky; top: 0; z-index: 30; }
.mobilebar .brand img { height: 26px; display: block; }
.burger { display: inline-flex; flex-direction: column; gap: 4px; border: .5px solid var(--line-2); background: #fff; border-radius: 6px; padding: 8px 9px; cursor: pointer; }
.burger span { width: 16px; height: 1.7px; background: #374151; display: block; border-radius: 2px; }
.nav-scrim { display: none; position: fixed; inset: 0; background: rgba(17,24,39,.35); z-index: 35; }

/* ------------------------------------------------------------- Headings */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-head h1 { margin-bottom: 3px; }
.lede { margin: 0; color: var(--muted); font-size: 13px; max-width: 60ch; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Cards */
.card {
  background: var(--surface);
  border: 0.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card + .card { margin-top: 16px; }
.card-h {
  padding: 13px 16px; border-bottom: 0.5px solid var(--line);
  font-weight: 500; font-size: 13.5px; color: var(--head);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.card-b { padding: 16px; }
.table-card { padding: 0; overflow: hidden; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty p { margin: 0 0 16px; }

/* --------------------------------------------------------------- Tables */
.grid { width: 100%; border-collapse: collapse; background: var(--surface); }
.grid thead th {
  text-align: left; font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted);
  padding: 11px 16px; border-bottom: 0.5px solid var(--line);
  background: var(--soft); white-space: nowrap;
}
.grid tbody td { padding: 11px 16px; border-bottom: 0.5px solid var(--line); vertical-align: middle; font-size: 13px; }
.grid tbody tr:last-child td { border-bottom: none; }
.grid tbody tr:hover { background: #fcfcfd; }

.col-price, .col-total, .col-qty { white-space: nowrap; }
.col-action { width: 1%; white-space: nowrap; }
.col-desc { color: var(--muted); max-width: 380px; }

.sku { font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.name { display: block; font-weight: 500; color: var(--head); }
.col-name .sku { display: block; margin-top: 2px; }
.price { font-variant-numeric: tabular-nums; }
.tag {
  display: inline-block; margin-top: 4px;
  font-size: 10.5px; color: var(--muted); background: var(--soft);
  border: 0.5px solid var(--line); border-radius: 999px; padding: 1px 8px;
}

/* --------------------------------------------------------------- Badges */
.badge {
  display: inline-flex; align-items: center; min-width: 18px; justify-content: center;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500;
  color: #fff; background: var(--brand); line-height: 1.6;
}
.pill {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; border: 0.5px solid var(--line-2);
  color: var(--muted); background: var(--surface); line-height: 1.6;
}
.pill.green { color: var(--ok); background: var(--ok-bg); border-color: #bfe6cb; }
.pill.blue  { color: var(--brand); background: var(--brand-soft); border-color: #c9dcff; }
.pill.amber { color: var(--warn); background: var(--warn-bg); border-color: #ecdca0; }
.pill.red   { color: var(--err); background: var(--err-bg); border-color: #f0c4bf; }
.pill.grey  { color: var(--muted); background: var(--soft); }

.row-actions { display: flex; gap: 14px; }
.row-actions a { color: var(--brand); font-size: 13px; }
.link-remove {
  background: none; border: none; color: var(--muted-2);
  font: inherit; font-size: 12.5px; cursor: pointer; padding: 0;
}
.link-remove:hover { color: var(--err); }

/* ------------------------------------------------------------- Stepper */
.add-row { display: flex; align-items: center; gap: 10px; }
.stepper {
  display: inline-flex; align-items: center;
  border: 0.5px solid var(--line-2); border-radius: var(--radius-sm);
  overflow: hidden; height: 32px; background: var(--surface);
}
.step {
  width: 30px; height: 30px; border: none; background: var(--surface);
  color: var(--text); font-size: 15px; cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.step:hover { background: var(--soft); }
.step-qty {
  width: 34px; height: 30px; border: none; text-align: center;
  font: inherit; font-size: 13px; color: var(--text);
  font-variant-numeric: tabular-nums; background: transparent;
  border-left: 0.5px solid var(--line-2); border-right: 0.5px solid var(--line-2);
}
.step-qty:focus { outline: none; }

/* --------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: 13px; font-weight: 500;
  padding: 8px 13px; border-radius: var(--radius-sm);
  border: 0.5px solid var(--line-2); background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.btn:hover { background: var(--soft); text-decoration: none; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--soft); }
.btn-add { padding: 8px 18px; }
.btn-block { display: flex; width: 100%; margin-top: 14px; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }

/* ------------------------------------------------------------- Summary */
.cart-layout, .checkout-layout, .confirm-layout {
  display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start;
}
.summary h2 { margin-bottom: 16px; }
.sum-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0; font-size: 13.5px; color: var(--muted);
}
.sum-row span:last-child { color: var(--text); font-variant-numeric: tabular-nums; }
.sum-total {
  margin-top: 6px; padding-top: 12px; border-top: 0.5px solid var(--line);
  font-size: 15px; font-weight: 600; color: var(--head);
}
.sum-total span:last-child { font-weight: 600; }
.sum-items { list-style: none; margin: 0 0 8px; padding: 0 0 8px; border-bottom: 0.5px solid var(--line); }
.sum-items li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; }
.sum-items .sum-name { color: var(--text); }
.sum-items em { color: var(--muted-2); font-style: normal; }
.fine { margin: 10px 0 0; font-size: 11.5px; color: var(--muted-2); text-align: center; }

/* --------------------------------------------------------------- Forms */
.form-card h2 { margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field > span { font-size: 12.5px; color: #374151; font-weight: 500; }
.field em { color: var(--muted-2); font-style: normal; font-weight: 400; }
.field input, .field textarea, .field select {
  font: inherit; font-size: 13px; color: var(--text);
  padding: 8px 11px; border: 0.5px solid var(--line-2);
  border-radius: var(--radius-sm); background: var(--surface); width: 100%;
}
.field select { appearance: none; -webkit-appearance: none; cursor: pointer;
  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='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.field input[readonly] { background: var(--soft); color: var(--muted); }
.field textarea { resize: vertical; min-height: 70px; }
.check { display: flex; align-items: center; gap: 9px; margin: 16px 0 4px; font-size: 13px; color: var(--muted); }
.check input { width: 15px; height: 15px; accent-color: var(--brand); }
.checkout-note {
  font-size: 13px; color: var(--muted); background: var(--soft);
  border: 0.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 14px; margin: 0 0 16px;
}
.checkout-note a { color: var(--brand); }
.pay-intro { font-size: 13.5px; color: var(--muted); margin: 0 0 18px; line-height: 1.5; }
.pay-note { font-size: 12px; color: var(--muted-2); margin: 14px 0 0; }

/* --------------------------------------------------------------- Auth */
.auth-wrap { max-width: 400px; margin: 6vh auto 0; }
.auth-card { padding: 30px 28px; border-radius: 12px; }
.auth-card h1 { font-size: 17px; margin-bottom: 6px; }
.auth-card .lede { margin-bottom: 20px; }
.auth-card .field { margin-bottom: 14px; }
.otp-input { letter-spacing: 8px; text-align: center; font-size: 18px; font-variant-numeric: tabular-nums; }
.resend { margin-top: 14px; text-align: center; }
.link-plain { background: none; border: none; color: var(--brand); font: inherit; font-size: 13px; cursor: pointer; }

/* --------------------------------------------------------------- Confirm */
.confirm-banner {
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
  border: 0.5px solid #bfe6cb; background: var(--ok-bg);
}
.confirm-banner .tick {
  width: 34px; height: 34px; border-radius: 50%; background: var(--ok);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; flex: none;
}
.confirm-ref { font-size: 15px; color: var(--head); font-weight: 600; }
.confirm-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* --------------------------------------------------------------- Flash */
.flash { border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; border: 0.5px solid; }
.flash-success { background: var(--ok-bg); border-color: #bfe6cb; color: var(--ok); }
.flash-error   { background: var(--err-bg); border-color: #f0c4bf; color: var(--err); }
.flash-info    { background: var(--brand-soft); border-color: #c9dcff; color: var(--brand); }

/* --------------------------------------------------------------- Toast */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--head); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.show-cart { display: none; }

/* ---------------------------------------------------------- Policy pages */
.policy { max-width: 820px; line-height: 1.6; }
.policy h2 { font-size: 15px; margin: 26px 0 8px; color: var(--head); }
.policy h2:first-child { margin-top: 0; }
.policy h3 { font-size: 13.5px; margin: 18px 0 6px; color: var(--head); }
.policy p { margin: 0 0 12px; color: #374151; font-size: 14px; }
.policy ul, .policy ol { margin: 0 0 14px; padding-left: 20px; color: #374151; font-size: 14px; }
.policy li { margin: 4px 0; }
.policy a { color: var(--brand); }
.policy .policy-address { line-height: 1.7; }
.policy .policy-eff { color: var(--muted-2); font-size: 12.5px; margin-top: 14px; }
.policy .policy-legend { font-size: 12.5px; color: var(--muted-2); }
.policy-table-wrap { overflow-x: auto; margin: 0 0 16px; }
.policy-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 460px; }
.policy-table th, .policy-table td { border: 0.5px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.policy-table th { background: var(--soft); font-weight: 500; color: var(--head); }
.policy-table td { color: #374151; }

/* ------------------------------------------------- Site footer (policies) */
.site-footer { margin-top: 44px; padding-top: 20px; border-top: 0.5px solid var(--line); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.footer-links a { font-size: 12.5px; color: var(--muted); }
.footer-links a:hover { color: var(--head); }
.footer-meta { font-size: 12px; color: var(--muted-2); }

/* ============================================================== Responsive */
.overlay { display: none; position: fixed; inset: 0; background: rgba(17,24,39,.35); z-index: 35; }
@media (max-width: 860px) {
  body.has-sidebar .shell { margin-left: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 30px rgba(0,0,0,.12); }
  .navtoggle:checked ~ .sidebar { transform: translateX(0); }
  .navtoggle:checked ~ .nav-scrim { display: block; }
  .mobilebar { display: flex; }
  .wrap { padding: 16px 14px; }

  .page-head { flex-direction: column; gap: 12px; }
  .cart-layout, .checkout-layout, .confirm-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .show-cart { display: inline-flex; }

  /* Tables become stacked cards */
  table[data-cards] thead { display: none; }
  table[data-cards], table[data-cards] tbody { display: block; }
  table[data-cards] tr {
    display: block; background: var(--surface);
    border: 0.5px solid var(--line); border-radius: var(--radius);
    padding: 6px 4px; margin: 0 0 10px;
  }
  table[data-cards] tr:hover { background: var(--surface); }
  table[data-cards] td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; padding: 9px 14px; border-bottom: 0.5px solid var(--line) !important;
  }
  table[data-cards] td:last-child { border-bottom: 0 !important; }
  table[data-cards] td::before {
    content: attr(data-label); font-size: 11px; letter-spacing: 0.03em;
    text-transform: uppercase; color: var(--muted); font-weight: 500; flex: 0 0 auto;
  }
  table[data-cards] td[data-label=""]::before { display: none; }
  table[data-cards] .col-name { flex-direction: column; align-items: flex-start; gap: 2px; }
  table[data-cards] .col-name::before { order: -1; }
  table[data-cards] .col-desc { color: var(--muted); font-size: 13px; }
  table[data-cards] .col-action { display: block; }
  table[data-cards] .col-action::before { display: block; margin-bottom: 8px; }
  table[data-cards] .add-row { justify-content: space-between; }
  table[data-cards] .row-actions { justify-content: flex-end; }
  .col-desc { max-width: none; }
}
@media (max-width: 420px) {
  table[data-cards] .add-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .btn-add { width: 100%; }
}

/* Accessibility */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ------------------------------------------------------------------- Admin */
.admin-shell { min-height: 100vh; background: var(--bg); }
.admin-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: var(--surface); border-bottom: 0.5px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.admin-brand { display: inline-flex; align-items: center; gap: 10px; }
.admin-brand:hover { text-decoration: none; }
.admin-brand img { width: 116px; height: auto; display: block; }
.admin-badge {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
  color: var(--brand); background: var(--brand-soft); border: 0.5px solid #c9dcff;
  padding: 2px 8px; border-radius: 999px;
}
.admin-user { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.admin-user .acct-email { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-main { max-width: 1080px; margin: 0 auto; padding: 24px; }
.admin-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.admin-cards .card { display: flex; flex-direction: column; }
.admin-cards .card .card-b { flex: 1; }
.admin-status { list-style: none; margin: 0; padding: 0; font-size: 13.5px; color: var(--muted); }
.admin-status li { padding: 5px 0; display: flex; gap: 8px; align-items: center; }
.admin-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.admin-auth .auth-card { width: 100%; max-width: 380px; }
.admin-auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.admin-auth-brand img { width: 120px; height: auto; }
@media (max-width: 720px) {
  .admin-cards { grid-template-columns: 1fr; }
  .admin-top { padding: 10px 14px; }
  .admin-main { padding: 16px 14px; }
}

/* ------------------------------------------------- Admin order builder */
.inline-search { display: flex; gap: 8px; }
.inline-search input[type=text] {
  flex: 1; font: inherit; font-size: 13px; padding: 8px 11px;
  border: 0.5px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface);
}
.inline-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.qty-input {
  width: 60px; font: inherit; font-size: 13px; text-align: center;
  padding: 6px 6px; border: 0.5px solid var(--line-2); border-radius: var(--radius-sm);
}
.admin-main .add-row { gap: 8px; }

/* Admin badge under the sidebar brand + live search results */
.brand-wrap .admin-badge { margin-top: 10px; }
.search-results { margin-top: 4px; }
.result-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 2px; border-bottom: 0.5px solid var(--line);
}
.result-row:last-child { border-bottom: none; }
.result-main { min-width: 0; }
.result-main .name { display: block; }
.result-main .sku { display: block; margin-top: 2px; }
.result-row form { margin: 0; display: flex; align-items: center; gap: 8px; }

/* Fix: second grid card was inheriting .card + .card top margin (misaligned tops) */
.admin-cards .card + .card { margin-top: 0; }

/* Clickable search-result rows (whole row is the button) */
.rowform { margin: 0; }
.result-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: none; border-bottom: 0.5px solid var(--line);
  padding: 11px 4px; font: inherit; color: var(--text);
  transition: background .12s;
}
.result-row:hover:not(:disabled) { background: var(--brand-soft); }
.result-row:disabled { cursor: not-allowed; opacity: .6; }
.rowform:last-child .result-row { border-bottom: none; }
.result-go { font-size: 12.5px; color: var(--brand); white-space: nowrap; flex: 0 0 auto; }
.result-row:disabled .result-go { color: var(--muted-2); }

/* Editable cart */
.cart-desc { width: 100%; min-width: 150px; font: inherit; font-size: 12.5px; padding: 6px 8px; border: 0.5px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); }
.cart-qty { width: 64px; font: inherit; font-size: 13px; text-align: center; padding: 6px; border: 0.5px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); }
.cart-desc:focus, .cart-qty:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.cart-grid td { vertical-align: middle; }
.line-total { font-variant-numeric: tabular-nums; }

/* ADMIN badge in the sidebar foot (above email) */
.whoami .admin-badge { display: inline-block; margin-bottom: 3px; }

/* Payments report: stat row + filter bar */
.muted { color: var(--muted-2); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 0.5px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat-n { font-size: 20px; font-weight: 600; color: var(--head); font-variant-numeric: tabular-nums; }
.stat-l { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); margin-top: 3px; }
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.fpill { font-size: 12.5px; padding: 6px 12px; border-radius: 999px; border: 0.5px solid var(--line-2); color: var(--muted); background: var(--surface); }
.fpill:hover { background: var(--soft); text-decoration: none; }
.fpill.on { background: var(--brand-soft); color: var(--brand); border-color: #c9dcff; font-weight: 500; }
.filter-search input { font: inherit; font-size: 13px; padding: 7px 11px; border: 0.5px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); min-width: 240px; }
.filter-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
@media (max-width: 700px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }

/* Payments filter: FY dropdown next to status pills */
.filter-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fy-form { margin: 0; }
.fy-select { font: inherit; font-size: 13px; padding: 6px 10px; border: 0.5px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--head); cursor: pointer; }
.fy-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* Payments table: invoice as PDF link + date sub-row */
.inv-link { color: var(--text); font: inherit; text-decoration: none; }
.inv-link:hover { color: var(--brand); text-decoration: underline; }
.sub-date { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.stat-caption { font-size: 11.5px; color: var(--muted-2); margin: 0 2px 8px; text-transform: uppercase; letter-spacing: .04em; }

/* Zoho entities settings form */
.cred-note { font-size: 12px; color: var(--muted-2); margin: 16px 0 8px; }
.check-row { display: flex; gap: 20px; margin-top: 12px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); }

/* Payments filter form (labelled controls, all on one line) */
.filter-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.fl { display: flex; flex-direction: column; gap: 4px; width: 160px; }
.fl > span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); }
.fl select, .fl input { width: 100%; height: 36px; font: inherit; font-size: 13px; padding: 6px 10px; border: 0.5px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--head); }
.fl select { cursor: pointer; }
.fl input:focus, .fl select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.fl-entity { width: 160px; }
.fl-client { width: 240px; }
.fl-fy { width: 150px; }
.fl-pay { width: 120px; }
.fl-search { flex: 1 1 auto; min-width: 180px; width: auto; }
