/* ==========================================================================
   ZephAI — app: dashboard shell, sidebars, topbar, widgets, charts
   ========================================================================== */

[data-shell='app'] {
  background-image: none;
  background-color: var(--bg);
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns var(--dur) var(--ease);
}
.app.is-collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }
.app-frame { min-width: 0; display: flex; flex-direction: column; }
.app-backdrop {
  position: fixed; inset: 0; background: var(--scrim); z-index: calc(var(--z-drawer) - 1);
  opacity: 0; visibility: hidden; transition: opacity 0.24s var(--ease), visibility 0.24s;
}
.app-backdrop.is-open { opacity: 1; visibility: visible; }

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: var(--z-drawer);
  overflow: hidden;
}
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; min-height: var(--topbar-h); padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--border); flex: none;
}
.sidebar-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px 12px 20px; }
.sidebar-foot { flex: none; padding: 12px; border-top: 1px solid var(--border); background: var(--surface); }

.side-label {
  font-size: 0.63rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.13em; color: var(--text-3);
  padding: 16px 10px 7px;
}
.side-label:first-child { padding-top: 4px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-2);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.side-link i:first-child { width: 18px; text-align: center; font-size: var(--fs-sm); color: var(--text-3); flex: none; }
.side-link span:first-of-type { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link:hover i:first-child { color: var(--text-2); }
.side-link.is-active {
  background: var(--brand-soft); color: var(--brand-text); font-weight: 650;
}
.side-link.is-active i:first-child { color: var(--brand-text); }
.side-tail { font-size: 0.62rem; opacity: 0.5; }
.side-count {
  min-width: 22px; height: 20px; padding-inline: 6px; border-radius: var(--r-full);
  background: var(--surface-3); color: var(--text-3);
  font-size: 0.66rem; font-weight: 700; display: grid; place-items: center;
}
.side-count--warn { background: var(--warn-soft); color: var(--warn); }
.side-count--danger { background: var(--danger-soft); color: var(--danger); }
.side-link.is-active .side-count { background: var(--surface); color: var(--brand-text); }
.side-nav--muted .side-link { font-size: var(--fs-xs); }

.side-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; }
.side-card--brand { background: linear-gradient(160deg, var(--brand-soft), transparent 70%), var(--surface-2); border-color: var(--brand-soft-2); }
.side-card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-card-title { font-size: var(--fs-2xs); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 10px; margin-bottom: 8px; font-weight: 650; }
.side-card-figure { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.03em; margin-top: 4px; }
.side-card-meta { font-size: var(--fs-2xs); color: var(--text-3); font-family: var(--font-mono); }
.side-card-note { font-size: var(--fs-2xs); color: var(--text-3); margin: 7px 0 11px; }
.side-switch { display: flex; align-items: center; gap: 9px; font-size: var(--fs-2xs); color: var(--text-2); margin-top: 12px; cursor: pointer; }
.side-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.side-collapsed-btn { display: none; width: 100%; height: 40px; border-radius: var(--r-md); color: var(--text-2); }
.side-collapsed-btn:hover { background: var(--surface-3); color: var(--text); }

/* collapsed rail */
.app.is-collapsed .sidebar-head { justify-content: center; padding-inline: 8px; }
.app.is-collapsed .sidebar .brand { display: none; }
.app.is-collapsed .side-label { font-size: 0; padding: 12px 0 6px; border-top: 1px solid var(--border); margin-top: 8px; }
.app.is-collapsed .side-label:first-child { border-top: 0; margin-top: 0; }
.app.is-collapsed .side-link { justify-content: center; padding-inline: 0; }
.app.is-collapsed .side-link span, .app.is-collapsed .side-link .side-count,
.app.is-collapsed .side-link .side-tail { display: none; }
.app.is-collapsed .side-card { display: none; }
.app.is-collapsed .side-collapsed-btn { display: grid; place-items: center; }
.topbar-collapse { display: inline-flex; }
.sidebar-icon { width: 18px; height: 18px; }
.sidebar-icon--expand { display: none; }
.app.is-collapsed .sidebar-icon--collapse { display: none; }
.app.is-collapsed .sidebar-icon--expand { display: inline-flex; }

