/* ══════════════════════════════════════════════════
   Commerce OS — Design System
   system.css — Reusable component & utility classes
   Extracted from design-preview.html
══════════════════════════════════════════════════ */

/*
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/PlusJakartaSans[wght].ttf") format("truetype") tech(variations);
  font-weight: 100 900;
  font-stretch: 75% 125%;
  font-style: normal;
}
*/

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@600;700&family=IBM+Plex+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;600');

/* ══════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES
══════════════════════════════════════════════════ */
:root {
  /* Fonts */
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:    'IBM Plex Sans', system-ui, sans-serif;
/*  --font-mono:    'Geist Mono', 'Courier New', monospace;*/
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* Accent — Ink */
  --ink-950:    #1e293b;
  --ink-900:    #243044;
  --ink-fg:     #ffffff;

  /* Accent — Indigo */
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-100: #e0e7ff;
  --indigo-fg:  #ffffff;

  /* Accent — Orange (warning) */
  --orange-600: #ea580c;
  --orange-700: #c2410c;
  --orange-50:  #fff7ed;
  --orange-fg:  #ffffff;

  /* Destructive — Red */
  --red-600: #dc264d;
  --red-700: #b91c3b;
  --red-50:  #fef2f6;
  --red-fg:  #ffffff;

  /* Zinc Surface */
  --zn-25:  #fcfcfc;
  --zn-50:  #fafafa;
  --zn-100: #f4f4f5;
  --zn-200: #e4e4e7;
  --zn-300: #d4d4d8;
  --zn-400: #a1a1aa;
  --zn-500: #71717a;
  --zn-600: #52525b;
  --zn-700: #3f3f46;
  --zn-900: #18181b;

  /* Slate Alternative */
  --sl-50:  #f8fafc;
  --sl-100: #f1f5f9;
  --sl-200: #e2e8f0;
  --sl-300: #cbd5e1;
  --sl-400: #94a3b8;
  --sl-500: #64748b;
  --sl-600: #475569;
  --sl-700: #334155;
  --sl-900: #0f172a;

  /* Radius */
  --radius-xs:   2px;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-pill: 9999px;

  /* Element sizing */
  --el-h:    38px;
  --el-px:   14px;
  --el-py:   8px;
  --el-text: 13px;
  --el-h-sm: 28px;
  --el-h-lg: 44px;

  /* Spacing */
  --sp-1:  4px;  --sp-2:  8px;  --sp-3:  12px;
  --sp-4:  16px; --sp-5:  20px; --sp-6:  24px;
  --sp-8:  32px; --sp-10: 40px; --sp-12: 48px;
  --sp-16: 64px; --sp-20: 80px;

  /* Semantic surface tokens (theme-aware) */
  --bg-page:          var(--zn-50);
  --bg-card:          #ffffff;
  --bg-surface:       var(--zn-100);
  --border:           var(--zn-200);
  --border-2:         var(--zn-300);
  --text-head:        var(--zn-900);
  --text-base:        var(--zn-700);
  --text-muted:       var(--zn-500);
  --text-placeholder: var(--zn-400);
  --input-bg:         var(--zn-25);
}

[data-theme="dark"] {
  --bg-page:          #111113;
  --bg-card:          #18181b;
  --bg-surface:       #1f1f23;
  --border:           rgba(255,255,255,0.07);
  --border-2:         rgba(255,255,255,0.12);
  --text-head:        #e4e4e7;
  --text-base:        #a1a1aa;
  --text-muted:       #52525b;
  --text-placeholder: #3f3f46;
  --input-bg:         #1f1f23;
}

/* ══════════════════════════════════════════════════
   BASE
══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: var(--el-text);
  line-height: 1.55;
  color: var(--text-base);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
  /*font-feature-settings: "ss02" 1;*/
  font-family: var(--font-display);
  color: var(--text-head);
}

a { color: var(--indigo-600); text-decoration: underline; }

