/* =============================================================
   Sósia Pro — Tema futurista
   Preto profundo + violeta + ciano elétrico
   Fontes: Space Grotesk (display) + Inter (body)
   ============================================================= */

:root {
  /* Marca */
  --violet:        #a855f7;
  --violet-dark:   #7c3aed;
  --violet-light:  #c084fc;
  --cyan:          #00d9ff;
  --cyan-dark:     #06b6d4;
  --gold:          #fbbf24;
  --grad: linear-gradient(135deg, #a855f7 0%, #00d9ff 100%);
  --grad-soft: linear-gradient(135deg, rgba(168,85,247,0.18) 0%, rgba(0,217,255,0.10) 100%);

  /* Semânticas */
  --success: #10b981;
  --danger:  #ef4444;
  --warning: #fbbf24;
  --info:    #00d9ff;

  /* Tema dark único */
  --bg:           #08080f;
  --bg-card:      #14141f;
  --bg-elevated:  #1c1c2e;
  --bg-input:     #0d0d18;
  --text:         #e2e8f0;
  --text-strong:  #f8fafc;
  --text-muted:   #94a3b8;
  --text-soft:    #64748b;
  --border:        rgba(168, 85, 247, 0.18);
  --border-strong: rgba(168, 85, 247, 0.40);
  --glow:          0 0 28px rgba(168, 85, 247, 0.25);

  /* Raio e sombra */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --shadow-card: 0 4px 20px rgba(0,0,0,0.55);

  /* Fontes */
  --ff-display: 'Space Grotesk', system-ui, sans-serif;
  --ff-body:    'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1000px 600px at 90% -10%, rgba(168,85,247,0.10), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(0,217,255,0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5 {
  font-family: var(--ff-display);
  color: var(--text-strong);
  font-weight: 600;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--violet-light); }

.mono { font-family: var(--ff-body); font-variant-numeric: tabular-nums; }
.text-muted { color: var(--text-muted); }
.pos, .positivo { color: var(--success); }
.neg, .negativo { color: var(--danger); }

/* =============================================================
   Sidebar + main
   ============================================================= */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 240px;
  background: linear-gradient(180deg, rgba(20,20,31,0.95), rgba(8,8,15,0.95));
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex; flex-direction: column;
  z-index: 50;
  backdrop-filter: blur(12px);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.brand-mark {
  width: 38px; height: 38px;
  background: var(--grad);
  border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  font-family: var(--ff-display);
  font-size: 18px; font-weight: 700;
  box-shadow: 0 0 18px rgba(168,85,247,0.45);
}
.brand-mark.big { width: 52px; height: 52px; font-size: 26px; border-radius: 14px; }
.brand-text strong {
  display: block; font-family: var(--ff-display);
  color: var(--text-strong); font-size: 15px; letter-spacing: -0.02em;
}
.brand-text span { display: block; font-size: 11px; color: var(--text-muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-soft); padding: 14px 10px 6px;
  font-family: var(--ff-display);
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--text); font-size: 13.5px; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--bg-elevated); color: var(--text-strong); }
.nav-item.active {
  background: var(--grad-soft);
  color: var(--text-strong);
  border-color: var(--border-strong);
  box-shadow: var(--glow);
}
.nav-item.disabled { color: var(--text-soft); cursor: not-allowed; opacity: 0.55; }
.nav-ico {
  width: 22px; text-align: center;
  font-family: var(--ff-display);
  color: var(--violet-light); font-size: 14px;
}
.nav-item.active .nav-ico { color: var(--cyan); }

.sidebar-footer {
  margin-top: auto; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user { display: flex; align-items: center; gap: 6px; font-size: 12.5px; min-width: 0; }
.su-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); }

.main { margin-left: 240px; padding: 22px 28px 60px; min-height: 100vh; max-width: 1500px; }

.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; margin-bottom: 18px;
}
.page-head h1 { font-size: 1.7rem; margin: 0; letter-spacing: -0.02em; }
.page-head .subtitle { margin: 4px 0 0; font-size: 0.9rem; color: var(--text-muted); }
.page-actions { display: flex; gap: 8px; }

.menu-toggle {
  display: none;
  position: fixed; top: 14px; left: 14px; z-index: 100;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--bg-card); color: var(--text-strong);
  border: 1px solid var(--border-strong);
  font-size: 22px; cursor: pointer;
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 60px 16px 40px; }
  .menu-toggle { display: block; }
}

/* =============================================================
   Cards
   ============================================================= */
