/*
 * ═══════════════════════════════════════════════════════════════
 *  UNTHERA CRM — Design System v2.0
 *  Inspired by Claude.ai + Supabase UI
 *  Fonts: Geist Mono (display) + Geist Sans (body)
 *  Brand: #c6613f
 * ═══════════════════════════════════════════════════════════════
 */

@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@300;400;500;600;700&family=Geist:wght@300;400;500;600;700&display=swap');

/* ═══════════════════════════════════
   §1  TOKENS
   ═══════════════════════════════════ */
:root {
  /* Brand — coral Unthera */
  --brand:        #c6613f;
  --brand-hover:  #b5572f;
  --brand-dim:    rgba(198,97,63,.13);
  --brand-border: rgba(198,97,63,.30);

  /* Radius — Supabase style */
  --r-xs: 3px;
  --r-sm: 5px;
  --r-md: 6px;
  --r-lg: 8px;

  /* Typography */
  --font-mono: 'Geist Mono', 'SF Mono', monospace;
  --font-sans: 'Geist', 'SF Pro Text', system-ui, sans-serif;

  /* Transitions */
  --ease: .15s cubic-bezier(.4,0,.2,1);

  /* Layout */
  --sidebar-w:           220px;
  --sidebar-w-collapsed: 52px;
  --navbar-h:            44px;
}

/* ── DARK theme (default) ── */
:root,
[data-theme="dark"] {
  --bg:            #0f0f0f;
  --bg-panel:      #141414;
  --bg-subtle:     #1a1a1a;
  --bg-hover:      rgba(255,255,255,.04);
  --bg-active:     rgba(255,255,255,.07);
  --bg-input:      #1a1a1a;

  --border:        rgba(255,255,255,.09);
  --border-mid:    rgba(255,255,255,.14);
  --border-strong: rgba(255,255,255,.22);

  --text-h:        #f0f0f0;
  --text-body:     #a3a3a3;
  --text-muted:    #525252;
  --text-inv:      #0f0f0f;

  --ring:          rgba(198,97,63,.22);

  --stroke-btn:
    inset 0  1px 0 rgba(255,255,255,.10),
    inset 0 -1px 0 rgba(0,0,0,.22),
    inset  1px 0 0 rgba(255,255,255,.05),
    inset -1px 0 0 rgba(255,255,255,.05);
  --stroke-btn-hover:
    inset 0  1px 0 rgba(255,255,255,.16),
    inset 0 -1px 0 rgba(0,0,0,.28),
    inset  1px 0 0 rgba(255,255,255,.08),
    inset -1px 0 0 rgba(255,255,255,.08);

  /* Status semantic */
  --s-green:    #3ecf8e;
  --s-green-bg: rgba(62,207,142,.10);
  --s-red:      #e53e3e;
  --s-red-bg:   rgba(229,62,62,.10);
  --s-amber:    #f6ad55;
  --s-amber-bg: rgba(246,173,85,.10);
  --s-blue:     #63b3ed;
  --s-blue-bg:  rgba(99,179,237,.10);
  --s-purple:   #b794f4;
  --s-purple-bg:rgba(183,148,244,.10);

  --date-icon-filter: invert(.7) sepia(.1);
}

/* ── LIGHT theme ── */
[data-theme="light"] {
  --bg:            #f8f8f8;
  --bg-panel:      #ffffff;
  --bg-subtle:     #f2f2f2;
  --bg-hover:      rgba(0,0,0,.03);
  --bg-active:     rgba(0,0,0,.06);
  --bg-input:      #ffffff;

  --border:        rgba(0,0,0,.09);
  --border-mid:    rgba(0,0,0,.14);
  --border-strong: rgba(0,0,0,.22);

  --text-h:        #111111;
  --text-body:     #444444;
  --text-muted:    #999999;
  --text-inv:      #ffffff;

  --ring:          rgba(198,97,63,.18);

  --stroke-btn:
    inset 0  1px 0 rgba(255,255,255,.80),
    inset 0 -1px 0 rgba(0,0,0,.08),
    inset  1px 0 0 rgba(255,255,255,.40),
    inset -1px 0 0 rgba(255,255,255,.40);
  --stroke-btn-hover:
    inset 0  1px 0 rgba(255,255,255,.90),
    inset 0 -1px 0 rgba(0,0,0,.12),
    inset  1px 0 0 rgba(255,255,255,.60),
    inset -1px 0 0 rgba(255,255,255,.60);

  --s-green:    #276749;
  --s-green-bg: rgba(39,103,73,.09);
  --s-red:      #c53030;
  --s-red-bg:   rgba(197,48,48,.09);
  --s-amber:    #b7791f;
  --s-amber-bg: rgba(183,121,31,.09);
  --s-blue:     #2b6cb0;
  --s-blue-bg:  rgba(43,108,176,.09);
  --s-purple:   #6b46c1;
  --s-purple-bg:rgba(107,70,193,.09);

  --date-icon-filter: none;
}

