/* ═══════════════════════════════════════════════════════════════
   Sistema Gestão — Design System
   Baseado no ricco-trade-v2 · Tema dinâmico por usuário
═══════════════════════════════════════════════════════════════ */

/* ══ DESIGN TOKENS BASE ═════════════════════════════════════════ */
:root {
  /* Accent — dinâmico via JS/PHP, default azul clínica */
  --accent:        #4ADE80;
  --accent-dim:    rgba(74,222,128,.15);
  --accent-border: rgba(74,222,128,.35);
  --accent-dark:   #22C55E;

  /* Admin accent separado */
  --admin-accent: #A855F7;
  --admin-dim:    rgba(168,85,247,.15);

  /* Semânticas */
  --green:    #22C55E;
  --green-dim: rgba(34,197,94,.14);
  --red:      #EF4444;
  --red-dim:  rgba(239,68,68,.14);
  --blue:     #3B82F6;
  --blue-dim: rgba(59,130,246,.14);
  --yellow:   #F59E0B;
  --yellow-dim: rgba(245,158,11,.13);
  --purple:   #A855F7;

  /* Layout */
  --sidebar-w:  252px;
  --topbar-h:   62px;
  --radius:     10px;
  --radius-lg:  14px;
  --radius-full: 9999px;
  --transition: 0.28s cubic-bezier(0.4,0,0.2,1);

  /* Fontes */
  --font-body:    'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

/* ══ PALETAS DE TEMA — 8 opções para o usuário escolher ═════════
   Cada tema define: --accent / --accent-dim / --accent-border / --accent-dark
   O resto (bg, surface, txt) segue dark/light conforme preferência
══════════════════════════════════════════════════════════════ */

/* Verde Clínica (padrão) */
[data-accent="green"] {
  --accent:        #4ADE80;
  --accent-dim:    rgba(74,222,128,.15);
  --accent-border: rgba(74,222,128,.35);
  --accent-dark:   #16A34A;
}
/* Azul */
[data-accent="blue"] {
  --accent:        #60A5FA;
  --accent-dim:    rgba(96,165,250,.15);
  --accent-border: rgba(96,165,250,.35);
  --accent-dark:   #2563EB;
}
/* Roxo */
[data-accent="purple"] {
  --accent:        #C084FC;
  --accent-dim:    rgba(192,132,252,.15);
  --accent-border: rgba(192,132,252,.35);
  --accent-dark:   #9333EA;
}
/* Laranja */
[data-accent="orange"] {
  --accent:        #FB923C;
  --accent-dim:    rgba(251,146,60,.15);
  --accent-border: rgba(251,146,60,.35);
  --accent-dark:   #EA580C;
}
/* Rosa */
[data-accent="pink"] {
  --accent:        #F472B6;
  --accent-dim:    rgba(244,114,182,.15);
  --accent-border: rgba(244,114,182,.35);
  --accent-dark:   #DB2777;
}
/* Cyan */
[data-accent="cyan"] {
  --accent:        #22D3EE;
  --accent-dim:    rgba(34,211,238,.15);
  --accent-border: rgba(34,211,238,.35);
  --accent-dark:   #0891B2;
}
/* Amarelo */
[data-accent="yellow"] {
  --accent:        #FBBF24;
  --accent-dim:    rgba(251,191,36,.15);
  --accent-border: rgba(251,191,36,.35);
  --accent-dark:   #D97706;
}
/* Vermelho */
[data-accent="red"] {
  --accent:        #F87171;
  --accent-dim:    rgba(248,113,113,.15);
  --accent-border: rgba(248,113,113,.35);
  --accent-dark:   #DC2626;
}

/* ══ DARK THEME (padrão) ════════════════════════════════════════ */
:root,
[data-theme="dark"] {
  --bg:        #0E0E10;
  --surface-1: #161618;
  --surface-2: #1C1C1F;
  --surface-3: #242428;
  --surface-4: #2E2E33;
  --border:    rgba(255,255,255,.07);
  --border-2:  rgba(255,255,255,.11);
  --txt:       #F0F0F2;
  --txt-muted: #6B7280;
  --txt-dim:   #3F4046;
  --bg-input:  #131315;
  --bg-hover:  rgba(255,255,255,.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.35);
  --shadow-md: 0 4px 16px rgba(0,0,0,.40);

  --sb-bg:       #161618;
  --sb-border:   rgba(255,255,255,.07);
  --sb-txt:      rgba(255,255,255,.55);
  --sb-txt-dim:  rgba(255,255,255,.28);
  --sb-hover:    rgba(255,255,255,.05);
  --sb-hover-txt: rgba(255,255,255,.9);
}

/* ══ LIGHT THEME ════════════════════════════════════════════════ */
[data-theme="light"] {
  --bg:        #F1F4F8;
  --surface-1: #FFFFFF;
  --surface-2: #F7F9FC;
  --surface-3: #EEF2F7;
  --surface-4: #E4EAF2;
  --border:    rgba(0,0,0,.07);
  --border-2:  rgba(0,0,0,.12);
  --txt:       #0F1923;
  --txt-muted: #4A6078;
  --txt-dim:   #8CA0B3;
  --bg-input:  #FFFFFF;
  --bg-hover:  rgba(0,0,0,.03);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);

  --sb-bg:       #1C2026;
  --sb-border:   rgba(255,255,255,.06);
  --sb-txt:      rgba(255,255,255,.55);
  --sb-txt-dim:  rgba(255,255,255,.28);
  --sb-hover:    rgba(255,255,255,.06);
  --sb-hover-txt: rgba(255,255,255,.92);
}

