/* ==========================================================================
   Master UI Kit v2.0 â€” Modern Compact Component Library
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
[v-cloak] { display: none !important; }
html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-primary);
  background-color: var(--bg-canvas);
  background-image: radial-gradient(var(--bg-canvas-dot) 1px, transparent 1px);
  background-size: 16px 16px;
  -webkit-font-smoothing: antialiased;
}

.mono, code, kbd { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tabular { font-variant-numeric: tabular-nums; }

kbd {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  font-size: 10px;
  line-height: 1.3;
  color: var(--ink-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
}

svg.ic {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ==========================================================================
   1. App Shell (Sidebar + Topbar + Canvas)
   ========================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
  overflow-x: clip;
}
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  margin-left: 0;
  transform: translateX(0);
  opacity: 1;
  transition:
    margin-left 280ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 220ms ease;
  will-change: margin-left, transform, opacity;
}
.app-shell.is-sidebar-hidden .sidebar {
  margin-left: calc(var(--sidebar-width) * -1);
  transform: translateX(-10px);
  border-right-color: transparent;
  opacity: 0;
  pointer-events: none;
}

.sidebar-brand {
  height: var(--topbar-height);
  padding: 0 var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: -0.015em;
}

.brand-badge {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: var(--inset-highlight);
  display: grid;
  place-items: center;
}

.sidebar-search {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrap .ic {
  position: absolute;
  left: 8px;
  color: var(--ink-muted);
  pointer-events: none;
}

.search-wrap .input {
  padding-left: 26px;
  padding-right: 26px;
  height: 28px;
  font-size: var(--text-xs);
  background: var(--bg-canvas);
}

.search-kbd {
  position: absolute;
  right: 6px;
  pointer-events: none;
}

.sidebar-nav {
  padding: var(--space-2);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.nav-group-label {
  padding: 0 var(--space-2);
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: 500;
  transition: background-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.nav-link-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-link:hover {
  background: rgba(21, 21, 19, 0.085);
  color: var(--ink-primary);
  transform: translateX(2px);
}
.nav-link.is-active {
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}
.nav-link.is-active .mono {
  color: var(--accent-fg);
  opacity: 0.85 !important;
}
[data-theme="dark"] .nav-link:hover {
  background: rgba(255, 255, 255, 0.11);
  color: var(--ink-primary);
}
[data-theme="dark"] .nav-link.is-active {
  background: var(--accent-subtle);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-border), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .nav-link.is-active .mono {
  color: var(--accent);
  opacity: 0.85 !important;
}

/* Sidebar Nested Submenu */
.nav-group-btn {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, transform 140ms ease;
}
.nav-group-btn:hover {
  background: rgba(21, 21, 19, 0.085);
  color: var(--ink-primary);
  transform: translateX(2px);
}
[data-theme="dark"] .nav-group-btn:hover {
  background: rgba(255, 255, 255, 0.11);
  color: var(--ink-primary);
}
.nav-chevron { transition: transform var(--transition-fast); color: var(--ink-muted); }
.nav-tree.is-open > .nav-group-btn .nav-chevron { transform: rotate(90deg); }
.nav-sublist {
  list-style: none;
  margin: 0 0 0 15px;
  padding: 0 0 0 8px;
  border-left: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-height 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease, margin 220ms ease;
}
.nav-tree.is-open > .nav-sublist {
  max-height: 240px;
  opacity: 1;
  margin: 2px 0 2px 15px;
  pointer-events: auto;
}

/* ==========================================================================
   Menu & Sub-Menu Showcase Patterns (Page 05)
   ========================================================================== */
/* A. App Tree Sidebar Menu */
.menu-tree-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tree-item {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
  text-align: left;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.tree-item:hover { background: var(--bg-subtle); color: var(--ink-primary); }
.tree-item.is-active { background: var(--accent-subtle); color: var(--accent); font-weight: 600; }
.tree-branch .tree-children {
  margin: 2px 0 4px 15px;
  padding-left: 8px;
  border-left: 1px solid var(--border-default);
  display: none;
  flex-direction: column;
  gap: 1px;
}
.tree-branch.is-open > .tree-children { display: flex; }
.tree-branch.is-open > .tree-item .tree-chev { transform: rotate(90deg); }
.tree-chev { transition: transform var(--transition-fast); color: var(--ink-muted); }

/* B. Horizontal Top Navbar + Rich Mega Submenu */
.hnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  gap: var(--space-3);
}
.hnav-links { display: flex; align-items: center; gap: 2px; }
.hnav-item { position: relative; }
.hnav-btn {
  border: 0;
  background: transparent;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
}
.hnav-btn:hover, .hnav-item.is-open > .hnav-btn { background: var(--bg-subtle); color: var(--ink-primary); }
.hnav-btn.is-active { background: var(--accent-subtle); color: var(--accent); font-weight: 600; }

.mega-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 340px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  z-index: 45;
  animation: dropIn 110ms cubic-bezier(0.2, 0, 0, 1);
}
.hnav-item.is-open .mega-panel { display: grid; }
.mega-link {
  border: 0;
  background: transparent;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.mega-link:hover { background: var(--bg-subtle); }
.mega-icon {
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  color: var(--accent);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.mega-title { font-size: var(--text-xs); font-weight: 600; color: var(--ink-primary); }
.mega-sub { font-size: 10px; color: var(--ink-muted); }

/* C. Cascading Flyout Submenu */
.flyout-wrap { position: relative; }
.flyout-sub {
  position: absolute;
  top: -4px;
  left: calc(100% + 4px);
  min-width: 168px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  display: none;
  z-index: 65;
}
.flyout-sub::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -8px;
  width: 8px;
}
.dropdown-menu:has(.flyout-wrap) { overflow: visible; }
.flyout-wrap:hover > .flyout-sub,
.flyout-wrap.is-open > .flyout-sub { display: block; }

/* D. Interactive Breadcrumb Trail */
.crumb-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--ink-muted);
}
.crumb-link {
  color: var(--ink-secondary);
  text-decoration: none;
  padding: 2px 5px;
  border-radius: var(--radius-xs);
}
.crumb-link:hover { background: var(--bg-subtle); color: var(--ink-primary); }
.crumb-current { color: var(--ink-primary); font-weight: 600; }

.sidebar-footer {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-2xs);
  color: var(--ink-muted);
}

.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }

.app-footer {
  margin-top: auto;
  height: 38px;
  padding: 0 var(--space-5);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-2xs);
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.footer-link {
  border: 0;
  background: transparent;
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: var(--text-2xs);
  color: var(--ink-muted);
  cursor: pointer;
}
.footer-link:hover { color: var(--ink-primary); background: var(--bg-subtle); }

.topbar {
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-left, .topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.cmd-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 27px;
  padding: 0 8px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-family: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
}
.cmd-trigger:hover { border-color: var(--border-strong); color: var(--ink-primary); }

.accent-picker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

.accent-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  padding: 0;
  transition: transform var(--transition-fast);
}
.accent-dot:hover { transform: scale(1.15); }
.accent-dot.is-active { box-shadow: 0 0 0 1.5px var(--bg-surface), 0 0 0 3px var(--ink-primary); }

.notif-btn { position: relative; }
.notif-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid var(--bg-surface);
}

.content-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-4) var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* ==========================================================================
   2. Per-Page Views & Grids
   ========================================================================== */
/* Route Progress Bar (Top of Topbar) & Page Transition Loader */
.route-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: var(--accent);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: width 200ms cubic-bezier(0.2, 0, 0, 1), opacity 180ms ease;
}
.route-progress.is-active {
  opacity: 1;
}

.page-loader {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 260px;
  color: var(--ink-muted);
  font-size: var(--text-xs);
  animation: fadeIn 120ms ease;
}
.page-loader.is-active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.kit-page {
  display: none;
  flex-direction: column;
  gap: var(--space-4);
}
.kit-page.is-active {
  display: flex;
  animation: pageIn 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.kit-page.is-active > * {
  animation: itemGlide 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.kit-page.is-active > *:nth-child(2) { animation-delay: 35ms; }
.kit-page.is-active > *:nth-child(3) { animation-delay: 65ms; }
.kit-page.is-active > *:nth-child(4) { animation-delay: 95ms; }
.kit-page.is-active > *:nth-child(5) { animation-delay: 120ms; }

@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes itemGlide {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-default);
}

.page-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.015em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.section-title {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.section-index { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--ink-muted); }

/* Table Toolbar, Tabs Bar, Bulk Bar & Active Filters */
.table-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  flex-wrap: wrap;
}
.table-tabs-nav {
  display: inline-flex;
  align-items: center;
  gap: 20px;
}
.table-tab-btn {
  position: relative;
  border: 0;
  background: transparent;
  padding: 13px 2px;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.table-tab-btn:hover { color: var(--ink-primary); }
.table-tab-btn.is-active {
  color: var(--ink-primary);
  font-weight: 600;
}
.table-tab-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background-color var(--transition-fast);
}
.table-tab-btn.is-active::after { background: var(--accent); }
.table-tab-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--ink-muted);
  line-height: 1.45;
}
.table-tab-btn.is-active .table-tab-count {
  background: var(--accent-subtle);
  color: var(--accent);
}

.table-toolbar {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tbl-ctrl-btn {
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}
.tbl-ctrl-btn:hover {
  background: var(--bg-canvas);
  border-color: var(--border-strong);
  color: var(--ink-primary);
}
.tbl-ctrl-btn.is-filtered {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
}
.tbl-ctrl-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--accent-fg);
  line-height: 1.5;
}

.bulk-bar {
  padding: 10px 16px;
  background: var(--ink-primary);
  color: var(--ink-inverse);
  font-size: var(--text-xs);
  font-weight: 500;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: fadeIn 120ms ease;
}
.bulk-bar.is-visible { display: flex; }
.bulk-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.bulk-count-pill {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.14);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}
[data-theme="dark"] .bulk-count-pill { background: rgba(0, 0, 0, 0.22); }
.bulk-link {
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
  opacity: 0.9;
}
.bulk-link:hover { opacity: 1; }
.bulk-bar .btn-ghost-inv {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink-inverse);
  border-color: rgba(255, 255, 255, 0.18);
}
.bulk-bar .btn-ghost-inv:hover { background: rgba(255, 255, 255, 0.22); }
[data-theme="dark"] .bulk-bar .btn-ghost-inv {
  background: rgba(0, 0, 0, 0.14);
  border-color: rgba(0, 0, 0, 0.22);
}

/* Unified 4-Cell Summary Strip */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.summary-cell {
  padding: 12px 16px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.summary-cell:last-child { border-right: 0; }
.summary-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
}
.summary-val {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  font-variant-numeric: tabular-nums;
}
.summary-sub {
  font-size: 11px;
  color: var(--ink-muted);
}

/* Table Search Input with Clear Button */
.tbl-search-box {
  position: relative;
  width: 320px;
  max-width: 100%;
  display: flex;
  align-items: center;
}
.tbl-search-box > .ic {
  position: absolute;
  left: 10px;
  color: var(--ink-muted);
  pointer-events: none;
}
.tbl-search-input {
  width: 100%;
  height: 34px;
  padding: 0 28px 0 32px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: inherit;
  font-size: var(--text-xs);
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}
.tbl-search-input:focus {
  outline: none;
  background: var(--bg-surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 2.5px var(--accent-subtle);
}
.tbl-search-clear {
  position: absolute;
  right: 6px;
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  border-radius: var(--radius-xs);
  display: none;
  place-items: center;
  cursor: pointer;
  font-size: 11px;
}
.tbl-search-clear.is-visible { display: grid; }
.tbl-search-clear:hover { background: var(--bg-subtle); color: var(--ink-primary); }

/* Status Filter Tabs with Live Counts */
.status-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
.status-tab {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  border-radius: 3px;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.status-tab:hover { color: var(--ink-primary); }
.status-tab.is-active {
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.tab-count {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--ink-muted);
}
.status-tab.is-active .tab-count {
  background: var(--accent-subtle);
  color: var(--accent);
}

/* Active Filters Chips Bar */
.active-filters-bar {
  padding: 8px 16px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-subtle);
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--text-2xs);
  color: var(--ink-muted);
}
.active-filters-bar.is-visible { display: flex; }

mark.hl {
  background: var(--warning-bg);
  color: var(--ink-primary);
  border-radius: 2px;
  padding: 0 2px;
}

/* Cohesive Inline Notice Banner & System Notices Feed */
.notice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--danger-border);
  box-shadow: var(--shadow-xs);
  font-size: var(--text-xs);
}
.notice-banner.is-hidden { display: none; }

.notice-feed {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.notice-feed-head {
  padding: 10px 16px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  font-weight: 600;
}
.notice-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--text-xs);
  transition: background-color var(--transition-fast);
}
.notice-item:last-child { border-bottom: 0; }
.notice-item:hover { background: var(--bg-canvas); }
.notice-item.is-hidden { display: none; }
.notice-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.th-sort:hover { color: var(--ink-primary); }
.sort-ind { font-size: 9px; opacity: 0.45; }
.th-sort.is-sorted .sort-ind { opacity: 1; color: var(--accent); }

.cell-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cell-sub {
  font-size: 10px;
  color: var(--ink-muted);
}

/* Spacing & Radius Visual Bars (Tokens Page) */
.scale-row {
  display: grid;
  grid-template-columns: 76px 52px 1fr;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
}
.scale-bar {
  height: 10px;
  background: var(--accent);
  border-radius: 2px;
}

