.aluno-login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.aluno-hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-mid) 100%);
  padding: 60px 20px 80px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}
.aluno-hero::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px; border-radius: 50%;
  background: rgba(46,203,161,.07);
  top: -150px; right: -100px;
}
.aluno-hero::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(46,203,161,.05);
  bottom: -100px; left: -80px;
}
.aluno-hero-inner { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; }
.aluno-hero .hero-logo { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 28px; }
.hero-logo-icon {
  width: 56px; height: 56px; background: rgba(46,203,161,.15);
  border-radius: 16px; border: 2px solid rgba(46,203,161,.3);
  display: flex; align-items: center; justify-content: center;
}
.hero-logo-icon svg { width: 30px; height: 30px; fill: none; stroke: var(--teal); stroke-width: 2; }
.hero-logo-text h1 { font-size: 32px; font-weight: 700; color: white; }
.hero-logo-text h1 span { color: var(--teal); }
.hero-logo-text p { font-size: 12px; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: 1.5px; }
.aluno-hero h2 { font-size: 20px; font-weight: 400; opacity: .85; margin-bottom: 8px; }
.aluno-hero p { font-size: 14px; opacity: .65; }

.aluno-login-body {
  flex: 1; display: flex; align-items: flex-start; justify-content: center;
  padding: 0 20px 40px; margin-top: -36px; position: relative; z-index: 1;
}
.aluno-login-card {
  background: var(--bg-card); border-radius: var(--rlg);
  padding: 36px 36px; width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  transition: background .25s, border-color .25s;
}
.aluno-login-card h3 {
  font-size: 18px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 6px; text-align: center;
}
.aluno-login-card .subtitle {
  font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 28px;
}
.cpf-icon-wrap { position: relative; }
.cpf-icon-wrap input { padding-left: 42px; }
.cpf-icon-wrap svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted); fill: none; stroke: currentColor; stroke-width: 2;
}
.btn-aluno-login {
  width: 100%; padding: 14px; background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: var(--navy-dark); border: none; border-radius: var(--rsm);
  font-family: var(--font-sans); font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all .2s; box-shadow: 0 4px 14px rgba(46,203,161,.4);
  margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-aluno-login:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(46,203,161,.5); }
.btn-aluno-login:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.other-login { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.other-login a { color: var(--navy); font-weight: 600; text-decoration: none; }
.other-login a:hover { color: var(--teal); }
.aluno-footer {
  text-align: center; padding: 20px;
  font-size: 12px; color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.theme-toggle-aluno {
  position: fixed; bottom: 20px; right: 20px;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .2s; color: var(--text-secondary); z-index: 100;
}
.theme-toggle-aluno:hover { border-color: var(--teal); color: var(--teal); }
.theme-toggle-aluno svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

/* APP DO ALUNO */
#aluno-app { display: none; flex-direction: column; min-height: 100vh; }
#aluno-app.active { display: flex; }
.student-page-title { display:none; }
.student-back-btn { display:none; }

.student-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 500;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  background: var(--navy);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  font-weight: 700;
  text-align: center;
  transition: opacity .2s ease, transform .2s ease;
}
.student-toast.show { opacity: 1; transform: translateY(0); }
.student-toast.error { background: #3b0b0b; border-color: #ef4444; }
.student-msg-badge {
  min-width:18px;
  height:18px;
  place-items:center;
  border-radius:999px;
  background:var(--err);
  color:#fff;
  font-size:10px;
  font-weight:800;
  line-height:1;
  padding:0 5px;
}
.nav-item .student-msg-badge {
  margin-left:auto;
}
.nav-item.has-unread {
  color:var(--navy);
  background:linear-gradient(135deg, rgba(239,68,68,.1), rgba(46,203,161,.08));
}

#aluno-app .student-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(170px,1fr));
  gap: 14px;
  margin-top: 16px;
}
#aluno-app .student-shortcuts button {
  position: relative;
  min-height: 118px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  padding: 18px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  overflow: hidden;
}
#aluno-app .student-shortcuts button svg {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  fill: none !important;
  stroke: var(--teal-dark);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#aluno-app .student-shortcuts span {
  color: var(--navy);
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
}
#aluno-app .student-shortcuts small {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.3;
}
#aluno-app .student-shortcuts .shortcut-alert {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: #ef4444;
  color: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
#aluno-app .student-shortcuts .student-finance-shortcut.ok {
  border-color: rgba(46,203,161,.35);
  background: linear-gradient(135deg, rgba(46,203,161,.1), var(--bg-card) 58%);
}
#aluno-app .student-shortcuts .student-finance-shortcut.open,
#aluno-app .student-shortcuts .student-finance-shortcut.overdue {
  border-color: rgba(239,68,68,.36);
  background: linear-gradient(135deg, rgba(239,68,68,.1), var(--bg-card) 56%);
}
#aluno-app .student-shortcuts .student-finance-shortcut.open svg,
#aluno-app .student-shortcuts .student-finance-shortcut.overdue svg {
  stroke: #ef4444;
}

