/* ============================================================
   Akmous — components.css
   Bibliothèque de composants unifiée (style Linear).
   Dépend de tokens.css.
   ============================================================ */

/* ---------- Reset léger ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---------- Accessibilité : anneau de focus clavier (WCAG 2.4.7) ---------- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
.btn-icon:focus-visible,
.tab:focus-visible,
.ctab:focus-visible,
.ctab-mode:focus-visible,
.hf:focus-visible,
.coord-cell--editable:focus-visible,
[role="button"]:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}
/* Souris : pas d'anneau (seulement au clavier via :focus-visible) */
:focus:not(:focus-visible) { outline: none; }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-normal);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, textarea, button { font-family: inherit; }

/* ════════════════════════════════════════════════════════════════
   Normalisation globale des icônes Lucide (tout le site).

   Les icônes FontAwesome converties par fa-to-lucide.js rendent un
   <svg class="lucide"> SANS dimension → Lucide applique 24px par
   défaut, ce qui les rend disproportionnées par rapport au DS.
   On fixe une taille de base alignée sur le DS (16px) ; les contextes
   spécifiques (sidebar, boutons, KPIs, bottom-nav…) gardent leurs
   propres tailles via des sélecteurs plus spécifiques (app.css /
   components.css / nav.js).

   On retire aussi tout fond/contour hérité d'un reset legacy sur les
   <i> d'icônes : un SVG d'icône ne doit jamais avoir de fond.
   ════════════════════════════════════════════════════════════════ */
svg.lucide {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  vertical-align: middle;
  stroke-width: 2;
  background: none !important;
  border: none !important;
}
i[data-lucide] {
  background: none !important;
  border: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ============================================================
   TITRES (Inter Display feel — letter-spacing négatif)
   ============================================================ */
.t-display { font-size: var(--text-4xl); font-weight: var(--weight-bold); letter-spacing: var(--tracking-tighter); line-height: var(--leading-tight); }
.t-h1 { font-size: var(--text-3xl); font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); line-height: var(--leading-tight); }
.t-h2 { font-size: var(--text-2xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); line-height: var(--leading-tight); }
.t-h3 { font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
.t-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
.t-body { font-size: var(--text-md); color: var(--text-secondary); line-height: var(--leading-normal); }
.t-muted { color: var(--text-secondary); }
.t-eyebrow {
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  text-transform: uppercase; letter-spacing: var(--tracking-caps);
  color: var(--text-tertiary);
}

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: var(--text-base); font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-normal);
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn .ico { width: 15px; height: 15px; flex-shrink: 0; }

/* Variantes */
.btn-primary   { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover  { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-active); }

.btn-secondary { background: var(--bg-elevated); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover  { background: var(--bg-hover); border-color: var(--text-tertiary); }

.btn-ghost     { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text); }

.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 86%, #000); }

.btn-danger-soft { background: var(--danger-subtle); color: var(--danger-text); border-color: var(--danger-border); }
.btn-danger-soft:hover { background: color-mix(in srgb, var(--danger-subtle) 70%, var(--danger)); color: #fff; }

.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: color-mix(in srgb, var(--success) 86%, #000); }

/* Tailles */
.btn-sm { height: 28px; padding: 0 10px; font-size: var(--text-sm); border-radius: var(--radius-sm); }
.btn-xs { height: 24px; padding: 0 8px; font-size: var(--text-xs); border-radius: var(--radius-sm); gap: 4px; }
.btn-lg { height: 38px; padding: 0 18px; font-size: var(--text-md); }
.btn-block { width: 100%; }

/* Bouton icône carré */
.btn-icon {
  width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg-elevated); color: var(--text-secondary);
  cursor: pointer; transition: var(--t-fast);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text); border-color: var(--text-tertiary); }
.btn-icon.borderless { border-color: transparent; background: transparent; }
.btn-icon.borderless:hover { background: var(--bg-tertiary); }
.btn-icon.sm { width: 28px; height: 28px; }
.btn-icon .ico { width: 16px; height: 16px; }

