/* ===========================================================
   AploVet — refreshed design system
   Warm-neutral surfaces · single accent hue · semantic statuses
   =========================================================== */

:root {
  --accent-h: 28;                 /* fixed, tweaks-panel not used */
  --font-scale: 1;

  --accent:        oklch(0.66 0.165 var(--accent-h));
  --accent-strong: oklch(0.58 0.17 var(--accent-h));
  --accent-ink:    oklch(0.45 0.12 var(--accent-h));
  --accent-soft:   oklch(0.96 0.03 var(--accent-h));
  --accent-soft-2: oklch(0.92 0.05 var(--accent-h));

  --bg:         #FAF8F4;
  --surface:    #FFFFFF;
  --surface-2:  #F6F2EB;
  --border:     #ECE6DC;
  --border-2:   #DED7CA;

  --ink:   #2B2824;
  --ink-2: #6C655A;
  --ink-3: #9A9285;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(43,40,36,.05), 0 1px 3px rgba(43,40,36,.04);
  --shadow-md: 0 4px 16px rgba(43,40,36,.08);
  --shadow-lg: 0 18px 50px rgba(43,40,36,.20);

  /* status tones */
  --t-pending-bg:#FFF1D9; --t-pending-fg:#925609; --t-pending-dot:#E0890B;
  --t-ok-bg:#E4F3E9;      --t-ok-fg:#1C7A44;      --t-ok-dot:#2E9E5B;
  --t-partial-bg:#E0F0F2; --t-partial-fg:#0E6B76; --t-partial-dot:#1593A0;
  --t-reject-bg:#FBE8E5;  --t-reject-fg:#B22A1B;  --t-reject-dot:#DC4633;
  --t-muted-bg:#EFEBE4;   --t-muted-fg:#6C655A;   --t-muted-dot:#AAA194;
}

html { font-size: calc(15px * var(--font-scale)); }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Onest', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1,h2,h3,h4,p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* tone helper — sets local vars */
.tone-pending { --tone-bg:var(--t-pending-bg); --tone-fg:var(--t-pending-fg); --tone-dot:var(--t-pending-dot); }
.tone-ok      { --tone-bg:var(--t-ok-bg);      --tone-fg:var(--t-ok-fg);      --tone-dot:var(--t-ok-dot); }
.tone-partial { --tone-bg:var(--t-partial-bg); --tone-fg:var(--t-partial-fg); --tone-dot:var(--t-partial-dot); }
.tone-reject  { --tone-bg:var(--t-reject-bg);  --tone-fg:var(--t-reject-fg);  --tone-dot:var(--t-reject-dot); }
.tone-muted   { --tone-bg:var(--t-muted-bg);   --tone-fg:var(--t-muted-fg);   --tone-dot:var(--t-muted-dot); }
.tone-brand   { --tone-bg:var(--accent-soft);  --tone-fg:var(--accent-ink);   --tone-dot:var(--accent); }

/* ===== App shell ===== */
.app-root { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; padding: 28px 34px 80px; }

/* ===== Sidebar ===== */
.sidebar {
  width: 264px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-dark  { background: #26241F; color: #EDE9E1; }
.sidebar-light { background: var(--surface); color: var(--ink); border-right: 1px solid var(--border); }

.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 18px 20px; }
.sidebar-brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: var(--shadow-sm); }
.brand-name { font-weight: 700; font-size: 1.06rem; letter-spacing: -.01em; }
.brand-sub { font-size: .72rem; opacity: .6; margin-top: 1px; }