.boletim-mobile-list { display: none; }
.chat-thread { min-height:260px; max-height:52vh; overflow-y:auto; border:1px solid var(--border); border-radius:12px; background:var(--bg-stripe); padding:12px; display:flex; flex-direction:column; gap:10px; }
.chat-bubble { max-width:88%; border:1px solid var(--border); border-radius:14px; padding:10px 12px; background:var(--bg-card); color:var(--text-primary); box-shadow:var(--shadow-sm); }
.chat-bubble.mine { align-self:flex-end; background:var(--teal-light); border-color:rgba(46,203,161,.35); }
.chat-bubble.theirs { align-self:flex-start; }
.chat-bubble p { margin:4px 0 0; white-space:pre-wrap; line-height:1.45; }
.chat-meta { color:var(--text-muted); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.35px; }
.student-comunicados-box { margin-bottom:18px; }
.student-comunicados-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.student-comunicados-head h3 {
  margin:0;
  color:var(--text-primary);
  font-size:17px;
}
.student-comunicados-head p {
  margin:4px 0 0;
  color:var(--text-muted);
  font-size:13px;
}
.student-comunicados-head > span {
  min-width:48px;
  min-height:30px;
  border:1px solid var(--border);
  border-radius:999px;
  display:grid;
  place-items:center;
  color:var(--text-secondary);
  font-weight:800;
  font-size:12px;
  background:var(--bg-stripe);
}
.student-comunicados-list { display:grid; gap:10px; }
.student-comunicado-item {
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--bg-stripe);
  padding:13px 14px;
}
.student-comunicado-top {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:7px;
}
.student-comunicado-top strong {
  color:var(--text-primary);
  font-size:15px;
  line-height:1.25;
}
.student-comunicado-top span {
  color:var(--text-muted);
  font-size:12px;
  white-space:nowrap;
}
.student-comunicado-item p {
  margin:0;
  color:var(--text-secondary);
  line-height:1.55;
  font-size:14px;
  white-space:pre-wrap;
}
.student-comunicado-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid var(--border);
}
.student-comunicado-footer span {
  color:var(--text-muted);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
}
.student-comunicados-actions {
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:12px;
  flex-wrap:wrap;
}
.student-observacoes-box h3,
.student-chat-head h3 {
  margin:0;
  color:var(--text-primary);
  font-size:16px;
}
.student-observacoes-box h3 { margin-bottom:14px; }
.student-chat-card { overflow:visible; }
.student-chat-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.student-chat-head p {
  margin:4px 0 0;
  color:var(--text-muted);
  font-size:13px;
}
.student-chat-head > span {
  min-height:28px;
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:4px 10px;
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
}
.student-chat-head > span.open {
  color:var(--teal-dark);
  background:var(--teal-light);
}
.student-chat-head > span.closed {
  color:var(--err);
  background:var(--err-bg);
}
.student-chat-compose {
  margin-top:14px;
  margin-bottom:10px;
}
.student-chat-compose textarea {
  min-height:92px;
  resize:vertical;
}
.student-chat-actions {
  display:flex;
  justify-content:flex-end;
}
.student-chat-actions .btn { min-width:170px; }
.student-finance-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin: 12px 0;
  text-align: left;
  box-shadow: 0 10px 28px rgba(27,45,107,.08);
  cursor: pointer;
}
.student-finance-card.open,
.student-finance-card.overdue {
  border-color: rgba(239,68,68,.34);
  background: linear-gradient(135deg, rgba(239,68,68,.1), var(--bg-card) 48%, rgba(46,203,161,.1));
}
.student-finance-card.ok {
  border-color: rgba(46,203,161,.34);
  background: linear-gradient(135deg, rgba(46,203,161,.12), var(--bg-card) 58%);
}
.student-finance-icon {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--teal-light);
  color: var(--teal-dark);
}
.student-finance-card.overdue .student-finance-icon,
.student-finance-card.open .student-finance-icon {
  background: rgba(239,68,68,.12);
  color: #ef4444;
}
.student-finance-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.student-finance-info,
.student-finance-value {
  min-width: 0;
}
.student-finance-info span,
.student-finance-value span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.student-finance-info strong,
.student-finance-value strong {
  display: block;
  color: var(--text-primary);
  font-family: var(--font-sans);
}
.student-finance-info strong {
  margin-top: 3px;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.student-finance-info small {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}
.student-finance-value {
  text-align: right;
}
.student-finance-value strong {
  font-size: 18px;
}
.student-invoices-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.student-invoices-head h3 {
  margin: 0;
  font-size: 17px;
}
.student-invoices-head p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}
.student-invoices-head > strong {
  font-family: var(--font-sans);
  color: var(--navy);
}
.student-invoice-list {
  display: grid;
  gap: 10px;
}
.student-invoice-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(27,45,107,.06);
}
.student-invoice-card span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.student-invoice-card strong {
  display: block;
  margin-top: 3px;
  color: var(--text-primary);
}
.student-invoice-card small {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
}
.student-invoice-card.vencida {
  border-color: rgba(239,68,68,.32);
  background: rgba(239,68,68,.06);
}
.student-invoice-card.paga {
  border-color: rgba(46,203,161,.32);
  background: rgba(46,203,161,.07);
}

