/* Admin dashboard — both Full and Lite share this base */

:root {
  --dark-bg:   #0b1733;
  --dark-2:    #11204a;
  --dark-3:    #1a2e65;
  --dark-ink:  #e2e8f0;
  --dark-muted:#94a3b8;
  --dark-line: rgba(148,163,184,.14);
}

body.dash { background: #f3f6fc; }

/* --- App shell --- */
.app { min-height: 100vh; display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
@media (min-width: 1024px) { .app { grid-template-columns: 260px 1fr; grid-template-rows: 1fr; } }

/* --- Sidebar --- */
.sidebar {
  background: linear-gradient(180deg, var(--dark-bg) 0%, var(--dark-2) 100%);
  color: var(--dark-ink); padding: 20px 16px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: none; flex-direction: column; gap: 4px;
}
@media (min-width: 1024px) { .sidebar { display: flex; } }

.sb-brand { display: flex; align-items: center; gap: 10px; padding: 8px 10px 20px; border-bottom: 1px solid var(--dark-line); margin-bottom: 10px; }
.sb-brand .brand-mark { width: 44px; height: 44px; border-radius: 12px;
  background: conic-gradient(from 220deg, #4a7bff, #86a9ff, #ffb547, #4a7bff);
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 1.2rem; }
.sb-brand strong { font-size: .98rem; color: #fff; display: block; }
.sb-brand small  { font-size: .72rem; color: var(--dark-muted); display: block; letter-spacing: .4px; }

.sb-section { font-size: .72rem; color: var(--dark-muted); text-transform: uppercase; letter-spacing: 1px; padding: 16px 12px 6px; }

.sb-link {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px;
  color: var(--dark-ink); font-size: .92rem; font-weight: 600; text-decoration: none;
  transition: all .18s; position: relative;
}
.sb-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sb-link.active {
  background: linear-gradient(135deg, #4a7bff, #2b55d6);
  color: #fff; box-shadow: 0 10px 30px -10px rgba(74,123,255,.6);
}
.sb-link.active::before { content: ''; position: absolute; right: -16px; top: 0; bottom: 0; width: 3px; background: #ffb547; border-radius: 2px; }
.sb-link .ico { font-size: 1.1rem; width: 24px; text-align: center; }
.sb-link .badge-pill {
  margin-right: auto; background: var(--accent); color: #231000;
  padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 800;
}

/* Shield banner (security emphasis — full dashboard) */
.sb-shield {
  margin-top: 20px; padding: 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(74,123,255,.15), rgba(255,181,71,.15));
  border: 1px solid var(--dark-line); color: var(--dark-ink);
  display: flex; flex-direction: column; gap: 6px;
}
.sb-shield .shield-ico {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #4a7bff, #2b55d6);
  display: grid; place-items: center; color: #fff; font-size: 1.2rem;
  box-shadow: 0 6px 16px -4px rgba(74,123,255,.5);
}
.sb-shield b { color: #fff; font-size: .92rem; }
.sb-shield small { color: var(--dark-muted); font-size: .78rem; }
.sb-shield .status-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.3); animation: pulse 2s infinite; display: inline-block; margin-left: 6px; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* --- Topbar --- */
.topbar {
  background: #fff; padding: 14px 20px; border-bottom: 1px solid #e5ecf6;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; z-index: 50;
}
.topbar h1 { font-size: 1.2rem; margin: 0; color: var(--brand-900); }
.topbar .right { display: flex; align-items: center; gap: 10px; }
.topbar .burger { display: inline-flex; } @media (min-width: 1024px) { .topbar .burger { display: none; } }
.topbar .search { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; min-width: 240px; font-size: .9rem; display: none; }
@media (min-width: 760px) { .topbar .search { display: inline-block; } }
.topbar .user-chip {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; font-size: .9rem;
}
.topbar .user-chip .av {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--accent)); color: #fff;
  display: grid; place-items: center; font-size: .8rem; font-weight: 900;
}

/* Mobile sidebar */
.sb-overlay { position: fixed; inset: 0; background: rgba(11,23,51,.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); z-index: 100; opacity: 0; pointer-events: none; transition: opacity .25s; }
.sb-overlay.open { opacity: 1; pointer-events: auto; }
.sb-overlay.open ~ .sidebar { display: flex; position: fixed; right: 0; top: 0; width: 280px; z-index: 110; animation: sb-in .25s; }
@keyframes sb-in { from { transform: translateX(100%); } to { transform: none; } }

/* --- Content area --- */
.content { padding: 24px; max-width: 100%; }

/* --- KPI cards --- */
.kpis { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 20px; }
@media (min-width: 540px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 920px) { .kpis { grid-template-columns: repeat(4, 1fr); } }

.kpi {
  background: linear-gradient(180deg,#fff,rgba(255,255,255,.92)); border: 1px solid var(--line); border-radius: 18px; padding: 18px;
  display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden;
  box-shadow: 0 18px 42px -34px rgba(11,23,51,.45);
}
.kpi::before { content:''; position:absolute; inset:auto -20% -55% -20%; height:90%; background: radial-gradient(circle, rgba(74,123,255,.10), transparent 60%); pointer-events:none; }
.kpi .top { display: flex; align-items: center; justify-content: space-between; }
.kpi .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; color: #fff; }
.kpi .ico.blue { background: linear-gradient(135deg, #4a7bff, #2b55d6); }
.kpi .ico.gold { background: linear-gradient(135deg, #ffb547, #ff7a59); }
.kpi .ico.green{ background: linear-gradient(135deg, #22c55e, #16a34a); }
.kpi .ico.red  { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.kpi .ico.purple{background: linear-gradient(135deg, #a855f7, #7c3aed); }
.kpi .delta { font-size: .78rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.kpi .delta.up { background: #e8f6ee; color: #166534; }
.kpi .delta.down { background: #fde2e2; color: #991b1b; }
.kpi b { font-size: 1.7rem; color: var(--brand-900); font-weight: 900; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-weight: 600; font-size: .85rem; }

/* --- Panels / cards --- */
.panel { background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin-bottom: 18px; box-shadow: 0 18px 45px -34px rgba(11,23,51,.35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 1.1rem; }
.panel-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Grid helpers --- */
.g2 { display: grid; gap: 18px; grid-template-columns: 1fr; }
.g3 { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 920px) { .g2 { grid-template-columns: 1.4fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } }

/* --- Mini chart --- */
.chart-wrap { height: 240px; position: relative; }
.chart-wrap svg { width: 100%; height: 100%; display: block; }
.chart-grid line { stroke: var(--line); stroke-dasharray: 3 3; }
.chart-axis text { font-size: 10px; fill: var(--muted); font-family: 'Mikhak', sans-serif; }
/* The gradient paint is set as a per-instance inline attribute by
   lineChart() (each chart owns a uniquely-suffixed gradient id, because
   SVG url(#id) resolves document-wide). The stroke/fill below are only
   fallbacks for the case where that attribute is absent. */
.chart-line { fill: none; stroke: var(--brand-500); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: var(--brand-300, var(--brand-500)); opacity: .3; }
.chart-dot { fill: var(--brand-500); stroke: #fff; stroke-width: 2; }

/* --- Donut --- */
.donut-wrap { display: flex; align-items: center; justify-content: center; padding: 10px; }
.donut { width: 180px; height: 180px; transform: rotate(-90deg); }
.donut-track { fill: none; stroke: var(--surface-2); stroke-width: 14; }
.donut-arc   { fill: none; stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.22,1,.36,1); }

/* --- Tables --- */
.tbl-wrap { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: auto; }
.tbl-wrap table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 640px; }
.tbl-wrap th, .tbl-wrap td { padding: 12px 14px; text-align: right; font-size: .9rem; border-bottom: 1px solid var(--line); }
.tbl-wrap th { background: var(--surface-2); font-weight: 700; color: var(--brand-900); font-size: .82rem; position: sticky; top: 0; }
.tbl-wrap tr:last-child td { border-bottom: 0; }
.tbl-wrap tr:hover td { background: #fafbff; }

/* --- Status badges --- */
.pill { padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; display: inline-block; }
.pill.ok   { background: #e8f6ee; color: #166534; }
.pill.warn { background: #fef3c7; color: #92400e; }
.pill.bad  { background: #fde2e2; color: #991b1b; }
.pill.info { background: #e0ebff; color: #1e3a8a; }
.pill.grey { background: var(--surface-2); color: var(--ink-2); }

/* --- Buttons --- */
.btn.icon { padding: 8px 12px; display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; }
.btn.danger { background: linear-gradient(135deg, #ef4444, #b91c1c); box-shadow: 0 10px 24px -8px rgba(239,68,68,.4); }
.btn.success{ background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 10px 24px -8px rgba(34,197,94,.4); }

/* --- Security specific --- */
.sec-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 920px) { .sec-grid { grid-template-columns: 1.6fr 1fr; } }

.threat-radar {
  position: relative; aspect-ratio: 1/1; max-width: 340px; margin: 0 auto;
  background: radial-gradient(circle, rgba(74,123,255,.12), transparent 70%);
  border-radius: 50%;
}
.threat-radar::before, .threat-radar::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 1px dashed rgba(74,123,255,.3);
}
.threat-radar::after { inset: 15%; }
.radar-sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(74,123,255,.4) 30deg, transparent 60deg);
  animation: radar 4s linear infinite;
}
@keyframes radar { to { transform: rotate(360deg); } }
.radar-dot {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,.3);
  animation: ping 2s ease-out infinite;
}
.radar-dot.d1 { top: 25%; right: 30%; }
.radar-dot.d2 { bottom: 35%; left: 25%; animation-delay: .7s; background: #f59e0b; }
.radar-dot.d3 { top: 55%; right: 15%; animation-delay: 1.4s; background: #ef4444; }
@keyframes ping { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }

.sec-metric {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px;
}
.sec-metric .item { padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.sec-metric .item b { display: block; font-size: 1.3rem; color: var(--brand-900); font-weight: 900; }
.sec-metric .item small { color: var(--muted); font-size: .8rem; }

.event-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  margin-bottom: 8px;
}
.event-row .sev { width: 10px; height: 10px; border-radius: 50%; }
.event-row.critical .sev { background: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.3); animation: pulse 1.5s infinite; }
.event-row.high .sev     { background: #ef4444; }
.event-row.medium .sev   { background: #f59e0b; }
.event-row.low .sev      { background: #3b82f6; }
.event-row.info .sev     { background: #94a3b8; }
.event-row b { font-size: .9rem; color: var(--brand-900); }
.event-row small { color: var(--muted); font-size: .78rem; display: block; }

/* Login (dashboard login) */
.dash-login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--dark-bg), var(--dark-3)); padding: 20px; position: relative; overflow: hidden; }
.dash-login::before {
  content: ''; position: absolute; inset: -50%;
  background: radial-gradient(circle at 30% 30%, rgba(74,123,255,.3), transparent 50%),
              radial-gradient(circle at 70% 70%, rgba(255,181,71,.2), transparent 50%);
  animation: hv-spin 40s linear infinite;
}
.dash-login-card { background: #fff; padding: 40px; border-radius: 24px; max-width: 440px; width: 100%; box-shadow: 0 40px 80px -20px rgba(11,23,51,.5); position: relative; z-index: 1; }
.premium-login-card { overflow: hidden; border: 1px solid rgba(255,255,255,.65); }
.premium-login-card::after { content: ''; position: absolute; inset: 1px; border-radius: 23px; pointer-events:none; border: 1px solid rgba(43,85,214,.08); }
.login-orb { position: absolute; border-radius: 999px; filter: blur(2px); opacity: .22; pointer-events:none; }
.login-orb.orb-a { width: 170px; height: 170px; background: #4a7bff; top: -90px; right: -80px; }
.login-orb.orb-b { width: 140px; height: 140px; background: #ffb547; bottom: -80px; left: -60px; }
.login-hint { margin: 14px auto 0; padding: 9px 12px; border-radius: 12px; background: #f1f5fb; color: var(--ink-2); border: 1px solid var(--line); font-size: .82rem; line-height: 1.8; }

/* Code / mono */
code, pre { font-family: 'SF Mono', Menlo, Monaco, Consolas, monospace; font-size: .85rem; direction: ltr; text-align: left; }

/* Scrollable list */
.scroll-list { max-height: 420px; overflow: auto; padding-right: 6px; }
.scroll-list::-webkit-scrollbar { width: 6px; }
.scroll-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* Full-width modal variant */
.modal.wide { max-width: 760px; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: var(--surface-2); border-radius: 999px; transition: .3s; border: 1px solid var(--line); cursor: pointer; }
.switch .slider::before { content: ''; position: absolute; width: 18px; height: 18px; right: 3px; top: 2px; background: #fff; border-radius: 50%; transition: .3s; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); border-color: transparent; }
.switch input:checked + .slider::before { transform: translateX(-20px); background: #fff; }

/* ============================================================================
   Agent A — UI/UX hardening layer (2026-10-28). Appended; nothing above edited.
   ========================================================================== */

/* ---------------------------------------------------------- MOBILE DRAWER
   BUGFIX: the original rule was

       .sb-overlay.open ~ .sidebar { position:fixed; ... }

   `~` is the general *sibling* combinator, but the DOM is

       <div class="sb-overlay"></div>
       <div class="app"><aside class="sidebar">…</aside></div>

   the sidebar is NESTED inside `.app`, never a sibling of the overlay — so the
   rule never matched and the drawer was dead on phones. Driven by explicit
   classes now (.sidebar.open + body.nav-open) set by initDrawer().
   ------------------------------------------------------------------------ */
.sb-overlay { z-index: 100; }

@media (max-width: 1023.98px) {
  .sidebar.open {
    display: flex;
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(86vw, 300px);
    z-index: 110;
    box-shadow: -24px 0 60px -20px rgba(11, 23, 51, .55);
    animation: sb-in .28s cubic-bezier(.22, 1, .36, 1);
  }
  body.nav-open { overflow: hidden; }
}
@media (min-width: 1024px) {
  /* Desktop: the drawer classes must never leak into the static layout. */
  .sidebar.open { position: sticky; width: auto; box-shadow: none; animation: none; }
  .sb-overlay   { display: none; }
}

/* The topbar admin name was hidden because `.md-inline` was used in the markup
   but never defined in any stylesheet. */
.md-inline { display: none !important; }
@media (min-width: 760px) { .md-inline { display: inline !important; } }

/* -------------------------------------------------------------- SKELETONS
   Layout-matched so the real content swaps in without a jump. */
.sk-bar {
  display: block;
  border-radius: 7px;
  margin: 6px 0;
  background: linear-gradient(100deg, #e9eef7 28%, #f4f7fc 48%, #e9eef7 68%);
  background-size: 220% 100%;
  animation: sk-shimmer 1.25s ease-in-out infinite;
}
@keyframes sk-shimmer { from { background-position: 180% 0; } to { background-position: -40% 0; } }
.sk-ico { width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto; margin: 0; }
.sk-dot { width: 10px; height: 10px; border-radius: 50%; margin: 0; flex: 0 0 auto; }
.sk .kpi, .sk.kpi { pointer-events: none; }
.sk-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.sk-row:last-child { border-bottom: 0; }
.sk-head { background: var(--surface-2); }
.sk-event { display: flex; align-items: center; gap: 12px; }

/* ------------------------------------------------------------ EMPTY STATES
   Replaces bare one-line "موردی ندارد" text, which read as a broken page. */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 54px 24px;
  color: var(--muted);
}
.empty-art {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  color: var(--brand-500);
  background: linear-gradient(135deg, rgba(43, 85, 214, .10), rgba(255, 181, 71, .14));
  border: 1px solid var(--line);
}
.empty-art svg { width: 38px; height: 38px; }
.empty-state h3 { margin: 0; font-size: 1.04rem; color: var(--brand-900); }
.empty-state p  { margin: 0; font-size: .9rem; max-width: 46ch; color: var(--muted); }
.empty-state .btn { margin-top: 14px; }
.empty-state.is-error .empty-art {
  color: var(--danger);
  background: linear-gradient(135deg, rgba(220, 38, 38, .10), rgba(239, 68, 68, .06));
  border-color: #fcc5c5;
}
.empty-state.is-error h3 { color: #991b1b; }
/* Empty state used inside a table cell. */
.empty-tr td { padding: 0 !important; background: #fff; }
.empty-tr:hover td { background: #fff; }

/* ---------------------------------------------------------------- askModal
   Replaces prompt()/confirm(). */
body.modal-open { overflow: hidden; }
.ask-modal { z-index: 700; }
.ask-modal .modal { position: relative; max-width: 460px; }
.ask-form { margin-top: 14px; }
.ask-form textarea.input { resize: vertical; min-height: 84px; font-family: inherit; }
.ask-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.ask-actions .btn { min-width: 108px; justify-content: center; }

/* ----------------------------------------------------------- misc polish */
.loader { display: grid; place-items: center; gap: 12px; padding: 60px 20px; color: var(--muted); }
.loader::before {
  content: '';
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--brand-500);
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Numeric columns read far better tabular + LTR inside an RTL table. */
.tbl-wrap td.price, .tbl-wrap .price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl-wrap td [dir="ltr"] { unicode-bidi: isolate; }

/* Action button clusters inside table cells should never overflow. */
.tbl-wrap td .btn.sm { padding: 6px 11px; font-size: .82rem; }
.tbl-wrap td > .btn + .btn { margin-right: 6px; }

/* Sidebar scrollbar (dark track) */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .3); border-radius: 3px; }

/* ------------------------------------------------------------------
   Chart series toggle — active state (Round 3 / P3)
   The toggles are rendered as `.btn.ghost.sm[data-chart]`, so the
   active rule has to out-specify `.btn.ghost`. Two class selectors
   (.btn.ghost.active) beat `.btn.ghost` on specificity, no !important.
   ------------------------------------------------------------------ */
.btn.ghost.active,
.btn.active {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 26px -10px rgba(43, 85, 214, .55);
}
.btn.ghost.active:hover,
.btn.active:hover {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  border-color: transparent;
  color: #fff;
}
/* Small gold underline so the state reads even in grayscale / for
   users who cannot distinguish the blue fill from the hover tint. */
.btn.active { position: relative; }
.btn.active::after {
  content: '';
  position: absolute; left: 22%; right: 22%; bottom: 5px;
  height: 2px; border-radius: 2px;
  background: var(--accent, #ffb547);
}
@media (prefers-reduced-motion: reduce) {
  .btn.active { transition: none; }
}

/* ------------------------------------------------------------------
   Round 4 / F1+F2 — mobile horizontal overflow (708px and 511px on a
   390px viewport, pages /accounting /seo /settings).

   ROOT CAUSE: a CSS Grid item's default minimum size is `auto`
   (= min-content), NOT zero. So a `.panel` inside `.g2` refuses to get
   narrower than its content:
     - /accounting,/seo : `.tbl-wrap table { min-width: 640px }` forced the
       whole PAGE to 708px, even though `.tbl-wrap` already has
       `overflow:auto` and was designed to scroll by itself.
     - /settings        : a bare <input> has a min-content width from its
       default `size` attribute (~20 chars ~ 466px).

   FIX = let grid items shrink, so the already-correct `overflow:auto` on
   `.tbl-wrap` finally does its job and the table scrolls INSIDE its card.

   Deliberately NOT `overflow-x:hidden` on .content: that would only clip
   the layout, making the right-most ledger columns permanently unreachable
   on a phone - it silences the audit while making the product worse.
   ------------------------------------------------------------------ */
.app > *,
.g2 > *,
.g3 > * { min-width: 0; }
.panel   { min-width: 0; }

/* Form controls inside a .field must track their container, never their
   intrinsic `size`. Scoped to .field on purpose so the inline topbar
   search and the compact in-table controls keep their own widths. */
.field .input,
.field .select,
.field select,
.field textarea { width: 100%; min-width: 0; max-width: 100%; }

/* Round 4 / F7 — burger was under the 32px minimum touch target. */
.topbar .burger { min-width: 40px; min-height: 40px; justify-content: center; }

/* ------------------------------------------------------------------
   Agent A 2026-10-30 [CLIENT C4] — suspended / soft-deleted user rows.
   The operator scans this table looking for abusers, so state must be
   obvious at a glance and NOT rely on colour alone (a right-edge bar +
   muted text carry the same meaning in greyscale).
   ------------------------------------------------------------------ */
.tbl-wrap tr.row-susp    > td { background: #fff8ec; }
.tbl-wrap tr.row-deleted > td { background: #fdf2f2; color: var(--muted); }
.tbl-wrap tr.row-deleted > td:first-child { box-shadow: inset -3px 0 0 #ef4444; }
.tbl-wrap tr.row-susp    > td:first-child { box-shadow: inset -3px 0 0 #ffb547; }
.tbl-wrap tr.row-deleted:hover > td { background: #fbe9e9; }
.tbl-wrap tr.row-susp:hover    > td { background: #fff3dd; }
/* keep the two action buttons from stacking awkwardly in a narrow cell */
.tbl-wrap td .btn.sm + .btn.sm { margin-right: 6px; }

/* ------------------------------------------------------------------
   Agent A 2026-10-30 [CLIENT C3/C11] — crypto deposit review cell.

   A 64-char hash must NOT be allowed to stretch the row (that is the
   grid min-width:auto overflow class of bug fixed in round 4), but it
   must also stay complete in the DOM so "copy" yields the whole string.
   So: truncate VISUALLY with ellipsis, never in the data.
   ------------------------------------------------------------------ */
.crypto-cell {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 6px; max-width: 360px;
}
.crypto-cell .hash-chip {
  direction: ltr; unicode-bidi: isolate; text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .75rem; line-height: 1.6;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 3px 8px;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: help;            /* title= carries the full hash */
}
.crypto-cell .btn.sm { padding: 4px 10px; font-size: .75rem; }
@media (max-width: 760px) {
  .crypto-cell .hash-chip { max-width: 120px; }
}

/* Agent A 2026-10-31 [ROUND2 N4] announcement live preview in settings */
.ann-preview {
  margin-top: 8px; padding: 8px 12px; border-radius: 10px;
  background: linear-gradient(90deg, #1a2e65, #2b55d6); color: #fff;
  font-weight: 700; font-size: .88rem; text-align: center; overflow-wrap: anywhere;
}