/* Bouton clavier / kbd */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  font-family: var(--font-sans); font-size: 11px; font-weight: var(--weight-medium);
  color: var(--text-tertiary);
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

/* ============================================================
   INPUTS / FORMULAIRES
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.label {
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--text-secondary);
}
.label .req { color: var(--danger); margin-left: 2px; }
.hint { font-size: var(--text-sm); color: var(--text-tertiary); }

.input, .select, .textarea {
  width: 100%; height: 32px;
  padding: 0 11px;
  font-size: var(--text-base); color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: var(--leading-normal); }
.input::placeholder, .textarea::placeholder { color: var(--text-tertiary); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-tertiary); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.input:disabled, .select:disabled { opacity: 0.55; cursor: not-allowed; }

.select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a8f98' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center;
}

/* Search */
.search { position: relative; display: flex; align-items: center; }
.search .ico {
  position: absolute; left: 10px; width: 15px; height: 15px;
  color: var(--text-tertiary); pointer-events: none;
}
.search .input { padding-left: 32px; background: var(--bg-tertiary); border-color: transparent; }
.search .input:focus { background: var(--bg-elevated); border-color: var(--accent); }

/* Date */
.input[type="date"] { cursor: pointer; }

/* Checkbox / radio (accent natif) */
.check, .radio { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }

/* Switch */
.switch { position: relative; display: inline-flex; width: 36px; height: 20px; cursor: pointer; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: var(--radius-full);
  background: var(--border-strong); transition: background var(--t);
}
.switch .thumb {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%; transition: transform var(--t);
  box-shadow: var(--shadow-sm);
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track + .thumb { transform: translateX(16px); }

/* Segmented control */
.segmented { display: inline-flex; padding: 2px; gap: 2px; background: var(--bg-tertiary); border-radius: var(--radius); border: 1px solid var(--border); }
.segmented button {
  height: 26px; padding: 0 11px; border: none; background: transparent;
  font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-secondary);
  border-radius: var(--radius-sm); cursor: pointer; transition: var(--t-fast);
  display: inline-flex; align-items: center; gap: 5px;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow-xs); }

/* Theme toggle (clair / sombre) — utilisé dans la topbar de toutes les
   pages. Centralisé ici (était dupliqué inline dans plusieurs pages). */
.theme-toggle { display: inline-flex; padding: 2px; gap: 2px; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius); }
.theme-toggle button { width: 28px; height: 26px; border: none; background: transparent; color: var(--text-secondary); border-radius: var(--radius-sm); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle button svg { width: 14px; height: 14px; }
.theme-toggle button.active { background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow-xs); }

/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 8px;
  font-size: var(--text-xs); font-weight: var(--weight-medium);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: currentColor; }

.badge-neutral { background: var(--bg-tertiary); color: var(--text-secondary); border-color: var(--border); }
.badge-accent  { background: var(--accent-subtle);  color: var(--accent-text);  border-color: var(--accent-border); }
.badge-success { background: var(--success-subtle); color: var(--success-text); border-color: var(--success-border); }
.badge-warning { background: var(--warning-subtle); color: var(--warning-text); border-color: var(--warning-border); }
.badge-danger  { background: var(--danger-subtle);  color: var(--danger-text);  border-color: var(--danger-border); }
.badge-info    { background: var(--info-subtle);    color: var(--info-text);    border-color: var(--info-border); }
.badge-purple  { background: var(--c-purple-subtle); color: var(--c-purple-text); border-color: transparent; }

/* Tag carré (filtres, étiquettes) */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 8px;
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--text-secondary);
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tag .x { cursor: pointer; color: var(--text-tertiary); display: inline-flex; }
.tag .x:hover { color: var(--danger); }