.org-switch {
  margin: 4px 14px 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid transparent;
  background: rgba(255,255,255,.07); color: inherit; transition: background .15s, border-color .15s;
}
.sidebar-light .org-switch { background: var(--surface-2); border-color: var(--border); }
.org-switch:hover { background: rgba(255,255,255,.12); }
.sidebar-light .org-switch:hover { background: var(--accent-soft); border-color: var(--accent-soft-2); }
.org-switch-main { flex: 1; min-width: 0; }
.org-switch-label { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; opacity: .55; }
.org-switch-name { display: block; font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-switch-chevron { opacity: .5; font-size: .9rem; }
.org-env { font-size: .62rem; font-weight: 700; padding: 2px 7px; border-radius: 20px; white-space: nowrap; }
.env-prod { background: var(--t-ok-bg); color: var(--t-ok-fg); }
.env-test { background: var(--t-pending-bg); color: var(--t-pending-fg); }

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 4px 0 12px; }
.nav-group { padding: 0 12px; margin-bottom: 14px; }
.nav-section { font-size: .67rem; text-transform: uppercase; letter-spacing: .07em; opacity: .45; padding: 6px 10px; font-weight: 600; }
.nav-link {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 11px;
  border: none; background: transparent; color: inherit; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; text-align: left; text-decoration: none;
  transition: background .13s, color .13s; position: relative;
}
.nav-link:hover { background: rgba(255,255,255,.08); }
.sidebar-light .nav-link:hover { background: var(--surface-2); }
.nav-link.active { background: var(--accent); color: #fff; }
.nav-link.active .nav-icon { opacity: 1; }
.nav-icon { font-size: 1.05rem; width: 20px; text-align: center; opacity: .7; }
.nav-label { flex: 1; }
.nav-badge { background: var(--t-pending-dot); color: #fff; font-size: .7rem; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; }
.nav-link.active .nav-badge { background: rgba(255,255,255,.28); }
.nav-ext { opacity: .65; }
.nav-ext-icon { font-size: .75rem; opacity: .6; }

.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-light .sidebar-user { border-color: var(--border); }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .7rem; opacity: .55; }
.user-logout { background: none; border: none; color: inherit; opacity: .5; font-size: 1.1rem; padding: 4px; border-radius: 8px; transition: opacity .13s, background .13s; }
.user-logout:hover { opacity: 1; background: rgba(255,255,255,.1); }

/* ===== Page header ===== */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-title { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }
.page-desc { color: var(--ink-2); font-size: .95rem; margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ===== Triage chips ===== */
.triage { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.triage-chip {
  flex: 1; min-width: 130px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 16px; text-align: left; transition: all .15s;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.triage-chip::before { content:''; position:absolute; left:0; top:0; bottom:0; width:4px; background: var(--tone-dot); opacity: .85; }
.triage-chip:hover { border-color: var(--border-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.triage-chip.active { border-color: var(--tone-dot); background: var(--tone-bg); }
.triage-num { display: block; font-size: 1.7rem; font-weight: 700; line-height: 1; color: var(--ink); letter-spacing: -.02em; }
.triage-chip.active .triage-num { color: var(--tone-fg); }
.triage-lbl { display: flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--ink-2); margin-top: 6px; font-weight: 500; }
.triage-chip.active .triage-lbl { color: var(--tone-fg); }

/* ===== Toolbar ===== */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search { flex: 1; min-width: 240px; display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 13px; height: 42px; transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search > i { color: var(--ink-3); }
.search input { flex: 1; border: none; outline: none; background: none; font-size: .92rem; color: var(--ink); }
.search-clear { border: none; background: none; color: var(--ink-3); padding: 2px; border-radius: 6px; }
.search-clear:hover { color: var(--ink); background: var(--surface-2); }

/* ===== Segmented control ===== */
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg { border: none; background: none; padding: 7px 14px; border-radius: 7px; font-size: .82rem; font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; transition: all .13s; }
.seg:hover { color: var(--ink); }
.seg.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }
.seg-count { background: var(--surface-2); border-radius: 20px; padding: 0 6px; font-size: .72rem; }

/* ===== Table ===== */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.vsd-table { width: 100%; border-collapse: collapse; }
.vsd-table thead th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.vsd-row { border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.vsd-row:last-child { border-bottom: none; }
.vsd-row:hover { background: var(--accent-soft); }
.vsd-row.selected { background: var(--accent-soft-2); }
.vsd-table td { padding: 13px 14px; vertical-align: middle; }
.density-compact .vsd-table td { padding: 8px 14px; }
.density-compact .vsd-table thead th { padding: 8px 14px; }

.col-check { width: 40px; }
.col-check input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.col-vol { width: 150px; }
.col-sender { width: 230px; }
.col-recv { width: 190px; }
.col-date { width: 96px; color: var(--ink-2); font-size: .86rem; white-space: nowrap; }
.col-status { width: 1%; white-space: nowrap; }
.col-act { width: 1%; white-space: nowrap; text-align: right; }

/* pending rows get a soft left accent for triage scanning */
.vsd-row.tone-pending td.col-prod { box-shadow: inset 3px 0 0 var(--t-pending-dot); }
.density-compact .prod-name { font-size: .9rem; }
.prod-name { font-weight: 600; font-size: .95rem; line-height: 1.3; color: var(--ink); }
.prod-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.prod-num { font-size: .76rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fresh { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 600; color: var(--t-pending-fg); background: var(--t-pending-bg); padding: 1px 8px 1px 4px; border-radius: 20px; }
.col-vol b { font-weight: 600; font-variant-numeric: tabular-nums; }
.vol-of { color: var(--ink-3); font-size: .8rem; font-weight: 400; }
.sender { font-size: .86rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.row-actions { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }
.kebab { border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; transition: all .13s; }
.kebab:hover { background: var(--surface-2); color: var(--ink); border-color: var(--border-2); }
.row-menu { position: relative; display: inline-block; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 5px; z-index: 40; min-width: 196px; }
.menu-pop button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: none; background: none; border-radius: 8px; font-size: .86rem; color: var(--ink); text-align: left; }
.menu-pop button:hover { background: var(--surface-2); }
.menu-pop .menu-danger { color: var(--t-reject-fg); }
.menu-pop .menu-danger:hover { background: var(--t-reject-bg); }

/* ===== Status pills / dots ===== */
.st-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--tone-bg); color: var(--tone-fg); font-weight: 600; border-radius: 20px; padding: 4px 11px; font-size: .78rem; white-space: nowrap; }
.st-pill.st-sm { padding: 3px 9px; font-size: .74rem; }
.st-dot-wrap { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 500; color: var(--ink); white-space: nowrap; }
.st-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tone-dot); flex-shrink: 0; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 9px 15px; font-size: .88rem; font-weight: 600; transition: background .14s, border-color .14s, color .14s, transform .07s, box-shadow .14s; white-space: nowrap; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: .82rem; border-radius: 8px; }
.btn-lg { padding: 13px 20px; font-size: 1rem; width: 100%; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--ink-3); }
.btn-soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn-soft:hover:not(:disabled) { background: var(--accent-soft-2); }
.btn-danger { background: var(--t-reject-dot); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--t-reject-fg); }
.btn-danger-ghost { background: var(--surface); color: var(--t-reject-fg); border-color: var(--t-reject-bg); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--t-reject-bg); }
.btn-spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin 1s linear infinite; }