/* ═══════════════════════════════════
   §2  RESET & BASE
   ═══════════════════════════════════ */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }

html { font-size:14px; -webkit-font-smoothing:antialiased; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.5;
  transition: background var(--ease), color var(--ease);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ═══════════════════════════════════
   §3  LAYOUT SHELL
   ═══════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
  max-width: 100%;   /* fills full viewport */
  margin: 0 auto;
  position: relative;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: width var(--ease), transform var(--ease);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-w-collapsed); }

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 9px;
  height: var(--navbar-h);
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar__logo-mark {
  width: 24px; height: 24px;
  background: var(--brand);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--stroke-btn);
}
.sidebar__logo-mark svg { width:13px; height:13px; color:#fff; }

.sidebar__logo-name {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-h);
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--ease), width var(--ease);
}

.sidebar.collapsed .sidebar__logo-name,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .sidebar__footer-label { opacity:0; width:0; overflow:hidden; }

.sidebar__nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.sidebar__nav::-webkit-scrollbar { display:none; }

.nav-section-title {
  font-family: var(--font-mono);
  font-size: .60rem;
  font-weight: 500;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 14px 4px;
  white-space: nowrap;
  transition: opacity var(--ease);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  height: 32px;
  margin: 1px 4px;
  border-radius: var(--r-sm);
  color: var(--text-body);
  font-size: .8125rem;
  font-weight: 400;
  transition: background var(--ease), color var(--ease);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.nav-item svg { width:15px; height:15px; flex-shrink:0; opacity:.7; }
.nav-item:hover  { background: var(--bg-hover); color: var(--text-h); }
.nav-item:hover svg { opacity:1; }
.nav-item.active { background: var(--bg-active); color: var(--text-h); }
.nav-item.active svg { opacity:1; color: var(--brand); }

.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: .60rem;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: var(--r-xs);
  background: var(--brand-dim);
  color: var(--brand);
  border: 1px solid var(--brand-border);
  flex-shrink: 0;
}

.sidebar__footer {
  padding: 8px 4px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar__footer-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  height: 32px;
  border-radius: var(--r-sm);
  color: var(--text-body);
  font-size: .8125rem;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
  white-space: nowrap;
}
.sidebar__footer-item svg { width:15px; height:15px; flex-shrink:0; opacity:.6; }
.sidebar__footer-item:hover { background: var(--bg-hover); color: var(--text-h); }

/* ── Main content area ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left var(--ease);
}
.main-content.sidebar-collapsed { margin-left: var(--sidebar-w-collapsed); }

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  height: var(--navbar-h);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  z-index: 100;
  flex-shrink: 0;
  animation: topbarIn .28s ease .1s both;
}

.topbar__breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  color: var(--text-muted);
}
.topbar__breadcrumb span { color: var(--text-body); }
.topbar__breadcrumb .sep { opacity:.4; }

.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Page body ── */
.page-body { padding: 14px 16px; }

/* ── Sidebar toggle ── */
.sidebar-toggle {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-h); border-color: var(--border-mid); }
.sidebar-toggle svg { width:13px; height:13px; }

/* ═══════════════════════════════════
   §4  BUTTONS
   ═══════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: .8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease),
              color var(--ease), box-shadow var(--ease), opacity var(--ease);
  white-space: nowrap;
  height: 32px;
  padding: 0 12px;
  line-height: 1;
}
.btn svg { width:13px; height:13px; flex-shrink:0; }
.btn:disabled { opacity:.45; cursor:not-allowed; }

/* Primary */
.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--stroke-btn);
}
.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
  box-shadow: var(--stroke-btn-hover);
}

