:root{
  --bg:#0b1220;
  --panel:#101a2e;
  --panel2:#0f172a;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --border:rgba(255,255,255,.08);
  --accent:#4f46e5;
  --accent2:#22c55e;
  --warn:#f59e0b;
  --danger:#ef4444;
  --shadow: 0 14px 40px rgba(0,0,0,.35);
  --radius:16px;
  --radius-sm:12px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue", sans-serif;
  background:
    radial-gradient(1200px 800px at 15% 10%, rgba(79,70,229,.18), transparent 60%),
    radial-gradient(900px 700px at 95% 20%, rgba(34,197,94,.12), transparent 55%),
    var(--bg);
  color:var(--text);
}

/* ===== LAYOUT ===== */
.shell{
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 18px 60px;
}

.topbar{
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
  margin-bottom:18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  letter-spacing:.3px;
}

.brand .dot{
  width:12px;height:12px;border-radius:999px;
  background: linear-gradient(135deg, var(--accent), #06b6d4);
  box-shadow: 0 0 0 6px rgba(79,70,229,.18);
}

.nav{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
}

a{ color:#c7d2fe; text-decoration:none; }
a:hover{ color:#fff; }

/* ===== BUTTONS ===== */
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background: rgba(255,255,255,.04);
  border:1px solid var(--border);
  color:var(--text);
}
.pill:hover{ background: rgba(255,255,255,.06); }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color:#fff;
  border:1px solid rgba(255,255,255,.14);
  box-shadow: 0 10px 25px rgba(79,70,229,.25);
  cursor:pointer;
  font-weight:600;
}
.btn:hover{ filter:brightness(1.06); }

.btn-secondary{
  background: rgba(255,255,255,.06);
  box-shadow:none;
}

/* ===== TITLES ===== */
.h1{ font-size:26px; margin:10px 0 14px; }
.h2{ font-size:18px; margin:20px 0 10px; color:#f3f4f6; }

/* ===== CARDS ===== */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.035));
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.pad{ padding:16px; }

/* ===== GRID / KPI ===== */
.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:12px;
}

.kpis{ margin-top: 8px; }

.kpi{
  grid-column: span 3;
  padding:14px;
  border-radius: var(--radius);
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
}
.kpi .label{ color:var(--muted); font-size:12px; }
.kpi .value{ font-size:18px; font-weight:800; margin-top:6px; }
.kpi.positive .value{ color:#86efac; }
.kpi.negative .value{ color:#fca5a5; }

@media (max-width: 980px){
  .kpi{ grid-column: span 6; }
}
@media (max-width: 520px){
  .kpi{ grid-column: span 12; }
  .topbar{ flex-direction:column; align-items:flex-start; }
  .nav{ justify-content:flex-start; }
}

/* ===== TABLE ===== */
.table-wrap{
  overflow:auto;
  border-radius: var(--radius);
  border:1px solid var(--border);
  background: rgba(255,255,255,.02);
}

table{
  width:100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,td{
  padding:12px;
  border-bottom:1px solid rgba(255,255,255,.06);
  text-align:left;
  font-size: 14px;
}

th{
  color:#d1d5db;
  font-weight:700;
  background: rgba(255,255,255,.03);
}

tr:hover td{ background: rgba(255,255,255,.02); }

/* ===== BADGES ===== */
.badge{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  font-size:12px;
  font-weight:700;
}

.badge.open{
  color:#fde68a;
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.25);
}
.badge.paid{
  color:#86efac;
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.25);
}
.badge.overdue{
  color:#fca5a5;
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.25);
}

/* ===== FORMS ===== */
.form{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:12px;
}

.field{ grid-column: span 6; }
.field.full{ grid-column: span 12; }

label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
}

input,select{
  width:100%;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  color:var(--text);
  outline:none;
}

input:focus,select:focus{
  border-color: rgba(79,70,229,.6);
  box-shadow: 0 0 0 4px rgba(79,70,229,.18);
}

.form-actions{
  grid-column: span 12;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
}

/* ===== ALERTS ===== */
.alert{
  border:1px solid var(--border);
  border-left:4px solid rgba(245,158,11,.65);
  background: rgba(255,255,255,.03);
  padding:12px;
  border-radius: 12px;
}
.alert.error{ border-left-color: rgba(239,68,68,.75); }

/* =====================================================
   AUTH (LOGIN / REGISTER) — TEMA ESCURO
===================================================== */
.auth-center{
  min-height: calc(100vh - 86px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 28px 14px 60px;
}

.auth-card{
  width: 520px;
  max-width: 92vw;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  padding: 26px 26px 20px;
}

.auth-logo{
  display:flex;
  justify-content:center;
  margin-bottom: 14px;
}

.auth-logo img{
  max-width: 180px;
  height:auto;
  opacity:.95;
}

.auth-title{
  text-align:center;
  font-size: 22px;
  font-weight: 800;
  margin: 6px 0 18px;
}

.auth-card label{
  color: var(--muted);
}

.auth-card input, .auth-card select{
  background: rgba(0,0,0,.35);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.15);
}

.auth-card input:focus, .auth-card select:focus{
  border-color: rgba(79,70,229,.9);
  box-shadow: 0 0 0 4px rgba(79,70,229,.25);
}

.btn-full{
  width:100%;
  justify-content:center;
  padding: 12px 14px;
  border-radius: 12px;
}

.auth-links{
  text-align:center;
  margin-top: 10px;
  font-size: 13px;
}
.auth-links a{ color:#c7d2fe; }
.auth-links a:hover{ color:#fff; text-decoration: underline; }

.auth-footer{
  text-align:center;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}