/* ══════════════════════════════════════════════════
   COMPONENT: BUTTONS
══════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--el-h);
  padding: 0 var(--el-px);
  font-family: var(--font-body);
  font-size: var(--el-text);
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 0.12s, background 0.12s, border-color 0.12s, opacity 0.12s;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
}

.btn-ink           { background: var(--ink-950); color: #fff; }
.btn-ink:hover     { background: var(--ink-900); }

.btn-indigo        { background: var(--indigo-600); color: #fff; }
.btn-indigo:hover  { background: var(--indigo-700); }

.btn-orange        { background: var(--orange-600); color: #fff; }
.btn-orange:hover  { background: var(--orange-700); }

.btn-destructive        { background: var(--red-600); color: #fff; }
.btn-destructive:hover  { background: var(--red-700); }

.btn-outline       { background: var(--bg-card); color: var(--text-base); border-color: var(--border); }
.btn-outline:hover { background: var(--bg-surface); }

.btn-ghost         { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover   { background: var(--bg-surface); color: var(--text-head); }

.btn-danger-outline       { background: transparent; color: var(--red-600); border-color: rgba(220,38,77,0.3); }
.btn-danger-outline:hover { background: var(--red-50); }

.btn-link       { background: transparent; color: var(--indigo-600); border: none; text-decoration: underline; padding: 0; min-height: unset; font-weight: 400; }
.btn-link:hover { opacity: 0.75; }

.btn-sm { min-height: var(--el-h-sm); padding: 0 8px; font-size: 12px; }
.btn-lg { min-height: var(--el-h-lg); padding: 0 20px; font-size: 15px; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-left   { justify-content: flex-start; text-align: left; }
.btn-center { justify-content: center; }
.btn-left .btn-arrow {
  margin-left: auto;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.btn-left:hover .btn-arrow {
  transform: translateX(4px);
  opacity: 1;
}

/* ══════════════════════════════════════════════════
   COMPONENT: INPUTS & FORM CONTROLS
══════════════════════════════════════════════════ */
.input, select.input, textarea.input {
  display: block;
  width: 100%;
  height: var(--el-h);
  padding: 0 var(--el-px);
  font-family: var(--font-body);
  font-size: var(--el-text);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-head);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder { color: var(--text-placeholder); }
.input:hover        { border-color: var(--border-2); }
.input:focus {
  border-color: var(--ink-950);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.1);
}
.input:disabled { background: var(--bg-surface); }
.input.error        { border-color: #dc264d; }
.input.error:focus  { box-shadow: 0 0 0 3px rgba(220,38,38,0.12); }
.input.success      { border-color: #16a37a; }

textarea.input {
  padding: var(--el-py) var(--el-px);
  resize: vertical;
  height: calc(var(--el-h) * 2.5);
  line-height: 1.55;
}

select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
  transition: background-position 0.15s;
}
select.input:focus {
  background-position: right 12px center;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-head); }
.form-hint  { font-size: 12px; color: var(--text-muted); }
.form-error { font-size: 12px; color: #dc264d; }

/* ══════════════════════════════════════════════════
   COMPONENT: TOGGLE (SWITCH)
══════════════════════════════════════════════════ */
.toggle { position: relative; display: inline-flex; width: 38px; height: 22px; cursor: pointer; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track { position: absolute; inset: 0; background: var(--border-2); border-radius: 99px; transition: background 0.2s; }
.toggle input:checked + .toggle-track { background: var(--ink-900); }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: white; border-radius: 50%; transition: transform 0.2s; pointer-events: none; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle input:checked ~ .toggle-thumb { transform: translateX(16px); }

/* ══════════════════════════════════════════════════
   COMPONENT: BADGES
══════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.badge-default  { background: var(--zn-100); color: var(--zn-600); border-color: var(--zn-200); }
.badge-indigo   { background: var(--indigo-100); color: var(--indigo-600); border-color: rgba(79,70,229,0.25); }
.badge-success  { background: #f0fdf9; color: #16a37a; border-color: #bbf7d0; }
.badge-warning  { background: var(--orange-50); color: var(--orange-600); border-color: rgba(234,88,12,0.25); }
.badge-error    { background: #fef2f6; color: #dc264d; border-color: #fecaca; }
.badge-neutral  { background: var(--zn-100); color: var(--text-muted); border-color: var(--border); }

[data-theme="dark"] .badge-default  { background: rgba(255,255,255,0.06); color: var(--text-muted); border-color: var(--border); }
[data-theme="dark"] .badge-indigo   { background: rgba(79,70,229,0.15); border-color: rgba(79,70,229,0.3); }
[data-theme="dark"] .badge-success  { background: rgba(22,163,74,0.12); color: #4ade80; border-color: rgba(22,163,74,0.3); }
[data-theme="dark"] .badge-warning  { background: rgba(234,88,12,0.12); color: #fb923c; border-color: rgba(234,88,12,0.3); }
[data-theme="dark"] .badge-error    { background: rgba(220,38,38,0.12); color: #f87171; border-color: rgba(220,38,38,0.3); }

/* ══════════════════════════════════════════════════
   COMPONENT: CARDS
══════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: background 0.2s, border-color 0.2s;
}

.card-muted    { background: var(--bg-surface); }
.card-elevated { border-color: transparent; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
[data-theme="dark"] .card-elevated { box-shadow: 0 2px 12px rgba(0,0,0,0.4); }
.card-ink      { background: var(--ink-950); border-color: var(--ink-900); }
.card-ink *    { color: rgba(255,255,255,0.85); }
.card-ink h3, .card-ink h4 { color: rgba(255,255,255,0.95); }
.card-indigo-tint { background: color-mix(in srgb, var(--indigo-600) 5%, var(--bg-card)); border-color: color-mix(in srgb, var(--indigo-600) 20%, var(--border)); }
.card-interactive { transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s; cursor: pointer; }
.card:hover.card-interactive { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

/* ══════════════════════════════════════════════════
   COMPONENT: DATA TABLE
══════════════════════════════════════════════════ */
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-placeholder);
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
  text-align: left;
}
[data-theme="dark"] .table th { border-bottom-color: rgba(255,255,255,0.3); }
.table td {
  padding: 11px 16px;
  font-size: 13px;
  color: var(--text-base);
  border-bottom: 1px solid var(--border);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: var(--bg-surface); }