/* Secondary */
.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-body);
  border-color: var(--border-mid);
  box-shadow: var(--stroke-btn);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-h);
  border-color: var(--border-strong);
  box-shadow: var(--stroke-btn-hover);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-body);
  border-color: var(--border-mid);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-h);
  border-color: var(--border-strong);
}

/* Danger */
.btn-danger {
  background: var(--s-red-bg);
  color: var(--s-red);
  border-color: rgba(229,62,62,.22);
}
.btn-danger:hover:not(:disabled) {
  background: var(--s-red);
  color: #fff;
}

/* Icon only */
.btn-icon-only {
  width: 28px; height: 28px;
  padding: 0;
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  border: none;
}
.btn-icon-only:hover { background: var(--bg-hover); color: var(--text-h); }
.btn-icon-only svg { width:14px; height:14px; }

/* Sizes */
.btn-sm { height: 26px; padding: 0 9px; font-size: .75rem; border-radius: var(--r-sm); }
.btn-lg { height: 38px; padding: 0 16px; font-size: .875rem; }

/* Loading spinner inside button */
.btn .spin {
  display: none;
  width: 12px; height: 12px;
  border: 1.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
.btn.loading .btn-lbl,
.btn.loading svg:not(.spin) { display: none; }
.btn.loading .spin           { display: inline-block; }

/* ═══════════════════════════════════
   §5  INPUTS / FORM
   ═══════════════════════════════════ */
.input, .select, .textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-h);
  font-family: var(--font-sans);
  font-size: .8125rem;
  padding: 0 10px;
  height: 32px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--ease), box-shadow var(--ease);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.10);
}
.input::placeholder,
.select::placeholder  { color: var(--text-muted); }
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--ring);
}
.textarea { height: auto; padding: 8px 10px; resize: vertical; }

.field-label {
  display: block;
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 5px;
}
.field { margin-bottom: 12px; }

/* Select — custom caret */
.select {
  padding-right: 26px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

/* ═══════════════════════════════════
   §6  TABLE — Supabase dense rows
   ═══════════════════════════════════ */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-panel);
  position: relative; /* required for loading overlays */
}

/* Thin scrollbar */
.table-wrap::-webkit-scrollbar        { height: 4px; }
.table-wrap::-webkit-scrollbar-track  { background: transparent; }
.table-wrap::-webkit-scrollbar-thumb  { background: var(--border-mid); border-radius: 4px; }
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

.table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: .8125rem;
}

.table thead tr {
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.table th {
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
  border-right: 1px solid var(--border);
}
.table th:last-child { border-right: none; }

.table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-body);
  border-right: 1px solid var(--border);
  white-space: nowrap;
}
.table td:last-child  { border-right: none; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg-hover); }
.table tbody tr.selected td { background: var(--brand-dim); }

/* ── Inline cell edit ── */
.cell-edit {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 3px 6px;
  width: 100%;
  height: 26px;
  color: var(--text-body);
  font-size: .775rem;
  font-family: var(--font-sans);
  outline: none;
  min-width: 72px;
  transition: border-color var(--ease), background var(--ease), box-shadow var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
.cell-edit:hover:not(:disabled) {
  border-color: var(--border-mid);
  background: var(--bg-input);
}
.cell-edit:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--ring);
  background: var(--bg-input);
}
.cell-edit:disabled {
  background: transparent;
  border-color: transparent;
  color: var(--text-body);
  cursor: default;
}

/* Select inside cell — custom caret */
select.cell-edit {
  cursor: pointer;
  padding-right: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}

