/* ─── RESET & BASE ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #F8FAFC;
  --surface:   #FFFFFF;
  --border:    #E2E8F0;
  --text:      #0F172A;
  --muted:     #64748B;
  --accent:    #3B82F6;
  --accent-dk: #1D4ED8;
  --green:     #10B981;
  --red:       #EF4444;
  --yellow:    #F59E0B;
  --sidebar-bg:#0F172A;
  --sidebar-hover: rgba(255,255,255,0.07);
  --sidebar-active: rgba(59,130,246,0.18);
  --sidebar-text: #94A3B8;
  --sidebar-text-active: #FFFFFF;
  --radius:    10px;
  --shadow:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ─── SIDEBAR ─────────────────────────────────── */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}
.brand-name {
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  padding: 14px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-item.sub { padding-left: 36px; font-size: 13px; font-weight: 400; }

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-footer-text { color: #334155; font-size: 11px; }

/* ─── MAIN ────────────────────────────────────── */
.main {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 0;
}
.page-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
}

.content { padding: 20px 28px 40px; }

/* ─── ALERTS ──────────────────────────────────── */
.alerts { padding: 12px 28px 0; }
.alert {
  padding: 11px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin-bottom: 8px;
  font-weight: 500;
}
.alert-success { background: #DCFCE7; color: #15803D; border-left: 3px solid var(--green); }
.alert-info    { background: #DBEAFE; color: #1D4ED8; border-left: 3px solid var(--accent); }
.alert-error   { background: #FEE2E2; color: #B91C1C; border-left: 3px solid var(--red); }

/* ─── CARDS / GRID ────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.stat-value.green { color: var(--green); }
.stat-value.red   { color: var(--red); }
.stat-value.blue  { color: var(--accent); }
.stat-value.yellow { color: var(--yellow); }
.stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ─── TABLE ───────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  background: #F8FAFC;
}
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: #F8FAFC; }
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text);
}
tbody tr:last-child td { border-bottom: none; }

/* ─── BADGES ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-aluno       { background: #EFF6FF; color: #1D4ED8; }
.badge-funcionario { background: #F0FDF4; color: #15803D; }
.badge-presente    { background: #DCFCE7; color: #15803D; }
.badge-ausente     { background: #FEE2E2; color: #B91C1C; }
.badge-atrasado    { background: #FEF3C7; color: #B45309; }
.badge-pago        { background: #DCFCE7; color: #15803D; }
.badge-pendente    { background: #FEF3C7; color: #B45309; }
.badge-atrasado-fin { background: #FEE2E2; color: #B91C1C; }
.badge-receita     { background: #DCFCE7; color: #15803D; }
.badge-despesa     { background: #FEE2E2; color: #B91C1C; }

/* ─── BUTTONS ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dk); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #CBD5E1; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); color: var(--text); }
.btn-danger { background: #FEE2E2; color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-success { background: #DCFCE7; color: var(--green); }
.btn-success:hover { background: var(--green); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ─── FORMS ───────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }

label { font-size: 12.5px; font-weight: 600; color: var(--text); }
input, select, textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ─── FILTERS BAR ─────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filters-bar input,
.filters-bar select { min-width: 160px; }

/* ─── DASHBOARD GRID ──────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ─── PRESENÇA LIST ───────────────────────────── */
.presenca-list { padding: 0; }
.presenca-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.presenca-row:last-child { border-bottom: none; }
.presenca-name { flex: 1; font-weight: 500; font-size: 13.5px; }
.presenca-radios { display: flex; gap: 8px; }
.radio-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.15s;
}
.radio-pill input { display: none; }
.radio-pill.presente { border-color: transparent; background: #DCFCE7; color: #15803D; }
.radio-pill.ausente  { border-color: transparent; background: #FEE2E2; color: #B91C1C; }
.radio-pill.atrasado { border-color: transparent; background: #FEF3C7; color: #B45309; }

/* ─── EMPTY STATE ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-state svg { width: 40px; height: 40px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 13.5px; }

/* ─── MODAL (Financeiro form) ─────────────────── */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 14px;
  padding: 28px;
  width: 540px;
  max-width: 95vw;
  box-shadow: var(--shadow-md);
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}
