/* ============================================================
   AgendamentoPro — Design System v2
   Tokens HSL para tema claro/escuro + cor de destaque
   ============================================================ */

:root {
  /* HSL canais (sem hsl() wrapper) para opacidade via Tailwind-style */
  --bg: 40 23% 95%;              /* #F3F2EF */
  --bg-card: 0 0% 100%;          /* #FFF */
  --bg-sidebar: 0 0% 11%;        /* #1C1B1A */
  --bg-hover: 40 17% 97%;        /* #F8F7F5 */
  --text: 0 0% 11%;              /* #1C1B1A */
  --text-muted: 40 3% 53%;       /* #8B8984 */
  --text-light: 40 5% 68%;       /* #B0AEA8 */
  --border: 40 14% 89%;          /* #E6E4E0 */

  /* Cor primária (accent) — padrão Purple */
  --primary-h: 261;
  --primary-s: 77%;
  --primary-l: 56%;
  --primary: var(--primary-h) var(--primary-s) var(--primary-l);
  --primary-hover: 258 90% 50%;
  --primary-subtle: 262 100% 97%;
  --primary-glow: 261 77% 56% / 0.12;

  --success: 161 94% 30%;
  --success-subtle: 152 81% 96%;
  --error: 0 84% 60%;
  --error-subtle: 0 93% 97%;
  --warning: 38 92% 50%;
  --warning-subtle: 48 100% 96%;

  --shadow: 0 4px 16px hsl(0 0% 0% / 0.05);
  --shadow-lg: 0 12px 40px hsl(0 0% 0% / 0.06);
  --shadow-glow: 0 8px 32px hsl(var(--primary) / 0.15);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-full: 999px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --nav-h: 64px;
  --sidebar-w: 260px;

  /* Glassmorphism */
  --glass-bg: hsl(0 0% 100% / 0.72);
  --glass-border: hsl(0 0% 100% / 0.18);
  --glass-shadow: 0 8px 32px hsl(0 0% 0% / 0.06);
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --bg: 0 0% 7%;                 /* #121212 */
  --bg-card: 0 0% 11%;           /* #1C1B1A */
  --bg-sidebar: 0 0% 5%;         /* #0D0D0D */
  --bg-hover: 0 0% 16%;          /* #282828 */
  --text: 0 0% 93%;              /* #EDEDED */
  --text-muted: 0 0% 53%;        /* #878787 */
  --text-light: 0 0% 35%;        /* #595959 */
  --border: 0 0% 18%;            /* #2E2E2E */

  --primary-subtle: 261 50% 15%;
  --primary-glow: 261 77% 56% / 0.15;
  --success-subtle: 161 60% 10%;
  --error-subtle: 0 60% 15%;
  --warning-subtle: 38 50% 12%;

  --glass-bg: hsl(0 0% 7% / 0.75);
  --glass-border: hsl(0 0% 100% / 0.06);
  --glass-shadow: 0 8px 32px hsl(0 0% 0% / 0.3);

  --shadow: 0 4px 16px hsl(0 0% 0% / 0.2);
  --shadow-lg: 0 12px 40px hsl(0 0% 0% / 0.3);
}