/* ═══════════════════════════════════
   §7  BADGE / STATUS PILL
   ═══════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: .67rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before {
  content:'';
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-active    { background: var(--s-green-bg);  color: var(--s-green);  border-color: rgba(62,207,142,.18); }
.badge-active::before    { background: var(--s-green); }
.badge-cancelled { background: var(--s-red-bg);    color: var(--s-red);    border-color: rgba(229,62,62,.18); }
.badge-cancelled::before { background: var(--s-red); }
.badge-pending   { background: var(--s-amber-bg);  color: var(--s-amber);  border-color: rgba(246,173,85,.18); }
.badge-pending::before   { background: var(--s-amber); }
.badge-completed { background: var(--s-blue-bg);   color: var(--s-blue);   border-color: rgba(99,179,237,.18); }
.badge-completed::before { background: var(--s-blue); }
.badge-hold      { background: var(--s-purple-bg); color: var(--s-purple); border-color: rgba(183,148,244,.18); }
.badge-hold::before      { background: var(--s-purple); }
.badge-stage     { background: var(--bg-subtle);   color: var(--text-body);border-color: var(--border-mid); }
.badge-stage::before     { background: var(--text-muted); }

/* ═══════════════════════════════════
   §8  PAGINATOR FILTERS
   ═══════════════════════════════════ */
.paginator-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

/* All controls: inputs + selects */
.paginator-filters input[type="text"],
.paginator-filters input[type="search"],
.paginator-filters input[type="date"],
.paginator-filters select {
  height: 28px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-h);
  font-family: var(--font-sans);
  font-size: .775rem;
  padding: 0 9px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.12);
}

.paginator-filters input::placeholder { color: var(--text-muted); }

.paginator-filters input:focus,
.paginator-filters select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--ring), inset 0 1px 2px rgba(0,0,0,.08);
  background: var(--bg-panel);
}

/* Search — wider */
.paginator-filters input[type="text"],
.paginator-filters input[type="search"] {
  min-width: 210px;
  padding-left: 10px;
}

/* Selects — custom caret */
.paginator-filters select {
  padding-right: 26px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
}
.paginator-filters select:hover { border-color: var(--border-mid); }

/* Date inputs */
.paginator-filters input[type="date"] {
  min-width: 134px;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .01em;
}
.paginator-filters input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: .5;
  cursor: pointer;
  filter: var(--date-icon-filter, none);
}

/* Per-page select */
.paginator-filters select[name="per_page"] {
  min-width: 116px;
  font-family: var(--font-mono);
  font-size: .72rem;
}

/* Submit button */
.paginator-filters button[type="submit"] {
  height: 28px;
  padding: 0 14px;
  background: var(--brand);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: .775rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--ease), box-shadow var(--ease);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 -1px 0 rgba(0,0,0,.18);
}
.paginator-filters button[type="submit"]:hover  { background: var(--brand-hover); }
.paginator-filters button[type="submit"]:active { transform: translateY(1px); }

/* "Limpiar" ghost link */
.paginator-filters a {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  font-size: .775rem;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
  white-space: nowrap;
}
.paginator-filters a:hover {
  background: var(--bg-hover);
  color: var(--text-h);
  border-color: var(--border-strong);
}

/* ═══════════════════════════════════
   §9  DRAWER / PANEL LATERAL
   ═══════════════════════════════════ */
.drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px) saturate(1.4);
  -webkit-backdrop-filter: blur(6px) saturate(1.4);
  z-index: 300;
}
.drawer-overlay.open { display: block; animation: fadeIn .15s ease; }

[data-theme="light"] .drawer-overlay { background: rgba(0,0,0,.25); }

.drawer {
  display: none;
  position: fixed; top: 0; right: 0;
  width: min(480px, 100vw);
  height: 100%;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-mid);
  box-shadow: -8px 0 32px rgba(0,0,0,.35), -1px 0 0 var(--border);
  z-index: 400;
  flex-direction: column;
}
.drawer.open {
  display: flex;
  animation: slideIn .2s cubic-bezier(.4,0,.2,1);
}

[data-theme="light"] .drawer {
  box-shadow: -4px 0 24px rgba(0,0,0,.12), -1px 0 0 var(--border);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--navbar-h);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-header h3 {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-h);
  letter-spacing: -.01em;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Drawer loading glass overlay */
.drawer.is-loading .drawer-body {
  position: relative;
  pointer-events: none;
}
.drawer.is-loading .drawer-body::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--bg-panel);
  opacity: .7;
  backdrop-filter: blur(3px);
  z-index: 5;
}
.drawer.is-loading .drawer-body::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 24px; height: 24px;
  border: 2px solid var(--brand-dim);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .65s linear infinite;
  z-index: 6;
}

