/* ============================================================
   HUB SAIS • Design System v3.0
   Moderno • Responsivo • Consistente
   ============================================================ */

/* ---------- FONT ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---------- TOKENS ---------- */
:root {
  /* Brand */
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;
  --brand-900: #312e81;

  /* Accent violet */
  --violet: #8b5cf6;
  --violet-600: #7c3aed;

  /* Neutros */
  --bg:        #f5f7fb;
  --surface:   #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e9eef5;
  --border:    #e2e8f0;
  --border-2:  #cbd5e1;
  --text:      #0f172a;
  --text-soft: #475569;
  --text-mute: #94a3b8;
  --dark:      #0b1220;
  --dark-2:    #111a2e;

  /* Status */
  --success:    #10b981;
  --success-bg: #d1fae5;
  --success-fg: #065f46;
  --danger:     #ef4444;
  --danger-bg:  #fee2e2;
  --danger-fg:  #991b1b;
  --warning:    #f59e0b;
  --warning-bg: #fef3c7;
  --warning-fg: #92400e;
  --info:       #3b82f6;
  --info-bg:    #dbeafe;
  --info-fg:    #1e40af;

  /* Radius */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-2xl:32px;

  /* Shadows */
  --sh-sm: 0 1px 2px rgba(15,23,42,.06);
  --sh:    0 4px 14px rgba(15,23,42,.07);
  --sh-md: 0 10px 28px rgba(15,23,42,.10);
  --sh-lg: 0 24px 50px rgba(15,23,42,.14);
  --sh-xl: 0 32px 70px rgba(79,70,229,.25);

  --t: all .22s cubic-bezier(.4,0,.2,1);
  --t-slow: all .4s cubic-bezier(.4,0,.2,1);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- BASE ---------- */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(1000px 500px at -10% -20%, rgba(99,102,241,.10), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, rgba(139,92,246,.08), transparent 60%),
    radial-gradient(900px 500px at 50% 120%, rgba(59,130,246,.06), transparent 60%);
  background-attachment: fixed;
}

a { color: var(--brand-600); text-decoration: none; transition: var(--t); }
a:hover { color: var(--brand-700); }

svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ---------- LAYOUT ---------- */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ============================================================
   LOGIN
   ============================================================ */
body.center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-wrapper {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 0;
  max-width: 1080px;
  width: 100%;
  background: var(--surface);
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--sh-xl);
  border: 1px solid var(--border);
  animation: fadeUp .55s ease;
}

.login-hero {
  padding: 60px 52px;
  color: #fff;
  background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 45%, #7c3aed 100%);
  position: relative;
  overflow: hidden;
}
.login-hero::before {
  content: '';
  position: absolute;
  width: 460px; height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%);
  top: -180px; right: -180px;
}
.login-hero::after {
  content: '';
  position: absolute;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.4), transparent 70%);
  bottom: -140px; left: -120px;
}
.login-hero > * { position: relative; z-index: 1; }

