/* ================================================================
   GESCLASS – Design System
   Cores extraídas da logo: Azul #1B2D6B | Teal #2ECBA1
================================================================ */

/* ── TEMA CLARO (padrão) ─────────────────────────────── */
:root {
  --navy:      #1B2D6B;
  --navy-dark: #111E4A;
  --navy-mid:  #2A3F8F;
  --teal:      #2ECBA1;
  --teal-dark: #22A882;
  --teal-light:#E6F9F4;

  --bg:        #F4F6FB;
  --bg-card:   #FFFFFF;
  --bg-sidebar:#FFFFFF;
  --bg-topbar: #FFFFFF;
  --bg-input:  #F8FAFC;
  --bg-hover:  #F0F4FF;
  --bg-stripe: #F8FAFC;

  --text-primary:   #1B2D6B;
  --text-secondary: #5A6A8A;
  --text-muted:     #9AAAC4;
  --text-inverse:   #FFFFFF;

  --border:    #DDE4EE;
  --border-focus: #2ECBA1;

  --shadow-sm: 0 1px 3px rgba(27,45,107,.07), 0 1px 2px rgba(27,45,107,.04);
  --shadow-md: 0 4px 16px rgba(27,45,107,.10), 0 2px 6px rgba(27,45,107,.05);
  --shadow-lg: 0 10px 40px rgba(27,45,107,.14), 0 4px 12px rgba(27,45,107,.07);

  --ok:       #16A34A; --ok-bg:   #DCFCE7;
  --warn:     #D97706; --warn-bg: #FEF3C7;
  --err:      #DC2626; --err-bg:  #FEE2E2;
  --info:     #0284C7; --info-bg: #E0F2FE;

  --r:    12px;
  --rsm:   8px;
  --rlg:  20px;
  --rxl:  28px;
}

/* ── TEMA ESCURO ──────────────────────────────────────── */
[data-theme="dark"] {
  --bg:        #0E1525;
  --bg-card:   #16213A;
  --bg-sidebar:#111E38;
  --bg-topbar: #16213A;
  --bg-input:  #1E2D4A;
  --bg-hover:  #1E2D4A;
  --bg-stripe: #1A2840;

  --text-primary:   #E8EDF8;
  --text-secondary: #8FA4C8;
  --text-muted:     #4D6080;

  --border:    #243050;
  --border-focus: #2ECBA1;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.5);

  --ok-bg:   #052e16; --warn-bg: #1c1000; --err-bg: #1c0000; --info-bg: #082035;
}

/* ── RESET & BASE ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background .25s, color .25s;
}
h1,h2,h3,h4,h5 { font-family: 'Sora', sans-serif; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: 'DM Sans', sans-serif; }
input, select, textarea { font-family: 'DM Sans', sans-serif; }

/* ── SCREENS ──────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: flex; }

/* ── LOGIN SCREEN ────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 55%, var(--navy-mid) 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.login-screen::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(46,203,161,.08);
  top: -180px; right: -180px;
}
.login-screen::after {
  content: '';
  position: absolute;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: rgba(46,203,161,.05);
  bottom: -130px; left: -130px;
}
.login-card {
  background: var(--bg-card);
  border-radius: var(--rxl);
  padding: 44px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}
.login-logo {
  display: flex; align-items: center; gap: 14px;
  justify-content: center; margin-bottom: 32px;
}
.login-logo-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(27,45,107,.35);
  flex-shrink: 0;
}
.login-logo-icon svg { width: 30px; height: 30px; }
.login-logo-text h1 {
  font-size: 28px; font-weight: 700; letter-spacing: -.5px;
  color: var(--navy);
}
.login-logo-text h1 span { color: var(--teal); }
.login-logo-text p { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; }

/* ── FORM ELEMENTS ───────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 7px; }
.form-control {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--rsm);
  font-size: 15px; color: var(--text-primary);
  background: var(--bg-input);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .25s;
}
.form-control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(46,203,161,.15);
  background: var(--bg-card);
}
.form-control::placeholder { color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── TABS ────────────────────────────────────────────── */
.login-tabs { display: flex; background: var(--bg); border-radius: var(--rsm); padding: 4px; margin-bottom: 28px; gap: 2px; }
.login-tab {
  flex: 1; padding: 9px 8px; border: none; background: transparent;
  border-radius: 6px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer; transition: all .2s;
}
.login-tab.active { background: var(--bg-card); color: var(--navy); box-shadow: var(--shadow-sm); }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--rsm);
  font-size: 13px; font-weight: 500; border: 1px solid transparent;
  transition: all .15s; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; }