/* ═══════════════════════════════════
   §10  TABLE SKELETON LOADING
   ═══════════════════════════════════ */

/* Glass overlay on table while loading */
.table-wrap.is-loading::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(15,15,15,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: var(--r-lg);
  z-index: 10;
  animation: glassIn .2s ease;
}
[data-theme="light"] .table-wrap.is-loading::after {
  background: rgba(248,248,248,.60);
}

/* Spinner inside glass overlay */
.table-wrap.is-loading::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 28px; height: 28px;
  border: 2.5px solid var(--brand-dim);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  z-index: 11;
}

/* Skeleton shimmer rows */
.skeleton-row td {
  padding: 8px 10px !important;
  border-bottom: 1px solid var(--border) !important;
}

.skeleton-line {
  height: 11px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    var(--bg-subtle) 25%,
    var(--bg-hover)  50%,
    var(--bg-subtle) 75%
  );
  background-size: 600px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-line.w-20 { width: 20%; }
.skeleton-line.w-30 { width: 30%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }

/* ═══════════════════════════════════
   §11  ROW ENTRANCE ANIMATION
   ═══════════════════════════════════ */
#salesTable tbody tr {
  animation: rowIn .22s ease both;
}
#salesTable tbody tr:nth-child(1)    { animation-delay: .04s; }
#salesTable tbody tr:nth-child(2)    { animation-delay: .07s; }
#salesTable tbody tr:nth-child(3)    { animation-delay: .10s; }
#salesTable tbody tr:nth-child(4)    { animation-delay: .13s; }
#salesTable tbody tr:nth-child(5)    { animation-delay: .15s; }
#salesTable tbody tr:nth-child(6)    { animation-delay: .17s; }
#salesTable tbody tr:nth-child(7)    { animation-delay: .19s; }
#salesTable tbody tr:nth-child(8)    { animation-delay: .20s; }
#salesTable tbody tr:nth-child(9)    { animation-delay: .21s; }
#salesTable tbody tr:nth-child(10)   { animation-delay: .22s; }
#salesTable tbody tr:nth-child(n+11) { animation-delay: .23s; }

/* ═══════════════════════════════════
   §12  PAGE-LOAD SPLASH SPINNER
   ═══════════════════════════════════ */
#page-loader {
  position: fixed; inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: loaderFade .35s ease .25s both;
}
#page-loader::after {
  content: '';
  width: 32px; height: 32px;
  border: 2.5px solid var(--brand-dim);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ═══════════════════════════════════
   §13  PAGINATION
   ═══════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 10px 0;
  flex-wrap: wrap;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  min-width: 26px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .75rem;
  font-family: var(--font-mono);
  color: var(--text-body);
  text-decoration: none;
  background: var(--bg-panel);
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.page-link:hover  { background: var(--bg-hover); border-color: var(--border-mid); color: var(--text-h); }
.page-link.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.page-ellipsis    { padding: 0 4px; color: var(--text-muted); font-size: .75rem; }
.page-total       { font-size: .72rem; color: var(--text-muted); margin-left: 8px; font-family: var(--font-mono); }

/* ═══════════════════════════════════
   §14  CARD
   ═══════════════════════════════════ */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-h);
  letter-spacing: -.01em;
}