.hero-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 68px; height: 68px; border-radius: 20px;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.25);
  font-weight: 900; font-size: 22px; letter-spacing: -1.5px;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  margin-bottom: 28px;
}
.login-hero h2 {
  font-size: 42px; font-weight: 900; letter-spacing: -1.5px;
  line-height: 1.05; margin-bottom: 16px;
  background: linear-gradient(135deg,#fff 30%, #c7d2fe);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-hero p { font-size: 16px; color: #c7d2fe; max-width: 400px; margin-bottom: 36px; }

.hero-features { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.hero-features li {
  display: flex; align-items: center; gap: 12px;
  font-size: 14.5px; color: #e0e7ff; font-weight: 500;
  padding: 12px 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}
.hero-features li svg { color: #a5b4fc; }

.login-card {
  padding: 60px 52px;
  display: flex; flex-direction: column; gap: 18px;
  background: var(--surface);
  justify-content: center;
}
.login-head { margin-bottom: 6px; }
.login-head h1 {
  font-size: 28px; font-weight: 800; color: var(--text);
  letter-spacing: -.8px; margin-bottom: 6px;
}
.login-head p { font-size: 14px; color: var(--text-soft); }

.login-card label {
  display: flex; flex-direction: column; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: .6px;
}
.login-card label > svg { color: var(--brand-600); margin-right: 4px; }

@media (max-width: 900px) {
  .login-wrapper { grid-template-columns: 1fr; max-width: 480px; }
  .login-hero { padding: 40px 32px; }
  .login-hero h2 { font-size: 30px; }
  .login-hero p { font-size: 14px; margin-bottom: 20px; }
  .hero-logo { width: 56px; height: 56px; font-size: 18px; margin-bottom: 20px; }
  .hero-features li { padding: 10px 12px; font-size: 13.5px; }
  .login-card { padding: 36px 28px; }
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 20px;
  padding: 12px 28px;
  background: rgba(11,18,32,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 2px 20px rgba(11,18,32,.18);
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 15.5px; font-weight: 800; color: #fff;
  letter-spacing: -.3px;
  padding-right: 18px;
  border-right: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
}
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg,#818cf8,#a78bfa);
  box-shadow: 0 0 14px rgba(129,140,248,.9);
  animation: pulse 2s infinite;
}
.brand-name { display: none; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; padding: 8px 10px;
  color: #cbd5e1; cursor: pointer;
  transition: var(--t);
}
.nav-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }

.topbar nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.topbar nav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500;
  color: #cbd5e1; white-space: nowrap;
  transition: var(--t);
}
.topbar nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.topbar nav a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-600), var(--violet));
  box-shadow: 0 6px 18px rgba(99,102,241,.40);
}
.topbar nav a.logout-link {
  color: #fca5a5; margin-left: auto;
}
.topbar nav a.logout-link:hover { background: rgba(239,68,68,.15); color: #fecaca; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 14px 5px 5px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 40px;
  flex-shrink: 0;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg,#818cf8,#a78bfa);
  color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-info { line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-handle { font-size: 11px; color: #94a3b8; }

@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: .7; transform: scale(1.15); }
}

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .brand { font-size: 14px; padding-right: 0; border-right: none; }
  .brand-name { display: inline; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .user-chip { padding: 4px; }
  .user-info { display: none; }

  .topbar nav {
    order: 20;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease, padding .35s ease;
  }
  .topbar nav.open { max-height: 500px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.06); }
  .topbar nav a { justify-content: flex-start; padding: 11px 14px; font-size: 14px; }
  .topbar nav a.logout-link { margin-left: 0; }
}

/* ============================================================
   TIPOGRAFIA
   ============================================================ */
h1 {
  font-size: 28px; font-weight: 800; letter-spacing: -.8px;
  color: var(--text); margin-bottom: 6px;
}
h2 { font-size: 20px; font-weight: 700; letter-spacing: -.4px; margin: 24px 0 12px; }
h3 { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }

.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 28px;
}
.page-title-block h1 { margin-bottom: 4px; }
.page-subtitle { font-size: 14px; color: var(--text-soft); font-weight: 500; }

/* ============================================================
   GRID
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}
.stat-card {
  position: relative;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  transition: var(--t);
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(99,102,241,.06), transparent 70%);
  border-radius: 50%;
  transform: translate(40%, -40%);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }

.stat-icon {
  width: 48px; height: 48px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; margin-bottom: 14px;
  position: relative; z-index: 1;
}
.stat-icon.indigo  { background: linear-gradient(135deg,#6366f1,#8b5cf6); box-shadow: 0 8px 22px rgba(99,102,241,.35); }
.stat-icon.emerald { background: linear-gradient(135deg,#10b981,#059669); box-shadow: 0 8px 22px rgba(16,185,129,.32); }
.stat-icon.amber   { background: linear-gradient(135deg,#f59e0b,#d97706); box-shadow: 0 8px 22px rgba(245,158,11,.32); }
.stat-icon.rose    { background: linear-gradient(135deg,#f43f5e,#e11d48); box-shadow: 0 8px 22px rgba(244,63,94,.32); }

.stat-value {
  font-size: 34px; font-weight: 900; letter-spacing: -1.5px;
  color: var(--text); line-height: 1; margin-bottom: 6px;
  position: relative; z-index: 1;
}
.stat-label {
  font-size: 12px; font-weight: 700; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: .7px;
  position: relative; z-index: 1;
}

/* ============================================================
   SECTION
   ============================================================ */
.section { margin-bottom: 40px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px; flex-wrap: wrap;
}
.section-title {
  font-size: 17px; font-weight: 700; letter-spacing: -.3px;
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text);
}
.section-title svg { color: var(--brand-600); }

/* ============================================================
   CARDS GENÉRICOS
   ============================================================ */
.card {
  background: var(--surface);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  transition: var(--t);
}
.card:hover { box-shadow: var(--sh-md); }