@media (max-width: 1080px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; width: var(--sidebar-w);
    transform: translateX(-102%); transition: transform 0.26s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .app.is-mobile-open .sidebar { transform: translateX(0); }
  .app.is-collapsed .side-label { font-size: 0.63rem; padding: 16px 10px 7px; border-top: 0; margin-top: 0; }
  .app.is-collapsed .side-link { justify-content: flex-start; padding-inline: 10px; }
  .app.is-collapsed .side-link span, .app.is-collapsed .side-link .side-count { display: revert; }
  .app.is-collapsed .side-card { display: block; }
  .app.is-collapsed .side-collapsed-btn { display: none; }
}

/* ==========================================================================
   Topbar
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  min-height: var(--topbar-h); padding-inline: clamp(14px, 2.4vw, 26px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--border);
}
.topbar-burger { display: none; }
.topbar-spacer { flex: 1; }
.crumbs { display: flex; align-items: center; gap: 9px; font-size: var(--fs-xs); color: var(--text-3); }
.crumbs a { color: var(--text-2); display: inline-flex; align-items: center; gap: 7px; }
.crumbs a:hover { color: var(--brand-text); }
.crumb-sep { font-size: 0.6rem; opacity: 0.6; }
.crumb-current { color: var(--text); font-weight: 650; }
.search-trigger--app { min-width: 190px; height: 34px; background: var(--surface-2); }
.topbar .icon-btn { width: 36px; height: 36px; }
.topbar-cta { height: 34px; }

.avatar-btn {
  display: inline-flex; align-items: center; gap: 9px; height: 40px;
  padding: 0 8px; border-radius: var(--r-md); transition: background var(--dur) var(--ease);
}
.avatar-btn:hover { background: var(--surface-3); }
.avatar-btn-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.avatar-btn-meta strong { font-size: var(--fs-xs); font-weight: 650; }
.avatar-btn-meta em { font-style: normal; font-size: 0.64rem; color: var(--text-3); }
.has-badge .badge-num {
  position: absolute; top: 2px; right: 2px;
  min-width: 17px; height: 17px; padding-inline: 4px;
  background: var(--danger); color: #fff;
  border: 2px solid var(--surface); border-radius: var(--r-full);
  font-size: 0.6rem; font-weight: 700; line-height: 13px; text-align: center;
}

@media (max-width: 900px) {
  .crumbs, .search-trigger--app, .topbar .chip--live { display: none; }
  .topbar-burger { display: inline-flex; }
  .topbar-collapse { display: none; }
  .avatar-btn-meta { display: none; }
}
@media (max-width: 560px) {
  .topbar-cta { display: none; }
}

/* ==========================================================================
   Main / page header
   ========================================================================== */
