/* ═══════════════════════════════════════════════════════════════
   DLE 1º e 2º ANO — styles.css v1.0.0
   Design System SME São Gonçalo do Amarante - CE
   ═══════════════════════════════════════════════════════════════ */

:root {
  --primary: #1565C0; --primary-hover: #0d47a1;
  --primary-soft: #E3F2FD; --primary-tint: #BBDEFB;
  --success: #2e7d32; --success-soft: #e8f5e9;
  --warning: #ed6c02; --warning-soft: #fff3e0;
  --danger: #c62828; --danger-soft: #ffebee;
  --info: #0288d1; --info-soft: #e1f5fe;
  --text: #1a202c; --text-muted: #64748b; --text-light: #94a3b8;
  --border: #e2e8f0; --border-strong: #cbd5e1;
  --bg: #f0f4f8; --bg-alt: #e2e8f0; --card-bg: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --radius-sm: 8px; --radius: 12px; --radius-lg: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
  color: var(--text); font-size: 14px; line-height: 1.5; min-height: 100vh;
}
.hidden { display: none !important; }

/* LOGIN */
#login-screen {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
}
.login-card {
  background: var(--card-bg); max-width: 420px; width: 100%;
  padding: 40px; border-radius: 20px; box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 16px; }
.login-logo img { width: 80px; height: 80px; object-fit: contain; }
.login-title {
  font-size: 22px; font-weight: 700; text-align: center;
  color: var(--primary); margin-bottom: 4px; letter-spacing: 0.3px;
}
.login-subtitle {
  font-size: 12px; color: var(--text-muted); text-align: center;
  margin-bottom: 28px; text-transform: uppercase; letter-spacing: 0.8px;
}
.login-footer {
  text-align: center; font-size: 11px; color: var(--text-light);
  margin-top: 22px; text-transform: uppercase; letter-spacing: 0.6px;
}

/* CAMPOS */
.field { display: flex; flex-direction: column; margin-bottom: 16px; }
.field label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--primary);
  margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
}
.field label i { font-size: 13px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--card-bg); transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}
.field select:disabled, .field input:disabled {
  background: #f8fafc; color: var(--text-light); cursor: not-allowed;
}

/* BOTÕES */
.btn-primary, .btn-secondary, .btn-danger, .btn-ghost {
  display: inline-flex; align-items: center; gap: 8px; border: none;
  padding: 11px 22px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary.full { width: 100%; justify-content: center; }
.btn-secondary { background: var(--card-bg); color: var(--primary); border: 1.5px solid var(--primary); }
.btn-secondary:hover { background: var(--primary-soft); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b71c1c; }
.btn-ghost {
  background: transparent; color: var(--text-muted);
  text-transform: none; letter-spacing: 0; font-weight: 500; padding: 8px 14px;
}
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); }