/* ══ RESET ══════════════════════════════════════════════════════ */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { font-size:14px; -webkit-font-smoothing:antialiased; scroll-behavior:smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--txt);
  padding-left: var(--sidebar-w);
  transition: background var(--transition), color var(--transition), padding-left var(--transition);
  overflow-x: clip;
  min-height: 100vh;
}
body.sidebar-hidden { padding-left: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 3px; }

/* ══ SIDEBAR ════════════════════════════════════════════════════ */
.sidebar {
  position: fixed; left:0; top:0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  z-index: 2000;
  display: flex; flex-direction: column;
  transition: transform var(--transition);
  overflow: hidden;
}

.sidebar-header {
  height: var(--topbar-h);
  padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.sidebar-logo-wrap { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.db-wordmark { display: flex; align-items: center; gap: 10px; }
.db-logo-img { height: 28px; width: auto; object-fit: contain; border-radius: 6px; display: block; }
.db-wordmark-sep { width: 1px; height: 20px; background: var(--sb-border); }
.db-wordmark-label { font-family: var(--font-display); font-size: 9px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase; color: var(--sb-txt-dim); }
.sidebar-brand-fallback {
  width: 28px; height: 28px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .9rem; color: #fff;
}
.sidebar-brand-name { font-family: var(--font-display); font-weight: 800; font-size: .95rem; color: rgba(255,255,255,.9); }
.btn-close-mobile { display: none; background: none; border: 1px solid var(--sb-border);
  border-radius: 8px; color: var(--sb-txt); padding: 6px 10px; font-size: .8rem; }

.sidebar-user-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--sb-border);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-dim); border: 1.5px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: var(--accent); flex-shrink: 0;
}
.avatar.admin-av { background: var(--admin-dim); border-color: rgba(168,85,247,.4); color: var(--admin-accent); }
.user-info strong { font-size: .82rem; display: block; color: rgba(255,255,255,.9); }
.user-info small  { font-size: .7rem; color: var(--sb-txt); }
.role-badge {
  display: inline-block; padding: 1px 8px; border-radius: var(--radius-full);
  font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px;
}
.role-admin      { background: var(--admin-dim); color: var(--admin-accent); }
.role-funcionario { background: var(--accent-dim); color: var(--accent); }

.menu-nav { flex: 1; padding: 8px 0; overflow-y: auto; overflow-x: hidden; }
.menu-nav::-webkit-scrollbar { width: 3px; }
.menu-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); }

.nav-header-text {
  padding: 14px 16px 4px;
  font-size: 9px; font-weight: 700; letter-spacing: .10em; text-transform: uppercase;
  color: var(--sb-txt-dim);
}
.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; margin: 1px 8px; border-radius: var(--radius);
  color: var(--sb-txt); text-decoration: none; font-size: 13px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap; overflow: hidden; position: relative;
}
.menu-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.menu-item:hover { background: var(--sb-hover); color: var(--sb-hover-txt); }
.menu-item.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
.menu-item.active svg { color: var(--accent); }
.menu-item.active-admin { background: var(--admin-dim); color: var(--admin-accent); font-weight: 600; }

.nav-badge {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: var(--red); color: #fff;
  font-size: .6rem; font-weight: 800; border-radius: 20px;
  padding: 1px 5px; min-width: 17px; text-align: center; line-height: 1.4;
}

