/* TillyStock 3.7.21 — modern client design system */
:root {
  color-scheme: light;
  --ts-bg: #f4f7fb;
  --ts-surface: rgba(255, 255, 255, .92);
  --ts-surface-solid: #ffffff;
  --ts-surface-soft: #f8faff;
  --ts-ink: #111827;
  --ts-muted: #667085;
  --ts-line: rgba(148, 163, 184, .23);
  --ts-line-strong: rgba(100, 116, 139, .34);
  --ts-primary: #635bff;
  --ts-primary-dark: #4f46e5;
  --ts-primary-soft: #eeedff;
  --ts-cyan: #0ea5e9;
  --ts-success: #079455;
  --ts-warning: #b54708;
  --ts-danger: #d92d20;
  --ts-radius-sm: 12px;
  --ts-radius: 18px;
  --ts-radius-lg: 26px;
  --ts-shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .04);
  --ts-shadow: 0 18px 55px rgba(26, 35, 58, .09), 0 2px 8px rgba(26, 35, 58, .04);
  --ts-shadow-float: 0 28px 80px rgba(15, 23, 42, .22);
  --red: var(--ts-primary);
  --red-dark: var(--ts-primary-dark);
  --line: var(--ts-line);
  --muted: var(--ts-muted);
  --primary: var(--ts-primary);
  --text: var(--ts-ink);
  --ink: var(--ts-ink);
  --border: var(--ts-line-strong);
}