.toast.is-success { background: var(--success); color: #ffffff; }
.toast.is-warning { background: var(--warning); color: #ffffff; }
.toast.is-danger { background: var(--danger); color: #ffffff; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.stack-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.stack-col { display: flex; flex-direction: column; gap: var(--space-2); }

/* ==========================================================================
   3. Panels, KPI + Sparklines, Accordion
   ========================================================================== */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.panel-header {
  padding: 7px var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.panel-title { margin: 0; font-size: var(--text-xs); font-weight: 600; }
.panel-body { padding: var(--space-3); }

.panel-footer {
  padding: 7px var(--space-3);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.stat-block {
  padding: var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-2xs);
  color: var(--ink-muted);
}

.stat-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-2);
}

.stat-value {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.sparkline { width: 64px; height: 22px; overflow: visible; }
.sparkline path { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Accordion */
.accordion {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow: hidden;
}
.accordion-item + .accordion-item { border-top: 1px solid var(--border-subtle); }
.accordion-trigger {
  width: 100%;
  background: transparent;
  border: 0;
  padding: 8px var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-primary);
  cursor: pointer;
}
.accordion-trigger:hover { background: var(--bg-subtle); }
.accordion-content { padding: 0 var(--space-3) 9px; font-size: var(--text-xs); color: var(--ink-secondary); display: none; }
.accordion-item.is-open .accordion-content { display: block; }
.accordion-chevron { transition: transform var(--transition-fast); color: var(--ink-muted); }
.accordion-item.is-open .accordion-chevron { transform: rotate(180deg); }

/* ==========================================================================
   4. Buttons & Tooltips
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: var(--control-h);
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), transform 80ms ease;
}
.btn:active:not(:disabled) { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-xs { height: 24px; padding: 0 7px; font-size: var(--text-2xs); }
.btn-sm { height: 27px; padding: 0 9px; font-size: var(--text-xs); }
.btn-md { height: 30px; padding: 0 11px; font-size: var(--text-xs); }
.btn-lg { height: 35px; padding: 0 14px; font-size: var(--text-sm); }

.btn-icon { width: var(--control-h); padding: 0; }
.btn-icon.btn-sm { width: 27px; }
.btn-icon.btn-xs { width: 24px; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
  box-shadow: var(--inset-highlight), var(--shadow-xs);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-surface);
  color: var(--ink-primary);
  border-color: var(--border-default);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--bg-subtle); border-color: var(--border-strong); }

.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent-border); }
.btn-outline:hover { background: var(--accent-subtle); }

.btn-ghost { background: transparent; color: var(--ink-secondary); }
.btn-ghost:hover { background: var(--bg-subtle); color: var(--ink-primary); }

.btn-danger { background: var(--danger); color: #ffffff; border-color: var(--danger); box-shadow: var(--inset-highlight); }
.btn-danger:hover { background: var(--danger-hover); }

.btn-danger-subtle { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.btn-danger-subtle:hover { background: var(--danger); color: #ffffff; }

.btn-success { background: var(--success); color: #ffffff; border-color: var(--success); box-shadow: var(--inset-highlight), var(--shadow-xs); }
.btn-success:hover { filter: brightness(0.92); }

.btn-success-subtle { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.btn-success-subtle:hover { background: var(--success); color: #ffffff; border-color: var(--success); }

.btn-warning-subtle { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.btn-warning-subtle:hover { background: var(--warning); color: #ffffff; border-color: var(--warning); }

.btn-info-subtle { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.btn-info-subtle:hover { background: var(--info); color: #ffffff; border-color: var(--info); }

.btn-ghost-info { background: transparent; color: var(--ink-muted); }
.btn-ghost-info:hover { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }

.btn-ghost-warning { background: transparent; color: var(--ink-muted); }
.btn-ghost-warning:hover { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }

.btn-ghost-danger { background: transparent; color: var(--ink-muted); }
.btn-ghost-danger:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }

.btn-kbd {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
  background: rgba(21, 21, 19, 0.07);
  color: inherit;
  opacity: 0.8;
  margin-left: 2px;
}
[data-theme="dark"] .btn-kbd { background: rgba(255, 255, 255, 0.12); }
.btn-primary .btn-kbd { background: color-mix(in srgb, currentColor 16%, transparent); opacity: 0.95; }
.btn-danger .btn-kbd, .btn-success .btn-kbd { background: rgba(255, 255, 255, 0.2); opacity: 0.95; }

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.action-row:first-child { padding-top: 0; }
.action-row:last-child { border-bottom: 0; padding-bottom: 0; }
.action-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  width: 108px;
  flex-shrink: 0;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  white-space: nowrap;
}

.row-pattern-card {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-canvas);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.row-pattern-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.row-pattern-title { font-size: var(--text-xs); font-weight: 600; color: var(--ink-primary); }
.row-pattern-sub { font-size: 10px; color: var(--ink-muted); }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
.btn-group .btn:last-child { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
.btn-group .btn + .btn { margin-left: -1px; }
.btn-group .btn.is-active { background: var(--bg-subtle); border-color: var(--border-strong); font-weight: 600; z-index: 1; }

/* CSS Micro-Tooltip */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(2px);
  padding: 3px 7px;
  border-radius: var(--radius-xs);
  background: var(--ink-primary);
  color: var(--ink-inverse);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 110ms ease, transform 110ms ease;
  z-index: 30;
}
[data-tip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Tooltip placement: below (topbar / explicit) */
.topbar [data-tip]::after,
[data-tip-pos="bottom"]::after {
  bottom: auto;
  top: calc(100% + 6px);
  transform: translateX(-50%) translateY(-2px);
}
.topbar [data-tip]:hover::after,
[data-tip-pos="bottom"]:hover::after { transform: translateX(-50%) translateY(0); }

/* Tooltip placement: left (table rows, avoids clipping by scroll container) */
.data-table [data-tip]::after,
[data-tip-pos="left"]::after {
  bottom: auto;
  left: auto;
  top: 50%;
  right: calc(100% + 6px);
  transform: translateY(-50%) translateX(2px);
}
.data-table [data-tip]:hover::after,
[data-tip-pos="left"]:hover::after { transform: translateY(-50%) translateX(0); }

.spinner {
  width: 12px; height: 12px;
  border: 1.8px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
.ic.is-spinning { animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   5. Forms, Chips & Dropzone
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: var(--text-xs); font-weight: 500; color: var(--ink-secondary); }
.field-error-msg { font-size: var(--text-2xs); color: var(--danger); }

.input, .select {
  width: 100%;
  height: var(--control-h);
  background: var(--bg-surface);
  color: var(--ink-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  padding: 5px 9px;
}
.input:hover:not(:disabled), .select:hover:not(:disabled) { border-color: var(--border-strong); }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2.5px var(--accent-subtle); }
.input.is-error { border-color: var(--danger); }
.input:disabled { background: var(--bg-subtle); color: var(--ink-muted); cursor: not-allowed; }

.input-group { display: flex; align-items: stretch; }
.input-addon {
  display: inline-flex; align-items: center; padding: 0 8px;
  background: var(--bg-subtle); border: 1px solid var(--border-default);
  color: var(--ink-muted); font-size: var(--text-2xs); font-family: var(--font-mono);
}
.input-addon:first-child { border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-addon:last-child { border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .input:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group .input:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.check-row { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-xs); cursor: pointer; }
.check-row input { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; cursor: pointer; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: var(--text-xs); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 30px; height: 17px; background: var(--border-strong); border-radius: var(--radius-full); position: relative; transition: background-color var(--transition-fast); }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: transform var(--transition-fast); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(13px); background: var(--accent-fg); }

.range-input { width: 105px; accent-color: var(--accent); cursor: pointer; }

/* Filter Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 7px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  font-size: var(--text-2xs);
  font-weight: 500;
  color: var(--ink-primary);
}
.chip-remove {
  border: 0; background: transparent; color: var(--ink-muted);
  cursor: pointer; padding: 0; font-size: 11px; line-height: 1;
}
.chip-remove:hover { color: var(--danger); }

/* Compact Dropzone */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  padding: 12px var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--accent); background: var(--accent-subtle); }

/* ==========================================================================
   6. Progress, Stepper, Avatars, Dropdown
   ========================================================================== */
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
}
.progress-fill { height: 100%; background: var(--accent); border-radius: var(--radius-full); }
.progress-fill.is-warn { background: var(--warning); }

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--ink-muted);
}
.step-item.is-done { color: var(--ink-primary); }
.step-item.is-active { color: var(--accent); font-weight: 600; }
.step-num {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}
.step-item.is-done .step-num { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.step-item.is-active .step-num { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }
.step-line { flex: 1; height: 1px; background: var(--border-default); min-width: 18px; }

/* Avatars */
.avatar-stack { display: inline-flex; align-items: center; }
.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1.5px solid var(--bg-surface);
  color: var(--ink-primary);
  font-size: 10px;
  font-weight: 600;
  display: grid; place-items: center;
  position: relative;
}
.avatar-stack .avatar + .avatar { margin-left: -7px; }
.avatar.is-accent { background: var(--accent-subtle); color: var(--accent); }
.avatar-status {
  position: absolute; bottom: -1px; right: -1px;
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--bg-surface);
  background: var(--success);
}
.avatar-status.is-away { background: var(--warning); }

/* Dropdown Menu & Searchable Combobox */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 224px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0;
  display: none;
  z-index: 45;
  overflow: hidden;
  animation: dropIn 110ms cubic-bezier(0.2, 0, 0, 1);
}
.dropdown-menu.align-right { left: auto; right: 0; }
.dropdown.is-open .dropdown-menu { display: block; }
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-3px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-search {
  position: relative;
  display: flex;
  align-items: center;
  padding: 6px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
}
.dropdown-search .ic {
  position: absolute;
  left: 13px;
  width: 13px;
  height: 13px;
  color: var(--ink-muted);
  pointer-events: none;
}
.dropdown-search input {
  width: 100%;
  height: 26px;
  padding: 0 8px 0 24px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-family: inherit;
  font-size: var(--text-xs);
  outline: none;
}
.dropdown-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

.dropdown-list {
  padding: 4px;
  max-height: 210px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dropdown-label {
  padding: 4px 8px 2px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.dropdown-item {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: inherit;
  font-size: var(--text-xs);
  color: var(--ink-primary);
  cursor: pointer;
  text-align: left;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.dropdown-item:hover { background: var(--bg-subtle); }
.dropdown-item.is-selected {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}
.dropdown-item.is-danger { color: var(--danger); }
.dropdown-item.is-danger:hover { background: var(--danger-bg); }
.dropdown-item.is-hidden { display: none; }
.dropdown-sep { height: 1px; background: var(--border-subtle); margin: 4px 0; }
.dropdown-empty {
  padding: 12px 8px;
  text-align: center;
  font-size: var(--text-2xs);
  color: var(--ink-muted);
  display: none;
}
.dropdown-empty.is-visible { display: block; }

/* Custom Searchable Select Trigger */
.select-combo { position: relative; width: 100%; }
.select-combo .dropdown-menu { width: 100%; min-width: 210px; }
.select-trigger {
  width: 100%;
  height: var(--control-h);
  padding: 0 9px;
  background: var(--bg-surface);
  color: var(--ink-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--text-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.select-trigger:hover { border-color: var(--border-strong); }
.dropdown.is-open .select-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 2.5px var(--accent-subtle);
}
.select-check { opacity: 0; color: var(--accent); }
.dropdown-item.is-selected .select-check { opacity: 1; }

/* ==========================================================================
   7. Tabs, Segmented, Badges, Alerts, Table & Pagination
   ========================================================================== */
.tabs-bar { display: flex; border-bottom: 1px solid var(--border-default); gap: var(--space-4); }
.tab-btn {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  padding: 5px 2px; margin-bottom: -1px; font-family: inherit;
  font-size: var(--text-xs); font-weight: 500; color: var(--ink-muted); cursor: pointer;
}
.tab-btn:hover { color: var(--ink-primary); }
.tab-btn.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-panel { display: none; padding-top: var(--space-2); font-size: var(--text-xs); color: var(--ink-secondary); }
.tab-panel.is-active { display: block; }

.segmented {
  display: inline-flex; padding: 2px;
  background: var(--bg-subtle); border: 1px solid var(--border-default); border-radius: var(--radius-sm);
}
.segmented-btn {
  border: 0; background: transparent; padding: 3px 9px; border-radius: 3px;
  font-family: inherit; font-size: var(--text-2xs); font-weight: 500; color: var(--ink-secondary); cursor: pointer;
}
.segmented-btn.is-active { background: var(--bg-surface); color: var(--ink-primary); box-shadow: var(--shadow-xs); font-weight: 600; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 6px; border-radius: var(--radius-xs);
  font-size: var(--text-2xs); font-weight: 600; line-height: 1.45;
  border: 1px solid transparent;
}
.badge-neutral { background: var(--bg-subtle); color: var(--ink-secondary); border-color: var(--border-default); }
.badge-accent { background: var(--accent-subtle); color: var(--accent); border-color: var(--accent-border); }
.badge-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge-info { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* Modern Minimal Alerts (Uniform 1px Hairline, Naked Semantic Icon â€” No Left Stripe) */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-xs);
  font-size: var(--text-xs);
  color: var(--ink-primary);
  transition: border-color var(--transition-fast);
}
.alert:hover { border-color: var(--border-strong); }

.alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.alert-icon svg.ic {
  width: 15px;
  height: 15px;
  stroke-width: 1.9;
}

.alert-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.alert-title {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
  line-height: 1.35;
}
.alert-text {
  color: var(--ink-muted);
  font-size: var(--text-2xs);
  line-height: 1.4;
}

.alert-info .alert-icon { color: var(--info); }
.alert-success .alert-icon { color: var(--success); }
.alert-warning { border-color: var(--warning-border); }
.alert-warning .alert-icon { color: var(--warning); }
.alert-danger { border-color: var(--danger-border); }
.alert-danger .alert-icon { color: var(--danger); }

.alert-dismiss {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-xs);
  font-size: 11px;
  opacity: 0.65;
  transition: opacity var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}
.alert-dismiss:hover { opacity: 1; background: var(--bg-subtle); color: var(--ink-primary); }

/* Purposeful Modern Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.card:hover { border-color: var(--border-strong); }
.card-select { cursor: pointer; text-align: left; font-family: inherit; }
.card-select.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-xs);
  background: var(--bg-surface);
}
.card-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--ink-primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-2xs);
  color: var(--ink-muted);
}

/* Anchored Popover Card */
.popover-wrap { position: relative; display: inline-block; }
.popover-card {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 250px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3);
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 65;
  animation: dropIn 110ms cubic-bezier(0.2, 0, 0, 1);
}
.popover-card.align-right { left: auto; right: 0; }
.popover-wrap.is-open .popover-card { display: flex; }

/* Popup Alert Icon Badge */
.popup-alert-body {
  padding: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.popup-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.popup-icon-badge.is-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.popup-icon-badge.is-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.popup-icon-badge.is-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.popup-icon-badge.is-info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }

/* Refined Loading System (Linear Bar, SVG Ring, Overlay Loader) */
.linear-loader {
  position: relative;
  width: 100%;
  height: 3px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.linear-loader::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 38%;
  background: var(--accent);
  border-radius: var(--radius-full);
  animation: linearSlide 1.25s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes linearSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(310%); }
}

.ring-spinner {
  border-radius: 50%;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.ring-sm { width: 14px; height: 14px; }
.ring-md { width: 20px; height: 20px; border-width: 2.2px; }
.ring-lg { width: 28px; height: 28px; border-width: 2.5px; }
.ring-xl { width: 36px; height: 36px; border-width: 3px; }
.pulse-dot.is-danger { background: var(--danger); }
.pulse-dot.is-muted { background: var(--ink-muted); animation: none; }

/* Three-Dot Bounce Loader */
.dots-loader { display: inline-flex; align-items: center; gap: 4px; height: 16px; }
.dots-loader span {
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  animation: dotBounce 1.1s ease-in-out infinite;
}
.dots-loader span:nth-child(2) { animation-delay: 0.15s; }
.dots-loader span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* Equalizer Bar Loader */
.bars-loader { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 16px; }
.bars-loader span {
  width: 3px; height: 6px; border-radius: 1.5px; background: var(--accent);
  animation: barPulse 0.9s ease-in-out infinite;
}
.bars-loader span:nth-child(2) { animation-delay: 0.14s; }
.bars-loader span:nth-child(3) { animation-delay: 0.28s; }
.bars-loader span:nth-child(4) { animation-delay: 0.42s; }
@keyframes barPulse {
  0%, 100% { height: 5px; opacity: 0.4; }
  50% { height: 16px; opacity: 1; }
}

/* Multi-Segment Quota Bar */
.quota-track {
  width: 100%; height: 7px; border-radius: var(--radius-full);
  background: var(--bg-subtle); overflow: hidden; display: flex; gap: 1.5px;
}
.quota-seg { height: 100%; }
.quota-seg.is-a { background: var(--accent); }
.quota-seg.is-b { background: var(--info); }
.quota-seg.is-c { background: var(--warning); }

/* Stepped Pipeline Loader */
.pipe-list { display: flex; flex-direction: column; gap: 6px; }
.pipe-step {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  background: var(--bg-canvas); font-size: var(--text-xs);
}
.pipe-step.is-active { border-color: var(--accent-border); background: var(--accent-subtle); color: var(--ink-primary); }
.pipe-step.is-done { color: var(--ink-secondary); }

/* Skeleton Presets */
.skel-card {
  padding: 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  background: var(--bg-canvas); display: flex; flex-direction: column; gap: 8px;
}
.skel-bars {
  display: flex; align-items: flex-end; gap: 8px; height: 72px; padding-top: 8px;
}
.skel-bars .skeleton { flex: 1; border-radius: 3px 3px 0 0; }

/* System State Cards & HTTP Error Code */
.state-code {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: var(--radius-xs);
  background: var(--bg-subtle); color: var(--ink-secondary); border: 1px solid var(--border-default);
}
.state-code.is-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.state-code.is-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.state-trace {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-muted);
  background: var(--bg-canvas); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs); padding: 4px 8px;
}
.sys-card {
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-xs);
}