/* Référence monospace */
.ref {
  font-family: var(--font-mono); font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--accent-text); background: var(--accent-subtle);
  padding: 1px 7px; border-radius: var(--radius-xs);
}

/* Statut avec point coloré (style Linear) */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: var(--text-base); color: var(--text); }
.status .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.status .dot.ring { background: transparent; border: 2px solid currentColor; box-sizing: border-box; }

/* ============================================================
   AVATARS
   ============================================================ */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--grad-brand); color: #fff;
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  flex-shrink: 0; overflow: hidden;
}
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.avatar.lg { width: 40px; height: 40px; font-size: var(--text-md); border-radius: var(--radius-md); }
.avatar.round { border-radius: 50%; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.card-pad { padding: var(--space-6); }
.card-hover { transition: background var(--t-fast), border-color var(--t-fast); cursor: pointer; }
.card-hover:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: var(--text-md); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
.card-body { padding: 16px; }

/* KPI / stat card */
.stat { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--text-secondary); font-weight: var(--weight-medium); }
.stat-value { font-size: var(--text-2xl); font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); line-height: 1; }
.stat-delta { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-sm); font-weight: var(--weight-medium); }
.stat-delta.up { color: var(--success-text); }
.stat-delta.down { color: var(--danger-text); }

/* ============================================================
   SIDEBAR (navigation principale gauche — style Linear)
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100%;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.sidebar-head {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 12px;
  height: 52px;
}
.sidebar-workspace {
  display: flex; align-items: center; gap: 9px;
  flex: 1; min-width: 0; padding: 5px 7px; border-radius: var(--radius);
  cursor: pointer; transition: background var(--t-fast);
}
.sidebar-workspace:hover { background: var(--bg-hover); }
.sidebar-ws-name { font-size: var(--text-md); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-ws-mark {
  width: 24px; height: 24px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--grad-brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: var(--weight-bold); font-size: 13px;
}

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.sidebar-section { margin-top: 14px; }
.sidebar-section-label {
  padding: 4px 8px; font-size: var(--text-xs); font-weight: var(--weight-semibold);
  color: var(--text-tertiary); letter-spacing: var(--tracking-wide); text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  height: 30px; padding: 0 8px; border-radius: var(--radius);
  font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text-secondary);
  cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
  user-select: none; text-decoration: none;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-subtle); color: var(--accent-text); }
.nav-item.active .nav-ico { color: var(--accent); }
.nav-ico { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-tertiary); }
.nav-item:hover .nav-ico { color: var(--text-secondary); }
.nav-item .nav-count { margin-left: auto; font-size: var(--text-xs); color: var(--text-tertiary); font-weight: var(--weight-medium); }
.nav-item.active .nav-count { color: var(--accent-text); }
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Groupes dépliables (sous-menus) */
.nav-group { display: flex; flex-direction: column; }
.nav-group > .nav-item .nav-caret {
  margin-left: auto; width: 14px; height: 14px; flex-shrink: 0;
  color: var(--text-tertiary); transition: transform var(--t-fast);
}
.nav-group > .nav-item .nav-count + .nav-caret { margin-left: 6px; }
.nav-group.open > .nav-item .nav-caret { transform: rotate(90deg); }
.nav-sub {
  display: none; flex-direction: column; gap: 1px;
  margin: 1px 0 2px 0; padding-left: 8px;
  border-left: 1px solid var(--border); margin-left: 16px;
}
.nav-group.open > .nav-sub { display: flex; }
.nav-sub .nav-item { height: 28px; font-weight: var(--weight-normal); }
.nav-sub .nav-item .nav-label { padding-left: 2px; }
.sidebar.collapsed .nav-sub,
.sidebar.collapsed .nav-caret { display: none; }