@media(max-width:768px) {
  html { scroll-padding-top: 68px; }
  #aluno-app {
    background: var(--bg);
  }
  #aluno-app .topbar {
    min-height: 56px;
    position: sticky;
    top: 0;
    z-index: 90;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 22px rgba(27,45,107,.07);
  }
  #aluno-app .topbar-logo-icon {
    width: 34px;
    height: 34px;
  }
  #aluno-app .topbar-logo-text {
    display: inline;
    font-size: 17px;
  }
  #aluno-app .student-page-title {
    display:inline-block;
    max-width:42vw;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:var(--text-primary);
    font-family:var(--font-sans);
    font-size:15px;
    font-weight:700;
    line-height:1;
  }
  #aluno-app .main-content {
    padding: 10px 12px 112px;
  }
  #aluno-app .page-header {
    display:none !important;
  }
  #aluno-app .profile-hero {
    display: grid;
    grid-template-columns: 58px minmax(0,1fr);
    align-items: start;
    border-radius: 14px;
    padding: 16px;
    gap: 13px;
    margin-bottom: 12px;
  }
  #aluno-app .profile-avatar-lg {
    width: 58px;
    height: 58px;
    font-size: 18px;
    border-width: 2px;
  }
  #aluno-app .profile-info {
    min-width: 0;
  }
  #aluno-app .profile-info h2 {
    font-size: 19px;
    line-height: 1.18;
    word-break: break-word;
  }
  #aluno-app .profile-info p {
    font-size: 12px;
    line-height: 1.35;
  }
  #aluno-app .profile-meta {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
    width: 100%;
    margin-top: 2px;
  }
  #aluno-app .profile-meta-item {
    min-width: 0;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 10px;
    padding: 9px 10px;
    background: rgba(255,255,255,.08);
  }
  #aluno-app .profile-meta-item span:first-child {
    font-size: 10px;
    letter-spacing: .4px;
  }
  #aluno-app .profile-meta-item span:last-child {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  #aluno-app .stats-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
    margin-bottom: 12px;
  }
  #aluno-app .stat-card {
    min-width: 0;
    padding: 12px;
    border-radius: 12px;
  }
  #aluno-app .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }
  #aluno-app .stat-info h3 {
    font-size: 20px;
    line-height: 1.1;
  }
  #aluno-app .stat-info p {
    font-size: 11px;
    line-height: 1.25;
  }
  #aluno-app .student-shortcuts {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
    margin-top: 10px;
  }
  #aluno-app .student-shortcuts button {
    min-height: 78px;
    border-radius: 12px;
    padding: 12px;
  }
  #aluno-app .student-shortcuts span {
    font-size: 13px;
  }
  #aluno-app .student-shortcuts small {
    font-size: 11px;
  }
  #aluno-app .obs-card,
  #aluno-app .student-comunicado-item {
    border-radius: 12px;
    padding: 13px;
  }
  #aluno-app .obs-top {
    display: grid;
    gap: 4px;
  }
  #aluno-app .obs-top h5 {
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  #aluno-app .chat-thread {
    min-height: 44vh;
    max-height: 54vh;
    border-radius: 12px;
  }
  #aluno-app .chat-bubble {
    max-width: 92%;
    overflow-wrap: anywhere;
  }
  body.aluno-chat-active #aluno-app .app-body {
    height: calc(100dvh - 56px);
    overflow: hidden;
    padding-bottom: 0 !important;
  }
  body.aluno-chat-active #aluno-app .main-content,
  #aluno-app .main-content:has(#page-mensagens.active) {
    padding: 0 !important;
    height: calc(100dvh - 56px);
    min-height: 0 !important;
    max-height: calc(100dvh - 56px);
    overflow: hidden;
  }
  body.aluno-chat-active #aluno-app #page-mensagens.active,
  #aluno-app #page-mensagens.active {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }
  #mensagens-content {
    height: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    overflow: hidden;
  }
  #aluno-app .student-chat-card {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: grid;
    grid-template-rows: auto minmax(0,1fr) auto auto;
    padding: 0 !important;
    overflow: hidden;
    background: var(--bg-card);
  }
  #aluno-app .student-chat-head {
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    align-items: center;
  }
  #aluno-app .student-chat-head h3 {
    font-size: 15px;
  }
  #aluno-app .student-chat-head p {
    display: none;
  }
  #aluno-app .student-chat-head > span {
    flex: 0 0 auto;
    min-height: 24px;
    padding: 3px 9px;
    font-size: 10px;
  }
  #aluno-app .student-chat-card .alert {
    margin: 8px 10px 0 !important;
  }
  #aluno-app #page-mensagens .chat-thread {
    min-height: 0;
    max-height: none;
    height: auto;
    border: 0;
    border-radius: 0;
    background: var(--bg-stripe);
    padding: 12px 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
  }
  #aluno-app #page-mensagens .student-chat-compose {
    margin: 0;
    padding: 6px 10px 6px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
  }
  #aluno-app #page-mensagens .student-chat-compose label {
    display: none;
  }
  #aluno-app #page-mensagens .student-chat-compose textarea {
    min-height: 42px;
    max-height: 76px;
    border-radius: 12px;
    resize: none;
    font-size: 16px;
  }
  #aluno-app #page-mensagens #aluno-chat-err {
    margin: 0 10px 6px;
  }
  #aluno-app #page-mensagens .student-chat-actions {
    padding: 0 10px 10px;
    background: var(--bg-card);
  }
  #aluno-app #page-mensagens .student-chat-actions .btn {
    min-height: 42px;
    width: 100%;
    min-width: 0;
    justify-content: center;
  }
  #aluno-app #page-protocolos .form-row {
    grid-template-columns: 1fr;
  }
  #aluno-app .boletim-page-header .print-actions {
    display: none;
  }
  #aluno-app .boletim-card {
    border-radius: 14px;
    overflow: hidden;
  }
  #aluno-app .boletim-header {
    gap: 14px;
    padding: 18px 16px !important;
  }
  #aluno-app .boletim-header-left {
    width: 100%;
  }
  #aluno-app .boletim-logo-box {
    width: 48px !important;
    height: 48px !important;
  }
  #aluno-app .boletim-escola h2,
  #aluno-app .boletim-aluno-info h3 {
    font-size: 18px !important;
    line-height: 1.25 !important;
  }
  #aluno-app .boletim-aluno-info p {
    font-size: 13px;
  }
  #aluno-app .boletim-body {
    padding: 12px !important;
    overflow: visible !important;
  }
  #aluno-app .boletim-table {
    display: none;
  }
  #aluno-app .boletim-mobile-list {
    display: grid;
    gap: 10px;
  }
  .boletim-mobile-subject {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    padding: 12px;
  }
  .boletim-mobile-subject-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
  }
  .boletim-mobile-subject-head strong {
    display: block;
    color: var(--text-primary);
    font-size: 16px;
  }
  .boletim-mobile-subject-head small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
  }
  .boletim-mobile-grades {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 8px;
  }
  .boletim-mobile-grades div {
    min-height: 54px;
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--bg-stripe);
  }
  .boletim-mobile-grades span:first-child {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }
  .muted-dash { color: var(--text-muted); }
  #aluno-app .boletim-footer {
    display: grid;
    gap: 8px;
    padding: 14px !important;
  }
  #aluno-app .student-frequency-table,
  #aluno-app .student-frequency-table thead,
  #aluno-app .student-frequency-table tbody,
  #aluno-app .student-frequency-table tr,
  #aluno-app .student-frequency-table td {
    display: block;
    min-width: 0;
    width: 100%;
  }
  #aluno-app .student-frequency-table thead {
    display: none;
  }
  #aluno-app .student-frequency-table tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--bg-card);
  }
  #aluno-app .student-frequency-table td {
    border: 0;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  #aluno-app .student-frequency-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
  }
  .student-comunicados-head { align-items:center; }
  .student-comunicado-top { display:grid; gap:3px; }
  .student-comunicado-top span { white-space:normal; }
  .student-comunicado-footer {
    align-items:stretch;
    flex-direction:column;
  }
  .student-comunicado-footer .btn { width:100%; justify-content:center; }
  .student-comunicados-actions .btn { flex:1; justify-content:center; }
  .student-chat-head { align-items:center; }
  .student-chat-head > span { align-self:center; }
  .student-chat-actions .btn {
    width:100%;
    min-width:0;
    justify-content:center;
  }
  .student-mobile-nav {
    display:flex;
    overflow-x:auto;
    gap:6px;
    padding-left:8px;
    padding-right:8px;
    scrollbar-width:none;
  }
  body.aluno-chat-active .student-mobile-nav {
    display:none !important;
  }
  .student-mobile-nav::-webkit-scrollbar { display:none; }
  .student-mobile-nav button {
    position:relative;
    flex:0 0 62px;
    min-height: 54px;
    border-radius: 10px;
  }
  .student-mobile-nav .student-msg-badge {
    position:absolute;
    top:4px;
    right:8px;
  }
}

@media(max-width:380px) {
  #aluno-app .profile-meta,
  #aluno-app .stats-grid,
  #aluno-app .student-shortcuts {
    grid-template-columns: 1fr;
  }
  #aluno-app .topbar-logo-text {
    display: none;
  }
  #aluno-app .student-page-title {
    max-width:52vw;
    font-size:14px;
  }
  .student-mobile-nav span {
    font-size: 9px;
  }
}