.app-main { padding: clamp(18px, 2.6vw, 30px) clamp(14px, 2.4vw, 30px) 60px; min-width: 0; }

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 18px; margin-bottom: clamp(18px, 2.4vw, 26px);
}
.page-head h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -0.03em; }
.page-head p { color: var(--text-2); font-size: var(--fs-sm); margin-top: 7px; max-width: 74ch; }
.page-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.page-eyebrow { display: flex; align-items: center; gap: 8px; font-size: var(--fs-2xs); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 650; margin-bottom: 8px; }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xs); overflow: hidden;
}
.panel + .panel { margin-top: var(--sp-5); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.panel-head h2, .panel-head h3 { font-size: var(--fs-md); letter-spacing: -0.02em; }
.panel-head p { font-size: var(--fs-2xs); color: var(--text-3); margin-top: 3px; }
.panel-actions { display: flex; align-items: center; gap: 8px; }
.panel-body { padding: 18px; }
.panel-body--flush { padding: 0; }
.panel-foot { padding: 13px 18px; border-top: 1px solid var(--border); background: var(--surface-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--fs-xs); color: var(--text-3); flex-wrap: wrap; }
.panel-foot a { color: var(--brand-text); font-weight: 600; }

.dash-grid { display: grid; gap: var(--sp-5); align-items: start; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.dash-grid > * { min-width: 0; }
.dash-grid > .metric { align-self: stretch; }
.dash-grid > .panel + .panel { margin-top: 0; }
.dash-grid .panel + .panel { margin-top: 0; }
.flex-col[class*="gap-"] > .panel + .panel, .grid > .panel + .panel { margin-top: 0; }
/* opt-in equal-height rows: panels stretch and their bodies centre content */
.dash-grid--equal { align-items: stretch; }
.dash-grid--equal > .panel { display: flex; flex-direction: column; }
.dash-grid--equal > .panel > .panel-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
/* every dashboard row shares the same 12-column track so the vertical seams
   line up, and the right rail is exactly as wide as a 1/3 card below it */
.dash-grid--2 > * { grid-column: span 6; }
.dash-grid--3 > * { grid-column: span 4; }
.dash-grid--4 > * { grid-column: span 3; }
.dash-grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dash-grid--main > :first-child, .dash-grid--split > :first-child { grid-column: span 8; }
.dash-grid--main > :last-child, .dash-grid--split > :last-child { grid-column: span 4; }
@media (max-width: 1180px) {
  .dash-grid--main > :first-child, .dash-grid--main > :last-child,
  .dash-grid--split > :first-child, .dash-grid--split > :last-child { grid-column: span 12; }
  .dash-grid--4 > * { grid-column: span 6; }
  .dash-grid--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  /* two-plus-one cards leave a hole at the end of the row — stack them instead */
  .dash-grid--3 > * { grid-column: span 12; }
}
@media (max-width: 780px) {
  .dash-grid--2 > *, .dash-grid--4 > * { grid-column: span 12; }
}

.metric {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
  transition: all var(--dur) var(--ease); position: relative; overflow: hidden;
}
.metric:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.metric-label { font-size: var(--fs-2xs); font-weight: 650; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-3); }
.metric-ico { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: var(--fs-sm); background: var(--surface-3); color: var(--text-2); }
.metric-ico.ico-brand { background: var(--brand-soft); color: var(--brand-text); }
.metric-ico.ico-info { background: var(--info-soft); color: var(--info); }
.metric-ico.ico-warn { background: var(--warn-soft); color: var(--warn); }
.metric-ico.ico-purple { background: var(--purple-soft); color: var(--purple); }
.metric-ico.ico-ok { background: var(--ok-soft); color: var(--ok); }
.metric-value { font-family: var(--font-display); font-size: clamp(1.6rem, 2.4vw, 2rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.metric-value small { font-size: 0.5em; color: var(--text-3); font-weight: 600; letter-spacing: -0.01em; }
.metric-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-2xs); color: var(--text-3); flex-wrap: wrap; }
.metric:has(.sparkline) .metric-foot { padding-right: 124px; }
.metric .sparkline { position: absolute; right: 12px; bottom: 12px; opacity: 0.75; pointer-events: none; }

/* ==========================================================================
   Charts
   ========================================================================== */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart-grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart-axis-label { fill: var(--text-3); font-size: 10px; font-family: var(--font-mono); }
.chart-line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { opacity: 0.16; }
.chart-dot { stroke: var(--surface); stroke-width: 2; }
.chart-bar { transition: opacity var(--dur) var(--ease); }
.chart-bar:hover { opacity: 0.75; }
.chart-hit { fill: transparent; cursor: crosshair; }
.chart-cursor { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; pointer-events: none; }
.chart.is-hovering .chart-cursor { opacity: 1; }

.chart-tip {
  position: absolute; z-index: 5; pointer-events: none;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-md);
  padding: 9px 11px; font-size: var(--fs-2xs); min-width: 130px;
  opacity: 0; transform: translate(-50%, -6px); transition: opacity 0.12s ease;
}
.chart-tip.is-visible { opacity: 1; }
.chart-tip .tip-title { font-family: var(--font-mono); color: var(--text-3); margin-bottom: 6px; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 7px; justify-content: space-between; }
.chart-tip .tip-row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.chart-tip .tip-row span { flex: 1; }
.chart-tip .tip-row strong { font-family: var(--font-display); }
.chart-tip .tip-total { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--border); }