* { scrollbar-width: thin; scrollbar-color: #c8d0df transparent; }
html { min-height: 100%; overflow-x: auto; background: var(--ts-bg); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  overflow-x: visible;
  color: var(--ts-ink);
  background:
    radial-gradient(circle at 8% -5%, rgba(99, 91, 255, .14), transparent 28rem),
    radial-gradient(circle at 94% 4%, rgba(14, 165, 233, .11), transparent 30rem),
    linear-gradient(180deg, #f8faff 0, var(--ts-bg) 48%, #f6f8fc 100%);
  font-family: Inter, "SF Pro Display", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .24;
  background-image: linear-gradient(rgba(99, 91, 255, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(99, 91, 255, .055) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, #000, transparent 48%);
}

.skip-link {
  position: fixed;
  left: 18px;
  top: 12px;
  z-index: 1000;
  padding: 11px 15px;
  border-radius: 11px;
  color: #fff;
  background: var(--ts-primary-dark);
  box-shadow: var(--ts-shadow-float);
  text-decoration: none;
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform .16s ease;
}
.skip-link:focus { transform: translateY(0); }

.ui-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.topbar svg, .mobile-nav svg, .topbar-logout svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0;
  color: #fff;
  background: rgba(11, 16, 32, .92);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 10px 35px rgba(10, 15, 30, .16);
  backdrop-filter: blur(22px) saturate(150%);
}
.topbar-inner {
  width: min(1600px, 100%);
  min-height: 76px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand-wrap { align-items: center; gap: 11px; flex: 0 0 auto; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #7c72ff 0%, #635bff 48%, #0ea5e9 140%);
  box-shadow: 0 10px 28px rgba(99, 91, 255, .36), inset 0 1px rgba(255, 255, 255, .35);
}
.brand-mark span { display: block !important; color: inherit !important; font-size: 13px !important; font-weight: 900; letter-spacing: -.4px; }
.brand-copy { display: grid; gap: 1px; }
.brand { font-size: 21px; font-weight: 850; letter-spacing: -.55px; line-height: 1.05; }
.brand-copy > span { color: #8e9aae; font-size: 11px; font-weight: 650; white-space: nowrap; }

.main-nav {
  min-width: 0;
  margin-left: auto;
  gap: 3px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 16px;
  background: rgba(255, 255, 255, .035);
}
.main-nav .nav-link, .nav-dropdown > summary {
  min-height: 42px;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 11px;
  color: #aeb9cc;
  font-size: 12px;
  font-weight: 720;
  letter-spacing: -.05px;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
.main-nav .nav-link svg { width: 16px; height: 16px; opacity: .86; }
.main-nav .nav-link:hover, .nav-dropdown > summary:hover {
  color: #fff;
  background: rgba(255, 255, 255, .07);
  transform: translateY(-1px);
}
.main-nav .nav-link.active, .nav-dropdown.active > summary, .nav-dropdown[open] > summary {
  color: #fff;
  background: linear-gradient(135deg, rgba(124, 114, 255, .95), rgba(99, 91, 255, .76));
  box-shadow: 0 8px 22px rgba(99, 91, 255, .25), inset 0 1px rgba(255, 255, 255, .22);
}
.nav-dropdown-menu {
  top: calc(100% + 10px);
  min-width: 240px;
  padding: 8px;
  border: 1px solid var(--ts-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--ts-shadow-float);
  backdrop-filter: blur(18px);
}
.nav-dropdown-menu a { color: #344054 !important; border-radius: 10px; padding: 11px 12px; font-weight: 680; }
.nav-dropdown-menu a:hover { color: var(--ts-primary) !important; background: var(--ts-primary-soft); }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.agent-indicator > summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  color: #dce4ef;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
}
.agent-indicator > summary > svg { color: #8e9aae; }
.agent-indicator.agent-online > summary > svg { color: #32d583; }
.agent-indicator.agent-offline > summary > svg { color: #f97066; }
.agent-dot { width: 7px; height: 7px; box-shadow: 0 0 0 4px rgba(249, 112, 102, .12); }
.agent-online .agent-dot { box-shadow: 0 0 0 4px rgba(50, 213, 131, .12); }
.agent-label { font-size: 11px; font-weight: 750; white-space: nowrap; }
.agent-popover {
  top: calc(100% + 10px);
  right: 0;
  width: 310px;
  padding: 18px;
  border: 1px solid var(--ts-line);
  border-radius: 18px;
  color: var(--ts-ink);
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--ts-shadow-float);
  backdrop-filter: blur(20px);
}
.agent-popover-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.agent-popover-title b { padding: 4px 7px; border-radius: 999px; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.agent-popover-title b.online { color: #067647; background: #dcfae6; }
.agent-popover-title b.offline { color: #b42318; background: #fee4e2; }
.agent-kv { padding: 10px 0; border-top: 1px solid #eef1f5; }
.agent-kv span { color: var(--ts-muted); font-size: 11px; }
.agent-kv strong { color: #344054; font-size: 12px; }
.topbar-logout {
  min-width: 42px;
  min-height: 42px;
  margin: 0;
  gap: 7px;
  padding: 9px 11px;
  border-color: rgba(255, 255, 255, .1);
  border-radius: 12px;
  color: #dce4ef;
  background: rgba(255, 255, 255, .04);
}
.topbar-logout:hover { background: rgba(255, 255, 255, .1); transform: translateY(-1px); }
.topbar-logout span { font-size: 11px; font-weight: 750; }

.mobile-nav { display: none; position: relative; }
.mobile-nav > summary {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  list-style: none;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, .07);
}
.mobile-nav > summary::-webkit-details-marker { display: none; }
.mobile-nav-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(340px, calc(100vw - 24px));
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--ts-line);
  border-radius: 20px;
  color: var(--ts-ink);
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--ts-shadow-float);
  backdrop-filter: blur(22px);
}
.mobile-nav-title { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 13px; }
.mobile-nav-title strong { font-size: 15px; }
.mobile-nav-title span { color: var(--ts-muted); font-size: 11px; }
.mobile-nav-panel > a {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #344054;
  text-decoration: none;
  font-size: 13px;
  font-weight: 720;
}
.mobile-nav-panel > a svg { color: #7a8699; }
.mobile-nav-panel > a:hover { color: var(--ts-primary); background: #f7f7ff; }
.mobile-nav-panel > a.active { color: var(--ts-primary); background: var(--ts-primary-soft); }
.mobile-nav-separator { margin: 9px 4px 5px; padding: 9px 8px 4px; border-top: 1px solid #edf0f5; }
.mobile-nav-separator span { color: #98a2b3; font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }

main { width: min(1520px, 100%); min-height: calc(100vh - 146px); margin: 0 auto; padding: 34px 28px 48px; }
.invoice-page { width: 100%; padding: 0; }
.page-head, .invoice-hero, .hero-row, .setup-heading {
  position: relative;
  margin-bottom: 24px;
  padding: 4px 2px;
}
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.span-3 { grid-column: span 3; }
.path-row { grid-template-columns: minmax(280px, 1fr) auto auto; }
h1, h2, h3 { color: var(--ts-ink); letter-spacing: -.025em; }
h1 { font-size: clamp(30px, 3.2vw, 44px); font-weight: 820; }
h2 { font-weight: 790; }
.eyebrow {
  color: var(--ts-primary);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .15em;
}
.muted { color: var(--ts-muted); line-height: 1.55; }

.card, .home-dashboard, .invoice-row, .edo-row, .action-card, .compact-card {
  border: 1px solid var(--ts-line);
  border-radius: var(--ts-radius-lg);
  background: var(--ts-surface);
  box-shadow: var(--ts-shadow-sm);
  backdrop-filter: blur(14px);
}
.card { padding: 28px; }
.card:hover { border-color: rgba(99, 91, 255, .22); }
.section-heading, .section-head { align-items: flex-start; }
.section-heading h2, .section-head h2 { margin-top: 1px; }
.section-heading > div:first-child { display: grid; align-items: start; gap: 2px; }
.section-heading p { margin: 6px 0 0; }
.document-card .section-heading > div:first-child { display: flex; align-items: center; gap: 12px; }
.document-card .section-heading > p { margin: 8px 0 0 46px; }
.step-badge, .invoice-number, .draft-note-icon, .ready-icon {
  background: linear-gradient(135deg, var(--ts-primary), #8b83ff) !important;
  color: #fff !important;
  box-shadow: 0 9px 24px rgba(99, 91, 255, .24);
}

button, .button, .button-link, .secondary-btn, .paste-btn {
  min-height: 44px;
  border-radius: var(--ts-radius-sm);
  font-weight: 780;
  letter-spacing: -.01em;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
button:not([class]), .button:not(.secondary):not(.danger):not(.success), .button-link:not(.secondary):not(.danger):not(.success) {
  color: #fff;
  background: linear-gradient(135deg, #7068ff, var(--ts-primary-dark));
  box-shadow: 0 9px 22px rgba(99, 91, 255, .22);
}
button:hover, .button:hover, .button-link:hover { transform: translateY(-1px); }
button:not([class]):hover, .button:not(.secondary):not(.danger):not(.success):hover, .button-link:not(.secondary):not(.danger):not(.success):hover {
  background: linear-gradient(135deg, #7c72ff, #5149df);
  box-shadow: 0 12px 27px rgba(99, 91, 255, .3);
}
.button.secondary, .button-link.secondary, .secondary-btn, .paste-btn {
  color: #344054;
  border: 1px solid var(--ts-line-strong);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.button.secondary:hover, .button-link.secondary:hover, .secondary-btn:hover, .paste-btn:hover {
  color: var(--ts-primary);
  border-color: rgba(99, 91, 255, .38);
  background: #f9f9ff;
}
.icon-btn.danger, .button.danger, button.text-danger, .mercury-delete-link { box-shadow: none; }
.invoice-more button { color: #344054; background: #fff; box-shadow: none; }
.invoice-more button:hover { color: var(--ts-primary); background: #f7f7ff; box-shadow: none; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(99, 91, 255, .28) !important;
  outline-offset: 2px;
}
button:disabled { transform: none !important; box-shadow: none !important; }

input, select, textarea {
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--ts-line-strong);
  border-radius: var(--ts-radius-sm);
  color: var(--ts-ink);
  background: rgba(255, 255, 255, .96);
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, .025);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #aab4c4; }
input:focus, select:focus, textarea:focus {
  border-color: var(--ts-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 91, 255, .11);
  outline: 0;
}
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--ts-primary); }
label { color: #344054; font-weight: 720; }
label small, .field-hint { color: var(--ts-muted); font-weight: 520; line-height: 1.45; }

.notice, .success, .draft-note {
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .04);
}
.notice.info { color: #175cd3; border-color: #b2ccff; background: linear-gradient(135deg, #eff4ff, #f6f9ff); }
.notice.warning { color: #7a2e0e; border-color: #fedf89; background: linear-gradient(135deg, #fffaeb, #fffdf5); }
.notice.error { color: #912018; border-color: #fecdca; background: linear-gradient(135deg, #fef3f2, #fff8f7); }
.notice.success, .success { color: #05603a; border-color: #abefc6; background: linear-gradient(135deg, #ecfdf3, #f5fff9); }

.table-wrap, .table-scroll, .admin-update-table-wrap, .mercury-stock-table-wrap, .mercury-expiry-table-wrap, .mercury-incoming-table-wrap, .mercury-inventory-table-wrap {
  border: 1px solid var(--ts-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 1px rgba(255, 255, 255, .8);
}
table { font-variant-numeric: tabular-nums; }
th {
  padding: 13px 14px;
  color: #667085;
  border-bottom-color: #e8ecf2;
  background: #f8faff;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .055em;
  text-transform: uppercase;
}
td { padding: 14px; border-bottom-color: #edf0f4; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #fafaff; }
.status, .chip, .status-pill, .invoice-status, .expiry-status, .match-state, .edo-status {
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 820;
  letter-spacing: -.01em;
}

.home-dashboard {
  position: relative;
  overflow: hidden;
  min-height: 650px;
  gap: 0;
  padding: 0;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--ts-shadow);
}
.home-dashboard::before {
  content: "";
  position: absolute;
  left: -100px;
  top: -130px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(99, 91, 255, .08);
  filter: blur(2px);
  pointer-events: none;
}
.home-upload-panel, .home-history-panel { position: relative; z-index: 1; padding: 38px; }
.home-history-panel { border-left: 1px solid var(--ts-line); background: rgba(248, 250, 255, .72); }
.home-heading h1 { font-size: clamp(32px, 4vw, 48px); margin-top: 7px; }
.auto-supplier-note {
  padding: 14px 16px;
  border: 1px solid #dfe4fb;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8f8ff, #f4f8ff);
}
.home-drop-zone, .drop-zone {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  border: 1.5px dashed rgba(99, 91, 255, .42);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0, rgba(99, 91, 255, .12), transparent 56%),
    linear-gradient(145deg, rgba(251, 251, 255, .98), rgba(244, 248, 255, .9));
}
.home-drop-zone::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, .7) 46%, transparent 70%);
  transform: translateX(-110%);
  transition: transform .65s ease;
}
.home-drop-zone:hover::after { transform: translateX(110%); }
.home-drop-zone:hover, .home-drop-zone:focus, .drop-zone.dragging {
  border-color: var(--ts-primary);
  background-color: #f8f8ff;
  box-shadow: 0 14px 38px rgba(99, 91, 255, .11);
  transform: translateY(-2px);
}
.drop-zone.has-file { border-color: #32b777; background: linear-gradient(145deg, #f3fff8, #f9fffb); }
.drop-icon {
  width: 58px;
  height: 58px;
  color: #fff;
  background: linear-gradient(135deg, #776eff, var(--ts-primary));
  box-shadow: 0 14px 32px rgba(99, 91, 255, .3);
}
.home-import-actions { grid-template-columns: 1fr 1fr 1.4fr; }
.home-history-list { gap: 9px; }
.home-history-item {
  border-color: rgba(148, 163, 184, .2);
  border-radius: 16px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .02);
}
.home-history-item:hover {
  border-color: rgba(99, 91, 255, .3);
  background: #fff;
  box-shadow: 0 12px 30px rgba(57, 49, 145, .09);
  transform: translateY(-2px);
}
.home-history-main strong { color: #1d2939; }
.home-history-side > strong { color: var(--ts-primary-dark); }
.upload-progress { border-radius: 16px; border-color: #d9dcff; background: #f8f8ff; }
.upload-progress-track { background: #e7e8f5; }
.upload-progress-track span { background: linear-gradient(90deg, var(--ts-primary), var(--ts-cyan)); }

.invoice-toolbar, .edo-toolbar { border-radius: 20px; }
.invoice-tabs a {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #f3f5f9;
}
.invoice-tabs a:hover { border-color: #d9dcff; color: var(--ts-primary); background: #f8f8ff; }
.invoice-tabs a.active { color: #fff; background: linear-gradient(135deg, #7068ff, var(--ts-primary-dark)); box-shadow: 0 8px 20px rgba(99, 91, 255, .2); }
.invoice-row, .edo-row { border-radius: 18px; }
.invoice-row:hover, .edo-row:hover { border-color: rgba(99, 91, 255, .3); box-shadow: 0 14px 34px rgba(45, 41, 99, .08); transform: translateY(-1px); }
.invoice-number { border-radius: 15px; }
.invoice-more > summary { border-color: var(--ts-line-strong); border-radius: 12px; background: #fff; }
.invoice-more > div { border-color: var(--ts-line); border-radius: 14px; box-shadow: var(--ts-shadow-float); }

.workflow-progress { border-radius: 20px; }
.review-page-wide {
  width: 100%;
  margin-left: 0;
  transform: none;
  display: flex;
  flex-direction: column;
}
.review-page-wide > .workflow-progress { order: 1; }
.review-page-wide > .review-summary-bar { order: 2; }
.review-page-wide > .review-workspace { order: 3; }
.review-page-wide > .match-suggestions-panel { order: 4; }
.review-page-wide > .document-visual-check { order: 5; }
.review-page-wide > .processing-journal { order: 6; }
.review-page-wide .table-wrap { position: relative; overscroll-behavior-inline: contain; }
.sticky-review-actions {
  padding: 14px 0 4px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(16px);
}
.workflow-step.current > span { color: var(--ts-primary); border-color: var(--ts-primary); box-shadow: 0 0 0 5px var(--ts-primary-soft); }
.workflow-step.done > span { border-color: var(--ts-success); background: var(--ts-success); }
.profile-badge { border-color: #d9dcff; border-radius: 14px; background: linear-gradient(135deg, #f8f8ff, #f5f8ff); }
.processing-journal { border-radius: 22px; }
.journal-event { border-color: var(--ts-line); border-radius: 14px; }
.journal-event:hover { border-color: rgba(99, 91, 255, .26); background: #fafaff; }
.product-search-results { border-color: var(--ts-line); border-radius: 14px; box-shadow: var(--ts-shadow-float); }
.product-search-option:hover, .product-search-option:focus, .product-search-option.active {
  color: var(--ts-primary-dark);
  background: var(--ts-primary-soft);
}
.ready-banner { border-color: #a6e2c1 !important; background: linear-gradient(135deg, #f3fcf7, #f8fffb) !important; }

.edo-hero, .edo-proof, .edo-summary .card, .honest-sign-org-card, .honest-sign-settings-card { border-radius: 22px; }
.edo-page > .card, .edo-list > .card, .edo-stats > .card, .honest-sign-page > .card { margin-bottom: 0; }
.edo-row { grid-template-columns: 120px minmax(280px, 1fr) 80px 130px minmax(190px, auto); }
.edo-bank-badge { color: #175cd3; border: 1px solid #b2ccff; background: #eff4ff; }
.edo-payment.revoked { color: var(--ts-danger); font-weight: 750; }
.edo-stat { border-radius: 18px; }
.edo-stat.active { outline: 0; border-color: rgba(99, 91, 255, .36); box-shadow: 0 0 0 4px var(--ts-primary-soft); }
.honest-sign-settings-card > summary:hover { background: #fafaff; }
.honest-sign-settings-card > summary::after {
  content: "⌄";
  color: var(--ts-muted);
  font-size: 20px;
  line-height: 1;
  transition: transform .18s ease;
}
.honest-sign-settings-card[open] > summary::after { transform: rotate(180deg); }
.honest-sign-group-grid label { border-color: var(--ts-line); border-radius: 12px; background: #fbfcfe; }
.honest-sign-group-grid label:hover { border-color: rgba(99, 91, 255, .34); background: #f8f8ff; }

.expiry-stat {
  min-height: 88px;
  border-color: var(--ts-line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}
.expiry-stat:hover { border-color: rgba(99, 91, 255, .32); background: #fafaff; transform: translateY(-1px); }
.expiry-stat.active { border-color: var(--ts-primary); box-shadow: 0 0 0 4px var(--ts-primary-soft); }
.mercury-match-trigger, .mercury-match-panel, .mercury-locked-batch { border-color: var(--ts-line-strong); border-radius: 13px; }
.mercury-match-panel { box-shadow: var(--ts-shadow-float); }
.mercury-confirm, .mercury-incoming-confirm { border-radius: 18px; }

.auth-shell { min-height: calc(100vh - 158px); }
.auth-card {
  width: min(460px, 100%);
  padding: 34px;
  border-color: var(--ts-line);
  border-radius: 26px;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--ts-shadow);
  backdrop-filter: blur(18px);
}
.auth-brand { color: var(--ts-primary); font-size: 25px; letter-spacing: -.5px; }

.app-footer {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 0 28px 24px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #98a2b3;
  font-size: 11px;
}
.app-footer span { color: #667085; font-weight: 820; }

@media (max-width: 1380px) {
  .agent-label, .topbar-logout span { display: none; }
  .main-nav .nav-link, .nav-dropdown > summary { padding-inline: 9px; }
}
@media (max-width: 1180px) {
  .main-nav { display: none; }
  .mobile-nav { display: block; }
  .topbar-actions { margin-left: auto; }
}
@media (max-width: 1050px) {
  .home-dashboard { grid-template-columns: 1fr; }
  .home-history-panel { border-left: 0; border-top: 1px solid var(--ts-line); }
  .home-upload-panel, .home-history-panel { padding: 30px; }
}
@media (max-width: 900px) {
  .mapping-table thead {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .edo-row { grid-template-columns: 90px minmax(0, 1fr) minmax(170px, auto); }
  .edo-count { display: none; }
  .edo-total { grid-column: 2; text-align: left; }
  .edo-actions { grid-column: 3; grid-row: 1 / 3; }
}
@media (max-width: 760px) {
  .topbar { padding: 0; }
  .topbar-inner { min-height: 66px; padding: 8px 12px; gap: 10px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .brand-copy > span { display: none; }
  .brand { font-size: 19px; }
  .agent-indicator > summary, .topbar-logout, .mobile-nav > summary { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; }
  .agent-indicator > summary .agent-dot { display: none; }
  .agent-popover { position: fixed; left: 12px; right: 12px; top: 76px; width: auto; }
  main { padding: 22px 12px 36px; }
  .card { padding: 20px 17px; border-radius: 20px; }
  .page-head, .invoice-hero, .hero-row { margin-bottom: 18px; }
  .page-head { flex-direction: column; }
  .span-3 { grid-column: auto; }
  .path-row { grid-template-columns: 1fr; }
  h1 { font-size: 30px; }
  .home-upload-panel, .home-history-panel { padding: 23px 18px; }
  .home-heading h1 { font-size: 34px; }
  .home-drop-zone { min-height: 210px; }
  .home-import-actions { grid-template-columns: 1fr; }
  .home-history-item { grid-template-columns: 1fr; }
  .home-history-side { align-items: flex-start; flex-direction: row; justify-content: space-between; }
  .app-footer { padding: 0 14px 18px; }
  .app-footer small { display: none; }
  th { font-size: 9px; }
  .review-page-wide .editable th:first-child,
  .review-page-wide .editable td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #fff;
    box-shadow: 1px 0 #e7eaf0;
  }
  .review-page-wide .editable th:first-child { z-index: 5; background: #f8faff; }
}
@media (max-width: 620px) {
  .edo-row { grid-template-columns: 1fr; }
  .edo-total, .edo-actions { grid-column: auto; grid-row: auto; }
  .edo-actions { justify-content: flex-start; }
}
@media (max-width: 430px) {
  .brand-wrap { gap: 8px; }
  .brand-mark { width: 36px; height: 36px; }
  .topbar-actions { gap: 5px; }
  .agent-indicator > summary, .topbar-logout, .mobile-nav > summary { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .mobile-nav-panel { right: -1px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