/* ═══════════════════════════════════
   §15  TOAST
   ═══════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 16px; right: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 9000;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: .8rem;
  color: var(--text-body);
  min-width: 220px;
  max-width: 340px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  animation: toastIn .2s ease;
}
.toast svg        { width:14px; height:14px; flex-shrink:0; }
.toast-success    { border-color: rgba(62,207,142,.25);  color: var(--s-green); }
.toast-danger     { border-color: rgba(229,62,62,.25);   color: var(--s-red); }
.toast-info       { border-color: rgba(99,179,237,.25);  color: var(--s-blue); }

/* ═══════════════════════════════════
   §16  LOGIN PAGE
   ═══════════════════════════════════ */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 16px;
}
.login-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 900px;
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-panel);
}
.login-side {
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-side::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: .4;
  pointer-events: none;
}
.login-side__logo  { display:flex; align-items:center; gap:9px; position:relative; }
.login-side__mark  {
  width: 28px; height: 28px;
  background: var(--brand);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--stroke-btn);
}
.login-side__mark svg { width:14px; height:14px; color:#fff; }
.login-side__name  { font-family:var(--font-mono); font-size:.8rem; font-weight:600; color:var(--text-h); }
.login-side__copy  { position:relative; }
.login-side__eyebrow {
  font-family: var(--font-mono); font-size:.63rem; font-weight:500;
  letter-spacing:.10em; text-transform:uppercase;
  color: var(--brand); margin-bottom:10px;
}
.login-side__headline {
  font-family: var(--font-mono); font-size:1.35rem; font-weight:600;
  color: var(--text-h); line-height:1.25; letter-spacing:-.025em; margin-bottom:10px;
}
.login-side__headline em { font-style:normal; color:var(--brand); }
.login-side__sub   { font-size:.8rem; font-weight:300; color:var(--text-muted); line-height:1.65; }
.login-side__footer {
  font-family: var(--font-mono); font-size:.60rem;
  color: var(--text-muted); letter-spacing:.04em; position:relative;
}
.login-form-panel  { padding:40px 36px; display:flex; flex-direction:column; justify-content:center; }
.login-title       { font-family:var(--font-mono); font-size:.9rem; font-weight:600; color:var(--text-h); letter-spacing:-.01em; margin-bottom:4px; }
.login-subtitle    { font-size:.78rem; color:var(--text-muted); margin-bottom:24px; }
.login-error {
  display:flex; align-items:center; gap:7px;
  padding:8px 11px;
  background: var(--s-red-bg);
  border: 1px solid rgba(229,62,62,.22);
  border-radius: var(--r-md);
  font-size:.78rem; color:var(--s-red); margin-bottom:14px;
}
.login-error svg   { width:13px; height:13px; flex-shrink:0; }
.login-btn         { width:100%; height:34px; margin-top:4px; }
.login-footer-text { margin-top:16px; font-size:.72rem; color:var(--text-muted); text-align:center; }
.theme-toggle-float {
  position:fixed; top:14px; right:14px;
  width:30px; height:30px;
  border-radius:var(--r-sm); border:1px solid var(--border);
  background:var(--bg-panel); color:var(--text-muted);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; z-index:50;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.theme-toggle-float:hover { background:var(--bg-hover); color:var(--text-h); border-color:var(--border-mid); }
.theme-toggle-float svg { width:13px; height:13px; }

/* ═══════════════════════════════════
   §17  SETTINGS PAGE
   ═══════════════════════════════════ */
.settings-section       { margin-bottom:20px; }
.settings-section-title {
  font-family: var(--font-mono); font-size:.68rem; font-weight:600;
  text-transform:uppercase; letter-spacing:.08em; color:var(--text-muted);
  padding-bottom:8px; border-bottom:1px solid var(--border); margin-bottom:12px;
}
.settings-row {
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 0; border-bottom:1px solid var(--border); gap:16px;
}
.settings-row:last-child  { border-bottom:none; }
.settings-row-label       { font-size:.8125rem; color:var(--text-body); font-weight:500; }
.settings-row-desc        { font-size:.75rem; color:var(--text-muted); margin-top:2px; }
.settings-row-control     { flex-shrink:0; }

/* ═══════════════════════════════════
   §18  PAGE HEADER
   ═══════════════════════════════════ */
.page-header {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:12px; flex-wrap:wrap; gap:8px;
}
.page-header-title { font-family:var(--font-mono); font-size:.8rem; font-weight:600; color:var(--text-h); }
.page-header-desc  { font-size:.75rem; color:var(--text-muted); }

/* ═══════════════════════════════════
   §19  UTILS
   ═══════════════════════════════════ */
.divider     { height:1px; background:var(--border); margin:12px 0; }
.text-muted  { color:var(--text-muted); }
.text-h      { color:var(--text-h); }
.mono        { font-family:var(--font-mono); }
.truncate    { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.flex-center { display:flex; align-items:center; justify-content:center; }
.flex        { display:flex; align-items:center; }
.gap-2       { gap:8px; }
.gap-1       { gap:4px; }
.ml-auto     { margin-left:auto; }
.w-full      { width:100%; }
.sr-only     { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

/* ═══════════════════════════════════
   §20  RESPONSIVE
   ═══════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,.3);
  }
  .main-content,
  .main-content.sidebar-collapsed { margin-left: 0; }
}

@media (max-width: 640px) {
  .paginator-filters { gap: 5px; }
  .paginator-filters input[type="text"],
  .paginator-filters input[type="search"] { min-width: 0; flex: 1 1 140px; }
  .paginator-filters input[type="date"]   { min-width: 0; flex: 1 1 110px; }
  .paginator-filters select               { flex: 1 1 100px; }
  .pagination   { justify-content: center; }
  .page-total   { width: 100%; text-align: center; margin: 4px 0 0; }
  .login-wrap   { grid-template-columns: 1fr; }
  .login-side   { display: none; }
}

/* ═══════════════════════════════════
   §21  KEYFRAMES
   ═══════════════════════════════════ */
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes glassIn  { from { opacity:0; } to { opacity:1; } }
@keyframes shimmer  { 0% { background-position:-600px 0; } 100% { background-position:600px 0; } }
@keyframes slideIn  { from { transform:translateX(100%); } to { transform:translateX(0); } }
@keyframes topbarIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
@keyframes rowIn    { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastIn  { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
@keyframes loaderFade { from { opacity:1; } to { opacity:0; visibility:hidden; } }
/* ═══════════════════════════════════════════════════════════════
   UNTHERA CRM — Patch v3 fixes
   · Spinner loading fijo en viewport (no se mueve con scroll)
   · Drawer spinner también fijo
   · Sidebar transición suave (slide, no teleport)
   · Theme toggle con animación de rotación
   · Sidebar footer: solo perfil + popover con Settings/Logout
   Append al final de main.css
   ═══════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════
   FIX 1: TABLE LOADING — spinner FIJO en viewport, no relativo
   El problema: ::before en position:absolute se mueve al hacer
   scroll porque .table-wrap no es fixed.
   Solución: usar un <div id="global-spinner"> fijo en viewport.
   ══════════════════════════════════════════════════════════════ */

/* Eliminar el spinner ::before del table-wrap (era el que se movía) */
.table-wrap.is-loading::before { display: none !important; }

/* Overlay glass sigue en el table-wrap (correcto) */
.table-wrap.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15,15,15,.48);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border-radius: var(--r-lg);
  z-index: 10;
  animation: glassIn .18s ease;
  pointer-events: none;
}
[data-theme="light"] .table-wrap.is-loading::after {
  background: rgba(248,248,248,.55);
}

/* ── Spinner global fijo en viewport ── */
#global-spinner {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9998;
  width: 36px;
  height: 36px;
  pointer-events: none;
}
#global-spinner::after {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--brand-dim);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
#global-spinner.show { display: block; }

/* ══════════════════════════════════════════════════════════════
   FIX 2: DRAWER SPINNER — también fijo en viewport
   ══════════════════════════════════════════════════════════════ */
.drawer.is-loading .drawer-body::before { display: none !important; }
.drawer.is-loading .drawer-body::after  { display: none !important; }

/* Overlay semitransparente sobre el drawer body */
.drawer.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-panel);
  opacity: .65;
  backdrop-filter: blur(2px);
  z-index: 5;
  pointer-events: all;
  border-radius: 0;
}
/* El spinner real viene del #global-spinner que se activa por JS */

/* ══════════════════════════════════════════════════════════════
   FIX 3: SIDEBAR — transición suave de entrada
   ══════════════════════════════════════════════════════════════ */
.sidebar {
  transition:
    width   .22s cubic-bezier(.4,0,.2,1),
    transform .22s cubic-bezier(.4,0,.2,1);
  /* Asegurar que empiece visible en desktop */
  transform: translateX(0);
}

/* Mobile: empieza fuera, desliza */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    /* Transición más lenta en mobile para que se note el desliz */
    transition: transform .28s cubic-bezier(.4,0,.2,1);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 6px 0 28px rgba(0,0,0,.35);
  }
}