.sidebar-footer { padding: 12px 8px; border-top: 1px solid var(--sb-border); flex-shrink: 0; }
.btn-logout {
  display: flex; align-items: center; gap: 10px;
  color: var(--sb-txt); font-size: .82rem; padding: 9px 10px; border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
  background: none; border: none; width: 100%;
}
.btn-logout svg { width: 17px; flex-shrink: 0; }
.btn-logout:hover { background: rgba(239,68,68,.12); color: #f87171; }
body.sidebar-hidden .sidebar { transform: translateX(-100%); }

/* Sidebar overlay */
#sidebarOverlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.60); backdrop-filter: blur(3px);
  z-index: 1999;
}
#sidebarOverlay.open { display: block; }

/* ══ TOPBAR ═════════════════════════════════════════════════════ */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: var(--surface-1);
  border-bottom: 1px solid var(--border-2);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; z-index: 1000;
  transition: left var(--transition), background var(--transition);
}
body.sidebar-hidden .topbar { left: 0; }

.topbar-left { display: flex; align-items: center; gap: 12px; }
.btn-toggle-sidebar {
  width: 36px; height: 36px; border-radius: var(--radius); border: 1px solid var(--border-2);
  background: var(--surface-2); color: var(--txt-muted);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.btn-toggle-sidebar svg { width: 16px; display: block; }
.btn-toggle-sidebar:hover { background: var(--surface-3); color: var(--accent); border-color: var(--accent-border); }

.topbar-page-title { font-family: var(--font-display); font-size: 12.5px; font-weight: 600; color: var(--txt-muted); }
.topbar-page-title .sep { margin: 0 5px; opacity: .35; }
.topbar-page-title .current { color: var(--txt); }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-greeting { text-align: right; line-height: 1.3; }
.user-greeting .label { display: block; font-size: 10px; color: var(--txt-dim); font-weight: 500; }
.user-greeting .name  { display: block; font-size: 12.5px; font-weight: 700; color: var(--txt); font-family: var(--font-display); }

.db-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 99px;
  font-family: var(--font-body); font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  transition: all 0.18s; white-space: nowrap; text-decoration: none;
}
.db-btn-ghost {
  background: var(--surface-2); border-color: var(--border-2); color: var(--txt-muted);
}
.db-btn-ghost:hover { background: var(--surface-3); border-color: var(--accent-border); color: var(--accent); }
.db-btn-theme {
  width: 36px; height: 36px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--txt-muted);
  transition: all var(--transition);
}
.db-btn-theme:hover { background: var(--surface-3); color: var(--accent); transform: rotate(20deg); }

/* ══ THEME PICKER (topbar) ══════════════════════════════════════ */
.theme-picker-wrap { position: relative; }
.theme-picker-btn {
  width: 36px; height: 36px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--txt-muted);
  cursor: pointer; transition: all var(--transition);
}
.theme-picker-btn:hover { background: var(--surface-3); color: var(--accent); }
.theme-picker-btn svg { width: 15px; }
.theme-picker-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: var(--radius-lg); padding: 14px;
  box-shadow: var(--shadow-md); min-width: 220px;
  display: none; z-index: 500;
}
.theme-picker-dropdown.open { display: block; }
.theme-picker-label { font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--txt-dim); margin-bottom: 8px; }
.accent-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 14px; }
.accent-swatch {
  width: 100%; aspect-ratio: 1; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s, border-color .15s;
  display: flex; align-items: center; justify-content: center;
}
.accent-swatch:hover { transform: scale(1.1); }
.accent-swatch.active { border-color: rgba(255,255,255,.6); transform: scale(1.1); }
.accent-swatch svg { width: 12px; color: #fff; display: none; }
.accent-swatch.active svg { display: block; }
.mode-toggle-row { display: flex; gap: 6px; }
.mode-btn {
  flex: 1; padding: 7px; border-radius: 8px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--border-2); background: var(--surface-3); color: var(--txt-muted);
  cursor: pointer; transition: all .15s; display: flex; align-items: center;
  justify-content: center; gap: 5px;
}
.mode-btn svg { width: 13px; }
.mode-btn.active { background: var(--accent-dim); border-color: var(--accent-border); color: var(--accent); }
.mode-btn:hover:not(.active) { background: var(--surface-4); color: var(--txt); }

/* ══ MAIN WRAPPER ════════════════════════════════════════════════ */
.main-wrapper { margin-top: var(--topbar-h); min-height: calc(100vh - var(--topbar-h)); }
.main-content  { padding: 24px; background: var(--bg); }