.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--fs-2xs); color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; }
.chart-legend .legend-dash { width: 14px; height: 0; border-top: 2px dashed currentColor; border-radius: 0; background: none !important; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-center-label { text-align: center; }
.donut-legend { display: grid; gap: 9px; flex: 1; min-width: 160px; }
.donut-legend-row { display: flex; align-items: center; gap: 9px; font-size: var(--fs-xs); color: var(--text-2); }
.donut-legend-row i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.donut-legend-row span { flex: 1; }
.donut-legend-row strong { font-family: var(--font-display); color: var(--text); }

.heat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14px, 1fr)); gap: 4px; }
.heat-grid span { aspect-ratio: 1; border-radius: 3px; background: var(--surface-3); transition: transform var(--dur) var(--ease); }
.heat-grid span:hover { transform: scale(1.25); }
.heat-grid span[data-level='1'] { background: color-mix(in srgb, var(--brand) 26%, var(--surface-3)); }
.heat-grid span[data-level='2'] { background: color-mix(in srgb, var(--brand) 48%, var(--surface-3)); }
.heat-grid span[data-level='3'] { background: color-mix(in srgb, var(--brand) 72%, var(--surface-3)); }
.heat-grid span[data-level='4'] { background: var(--brand); }

/* ==========================================================================
   Feed / lists / kv
   ========================================================================== */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 13px; padding: 13px 0; border-bottom: 1px dashed var(--border); }
.feed-item:last-child { border-bottom: 0; padding-bottom: 0; }
.feed-item:first-child { padding-top: 0; }
.feed-ico { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none; font-size: var(--fs-xs); background: var(--surface-3); color: var(--text-2); }
.feed-ico.ico-brand { background: var(--brand-soft); color: var(--brand-text); }
.feed-ico.ico-ok { background: var(--ok-soft); color: var(--ok); }
.feed-ico.ico-warn { background: var(--warn-soft); color: var(--warn); }
.feed-ico.ico-info { background: var(--info-soft); color: var(--info); }
.feed-ico.ico-danger { background: var(--danger-soft); color: var(--danger); }
.feed-body { flex: 1; min-width: 0; }
.feed-body p { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.5; }
.feed-body strong { color: var(--text); font-weight: 650; }
.feed-meta { display: flex; align-items: center; gap: 10px; font-size: var(--fs-2xs); color: var(--text-3); margin-top: 4px; }
.feed-time { font-family: var(--font-mono); font-size: var(--fs-3xs); color: var(--text-3); white-space: nowrap; }

.list-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 18px;
  border-bottom: 1px solid var(--border); transition: background var(--dur) var(--ease);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row > .grow { flex: 1; min-width: 0; }
.list-row-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.list-row-sub { font-size: var(--fs-2xs); color: var(--text-3); margin-top: 2px; }

.kv { display: grid; gap: 12px; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: var(--fs-sm); }
.kv-row dt { color: var(--text-3); }
.kv-row dd { font-weight: 600; color: var(--text); text-align: right; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.quick-action {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 15px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-2); text-align: left;
  transition: all var(--dur) var(--ease);
}
.quick-action:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-2px); }
.quick-action i { font-size: var(--fs-md); color: var(--brand-text); }
.quick-action strong { font-size: var(--fs-xs); font-weight: 650; color: var(--text); }
.quick-action span { font-size: var(--fs-2xs); color: var(--text-3); }

/* tabs in panels */
.panel-tabs { display: flex; gap: 4px; padding: 10px 14px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.panel-tabs .tab { padding: 7px 12px; font-size: var(--fs-xs); border-radius: var(--r-sm); }
.panel-tabs .tab.is-active { background: var(--brand-soft); color: var(--brand-text); }
.panel-tabs .tab.is-active::after { display: none; }

/* api key rows */
.key-row {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  transition: all var(--dur) var(--ease); flex-wrap: wrap;
}
.key-row + .key-row { margin-top: 10px; }
.key-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.key-main { flex: 1; min-width: 220px; }
.key-name { display: flex; align-items: center; gap: 9px; font-size: var(--fs-sm); font-weight: 650; }
.key-token {
  font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 4px 9px; border-radius: var(--r-sm); margin-top: 7px;
  display: inline-flex; align-items: center; gap: 9px; max-width: 100%; overflow: hidden;
}
.key-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--fs-2xs); color: var(--text-3); margin-top: 8px; }
.key-meta i { margin-right: 5px; opacity: 0.7; }
.key-actions { display: flex; gap: 6px; align-items: center; }