/* Cards de área */
.area-card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 22px 22px 22px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  transition: var(--t);
  overflow: hidden;
}
.area-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 5px; height: 100%;
  background: linear-gradient(180deg, var(--brand-500), var(--violet));
}
.area-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-md);
  border-color: var(--brand-200);
}
.area-card h3 {
  font-size: 16.5px; color: var(--text); letter-spacing: -.3px;
  display: flex; align-items: center; gap: 10px;
}
.area-card h3::before {
  content: '';
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-200));
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%234f46e5'%3E%3Cpath d='M12 2L2 7l10 5 10-5-10-5z'/%3E%3C/svg%3E"), linear-gradient(135deg, var(--brand-100), var(--brand-200));
  background-repeat: no-repeat;
  background-position: center;
}
.area-card .muted { font-size: 13.5px; color: var(--text-soft); }

/* Cards de contato */
.contato-card {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  transition: var(--t);
}
.contato-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-md);
  border-color: var(--brand-200);
}
.contato-card h3 {
  font-size: 16.5px; color: var(--text);
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--surface-2);
  margin-bottom: 4px;
  letter-spacing: -.3px;
}
.contato-card h3::before {
  content: '';
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--violet));
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(99,102,241,.30);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E"), linear-gradient(135deg, var(--brand-500), var(--violet));
  background-repeat: no-repeat;
  background-position: center;
}
.contato-card .muted {
  font-size: 13.5px; color: var(--text-soft);
  display: flex; align-items: center; gap: 8px;
}
.contato-card .muted svg { color: var(--brand-500); }

/* ============================================================
   FORM CARD
   ============================================================ */
.form-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  margin-bottom: 28px;
}
.form-card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--surface-2);
}
.form-card-head svg { color: var(--brand-600); }
.form-card-head h3 { font-size: 15.5px; margin: 0; letter-spacing: -.2px; }

/* ============================================================
   FORM ELEMENTOS
   ============================================================ */
label {
  display: flex; flex-direction: column; gap: 7px;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase; letter-spacing: .5px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  transition: var(--t);
  outline: none;
}
input::placeholder, textarea::placeholder { color: var(--text-mute); font-weight: 400; }
input:hover, select:hover, textarea:hover { border-color: var(--border-2); }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(99,102,241,.14);
  background: #fff;
}
textarea { min-height: 88px; resize: vertical; font-family: inherit; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' 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 14px center;
  padding-right: 40px;
  cursor: pointer;
}

/* Row inline */
.row {
  display: flex; gap: 14px; align-items: flex-end;
  flex-wrap: wrap; margin-bottom: 14px;
}
.row > * { flex: 1; min-width: 180px; }
.row .shrink { flex: 0 0 auto; min-width: auto; }

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.1;
  user-select: none;
}
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-600), var(--violet));
  color: #fff;
  box-shadow: 0 6px 16px rgba(99,102,241,.30);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-700), var(--violet-600));
  box-shadow: 0 10px 24px rgba(99,102,241,.42);
  transform: translateY(-1px);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 6px 16px rgba(239,68,68,.28);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 10px 24px rgba(239,68,68,.4);
  transform: translateY(-1px);
  color: #fff;
}

.btn-sm { padding: 8px 13px; font-size: 12.5px; gap: 5px; }
.btn-block { width: 100%; }

/* ============================================================
   TAGS
   ============================================================ */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  display: inline-flex; align-items: center;
  padding: 5px 11px;
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  color: var(--brand-700);
  border: 1px solid var(--brand-200);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .2px;
}

/* ============================================================
   ALERTAS
   ============================================================ */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; margin-bottom: 20px;
  border-radius: var(--r);
  font-size: 14px; font-weight: 500;
  border-left: 4px solid;
  animation: slideIn .3s ease;
}
.alert-success { background: var(--success-bg); color: var(--success-fg); border-color: var(--success); }
.alert-error   { background: var(--danger-bg);  color: var(--danger-fg);  border-color: var(--danger); }
.alert-info    { background: var(--info-bg);    color: var(--info-fg);    border-color: var(--info); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   TABELAS
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  border: 1px solid var(--border);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
table th, table td {
  padding: 14px 16px;
  text-align: left;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table th {
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: .8px;
  white-space: nowrap;
}
table tbody tr:last-child td { border-bottom: none; }
table tbody tr { transition: background .15s ease; }
table tbody tr:hover { background: var(--surface-2); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 10.5px; font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-admin { background: var(--warning-bg); color: var(--warning-fg); }
.badge-oper  { background: var(--info-bg);    color: var(--info-fg); }
.badge-conv  { background: var(--success-bg); color: var(--success-fg); }

/* Badge dentro do topbar (fundo escuro) */
.topbar .badge { padding: 4px 9px; font-size: 10px; }

/* ============================================================
   CHECKBOX LIST
   ============================================================ */
.checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  margin-top: 8px;
}
.checkbox-list::-webkit-scrollbar { width: 8px; }
.checkbox-list::-webkit-scrollbar-track { background: transparent; }
.checkbox-list::-webkit-scrollbar-thumb { background: var(--brand-300); border-radius: 4px; }
.checkbox-list::-webkit-scrollbar-thumb:hover { background: var(--brand-400); }

.checkbox-list label {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  transition: var(--t);
  user-select: none;
}
.checkbox-list label:hover {
  border-color: var(--brand-400);
  background: var(--brand-50);
  transform: translateY(-1px);
}
.checkbox-list input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--brand-600);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  border-radius: 4px;
}