/* Bottom Sheet Overlay */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(17, 17, 16, 0.45);
  display: none; align-items: flex-end; justify-content: center; z-index: 52;
}
.sheet-backdrop.is-open { display: flex; animation: fadeIn 140ms ease; }
.sheet-panel {
  width: 100%; max-width: 520px; background: var(--bg-surface);
  border: 1px solid var(--border-default); border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: sheetUp 190ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.sheet-handle {
  width: 36px; height: 4px; border-radius: var(--radius-full);
  background: var(--border-strong); margin: 10px auto 4px;
}
.sheet-action {
  width: 100%; border: 0; background: transparent; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: inherit; font-size: var(--text-xs); color: var(--ink-primary);
  cursor: pointer; text-align: left; border-top: 1px solid var(--border-subtle);
  transition: background-color var(--transition-fast);
}
.sheet-action:hover { background: var(--bg-canvas); }
.sheet-action.is-danger { color: var(--danger); }

/* Full-Screen Blocking Loader */
.blocking-backdrop {
  position: fixed; inset: 0; background: rgba(17, 17, 16, 0.52);
  display: none; align-items: center; justify-content: center; z-index: 65;
}
.blocking-backdrop.is-open { display: flex; animation: fadeIn 140ms ease; }
.blocking-card {
  min-width: 280px; max-width: 340px; padding: 20px 22px;
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
}

/* Wizard Stepper Bar inside Modal */
.wiz-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 10px 20px; background: var(--bg-canvas); border-bottom: 1px solid var(--border-subtle);
}
.wiz-step {
  display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-muted); font-weight: 500;
}
.wiz-step.is-active { color: var(--ink-primary); font-weight: 600; }
.wiz-step.is-done { color: var(--success); }
.wiz-num {
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  border: 1px solid var(--border-strong); background: var(--bg-surface);
}
.wiz-step.is-active .wiz-num { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.wiz-step.is-done .wiz-num { background: var(--success); color: #fff; border-color: var(--success); }

/* Toast Action Button */
.toast-action {
  border: 1px solid rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.14);
  color: inherit; border-radius: var(--radius-xs); padding: 2px 7px;
  font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
}
.toast-action:hover { background: rgba(255, 255, 255, 0.24); }

.loading-host { position: relative; overflow: hidden; }
.loading-veil {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.78);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 5;
  font-size: var(--text-xs);
  color: var(--ink-secondary);
}
[data-theme="dark"] .loading-veil { background: rgba(25, 25, 23, 0.8); }
.loading-host.is-loading .loading-veil { display: flex; }

.skel-row {
  display: grid;
  grid-template-columns: 28px 1.2fr 70px 80px;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.skel-row:last-child { border-bottom: 0; }
.skel-circle { width: 26px; height: 26px; border-radius: 50%; }

.table-wrap {
  width: 100%;
  overflow: visible;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
}
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-xs); text-align: left; }
.data-table th {
  padding: 10px 16px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-default);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--ink-muted);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  transition: background-color var(--transition-fast);
}
.data-table.is-compact th { padding: 8px 14px; }
.data-table.is-compact td { padding: 8px 14px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--bg-canvas); }
.data-table tbody tr.is-selected td { background: var(--accent-subtle); }
.data-table tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.data-table tfoot td {
  padding: 11px 16px;
  background: var(--bg-canvas);
  border-top: 1px solid var(--border-default);
  font-size: var(--text-xs);
  color: var(--ink-secondary);
}
.data-table.is-compact tfoot td { padding: 8px 14px; }
.data-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}
.text-right { text-align: right; }

/* Ledger Cell Typography, Tinted Avatars, Method Pills & Action Tray */
.inv-link {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  transition: color var(--transition-fast);
}
.inv-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cell-customer-name {
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.3;
}
/* Subtle Modern iOS Avatars (No Heavy Aqua Gloss) */
.avatar.is-tbl {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: none;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 1.5px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
}
.select-user-row .avatar.is-tbl { border-radius: 50%; }
.avatar.tone-0 { background: linear-gradient(180deg, #f2fcf7 0%, #dcfce7 100%); color: #146c43; border: 1px solid rgba(22, 163, 74, 0.22); }
.avatar.tone-1 { background: linear-gradient(180deg, #f2f7ff 0%, #dbeafe 100%); color: #1d4ed8; border: 1px solid rgba(37, 99, 235, 0.22); }
.avatar.tone-2 { background: linear-gradient(180deg, #fffdf2 0%, #fef3c7 100%); color: #9a580b; border: 1px solid rgba(217, 119, 6, 0.24); }
.avatar.tone-3 { background: linear-gradient(180deg, #fff7f3 0%, #ffedd5 100%); color: #b84a27; border: 1px solid rgba(194, 65, 12, 0.22); }
.avatar.tone-4 { background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%); color: #334155; border: 1px solid rgba(100, 116, 139, 0.24); }

[data-theme="dark"] .avatar.is-tbl {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -1px 2px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .avatar.tone-0 { background: linear-gradient(180deg, rgba(22, 163, 74, 0.20) 0%, rgba(22, 163, 74, 0.09) 100%); color: #6ee7b7; border-color: rgba(110, 231, 183, 0.24); }
[data-theme="dark"] .avatar.tone-1 { background: linear-gradient(180deg, rgba(37, 99, 235, 0.20) 0%, rgba(37, 99, 235, 0.09) 100%); color: #93c5fd; border-color: rgba(147, 197, 253, 0.24); }
[data-theme="dark"] .avatar.tone-2 { background: linear-gradient(180deg, rgba(217, 119, 6, 0.20) 0%, rgba(217, 119, 6, 0.09) 100%); color: #fcd34d; border-color: rgba(252, 211, 77, 0.24); }
[data-theme="dark"] .avatar.tone-3 { background: linear-gradient(180deg, rgba(234, 88, 12, 0.20) 0%, rgba(234, 88, 12, 0.09) 100%); color: #fdba74; border-color: rgba(253, 186, 116, 0.24); }
[data-theme="dark"] .avatar.tone-4 { background: linear-gradient(180deg, rgba(148, 163, 184, 0.20) 0%, rgba(100, 116, 139, 0.09) 100%); color: #cbd5e1; border-color: rgba(203, 213, 225, 0.22); }

/* Modern iPhone / iOS Status Capsules (Subtle Frosted Pill + Micro-Circle Icon) */
.status-3d {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px 0 3px;
  border-radius: 9999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-shadow: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}
.status-3d-ic {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 1px 1.5px rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.status-3d-ic svg {
  width: 7.5px;
  height: 7.5px;
  stroke: currentColor;
  stroke-width: 2.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.data-table.is-compact .status-3d { height: 18.5px; padding: 0 6px 0 2.5px; gap: 3.5px; font-size: 10px; }
.data-table.is-compact .status-3d-ic { width: 11px; height: 11px; }
.data-table.is-compact .status-3d-ic svg { width: 7px; height: 7px; }
.status-3d.is-paid {
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.95) 0%, rgba(220, 252, 231, 0.72) 100%);
  color: #146c43;
  border: 1px solid rgba(22, 163, 74, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(22, 163, 74, 0.06);
}
.status-3d.is-paid .status-3d-ic { background: linear-gradient(180deg, #22c55e 0%, #15803d 100%); color: #ffffff; }
.status-3d.is-pending {
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.95) 0%, rgba(254, 243, 199, 0.72) 100%);
  color: #9a580b;
  border: 1px solid rgba(217, 119, 6, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(217, 119, 6, 0.06);
}
.status-3d.is-pending .status-3d-ic { background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%); color: #ffffff; }
.status-3d.is-failed {
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.95) 0%, rgba(254, 226, 226, 0.72) 100%);
  color: #991b1b;
  border: 1px solid rgba(220, 38, 38, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(220, 38, 38, 0.06);
}
.status-3d.is-failed .status-3d-ic { background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%); color: #ffffff; }

[data-theme="dark"] .status-3d.is-paid {
  background: rgba(22, 163, 74, 0.15);
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
[data-theme="dark"] .status-3d.is-pending {
  background: rgba(217, 119, 6, 0.15);
  color: #fcd34d;
  border-color: rgba(252, 211, 77, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
[data-theme="dark"] .status-3d.is-failed {
  background: rgba(220, 38, 38, 0.15);
  color: #fca5a5;
  border-color: rgba(252, 165, 165, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.method-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(241, 245, 249, 0.52) 100%);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1.5px 2px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.05);
  color: var(--ink-secondary);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
}
[data-theme="dark"] .method-pill {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.04) 100%);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1.5px 2px rgba(0, 0, 0, 0.35);
}
.method-pill .ic { width: 11px; height: 11px; color: var(--ink-muted); }

.amt-primary {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink-primary);
}
.amt-ccy {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-left: 4px;
}

/* iOS Liquid Glass Control Center Action Dock */
.row-action-tray {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2.5px 3px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0%, rgba(241, 245, 249, 0.38) 100%);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), inset 0 -1.5px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.data-table tbody tr:hover .row-action-tray {
  border-color: rgba(255, 255, 255, 0.95);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(241, 245, 249, 0.52) 100%);
}
.data-table tbody tr:hover td:last-child { position: relative; z-index: 10; }
[data-theme="dark"] .row-action-tray {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.04) 100%);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -1.5px 2px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .data-table tbody tr:hover .row-action-tray {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.06) 100%);
  border-color: rgba(255, 255, 255, 0.24);
}

.row-action-tray .btn {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 5.5px;
  transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1), background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.row-action-tray .btn svg.ic { width: 12px; height: 12px; stroke-width: 1.85; position: relative; z-index: 1; }
.row-action-tray .btn:hover { transform: translateY(-1px); z-index: 5; }
.data-table.is-compact .row-action-tray { padding: 2px; gap: 2px; border-radius: 7px; }
.data-table.is-compact .row-action-tray .btn { width: 20px; height: 20px; border-radius: 5px; }
.data-table.is-compact .row-action-tray .btn svg.ic { width: 11px; height: 11px; }

.row-action-tray .btn-ghost-info {
  color: #1d4ed8;
  background: linear-gradient(165deg, rgba(239, 246, 255, 0.88) 0%, rgba(191, 219, 254, 0.45) 100%);
  border: 1px solid rgba(147, 197, 253, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1.5px 2px rgba(29, 78, 216, 0.10);
}
.row-action-tray .btn-ghost-info:hover {
  color: #ffffff;
  background: linear-gradient(165deg, rgba(59, 130, 246, 0.92) 0%, rgba(29, 78, 216, 0.88) 100%);
  border-color: rgba(191, 219, 254, 0.8);
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, 0.65), inset 0 -2px 3px rgba(0, 0, 0, 0.22);
}

.row-action-tray .btn-ghost-warning {
  color: #b45309;
  background: linear-gradient(165deg, rgba(255, 251, 235, 0.92) 0%, rgba(253, 230, 138, 0.45) 100%);
  border: 1px solid rgba(252, 211, 77, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1.5px 2px rgba(180, 83, 9, 0.10);
}
.row-action-tray .btn-ghost-warning:hover {
  color: #ffffff;
  background: linear-gradient(165deg, rgba(245, 158, 11, 0.94) 0%, rgba(180, 83, 9, 0.88) 100%);
  border-color: rgba(253, 230, 138, 0.8);
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, 0.65), inset 0 -2px 3px rgba(0, 0, 0, 0.22);
}

.row-action-tray .btn-ghost {
  color: #334155;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.92) 0%, rgba(226, 232, 240, 0.52) 100%);
  border: 1px solid rgba(203, 213, 225, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1.5px 2px rgba(15, 23, 42, 0.08);
}
.row-action-tray .btn-ghost:hover {
  color: #ffffff;
  background: linear-gradient(165deg, rgba(51, 65, 85, 0.92) 0%, rgba(15, 23, 42, 0.88) 100%);
  border-color: rgba(203, 213, 225, 0.6);
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, 0.5), inset 0 -2px 3px rgba(0, 0, 0, 0.28);
}

.row-action-tray .btn-ghost-danger {
  color: #b91c1c;
  background: linear-gradient(165deg, rgba(254, 242, 242, 0.92) 0%, rgba(254, 202, 202, 0.45) 100%);
  border: 1px solid rgba(252, 165, 165, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1.5px 2px rgba(185, 28, 28, 0.10);
}
.row-action-tray .btn-ghost-danger:hover {
  color: #ffffff;
  background: linear-gradient(165deg, rgba(239, 68, 68, 0.94) 0%, rgba(185, 28, 28, 0.88) 100%);
  border-color: rgba(254, 202, 202, 0.8);
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, 0.65), inset 0 -2px 3px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .row-action-tray .btn-ghost-info {
  color: #93c5fd;
  background: linear-gradient(165deg, rgba(59, 130, 246, 0.22) 0%, rgba(29, 78, 216, 0.10) 100%);
  border-color: rgba(147, 197, 253, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1.5px 2px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .row-action-tray .btn-ghost-warning {
  color: #fcd34d;
  background: linear-gradient(165deg, rgba(245, 158, 11, 0.22) 0%, rgba(180, 83, 9, 0.10) 100%);
  border-color: rgba(252, 211, 77, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1.5px 2px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .row-action-tray .btn-ghost {
  color: #cbd5e1;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -1.5px 2px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .row-action-tray .btn-ghost-danger {
  color: #fca5a5;
  background: linear-gradient(165deg, rgba(239, 68, 68, 0.22) 0%, rgba(185, 28, 28, 0.10) 100%);
  border-color: rgba(252, 165, 165, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1.5px 2px rgba(0, 0, 0, 0.35);
}

.sub-row-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px;
}
.sub-meta-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}
.sub-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-2xs);
  color: var(--ink-muted);
}
.sub-meta-item strong,
.sub-meta-item code { color: var(--ink-primary); font-weight: 600; }

.table-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-xs);
  color: var(--ink-muted);
}
.tbl-footer-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tbl-rows-label { font-size: var(--text-2xs); color: var(--ink-muted); }
.page-btn {
  height: 28px;
  min-width: 28px;
  padding: 0 9px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}
.page-btn:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--ink-primary);
  border-color: var(--border-strong);
}
.page-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}
.page-btn:disabled { opacity: 0.42; cursor: not-allowed; }

@media (max-width: 960px) {
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .summary-cell { border-bottom: 1px solid var(--border-subtle); }
  .tbl-search-box { width: 100%; }
  .table-tabs-bar { padding: 0 14px; }
  .table-tabs-nav { gap: 14px; overflow-x: auto; max-width: 100%; }
}

/* ==========================================================================
   8. Tokens Swatches & Icon Library Grid
   ========================================================================== */
.swatch-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-2); }
.swatch {
  border: 1px solid var(--border-default); border-radius: var(--radius-sm); overflow: hidden;
  background: var(--bg-surface); cursor: pointer; padding: 0; text-align: left; font-family: inherit;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.swatch:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.swatch-color { height: 26px; border-bottom: 1px solid var(--border-subtle); }
.swatch-meta { padding: 5px 7px; }
.swatch-name { font-size: var(--text-2xs); font-weight: 600; color: var(--ink-primary); }
.swatch-var { font-family: var(--font-mono); font-size: 10px; color: var(--ink-muted); }

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 6px;
}
.icon-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 9px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  transition: border-color var(--transition-fast), color var(--transition-fast), background-color var(--transition-fast);
}
.icon-tile:hover { border-color: var(--accent-border); background: var(--accent-subtle); color: var(--accent); }
.icon-tile svg.ic { width: 16px; height: 16px; }

/* Proprietary Atelier Icon Engine (4 Signature Styles) */
svg.ic-atelier {
  flex-shrink: 0;
  overflow: visible;
  transition: transform var(--transition-fast);
}
svg.ic-atelier .ic-tone {
  fill: var(--accent);
  fill-opacity: 0.16;
  stroke: none;
  transition: fill-opacity var(--transition-fast), fill var(--transition-fast);
}
svg.ic-atelier .ic-stroke {
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
svg.ic-atelier .ic-dot {
  fill: var(--accent);
  stroke: none;
}

/* Style 1: Atelier Duotone (Default â€” Chamfered + Accent Plate + Anchor Dot) */
.icon-studio-stage.style-duotone svg.ic-atelier .ic-tone { fill: var(--accent); fill-opacity: 0.18; }
.icon-studio-stage.style-duotone svg.ic-atelier .ic-stroke { stroke-linecap: butt; stroke-linejoin: miter; }
.icon-studio-stage.style-duotone svg.ic-atelier .ic-dot { fill: var(--accent); }

/* Style 2: Draftsman Sharp (Blueprint Technical â€” Fine Razor Hairlines, No Fill) */
.icon-studio-stage.style-sharp svg.ic-atelier .ic-tone { fill-opacity: 0; stroke: var(--accent); stroke-opacity: 0.35; stroke-width: 0.85; stroke-dasharray: 2 1.5; }
.icon-studio-stage.style-sharp svg.ic-atelier .ic-stroke { stroke-linecap: square; stroke-linejoin: miter; }
.icon-studio-stage.style-sharp svg.ic-atelier .ic-dot { fill: var(--ink-primary); }

/* Style 3: Ink Solid (Editorial Cutout â€” High-Contrast Solid Core + Carved Surface) */
.icon-studio-stage.style-solid svg.ic-atelier .ic-tone { fill: currentColor; fill-opacity: 0.92; }
.icon-studio-stage.style-solid svg.ic-atelier .ic-stroke { stroke: currentColor; stroke-linecap: square; stroke-linejoin: miter; }
.icon-studio-stage.style-solid svg.ic-atelier .ic-dot { fill: var(--accent); }

/* Style 4: Mono Stencil (Crisp Minimal Outline + Signature Accent Node) */
.icon-studio-stage.style-stencil svg.ic-atelier .ic-tone { fill-opacity: 0; }
.icon-studio-stage.style-stencil svg.ic-atelier .ic-stroke { stroke-linecap: round; stroke-linejoin: round; }
.icon-studio-stage.style-stencil svg.ic-atelier .ic-dot { fill: var(--accent); }

.icon-tile {
  padding: 12px 6px 10px;
  gap: 8px;
  position: relative;
}
.icon-tile:hover svg.ic-atelier .ic-tone { fill-opacity: 0.28; }
.icon-tile-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}
.icon-tile:hover .icon-tile-del { opacity: 1; }
.icon-tile-del:hover { background: var(--danger-bg); color: var(--danger); }

/* Custom Icon Studio Workbench */
.icon-builder-grid {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.icon-canvas-box {
  background: var(--bg-canvas);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.icon-editor-svg {
  width: 240px;
  height: 240px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}
.icon-preview-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.icon-preview-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-muted);
}
@media (max-width: 900px) {
  .icon-builder-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   9. States, Modal, Command Palette, Record Popup & Toast
   ========================================================================== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--bg-muted) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-xs);
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.state-box {
  padding: var(--space-4); text-align: center;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--bg-surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.state-box.is-error { border-style: solid; border-color: var(--danger-border); background: var(--danger-bg); }
.state-title { margin: 0; font-size: var(--text-xs); font-weight: 600; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(17, 17, 16, 0.45);
  display: none; align-items: center; justify-content: center; padding: var(--space-4); z-index: 50;
}
.modal-backdrop.is-open { display: flex; animation: fadeIn 140ms ease; }

.modal-dialog {
  width: 100%; max-width: 390px; background: var(--bg-surface);
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: popIn 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-dialog.modal-lg {
  max-width: 680px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}
.modal-body-lg {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-body-lg > * { flex-shrink: 0; }
.modal-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Command Palette */
.cmd-dialog {
  width: 100%; max-width: 480px; background: var(--bg-surface);
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden; align-self: flex-start; margin-top: 10vh;
  animation: popIn 170ms cubic-bezier(0.16, 1, 0.3, 1);
}
.cmd-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--border-subtle);
}
.cmd-head input {
  flex: 1; border: 0; background: transparent; color: var(--ink-primary);
  font-family: inherit; font-size: var(--text-sm); outline: none;
}
.cmd-list { padding: 6px; max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.cmd-item {
  width: 100%; border: 0; background: transparent; padding: 7px 9px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: space-between;
  font-family: inherit; font-size: var(--text-xs); color: var(--ink-primary); cursor: pointer;
}
.cmd-item:hover { background: var(--accent-subtle); color: var(--accent); }
.cmd-item.is-hidden { display: none; }

/* Record Dialog (formerly slide-over drawer) â€” centered popup, uniform with .modal-dialog */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(17, 17, 16, 0.45);
  display: none; align-items: center; justify-content: center; padding: var(--space-4); z-index: 50;
}
.drawer-backdrop.is-open { display: flex; animation: fadeIn 140ms ease; }
.drawer-panel {
  width: 100%; max-width: 520px; max-height: calc(100vh - 48px);
  background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
  animation: popIn 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.drawer-body { flex: 1; padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-3); }

/* Toast */
.toast-stack { position: fixed; right: var(--space-4); bottom: var(--space-4); display: flex; flex-direction: column; gap: 6px; z-index: 60; }
.toast {
  min-width: 220px; max-width: 320px; background: var(--ink-primary); color: var(--ink-inverse);
  padding: 7px 11px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  font-size: var(--text-xs); display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  animation: toastIn 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.sidebar-backdrop { display: none; }
.mobile-only { display: none; }

@media (max-width: 960px) {
  .mobile-only { display: inline-flex; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100dvh;
    width: 264px;
    min-width: 264px;
    max-width: 84vw;
    margin-left: 0 !important;
    z-index: 75;
    background: #ffffff;
    border-right: 1px solid var(--border-strong);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.24);
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
  [data-theme="dark"] .sidebar {
    background: #171a1e;
    border-right-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.68);
  }
  .app-shell.is-sidebar-hidden .sidebar {
    margin-left: 0 !important;
    transform: translateX(-105%);
    opacity: 0;
    pointer-events: none;
    box-shadow: none;
  }
  .app-shell:not(.is-sidebar-hidden) .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 180ms ease;
  }
  .swatch-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .vtabs { grid-template-columns: 1fr; }
  .vtabs-list {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
    padding-right: 0;
    padding-bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .nav-sublist { transition: none; }
}


/* ==========================================================================
   10. v3.0 Comprehensive Component Additions
   ========================================================================== */

/* Elevation & Radius Specimens */
.specimen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--space-3);
}
.specimen-box {
  height: 54px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: var(--text-2xs);
  color: var(--ink-secondary);
}

/* Toggle Toolbar Buttons (Pressed State) */
.btn-toggle.is-pressed {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent);
}
.btn-link {
  background: transparent;
  color: var(--accent);
  padding: 0 4px;
  height: auto;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-link:hover { color: var(--accent-hover); }
.btn-block { width: 100%; }

/* Counter Pill */
.counter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--accent-fg);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}
.counter-pill.is-danger { background: var(--danger); color: #fff; }

/* Mini Bar Chart (Pure CSS/SVG) */
.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 92px;
  padding-top: 14px;
}
.mini-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.mini-bar {
  width: 100%;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-radius: 3px 3px 0 0;
  transition: background-color var(--transition-fast), height 240ms ease;
  position: relative;
}
.mini-bar:hover, .mini-bar.is-peak {
  background: var(--accent);
  border-color: var(--accent);
}
.mini-bar-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-muted);
}