/* ══ PAGE HEADER ════════════════════════════════════════════════ */
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 1.3rem; font-weight: 700; font-family: var(--font-display); color: var(--txt); }
.page-header p  { color: var(--txt-muted); font-size: .82rem; margin-top: 3px; }
.page-header-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ══ CARDS ══════════════════════════════════════════════════════ */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.card-accent { background: var(--accent-dim); border-color: var(--accent-border); }
.card-title  { font-size: .7rem; color: var(--txt-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px; }
.card-value  { font-size: 1.45rem; font-weight: 800; }

/* ══ STATS ══════════════════════════════════════════════════════ */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; }
.stat-label { font-size: .68rem; color: var(--txt-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px; }
.stat-value { font-size: 1.3rem; font-weight: 800; color: var(--txt); }
.stat-value.accent { color: var(--accent); }
.stat-value.green  { color: var(--green); }
.stat-value.red    { color: var(--red); }
.stat-value.yellow { color: var(--yellow); }
.stat-value.purple { color: var(--purple); }
.stat-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 18px; }
.stat-icon.accent { background: var(--accent-dim); color: var(--accent); }
.stat-icon.green  { background: var(--green-dim);  color: var(--green); }
.stat-icon.red    { background: var(--red-dim);    color: var(--red); }
.stat-icon.purple { background: var(--admin-dim);  color: var(--admin-accent); }
.stat-icon.yellow { background: var(--yellow-dim); color: var(--yellow); }

/* ══ GRID ═══════════════════════════════════════════════════════ */
.grid   { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2,1fr); }
.grid-3 { grid-template-columns: repeat(3,1fr); }
.grid-4 { grid-template-columns: repeat(4,1fr); }