@media(max-width:768px) {
  body:has(#aluno-app.active) {
    background:
      radial-gradient(circle at 18% 0, rgba(46,203,161,.16), transparent 30%),
      linear-gradient(180deg, rgba(27,45,107,.08), transparent 220px),
      var(--bg);
  }

  #aluno-app .topbar {
    min-height: 60px;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--bg-card) 94%, transparent);
    backdrop-filter: blur(16px);
  }

  #aluno-app .topbar-left {
    min-width: 0;
    flex: 1 1 auto;
  }

  #aluno-app .student-back-btn {
    width: auto;
    height: 38px;
    flex: 0 0 auto;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 9px 0 7px;
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 8px 18px rgba(27,45,107,.08);
    cursor: pointer;
  }

  #aluno-app .student-back-btn.show {
    display: inline-flex;
  }

  #aluno-app .student-back-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  #aluno-app .student-back-btn span {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
  }

  #aluno-app .topbar-logo {
    min-width: 0;
    gap: 9px;
  }

  #aluno-app .topbar-logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(27,45,107,.18);
  }

  #aluno-app .topbar-logo-text {
    display: none;
  }

  #aluno-app .student-page-title {
    display: block;
    max-width: 40vw;
    font-size: 17px;
    line-height: 1.1;
  }

  #aluno-app .school-badge {
    display: none;
  }

  #aluno-app .topbar-right {
    gap: 6px;
  }

  #aluno-app .topbar-right .theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  #aluno-app .user-chip {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    border: 0;
  }

  #aluno-app .user-chip-name,
  #aluno-app .role-pill {
    display: none;
  }

  #aluno-app .user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 12px;
  }

  #aluno-app .topbar-right .btn-outline {
    min-height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
  }

  #aluno-app .main-content {
    padding: 12px 12px calc(96px + env(safe-area-inset-bottom));
  }

  #aluno-app .card,
  #aluno-app .stat-card,
  #aluno-app .obs-card,
  #aluno-app .student-comunicado-item,
  #aluno-app .boletim-card,
  #aluno-app .boletim-mobile-subject {
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(27,45,107,.06);
  }

  #aluno-app .card-padded {
    padding: 14px;
  }

  #aluno-app .profile-hero {
    grid-template-columns: 62px minmax(0,1fr);
    padding: 16px;
    border-radius: 8px;
    background:
      linear-gradient(135deg, rgba(17,30,74,.96), rgba(27,45,107,.94) 58%, rgba(34,168,130,.92));
    box-shadow: 0 18px 34px rgba(17,30,74,.2);
  }

  #aluno-app .profile-avatar-lg {
    width: 62px;
    height: 62px;
    border-radius: 8px;
  }

  #aluno-app .profile-info h2 {
    font-size: 18px;
    line-height: 1.18;
  }

  #aluno-app .profile-info p {
    margin-top: 3px;
    opacity: .82;
  }

  #aluno-app .profile-meta {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  #aluno-app .profile-meta-item {
    border-radius: 8px;
    padding: 8px 9px;
  }

  #aluno-app .stats-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
  }

  #aluno-app .stat-card {
    align-items: center;
    gap: 10px;
    min-height: 74px;
    padding: 12px;
  }

  #aluno-app .stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  #aluno-app .student-shortcuts {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
    margin-top: 12px;
  }

  #aluno-app .student-shortcuts button {
    position: relative;
    min-height: 112px;
    align-items: flex-start;
    justify-content: flex-start;
    border-radius: 8px;
    padding: 13px;
    background: var(--bg-card);
    box-shadow: 0 8px 24px rgba(27,45,107,.06);
  }

  #aluno-app .student-shortcuts button.has-alert {
    border-color: rgba(239,68,68,.38);
    background:
      linear-gradient(135deg, rgba(239,68,68,.12), rgba(255,255,255,.92) 44%, rgba(46,203,161,.12)),
      var(--bg-card);
    box-shadow: 0 14px 32px rgba(239,68,68,.12);
  }

  #aluno-app .student-shortcuts button.has-alert::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 0 999px 999px 0;
    background: #ef4444;
  }

  #aluno-app .student-shortcuts button.has-alert svg {
    stroke: #ef4444;
  }

  #aluno-app .student-shortcuts .shortcut-alert {
    position: absolute;
    top: 9px;
    right: 9px;
    min-height: 22px;
    align-items: center;
    border-radius: 999px;
    padding: 4px 8px;
    background: #ef4444;
    color: #fff;
    font-style: normal;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(239,68,68,.24);
  }

  #aluno-app .student-shortcuts button svg {
    width: 23px;
    height: 23px;
    margin-bottom: 10px;
    fill: none;
    stroke: var(--teal-dark);
    stroke-width: 2;
  }

  #aluno-app .student-shortcuts span {
    font-size: 15px;
    line-height: 1.1;
  }

  #aluno-app .student-shortcuts small {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.25;
    text-align: left;
  }

  .student-mobile-nav {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: auto;
    height: 64px;
    display: grid;
    grid-template-columns: repeat(5,minmax(0,1fr));
    gap: 4px;
    padding: 6px;
    border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--bg-card) 94%, transparent);
    box-shadow: 0 18px 40px rgba(17,30,74,.18);
    backdrop-filter: blur(18px);
    overflow: visible;
  }

  .student-mobile-nav button:nth-child(4),
  .student-mobile-nav button:nth-child(5),
  .student-mobile-nav button:nth-child(8) {
    display: none;
  }

  .student-mobile-nav button {
    min-width: 0;
    min-height: 50px;
    flex: none;
    border-radius: 8px;
    padding: 5px 3px;
  }

  .student-mobile-nav svg {
    width: 20px;
    height: 20px;
  }

  .student-mobile-nav span {
    font-size: 10px;
    line-height: 1;
  }

  .student-mobile-nav button.active {
    background: linear-gradient(135deg, var(--teal-light), rgba(27,45,107,.08));
    box-shadow: inset 0 0 0 1px rgba(46,203,161,.24);
  }

  body.aluno-chat-active .student-mobile-nav {
    display: none !important;
  }

  .student-toast {
    bottom: calc(86px + env(safe-area-inset-bottom));
    border-radius: 8px;
  }
}

@media(max-width:380px) {
  #aluno-app .student-page-title {
    max-width: 44vw;
    font-size: 16px;
  }

  #aluno-app .student-shortcuts {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  #aluno-app .student-shortcuts button {
    min-height: 104px;
    padding: 12px;
  }
}

@media(max-width:768px) {
  #aluno-app .main-content:has(#page-perfil.active) {
    height: calc(100dvh - 60px);
    max-height: calc(100dvh - 60px);
    overflow: hidden;
    padding: 8px 10px calc(82px + env(safe-area-inset-bottom));
  }

  #aluno-app #page-perfil.active {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0,1fr);
    overflow: hidden;
  }

  #aluno-app #perfil-content {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: auto auto minmax(0,1fr);
    gap: clamp(7px, 1.4dvh, 11px);
    overflow: hidden;
  }

  #aluno-app #page-perfil.active .profile-hero {
    margin: 0;
    padding: clamp(10px, 1.8dvh, 14px);
    gap: clamp(8px, 1.3dvh, 12px);
    grid-template-columns: clamp(44px, 13vw, 58px) minmax(0,1fr);
    align-items: start;
  }

  #aluno-app #page-perfil.active .profile-avatar-lg {
    width: clamp(44px, 13vw, 58px);
    height: clamp(44px, 13vw, 58px);
    font-size: 16px;
  }

  #aluno-app #page-perfil.active .profile-info h2 {
    font-size: clamp(15px, 4.2vw, 18px);
    line-height: 1.12;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #aluno-app #page-perfil.active .profile-info p {
    font-size: clamp(10px, 3vw, 12px);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #aluno-app #page-perfil.active .profile-meta {
    gap: clamp(5px, 1dvh, 8px);
    margin-top: 0;
  }

  #aluno-app #page-perfil.active .profile-meta-item {
    padding: clamp(6px, 1.2dvh, 8px) 8px;
    min-height: 0;
  }

  #aluno-app #page-perfil.active .profile-meta-item span:first-child {
    font-size: 9px;
    letter-spacing: 0;
  }

  #aluno-app #page-perfil.active .profile-meta-item span:last-child {
    margin-top: 2px;
    font-size: clamp(11px, 3.1vw, 13px);
    line-height: 1.12;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #aluno-app #page-perfil.active .student-finance-card {
    min-height: 0;
    margin: 0;
    gap: 10px;
    padding: clamp(9px, 1.6dvh, 12px);
    grid-template-columns: clamp(36px, 10vw, 42px) minmax(0,1fr) auto;
  }

  #aluno-app #page-perfil.active .student-finance-icon {
    width: clamp(36px, 10vw, 42px);
    height: clamp(36px, 10vw, 42px);
  }

  #aluno-app #page-perfil.active .student-finance-icon svg {
    width: 21px;
    height: 21px;
  }

  #aluno-app #page-perfil.active .student-finance-info span,
  #aluno-app #page-perfil.active .student-finance-value span {
    font-size: 10px;
  }

  #aluno-app #page-perfil.active .student-finance-info strong {
    font-size: clamp(13px, 3.8vw, 15px);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #aluno-app #page-perfil.active .student-finance-info small {
    font-size: clamp(10px, 2.8vw, 11px);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #aluno-app #page-perfil.active .student-finance-value strong {
    font-size: clamp(13px, 3.8vw, 15px);
  }

  #aluno-app #page-perfil.active .student-shortcuts {
    min-height: 0;
    height: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    grid-auto-rows: minmax(0,1fr);
    gap: clamp(7px, 1.2dvh, 10px);
  }

  #aluno-app #page-perfil.active .student-shortcuts button {
    min-height: 0;
    height: 100%;
    padding: clamp(8px, 1.4dvh, 11px);
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
  }

  #aluno-app #page-perfil.active .student-shortcuts button svg {
    width: clamp(19px, 5.5vw, 23px);
    height: clamp(19px, 5.5vw, 23px);
    margin-bottom: clamp(5px, .9dvh, 8px);
    flex: 0 0 auto;
  }

  #aluno-app #page-perfil.active .student-shortcuts span {
    font-size: clamp(11px, 3.25vw, 14px);
    line-height: 1.05;
    max-width: 100%;
  }

  #aluno-app #page-perfil.active .student-shortcuts small {
    margin-top: 3px;
    font-size: clamp(9px, 2.6vw, 11px);
    line-height: 1.1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #aluno-app #page-perfil.active .student-shortcuts .shortcut-alert {
    top: 6px;
    right: 6px;
    min-height: 18px;
    padding: 3px 6px;
    font-size: 9px;
    max-width: calc(100% - 12px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .student-mobile-nav {
    height: 58px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    padding: 5px;
  }

  .student-mobile-nav button {
    min-height: 46px;
  }
}