.card {
  background: linear-gradient(180deg, rgba(20,20,31,0.85), rgba(20,20,31,0.65));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
}
.card h2 { font-size: 1.1rem; margin-bottom: 6px; }
.card h3 { font-size: 1rem; margin-bottom: 6px; }
.card h2 + p.text-muted, .card h3 + p.text-muted { margin: 0 0 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-card { min-height: 140px; }

/* =============================================================
   Hero
   ============================================================= */
.hero {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(450px 240px at 100% 0%, rgba(0,217,255,0.16), transparent 60%),
    radial-gradient(450px 240px at 0% 100%, rgba(168,85,247,0.20), transparent 60%),
    linear-gradient(180deg, rgba(20,20,31,0.90), rgba(20,20,31,0.70));
}
.hero h2 { font-size: 1.6rem; line-height: 1.2; margin-bottom: 8px; }
.hero p { font-size: 14.5px; margin: 0 0 18px; max-width: 640px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-glow {
  position: absolute; top: -60px; right: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: var(--grad);
  filter: blur(70px); opacity: 0.35;
  pointer-events: none;
}

/* =============================================================
   Botões
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px;
  border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600;
  font-family: var(--ff-body);
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter .12s, transform .05s, border-color .12s, box-shadow .15s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn-disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 18px rgba(168,85,247,0.35);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 6px 28px rgba(168,85,247,0.55); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-elevated); border-color: var(--violet); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger); border-color: rgba(239,68,68,0.4);
}
.btn-danger:hover { background: rgba(239,68,68,0.20); }
.btn-block { width: 100%; }

/* =============================================================
   Forms
   ============================================================= */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; }
.field small { display: block; margin-top: 4px; font-size: 11.5px; }
.input, .select, .textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-strong);
  font-family: var(--ff-body);
  font-size: 14px;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.20);
}
.input:disabled, .select:disabled { opacity: 0.7; cursor: not-allowed; }
.textarea { min-height: 90px; resize: vertical; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .field-row, .field-row-3 { grid-template-columns: 1fr; } }

/* =============================================================
   Tabela
   ============================================================= */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tbl th { color: var(--text-muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.tbl-dense th, .tbl-dense td { padding: 6px 8px; }
.tbl tr:last-child td { border-bottom: none; }

/* =============================================================
   KPIs
   ============================================================= */
.kpis {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 18px;
}
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } }
.kpi {
  background: linear-gradient(180deg, rgba(20,20,31,0.85), rgba(20,20,31,0.65));
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s, box-shadow .15s;
}
.kpi:hover { border-color: var(--border-strong); box-shadow: var(--glow); }
.kpi-label { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.kpi-value { font-family: var(--ff-display); font-size: 1.4rem; color: var(--text-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 11.5px; color: var(--text-soft); }

/* =============================================================
   Badges
   ============================================================= */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 11px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border); font-weight: 500;
}
.badge-success { background: rgba(16,185,129,0.12); color: var(--success); border-color: rgba(16,185,129,0.3); }
.badge-danger  { background: rgba(239,68,68,0.12); color: var(--danger);  border-color: rgba(239,68,68,0.3); }
.badge-warn    { background: rgba(251,191,36,0.14); color: var(--gold);   border-color: rgba(251,191,36,0.3); }
.badge-info    { background: rgba(0,217,255,0.12); color: var(--cyan);    border-color: rgba(0,217,255,0.3); }

/* =============================================================
   Pills
   ============================================================= */
.pill {
  display: inline-flex; align-items: center;
  padding: 8px 14px; border-radius: var(--r-pill);
  font-size: 13px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .12s;
}
.pill:hover { color: var(--text-strong); border-color: var(--violet); }
.pill-active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 0 16px rgba(168,85,247,0.4); }

/* =============================================================
   Flash
   ============================================================= */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash {
  padding: 12px 14px; border-radius: var(--r-sm);
  font-size: 13.5px; border: 1px solid;
}
.flash-success { background: rgba(16,185,129,0.10); color: var(--success); border-color: rgba(16,185,129,0.3); }
.flash-error   { background: rgba(239,68,68,0.10); color: var(--danger);  border-color: rgba(239,68,68,0.3); }
.flash-warn    { background: rgba(251,191,36,0.10); color: var(--gold);   border-color: rgba(251,191,36,0.3); }
.flash-info    { background: rgba(0,217,255,0.10); color: var(--cyan);    border-color: rgba(0,217,255,0.3); }

/* =============================================================
   Auth
   ============================================================= */
.auth-body {
  background:
    radial-gradient(800px 500px at 15% 0%, rgba(168,85,247,0.18), transparent 60%),
    radial-gradient(700px 500px at 85% 100%, rgba(0,217,255,0.15), transparent 60%),
    var(--bg);
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 30px 16px;
}
.auth-shell { width: 100%; max-width: 440px; }
.auth-card { padding: 30px 26px; }
.auth-brand {
  text-align: center; margin-bottom: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.auth-brand h1 { font-size: 1.6rem; margin: 6px 0 0; letter-spacing: -0.02em; }
.auth-brand p { margin: 0; font-size: 13.5px; }
.auth-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.auth-form .field:last-of-type { margin-bottom: 18px; }
.auth-hint { text-align: center; margin: 14px 0 0; font-size: 13px; }