/* Playground / console */
.console { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: var(--sp-5); align-items: start; }
@media (max-width: 1100px) { .console { grid-template-columns: minmax(0, 1fr); } }
.console-thread { display: flex; flex-direction: column; gap: 14px; min-height: 320px; }
.bubble { display: flex; gap: 12px; max-width: 88%; }
.bubble--user { align-self: flex-end; flex-direction: row-reverse; }
.bubble-body {
  padding: 12px 15px; border-radius: var(--r-lg); font-size: var(--fs-sm);
  background: var(--surface-2); border: 1px solid var(--border); line-height: 1.6;
}
.bubble--user .bubble-body { background: var(--brand-soft); border-color: transparent; color: var(--text); }
.bubble-meta { font-size: var(--fs-3xs); color: var(--text-3); font-family: var(--font-mono); margin-top: 6px; display: flex; gap: 10px; }
.composer {
  display: flex; gap: 10px; align-items: flex-end; padding: 12px;
  border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface);
  margin-top: 14px; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.composer:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; min-height: 24px; max-height: 160px; outline: none; font-size: var(--fs-sm); }
.param-slider { display: grid; gap: 6px; margin-bottom: 16px; }
.param-slider-head { display: flex; justify-content: space-between; font-size: var(--fs-xs); }
.param-slider-head span { color: var(--text-3); }
.param-slider-head strong { font-family: var(--font-mono); font-size: var(--fs-2xs); }

/* filter bar */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); margin-bottom: var(--sp-5);
}
.filter-bar .input { max-width: 280px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-label { font-size: var(--fs-2xs); color: var(--text-3); font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; }

/* date range */
.range-tabs { display: inline-flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 3px; }
.range-tabs button {
  padding: 5px 11px; border-radius: var(--r-sm); font-size: var(--fs-2xs); font-weight: 650;
  color: var(--text-3); transition: all var(--dur) var(--ease);
}
.range-tabs button:hover { color: var(--text); }
.range-tabs button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* wizard steps */
.wizard { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: var(--sp-6); }
.wizard-step { display: flex; align-items: center; gap: 9px; font-size: var(--fs-xs); color: var(--text-3); }
.wizard-step .num {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-3); font-size: var(--fs-2xs); font-weight: 700;
}
.wizard-step.is-active { color: var(--text); font-weight: 650; }
.wizard-step.is-active .num { background: var(--brand); color: #04140d; }
.wizard-step.is-done .num { background: var(--brand-soft); color: var(--brand-text); }
.wizard-line { width: 34px; height: 1px; background: var(--border); }

/* progress ring used in vendor/admin cards */
.mini-bars { display: flex; align-items: flex-end; gap: 4px; height: 46px; }
.mini-bars span { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; opacity: 0.85; min-height: 4px; transition: opacity var(--dur) var(--ease); }
.mini-bars span:hover { opacity: 1; }
.mini-bars--info span { background: var(--info); }

/* dense list rows: fixed-width chart/usage columns squeeze the title on phones */
@media (max-width: 640px) {
  .list-row { gap: 10px; padding: 12px 14px; }
  .list-row > span[style*="width:120px"] { width: 72px !important; }
}
@media (max-width: 460px) {
  .list-row > span[style*="width:120px"] { display: none; }
}

/* leaderboard */
.rank { width: 26px; height: 26px; border-radius: var(--r-sm); display: grid; place-items: center; font-family: var(--font-display); font-size: var(--fs-2xs); font-weight: 700; background: var(--surface-3); color: var(--text-3); }
.rank--1 { background: var(--brand); color: #04140d; }
.rank--2 { background: var(--info-soft); color: var(--info); }
.rank--3 { background: var(--purple-soft); color: var(--purple); }

/* verdict banner (moderation) */
.verdict { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); }
.verdict-ico { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; flex: none; background: var(--warn-soft); color: var(--warn); }
.verdict-ico.ok { background: var(--ok-soft); color: var(--ok); }
.verdict h4 { font-size: var(--fs-sm); }
.verdict p { font-size: var(--fs-xs); color: var(--text-2); margin-top: 4px; }
.verdict-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */
[data-reveal].reveal-ready {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
[data-reveal].reveal-ready.is-revealed { opacity: 1; transform: none; }

@media (max-width: 640px) {
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head-actions { width: 100%; }
  .panel-head { flex-direction: column; align-items: flex-start; }
}