/* Garante que scrollbar e seleção acompanhem o tema */
[data-theme="dark"] ::selection { background: hsl(var(--primary) / 0.3); color: #fff; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: hsl(0 0% 25%); }
[data-theme="dark"] ::-webkit-scrollbar-track { background: hsl(0 0% 10%); }

/* --- CSS Reset --- */
*, *::before, *::after {
  box-sizing: border-box; margin: 0; padding: 0;
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: hsl(var(--bg));
  color: hsl(var(--text));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible {
  outline: 2.5px solid hsl(var(--primary));
  outline-offset: 2px; border-radius: 4px;
}
::selection { background: hsl(var(--primary) / 0.2); }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   LOGO
   ============================================================ */
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: hsl(var(--primary)); color: #fff;
  font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.logo-text {
  font-size: 1.1rem; font-weight: 700; letter-spacing: -0.03em;
}
.logo-text span { color: hsl(var(--primary)); }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
  min-height: 100vh; display: grid; place-items: center;
  padding: 1.5rem;
  background: hsl(var(--bg));
}
.auth-container { width: 100%; max-width: 460px; }
.auth-card {
  background: hsl(var(--bg-card));
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid hsl(var(--border));
}
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header .auth-logo {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem;
}
.auth-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.35rem; }
.auth-header p { color: hsl(var(--text-muted)); font-size: 0.875rem; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.82rem; margin-bottom: 1.25rem; line-height: 1.5;
  display: flex; align-items: center; gap: 0.5rem;
  animation: alertIn .25s ease-out;
}
@keyframes alertIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.alert-success {
  background: hsl(var(--success-subtle)); color: hsl(var(--success));
  border: 1px solid hsl(var(--success) / 0.25);
}
.alert-error {
  background: hsl(var(--error-subtle)); color: hsl(var(--error));
  border: 1px solid hsl(var(--error) / 0.25);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block; font-size: 0.8rem; font-weight: 500;
  margin-bottom: 0.35rem; color: hsl(var(--text));
}
.form-hint {
  font-size: 0.72rem; color: hsl(var(--text-muted));
  margin-top: 0.25rem;
}
.inp {
  width: 100%; padding: 0.7rem 0.9rem; font-size: 0.875rem;
  border: 1.5px solid hsl(var(--border)); border-radius: var(--radius-sm);
  background: hsl(var(--bg-card)); color: hsl(var(--text));
  font-family: var(--font); transition: border-color .2s, box-shadow .2s, background .2s;
}
.inp:focus {
  outline: none; border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.12);
}
.inp::placeholder { color: hsl(var(--text-light)); }
textarea.inp { resize: vertical; min-height: 80px; }
select.inp { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238B8984' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }
.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 0.7rem 1.5rem; font-size: 0.875rem; font-weight: 500;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font); transition: all .2s ease;
  position: relative; overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: hsl(var(--primary)); color: #fff;
}
.btn-primary:hover {
  background: hsl(var(--primary-hover));
  box-shadow: var(--shadow-glow);
}
.btn-secondary {
  background: hsl(var(--bg-card)); color: hsl(var(--text));
  border: 1.5px solid hsl(var(--border));
}
.btn-secondary:hover {
  background: hsl(var(--bg-hover)); border-color: hsl(var(--text-light));
}
.btn-danger {
  background: hsl(var(--error)); color: #fff;
}
.btn-danger:hover {
  background: hsl(0 74% 50%);
  box-shadow: 0 8px 24px hsl(0 84% 60% / 0.2);
}
.btn-block { width: 100%; }
.btn-sm {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.75rem; font-size: 0.75rem; font-weight: 500;
  border-radius: 6px; background: hsl(var(--bg)); color: hsl(var(--text));
  border: 1px solid hsl(var(--border)); cursor: pointer;
  font-family: var(--font); transition: all .15s; text-decoration: none;
}
.btn-sm:hover { background: hsl(var(--bg-hover)); }
.btn-sm-danger { color: hsl(var(--error)); border-color: hsl(var(--error) / 0.25); }
.btn-sm-danger:hover { background: hsl(var(--error-subtle)); }

/* --- Profile Select --- */
.profile-select {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.profile-option {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  padding: 1.25rem 1rem; border: 1.5px solid hsl(var(--border));
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all .2s; text-align: center; position: relative;
}
.profile-option:hover { border-color: hsl(var(--primary)); }
.profile-option.active {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary-subtle));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.12);
}
.profile-option input { display: none; }
.profile-option strong { font-size: 0.82rem; font-weight: 600; }
.profile-option span:last-child { font-size: 0.72rem; color: hsl(var(--text-muted)); }
.divider { border: none; border-top: 1px solid hsl(var(--border)); margin: 1.5rem 0; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w); background: hsl(var(--bg-sidebar));
  z-index: 200; display: flex; flex-direction: column;
  transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid hsl(var(--border) / .06);
}
.sidebar-logo { display: flex; align-items: center; gap: 0.5rem; }
.sidebar-logo .logo-mark { background: hsl(var(--primary)); }
.sidebar-logo .logo-text { color: #fff; font-size: 1rem; }
.sidebar-logo .logo-text span { color: hsl(var(--primary-hover)); }
.sidebar-close {
  background: none; border: none; color: hsl(0 0% 100% / .3);
  font-size: 1.5rem; cursor: pointer; padding: 0.25rem; display: none; line-height: 1;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.75rem; }
.nav-label {
  display: block; font-size: 0.65rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: hsl(0 0% 100% / .2);
  padding: 0.75rem 0.75rem 0.5rem;
}
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.75rem; border-radius: var(--radius-sm);
  color: hsl(0 0% 100% / .5); font-size: 0.82rem; font-weight: 450;
  transition: all .15s; margin-bottom: 2px; cursor: pointer;
}
.nav-item:hover { background: hsl(0 0% 100% / .04); color: hsl(0 0% 100% / .8); }
.nav-item.active {
  background: hsl(261 77% 56% / .15);
  color: hsl(261 77% 75%);
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .6; transition: opacity .15s; }
.nav-item.active .nav-icon { opacity: 1; }