.btn-primary {
  width: 100%; padding: 14px; justify-content: center;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  color: white; border: none; border-radius: var(--rsm);
  font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(27,45,107,.35);
  margin-top: 6px; cursor: pointer; transition: all .2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(27,45,107,.40); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-teal { background: var(--teal); color: var(--navy-dark); box-shadow: 0 2px 8px rgba(46,203,161,.35); }
.btn-teal:hover { background: var(--teal-dark); }
.btn-navy { background: var(--navy); color: white; box-shadow: 0 2px 8px rgba(27,45,107,.25); }
.btn-navy:hover { background: var(--navy-dark); }
.btn-outline { background: var(--bg-card); color: var(--text-secondary); border-color: var(--border); }
.btn-outline:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-danger { background: var(--err-bg); color: var(--err); border-color: #fca5a5; }
.btn-danger:hover { background: #fee2e2; }
.btn-ghost { background: none; border: none; color: var(--text-secondary); padding: 6px 10px; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: var(--rsm); }

/* ── APP LAYOUT ──────────────────────────────────────── */
.app-layout { min-height: 100vh; flex-direction: column; }
.topbar {
  height: 64px; background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: background .25s, border-color .25s;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-logo { display: flex; align-items: center; gap: 10px; }
.topbar-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
}
.topbar-logo-icon svg { width: 20px; height: 20px; }
.topbar-logo-text { font-family: 'Sora', sans-serif; font-size: 18px; font-weight: 700; color: var(--navy); }
.topbar-logo-text span { color: var(--teal); }
.school-badge {
  background: var(--teal-light); color: var(--teal-dark);
  font-size: 12px; font-weight: 600; padding: 4px 12px;
  border-radius: 20px; border: 1px solid rgba(46,203,161,.25);
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.menu-toggle { display: none; background: none; border: none; color: var(--text-secondary); padding: 8px; border-radius: var(--rsm); }
@media(max-width:768px) { .menu-toggle { display: flex; align-items: center; } }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 50px; padding: 5px 14px 5px 5px;
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white; flex-shrink: 0;
}
.user-chip-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.role-pill {
  font-size: 10px; font-weight: 700; padding: 3px 8px;
  border-radius: 20px; text-transform: uppercase; letter-spacing: .5px;
}
.role-pill.superadmin { background: linear-gradient(135deg,#7c3aed,#4f46e5); color: white; }
.role-pill.gestor { background: var(--navy); color: white; }
.role-pill.professor { background: linear-gradient(135deg, var(--teal-dark), var(--teal)); color: var(--navy-dark); }
.role-pill.aluno { background: var(--ok-bg); color: var(--ok); }

/* ── SIDEBAR ─────────────────────────────────────────── */
.app-body { display: flex; flex: 1; overflow: hidden; }
.sidebar {
  width: 240px; background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 16px 10px; overflow-y: auto;
  min-height: calc(100vh - 64px); flex-shrink: 0;
  transition: transform .3s, background .25s, border-color .25s;
}
@media(max-width:768px) {
  .sidebar {
    position: fixed; top: 64px; left: 0;
    height: calc(100vh - 64px); z-index: 200;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
}
.nav-group { margin-bottom: 22px; }
.nav-group-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text-muted);
  padding: 0 12px; margin-bottom: 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--rsm);
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  border: none; background: none; width: 100%; text-align: left;
  cursor: pointer; transition: all .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: linear-gradient(135deg, rgba(27,45,107,.1), rgba(46,203,161,.08)); color: var(--navy); }
[data-theme="dark"] .nav-item.active { background: rgba(46,203,161,.12); color: var(--teal); }
.nav-item.active svg { stroke: var(--teal); }
.nav-item-badge {
  margin-left: auto; background: var(--teal); color: var(--navy-dark);
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
}

/* ── MAIN CONTENT ────────────────────────────────────── */
.main-content { flex: 1; padding: 28px; overflow-y: auto; max-height: calc(100vh - 64px); }
@media(max-width:768px) { .main-content { padding: 16px; } }
.page { display: none; }
.page.active { display: block; }
.page-header { margin-bottom: 28px; }
.page-header h2 { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.page-header p { font-size: 14px; color: var(--text-muted); }

/* ── CARDS ───────────────────────────────────────────── */
.card {
  background: var(--bg-card); border-radius: var(--r);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  overflow: hidden; margin-bottom: 20px;
  transition: background .25s, border-color .25s;
}
.card-header {
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.card-header h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.card-body { padding: 0; }
.card-padded { padding: 22px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); border-radius: var(--r);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  padding: 20px; display: flex; align-items: center; gap: 14px;
  transition: background .25s, border-color .25s;
}
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.stat-info h3 { font-size: 24px; font-weight: 700; color: var(--text-primary); }
.stat-info p { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ── TABLE ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--bg-stripe); }
th {
  padding: 11px 18px; text-align: left; font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
td {
  padding: 13px 18px; font-size: 14px; color: var(--text-primary);
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

/* ── BADGES ──────────────────────────────────────────── */
.nota-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; padding: 4px 10px; border-radius: 6px;
  font-size: 14px; font-weight: 700; font-family: 'Sora', sans-serif;
}
.nb-a { background: #DCFCE7; color: #15803D; }
.nb-b { background: #DBEAFE; color: #1D4ED8; }
.nb-c { background: #FEF9C3; color: #854D0E; }
.nb-d { background: #FEE2E2; color: #B91C1C; }
[data-theme="dark"] .nb-a { background: #052e16; color: #4ade80; }
[data-theme="dark"] .nb-b { background: #082035; color: #60a5fa; }
[data-theme="dark"] .nb-c { background: #1c1000; color: #fbbf24; }
[data-theme="dark"] .nb-d { background: #1c0000; color: #f87171; }

.sit-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.sit-aprovado { background: var(--ok-bg); color: var(--ok); }
.sit-reprovado { background: var(--err-bg); color: var(--err); }
.sit-recuperacao { background: var(--warn-bg); color: var(--warn); }
.sit-cursando { background: rgba(27,45,107,.08); color: var(--navy); }
[data-theme="dark"] .sit-cursando { background: rgba(46,203,161,.1); color: var(--teal); }

.tag {
  display: inline-flex; padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.tag-teal { background: var(--teal-light); color: var(--teal-dark); }
.tag-navy { background: rgba(27,45,107,.08); color: var(--navy); }
[data-theme="dark"] .tag-navy { background: rgba(27,45,107,.4); color: #a5b4d8; }

/* ── MODAL ───────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(14,21,37,.55); z-index: 500;
  align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card); border-radius: var(--rlg);
  width: 100%; max-width: 520px; box-shadow: var(--shadow-lg);
  overflow: hidden; transition: background .25s;
}
.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 17px; font-weight: 600; color: var(--text-primary); }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── SEARCH ──────────────────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: var(--rsm); padding: 9px 14px;
  transition: border-color .2s, background .25s;
}
.search-bar:focus-within { border-color: var(--teal); background: var(--bg-card); }
.search-bar svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; }
.search-bar input { background: none; border: none; outline: none; font-size: 14px; color: var(--text-primary); flex: 1; min-width: 0; }
.search-bar input::placeholder { color: var(--text-muted); }
.filter-select {
  padding: 9px 14px; border: 1.5px solid var(--border);
  border-radius: var(--rsm); font-size: 14px;
  color: var(--text-primary); background: var(--bg-input);
  outline: none; cursor: pointer; transition: border-color .2s, background .25s;
}
.filter-select:focus { border-color: var(--teal); background: var(--bg-card); }

/* ── ALERTS ──────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--rsm); font-size: 14px;
  margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; }
.alert-danger { background: var(--err-bg); color: var(--err); border: 1px solid #fca5a5; }
.alert-success { background: var(--ok-bg); color: var(--ok); border: 1px solid #86efac; }
.alert-info { background: var(--info-bg); color: var(--info); border: 1px solid #7dd3fc; }

/* ── EMPTY STATE ─────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 14px; opacity: .25; fill: none; stroke: var(--text-muted); stroke-width: 1.5; }
.empty-state h4 { font-size: 16px; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--text-muted); }

/* ── THEME TOGGLE ────────────────────────────────────── */
.theme-toggle {
  width: 38px; height: 38px; border-radius: var(--rsm); border: 1px solid var(--border);
  background: var(--bg-input); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .2s; color: var(--text-secondary);
}
.theme-toggle:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--teal); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ── LOADER ──────────────────────────────────────────── */
.loader { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
.loader-teal { border-color: rgba(46,203,161,.3); border-top-color: var(--teal); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  position: fixed; inset: 0; background: rgba(14,21,37,.6);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
  backdrop-filter: blur(4px);
}
.loading-box {
  background: var(--bg-card); border-radius: var(--r); padding: 32px 40px;
  text-align: center; box-shadow: var(--shadow-lg);
}
.loading-box .loader { width: 36px; height: 36px; border-width: 3px; margin: 0 auto 14px; display: block; }
.loading-box p { font-size: 15px; color: var(--text-secondary); }

/* ── PROFILE CARD (aluno) ────────────────────────────── */
.profile-hero {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy), var(--navy-mid));
  border-radius: var(--rlg); padding: 28px; color: white;
  margin-bottom: 20px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.profile-avatar-lg {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(46,203,161,.2); border: 3px solid rgba(46,203,161,.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; flex-shrink: 0;
}
.profile-info h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.profile-info p { opacity: .75; font-size: 14px; }
.profile-meta { display: flex; gap: 20px; margin-top: 12px; flex-wrap: wrap; }
.profile-meta-item span:first-child { font-size: 11px; opacity: .65; text-transform: uppercase; letter-spacing: .8px; display: block; }
.profile-meta-item span:last-child { font-size: 15px; font-weight: 600; }

/* ── SUBJECT CARDS ───────────────────────────────────── */
.subject-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.subject-card { background: var(--bg-card); border-radius: var(--r); box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden; transition: background .25s, border-color .25s; }
.subject-card-top {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: white;
}
.subject-card-top h4 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.subject-card-top span { font-size: 12px; opacity: .7; }
.subject-card-body { padding: 16px 20px; }
.nota-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.nota-row:last-child { border-bottom: none; }
.nota-row span { font-size: 13px; color: var(--text-secondary); }
.media-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; background: var(--bg-stripe);
  border-top: 1px solid var(--border);
}
.media-row span:first-child { font-size: 13px; font-weight: 600; color: var(--text-secondary); }

/* ── CALENDAR ────────────────────────────────────────── */
.cal-grid-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; }
@media(max-width:700px) { .cal-grid-layout { grid-template-columns: 1fr; } }
.calendar-grid-7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-header-day { font-size: 10px; font-weight: 700; text-align: center; color: var(--text-muted); padding: 8px 2px; text-transform: uppercase; }
.cal-day {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 13px; cursor: pointer; transition: all .15s;
  position: relative; min-height: 34px;
}
.cal-day:hover { background: var(--bg-hover); }
.cal-day.today { background: var(--teal); color: white; font-weight: 700; }
.cal-day.has-event::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--teal); position: absolute; bottom: 4px; }
.cal-day.today.has-event::after { background: white; }
.cal-day.other-month { color: var(--border); }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.cal-nav h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.cal-nav button { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; cursor: pointer; color: var(--text-secondary); transition: all .15s; }
.cal-nav button:hover { background: var(--teal-light); color: var(--teal-dark); border-color: var(--teal); }
.event-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: var(--rsm); background: var(--bg); border: 1px solid var(--border); margin-bottom: 8px; transition: background .25s; }
.event-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.event-item h5 { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.event-item p { font-size: 12px; color: var(--text-muted); }

/* ── BOLETIM PRINT ───────────────────────────────────── */
.boletim-wrap { max-width: 800px; margin: 0 auto; }
.boletim-card { background: var(--bg-card); border-radius: var(--r); box-shadow: var(--shadow-md); border: 1px solid var(--border); overflow: hidden; }
.boletim-header {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: white; padding: 24px 28px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.boletim-header-left { display: flex; align-items: center; gap: 14px; }
.boletim-logo-box {
  width: 48px; height: 48px; background: rgba(46,203,161,.2);
  border-radius: 12px; border: 2px solid rgba(46,203,161,.4);
  display: flex; align-items: center; justify-content: center;
}
.boletim-escola h2 { font-size: 16px; font-weight: 700; }
.boletim-escola p { font-size: 12px; opacity: .7; }
.boletim-aluno-info { text-align: right; }
.boletim-aluno-info h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.boletim-aluno-info p { font-size: 12px; opacity: .75; }
.boletim-body { padding: 24px 28px; }
.boletim-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.boletim-table th { padding: 10px 14px; background: var(--bg-stripe); font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; border-bottom: 2px solid var(--border); }
.boletim-table td { padding: 12px 14px; font-size: 14px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.boletim-table tr:last-child td { border-bottom: none; }
.boletim-footer { padding: 18px 28px; border-top: 2px solid var(--teal); background: var(--bg-stripe); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.boletim-footer p { font-size: 12px; color: var(--text-muted); }
.print-actions { display: flex; gap: 10px; margin-bottom: 20px; justify-content: flex-end; }

@media print {
  body { background: white !important; }
  .topbar, .sidebar, .print-actions, .theme-toggle, .btn-logout { display: none !important; }
  .main-content { padding: 0 !important; max-height: none !important; }
  .page.active { display: block !important; }
  .boletim-header { background: var(--navy) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .boletim-table th { background: #f0f4ff !important; -webkit-print-color-adjust: exact; }
  .nota-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── OBS CARDS ───────────────────────────────────────── */
.obs-card { background: var(--bg-card); border-radius: var(--r); border: 1px solid var(--border); box-shadow: var(--shadow-sm); padding: 16px 20px; margin-bottom: 10px; transition: background .25s; }
.obs-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.obs-top h5 { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.obs-top span { font-size: 12px; color: var(--text-muted); }
.obs-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ── SUPERADMIN CARDS ────────────────────────────────── */
.escola-card {
  background: var(--bg-card); border-radius: var(--r); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); padding: 20px; display: flex; gap: 16px; align-items: center;
  transition: box-shadow .15s, background .25s, border-color .25s;
}
.escola-card:hover { box-shadow: var(--shadow-md); }
.escola-card-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  display: flex; align-items: center; justify-content: center;
}
.escola-card-icon svg { width: 24px; height: 24px; fill: none; stroke: white; stroke-width: 2; }
.escola-card-info h4 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.escola-card-info p { font-size: 13px; color: var(--text-muted); }
.escola-card-meta { margin-left: auto; text-align: right; flex-shrink: 0; }
.escola-status { display: inline-flex; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-ativo { background: var(--ok-bg); color: var(--ok); }
.status-inativo { background: var(--err-bg); color: var(--err); }

/* ── RESPONSIVE ──────────────────────────────────────── */
@media(max-width:600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .card-header { flex-direction: column; align-items: flex-start; }
  td, th { padding: 10px 12px; }
  .login-card { padding: 32px 24px; }
  .boletim-header { flex-direction: column; }
  .boletim-aluno-info { text-align: left; }
}