/* Circular Progress Ring */
.ring-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ring-svg { width: 40px; height: 40px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg-subtle); stroke-width: 4; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.ring-fg.is-warn { stroke: var(--warning); }
.ring-fg.is-danger { stroke: var(--danger); }

/* Key-Value Metadata List */
.kv-list {
  display: flex;
  flex-direction: column;
}
.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
}
.kv-row:last-child { border-bottom: 0; }
.kv-key { color: var(--ink-muted); }
.kv-val { color: var(--ink-primary); font-weight: 500; }

/* Activity Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  padding-left: 16px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border-default);
}
.tl-item {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--text-xs);
}
.tl-dot {
  position: absolute;
  left: -15px;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--bg-surface);
}
.tl-dot.is-muted { background: var(--border-strong); }
.tl-time { font-family: var(--font-mono); font-size: 10px; color: var(--ink-muted); flex-shrink: 0; }

/* Password Input, Valid/Warn States, Textarea & OTP */
.input-icon-right { position: relative; display: flex; align-items: center; }
.input-icon-right .input { padding-right: 30px; }
.input-action-btn {
  position: absolute;
  right: 4px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-xs);
  display: grid;
  place-items: center;
}
.input-action-btn:hover { color: var(--ink-primary); background: var(--bg-subtle); }

.input.is-valid { border-color: var(--success); }
.field-valid-msg { font-size: var(--text-2xs); color: var(--success); }

.textarea {
  width: 100%;
  min-height: 62px;
  background: var(--bg-surface);
  color: var(--ink-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  padding: 6px 9px;
  resize: vertical;
}
.textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2.5px var(--accent-subtle); }

.otp-group { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.otp-sep { color: var(--ink-muted); font-family: var(--font-mono); font-weight: 600; padding: 0 2px; user-select: none; }
.otp-box {
  width: 44px;
  height: 48px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--ink-primary);
  caret-color: var(--accent);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}
.otp-box:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2.5px var(--accent-subtle); }
.otp-box.is-filled { border-color: var(--border-strong); background: var(--bg-surface); }
.otp-box.is-verified { border-color: var(--success); background: var(--success-bg); color: var(--success); }