.sidebar-foot { padding: 8px; border-top: 1px solid var(--border); }
.sidebar-user {
  display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: var(--radius);
  cursor: pointer; transition: background var(--t-fast);
}
.sidebar-user:hover { background: var(--bg-hover); }
.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-name { font-size: var(--text-base); font-weight: var(--weight-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-mail { font-size: var(--text-xs); color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Collapsed (icon-only) */
.sidebar.collapsed { width: var(--sidebar-collapsed-w); }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-count,
.sidebar.collapsed .sidebar-ws-name,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-user-info { display: none; }
.sidebar.collapsed .nav-item,
.sidebar.collapsed .sidebar-workspace { justify-content: center; padding: 0; }

/* ============================================================
   TOPBAR (contextuelle, dans la zone contenu)
   ============================================================ */
.topbar {
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.topbar-title { font-size: var(--text-md); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
.topbar-spacer { flex: 1; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: var(--text-base); }
.breadcrumb a { color: var(--text-secondary); font-weight: var(--weight-medium); }
.breadcrumb a:hover { color: var(--text); text-decoration: none; }
.breadcrumb .sep { color: var(--text-tertiary); opacity: .6; }
.breadcrumb .current { color: var(--text); font-weight: var(--weight-medium); }

/* ============================================================
   TABLES DENSES (style Linear issues)
   ============================================================ */
.table-wrap { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th {
  position: sticky; top: 0; z-index: 1;
  padding: 8px 14px; text-align: left;
  font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-tertiary);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap; cursor: pointer; user-select: none;
}
.tbl thead th:hover { color: var(--text-secondary); }
.tbl thead th.sorted { color: var(--text); }
.tbl tbody td {
  padding: 0 14px; height: 40px;
  font-size: var(--text-base); color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle; white-space: nowrap;
}
.tbl tbody tr { cursor: pointer; transition: background var(--t-fast); }
.tbl tbody tr:hover td { background: var(--bg-hover); }
.tbl tbody tr.selected td { background: var(--accent-subtle); }
.td-primary { font-weight: var(--weight-medium); }
.td-muted { color: var(--text-secondary); }
.cell-name { display: flex; align-items: center; gap: 9px; }

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.tab {
  position: relative;
  height: 38px; padding: 0 12px; border: none; background: transparent;
  font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text-secondary);
  cursor: pointer; transition: color var(--t-fast);
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab.active::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.tab .tab-count {
  font-size: var(--text-xs); color: var(--text-tertiary);
  background: var(--bg-tertiary); padding: 0 6px; border-radius: var(--radius-full); height: 16px;
  display: inline-flex; align-items: center;
}

/* ============================================================
   MODALES
   ============================================================ */
.overlay {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  background: rgba(8, 9, 10, 0.55);
  backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.overlay.open { display: flex; animation: overlayIn var(--t) ; }
.modal {
  width: 100%; max-width: 460px; max-height: 88vh; overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-overlay);
  display: flex; flex-direction: column;
  animation: modalIn var(--t-slow);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: var(--text-md); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}
.modal-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: none; background: transparent;
  color: var(--text-tertiary); border-radius: var(--radius); cursor: pointer; transition: var(--t-fast);
}
.modal-close:hover { background: var(--bg-tertiary); color: var(--text); }

@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }

/* ============================================================
   TOASTS
   ============================================================ */
.toast {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  font-size: var(--text-base); color: var(--text);
  min-width: 240px;
}
.toast .ico { width: 17px; height: 17px; flex-shrink: 0; }
.toast.success .ico { color: var(--success); }
.toast.error .ico { color: var(--danger); }
.toast.info .ico { color: var(--accent); }
.toast .close { margin-left: auto; color: var(--text-tertiary); cursor: pointer; display: inline-flex; }
.toast .close:hover { color: var(--text); }

/* ============================================================
   LOADER
   ============================================================ */
.loader { display: inline-flex; align-items: center; gap: 9px; color: var(--text-secondary); font-size: var(--text-base); }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ============================================================
   DIVERS
   ============================================================ */
.divider { height: 1px; background: var(--border); border: none; }
.kbd-row { display: inline-flex; gap: 3px; }