.nav-dashboard { background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23A78BFA' stroke-width='1.5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-agendamentos { background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23A78BFA' stroke-width='1.5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-clientes { background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23A78BFA' stroke-width='1.5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 00-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 010 7.75'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-servicos { background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23A78BFA' stroke-width='1.5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-profissionais { background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23A78BFA' stroke-width='1.5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-financeiro { background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23A78BFA' stroke-width='1.5' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='12' y1='1' x2='12' y2='23'/%3E%3Cpath d='M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-relatorios { background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23A78BFA' stroke-width='1.5' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='18' y1='20' x2='18' y2='10'/%3E%3Cline x1='12' y1='20' x2='12' y2='4'/%3E%3Cline x1='6' y1='20' x2='6' y2='14'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-configuracoes { background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23A78BFA' stroke-width='1.5' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z'/%3E%3C/svg%3E") center/contain no-repeat; }
.nav-sair { background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23A78BFA' stroke-width='1.5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E") center/contain no-repeat; }

.sidebar-footer { padding: 0.75rem; border-top: 1px solid hsl(0 0% 100% / .06); }
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 199;
  background: hsl(0 0% 0% / .4); display: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* --- Main Content --- */
.main-content {
  margin-left: var(--sidebar-w); flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
}

/* --- Topbar --- */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.5rem; height: var(--nav-h);
  background: var(--glass-bg);
  border-bottom: 1px solid hsl(var(--border));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 100;
}
.topbar-toggle {
  display: none; flex-direction: column; gap: 4px;
  background: none; border: none; cursor: pointer; padding: 0.25rem;
}
.topbar-toggle span {
  display: block; width: 20px; height: 2px;
  background: hsl(var(--text)); border-radius: 2px;
  transition: all .3s;
}
.topbar-title { flex: 1; }
.topbar-title h2 { font-size: 1.1rem; font-weight: 600; }
.topbar-perfil {
  font-size: 0.7rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.06em; color: hsl(var(--primary));
  background: hsl(var(--primary-subtle));
  padding: 0.15rem 0.6rem; border-radius: var(--radius-full);
}
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-user { display: flex; align-items: center; gap: 0.65rem; }
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: hsl(var(--primary-subtle)); color: hsl(var(--primary));
  font-weight: 700; font-size: 0.75rem; flex-shrink: 0;
}
.topbar-user-info { line-height: 1.3; }
.topbar-user-info strong { display: block; font-size: 0.8rem; font-weight: 600; }
.topbar-user-info span { font-size: 0.72rem; color: hsl(var(--text-muted)); }

/* --- Content --- */
.content { padding: 1.5rem; flex: 1; }

/* --- Stats Grid --- */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  display: flex; align-items: center; gap: 1rem;
  background: hsl(var(--bg-card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); padding: 1.25rem;
  transition: all .2s ease; cursor: default;
}
.stat-card:hover {
  box-shadow: var(--shadow); transform: translateY(-2px);
}
.stat-icon { width: 44px; height: 44px; border-radius: var(--radius-sm); flex-shrink: 0; }
.stat-icon-users { background: hsl(var(--primary-subtle)); }
.stat-icon-today { background: hsl(var(--success-subtle)); }
.stat-icon-pending { background: hsl(var(--warning-subtle)); }
.stat-icon-clients { background: hsl(336 100% 97%); }
.stat-info { line-height: 1.3; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; }
.stat-label { font-size: 0.78rem; color: hsl(var(--text-muted)); font-weight: 450; }

/* --- Cards --- */
.card-grid { display: grid; gap: 1rem; }
.card {
  background: hsl(var(--bg-card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); overflow: hidden;
  transition: box-shadow .2s ease;
}
.card:hover { box-shadow: var(--shadow); }
.card-full { grid-column: 1 / -1; }
.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid hsl(var(--border)); }
.card-header h3 { font-size: 1rem; font-weight: 600; }
.card-header p { font-size: 0.82rem; color: hsl(var(--text-muted)); margin-top: 0.25rem; }
.card-header-actions { display: flex; align-items: center; gap: 0.5rem; }
.card-body { padding: 1.25rem 1.5rem; }
.card-body:first-child { padding: 0; }
.card-glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* --- Page Header --- */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.page-header-left h3 { font-size: 1.15rem; font-weight: 600; }
.page-header-left p { font-size: 0.82rem; color: hsl(var(--text-muted)); margin-top: 0.2rem; }
.page-header-right { flex-shrink: 0; }

/* --- Tables --- */
.table-wrapper { overflow-x: auto; }
.table {
  width: 100%; border-collapse: collapse; font-size: 0.82rem;
}
.table th {
  text-align: left; padding: 0.75rem 1rem; font-weight: 600;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: hsl(var(--text-muted));
  background: hsl(var(--bg)); border-bottom: 1px solid hsl(var(--border));
}
.table td {
  padding: 0.75rem 1rem; border-bottom: 1px solid hsl(var(--border)); vertical-align: middle;
}
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: hsl(var(--bg-hover)); }
.table tbody tr:last-child td { border-bottom: none; }
.table td small { color: hsl(var(--text-muted)); font-size: 0.72rem; }
.actions-cell { white-space: nowrap; display: flex; gap: 0.35rem; }

/* --- Badges --- */
.badge {
  display: inline-flex; padding: 0.15rem 0.5rem; border-radius: var(--radius-full);
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-ativo, .badge-concluido { background: hsl(var(--success-subtle)); color: hsl(var(--success)); }
.badge-pendente { background: hsl(var(--warning-subtle)); color: hsl(var(--warning)); }
.badge-inativo, .badge-cancelado { background: hsl(var(--error-subtle)); color: hsl(var(--error)); }

/* --- Empty State --- */
.empty-state {
  text-align: center; padding: 3rem 1.5rem;
}
.empty-icon {
  width: 56px; height: 56px; margin: 0 auto 1rem;
  background: hsl(var(--bg)); border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.5rem; color: hsl(var(--text-light));
}
.empty-state h4 { font-size: 1rem; font-weight: 600; margin-bottom: 0.35rem; }
.empty-state p { font-size: 0.82rem; color: hsl(var(--text-muted)); margin-bottom: 1.25rem; max-width: 360px; margin-left: auto; margin-right: auto; }

/* ============================================================
   SETTINGS — Theme Picker / Color Picker
   ============================================================ */
.theme-toggle {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem; border-radius: var(--radius-full);
  background: hsl(var(--bg)); border: 1px solid hsl(var(--border));
}
.theme-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: transparent; cursor: pointer; font-size: 1.1rem;
  display: grid; place-items: center;
  transition: all .2s; color: hsl(var(--text-muted));
}
.theme-btn.active {
  background: hsl(var(--primary-subtle));
  color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / .2);
}
.theme-btn:hover { color: hsl(var(--text)); }

.color-options {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.color-swatch {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; transition: all .2s; position: relative;
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.active { border-color: hsl(var(--text)); box-shadow: 0 0 0 3px hsl(var(--bg-card)), 0 0 0 5px hsl(var(--primary)); }
.color-swatch input { display: none; }

/* --- Upload / Logo --- */
.upload-area {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem; border: 2px dashed hsl(var(--border));
  border-radius: var(--radius-sm); transition: all .2s; cursor: pointer;
}
.upload-area:hover { border-color: hsl(var(--primary)); background: hsl(var(--primary-subtle)); }
.upload-preview {
  width: 64px; height: 64px; border-radius: var(--radius-sm);
  background: hsl(var(--bg)); display: grid; place-items: center;
  overflow: hidden; flex-shrink: 0;
}
.upload-preview img { width: 100%; height: 100%; object-fit: contain; }
.upload-info small { color: hsl(var(--text-muted)); font-size: 0.72rem; }

/* --- Danger Zone --- */
.zone-danger {
  border: 1.5px solid hsl(var(--error) / .35);
  border-radius: var(--radius);
  background: hsl(var(--error-subtle));
}
.zone-danger .card-header {
  border-bottom-color: hsl(var(--error) / .15);
}
.zone-danger .card-header h3 { color: hsl(var(--error)); }

/* --- Integration Row --- */
.integration-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1rem 0;
}
.integration-row + .integration-row { border-top: 1px solid hsl(var(--border)); }
.integration-info { display: flex; align-items: center; gap: 0.75rem; }
.integration-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: grid; place-items: center; font-size: 1.15rem;
  background: hsl(var(--bg));
}
.integration-info strong { display: block; font-size: 0.85rem; }
.integration-info small { font-size: 0.75rem; color: hsl(var(--text-muted)); }

/* --- Switch Toggle --- */
.toggle {
  position: relative; display: inline-flex; width: 44px; height: 24px;
  cursor: pointer; flex-shrink: 0;
}
.toggle input { display: none; }
.toggle-slider {
  position: absolute; inset: 0; background: hsl(var(--border));
  border-radius: var(--radius-full); transition: background .2s;
}
.toggle-slider::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .2s;
  box-shadow: 0 1px 3px hsl(0 0% 0% / .15);
}
.toggle input:checked + .toggle-slider { background: hsl(var(--primary)); }
.toggle input:checked + .toggle-slider::after { transform: translateX(20px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .topbar-toggle { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 1rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar-user-info { display: none; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