.table.lg-padding th:first-child,
.table.lg-padding td:first-child {
  padding-left: 20px;
}

.table.lg-padding th:last-child,
.table.lg-padding td:last-child {
  padding-right: 20px;
}

/* ══════════════════════════════════════════════════
   COMPONENT: STAT CARD
══════════════════════════════════════════════════ */
.stats-grid   { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat-card  { padding: 20px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg-card); }
.stat-label { font-family: var(--font-body); font-size: 10px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; }
.stat-value { font-family: var(--font-mono); font-size: 28px; font-weight: 600; letter-spacing: -0.04em; color: var(--text-head); margin-bottom: 4px; }
.stat-delta { display: flex; align-items: center; gap: 6px; }

/* ══════════════════════════════════════════════════
   UTILITIES
══════════════════════════════════════════════════ */
.flex         { display: flex; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }
.gap-4        { gap: 16px; }
.gap-6        { gap: 24px; }
.mt-4         { margin-top: 16px; }
.mt-6         { margin-top: 24px; }
.mt-8         { margin-top: 32px; }
.p-4          { padding: 16px; }
.p-5          { padding: 20px; }
.p-6          { padding: 24px; }
.w-full       { width: 100%; }
.grid-2       { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3       { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.text-muted   { color: var(--text-muted); }
.text-head    { color: var(--text-head); }
.text-indigo  { color: var(--indigo-600); }
.text-strong  { font-weight: 500; color: var(--text-head); }
.text-sm      { font-size: 12px; }
.text-xs      { font-size: 11px; }
.mono         { font-family: var(--font-mono); }
.mono-sm      { font-family: var(--font-mono); font-size: 12px; }
.font-mono    { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }
.divider      { height: 1px; background: var(--border); margin: 16px 0; }
.divider-sm   { height: 1px; background: var(--border); margin: 4px 0; }
.dark-panel   { background: var(--ink-950); border-radius: var(--radius-lg); padding: 32px; }

/* ══════════════════════════════════════════════════
   COMPONENT: TOGGLE — SMALL VARIANT
══════════════════════════════════════════════════ */
.toggle-sm { width: 28px; height: 16px; }
.toggle-sm .toggle-thumb { width: 10px; height: 10px; top: 3px; left: 3px; }
.toggle-sm input:checked ~ .toggle-thumb { transform: translateX(12px); }

/* ══════════════════════════════════════════════════
   COMPONENT: DROPDOWN
══════════════════════════════════════════════════ */
.dropdown { position: relative; display: inline-flex; }

.dropdown-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  min-width: 172px; z-index: 200;
  display: none; flex-direction: column;
  padding: 4px;
  /* Prevent hover bleed from table row */
  pointer-events: none;
}
.dropdown-menu.open { display: flex; pointer-events: auto; }

.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  font-size: 13px; font-family: var(--font-body);
  color: var(--text-base);
  border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none;
  transition: background 0.1s, color 0.1s;
  user-select: none;
  border: none; background: none; width: 100%; text-align: left;
}
.dropdown-item i { font-size: 15px; color: var(--text-muted); flex-shrink: 0; }
.dropdown-item:hover { background: var(--bg-surface); color: var(--text-head); }
.dropdown-item:hover i { color: var(--text-base); }
.dropdown-item-danger { color: var(--red-600); }
.dropdown-item-danger i { color: var(--red-600); }
.dropdown-item-danger:hover { background: var(--red-50); color: var(--red-700); }
.dropdown-item-danger:hover i { color: var(--red-700); }