@media(max-width:360px), (max-height:700px) {
  #aluno-app #page-perfil.active .profile-meta {
    grid-template-columns: repeat(4,minmax(0,1fr));
  }

  #aluno-app #page-perfil.active .profile-meta-item {
    padding: 6px;
  }

  #aluno-app #page-perfil.active .profile-meta-item span:first-child {
    font-size: 8px;
  }

  #aluno-app #page-perfil.active .profile-meta-item span:last-child {
    font-size: 10px;
  }

  #aluno-app #page-perfil.active .student-finance-value {
    display: none;
  }

  #aluno-app #page-perfil.active .student-shortcuts small {
    -webkit-line-clamp: 1;
  }
}

@media(max-height:620px) and (max-width:768px) {
  #aluno-app #page-perfil.active .profile-meta-item:nth-child(3) {
    display: none;
  }

  #aluno-app #page-perfil.active .student-shortcuts button svg {
    margin-bottom: 3px;
  }
}

@media(max-width:768px) {
  #aluno-app .main-content:has(#page-perfil.active) {
    height: auto;
    max-height: none;
    min-height: calc(100dvh - 60px);
    overflow-y: auto;
    padding: 14px 16px calc(88px + env(safe-area-inset-bottom));
  }

  #aluno-app #page-perfil.active,
  #aluno-app #perfil-content {
    height: auto;
    min-height: 0;
    display: block;
    overflow: visible;
  }

  #aluno-app #page-perfil.active .profile-hero {
    margin: 6px 0 12px;
    padding: 14px;
    border-radius: 14px;
    grid-template-columns: 56px minmax(0,1fr);
  }

  #aluno-app #page-perfil.active .profile-avatar-lg {
    width: 56px;
    height: 56px;
  }

  #aluno-app #page-perfil.active .profile-info h2 {
    font-size: 18px;
    -webkit-line-clamp: 2;
  }

  #aluno-app #page-perfil.active .profile-meta {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
  }

  #aluno-app #page-perfil.active .profile-meta-item {
    padding: 8px 9px;
  }

  #aluno-app #page-perfil.active .profile-meta-item span:first-child {
    font-size: 10px;
  }

  #aluno-app #page-perfil.active .profile-meta-item span:last-child {
    font-size: 13px;
  }

  #aluno-app #page-perfil.active .student-finance-card {
    margin: 0 0 14px;
    padding: 13px;
    border-radius: 14px;
    grid-template-columns: 42px minmax(0,1fr) auto;
  }

  #aluno-app #page-perfil.active .student-finance-icon {
    width: 42px;
    height: 42px;
  }

  #aluno-app #page-perfil.active .student-finance-value {
    display: block;
  }

  #aluno-app #page-perfil.active .student-shortcuts {
    height: auto;
    min-height: 0;
    grid-template-columns: repeat(2,minmax(0,1fr));
    grid-auto-rows: auto;
    gap: 12px;
    margin: 0;
  }

  #aluno-app #page-perfil.active .student-shortcuts button {
    min-height: 96px;
    height: auto;
    padding: 13px;
    border-radius: 14px;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(27,45,107,.07);
  }

  #aluno-app #page-perfil.active .student-shortcuts button svg {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    margin-bottom: 6px;
  }

  #aluno-app #page-perfil.active .student-shortcuts span {
    font-size: 15px;
    line-height: 1.1;
  }

  #aluno-app #page-perfil.active .student-shortcuts small {
    font-size: 12px;
    line-height: 1.2;
    -webkit-line-clamp: 1;
  }
}

@media(max-width:380px) {
  #aluno-app .main-content:has(#page-perfil.active) {
    padding-left: 14px;
    padding-right: 14px;
  }

  #aluno-app #page-perfil.active .profile-hero {
    padding: 12px;
  }

  #aluno-app #page-perfil.active .student-shortcuts {
    gap: 10px;
  }

  #aluno-app #page-perfil.active .student-shortcuts button {
    min-height: 90px;
    padding: 12px;
  }
}

/* Profile hero polish */
#aluno-app .profile-hero {
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(0,1fr);
  align-items: center;
  gap: 22px;
  padding: 26px 30px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(19,34,86,.98), rgba(35,58,142,.94) 64%, rgba(36,170,135,.9));
  box-shadow: 0 18px 42px rgba(17,30,74,.16);
  overflow: hidden;
}

#aluno-app .profile-hero::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,.12);
  pointer-events: none;
}

#aluno-app .profile-avatar-lg {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 3px solid rgba(46,203,161,.56);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
  font-family: var(--font-sans);
  font-size: 25px;
  font-weight: 800;
}

#aluno-app .profile-info {
  min-width: 0;
}

#aluno-app .profile-info h2 {
  color: #fff;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.12;
  margin: 0;
  letter-spacing: 0;
}

#aluno-app .profile-info p {
  color: rgba(255,255,255,.78);
  margin: 6px 0 16px;
  font-size: 15px;
}

#aluno-app .profile-meta {
  display: grid;
  grid-template-columns: repeat(4,minmax(118px,1fr));
  gap: 10px;
  width: 100%;
}

#aluno-app .profile-meta-item {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  padding: 11px 13px;
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(10px);
}

#aluno-app .profile-meta-item span:first-child {
  display: block;
  color: rgba(255,255,255,.64);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
}