/* Radio Cards */
.radio-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.radio-card {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--bg-surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.radio-card:hover { border-color: var(--border-strong); }
.radio-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

/* ==========================================================================
   Page 04 Extended: Forms, Searchable Select & Upload Suite
   ========================================================================== */
.input-clear-btn {
  position: absolute;
  right: 6px;
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  border-radius: var(--radius-xs);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 11px;
}
.input-clear-btn:hover { background: var(--bg-subtle); color: var(--ink-primary); }

/* Password Strength Meter */
.pwd-strength { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; }
.pwd-strength-bars { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pwd-bar { height: 4px; border-radius: var(--radius-full); background: var(--border-default); transition: background-color var(--transition-fast); }
.pwd-bar.is-weak { background: var(--danger); }
.pwd-bar.is-fair { background: var(--warning); }
.pwd-bar.is-good { background: var(--info); }
.pwd-bar.is-strong { background: var(--success); }
.pwd-strength-lbl { font-size: 10px; font-weight: 600; font-family: var(--font-mono); color: var(--ink-muted); min-width: 48px; text-align: right; }

/* Numeric Stepper (full-width, aligned with other controls) */
.stepper-group {
  display: flex;
  width: 100%;
  align-items: stretch;
  height: var(--control-h);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  overflow: hidden;
}
.stepper-btn {
  width: 34px;
  flex-shrink: 0;
  border: 0;
  background: var(--bg-canvas);
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.stepper-btn:hover:not(:disabled) { background: var(--bg-subtle); color: var(--ink-primary); }
.stepper-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.stepper-val {
  flex: 1;
  min-width: 44px;
  padding: 0 8px;
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-primary);
}

/* Brand Color Swatches & Rating Stars */
.color-picker-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; height: var(--control-h); }
.color-swatch-btn {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 0 1px var(--border-default);
  cursor: pointer;
  padding: 0;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.color-swatch-btn:hover { transform: scale(1.08); }
.color-swatch-btn.is-active { box-shadow: 0 0 0 2px var(--ink-primary); transform: scale(1.08); }
.color-native {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  padding: 0;
  border: 2px solid var(--bg-surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--border-default);
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
  margin-left: 4px;
  position: relative;
}
.color-native::-webkit-color-swatch-wrapper { padding: 0; }
.color-native::-webkit-color-swatch { border: 0; border-radius: 50%; }
.color-native::-moz-color-swatch { border: 0; border-radius: 50%; }

/* Button attached to the end of an input group (same height as input) */
.input-group > .input-group-btn {
  height: var(--control-h);
  padding: 0 12px;
  flex-shrink: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1px;
}
.input-group > .select { flex-shrink: 0; }

.star-rating { display: inline-flex; align-items: center; gap: 2px; }
.star-btn {
  border: 0;
  background: transparent;
  padding: 2px;
  cursor: pointer;
  color: var(--border-strong);
  display: grid;
  place-items: center;
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.star-btn:hover { transform: scale(1.1); }
.star-btn.is-filled { color: #d99b30; }

/* Date Range Preset Pills */
.preset-pills { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.preset-pill {
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: var(--bg-canvas);
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}
.preset-pill:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }

/* Searchable Select & Combobox Suite */
.select-combo .dropdown-list { max-height: 235px; overflow-y: auto; }
.select-trigger.is-multi {
  min-height: var(--control-h);
  height: auto;
  padding: 4px 8px;
  align-items: center;
}
.select-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.select-placeholder { color: var(--ink-muted); font-size: var(--text-xs); }
.select-clear-btn {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  line-height: 1;
}
.select-clear-btn:hover { background: var(--bg-subtle); color: var(--danger); }
.select-group-hdr {
  padding: 6px 10px 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}
.select-footer-bar {
  padding: 6px 10px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.select-user-row { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.select-user-meta { display: flex; flex-direction: column; text-align: left; min-width: 0; }
.select-user-name { font-size: var(--text-xs); font-weight: 600; color: var(--ink-primary); line-height: 1.25; }
.select-user-role { font-size: 10px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.latency-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--ink-muted);
}
.select-creatable-btn {
  width: 100%;
  border: 1px dashed var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.select-creatable-btn:hover { filter: brightness(0.97); }

/* Complete File Upload Suite */
.upload-zone-lg {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.upload-zone-lg:hover, .upload-zone-lg.is-drag {
  border-color: var(--accent);
  background: var(--accent-subtle);
}
.upload-zone-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--accent);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-xs);
}
.upload-zone-title { font-size: var(--text-xs); font-weight: 600; color: var(--ink-primary); }
.upload-zone-sub { font-size: 11px; color: var(--ink-muted); }

.upload-queue { display: flex; flex-direction: column; gap: 8px; }
.upload-item {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.upload-item.is-error { border-color: rgba(214, 69, 69, 0.45); background: rgba(214, 69, 69, 0.04); }
.upload-ext {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  border: 1px solid var(--border-default);
}
.upload-ext.ext-pdf { background: #fdf0eb; color: #b84a27; border-color: #f0c2b2; }
.upload-ext.ext-csv { background: #e8f3ee; color: #165e45; border-color: #c7e2d5; }
.upload-ext.ext-png, .upload-ext.ext-jpg, .upload-ext.ext-svg { background: #e8f1fa; color: #1d4e89; border-color: #c5dcf4; }
.upload-ext.ext-json { background: #f8f0df; color: #8c5a14; border-color: #ebd7b0; }
[data-theme="dark"] .upload-ext.ext-pdf { background: rgba(224, 109, 72, 0.14); color: #e06d48; border-color: rgba(224, 109, 72, 0.28); }
[data-theme="dark"] .upload-ext.ext-csv { background: rgba(45, 164, 114, 0.16); color: #67cfa0; border-color: rgba(45, 164, 114, 0.28); }
[data-theme="dark"] .upload-ext.ext-png,
[data-theme="dark"] .upload-ext.ext-jpg,
[data-theme="dark"] .upload-ext.ext-svg { background: rgba(74, 144, 226, 0.16); color: #7bb4f2; border-color: rgba(74, 144, 226, 0.28); }
[data-theme="dark"] .upload-ext.ext-json { background: rgba(217, 155, 48, 0.16); color: #e8be68; border-color: rgba(217, 155, 48, 0.28); }

.upload-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.upload-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.upload-name { font-size: var(--text-xs); font-weight: 600; color: var(--ink-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-size { font-family: var(--font-mono); font-size: 10px; color: var(--ink-muted); flex-shrink: 0; }
.upload-prog-track { width: 100%; height: 5px; border-radius: var(--radius-full); background: var(--bg-subtle); overflow: hidden; }
.upload-prog-fill { height: 100%; border-radius: var(--radius-full); transition: width 180ms ease; }
.upload-prog-fill.is-uploading { background: var(--accent); }
.upload-prog-fill.is-done { background: var(--success); }
.upload-prog-fill.is-error { background: var(--danger); }
.upload-err-msg { font-size: 10px; color: var(--danger); font-weight: 500; }
.upload-actions { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* Avatar Uploader & Document Slots */
.avatar-upload-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
}
.avatar-preview-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-preview-ring img { width: 100%; height: 100%; object-fit: cover; }

.doc-slot-list { display: flex; flex-direction: column; gap: 10px; }
.doc-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-canvas);
}
.doc-slot.is-attached {
  border-style: solid;
  border-color: var(--success-border);
  background: var(--success-bg);
}
.doc-slot-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.doc-slot-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--ink-secondary);
}
.doc-slot.is-attached .doc-slot-icon {
  background: var(--bg-surface);
  border-color: var(--success-border);
  color: var(--success);
}
.doc-slot-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.doc-slot-file { font-family: var(--font-mono); font-size: 10.5px; color: var(--success); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Elevate open dropdown / combobox / popover / mega-menu / flyout above all sibling rows & glass panels */
.kit-page.is-active > *:has(.dropdown.is-open, .hnav-item.is-open, .mega-wrap.is-open, .popover-wrap.is-open, .flyout-wrap:hover, .flyout-wrap.is-open),
.hnav:has(.hnav-item.is-open, .dropdown.is-open),
.grid-2:has(.dropdown.is-open, .hnav-item.is-open, .mega-wrap.is-open, .popover-wrap.is-open, .flyout-wrap:hover, .flyout-wrap.is-open),
.grid-3:has(.dropdown.is-open, .hnav-item.is-open, .mega-wrap.is-open, .popover-wrap.is-open, .flyout-wrap:hover, .flyout-wrap.is-open),
.grid-4:has(.dropdown.is-open, .hnav-item.is-open, .mega-wrap.is-open, .popover-wrap.is-open, .flyout-wrap:hover, .flyout-wrap.is-open),
.stack-col:has(.dropdown.is-open, .hnav-item.is-open, .mega-wrap.is-open, .popover-wrap.is-open, .flyout-wrap:hover, .flyout-wrap.is-open),
.stack-row:has(.dropdown.is-open, .hnav-item.is-open, .mega-wrap.is-open, .popover-wrap.is-open, .flyout-wrap:hover, .flyout-wrap.is-open),
.canvas-studio:has(.dropdown.is-open),
.form-canvas-board:has(.dropdown.is-open),
.form-canvas-sheet:has(.dropdown.is-open) {
  position: relative;
  z-index: 45;
}
.panel:has(.dropdown.is-open, .hnav-item.is-open, .mega-wrap.is-open, .popover-wrap.is-open, .flyout-wrap:hover, .flyout-wrap.is-open),
.card:has(.dropdown.is-open, .popover-wrap.is-open),
.wf-card:has(.dropdown.is-open, .popover-wrap.is-open),
.table-wrap:has(.dropdown.is-open),
.table-toolbar:has(.dropdown.is-open),
.page-header:has(.dropdown.is-open, .popover-wrap.is-open),
.action-row:has(.dropdown.is-open, .popover-wrap.is-open),
.field:has(.dropdown.is-open),
.input-group:has(.dropdown.is-open),
.canvas-field:has(.dropdown.is-open) {
  position: relative;
  z-index: 46;
  overflow: visible;
}
.dropdown.is-open,
.hnav-item.is-open,
.mega-wrap.is-open,
.popover-wrap.is-open {
  position: relative;
  z-index: 50;
}
.dropdown-menu,
.mega-panel,
.popover-card,
.flyout-sub { z-index: 65; }

/* Complete Form Pattern & Validation Banner */
.form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 4px 0 2px;
}
.form-section-title::after { content: ""; flex: 1; height: 1px; background: var(--border-subtle); }
.form-val-banner {
  padding: 10px 12px;
  border: 1px solid rgba(214, 69, 69, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(214, 69, 69, 0.07);
  color: var(--danger);
  font-size: var(--text-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.form-footer-bar {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Right-Click Context Zone & Floating Context Menu */
.ctx-zone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  padding: 16px;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--ink-muted);
  user-select: none;
  cursor: context-menu;
}
.ctx-menu {
  position: fixed;
  min-width: 175px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  display: none;
  z-index: 80;
  animation: dropIn 100ms ease;
}
.ctx-menu.is-open { display: block; }

/* Vertical Tabs */
.vtabs { display: grid; grid-template-columns: 124px 1fr; gap: var(--space-3); }
.vtabs-list { display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--border-subtle); padding-right: 8px; }
.vtab-btn {
  border: 0; background: transparent; padding: 6px 8px; border-radius: var(--radius-sm);
  text-align: left; font-family: inherit; font-size: var(--text-xs); color: var(--ink-secondary); cursor: pointer;
}
.vtab-btn:hover { background: var(--bg-subtle); color: var(--ink-primary); }
.vtab-btn.is-active { background: var(--accent-subtle); color: var(--accent); font-weight: 600; }

/* Expandable Table Sub-Row */
.row-expand-btn {
  border: 0; background: transparent; color: var(--ink-muted);
  cursor: pointer; padding: 2px; display: inline-grid; place-items: center;
  transition: transform var(--transition-fast);
}
.row-expand-btn.is-open { transform: rotate(90deg); color: var(--accent); }
.sub-row td {
  background: var(--bg-canvas);
  padding: 8px var(--space-4);
  font-size: var(--text-2xs);
  color: var(--ink-secondary);
}
.col-hidden { display: none; }

/* Pulsing Status Indicator */
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success);
  position: relative; display: inline-block;
}
.pulse-dot::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 1.5px solid var(--success); opacity: 0.5;
  animation: pulseRing 1.6s ease-out infinite;
}
.pulse-dot.is-warn, .pulse-dot.is-warn::after { background: var(--warning); border-color: var(--warning); }
@keyframes pulseRing {
  0% { transform: scale(0.8); opacity: 0.7; }
  100% { transform: scale(1.9); opacity: 0; }
}


/* ==========================================================================
   11. Page 09 â€” Crisp Solid Studio Workbench (Workflows, Pay, Files, E-Sign)
   ========================================================================== */
.wf-split-top {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: var(--space-4);
  align-items: stretch;
}
.wf-split-bottom {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: var(--space-4);
  align-items: stretch;
}
.wf-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wf-zone { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.wf-divider { height: 1px; background: var(--border-default); }

/* Dark High-Contrast PDF Toolbar */
.pdf-bar {
  padding: 10px 14px;
  background: var(--ink-primary);
  color: var(--ink-inverse);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
[data-theme="dark"] .pdf-bar {
  background: #0d0d0c;
  color: var(--ink-primary);
  border-bottom: 1px solid var(--border-default);
}
.pdf-btn {
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background-color var(--transition-fast);
}
.pdf-btn:hover { background: rgba(255, 255, 255, 0.18); }
.pdf-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

/* Full-Bleed Solid Contract Sheet (No nested stage) */
.doc-paper {
  position: relative;
  padding: 24px 28px;
  background: var(--bg-surface);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 150ms ease;
  transform-origin: top center;
}
.doc-head {
  padding-top: 10px;
  border-top: 2px solid var(--ink-primary);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.doc-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
}
.doc-meta-cell {
  padding: 8px 10px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.doc-meta-cell:last-child { border-right: 0; }
.doc-meta-lbl { font-size: 10px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.doc-meta-val { font-size: 11px; font-weight: 600; color: var(--ink-primary); }

.doc-highlight {
  background: var(--warning-bg);
  border-bottom: 1.5px solid var(--warning);
  padding: 0 2px;
}

/* 100% Opaque Solid Double-Bordered Stamp */
.doc-stamp {
  position: absolute;
  top: 24px;
  right: 132px;
  padding: 3px 10px;
  background: var(--bg-surface);
  border: 2px solid var(--success);
  box-shadow: inset 0 0 0 1px var(--success);
  border-radius: var(--radius-xs);
  color: var(--success);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(-6deg);
  opacity: 1;
  pointer-events: none;
  display: none;
}
.doc-stamp.is-visible { display: inline-block; animation: stampDrop 160ms cubic-bezier(0.2, 0, 0, 1); }
.doc-stamp.is-paid { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.doc-stamp.is-conf { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); color: var(--danger); }

@keyframes stampDrop {
  from { opacity: 0; transform: scale(1.28) rotate(-10deg); }
  to { opacity: 1; transform: scale(1) rotate(-6deg); }
}

/* Solid E-Signature Surface & Vertical Approval List */
.sig-surface {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  position: relative;
  overflow: hidden;
}
.sig-surface:hover { border-color: var(--border-strong); }
.sig-canvas {
  display: block;
  width: 100%;
  height: 100px;
  cursor: crosshair;
  touch-action: none;
}
.sig-baseline {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 20px;
  border-bottom: 1px solid var(--border-default);
  pointer-events: none;
}
.sig-x {
  position: absolute;
  left: 14px;
  bottom: 23px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-muted);
  pointer-events: none;
}
.sig-preview-img { max-height: 36px; display: block; }
.sig-typed {
  font-family: "Georgia", serif;
  font-style: italic;
  font-size: 18px;
  color: var(--ink-primary);
  line-height: 1.1;
}

.appr-list { display: flex; flex-direction: column; }
.appr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.appr-row:last-child { border-bottom: 0; }
.appr-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  border: 1.5px solid var(--border-strong);
  color: var(--ink-muted);
  background: var(--bg-surface);
}
.appr-dot.is-approved { background: var(--success); border-color: var(--success); color: #ffffff; }
.appr-dot.is-current { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.appr-dot.is-rejected { background: var(--danger); border-color: var(--danger); color: #ffffff; }

/* Stripe-Style Payment Checkout */
.pay-methods {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.pay-method-btn {
  padding: 8px 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.pay-method-btn:hover { border-color: var(--border-strong); color: var(--ink-primary); }
.pay-method-btn.is-active {
  border-color: var(--ink-primary);
  box-shadow: inset 0 0 0 1px var(--ink-primary);
  color: var(--ink-primary);
  font-weight: 600;
}

/* Crisp Solid File Vault */
.file-row {
  display: grid;
  grid-template-columns: 38px 1fr 76px 96px auto;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  transition: background-color var(--transition-fast);
}
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: var(--bg-canvas); }
.file-tag {
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  color: #ffffff;
  background: var(--ink-secondary);
}
.file-tag.is-pdf { background: #b91c1c; }
.file-tag.is-xls { background: #15803d; }
.file-tag.is-zip { background: #1f1f1d; }
.file-tag.is-dir { background: var(--accent); color: var(--accent-fg); }

@media (max-width: 1024px) {
  .wf-split-top, .wf-split-bottom { grid-template-columns: 1fr; }
  .doc-meta-grid { grid-template-columns: repeat(2, 1fr); }
  .file-row { grid-template-columns: 38px 1fr auto; }
  .file-row .file-hide-sm { display: none; }
}

/* ==========================================================================
   11. Formula Studio (fx) & Visual Canvas Form Builder (Page 10)
   ========================================================================== */
.fx-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}
.fx-bar:focus-within {
  border-color: var(--accent);
  background: var(--bg-surface);
  box-shadow: 0 0 0 2.5px var(--accent-subtle);
}
.fx-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  padding: 3px 7px;
  border-radius: var(--radius-xs);
  background: var(--accent);
  color: var(--accent-fg);
  flex-shrink: 0;
}
.fx-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink-primary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  outline: none;
}
.fx-result-pill {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.fx-result-pill.is-error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

.fx-tokens-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-sm);
  min-height: 36px;
}
.fx-tok {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
}
.fx-tok.is-var { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.fx-tok.is-fn { background: var(--accent-subtle); color: var(--accent); border: 1px solid var(--accent-border); font-weight: 600; }
.fx-tok.is-op { background: var(--bg-subtle); color: var(--ink-primary); font-weight: 600; }
.fx-tok.is-num { background: var(--warning-bg); color: var(--warning); }

.fx-var-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

/* 3-Column Visual Canvas Form Builder */
.canvas-studio {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr) 256px;
  gap: 12px;
  align-items: start;
}
.palette-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.palette-btn {
  width: 100%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-primary);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.palette-btn:hover {
  border-color: var(--accent-border);
  background: var(--accent-subtle);
  color: var(--accent);
}

.form-canvas-board {
  background: var(--bg-canvas);
  background-image: radial-gradient(var(--bg-canvas-dot) 1px, transparent 1px);
  background-size: 16px 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px;
  min-height: 380px;
}
.form-canvas-sheet {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.canvas-field {
  grid-column: span 2;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.canvas-field.is-half { grid-column: span 1; }
.canvas-field:hover { border-color: var(--border-strong); }
.canvas-field.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}
.canvas-field.is-preview {
  cursor: default;
  border-color: transparent;
  padding: 4px 2px;
}
.canvas-field.is-preview:hover { border-color: transparent; }

.canvas-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.canvas-field-head > .stack-row {
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}
.canvas-field-head > .stack-row > .mono {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.canvas-field-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.logic-rule-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
}
.logic-clause {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.schema-pre {
  margin: 0;
  padding: 12px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-secondary);
  max-height: 220px;
  overflow: auto;
  white-space: pre;
}

@media (max-width: 1120px) {
  .canvas-studio { grid-template-columns: 1fr; }
  .fx-var-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   12. Full-Page Auth/Login Studio (Page 11) & Error Pages (Page 12)
   ========================================================================== */
.tpl-stage {
  background: var(--bg-canvas);
  background-image: radial-gradient(var(--bg-canvas-dot) 1px, transparent 1px);
  background-size: 16px 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  min-height: 540px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.tpl-stage.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 58;
  border: 0;
  border-radius: 0;
  padding: 32px;
  overflow-y: auto;
}
.tpl-stage.is-flush { padding: 0; align-items: stretch; }
.tpl-fs-exit {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 62;
  box-shadow: var(--shadow-lg);
}

/* Auth Layout (Centered Single Card) */
.auth-card {
  width: 100%;
  max-width: 410px;
  padding: 28px 30px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: auto;
}
[data-theme="dark"] .auth-card {
  background: #191d23;
  border-color: #323842;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 32px rgba(0, 0, 0, 0.45);
}
@media (max-width: 640px) {
  .auth-card {
    padding: 20px 18px;
  }
}
.btn-entra {
  background: #0067b8;
  color: #ffffff;
  border-color: #0067b8;
  box-shadow: var(--inset-highlight), var(--shadow-xs);
}
.btn-entra:hover { background: #00559b; border-color: #00559b; }
.entra-error-box {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: var(--text-xs);
  line-height: 1.45;
}

/* Full Error Pages Studio */
.err-page-card {
  width: 100%;
  max-width: 600px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.err-page-top {
  padding: 28px 30px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.err-big-code {
  font-family: var(--font-mono);
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink-primary);
}
.err-big-code.is-danger { color: var(--danger); }
.err-big-code.is-warning { color: var(--warning); }
.err-big-code.is-accent { color: var(--accent); }
.err-diag-box {
  padding: 12px 14px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--text-xs);
}
.err-page-foot {
  padding: 12px 30px;
  background: var(--bg-canvas);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--ink-muted);
}

@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand-pane { padding: 22px; }
  .auth-form-pane { padding: 22px; }
}

/* ==========================================================================
   13. Charts & Analytics Studio (Page 13)
   ========================================================================== */
.chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.chart-grid-line { stroke: var(--border-subtle); stroke-width: 1; }
.chart-axis-lbl {
  font-family: var(--font-mono);
  font-size: 9.5px;
  fill: var(--ink-muted);
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.legend-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  border-radius: var(--radius-xs);
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 11px;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: opacity var(--transition-fast), border-color var(--transition-fast);
}
.legend-btn.is-off { opacity: 0.42; text-decoration: line-through; }
.legend-swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

.chart-readout {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-secondary);
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 3px 8px;
}

/* Pie & Donut Layout */
.pie-layout {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.pie-slice {
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease;
  transform-origin: 90px 90px;
}
.pie-slice.is-active { transform: scale(1.04); }
.pie-legend-list { display: flex; flex-direction: column; gap: 6px; }
.pie-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.pie-legend-row:hover, .pie-legend-row.is-active {
  border-color: var(--accent-border);
  background: var(--accent-subtle);
}

/* Horizontal Ranking Bars */
.hbar-list { display: flex; flex-direction: column; gap: 10px; }
.hbar-item { display: flex; flex-direction: column; gap: 4px; }
.hbar-track {
  width: 100%; height: 9px; border-radius: var(--radius-xs);
  background: var(--bg-subtle); overflow: hidden;
}
.hbar-fill {
  height: 100%; border-radius: var(--radius-xs);
  background: var(--accent);
  transition: width 240ms ease;
}

/* Conversion Funnel */
.funnel-list { display: flex; flex-direction: column; gap: 8px; }
.funnel-row {
  display: grid;
  grid-template-columns: 132px 1fr 78px;
  align-items: center;
  gap: 10px;
  font-size: var(--text-xs);
}
.funnel-bar-wrap {
  height: 22px; background: var(--bg-canvas); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs); overflow: hidden; display: flex; align-items: center;
}
.funnel-bar {
  height: 100%; background: var(--accent); color: var(--accent-fg);
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  display: flex; align-items: center; padding-left: 8px;
  transition: width 240ms ease;
}

/* Activity Heatmap Grid (12 weeks x 7 days) */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 3px;
}
.hm-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--bg-subtle);
  cursor: default;
}
.hm-cell.lv-1 { background: var(--accent-subtle); }
.hm-cell.lv-2 { background: var(--accent-border); }
.hm-cell.lv-3 { background: var(--accent); opacity: 0.72; }
.hm-cell.lv-4 { background: var(--accent); }

@media (max-width: 900px) {
  .pie-layout { grid-template-columns: 1fr; justify-items: center; }
  .pie-legend-list { width: 100%; }
}

/* ==========================================================================
   iOS Liquid Glass Surfaces (Zero Drop Shadows + Cohesive Frosted Backdrop)
   ========================================================================== */
body {
  background-color: #e4e7eb;
  background-image:
    radial-gradient(900px 580px at 8% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 65%),
    radial-gradient(760px 520px at 94% 92%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 65%),
    linear-gradient(155deg, #eef1f5 0%, #dfe4ea 52%, #e8ecef 100%);
  background-size: 100% 100%;
  background-attachment: fixed;
}
[data-theme="dark"] body {
  background-color: #0b0d0e;
  background-image:
    radial-gradient(900px 580px at 8% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 65%),
    radial-gradient(760px 520px at 94% 92%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 65%),
    linear-gradient(155deg, #101315 0%, #090b0c 55%, #0e1113 100%);
}

.sidebar,
.topbar {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-color: var(--glass-border-outer);
  box-shadow: var(--glass-specular);
}

.panel,
.kpi-card,
.table-wrap,
.summary-strip,
.auth-card,
.err-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border-color: var(--glass-border-outer);
  border-radius: 12px;
  box-shadow: var(--glass-specular);
}

.panel-header,
.table-tabs-bar,
.table-footer,
.data-table th {
  background: rgba(255, 255, 255, 0.35);
}
.panel-header,
.table-tabs-bar {
  border-top-left-radius: 11px;
  border-top-right-radius: 11px;
}
.panel-footer,
.table-footer {
  border-bottom-left-radius: 11px;
  border-bottom-right-radius: 11px;
}
[data-theme="dark"] .panel-header,
[data-theme="dark"] .table-tabs-bar,
[data-theme="dark"] .table-footer,
[data-theme="dark"] .data-table th {
  background: rgba(255, 255, 255, 0.03);
}

.dropdown-menu,
.popover-card,
.ctx-menu {
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid #cfd6df;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 #ffffff, 0 12px 28px rgba(15, 23, 42, 0.14);
}
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .popover-card,
[data-theme="dark"] .ctx-menu {
  background: #1e2227;
  border-color: #343940;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 32px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   Solid 3D Adaptive Pop-ups & Form Controls (Light & Dark Mode)
   ========================================================================== */
.modal-dialog,
.cmd-dialog,
.drawer-panel,
.sheet-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f4f6f9 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid #cfd6df;
  border-radius: 14px;
  box-shadow: inset 0 2px 0 #ffffff, inset 0 -3px 5px rgba(15, 23, 42, 0.07), 0 14px 32px rgba(15, 23, 42, 0.14);
}
[data-theme="dark"] .modal-dialog,
[data-theme="dark"] .cmd-dialog,
[data-theme="dark"] .drawer-panel,
[data-theme="dark"] .sheet-panel {
  background: linear-gradient(180deg, #22262b 0%, #171a1e 100%);
  border-color: #343940;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.10), inset 0 -3px 5px rgba(0, 0, 0, 0.55), 0 16px 36px rgba(0, 0, 0, 0.55);
}

.modal-dialog .panel-header,
.drawer-panel .panel-header,
.sheet-panel .panel-header {
  background: linear-gradient(180deg, #ffffff 0%, #eff2f6 100%);
  border-bottom: 1px solid #dde2e9;
  border-top-left-radius: 13px;
  border-top-right-radius: 13px;
}
.modal-dialog .panel-footer,
.drawer-panel .panel-footer,
.sheet-panel .panel-footer {
  background: linear-gradient(180deg, #eef1f5 0%, #e6ebf1 100%);
  border-top: 1px solid #d8dee6;
  box-shadow: inset 0 1px 0 #ffffff;
  border-bottom-left-radius: 13px;
  border-bottom-right-radius: 13px;
}
.sheet-panel,
.sheet-panel .panel-footer {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
[data-theme="dark"] .modal-dialog .panel-header,
[data-theme="dark"] .drawer-panel .panel-header,
[data-theme="dark"] .sheet-panel .panel-header {
  background: linear-gradient(180deg, #272c32 0%, #1e2227 100%);
  border-bottom-color: #30363d;
}
[data-theme="dark"] .modal-dialog .panel-footer,
[data-theme="dark"] .drawer-panel .panel-footer,
[data-theme="dark"] .sheet-panel .panel-footer {
  background: linear-gradient(180deg, #181b1f 0%, #131619 100%);
  border-top-color: #2c3138;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* 3D Recessed Form Controls inside Pop-ups */
.modal-dialog .input,
.modal-dialog .select,
.modal-dialog .textarea,
.drawer-panel .input,
.drawer-panel .select,
.drawer-panel .textarea {
  background: linear-gradient(180deg, #f1f4f8 0%, #ffffff 38%, #ffffff 100%);
  color: var(--ink-primary);
  border: 1px solid #c8d0db;
  border-radius: 8px;
  box-shadow: inset 0 2px 3px rgba(15, 23, 42, 0.07), 0 1px 0 #ffffff;
}
.modal-dialog .input:disabled,
.modal-dialog .select:disabled,
.modal-dialog .textarea:disabled,
.drawer-panel .input:disabled,
.drawer-panel .select:disabled,
.drawer-panel .textarea:disabled {
  background: #e8ecf1;
  color: #64748b;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}
[data-theme="dark"] .modal-dialog .input,
[data-theme="dark"] .modal-dialog .select,
.modal-dialog .select option,
[data-theme="dark"] .modal-dialog .textarea,
[data-theme="dark"] .drawer-panel .input,
[data-theme="dark"] .drawer-panel .select,
.drawer-panel .select option,
[data-theme="dark"] .drawer-panel .textarea {
  background: var(--bg-surface);
  color: var(--ink-primary);
}
[data-theme="dark"] .modal-dialog .input,
[data-theme="dark"] .modal-dialog .select,
[data-theme="dark"] .modal-dialog .textarea,
[data-theme="dark"] .drawer-panel .input,
[data-theme="dark"] .drawer-panel .select,
[data-theme="dark"] .drawer-panel .textarea {
  background: linear-gradient(180deg, #101215 0%, #16191d 45%, #181c20 100%);
  color: #f2f4f7;
  border-color: #323840;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .modal-dialog .input:disabled,
[data-theme="dark"] .modal-dialog .select:disabled,
[data-theme="dark"] .modal-dialog .textarea:disabled,
[data-theme="dark"] .drawer-panel .input:disabled,
[data-theme="dark"] .drawer-panel .select:disabled,
[data-theme="dark"] .drawer-panel .textarea:disabled {
  background: #131619;
  color: #6b7280;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}
.modal-dialog .input:focus,
.modal-dialog .select:focus,
.modal-dialog .textarea:focus,
.drawer-panel .input:focus,
.drawer-panel .select:focus,
.drawer-panel .textarea:focus {
  border-color: var(--accent);
  box-shadow: inset 0 2px 3px rgba(15, 23, 42, 0.06), 0 0 0 2.5px var(--accent-subtle);
}
[data-theme="dark"] .modal-dialog .input:focus,
[data-theme="dark"] .modal-dialog .select:focus,
[data-theme="dark"] .modal-dialog .textarea:focus,
[data-theme="dark"] .drawer-panel .input:focus,
[data-theme="dark"] .drawer-panel .select:focus,
[data-theme="dark"] .drawer-panel .textarea:focus {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.55), 0 0 0 2.5px var(--accent-subtle);
}

/* 3D Tactile Buttons inside Pop-ups */
.modal-dialog .btn-secondary,
.drawer-panel .btn-secondary {
  background: linear-gradient(180deg, #ffffff 0%, #edf0f4 100%);
  border-color: #c8d0db;
  box-shadow: inset 0 1px 0 #ffffff, inset 0 -2px 2px rgba(15, 23, 42, 0.08);
}
[data-theme="dark"] .modal-dialog .btn-secondary,
[data-theme="dark"] .drawer-panel .btn-secondary {
  background: linear-gradient(180deg, #2a2f36 0%, #1f2329 100%);
  color: #e5e7eb;
  border-color: #3b424c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), inset 0 -2px 2px rgba(0, 0, 0, 0.45);
}
.modal-dialog .btn-primary,
.drawer-panel .btn-primary,
.modal-dialog .btn-danger,
.drawer-panel .btn-danger {
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.28), inset 0 -2.5px 2px rgba(0, 0, 0, 0.32);
}

.modal-backdrop,
.drawer-backdrop,
.sheet-backdrop {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.toast {
  background: rgba(21, 21, 19, 0.78);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--glass-specular);
}
[data-theme="dark"] .toast {
  background: rgba(30, 34, 40, 0.94);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.14);
}

/* Page 04 1-Menu-1-Popup Launcher Grid */
.launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}
.launcher-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  text-align: left;
  font-family: inherit;
  color: var(--ink-primary);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--glass-border-outer);
  border-radius: 12px;
  box-shadow: var(--glass-specular);
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast), background-color var(--transition-fast);
}
.launcher-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  background: var(--glass-bg-elevated);
}
.launcher-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.launcher-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.launcher-title {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-primary);
}
.launcher-desc {
  margin: 3px 0 0;
  font-size: var(--text-xs);
  color: var(--ink-muted);
  line-height: 1.4;
}
.launcher-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--ink-secondary);
}
.modal-body-lg.is-selects-body {
  min-height: 360px;
  overflow: visible;
}

/* Custom Unified <ui-select> Dropdowns (Zero Native OS Select Popups) */
.ui-select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  flex: 1;
  min-width: 0;
}
.ui-select-chev {
  color: var(--ink-muted);
  transition: transform var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}
.ui-select.is-open .ui-select-chev { transform: rotate(180deg); color: var(--accent); }
.ui-select.is-compact .select-trigger { height: 26px; padding: 0 7px; font-size: 11px; }
.ui-select .select-trigger:disabled {
  background: var(--bg-subtle);
  color: var(--ink-muted);
  cursor: not-allowed;
  opacity: 0.85;
}
.ui-select .dropdown-menu { min-width: max(100%, 132px); width: max-content; max-width: 320px; }
.input-group > .ui-select { flex-shrink: 0; }
.input-group > .ui-select:first-child .select-trigger {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 0;
}
.input-group > .ui-select:last-child .select-trigger {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 0;
}

/* Solid 3D Trigger inside Pop-ups */
.modal-dialog .select-trigger,
.drawer-panel .select-trigger {
  background: linear-gradient(180deg, #f1f4f8 0%, #ffffff 38%, #ffffff 100%);
  color: var(--ink-primary);
  border: 1px solid #c8d0db;
  border-radius: 8px;
  box-shadow: inset 0 2px 3px rgba(15, 23, 42, 0.07), 0 1px 0 #ffffff;
}
.modal-dialog .select-trigger:disabled,
.drawer-panel .select-trigger:disabled {
  background: #e8ecf1;
  color: #64748b;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}
[data-theme="dark"] .modal-dialog .select-trigger,
[data-theme="dark"] .drawer-panel .select-trigger {
  background: linear-gradient(180deg, #101215 0%, #16191d 45%, #181c20 100%);
  color: #f2f4f7;
  border-color: #323840;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .modal-dialog .select-trigger:disabled,
[data-theme="dark"] .drawer-panel .select-trigger:disabled {
  background: #131619;
  color: #6b7280;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* Prevent clipping of custom dropdown menus inside modals & logic rules */
.modal-dialog:has(.dropdown.is-open),
.drawer-panel:has(.dropdown.is-open),
.modal-body-lg:has(.dropdown.is-open),
.drawer-body:has(.dropdown.is-open) {
  overflow: visible;
}
.logic-rule-row:has(.dropdown.is-open),
.logic-clause:has(.dropdown.is-open) {
  position: relative;
  z-index: 42;
}

/* ==========================================================================
   15. Mobile & Small-Screen Responsive Adaptations (<=640px & <=390px)
   ========================================================================== */
@media (max-width: 640px) {
  .topbar {
    height: 48px;
    padding: 0 10px;
    gap: 6px;
  }
  .topbar-left {
    flex: 1;
    min-width: 0;
    gap: 6px;
  }
  #topbar-page-name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .topbar-actions {
    flex-shrink: 0;
    gap: 5px;
  }
  .hide-mobile,
  #toggle-density {
    display: none !important;
  }
  .accent-picker {
    padding: 3px 5px;
    gap: 4px;
  }
  .accent-dot {
    width: 12px;
    height: 12px;
  }
  [data-tip]::after {
    display: none !important;
  }

  .content-container {
    padding: 12px 12px 24px;
    gap: 14px;
  }
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-bottom: 10px;
  }
  .page-title {
    font-size: 15.5px;
    line-height: 1.3;
    flex-wrap: wrap;
  }
  .page-header > .stack-row {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }
  .section-bar {
    flex-wrap: wrap;
    gap: 6px;
  }

  .panel-header {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .panel-body {
    padding: 12px;
  }
  .panel-footer {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .summary-strip {
    grid-template-columns: 1fr;
  }
  .summary-cell {
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  .summary-cell:last-child {
    border-bottom: 0;
  }
  .swatch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .radio-cards {
    grid-template-columns: 1fr;
  }
  .otp-group {
    gap: 5px;
    flex-wrap: nowrap;
  }
  .otp-box {
    width: 38px;
    height: 42px;
    font-size: 15px;
  }
  .avatar-upload-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .doc-slot {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .doc-slot > .stack-row {
    justify-content: flex-end;
  }
  .form-val-banner,
  .form-footer-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .form-footer-bar > .stack-row {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .table-tabs-bar {
    flex-wrap: wrap;
    padding: 6px 12px 0;
    gap: 8px;
  }
  .table-tabs-nav {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .table-tabs-bar .density-seg {
    margin-bottom: 8px;
  }
  .table-toolbar {
    padding: 10px 12px;
    gap: 8px;
    flex-direction: column;
    align-items: stretch;
  }
  .table-toolbar > .stack-row {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }
  .table-footer {
    padding: 10px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .tbl-footer-left {
    width: 100%;
    justify-content: space-between;
  }

  .dropdown-menu,
  .ui-select .dropdown-menu,
  .mega-panel,
  .popover-panel {
    max-width: calc(100vw - 24px);
  }
  .modal-backdrop,
  .drawer-backdrop,
  .cmd-backdrop {
    padding: 10px;
  }
  .modal-dialog,
  .drawer-panel {
    max-width: 100%;
    max-height: calc(100dvh - 20px);
  }
  .modal-header,
  .drawer-header,
  .modal-footer,
  .drawer-footer {
    padding: 12px 14px;
    flex-wrap: wrap;
  }
  .modal-body,
  .modal-body-lg,
  .drawer-body {
    padding: 14px;
  }
  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .toast {
    max-width: 100%;
    width: 100%;
  }
  .app-footer {
    height: auto;
    padding: 10px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .footer-links {
    flex-wrap: wrap;
    gap: 8px;
  }
  .tpl-stage {
    padding: 12px;
    min-height: 420px;
  }
  .auth-brand-pane,
  .auth-form-pane,
  .err-page-top {
    padding: 18px 16px;
  }
  .err-page-foot {
    padding: 10px 16px;
    flex-wrap: wrap;
  }
}

@media (max-width: 390px) {
  .otp-box {
    width: 34px;
    height: 38px;
    font-size: 14px;
  }
}

/* ==========================================================================
   16. Standalone iOS Liquid Glass 3D Buttons, Labeled Tray & Status Capsules
   ========================================================================== */
.row-action-tray .btn:not(.btn-icon) {
  width: auto;
  height: 22px;
  padding: 0 7px;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 500;
}

.btn-glass,
.btn-glass-info,
.btn-glass-success,
.btn-glass-warning,
.btn-glass-danger {
  position: relative;
  border-radius: 7px;
  backdrop-filter: blur(12px) saturate(165%);
  -webkit-backdrop-filter: blur(12px) saturate(165%);
  transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1), background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.btn-glass:hover:not(:disabled),
.btn-glass-info:hover:not(:disabled),
.btn-glass-success:hover:not(:disabled),
.btn-glass-warning:hover:not(:disabled),
.btn-glass-danger:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-glass {
  color: #334155;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.92) 0%, rgba(226, 232, 240, 0.56) 100%);
  border: 1px solid rgba(203, 213, 225, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), inset 0 -1.5px 2px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.05);
}
.btn-glass:hover:not(:disabled) {
  color: #ffffff;
  background: linear-gradient(165deg, rgba(51, 65, 85, 0.92) 0%, rgba(15, 23, 42, 0.88) 100%);
  border-color: rgba(203, 213, 225, 0.65);
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, 0.5), inset 0 -2px 3px rgba(0, 0, 0, 0.28), 0 4px 10px rgba(15, 23, 42, 0.14);
}

.btn-glass-info {
  color: #1d4ed8;
  background: linear-gradient(165deg, rgba(239, 246, 255, 0.92) 0%, rgba(191, 219, 254, 0.48) 100%);
  border: 1px solid rgba(147, 197, 253, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), inset 0 -1.5px 2px rgba(29, 78, 216, 0.10), 0 1px 2px rgba(29, 78, 216, 0.06);
}
.btn-glass-info:hover:not(:disabled) {
  color: #ffffff;
  background: linear-gradient(165deg, rgba(59, 130, 246, 0.94) 0%, rgba(29, 78, 216, 0.9) 100%);
  border-color: rgba(191, 219, 254, 0.82);
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, 0.65), inset 0 -2px 3px rgba(0, 0, 0, 0.22), 0 4px 10px rgba(29, 78, 216, 0.18);
}

.btn-glass-success {
  color: #146c43;
  background: linear-gradient(165deg, rgba(240, 253, 244, 0.94) 0%, rgba(187, 247, 208, 0.48) 100%);
  border: 1px solid rgba(134, 239, 172, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), inset 0 -1.5px 2px rgba(20, 108, 67, 0.10), 0 1px 2px rgba(20, 108, 67, 0.06);
}
.btn-glass-success:hover:not(:disabled) {
  color: #ffffff;
  background: linear-gradient(165deg, rgba(34, 197, 94, 0.94) 0%, rgba(21, 128, 61, 0.9) 100%);
  border-color: rgba(187, 247, 208, 0.82);
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, 0.65), inset 0 -2px 3px rgba(0, 0, 0, 0.22), 0 4px 10px rgba(21, 128, 61, 0.18);
}

.btn-glass-warning {
  color: #b45309;
  background: linear-gradient(165deg, rgba(255, 251, 235, 0.94) 0%, rgba(253, 230, 138, 0.48) 100%);
  border: 1px solid rgba(252, 211, 77, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), inset 0 -1.5px 2px rgba(180, 83, 9, 0.10), 0 1px 2px rgba(180, 83, 9, 0.06);
}
.btn-glass-warning:hover:not(:disabled) {
  color: #ffffff;
  background: linear-gradient(165deg, rgba(245, 158, 11, 0.94) 0%, rgba(180, 83, 9, 0.9) 100%);
  border-color: rgba(253, 230, 138, 0.82);
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, 0.65), inset 0 -2px 3px rgba(0, 0, 0, 0.22), 0 4px 10px rgba(180, 83, 9, 0.18);
}

.btn-glass-danger {
  color: #b91c1c;
  background: linear-gradient(165deg, rgba(254, 242, 242, 0.94) 0%, rgba(254, 202, 202, 0.48) 100%);
  border: 1px solid rgba(252, 165, 165, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), inset 0 -1.5px 2px rgba(185, 28, 28, 0.10), 0 1px 2px rgba(185, 28, 28, 0.06);
}
.btn-glass-danger:hover:not(:disabled) {
  color: #ffffff;
  background: linear-gradient(165deg, rgba(239, 68, 68, 0.94) 0%, rgba(185, 28, 28, 0.9) 100%);
  border-color: rgba(254, 202, 202, 0.82);
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, 0.65), inset 0 -2px 3px rgba(0, 0, 0, 0.24), 0 4px 10px rgba(185, 28, 28, 0.18);
}

[data-theme="dark"] .btn-glass {
  color: #e2e8f0;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -1.5px 2px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .btn-glass-info {
  color: #93c5fd;
  background: linear-gradient(165deg, rgba(59, 130, 246, 0.22) 0%, rgba(29, 78, 216, 0.10) 100%);
  border-color: rgba(147, 197, 253, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1.5px 2px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .btn-glass-success {
  color: #6ee7b7;
  background: linear-gradient(165deg, rgba(34, 197, 94, 0.22) 0%, rgba(21, 128, 61, 0.10) 100%);
  border-color: rgba(110, 231, 183, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1.5px 2px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .btn-glass-warning {
  color: #fcd34d;
  background: linear-gradient(165deg, rgba(245, 158, 11, 0.22) 0%, rgba(180, 83, 9, 0.10) 100%);
  border-color: rgba(252, 211, 77, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1.5px 2px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .btn-glass-danger {
  color: #fca5a5;
  background: linear-gradient(165deg, rgba(239, 68, 68, 0.22) 0%, rgba(185, 28, 28, 0.10) 100%);
  border-color: rgba(252, 165, 165, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1.5px 2px rgba(0, 0, 0, 0.35);
}

/* Additional iOS 3D Status Capsules (Info & Neutral) */
.status-3d.is-info {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.95) 0%, rgba(219, 234, 254, 0.72) 100%);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(37, 99, 235, 0.06);
}
.status-3d.is-info .status-3d-ic { background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%); color: #ffffff; }
.status-3d.is-neutral {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(226, 232, 240, 0.72) 100%);
  color: #334155;
  border: 1px solid rgba(100, 116, 139, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(15, 23, 42, 0.05);
}
.status-3d.is-neutral .status-3d-ic { background: linear-gradient(180deg, #64748b 0%, #475569 100%); color: #ffffff; }

[data-theme="dark"] .status-3d.is-info {
  background: rgba(37, 99, 235, 0.16);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
[data-theme="dark"] .status-3d.is-neutral {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border-color: rgba(203, 213, 225, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

/* Standalone Bulk Bar & Inline Tabs Showcase */
.bulk-bar.is-demo {
  display: flex;
  border-radius: var(--radius-md);
  padding: 9px 14px;
}
.tabs-inline-demo {
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 4px;
  flex-wrap: wrap;
}

/* ==========================================================================
   17. Dark Mode Contrast & Component Refinements
   ========================================================================== */
[data-theme="dark"][data-accent="obsidian"] body {
  background-color: #0b0d0e;
  background-image:
    radial-gradient(900px 580px at 8% 0%, rgba(255, 255, 255, 0.04), transparent 65%),
    radial-gradient(760px 520px at 94% 92%, rgba(148, 163, 184, 0.05), transparent 65%),
    linear-gradient(155deg, #101315 0%, #090b0c 55%, #0e1113 100%);
}

[data-theme="dark"] .accent-dot[aria-label="Obsidian"] {
  background: #e2e8f0 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
[data-theme="dark"] .accent-dot[aria-label="Obsidian"].is-active {
  box-shadow: 0 0 0 1.5px var(--bg-surface), 0 0 0 3px var(--ink-primary) !important;
}

.mega-panel,
.flyout-sub {
  background: #ffffff;
  border: 1px solid #cfd6df;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 #ffffff, 0 12px 28px rgba(15, 23, 42, 0.14);
}
[data-theme="dark"] .mega-panel,
[data-theme="dark"] .flyout-sub {
  background: #1e2227;
  border-color: #343940;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 32px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .segmented,
[data-theme="dark"] .status-tabs {
  background: #121519;
  border-color: #2c323b;
}
[data-theme="dark"] .segmented-btn.is-active,
[data-theme="dark"] .status-tab.is-active {
  background: #282e37;
  color: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 1px 2px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .btn-success,
[data-theme="dark"] .btn-success-subtle:hover,
[data-theme="dark"] .toast.is-success,
[data-theme="dark"] .wiz-step.is-done .wiz-num,
[data-theme="dark"] .appr-dot.is-approved {
  background: #16a34a;
  border-color: #22c55e;
  color: #ffffff;
}
[data-theme="dark"] .btn-danger,
[data-theme="dark"] .btn-danger-subtle:hover,
[data-theme="dark"] .toast.is-danger,
[data-theme="dark"] .counter-pill.is-danger,
[data-theme="dark"] .appr-dot.is-rejected {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
}
[data-theme="dark"] .btn-warning-subtle:hover,
[data-theme="dark"] .toast.is-warning {
  background: #d97706;
  border-color: #f59e0b;
  color: #ffffff;
}
[data-theme="dark"] .btn-info-subtle:hover {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}

[data-theme="dark"] .bulk-bar {
  background: #242932;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.10);
}
[data-theme="dark"] .bulk-count-pill {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}
[data-theme="dark"] .bulk-bar .btn-ghost-inv {
  background: rgba(255, 255, 255, 0.10);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.18);
}
[data-theme="dark"] .bulk-bar .btn-ghost-inv:hover {
  background: rgba(255, 255, 255, 0.20);
}

[data-theme="dark"] .file-tag.is-zip {
  background: #334155;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
}

[data-theme="dark"] .menu-tree-box,
[data-theme="dark"] .hnav,
[data-theme="dark"] .card,
[data-theme="dark"] .stat-block {
  border-color: #2e343e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   18. Fresh Mobile UI Patterns (Gradient Hero, Ring Gauge, Pastel Tiles)
   ========================================================================== */
.fresh-stage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
  justify-items: center;
}
.fresh-phone {
  --fresh-ink: #14224a;
  --fresh-muted: #7b869f;
  --fresh-surface: #ffffff;
  --fresh-page: #f4f6fa;
  --fresh-line: #e8ecf4;
  width: 100%;
  max-width: 340px;
  background: var(--fresh-page);
  border: 1px solid var(--border-default);
  border-radius: 30px;
  overflow: hidden;
  padding-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--fresh-ink);
  position: relative;
}
.fresh-phone.is-light { padding-top: 18px; }
[data-theme="dark"] .fresh-phone {
  --fresh-ink: #eef2fb;
  --fresh-muted: #8f9ab3;
  --fresh-surface: #1b2029;
  --fresh-page: #12161d;
  --fresh-line: #272e3a;
}

.fresh-hero {
  position: relative;
  padding: 18px 18px 40px;
  color: #ffffff;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, 0.16), transparent 60%),
    linear-gradient(165deg, #3f6fe0 0%, #5da6ea 52%, #bfe9a3 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fresh-hero.is-tall { padding-bottom: 22px; background: linear-gradient(175deg, #3a67dc 0%, #5aa0e8 62%, #a9e0c4 100%); }
[data-theme="dark"] .fresh-hero { background: radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, 0.08), transparent 60%), linear-gradient(165deg, #2a4fae 0%, #3a78b8 55%, #4f9a82 100%); }
[data-theme="dark"] .fresh-hero.is-tall { background: linear-gradient(175deg, #2a4fae 0%, #3a78b8 62%, #3f8570 100%); }

.fresh-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fresh-top-r { display: flex; align-items: center; gap: 10px; }
.fresh-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 10.5px;
  font-weight: 600;
  color: #ffffff;
}
.fresh-chip.is-solid { background: rgba(255, 255, 255, 0.3); }
.fresh-bell {
  position: relative;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.fresh-bell .ic { width: 14px; height: 14px; }
.fresh-bell i { position: absolute; top: 5px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: #ff6b6b; border: 1.5px solid #4a86e2; }
.fresh-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #1c3f86;
  background: linear-gradient(160deg, #ffffff, #cfe3ff);
  border: 2px solid rgba(255, 255, 255, 0.7);
}
.fresh-back {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.fresh-back .ic { width: 15px; height: 15px; }
.fresh-back.is-dark { background: transparent; color: var(--fresh-ink); }
.fresh-days { font-size: 11px; opacity: 0.95; }
.fresh-days b { font-weight: 700; }
.fresh-greet { margin: 4px 0 0; font-size: 17px; font-weight: 400; line-height: 1.35; letter-spacing: -0.01em; }
.fresh-greet strong { font-weight: 700; }

.fresh-balance {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: #14224a;
  margin-bottom: -22px;
  position: relative;
  z-index: 2;
}
[data-theme="dark"] .fresh-balance { background: rgba(27, 32, 41, 0.9); color: #eef2fb; }
.fresh-balance-meta { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.fresh-balance-meta small { font-size: 9.5px; opacity: 0.65; }
.fresh-balance-meta b { font-size: 13px; }

.fresh-btn {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: #3868dd;
  color: #ffffff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 120ms ease, filter 120ms ease;
}
.fresh-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.fresh-btn.is-ghost { background: rgba(255, 255, 255, 0.24); border: 1px solid rgba(255, 255, 255, 0.34); }

.fresh-card {
  background: var(--fresh-surface);
  border: 1px solid var(--fresh-line);
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(31, 60, 120, 0.06);
  font-family: inherit;
  color: inherit;
  text-align: left;
}
[data-theme="dark"] .fresh-card { box-shadow: none; }
button.fresh-card { cursor: pointer; transition: transform 140ms ease, box-shadow 140ms ease; }
button.fresh-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(31, 60, 120, 0.1); }

.fresh-ic {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.fresh-ic .ic { width: 17px; height: 17px; stroke-width: 2; }
.fresh-ic.sm { width: 28px; height: 28px; border-radius: 9px; }
.fresh-ic.sm .ic { width: 14px; height: 14px; }
.fresh-ic.is-green { background: linear-gradient(145deg, #e3f7d2, #a7e0b4); color: #1f7a4a; }
.fresh-ic.is-blue { background: linear-gradient(145deg, #dbeafe, #9cc8f6); color: #2455b8; }
.fresh-ic.is-yellow { background: linear-gradient(145deg, #f6f8c9, #cbe58c); color: #5b7a14; }
[data-theme="dark"] .fresh-ic { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14); }
[data-theme="dark"] .fresh-ic.is-green { background: linear-gradient(145deg, rgba(110, 220, 150, 0.28), rgba(60, 170, 110, 0.16)); color: #86e3ae; }
[data-theme="dark"] .fresh-ic.is-blue { background: linear-gradient(145deg, rgba(110, 170, 250, 0.28), rgba(70, 130, 220, 0.16)); color: #9cc8ff; }
[data-theme="dark"] .fresh-ic.is-yellow { background: linear-gradient(145deg, rgba(200, 230, 120, 0.26), rgba(150, 190, 70, 0.14)); color: #cfe98a; }

.fresh-usage {
  margin: 0 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 1;
  margin-top: 4px;
}
.fresh-usage-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fresh-tags { display: flex; gap: 6px; }
.fresh-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}
.fresh-tag.is-green { background: #dff6e4; color: #25784a; }
.fresh-tag.is-blue { background: #dce9fb; color: #2b5fb8; }
.fresh-tag.is-red { background: #fde0e0; color: #c24444; }
[data-theme="dark"] .fresh-tag.is-green { background: rgba(80, 200, 130, 0.18); color: #86e3ae; }
[data-theme="dark"] .fresh-tag.is-blue { background: rgba(90, 150, 240, 0.2); color: #9cc8ff; }
[data-theme="dark"] .fresh-tag.is-red { background: rgba(240, 100, 100, 0.18); color: #ff9c9c; }
.fresh-plan-row { display: flex; align-items: center; gap: 9px; }
.fresh-plan-row b, .fresh-plan-name b { display: block; font-size: 12px; font-weight: 700; }
.fresh-plan-row small, .fresh-plan-name small { display: block; font-size: 10px; color: var(--fresh-muted); margin-top: 1px; }
.fresh-active { display: flex; flex-direction: column; gap: 1px; }
.fresh-active small { font-size: 9.5px; color: var(--fresh-muted); }
.fresh-active b { font-size: 11.5px; font-weight: 700; }
.fresh-active.is-light small { color: rgba(255, 255, 255, 0.75); }
.fresh-active.is-light b { color: #ffffff; }

/* Ring Gauge */
.fresh-ring { position: relative; aspect-ratio: 1; flex-shrink: 0; }
.fresh-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.fresh-ring .rg-bg { fill: none; stroke: #e6ecf6; stroke-width: 11; }
.fresh-ring .rg-fg { fill: none; stroke: url(#fresh-ring-grad); stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset 420ms cubic-bezier(0.22, 1, 0.36, 1); }
[data-theme="dark"] .fresh-ring .rg-bg { stroke: #262e3b; }
.fresh-ring.is-on-hero .rg-bg { stroke: rgba(255, 255, 255, 0.26); }
.fresh-ring-val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.fresh-ring-val b { font-size: 1.25em; font-weight: 700; font-size: 20px; }
.fresh-ring-val b em { font-style: normal; font-size: 0.5em; font-weight: 600; margin-left: 2px; opacity: 0.8; }
.fresh-ring-val span { font-size: 10px; color: var(--fresh-muted); margin-top: 2px; }
.fresh-ring.is-on-hero .fresh-ring-val { color: #ffffff; }
.fresh-ring.is-on-hero .fresh-ring-val b { font-size: 34px; }
.fresh-ring.is-on-hero .fresh-ring-val span { color: rgba(255, 255, 255, 0.85); font-size: 12px; }
.fresh-hero-foot { display: flex; align-items: flex-end; justify-content: space-between; }
.fresh-slider { display: flex; align-items: center; gap: 8px; font-size: 10px; color: rgba(255, 255, 255, 0.9); }
.fresh-slider input { flex: 1; accent-color: #ffffff; height: 4px; }

.fresh-section-bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 18px 0; }
.fresh-section-bar h3 { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--fresh-ink); letter-spacing: -0.01em; }
.fresh-section-bar button { border: 0; background: transparent; color: #3f78e0; font-family: inherit; font-size: 11px; font-weight: 500; cursor: pointer; }

.fresh-scroll { display: flex; gap: 10px; padding: 0 14px 4px 14px; overflow-x: auto; scrollbar-width: none; }
.fresh-scroll::-webkit-scrollbar { display: none; }
.fresh-plan, .fresh-addon { flex: 0 0 150px; padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.fresh-plan-line b { display: block; font-size: 11.5px; font-weight: 600; }
.fresh-plan-line small { display: block; font-size: 10px; color: var(--fresh-muted); margin-top: 1px; }
.fresh-plan-price { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.fresh-plan-price b { font-size: 15px; font-weight: 700; }
.fresh-plan-price .ic { width: 15px; height: 15px; color: var(--fresh-ink); }

.fresh-nav {
  margin: 4px 14px 0;
  padding: 9px 14px;
  border-radius: 22px;
  background: var(--fresh-surface);
  border: 1px solid var(--fresh-line);
  display: flex;
  align-items: center;
  justify-content: space-around;
}
.fresh-nav-btn { width: 36px; height: 32px; border: 0; border-radius: 12px; background: transparent; color: var(--fresh-muted); display: grid; place-items: center; cursor: pointer; transition: background-color 140ms ease, color 140ms ease; }
.fresh-nav-btn .ic { width: 18px; height: 18px; }
.fresh-nav-btn:hover { color: var(--fresh-ink); }
.fresh-nav-btn.is-active { color: #3f78e0; background: rgba(63, 120, 224, 0.12); }

.fresh-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 14px; margin-top: -4px; }
.fresh-mini { padding: 11px; display: flex; flex-direction: column; gap: 9px; box-shadow: 0 6px 18px rgba(31, 60, 120, 0.1); }
.fresh-mini-head { display: flex; align-items: center; gap: 7px; }
.fresh-mini-head b { display: block; font-size: 12px; }
.fresh-mini-head small { display: block; font-size: 9.5px; color: var(--fresh-muted); }
.fresh-dots { margin-left: auto; font-style: normal; color: var(--fresh-muted); letter-spacing: 1px; }
.fresh-mini-val b { display: block; font-size: 12px; font-weight: 700; }
.fresh-mini-val small { display: block; font-size: 10px; color: var(--fresh-muted); }
.fresh-bar { height: 4px; border-radius: 4px; background: #e6ecf6; overflow: hidden; }
.fresh-bar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #a7dc7a, #62b6ea); }
.fresh-bar.is-blue span { background: linear-gradient(90deg, #6aa8f0, #3f78e0); }
[data-theme="dark"] .fresh-bar { background: #262e3b; }
.fresh-mini-foot { display: flex; justify-content: space-between; font-size: 9px; font-weight: 600; color: var(--fresh-muted); }

.fresh-head { display: flex; align-items: center; justify-content: space-between; padding: 0 16px; gap: 10px; }
.fresh-head h3 { margin: 0; flex: 1; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.fresh-select { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--fresh-line); background: var(--fresh-surface); font-size: 11px; font-weight: 500; color: var(--fresh-muted); }
.fresh-select .ic { width: 12px; height: 12px; }

.fresh-chart { margin: 0 14px; padding: 14px 12px 8px; position: relative; }
.fresh-chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.fresh-grid line { stroke: var(--fresh-line); stroke-width: 1; }
.fresh-line { fill: none; stroke: #6cc47a; stroke-width: 2; stroke-linecap: round; }
.fresh-cursor { stroke: #6cc47a; stroke-width: 1; }
.fresh-dot { fill: #ffffff; stroke: #6cc47a; stroke-width: 2; }
.fresh-tip {
  position: absolute;
  transform: translate(-50%, calc(-100% - 12px));
  padding: 6px 10px;
  border-radius: 8px;
  background: #14224a;
  color: #ffffff;
  white-space: nowrap;
  pointer-events: none;
  transition: left 240ms cubic-bezier(0.22, 1, 0.36, 1), top 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.fresh-chart .fresh-tip { margin-top: 14px; margin-left: 12px; }
.fresh-tip b { display: block; font-size: 11px; font-weight: 700; }
.fresh-tip small { display: block; font-size: 9px; opacity: 0.75; }
[data-theme="dark"] .fresh-tip { background: #f3f6fc; color: #14224a; }
.fresh-months { display: flex; justify-content: space-between; padding-top: 8px; }
.fresh-months button { border: 0; background: transparent; font-family: inherit; font-size: 9.5px; font-weight: 500; color: var(--fresh-muted); cursor: pointer; padding: 3px 4px; border-radius: 5px; }
.fresh-months button.is-active { color: var(--fresh-ink); font-weight: 700; background: rgba(108, 196, 122, 0.18); }

.fresh-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 14px; }
.fresh-stat { display: flex; align-items: center; gap: 7px; padding: 8px; border-radius: 14px; background: var(--fresh-surface); border: 1px solid var(--fresh-line); }
.fresh-stat b { display: block; font-size: 11px; }
.fresh-stat small { display: block; font-size: 9.5px; color: var(--fresh-muted); }

.fresh-list { display: flex; flex-direction: column; gap: 8px; padding: 0 14px; }
.fresh-row { width: 100%; padding: 10px 12px; display: flex; align-items: center; gap: 10px; border-radius: 16px; }
.fresh-row .fresh-plan-name { flex: 1; }
.fresh-chev { width: 14px; height: 14px; color: var(--fresh-muted); }

@media (max-width: 1180px) {
  .fresh-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .fresh-stage { grid-template-columns: 1fr; }
}

.fresh-chart-wrap { position: relative; }
.fresh-chart .fresh-tip { margin: 0; }
