/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Poppins', sans-serif;
  background: #EEF2FE;
  color: #1e293b;
  min-height: 100vh;
}
a { color: #497BFD; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== LOGIN ===== */
.login-container {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(135deg, #3558c7 0%, #497BFD 100%);
}
.login-box {
  background: #FFFFFF; border-radius: 16px; padding: 48px 40px;
  width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.login-box h1 {
  text-align: center; color: #1e293b; font-size: 28px; margin-bottom: 8px; font-weight: 700;
}
.login-box .subtitle {
  text-align: center; color: #64748b; margin-bottom: 32px; font-size: 14px;
}
.login-box .logo {
  text-align: center; font-size: 40px; margin-bottom: 16px; color: #497BFD;
}

/* ===== LAYOUT ===== */
.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 260px; background: #FFFFFF; color: #1e293b;
  display: flex; flex-direction: column; position: fixed;
  top: 0; left: 0; bottom: 0; z-index: 100;
  transition: transform 0.3s;
  border-right: 1px solid #e2e8f0;
  box-shadow: 2px 0 8px rgba(0,0,0,0.04);
}
.sidebar-header {
  padding: 24px 20px; border-bottom: 1px solid #e2e8f0;
}
.sidebar-header h2 { font-size: 20px; color: #497BFD; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.sidebar-header small { color: #94a3b8; font-size: 12px; }
.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; color: #64748b; font-size: 14px; font-weight: 500;
  transition: all 0.2s; border-left: 3px solid transparent;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: #EEF2FE; color: #497BFD; text-decoration: none;
  border-left-color: #497BFD;
}
.sidebar-nav a .icon { font-size: 18px; width: 24px; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.sidebar-footer {
  padding: 16px 20px; border-top: 1px solid #e2e8f0;
}
.sidebar-footer a {
  color: #ef4444; font-size: 14px; display: flex; align-items: center; gap: 8px; font-weight: 500;
}
.sidebar-footer a:hover { color: #dc2626; text-decoration: none; }

/* Main */
.main-content {
  flex: 1; margin-left: 260px; padding: 32px;
  min-height: 100vh;
}
.page-header {
  margin-bottom: 32px;
}
.page-header h1 { font-size: 28px; color: #1e293b; margin-bottom: 4px; font-weight: 700; }
.page-header p { color: #64748b; font-size: 14px; }

/* ===== CARDS ===== */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px; margin-bottom: 32px;
}
.stat-card {
  background: #FFFFFF; border-radius: 12px; padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex; align-items: center; gap: 16px;
  border: 1px solid #e2e8f0;
}
.stat-card .stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #FFFFFF;
}
.stat-icon.blue { background: #497BFD; }
.stat-icon.green { background: #16a34a; }
.stat-icon.purple { background: #7c3aed; }
.stat-icon.orange { background: #ea580c; }
.stat-card .stat-info h3 { font-size: 28px; color: #1e293b; font-weight: 700; }
.stat-card .stat-info p { font-size: 13px; color: #64748b; }

/* ===== CARD / PANEL ===== */
.card {
  background: #FFFFFF; border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 24px;
  border: 1px solid #e2e8f0;
}
.card-header {
  padding: 20px 24px; border-bottom: 1px solid #e2e8f0;
  display: flex; justify-content: space-between; align-items: center;
}
.card-header h2 { font-size: 18px; color: #1e293b; font-weight: 600; }
.card-body { padding: 24px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 14px; font-weight: 600;
  color: #374151; margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 10px 14px; border: 1px solid #d1d5db;
  border-radius: 8px; font-size: 14px; background: #FFFFFF;
  transition: border-color 0.2s; font-family: 'Poppins', sans-serif;
}
.form-control:focus { outline: none; border-color: #497BFD; box-shadow: 0 0 0 3px rgba(73,123,253,0.15); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-inline {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
}
.form-inline .form-group { margin-bottom: 0; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; text-decoration: none;
  font-family: 'Poppins', sans-serif;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: #497BFD; color: #FFFFFF; }
.btn-primary:hover { background: #3a66e0; }
.btn-success { background: #16a34a; color: #FFFFFF; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #ef4444; color: #FFFFFF; }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: #64748b; color: #FFFFFF; }
.btn-secondary:hover { background: #475569; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-outline {
  background: transparent; border: 1px solid #d1d5db; color: #374151;
}
.btn-outline:hover { background: #EEF2FE; }

/* ===== TABLES ===== */
.table-responsive { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
}
@media (max-width: 768px) {
  th, td {
    padding: 10px 8px; font-size: 12px;
  }
}
th, td {
  padding: 12px 16px; text-align: left; font-size: 14px;
  border-bottom: 1px solid #e2e8f0;
}
th {
  background: #EEF2FE; color: #64748b; font-weight: 600;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
}
tr:hover { background: #f8fafc; }
.actions { display: flex; gap: 8px; }

/* ===== ALERTS ===== */
.alert {
  padding: 14px 20px; border-radius: 8px; margin-bottom: 20px;
  font-size: 14px; display: flex; align-items: center; gap: 10px;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #EEF2FE; color: #497BFD; border: 1px solid #c7d2fe; }

/* ===== BADGES ===== */
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-blue { background: #EEF2FE; color: #497BFD; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-orange { background: #fff7ed; color: #c2410c; }

/* ===== CHECKBOX PRESENÇA ===== */
.checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.checkbox-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px;
  background: #f8fafc; border: 1px solid #e2e8f0;
}
.checkbox-item input[type="checkbox"] {
  width: 18px; height: 18px; cursor: pointer; accent-color: #497BFD;
}
.checkbox-item label { cursor: pointer; font-size: 14px; }

/* ===== SELECT MULTIPLE ===== */
.select-multiple {
  border: 1px solid #d1d5db; border-radius: 8px;
  max-height: 200px; overflow-y: auto; padding: 8px;
}
.select-multiple label {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 4px; cursor: pointer;
  font-size: 14px; font-weight: normal;
}
.select-multiple label:hover { background: #EEF2FE; }
.select-multiple input[type="checkbox"] { accent-color: #497BFD; }

/* ===== NOTAS INPUT ===== */
.nota-input {
  width: 70px; text-align: center; padding: 6px 8px;
  border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px;
  font-family: 'Poppins', sans-serif;
}
.nota-input:focus { outline: none; border-color: #497BFD; }
.media-badge {
  display: inline-block; padding: 4px 12px; border-radius: 6px;
  font-weight: 700; font-size: 13px;
}
.media-badge.aprovado { background: #dcfce7; color: #166534; }
.media-badge.reprovado { background: #fee2e2; color: #991b1b; }
.media-badge.pendente { background: #EEF2FE; color: #64748b; }

/* ===== BOLETIM PRINT ===== */
.boletim-container { max-width: 900px; margin: 0 auto; }
.boletim-header {
  text-align: center; margin-bottom: 24px;
  padding-bottom: 16px; border-bottom: 2px solid #497BFD;
}
.boletim-header h2 { font-size: 22px; font-weight: 700; color: #1e293b; display: flex; align-items: center; justify-content: center; gap: 10px; }
.boletim-header p { color: #64748b; }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 24px;
  padding: 16px; background: #FFFFFF; border-radius: 8px;
  border: 1px solid #e2e8f0; align-items: flex-end;
}
.filter-bar form { display: contents; }
.filter-bar .form-group { margin-bottom: 0; display: flex; flex-direction: column; }
.filter-bar .btn { width: 100%; justify-content: center; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 48px 20px; color: #94a3b8;
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; color: #c7d2fe; }
.empty-state p { font-size: 15px; }

/* ===== LUCIDE ICON HELPERS ===== */
.sidebar-nav a .icon i,
.sidebar-footer a .icon i { font-size: 18px; }
.btn i { font-size: 14px; }
.stat-icon i { font-size: 22px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 12px; overflow-x: hidden; }
  body { overflow-x: hidden; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .form-row { grid-template-columns: 1fr; gap: 12px; }
  .form-inline { gap: 8px; }
  .form-group { margin-bottom: 12px; }
  .card-body { padding: 16px 12px; }
  .page-header { padding: 16px 0; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar .btn { width: 100%; }
  .mobile-toggle {
    display: flex !important; align-items: center; justify-content: center;
    position: fixed; bottom: 20px; right: 20px;
    z-index: 200; background: #497BFD; color: #FFFFFF; border: none;
    width: 52px; height: 52px; border-radius: 50%; font-size: 22px;
    cursor: pointer; box-shadow: 0 4px 12px rgba(73,123,253,0.4);
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .mobile-toggle:active {
    transform: scale(0.92);
    box-shadow: 0 2px 8px rgba(73,123,253,0.3);
  }
}
.mobile-toggle { display: none; }

/* ===== PRINT ===== */
@media print {
  .sidebar, .no-print, .mobile-toggle { display: none !important; }
  .main-content { margin-left: 0; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  body { background: #FFFFFF; }
}