#aluno-app .profile-meta-item span:last-child {
  display: block;
  margin-top: 7px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media(max-width:768px) {
  #aluno-app #page-perfil.active .profile-hero,
  #aluno-app .profile-hero {
    grid-template-columns: 58px minmax(0,1fr);
    align-items: center;
    gap: 13px;
    margin: 6px 0 13px;
    padding: 14px;
    border-radius: 18px;
  }

  #aluno-app #page-perfil.active .profile-avatar-lg,
  #aluno-app .profile-avatar-lg {
    width: 58px;
    height: 58px;
    border-radius: 15px;
    font-size: 18px;
  }

  #aluno-app #page-perfil.active .profile-info h2,
  #aluno-app .profile-info h2 {
    font-size: 21px;
    line-height: 1.1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #aluno-app #page-perfil.active .profile-info p,
  #aluno-app .profile-info p {
    margin: 4px 0 11px;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #aluno-app #page-perfil.active .profile-meta,
  #aluno-app .profile-meta {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
    margin: 0;
  }

  #aluno-app #page-perfil.active .profile-meta-item,
  #aluno-app .profile-meta-item {
    min-height: 62px;
    border-radius: 13px;
    padding: 10px 11px;
  }

  #aluno-app #page-perfil.active .profile-meta-item span:first-child,
  #aluno-app .profile-meta-item span:first-child {
    font-size: 10px;
  }

  #aluno-app #page-perfil.active .profile-meta-item span:last-child,
  #aluno-app .profile-meta-item span:last-child {
    margin-top: 6px;
    font-size: 15px;
  }
}

@media(max-width:380px) {
  #aluno-app #page-perfil.active .profile-hero,
  #aluno-app .profile-hero {
    grid-template-columns: 50px minmax(0,1fr);
    gap: 11px;
    padding: 12px;
  }

  #aluno-app #page-perfil.active .profile-avatar-lg,
  #aluno-app .profile-avatar-lg {
    width: 50px;
    height: 50px;
    border-radius: 13px;
    font-size: 16px;
  }

  #aluno-app #page-perfil.active .profile-info h2,
  #aluno-app .profile-info h2 {
    font-size: 18px;
  }

  #aluno-app #page-perfil.active .profile-meta-item,
  #aluno-app .profile-meta-item {
    min-height: 56px;
    padding: 8px 9px;
  }

  #aluno-app #page-perfil.active .profile-meta-item span:last-child,
  #aluno-app .profile-meta-item span:last-child {
    font-size: 13px;
  }
}

/* Mobile home final cleanup: profile has no empty avatar column and home cards replace bottom nav. */
#aluno-app .profile-hero {
  display: block;
}

#aluno-app .profile-info {
  display: grid;
  grid-template-columns: 76px minmax(0,1fr);
  column-gap: 20px;
  align-items: center;
}

#aluno-app .profile-info .profile-avatar-lg {
  grid-row: 1 / 3;
}

#aluno-app .profile-info .profile-meta {
  grid-column: 1 / -1;
  margin-top: 18px;
}

@media(max-width:768px) {
  #aluno-app .main-content:has(#page-perfil.active) {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  #aluno-app:has(#page-perfil.active) .student-mobile-nav {
    display: none !important;
  }

  #aluno-app #page-perfil.active .profile-hero {
    display: block;
    padding: 14px;
    margin: 6px 0 14px;
    border-radius: 18px;
  }

  #aluno-app #page-perfil.active .profile-info {
    display: grid;
    grid-template-columns: 54px minmax(0,1fr);
    column-gap: 12px;
    align-items: center;
  }

  #aluno-app #page-perfil.active .profile-avatar-lg {
    grid-row: 1 / 3;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    font-size: 17px;
  }

  #aluno-app #page-perfil.active .profile-info h2 {
    grid-column: 2;
    margin: 0;
    font-size: 20px;
    line-height: 1.1;
    -webkit-line-clamp: 2;
  }

  #aluno-app #page-perfil.active .profile-info p {
    grid-column: 2;
    margin: 4px 0 0;
    font-size: 12px;
    opacity: .78;
  }

  #aluno-app #page-perfil.active .profile-meta {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
    margin-top: 13px;
  }

  #aluno-app #page-perfil.active .profile-meta-item {
    min-height: 58px;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,.095);
  }

  #aluno-app #page-perfil.active .profile-meta-item span:first-child {
    font-size: 9px;
  }

  #aluno-app #page-perfil.active .profile-meta-item span:last-child {
    margin-top: 5px;
    font-size: 14px;
  }
}

@media(max-width:380px) {
  #aluno-app #page-perfil.active .profile-info {
    grid-template-columns: 48px minmax(0,1fr);
    column-gap: 10px;
  }

  #aluno-app #page-perfil.active .profile-avatar-lg {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    font-size: 16px;
  }

  #aluno-app #page-perfil.active .profile-info h2 {
    font-size: 18px;
  }

  #aluno-app #page-perfil.active .profile-meta {
    gap: 7px;
  }

  #aluno-app #page-perfil.active .profile-meta-item {
    min-height: 54px;
    padding: 8px 9px;
  }
}

/* Typography polish for the student portal. */
#aluno-login,
#aluno-login *,
#aluno-app,
#aluno-app * {
  font-family: var(--font-sans) !important;
}

.hero-logo-text h1,
.aluno-login-card h3,
#aluno-app .profile-info h2,
#aluno-app .student-shortcuts span,
#aluno-app .student-finance-card strong,
#aluno-app .student-home-card strong,
#aluno-app .page-header h2,
#aluno-app .mobile-page-title,
#aluno-app .chat-contact-name,
#aluno-app .boletim-mobile-subject-head strong {
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

.hero-logo-text p,
#aluno-app .profile-meta-item span:first-child,
#aluno-app .student-shortcuts small,
#aluno-app .student-finance-card small,
#aluno-app .student-home-card small,
#aluno-app .chat-meta,
#aluno-app .boletim-mobile-grades span:first-child,
#aluno-app .student-mobile-nav button {
  font-weight: 600 !important;
  letter-spacing: .01em !important;
}

#aluno-app .profile-meta-item span:last-child,
#aluno-app .student-finance-card strong,
#aluno-app .student-home-card strong,
#aluno-app .student-shortcuts span {
  font-variant-numeric: tabular-nums;
}

/* SaaS school theme for the student portal. */
[data-theme="saas"] .aluno-hero,
[data-theme="saas"] #aluno-app .profile-hero {
  background:
    radial-gradient(circle at 92% 8%, rgba(25,184,154,.34), transparent 26%),
    linear-gradient(135deg,#1857D7 0%,#103C9E 58%,#19B89A 100%);
  box-shadow:0 18px 42px rgba(16,42,86,.14);
}

[data-theme="saas"] .aluno-login-card,
[data-theme="saas"] #aluno-app .student-shortcuts button,
[data-theme="saas"] #aluno-app .student-finance-card,
[data-theme="saas"] #aluno-app .student-home-card,
[data-theme="saas"] #aluno-app .card,
[data-theme="saas"] #aluno-app .boletim-card,
[data-theme="saas"] #aluno-app .chat-list-panel,
[data-theme="saas"] #aluno-app .chat-main-panel {
  background:rgba(255,255,255,.96);
  border-color:rgba(24,87,215,.12);
  box-shadow:0 10px 28px rgba(16,42,86,.06);
}

