/* =========================================================================
   Atheer v2 · BRIDGE SKIN
   Upgrades ALL existing v1 pages to the Yeastar-grade v2 look WITHOUT
   touching page logic. Maps legacy class names (.btn, .table, .badge,
   .search-input, .form-control, .page, .page-content...) onto v2 tokens.
   Loaded LAST so it wins over refine.css / saas-polish.css.
   Targets BOTH button conventions: btn--primary (BEM) and btn-primary.
   Scope: only legacy classes — never touches .at-* (v2 native) components.
   ========================================================================= */

/* ── Page container rhythm ──────────────────────────────────────────── */
.page, .page-content {
  font-family: var(--at-font-base);
}

/* ── Buttons (both .btn--x and .btn-x conventions) ──────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  font-family: var(--at-font-base);
  font-size: 13px; font-weight: 600; line-height: 1;
  border-radius: 4px;
  border: 1px solid var(--at-border-strong, #cbd5e1);
  background: var(--at-surface-1, #fff);
  color: var(--at-text-primary, #0f172a);
  cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .06s;
  box-shadow: 0 1px 1px rgba(15,23,42,.03);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--at-surface-2, #f1f5f9); border-color: var(--at-border-hover, #94a3b8); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(15,98,254,.18); }
.btn .icon, .btn .material-symbols-rounded { font-size: 18px; }

.btn--sm, .btn-sm { height: 32px; padding: 0 11px; font-size: 12px; }
.btn--xs, .btn-xs {
  height: 28px; width: auto; min-width: 28px; padding: 0 8px; font-size: 12px;
  border-radius: 4px;
}
.btn--lg, .btn-lg { height: 40px; padding: 0 18px; font-size: 15px; }

.btn--primary, .btn-primary {
  background: var(--at-accent, #0f62fe); border-color: var(--at-accent, #0f62fe);
  color: #fff; box-shadow: 0 1px 2px rgba(15,98,254,.18);
}
.btn--primary:hover, .btn-primary:hover {
  background: var(--at-accent-hover, #0c54d7); border-color: var(--at-accent-hover, #0c54d7);
  box-shadow: 0 2px 4px rgba(15,98,254,.28);
}
.btn--danger, .btn-danger {
  background: var(--at-danger, #dc2626); border-color: var(--at-danger, #dc2626); color: #fff;
}
.btn--danger:hover, .btn-danger:hover { filter: brightness(.95); }
.btn--danger-ghost, .btn-danger-ghost, .btn-danger-outline {
  background: transparent; border-color: transparent; color: var(--at-danger, #dc2626);
  box-shadow: none;
}
.btn--danger-ghost:hover, .btn-danger-ghost:hover { background: var(--at-danger-bg, #fef2f2); }
.btn--outline, .btn-outline, .btn--secondary, .btn-secondary {
  background: var(--at-surface-1, #fff); border-color: var(--at-border-strong, #cbd5e1);
  color: var(--at-text-primary);
}
.btn--ghost, .btn-ghost {
  background: transparent; border-color: transparent; color: var(--at-text-secondary, #334155);
  box-shadow: none;
}
.btn--ghost:hover, .btn-ghost:hover { background: var(--at-surface-2, #f1f5f9); color: var(--at-text-primary); }
.btn:disabled, .btn[disabled] {
  opacity: 1; background: var(--at-surface-1, #fff) !important;
  border-color: var(--at-border, #e2e8f0) !important;
  color: var(--atheer-gray-400, #94a3b8) !important;
  cursor: not-allowed; box-shadow: none !important;
}

/* ── Inputs / selects / search ──────────────────────────────────────── */
.search-input, .form-control, input.input,
input[type="text"].form-control, input[type="email"].form-control,
input[type="tel"].form-control, input[type="number"].form-control,
input[type="password"].form-control, input[type="search"].form-control,
select.form-control, textarea.form-control {
  height: 36px; padding: 0 12px;
  font-family: var(--at-font-base); font-size: 13px;
  color: var(--at-text-primary, #0f172a);
  background: var(--at-surface-1, #fff);
  border: 1px solid var(--at-border-strong, #cbd5e1);
  border-radius: 4px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea.form-control { height: auto; min-height: 90px; padding: 8px 12px; }
.search-input:focus, .form-control:focus {
  border-color: var(--at-accent, #0f62fe);
  box-shadow: 0 0 0 3px rgba(15,98,254,.15);
}
.search-input::placeholder, .form-control::placeholder { color: var(--at-text-muted, #64748b); }

/* ── Tables ─────────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--at-surface-1, #fff);
  border: 1px solid var(--at-border, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  overflow-x: auto;
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; font-family: var(--at-font-base); }
.table thead th {
  text-align: start; padding: 11px 14px;
  background: var(--at-surface-1, #fff);
  border-bottom: 1px solid var(--at-border-strong, #cbd5e1);
  font-size: 12px; font-weight: 600;
  color: var(--at-text-secondary, #334155);
  white-space: nowrap;
}
.table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--at-border, #e2e8f0);
  color: var(--at-text-primary, #0f172a);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--at-surface-0, #f8fafc); }

/* ── Badges ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-family: var(--at-font-base); font-size: 11.5px; font-weight: 600;
  line-height: 1.4; border: 1px solid transparent; white-space: nowrap;
}
.badge--success, .badge-success, .badge--ok { color: var(--at-success,#10b981); background: var(--at-success-bg,#ecfdf5); border-color: var(--at-success,#10b981); }
.badge--info, .badge-info       { color: var(--at-info,#0284c7);    background: var(--at-info-bg,#eff6ff);    border-color: var(--at-info,#0284c7); }
.badge--warning, .badge-warning { color: var(--at-warning,#f59e0b); background: var(--at-warning-bg,#fffbeb); border-color: var(--at-warning,#f59e0b); }
.badge--error, .badge-error, .badge--danger { color: var(--at-danger,#dc2626); background: var(--at-danger-bg,#fef2f2); border-color: var(--at-danger,#dc2626); }
.badge--neutral, .badge-neutral { color: var(--at-text-secondary,#334155); background: var(--at-surface-2,#f1f5f9); border-color: var(--at-border,#e2e8f0); }

/* ── Cards / surfaces commonly used in v1 ──────────────────────────── */
.card, .panel, .surface-card {
  background: var(--at-surface-1, #fff);
  border: 1px solid var(--at-border, #e2e8f0);
  border-radius: 12px;
}

/* ── Page header (v1 helper output) ────────────────────────────────── */
.page-header, .page__header {
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--at-border, #e2e8f0);
}
.page-header h1, .page-header .page-title, .page__title {
  font-size: 20px; font-weight: 700; letter-spacing: -.2px;
  color: var(--at-text-primary, #0f172a);
}

/* ── Breadcrumb (v1) ───────────────────────────────────────────────── */
.breadcrumb, .page-breadcrumb { font-size: 12.5px; color: var(--at-text-muted, #64748b); }
.breadcrumb a, .page-breadcrumb a { color: var(--at-text-muted, #64748b); text-decoration: none; }
.breadcrumb a:hover { color: var(--at-text-link, #0c54d7); }

/* ── Empty / loading / error states (v1 helpers) ──────────────────── */
.empty-state, .loading-state, .error-state {
  padding: 48px 24px; text-align: center; color: var(--at-text-secondary, #334155);
  font-family: var(--at-font-base);
}
.empty-state .material-symbols-rounded, .empty-state .icon { color: var(--at-text-muted, #64748b); }

/* ── Tabs (v1) ──────────────────────────────────────────────────────── */
.tabs, .tab-nav { border-bottom: 1px solid var(--at-border, #e2e8f0); }
.tab, .tab-item {
  font-family: var(--at-font-base); font-size: 13.5px; font-weight: 600;
  color: var(--at-text-secondary, #334155);
}
.tab--active, .tab-item.active, .tab[aria-selected="true"] {
  color: var(--at-accent, #0f62fe); border-bottom-color: var(--at-accent, #0f62fe);
}

/* =========================================================================
   v2 Bridge · EXTENDED COVERAGE
   Covers the dominant real conventions found across all 87 pages:
   .input (193×), .select, .data-table + *-table, badge--accent, btn-icon,
   stat-card, kpi-*, form-card, panel. Never touches .at-* (v2 native).
   ========================================================================= */

/* ── Inputs: the dominant .input + .select ─────────────────────────── */
input.input, select.input, textarea.input,
.input:not(.at-input):not(button),
select.select, .select:not(.at-input) {
  height: 36px; padding: 0 12px;
  font-family: var(--at-font-base); font-size: 13px;
  color: var(--at-text-primary, #0f172a);
  background: var(--at-surface-1, #fff);
  border: 1px solid var(--at-border-strong, #cbd5e1);
  border-radius: 4px; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 90px; padding: 8px 12px; line-height: 1.5; }
input.input:focus, select.input:focus, textarea.input:focus,
.input:focus:not(.at-input), select.select:focus {
  border-color: var(--at-accent, #0f62fe);
  box-shadow: 0 0 0 3px rgba(15,98,254,.15);
}
input.input::placeholder, textarea.input::placeholder, .input::placeholder { color: var(--at-text-muted, #64748b); }

/* ── ALL data tables (data-table, containers-table, backups-table, …) ─ */
.page table:not(.at-grid__table),
.page-content table:not(.at-grid__table),
table.data-table, table.stable {
  width: 100%; border-collapse: collapse;
  font-size: 13px; font-family: var(--at-font-base);
  background: var(--at-surface-1, #fff);
}
.page table:not(.at-grid__table) thead th,
.page-content table:not(.at-grid__table) thead th,
table.data-table thead th {
  text-align: start; padding: 11px 14px;
  background: var(--at-surface-1, #fff);
  border-bottom: 1px solid var(--at-border-strong, #cbd5e1);
  font-size: 12px; font-weight: 600;
  color: var(--at-text-secondary, #334155); white-space: nowrap;
}
.page table:not(.at-grid__table) tbody td,
.page-content table:not(.at-grid__table) tbody td,
table.data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--at-border, #e2e8f0);
  color: var(--at-text-primary, #0f172a); vertical-align: middle;
}
.page table:not(.at-grid__table) tbody tr:last-child td,
table.data-table tbody tr:last-child td { border-bottom: none; }
.page table:not(.at-grid__table) tbody tr:hover td,
.page-content table:not(.at-grid__table) tbody tr:hover td,
table.data-table tbody tr:hover td { background: var(--at-surface-0, #f8fafc); }

/* wrap any standalone data-table in a rounded card border */
table.data-table { border: 1px solid var(--at-border, #e2e8f0); border-radius: 10px; overflow: hidden; }

/* ── Badge variants (single + double dash + extras) ─────────────────── */
.badge--accent, .badge-accent, .badge-primary, .badge--primary { color: var(--at-accent,#0f62fe); background: var(--at-accent-soft-bg,#e0ebff); border-color: var(--at-accent,#0f62fe); }
.badge-secondary, .badge--secondary, .badge-gray, .badge--gray { color: var(--at-text-secondary,#334155); background: var(--at-surface-2,#f1f5f9); border-color: var(--at-border,#e2e8f0); }
.badge-green, .badge--green, .badge--owner { color: var(--at-success,#10b981); background: var(--at-success-bg,#ecfdf5); border-color: var(--at-success,#10b981); }
.badge--xs { padding: 2px 7px; font-size: 11px; }
.badge-dot::before, .badge--dot::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; display:inline-block; }

/* ── Button extras: icon-only, close, warning, cancel, accent ───────── */
.btn-icon, .btn--icon {
  width: 32px; min-width: 32px; padding: 0; justify-content: center;
}
.btn-icon.btn-sm, .btn--icon.btn--sm { width: 30px; min-width: 30px; }
.btn-warning, .btn--warning { background: var(--at-warning,#f59e0b); border-color: var(--at-warning,#f59e0b); color: #fff; }
.btn--cancel, .btn-cancel { background: transparent; border-color: var(--at-border-strong,#cbd5e1); color: var(--at-text-secondary,#334155); box-shadow: none; }
.btn--accent, .btn-accent { background: var(--at-accent,#0f62fe); border-color: var(--at-accent,#0f62fe); color: #fff; }
.btn-close, .btn--close {
  width: 32px; min-width: 32px; padding: 0; justify-content: center;
  background: transparent; border-color: transparent; box-shadow: none;
  color: var(--at-text-muted,#64748b);
}
.btn-close:hover, .btn--close:hover { background: var(--at-surface-2,#f1f5f9); color: var(--at-text-primary); }

/* ── Cards: stat-card, form-card, panel, kpi tiles ──────────────────── */
.stat-card, .form-card, .panel, .kpi-tile {
  background: var(--at-surface-1, #fff);
  border: 1px solid var(--at-border, #e2e8f0);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.stat-card:hover, .kpi-tile:hover { border-color: var(--at-border-hover, #94a3b8); }
.kpi-label { font-size: 12px; color: var(--at-text-muted,#64748b); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.kpi-value { font-size: 26px; font-weight: 700; color: var(--at-text-primary,#0f172a); line-height: 1.1; }

/* ── Misc text utilities used in v1 ─────────────────────────────────── */
.text-muted  { color: var(--at-text-muted, #64748b); }
.text-small  { font-size: 12px; }
code, .text-mono { font-family: var(--at-font-mono, monospace); }

/* =========================================================================
   v2 Bridge · FORMS · TABS · SETTINGS · PERMISSIONS (internal pages)
   Makes every edit form / settings page / permission page look Yeastar-grade
   (e.g. "Edit Extension" 9-tab workspace) — CSS only, no logic touched.
   ========================================================================= */

/* ── Tab bar (edit-extension style: horizontal, accent underline) ───── */
.tab-bar, .tabs, .tabs__nav, .tab-nav {
  display: flex; flex-wrap: wrap; gap: 2px;
  border-bottom: 1.5px solid var(--at-border, #e2e8f0);
  margin-bottom: 20px; padding-bottom: 0;
}
.tabs__item, .tab, .tab-item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 16px;
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--at-font-base); font-size: 13.5px; font-weight: 600;
  color: var(--at-text-secondary, #334155);
  cursor: pointer; white-space: nowrap;
  transition: color .12s, border-color .12s;
  margin-bottom: -1.5px;
}
.tabs__item .icon, .tab .icon { font-size: 18px; }
.tabs__item:hover, .tab:hover { color: var(--at-text-primary, #0f172a); }
.tabs__item.is-active, .tab.is-active, .tab--active, .tab[aria-selected="true"],
.tab-item.active {
  color: var(--at-accent, #0f62fe);
  border-bottom-color: var(--at-accent, #0f62fe);
}
.tabs__item.is-active .icon { color: var(--at-accent, #0f62fe); }
.tabs__item--planned, .tabs__item:disabled {
  color: var(--at-text-disabled, #94a3b8); cursor: default;
}
.tabs__item--planned:hover { color: var(--at-text-disabled, #94a3b8); }

/* ── Form sections (cards, like Yeastar grouped settings) ───────────── */
.form-section, .settings-section, .form-card {
  background: var(--at-surface-1, #fff);
  border: 1px solid var(--at-border, #e2e8f0);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 16px;
}
.form-section__title, .form-section > h3, .section-title,
.settings-section__title, .form-card__title {
  font-size: 15px; font-weight: 700; margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--at-border, #e2e8f0);
  color: var(--at-text-primary, #0f172a);
}

/* ── Form grid: label + control rows (Yeastar two-column form) ─────── */
.form-grid {
  display: grid; grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 14px 20px; align-items: center;
}
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; gap: 6px 0; } }

.form-field, .form-group, .field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px; min-width: 0;
}
.form-field:last-child, .form-group:last-child { margin-bottom: 0; }
.form-label, .field-label, .form-field > label, .form-group > label {
  font-size: 13px; font-weight: 600;
  color: var(--at-text-primary, #0f172a); line-height: 1.4;
}
.form-hint, .field-hint, .form-help { font-size: 12px; color: var(--at-text-muted, #64748b); line-height: 1.5; }
.form-error, .field-error { font-size: 12px; color: var(--at-danger, #dc2626); font-weight: 500; }
.required::after, label[data-required]::after { content: " *"; color: var(--at-danger, #dc2626); }

/* constrain form inputs to a comfortable width (not full page) */
.form-field input.input, .form-field select.input, .form-field .input,
.form-group input.input, .form-group select.input,
.form-grid input.input, .form-grid select.input, .form-grid .input {
  max-width: 420px;
}
.form-field input[type="number"].input, .form-grid input[type="number"].input { max-width: 160px; }

/* ── Form actions (footer buttons) ─────────────────────────────────── */
.form-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding-top: 16px; margin-top: 8px;
  border-top: 1px solid var(--at-border, #e2e8f0);
}

/* ── Checkbox / radio (accent — settings toggles) ──────────────────── */
input[type="checkbox"].checkbox, input[type="checkbox"], .checkbox input,
input[type="radio"], .radio input {
  width: 16px; height: 16px; accent-color: var(--at-accent, #0f62fe);
  cursor: pointer; vertical-align: middle;
}
.checkbox, .checkbox-label, .radio, .radio-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--at-text-primary, #0f172a); cursor: pointer;
}

/* ── Generic sections / key-value rows (permissions, details) ──────── */
.section { margin-bottom: 20px; }
.kv-row, .kvrow, .detail-row, .info-row, .setting-item, .perm-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 11px 0;
  border-bottom: 1px solid var(--at-border, #f1f5f9);
  font-size: 13px;
}
.kv-row:last-child, .detail-row:last-child, .setting-item:last-child { border-bottom: none; }
.kv-row > .label, .detail-row > .label, .setting-item > .label,
.kv-row dt, .detail-row dt { color: var(--at-text-muted, #64748b); }
.kv-row > .value, .detail-row > .value, .kv-row dd, .detail-row dd {
  color: var(--at-text-primary, #0f172a); font-weight: 600; margin: 0;
}

/* ── Toggle-switch look for boolean settings rows (where used) ─────── */
.toggle-switch, .switch {
  position: relative; display: inline-block; width: 40px; height: 22px;
}
.toggle-switch input, .switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider, .switch .slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--at-border-strong, #cbd5e1); border-radius: 999px;
  transition: background .2s;
}
.toggle-switch .slider::before, .switch .slider::before {
  content: ""; position: absolute; height: 16px; width: 16px;
  inset-inline-start: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: transform .2s;
}
.toggle-switch input:checked + .slider, .switch input:checked + .slider { background: var(--at-accent, #0f62fe); }
.toggle-switch input:checked + .slider::before, .switch input:checked + .slider::before { transform: translateX(18px); }
[dir="rtl"] .toggle-switch input:checked + .slider::before,
[dir="rtl"] .switch input:checked + .slider::before { transform: translateX(-18px); }

/* .form-input (used in CDR filters, queue AI, etc.) */
input.form-input, select.form-input, textarea.form-input, .form-input:not(.at-input) {
  height: 36px; padding: 0 12px; font-family: var(--at-font-base); font-size: 13px;
  color: var(--at-text-primary); background: var(--at-surface-1);
  border: 1px solid var(--at-border-strong); border-radius: 4px; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea.form-input { height: auto; min-height: 80px; padding: 8px 12px; }
.form-input:focus { border-color: var(--at-accent); box-shadow: 0 0 0 3px rgba(15,98,254,.15); }
.filters-bar { background: var(--at-surface-1) !important; border-color: var(--at-border) !important; border-radius: 8px !important; }

/* =========================================================================
   v2 Bridge · SHARED COMPONENTS (Modal · Drawer · Field · Tabs · DataTable)
   Restyles the output classes of components.js so EVERY modal, drawer, form
   field, tab, and table across ALL 59 pages adopts the v2 Yeastar look —
   comprehensively, with zero logic change. Loaded last → overrides components.css.
   ========================================================================= */

/* ── Modal (component.js Modal) ─────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: var(--at-z-modal, 3000);
  background: var(--at-overlay, rgba(15,23,42,.45));
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: at-fade-in var(--at-duration-normal, .2s) var(--at-ease-out);
}
.modal {
  background: var(--at-surface-1, #fff);
  border-radius: var(--at-radius-lg, 12px);
  box-shadow: var(--at-shadow-xl, 0 16px 40px rgba(15,23,42,.18));
  width: 100%; max-width: 540px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; overflow: hidden;
  font-family: var(--at-font-base);
  animation: at-modal-up 240ms var(--at-ease-out);
}
.modal--sm { max-width: 420px; } .modal--lg { max-width: 760px; } .modal--xl { max-width: 1040px; }
.modal__header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--at-border, #e2e8f0);
}
.modal__title { margin: 0; font-size: var(--at-text-md, 15px); font-weight: 700; color: var(--at-text-primary); }
.modal__body { padding: 18px 20px; overflow-y: auto; color: var(--at-text-secondary); font-size: var(--at-text-base, 13.5px); line-height: 1.55; }
.modal__footer {
  display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px;
  border-top: 1px solid var(--at-border, #e2e8f0); background: var(--at-surface-0, #f8fafc);
}

/* ── Drawer (component.js Drawer) ──────────────────────────────────── */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: var(--at-z-drawer, 2000);
  background: var(--at-overlay, rgba(15,23,42,.45));
  display: flex; justify-content: flex-end;
  animation: at-fade-in var(--at-duration-fast, .12s) var(--at-ease-out);
}
.drawer {
  width: 100%; max-width: 460px; height: 100vh; background: var(--at-surface-1, #fff);
  display: flex; flex-direction: column; font-family: var(--at-font-base);
  box-shadow: var(--at-shadow-xl);
}
.drawer__header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--at-border, #e2e8f0);
}
.drawer__title { margin: 0; font-size: var(--at-text-md, 15px); font-weight: 700; color: var(--at-text-primary); }
.drawer__body { flex: 1; padding: 16px 20px; overflow-y: auto; }
.drawer__footer {
  display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px;
  border-top: 1px solid var(--at-border, #e2e8f0); background: var(--at-surface-0, #f8fafc);
}

/* ── icon-btn (used in modals/drawers/rows) ────────────────────────── */
.icon-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: var(--at-radius-sm, 6px);
  color: var(--at-text-muted, #64748b); cursor: pointer; transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--at-surface-2, #f1f5f9); color: var(--at-text-primary); }
.icon-btn .icon, .icon-btn .material-symbols-rounded { font-size: 18px; }

/* ── Field (component.js Field) ────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--at-text-primary); }
.field__control { display: flex; align-items: center; }
.field__input {
  width: 100%; height: 36px; padding: 0 12px; font-family: var(--at-font-base); font-size: 13px;
  color: var(--at-text-primary); background: var(--at-surface-1, #fff);
  border: 1px solid var(--at-border-strong, #cbd5e1); border-radius: 4px; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea.field__input { height: auto; min-height: 84px; padding: 8px 12px; }
.field__input:focus { border-color: var(--at-accent, #0f62fe); box-shadow: 0 0 0 3px rgba(15,98,254,.15); }
.field__hint { font-size: 12px; color: var(--at-text-muted, #64748b); }

/* ── Tabs component: .tab + .is-active (in addition to .tabs__item) ── */
.tabs .tab, .tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 11px 16px;
  background: transparent; border: none; border-bottom: 2px solid transparent;
  font-family: var(--at-font-base); font-size: 13.5px; font-weight: 600;
  color: var(--at-text-secondary, #334155); cursor: pointer; white-space: nowrap;
  margin-bottom: -1.5px; transition: color .12s, border-color .12s;
}
.tabs .tab:hover { color: var(--at-text-primary); }
.tabs .tab.is-active, .tab.is-active {
  color: var(--at-accent, #0f62fe); border-bottom-color: var(--at-accent, #0f62fe);
}

/* ── DataTable component: .table-wrapper / .table-empty ────────────── */
.table-wrapper {
  background: var(--at-surface-1, #fff); border: 1px solid var(--at-border, #e2e8f0);
  border-radius: 10px; overflow: hidden; overflow-x: auto;
}
.table-empty { padding: 40px 24px; text-align: center; color: var(--at-text-muted, #64748b); font-family: var(--at-font-base); }

/* ── KPICard (component.js) ────────────────────────────────────────── */
.kpi-card, .kpicard {
  background: var(--at-surface-1, #fff); border: 1px solid var(--at-border, #e2e8f0);
  border-radius: 12px; padding: 16px 18px;
}
.kpi-card__value, .kpicard__value { font-size: 26px; font-weight: 700; color: var(--at-text-primary); line-height: 1.1; }
.kpi-card__label, .kpicard__label { font-size: 12px; color: var(--at-text-muted); font-weight: 600; }

/* ── Toast (component.js) — align with v2 ──────────────────────────── */
.toast { font-family: var(--at-font-base); border-radius: 8px; box-shadow: var(--at-shadow-lg); }