/* ══ BOTÕES ═════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; border: none;
  font-size: .82rem; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: all .15s; white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn-accent  { background: var(--accent); color: #0a0a0a; }
.btn-accent:hover { filter: brightness(1.1); }
.btn-outline { background: transparent; color: var(--txt-muted); border: 1px solid var(--border-2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost   { background: transparent; color: var(--txt-muted); }
.btn-ghost:hover { color: var(--txt); }
.btn-green   { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,197,94,.3); }
.btn-red     { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,.3); }
.btn-admin   { background: var(--admin-dim); color: var(--admin-accent); border: 1px solid rgba(168,85,247,.35); }
.btn-sm  { padding: 5px 12px; font-size: .76rem; }
.btn-lg  { padding: 11px 22px; font-size: .88rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon  { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 8px; }

/* ══ FORMULÁRIOS ════════════════════════════════════════════════ */
.form-group { margin-bottom: 14px; }
label { display: block; font-size: .76rem; color: var(--txt-muted); margin-bottom: 4px; font-weight: 500; }
.form-control {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border-2);
  border-radius: 8px; color: var(--txt); padding: 9px 12px;
  font-size: .85rem; outline: none;
  transition: border-color .15s, background .15s;
  font-family: var(--font-body);
}
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--txt-dim); }
[data-theme="light"] .form-control { background: #fff; border-color: rgba(0,0,0,.14); }
select.form-control option { background: #1a1a1f; color: #fff; }
[data-theme="light"] select.form-control option { background: #fff; color: #111; }
.form-hint { font-size: .7rem; color: var(--txt-muted); margin-top: 3px; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-group { position: relative; }
.input-group .form-control { padding-left: 38px; }
.input-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--txt-muted); }
.input-icon svg { width: 15px; }

/* ══ ALERTS ═════════════════════════════════════════════════════ */
.alert {
  padding: 10px 14px; border-radius: 8px; font-size: .82rem;
  margin-bottom: 14px; display: flex; align-items: center; gap: 9px;
}
.alert svg { width: 15px; flex-shrink: 0; }
.alert-success { background: var(--green-dim); border: 1px solid rgba(34,197,94,.3); color: #86EFAC; }
.alert-error   { background: var(--red-dim); border: 1px solid rgba(239,68,68,.3); color: #FCA5A5; }
.alert-warning { background: var(--yellow-dim); border: 1px solid rgba(245,158,11,.3); color: #FDE68A; }
.alert-info    { background: var(--blue-dim); border: 1px solid rgba(59,130,246,.3); color: #93C5FD; }
[data-theme="light"] .alert-success { color: #166534; }
[data-theme="light"] .alert-error   { color: #991b1b; }
[data-theme="light"] .alert-warning { color: #92400e; }
[data-theme="light"] .alert-info    { color: #1e40af; }

/* ══ TABELAS ════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
thead th { padding: 8px 12px; text-align: left; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--txt-muted);
  border-bottom: 1px solid var(--border-2); white-space: nowrap; }
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-hover); }

/* ══ BADGES ═════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: var(--radius-full);
  font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.badge-active, .badge-approved, .badge-concluido   { background: var(--green-dim); color: var(--green); }
.badge-pending, .badge-agendado, .badge-em_andamento { background: var(--yellow-dim); color: var(--yellow); }
.badge-cancelled, .badge-cancelado, .badge-error     { background: var(--red-dim); color: var(--red); }
.badge-info, .badge-confirmado                        { background: var(--blue-dim); color: var(--blue); }
.badge-accent                                          { background: var(--accent-dim); color: var(--accent); }

/* ══ SECTION HEADER ═════════════════════════════════════════════ */
.section-hd { display: flex; align-items: center; justify-content: space-between; }
.section-title { font-size: .82rem; font-weight: 700; color: var(--txt); font-family: var(--font-display); }

/* ══ UTILITÁRIOS ════════════════════════════════════════════════ */
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-14 { margin-bottom: 14px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-14 { margin-top: 14px; }
.mt-20 { margin-top: 20px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-muted { color: var(--txt-muted); }
.text-accent { color: var(--accent); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.fw-700 { font-weight: 700; }
.fs-sm  { font-size: .78rem; }

/* ══ AUTH LAYOUT ════════════════════════════════════════════════ */
body.auth-body { display: block; padding-left: 0; }
.auth-wrap {
  min-height: 100vh; display: flex;
  background: radial-gradient(ellipse at 20% 20%, var(--accent-dim) 0%, transparent 55%), var(--bg);
}
.auth-visual {
  flex: 1; background: var(--surface-1); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px; min-height: 100vh; gap: 0;
}
.auth-visual-logo-wrap {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; margin-bottom: 40px;
}
.auth-visual-logo-wrap img { width: clamp(140px,22vw,220px); height: auto; object-fit: contain; }
.auth-visual-title { font-size: 2rem; font-weight: 800; color: var(--txt);
  text-align: center; line-height: 1.2; margin-bottom: 12px; font-family: var(--font-display); }
.auth-visual-title span { color: var(--accent); }
.auth-visual-sub { font-size: .87rem; color: var(--txt-muted); text-align: center; max-width: 300px; line-height: 1.6; }
.auth-visual-features { margin-top: 36px; display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 300px; }
.auth-feature { display: flex; align-items: center; gap: 12px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.auth-feature-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-feature-icon svg { width: 15px; color: var(--accent); }
.auth-feature-text strong { font-size: .82rem; display: block; }
.auth-feature-text small  { font-size: .72rem; color: var(--txt-muted); }

.auth-form-wrap { width: 420px; max-width: 100%; padding: 48px 40px;
  display: flex; flex-direction: column; justify-content: center; }
.auth-logo     { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.auth-logo img { height: 30px; width: auto; object-fit: contain; }
.auth-title    { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; font-family: var(--font-display); }
.auth-subtitle { font-size: .82rem; color: var(--txt-muted); margin-bottom: 22px; }
.auth-footer   { text-align: center; font-size: .8rem; color: var(--txt-muted); margin-top: 18px; }
.auth-footer a { color: var(--accent); }
.auth-divider  { height: 1px; background: var(--border); margin: 18px 0; position: relative; }
.auth-divider span { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: var(--bg); padding: 0 10px; font-size: .72rem; color: var(--txt-dim); }

/* ══ AUTH ACCENT SELECTOR (tela de login) ═══════════════════════ */
.auth-accent-row { display: flex; align-items: center; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.auth-accent-label { font-size: .68rem; color: var(--txt-dim); white-space: nowrap; }
.auth-accent-dots  { display: flex; gap: 6px; flex-wrap: wrap; }
.auth-accent-dot {
  width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s, border-color .15s;
  position: relative;
}
.auth-accent-dot:hover { transform: scale(1.2); }
.auth-accent-dot.active { border-color: rgba(255,255,255,.7); transform: scale(1.2); }
.auth-accent-dot.active::after {
  content: ''; position: absolute; inset: 2px;
  background: rgba(255,255,255,.3); border-radius: 50%;
}

/* ══ MOBILE ═════════════════════════════════════════════════════ */
@media(max-width:1100px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
}
@media(max-width:800px) {
  .auth-visual { display: none; }
  .auth-form-wrap { width: 100%; padding: 32px 22px; min-height: 100vh; }
  .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2,1fr); }
  .btn-close-mobile { display: inline-flex; }
  body { padding-left: 0; }
  .topbar { left: 0; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
}
@media(max-width:480px) {
  .stats-row { grid-template-columns: 1fr; }
  .auth-form-wrap { padding: 24px 16px; }
}