/* Overlay del sidebar en mobile (nuevo elemento) */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 199;
  animation: fadeIn .18s ease;
}
#sidebar-overlay.show { display: block; }

/* ══════════════════════════════════════════════════════════════
   FIX 4: THEME TOGGLE — rotación suave al cambiar
   ══════════════════════════════════════════════════════════════ */
.btn-icon-only#themeToggle svg {
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .2s ease;
}
.btn-icon-only#themeToggle:active svg {
  transform: rotate(30deg) scale(.85);
}
.theme-switching svg {
  animation: themeSpin .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes themeSpin {
  0%   { transform: rotate(0deg)   scale(1); }
  40%  { transform: rotate(20deg)  scale(.8); }
  100% { transform: rotate(360deg) scale(1); }
}

/* ══════════════════════════════════════════════════════════════
   FIX 5: SIDEBAR FOOTER — solo perfil, popover arriba
   ══════════════════════════════════════════════════════════════ */

/* Ocultar footer items sueltos — reemplazados por el perfil */
.sidebar__footer { padding: 6px 4px; }

/* Botón de perfil */
.sidebar__profile-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  height: 36px;
  border-radius: var(--r-sm);
  cursor: pointer;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: .8125rem;
  transition: background var(--ease), color var(--ease);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}
.sidebar__profile-btn:hover {
  background: var(--bg-hover);
  color: var(--text-h);
}