[data-theme="saas"] #aluno-app .student-shortcuts button.has-alert,
[data-theme="saas"] #aluno-app .nav-item.has-unread {
  background:linear-gradient(135deg,rgba(25,184,154,.16),rgba(234,242,255,.92));
  border-color:rgba(25,184,154,.34);
}

[data-theme="saas"] #aluno-app .student-shortcuts button svg,
[data-theme="saas"] #aluno-app .student-mobile-nav button.active svg,
[data-theme="saas"] #aluno-app .nav-item.active svg {
  stroke:#0E9279;
}

[data-theme="saas"] #aluno-app .student-mobile-nav {
  background:rgba(255,255,255,.94);
  border-color:rgba(24,87,215,.12);
  box-shadow:0 -12px 28px rgba(16,42,86,.08);
  backdrop-filter:blur(14px);
}

[data-theme="saas"] #aluno-app .student-mobile-nav button.active {
  background:#E8F8F4;
  color:#102A56;
}

[data-theme="saas"] .theme-toggle-aluno {
  background:#fff;
  color:#1857D7;
  border-color:#D7E4F5;
}

/* Ajuste final do portal do aluno no celular: tela inicial com cara de app. */
@media(max-width:768px) {
  #aluno-app.active,
  #aluno-app .app-body {
    min-height: 100dvh;
    overflow: hidden;
  }

  #aluno-app .app-body {
    height: calc(100dvh - 58px);
  }

  #aluno-app .main-content {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  #aluno-app .main-content::-webkit-scrollbar,
  #aluno-app .student-mobile-nav::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  #aluno-app .topbar {
    min-height: 58px;
    height: 58px;
    padding: 8px 12px;
    gap: 8px;
  }

  #aluno-app .topbar-logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  #aluno-app .topbar-logo-text strong,
  #aluno-app .mobile-page-title {
    font-size: 18px;
    line-height: 1.1;
  }

  #aluno-app .topbar-logo-text span,
  #aluno-app .topbar-right .user-chip {
    display: none !important;
  }

  #aluno-app .topbar-right {
    gap: 7px;
  }

  #aluno-app .topbar-right .theme-toggle,
  #aluno-app .topbar-right .btn-outline {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    border-radius: 12px;
  }

  #aluno-app .topbar-right .btn-outline {
    font-size: 0;
  }

  #aluno-app .topbar-right .btn-outline::before {
    content: "Sair";
    font-size: 12px;
    font-weight: 700;
  }

  #aluno-app .main-content:has(#page-perfil.active) {
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
    background:
      linear-gradient(180deg, rgba(234,242,255,.78) 0%, rgba(246,249,253,1) 44%, rgba(246,249,253,1) 100%);
  }

  #aluno-app #page-perfil.active {
    min-height: 100%;
  }

  #aluno-app #page-perfil.active #perfil-content {
    min-height: 100%;
    display: grid;
    grid-template-rows: auto 1fr;
    align-content: start;
    gap: 10px;
  }

  #aluno-app #page-perfil.active .profile-hero {
    margin: 0;
    padding: 12px;
    border-radius: 17px;
    box-shadow: 0 14px 30px rgba(16,42,86,.14);
  }

  #aluno-app #page-perfil.active .profile-info {
    grid-template-columns: 50px minmax(0,1fr);
    column-gap: 10px;
  }

  #aluno-app #page-perfil.active .profile-avatar-lg {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    font-size: 16px;
  }

  #aluno-app #page-perfil.active .profile-info h2 {
    font-size: 18px;
    line-height: 1.12;
    -webkit-line-clamp: 1;
  }

  #aluno-app #page-perfil.active .profile-info p {
    margin-top: 3px;
    font-size: 12px;
  }

  #aluno-app #page-perfil.active .profile-meta {
    gap: 7px;
    margin-top: 10px;
  }

  #aluno-app #page-perfil.active .profile-meta-item {
    min-height: 49px;
    padding: 7px 9px;
    border-radius: 11px;
  }

  #aluno-app #page-perfil.active .profile-meta-item span:first-child {
    font-size: 8.5px;
  }

  #aluno-app #page-perfil.active .profile-meta-item span:last-child {
    margin-top: 4px;
    font-size: 13px;
  }

  #aluno-app #page-perfil.active .student-shortcuts {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 9px;
    margin-top: 0;
    align-content: start;
  }

  #aluno-app #page-perfil.active .student-shortcuts button {
    min-height: 92px;
    padding: 12px;
    border-radius: 15px;
    box-shadow: 0 10px 22px rgba(16,42,86,.07);
  }

  #aluno-app #page-perfil.active .student-shortcuts button svg {
    width: 22px;
    height: 22px;
    margin-bottom: 7px;
  }

  #aluno-app #page-perfil.active .student-shortcuts span {
    font-size: 14px;
    line-height: 1.15;
  }

  #aluno-app #page-perfil.active .student-shortcuts small {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.18;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #aluno-app #page-perfil.active .student-shortcuts .shortcut-alert {
    top: 9px;
    right: 9px;
  }
}

@media(max-width:380px) {
  #aluno-app .topbar {
    padding-inline: 10px;
  }

  #aluno-app .main-content:has(#page-perfil.active) {
    padding-inline: 10px;
  }

  #aluno-app #page-perfil.active .profile-info {
    grid-template-columns: 46px minmax(0,1fr);
  }

  #aluno-app #page-perfil.active .profile-avatar-lg {
    width: 46px;
    height: 46px;
  }

  #aluno-app #page-perfil.active .profile-info h2 {
    font-size: 17px;
  }

  #aluno-app #page-perfil.active .profile-meta-item {
    min-height: 46px;
    padding: 7px 8px;
  }

  #aluno-app #page-perfil.active .student-shortcuts button {
    min-height: 84px;
    padding: 10px;
  }
}