/* ============================================================
   ACTIONS (dentro de cards)
   ============================================================ */
.actions {
  display: flex; gap: 8px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--surface-2);
  flex-wrap: wrap;
}
.actions form { margin: 0; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  padding: 60px 24px;
  text-align: center;
  background: var(--surface);
  border: 2px dashed var(--border-2);
  border-radius: var(--r-lg);
  color: var(--text-soft);
}
.empty-state svg { color: var(--brand-300); margin-bottom: 14px; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; color: var(--text); font-weight: 700; }
.empty-state p { font-size: 13.5px; }

/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.muted { color: var(--text-soft); font-size: 13px; }
.text-center { text-align: center; }
.mt-2 { margin-top: 20px; }
.mb-2 { margin-bottom: 20px; }

/* ============================================================
   ANIMAÇÕES
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.area-card, .contato-card, .stat-card {
  animation: fadeUp .4s ease both;
}
.area-card:nth-child(1), .contato-card:nth-child(1), .stat-card:nth-child(1) { animation-delay: .04s; }
.area-card:nth-child(2), .contato-card:nth-child(2), .stat-card:nth-child(2) { animation-delay: .08s; }
.area-card:nth-child(3), .contato-card:nth-child(3), .stat-card:nth-child(3) { animation-delay: .12s; }
.area-card:nth-child(4), .contato-card:nth-child(4), .stat-card:nth-child(4) { animation-delay: .16s; }
.area-card:nth-child(5), .contato-card:nth-child(5), .stat-card:nth-child(5) { animation-delay: .20s; }
.area-card:nth-child(6), .contato-card:nth-child(6), .stat-card:nth-child(6) { animation-delay: .24s; }

/* ============================================================
   SCROLLBAR GLOBAL
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand-300), var(--brand-500));
  border-radius: 6px;
  border: 2px solid var(--surface-2);
}
::-webkit-scrollbar-thumb:hover { background: var(--brand-500); }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 900px) {
  .container { padding: 24px 18px 60px; }
  h1 { font-size: 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
  .stat-value { font-size: 28px; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .container { padding: 20px 14px 50px; }

  h1 { font-size: 21px; letter-spacing: -.5px; }
  h2 { font-size: 17px; }

  .page-header { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-header .btn { width: 100%; }

  .grid { grid-template-columns: 1fr; gap: 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-icon { width: 40px; height: 40px; border-radius: 11px; margin-bottom: 10px; }
  .stat-value { font-size: 24px; }
  .stat-label { font-size: 10.5px; }

  .card, .area-card, .contato-card, .form-card { padding: 18px; }
  .area-card { padding-left: 20px; }

  .row { gap: 10px; margin-bottom: 10px; }
  .row > * { min-width: 100%; flex: 1 1 100%; }
  .row .shrink { width: 100%; }
  .row .shrink .btn { width: 100%; }

  .actions { flex-direction: column; gap: 8px; }
  .actions .btn, .actions form, .actions form .btn { width: 100%; }

  .checkbox-list { grid-template-columns: 1fr; max-height: 240px; padding: 10px; }

  .table-wrap { border-radius: var(--r); }
  table th, table td { padding: 11px 12px; font-size: 12.5px; }

  .section-header { flex-direction: column; align-items: stretch; }
  .section-header .btn { width: 100%; }

  .login-card { padding: 30px 22px; }
  .login-hero h2 { font-size: 26px; }
}

@media (max-width: 380px) {
  .container { padding: 16px 10px 40px; }
  .stat-grid { grid-template-columns: 1fr; }
  h1 { font-size: 19px; }
}