/* HEADER */
.header {
  background: var(--card-bg); border-bottom: 4px solid var(--primary);
  padding: 14px 26px; display: flex;
  justify-content: space-between; align-items: center;
  box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 10;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-logo { width: 46px; height: 46px; object-fit: contain; }
.header-title { font-weight: 700; font-size: 17px; color: var(--primary); line-height: 1.2; }
.header-subtitle {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.header-right { display: flex; align-items: center; gap: 18px; }
.user-info { text-align: right; }
.user-name { font-weight: 600; font-size: 13px; }
.user-role {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.main { max-width: 1400px; margin: 0 auto; padding: 24px; }

/* VIEWS / TABS */
.view { display: none; }
.view.active { display: block; }
.tabs {
  display: flex; gap: 8px; margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}
.tab {
  background: transparent; border: none; padding: 12px 22px;
  font-family: inherit; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: all 0.15s; display: flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* PAGE HEADER */
.page-header {
  display: flex; justify-content: space-between;
  align-items: flex-end; margin-bottom: 20px;
  flex-wrap: wrap; gap: 16px;
}
.page-title {
  font-size: 22px; font-weight: 700; color: var(--primary);
  display: flex; align-items: center; gap: 10px;
}
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* CARDS */
.card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.card-title {
  font-size: 15px; font-weight: 700; color: var(--primary);
  margin-bottom: 18px; display: flex; align-items: center; gap: 8px;
}
.filters-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 4px;
}

/* TABELA ALUNOS */
.alunos-wrap {
  overflow-x: auto; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.tbl-alunos {
  width: 100%; border-collapse: collapse;
  font-size: 12px; min-width: 1100px;
}
.tbl-alunos thead { background: var(--primary-soft); position: sticky; top: 0; }
.tbl-alunos th {
  text-align: left; padding: 10px 8px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--primary); border-bottom: 2px solid var(--primary-tint);
  white-space: nowrap;
}
.tbl-alunos td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl-alunos tbody tr:nth-child(even) { background: rgba(241, 245, 249, 0.5); }
.tbl-alunos tbody tr:hover { background: var(--primary-soft); }
.tbl-alunos tr.ja-avaliado .col-aluno::before {
  content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  color: var(--success); margin-right: 6px; font-size: 10px;
}
.tbl-alunos td.col-aluno {
  font-weight: 600; font-size: 12px; min-width: 220px;
  position: sticky; left: 0; background: var(--card-bg); z-index: 1;
}
.tbl-alunos tbody tr:hover .col-aluno { background: var(--primary-soft); }
.tbl-alunos td.col-aluno .aluno-tags {
  display: block; font-size: 10px; color: var(--text-muted); margin-top: 2px;
}
.tbl-alunos td.col-aluno .aee-icon { color: var(--info); margin-left: 4px; }
.tbl-alunos select.diag-input {
  width: 100%; padding: 5px 6px; font-size: 11px;
  border: 1px solid var(--border); border-radius: 5px;
  background: white; font-family: inherit; min-width: 80px;
}
.tbl-alunos select.diag-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(21,101,192,0.15);
}
.tbl-alunos select.diag-input.has-value {
  border-color: var(--primary); background: var(--primary-soft); font-weight: 600;
}

/* DASHBOARD */
.metrics-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.metric {
  background: linear-gradient(135deg, var(--primary-soft) 0%, white 100%);
  border: 1px solid var(--primary-tint);
  border-radius: var(--radius-sm); padding: 16px;
}
.metric-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--primary); margin-bottom: 6px;
}
.metric-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.metric-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.barlist { display: flex; flex-direction: column; gap: 8px; }
.barlist-row {
  display: grid; grid-template-columns: 200px 60px 1fr 70px;
  gap: 10px; align-items: center;
}
.barlist-row .codigo { font-size: 12px; font-weight: 600; color: var(--text); }
.barlist-row .qtd { font-size: 12px; font-weight: 700; color: var(--primary); text-align: right; }
.barlist-row .pct { font-size: 11px; color: var(--text-muted); text-align: right; }
.barlist-bar-wrap {
  background: var(--bg-alt); height: 20px;
  border-radius: 10px; overflow: hidden;
}
.barlist-bar {
  background: linear-gradient(90deg, var(--primary) 0%, var(--info) 100%);
  height: 100%; border-radius: 10px; transition: width 0.3s ease;
}

/* LOADING / TOAST / MODAL */
#loading-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,0.7);
  display: none; align-items: center; justify-content: center; z-index: 9999;
}
#loading-overlay.show { display: flex; }
.spinner { font-size: 36px; color: var(--primary); }
#toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 9998;
  display: flex; flex-direction: column; gap: 8px; max-width: 380px;
}
.toast {
  background: var(--card-bg); padding: 12px 16px;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; border-left: 4px solid var(--primary);
  animation: slideIn 0.2s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.success i { color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.error i { color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--info); }
.toast i { margin-top: 2px; font-size: 16px; }
.toast span { word-break: break-word; }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--card-bg); border-radius: var(--radius-lg);
  padding: 28px; max-width: 460px; width: 100%; box-shadow: var(--shadow-lg);
}
.modal-title {
  font-size: 17px; font-weight: 700; color: var(--primary);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.modal-body { font-size: 13px; color: var(--text); margin-bottom: 22px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* EMPTY STATE */
.empty-state {
  text-align: center; padding: 50px 20px; color: var(--text-muted);
}
.empty-state i {
  font-size: 56px; color: var(--text-light); margin-bottom: 12px;
}
.empty-state p { font-size: 14px; margin-bottom: 18px; }

/* RESPONSIVO */
@media (max-width: 768px) {
  .main { padding: 14px; }
  .header { padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .header-title { font-size: 14px; }
  .user-info { display: none; }
  .page-title { font-size: 18px; }
  .filters-grid { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; }
  .tab { padding: 10px 14px; font-size: 11px; white-space: nowrap; }
  .barlist-row { grid-template-columns: 130px 50px 1fr 50px; }
}