/* Rodada de acabamento das paginas internas do aluno no celular. */
@media(max-width:768px) {
  #aluno-app .main-content:not(:has(#page-perfil.active)):not(:has(#page-mensagens.active)) {
    padding: 12px 14px calc(76px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(234,242,255,.72), rgba(246,249,253,1) 190px);
  }

  #aluno-app .page:not(#page-perfil) > .page-header {
    display: none !important;
  }

  #aluno-app .page:not(#page-perfil):not(#page-mensagens).active {
    min-height: 100%;
  }

  #aluno-app .page:not(#page-perfil):not(#page-mensagens) .card,
  #aluno-app .page:not(#page-perfil):not(#page-mensagens) .boletim-card,
  #aluno-app .page:not(#page-perfil):not(#page-mensagens) .student-finance-card,
  #aluno-app .page:not(#page-perfil):not(#page-mensagens) .student-invoice-card,
  #aluno-app .page:not(#page-perfil):not(#page-mensagens) .obs-card,
  #aluno-app .page:not(#page-perfil):not(#page-mensagens) .student-comunicado-item {
    border-radius: 15px;
    border-color: rgba(24,87,215,.12);
    box-shadow: 0 10px 24px rgba(16,42,86,.06);
  }

  #aluno-app #page-financeiro.active #financeiro-content {
    display: grid;
    gap: 10px;
  }

  #aluno-app #page-financeiro.active .student-finance-card {
    min-height: 86px;
    grid-template-columns: 44px minmax(0,1fr) auto;
    gap: 11px;
    padding: 12px;
  }

  #aluno-app #page-financeiro.active .student-finance-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  #aluno-app #page-financeiro.active .student-finance-info strong {
    font-size: 15px;
    line-height: 1.15;
  }

  #aluno-app #page-financeiro.active .student-finance-info small {
    font-size: 12px;
    line-height: 1.2;
  }

  #aluno-app #page-financeiro.active .student-finance-value strong {
    font-size: 15px;
  }

  #aluno-app #page-financeiro.active .student-invoices-head {
    gap: 8px;
    padding: 2px 0 0;
  }

  #aluno-app #page-financeiro.active .student-invoices-head h3 {
    font-size: 15px;
  }

  #aluno-app #page-financeiro.active .student-invoice-list {
    gap: 9px;
  }

  #aluno-app #page-financeiro.active .student-invoice-card {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }

  #aluno-app #page-financeiro.active .student-invoice-card > div:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  #aluno-app #page-boletim.active .boletim-card {
    overflow: hidden;
  }

  #aluno-app #page-boletim.active .boletim-header {
    padding: 13px 14px !important;
    gap: 8px;
    background: linear-gradient(135deg,#1857D7,#103C9E);
  }

  #aluno-app #page-boletim.active .boletim-logo-box {
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px;
  }

  #aluno-app #page-boletim.active .boletim-escola h2,
  #aluno-app #page-boletim.active .boletim-aluno-info h3 {
    font-size: 15px !important;
    line-height: 1.15 !important;
  }

  #aluno-app #page-boletim.active .boletim-aluno-info p,
  #aluno-app #page-boletim.active .boletim-escola p {
    font-size: 11px;
    line-height: 1.2;
  }

  #aluno-app #page-boletim.active .boletim-body {
    padding: 10px !important;
  }

  #aluno-app #page-boletim.active .boletim-mobile-list {
    gap: 9px;
  }

  #aluno-app #page-boletim.active .boletim-mobile-subject {
    padding: 11px;
    border-radius: 13px;
  }

  #aluno-app #page-boletim.active .boletim-mobile-subject-head {
    margin-bottom: 8px;
  }

  #aluno-app #page-boletim.active .boletim-mobile-subject-head strong {
    font-size: 14px;
    line-height: 1.15;
  }

  #aluno-app #page-boletim.active .boletim-mobile-grades {
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 7px;
  }

  #aluno-app #page-boletim.active .boletim-mobile-grades div {
    min-height: 48px;
    border-radius: 10px;
  }

  #aluno-app #page-frequencia.active .stats-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 9px;
  }

  #aluno-app #page-frequencia.active .stat-card {
    min-height: 76px;
    padding: 11px;
    border-radius: 15px;
  }

  #aluno-app #page-frequencia.active .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  #aluno-app #page-frequencia.active .stat-info h3 {
    font-size: 19px;
  }

  #aluno-app #page-obs.active #obs-content,
  #aluno-app #page-protocolos.active #protocolos-content {
    display: grid;
    gap: 10px;
  }

  #aluno-app #page-obs.active .student-comunicados-box,
  #aluno-app #page-obs.active .student-observacoes-box,
  #aluno-app #page-protocolos.active .card {
    padding: 13px !important;
  }

  #aluno-app #page-obs.active .student-comunicados-head h3,
  #aluno-app #page-obs.active .student-observacoes-box h3,
  #aluno-app #page-protocolos.active h3 {
    font-size: 15px !important;
  }

  #aluno-app #page-obs.active .student-comunicado-item,
  #aluno-app #page-protocolos.active .obs-card {
    padding: 12px;
  }

  #aluno-app #page-cal.active .cal-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #aluno-app #page-cal.active .card {
    padding: 12px !important;
  }

  #aluno-app #page-cal.active .cal-nav {
    margin-bottom: 8px;
  }

  #aluno-app #page-cal.active .cal-nav h3 {
    font-size: 15px;
  }

  #aluno-app #page-cal.active .calendar-grid-7 {
    gap: 5px;
  }

  #aluno-app #page-cal.active .cal-day,
  #aluno-app #page-cal.active .cal-header-day {
    min-height: 38px;
    border-radius: 10px;
  }

  body.aluno-chat-active #aluno-app .app-body {
    height: calc(100dvh - 58px);
  }

  body.aluno-chat-active #aluno-app .main-content,
  #aluno-app .main-content:has(#page-mensagens.active) {
    height: calc(100dvh - 58px);
    max-height: calc(100dvh - 58px);
    background: var(--bg-stripe);
  }

  #aluno-app #page-mensagens.active .student-chat-card {
    background: var(--bg-card);
    grid-template-rows: auto minmax(0,1fr) auto auto;
  }

  #aluno-app #page-mensagens.active .student-chat-head {
    min-height: 50px;
    padding: 9px 12px;
    background: linear-gradient(135deg,#1857D7,#103C9E);
    color: #fff;
    border-bottom: 0;
  }

  #aluno-app #page-mensagens.active .student-chat-head h3 {
    color: #fff;
  }

  #aluno-app #page-mensagens.active .student-chat-head > span.open {
    background: rgba(255,255,255,.16);
    color: #fff;
    border-color: rgba(255,255,255,.24);
  }

  #aluno-app #page-mensagens.active .chat-thread {
    padding: 12px 12px 10px;
    background:
      radial-gradient(circle at 20% 0, rgba(25,184,154,.10), transparent 28%),
      var(--bg-stripe);
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  #aluno-app #page-mensagens.active .chat-thread::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  #aluno-app #page-mensagens.active .chat-bubble {
    border-radius: 15px;
    padding: 9px 11px;
    box-shadow: 0 8px 18px rgba(16,42,86,.06);
  }

  #aluno-app #page-mensagens.active .student-chat-compose {
    padding: 8px 10px 6px;
    box-shadow: 0 -10px 20px rgba(16,42,86,.06);
  }

  #aluno-app #page-mensagens.active .student-chat-compose textarea {
    min-height: 44px;
    max-height: 88px;
    padding: 11px 12px;
    border-radius: 14px;
  }

  #aluno-app #page-mensagens.active .student-chat-actions {
    padding: 0 10px calc(10px + env(safe-area-inset-bottom));
  }

  #aluno-app #page-mensagens.active .student-chat-actions .btn {
    min-height: 44px;
    border-radius: 14px;
    font-weight: 800;
  }
}

@media(max-width:380px) {
  #aluno-app .main-content:not(:has(#page-perfil.active)):not(:has(#page-mensagens.active)) {
    padding-left: 12px;
    padding-right: 12px;
  }

  #aluno-app #page-financeiro.active .student-finance-card {
    grid-template-columns: 40px minmax(0,1fr);
  }

  #aluno-app #page-financeiro.active .student-finance-value {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }

  #aluno-app #page-boletim.active .boletim-mobile-grades {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}