.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; flex-shrink: 0; }

/* ══════════════════════════════════════════════════
   COMPONENT: SIDEBAR (light + dark variants)
══════════════════════════════════════════════════ */

/* Base — light */
.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
}
.sidebar-logo {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.logo-mark {
  width: 30px; height: 30px;
  background: var(--ink-950);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: white;
}
.logo-text { flex: 1; min-width: 0; }
.logo-name {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600; color: var(--text-head);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.logo-handle { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }
.sidebar-nav { flex: 1; padding: 6px 8px; }
.sidebar-footer {
  flex-shrink: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user { flex: 1; min-width: 0; }
.sidebar-user-name  { font-size: 12px; font-weight: 500; color: var(--text-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-settings-btn {
  color: var(--text-placeholder); cursor: pointer;
  border: none; background: none; padding: 4px; border-radius: 4px;
  display: flex; align-items: center;
  transition: background 0.1s, color 0.1s;
}
.sidebar-settings-btn:hover { background: var(--border); color: var(--text-head); }

/* Dark variant — use on <aside class="sidebar sidebar-dark"> */
.sidebar-dark {
  /*background: #18181b;*/
  background: #1b1b21;
  border-right-color: rgba(255,255,255,0.07);
}
.sidebar-dark .sidebar-logo    { border-bottom-color: rgba(255,255,255,0.07); }
.sidebar-dark .sidebar-footer  { border-top-color: rgba(255,255,255,0.07); }
.sidebar-dark .nav-section-label { color: #3f3f46; }
.sidebar-dark .nav-item        { color: #9898ad; }
.sidebar-dark .nav-item i      { opacity: 0.7; }
.sidebar-dark .nav-item:hover  { background: rgba(255,255,255,0.05); color: #e4e4e7; }
.sidebar-dark .nav-item:hover i { opacity: 1; }
.sidebar-dark .nav-item.active { background: var(--ink-950); color: #fff; }
.sidebar-dark .nav-item.active i { opacity: 1; }
.sidebar-dark .nav-item-arrow  { color: #3f3f46; }
.sidebar-dark .logo-name       { color: #e4e4e7; }
.sidebar-dark .logo-handle     { color: #3f3f46; }
.sidebar-dark .logo-mark       { background: #2d2d38; }
.sidebar-dark .sidebar-user-name  { color: #e4e4e7; }
.sidebar-dark .sidebar-user-email { color: #52525b; }
.sidebar-dark .sidebar-settings-btn { color: #3f3f46; }
.sidebar-dark .sidebar-settings-btn:hover { background: rgba(255,255,255,0.07); color: #e4e4e7; }

/* Nav items — shared between light and dark (dark overrides above) */
.nav-section-label {
  font-size: 10px; font-weight: 600;
  color: var(--text-placeholder);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 14px 8px 4px;
}

.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 400;
  color: var(--zn-600);
  cursor: pointer; text-decoration: none;
  transition: background 0.1s, color 0.1s;
  user-select: none;
}
.nav-item i           { font-size: 16px; flex-shrink: 0; opacity: 0.8; }
.nav-item-label       { flex: 1; }
.nav-item-arrow       { font-size: 14px; color: var(--text-placeholder); flex-shrink: 0; }
.nav-item:hover       { background: color-mix(in srgb, var(--ink-950) 8%, transparent); color: var(--zn-900); }
.nav-item:hover i     { opacity: 1; }
.nav-item.active      { background: var(--ink-950); color: #fff; font-weight: 500; }
.nav-item.active i    { opacity: 1; }

/* ══════════════════════════════════════════════════
   COMPONENT: PAGE HEADER & BREADCRUMB
══════════════════════════════════════════════════ */
.page-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 32px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}
.page-header-left { display: flex; flex-direction: column; gap: 3px; }
.page-actions     { display: flex; align-items: center; gap: 8px; }

.page-header:has(+ .tabs) {
  border-bottom: none;
  padding-bottom: 4px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600;
  color: var(--text-head); letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 8px;
  line-height: 1.2;
}

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
}
.breadcrumb a          { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover    { color: var(--text-head); }
.breadcrumb-sep        { color: var(--border-2); }

/* ══════════════════════════════════════════════════
   COMPONENT: TABS
══════════════════════════════════════════════════ */
.tabs {
  display: flex; align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  background: var(--bg-card);
  flex-shrink: 0;
}
.tab {
  padding: 10px 14px; font-size: 13px; font-weight: 400;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  text-decoration: none; user-select: none;
}
.tab:hover  { color: var(--text-head); }
.tab.active { color: var(--ink-950); font-weight: 500; border-bottom-color: var(--ink-950); }

/* ══════════════════════════════════════════════════
   COMPONENT: DETAIL SECTION (info rows)
══════════════════════════════════════════════════ */
/* Scrollable area inside a flex detail-section (pair with a height/max-height class) */
.table-scroll { flex: 1; overflow-y: auto; min-height: 0; }

.detail-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.detail-section-header {
  min-height: 44px; padding: 0 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-surface);
}
/* Align button text with card edge (matches the 20px left inset of the section title) */
.detail-section-header > .btn { margin-right: -8px; }
.detail-section-title {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600;
  color: var(--text-head); letter-spacing: -0.01em;
}

/* Non-row body content inside a detail-section (tags, notes, timelines) */
.detail-section-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 16px; }

/* Each row: fixed height, label / value two-col grid */
.detail-row {
  display: grid; grid-template-columns: 100px 1fr;
  gap: 8px; padding: 0 20px;
  min-height: 40px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.detail-row:last-child { border-bottom: none; }
/* Multi-line rows (addresses, notes) override alignment */
.detail-row.align-top { align-items: start; padding-top: 10px; padding-bottom: 10px; min-height: 0; }

.detail-label { font-size: 12px; color: var(--text-muted); }
.detail-value { text-align: right; font-size: 13px; color: var(--text-head); min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.detail-value:has(.toggle) {
  display: flex;
  justify-content: flex-end;
}

/* ══════════════════════════════════════════════════
   COMPONENT: TIMELINE
══════════════════════════════════════════════════ */
.timeline { padding: 16px 20px; display: flex; flex-direction: column; }
.timeline-item {
  display: flex; gap: 12px;
  padding-bottom: 20px; position: relative;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child)::before {
  content: ''; position: absolute;
  left: 14px; top: 30px; bottom: 0;
  width: 1px; background: var(--border);
}
.timeline-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 13px; color: var(--text-muted);
}
.timeline-dot.success { background: #f0fdf9; border-color: #bbf7d0; color: #16a37a; }
.timeline-dot.warning { background: var(--orange-50); border-color: rgba(234,88,12,0.3); color: var(--orange-600); }
.timeline-dot.indigo  { background: var(--indigo-100); border-color: rgba(79,70,229,0.25); color: var(--indigo-600); }

.timeline-content  { flex: 1; padding-top: 4px; }
.timeline-event    { font-size: 13px; color: var(--text-head); font-weight: 500; margin-bottom: 2px; }
.timeline-meta     { font-size: 12px; color: var(--text-muted); }
.timeline-time     { font-family: var(--font-mono); font-size: 11px; color: var(--text-placeholder); margin-top: 3px; }

/* ══════════════════════════════════════════════════
   COMPONENT: PAGINATION
══════════════════════════════════════════════════ */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-top: 1px solid var(--border);
}
.pagination-info { font-size: 12px; color: var(--text-muted); }
.page-btns       { display: flex; align-items: center; gap: 4px; }
.page-btn {
  min-width: 28px; height: 28px; padding: 0 8px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-card); font-size: 12px; color: var(--text-base);
  cursor: pointer; font-family: var(--font-body);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.1s; user-select: none;
}
.page-btn:hover    { background: var(--bg-surface); }
.page-btn.active   { background: var(--ink-950); color: white; border-color: var(--ink-950); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.page-btn i { font-size: 12px; }

/* ══════════════════════════════════════════════════
   COMPONENT: TABLE CARD
══════════════════════════════════════════════════ */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-card .table th:first-child,
.table-card .table td:first-child { padding-left: 20px; }
.table-card .table th:last-child,
.table-card .table td:last-child  { padding-right: 20px; text-align: right; }
.table-card .table td { vertical-align: middle; }

/* ══════════════════════════════════════════════════
   COMPONENT: NOTICE BAR
══════════════════════════════════════════════════ */
.notice-bar {
  padding: 8px 28px;
  background: var(--orange-50);
  border-bottom: 1px solid rgba(234,88,12,0.18);
  font-size: 12px; color: var(--zn-700);
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.notice-bar i { color: var(--orange-600); font-size: 15px; }
.notice-bar a { color: var(--orange-600); font-weight: 500; }


/* ══════════════════════════════════════════════════
   COMPONENT: FILTER BAR
══════════════════════════════════════════════════ */

.search-field { position: relative; flex-shrink: 0; }
.search-field > i {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-placeholder); font-size: 14px;
  pointer-events: none;
}

.search-input { min-width: 240px; padding-left: 32px;  }

/* Right-aligns last item in filter-bar (column toggle etc.) */
.filter-bar-end { margin-left: auto; }

/* Right-aligned table column */
.col-right, th.col-right, td.col-right { text-align: right; }

.filter-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-page);
  flex-shrink: 0;
}

.filter-bar .input {
/*  height: var(--el-h-sm);*/
}

/* In a filter-bar, selects should auto-size and match the sm height */
.filter-bar select.input { width: auto; }

.search-input { min-width: 240px; }
.filter-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════
   COMPONENT: CUSTOMER CELL (table row pattern)
══════════════════════════════════════════════════ */
.customer-cell { display: flex; align-items: center; gap: 10px; }
.customer-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  flex-shrink: 0;
}
.customer-name  { font-weight: 500; color: var(--text-head); font-size: 13px; }
.customer-email { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.row-link { cursor: pointer; }
.row-link:hover td { background: var(--bg-surface) !important; }

.actions-cell { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
/* When used directly on a <td>, restore table-cell display to prevent border misalignment */
td.actions-cell { display: table-cell; vertical-align: middle; text-align: right; padding-right: 4px; }

/* ══════════════════════════════════════════════════
   COMPONENT: PLAN CHIP
══════════════════════════════════════════════════ */
.plan-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: var(--radius-sm);
  background: var(--bg-surface); border: 1px solid var(--border);
  font-size: 11px; font-weight: 500; color: var(--text-base);
  font-family: var(--font-body);
}

/* ══════════════════════════════════════════════════
   COMPONENT: PAYMENT ROW
══════════════════════════════════════════════════ */
.payment-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; border-bottom: 1px solid var(--border);
}
.payment-row:last-child { border-bottom: none; }
.payment-row:hover { background: var(--bg-surface); }
.payment-info { flex: 1; }
.payment-id     { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.payment-date   { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.payment-amount { font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--text-head); }

/* ══════════════════════════════════════════════════
   COMPONENT: ACTION CARD (side panel card)
══════════════════════════════════════════════════ */
.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.action-card-header {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.action-card-title {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600; color: var(--text-head);
}
.action-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }

/* ══════════════════════════════════════════════════
   COMPONENT: NEXT BILLING BOX
══════════════════════════════════════════════════ */
.next-billing-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 4px;
}
.next-billing-label  { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.next-billing-date   { font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--text-head); }
.next-billing-amount { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ══════════════════════════════════════════════════
   COMPONENT: EMPTY STATE
══════════════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 56px 24px;
  color: var(--text-muted);
}
.empty-state i { font-size: 40px; color: var(--border-2); display: block; margin: 0 auto 12px; }
.empty-state p { font-size: 13px; }

/* ══════════════════════════════════════════════════
   COMPONENT: INLINE META
══════════════════════════════════════════════════ */
.inline-meta {
  display: flex; align-items: center; gap: 16px;
  font-size: 12px; color: var(--text-muted);
}
.inline-meta i { font-size: 13px; }
.inline-meta span { display: flex; align-items: center; gap: 4px; }


/* ── COMING SOON FOOTER (minimal) ── */
.b-footer-cs {
  background: #07090c; border-top: 1px solid rgba(255,255,255,0.07);
  padding: 40px 0 28px; position: relative; overflow: hidden;
}
.b-footer-cs-iso {
  position: absolute; right: -60px; top: 50%; transform: translateY(-50%);
  width: 420px; opacity: 0.04; pointer-events: none; user-select: none;
}
.b-footer-cs-inner {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 40px;
  margin-bottom: 28px;
}
.b-footer-cs-links { display: flex; gap: 28px; padding-top: 4px; }
.b-footer-cs-link {
  font-size: 13px; color: rgba(148,163,184,0.65);
  transition: color 0.12s;
}
.b-footer-cs-link:hover { color: #fff; }
.b-footer-cs-bar {
  border-top: 1px solid rgba(255,255,255,0.06); padding-top: 20px;
}