/* ===== Empty / stub ===== */
.empty { background: var(--surface); border: 1px dashed var(--border-2); border-radius: var(--radius); padding: 64px 20px; text-align: center; }
.empty > i { font-size: 2.6rem; color: var(--ink-3); }
.empty h3 { font-size: 1.15rem; margin-top: 14px; }
.empty p { color: var(--ink-2); margin-top: 6px; font-size: .92rem; }

/* ===== Bulk bar ===== */
.bulk-bar { position: fixed; bottom: 24px; left: calc(50% + 132px); transform: translateX(-50%); background: #26241F; color: #fff; border-radius: 14px; padding: 11px 14px 11px 20px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow-lg); z-index: 50; animation: bulkin .2s ease; }
@keyframes bulkin { from { transform: translate(-50%, 12px); opacity: 0; } }
.bulk-count { font-size: .9rem; }
.bulk-count b { font-size: 1.05rem; }
.bulk-actions { display: flex; gap: 8px; }
.bulk-bar .btn-danger-ghost { background: transparent; color: #ff9b8e; border-color: rgba(255,255,255,.2); }
.bulk-bar .btn-danger-ghost:hover { background: rgba(255,255,255,.1); }
.bulk-clear { background: none; border: none; color: rgba(255,255,255,.6); font-size: .85rem; padding: 4px 6px; }
.bulk-clear:hover { color: #fff; }

/* ===== Drawer ===== */
.drawer-scrim { position: fixed; inset: 0; background: rgba(43,40,36,.34); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; }
.drawer-scrim.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 460px; max-width: 94vw; background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .26s cubic-bezier(.4,0,.2,1); z-index: 61; display: flex; flex-direction: column; }
.drawer.show { transform: translateX(0); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 22px 16px; border-bottom: 1px solid var(--border); }
.drawer-eyebrow { font-size: .76rem; color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 600; }
.drawer-title { font-size: 1.2rem; font-weight: 700; line-height: 1.25; margin-top: 4px; letter-spacing: -.01em; }
.drawer-sub { color: var(--ink-2); font-size: .85rem; margin-top: 3px; }
.drawer-statusrow { display: flex; align-items: center; gap: 11px; padding: 14px 22px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.drawer-hint { font-size: .82rem; color: var(--ink-2); }
.drawer-scroll { flex: 1; overflow-y: auto; padding: 8px 22px 22px; }
.d-section { padding: 16px 0; border-bottom: 1px solid var(--border); }
.d-section:last-child { border-bottom: none; }
.d-h { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; margin-bottom: 11px; }
.d-grid { display: grid; gap: 11px; margin: 0; }
.d-grid > div { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.d-grid dt { color: var(--ink-2); font-size: .86rem; margin: 0; }
.d-grid dd { margin: 0; font-size: .9rem; font-weight: 500; text-align: right; }
.d-strong { color: var(--t-partial-fg); font-weight: 700; }
.d-mono { font-family: ui-monospace, 'SF Mono', monospace; font-size: .76rem; color: var(--ink-2); }
.route { display: flex; flex-direction: column; gap: 4px; }
.route-node { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; display: flex; flex-direction: column; gap: 2px; }
.route-role { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.route-name { font-weight: 600; font-size: .9rem; }
.route-city { font-size: .8rem; color: var(--ink-2); }
.route-arrow { text-align: center; color: var(--ink-3); font-size: 1rem; }
.drawer-actions { display: flex; gap: 9px; padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface); }
.drawer-actions .btn:first-child { flex: 1; }

/* ===== Modals (design-system) ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(43,40,36,.42); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 70; animation: fadein .16s ease; }
@keyframes fadein { from { opacity: 0; } }
.modal-card { background: var(--surface); border-radius: 18px; width: 100%; max-width: 460px; box-shadow: var(--shadow-lg); overflow: hidden; animation: modalin .2s cubic-bezier(.4,0,.2,1); }
@keyframes modalin { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 14px; }
.modal-title { display: flex; align-items: center; gap: 10px; color: var(--tone-fg); }
.modal-title > i { font-size: 1.3rem; }
.modal-title h3 { font-size: 1.12rem; font-weight: 700; color: var(--ink); }
.modal-x { border: none; background: var(--surface-2); color: var(--ink-2); width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.modal-x:hover { background: var(--border); color: var(--ink); }
.modal-body { padding: 4px 22px 8px; }
.modal-lead { font-weight: 600; font-size: .98rem; margin-bottom: 14px; }
.modal-sub { color: var(--ink-2); font-size: .9rem; margin-bottom: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; }

.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .85rem; line-height: 1.45; margin-bottom: 18px; }
.callout > i { font-size: 1.05rem; flex-shrink: 0; margin-top: 1px; }
.callout-info { background: var(--t-partial-bg); color: var(--t-partial-fg); }
.callout-danger { background: var(--t-reject-bg); color: var(--t-reject-fg); }

.field { margin-bottom: 16px; }
.field > label { display: flex; align-items: center; gap: 7px; font-size: .85rem; font-weight: 600; margin-bottom: 7px; color: var(--ink); }
.req { font-size: .68rem; font-weight: 600; color: var(--t-reject-fg); background: var(--t-reject-bg); padding: 1px 7px; border-radius: 20px; text-transform: lowercase; }
.field input, .field textarea { width: 100%; border: 1.5px solid var(--border-2); border-radius: var(--radius-sm); padding: 10px 13px; font-size: .92rem; color: var(--ink); background: var(--surface); transition: border-color .14s, box-shadow .14s; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-readonly { background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 10px 13px; font-size: .92rem; font-weight: 600; color: var(--ink-2); }
.field-help { font-size: .8rem; color: var(--ink-2); margin-top: 6px; }
.field-err { font-size: .8rem; color: var(--t-reject-fg); margin-top: 6px; }
.input-suffix { display: flex; align-items: stretch; border: 1.5px solid var(--border-2); border-radius: var(--radius-sm); overflow: hidden; transition: border-color .14s, box-shadow .14s; }
.input-suffix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-suffix input { border: none; box-shadow: none !important; flex: 1; }
.input-suffix input:focus { border: none; }
.suffix { display: flex; align-items: center; padding: 0 14px; background: var(--surface-2); color: var(--ink-2); font-size: .88rem; font-weight: 600; border-left: 1px solid var(--border); }
.suffix-btn { border: none; background: var(--surface-2); color: var(--ink-2); padding: 0 13px; border-left: 1px solid var(--border); }
.suffix-btn:hover { color: var(--ink); }

/* ===== Org list ===== */
.org-list { display: flex; flex-direction: column; gap: 8px; }
.org-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); text-align: left; transition: all .13s; }
.org-row:hover { border-color: var(--border-2); background: var(--surface-2); }
.org-row.active { border-color: var(--accent); background: var(--accent-soft); }
.org-row-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.org-row-main { flex: 1; min-width: 0; }
.org-row-name { font-weight: 600; font-size: .92rem; }
.org-row-meta { font-size: .78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.org-row-check { color: var(--accent); font-size: 1.1rem; }

/* ===== Toasts ===== */
.toast-stack { position: fixed; top: 18px; right: 18px; display: flex; flex-direction: column; gap: 9px; z-index: 90; max-width: 360px; }
.toast-card { display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow-md); font-size: .87rem; animation: toastin .22s ease; }
@keyframes toastin { from { transform: translateX(20px); opacity: 0; } }
.toast-card > i { font-size: 1.1rem; }
.toast-body { flex: 1; }
.toast-x { border: none; background: none; color: var(--ink-3); padding: 2px; }
.toast-x:hover { color: var(--ink); }
.toast-success { border-left-color: var(--t-ok-dot); } .toast-success > i { color: var(--t-ok-dot); }
.toast-error { border-left-color: var(--t-reject-dot); } .toast-error > i { color: var(--t-reject-dot); }
.toast-info { border-left-color: var(--accent); } .toast-info > i { color: var(--accent); }
.toast-progress { border-left-color: var(--accent); } .toast-progress > i { color: var(--accent); }

/* ===== Login ===== */
.login-wrap { flex: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background:
  radial-gradient(120% 90% at 80% 0%, var(--accent-soft) 0%, transparent 55%), var(--bg); }
.login-card { width: 100%; max-width: 392px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 36px 34px 26px; }
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand img { width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--shadow-md); }
.login-brand h1 { font-size: 1.5rem; font-weight: 700; margin-top: 14px; }
.login-brand p { color: var(--ink-2); font-size: .85rem; margin-top: 5px; }
.login-form .btn { margin-top: 6px; }
.login-foot { text-align: center; color: var(--ink-3); font-size: .78rem; margin-top: 18px; }

/* ===== Section stub ===== */
.stub { max-width: 460px; margin: 80px auto; text-align: center; }
.stub-icon { width: 72px; height: 72px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 20px; }
.stub h2 { font-size: 1.4rem; font-weight: 700; }
.stub p { color: var(--ink-2); margin-top: 8px; line-height: 1.5; }

/* ===== Responsive ===== */
@media (max-width: 920px) {
  .sidebar { display: none; }
  .main { padding: 20px 18px 80px; }
  .col-sender { display: none; }
  .col-recv { display: none; }
  .bulk-bar { left: 50%; }
}
/* mobile sidebar overlay */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 59; }
@media (max-width: 920px) {
  .sidebar { display: flex; transform: translateX(-100%); transition: transform .3s; position: fixed; z-index: 60; }
  .sidebar.mobile-open { transform: translateX(0); display: flex; }
  .sidebar-overlay.visible { display: block; }
}

/* ===== Bootstrap modal override — restyle under design system ===== */
.modal-content { border-radius: 18px; border: none; box-shadow: var(--shadow-lg); }
.modal-header  { border-bottom: 1px solid var(--border); padding: 20px 22px 14px; }
.modal-footer  { border-top: 1px solid var(--border); padding: 16px 22px 20px; }