/* Avatar */
.sidebar__avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--r-sm);
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: .60rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: .02em;
  box-shadow: var(--stroke-btn);
}

/* Texto perfil */
.sidebar__profile-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  overflow: hidden;
  transition: opacity var(--ease), width var(--ease);
}
.sidebar__profile-name {
  font-size: .775rem;
  font-weight: 500;
  color: var(--text-h);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
.sidebar__profile-role {
  font-family: var(--font-mono);
  font-size: .60rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Icono chevron */
.sidebar__profile-btn .profile-chevron {
  margin-left: auto;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: .4;
  transition: transform .2s ease, opacity .2s ease;
}
.sidebar__profile-btn.active .profile-chevron {
  transform: rotate(180deg);
  opacity: .7;
}

/* Collapsed: ocultar texto */
.sidebar.collapsed .sidebar__profile-info,
.sidebar.collapsed .profile-chevron { opacity:0; width:0; overflow:hidden; }

/* ── Popover menu (aparece arriba del botón) ── */
.sidebar__profile-popover {
  position: fixed;
  bottom: calc(36px + 12px);  /* se recalcula por JS */
  left: 0;                     /* se recalcula por JS */
  width: 200px;
  background: var(--bg-panel);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  box-shadow: 0 -4px 24px rgba(0,0,0,.28), 0 0 0 1px rgba(255,255,255,.04);
  z-index: 500;
  overflow: hidden;
  transform-origin: bottom left;
  animation: popoverIn .15s cubic-bezier(.34,1.56,.64,1);
}
[data-theme="light"] .sidebar__profile-popover {
  box-shadow: 0 -4px 20px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.05);
}

@keyframes popoverIn {
  from { opacity:0; transform: scale(.92) translateY(6px); }
  to   { opacity:1; transform: scale(1)   translateY(0); }
}

/* Header del popover — muestra usuario */
.profile-popover-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
}
.profile-popover-name {
  font-size: .775rem;
  font-weight: 600;
  color: var(--text-h);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-popover-role {
  font-family: var(--font-mono);
  font-size: .60rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 1px;
}

/* Items del popover */
.profile-popover-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  height: 34px;
  font-size: .8125rem;
  color: var(--text-body);
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  font-family: var(--font-sans);
}
.profile-popover-item svg { width:14px; height:14px; flex-shrink:0; opacity:.6; }
.profile-popover-item:hover {
  background: var(--bg-hover);
  color: var(--text-h);
}
.profile-popover-item:hover svg { opacity:1; }

/* Item de logout — rojo */
.profile-popover-item.danger       { color: var(--s-red); }
.profile-popover-item.danger svg   { opacity:.7; color: var(--s-red); }
.profile-popover-item.danger:hover { background: var(--s-red-bg); color: var(--s-red); }

.profile-popover-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

/* ══════════════════════════════════════════════════════════════
   PAGE LOADER — ocultar sidebar y no solaparse
   ══════════════════════════════════════════════════════════════ */
#page-loader {
  z-index: 10000; /* sobre todo */
}