/**
 * Identidade visual - Instituto Politécnico Nº 2039 '30 de Setembro'
 * Design 2026: limpo, responsivo, espaçamento consistente.
 */
/* Tipografia local (sem Google Fonts) — funciona offline com WAMP */

/* Modo escuro - variáveis quando .dark em html (estilo Facebook: todo o conteúdo) */
.dark {
  --ip-background: #0F172A;
  --ip-surface: #1E293B;
  --ip-secondary: #F8FAFC;
  --ip-border: #334155;
  --ip-muted: #94A3B8;
  --ip-muted-accessible: #CBD5E1;
  --ip-text: #F1F5F9;
  --ip-text-secondary: #CBD5E1;
}

:root {
  --ip-text: #0F172A;
  --ip-text-secondary: #475569;
  --ip-primary: #B91C1C;
  --ip-primary-hover: #991B1B;
  --ip-primary-light: rgba(185, 28, 28, 0.08);
  --ip-secondary: #0F172A;
  --ip-background: #F8FAFC;
  --ip-surface: #FFFFFF;
  --ip-accent: #1D4ED8;
  --ip-accent-light: #DBEAFE;
  --ip-muted: #64748B;
  --ip-muted-accessible: #475569;
  --ip-border: #E2E8F0;
  --ip-success: #16A34A;
  --ip-error: #DC2626;
  --ip-radius: 0.75rem;
  --ip-radius-lg: 1rem;
  --ip-radius-xl: 1.25rem;
  --ip-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --ip-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 16px -4px rgba(0, 0, 0, 0.06);
  --ip-shadow-hover: 0 10px 28px -6px rgba(185, 28, 28, 0.1), 0 6px 16px rgba(0, 0, 0, 0.04);
  --ip-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --ip-sidebar-width: 280px;
}

/* Antes: visibility:hidden deixava o menu invisível se o JS falhasse. O filtro de papéis continua em applySidebarMarkup. */
#sidebar-menu.sidebar-pending > li {
  visibility: visible;
}

html { background-color: #F8FAFC; }
html.dark { background-color: #0F172A; }
html.dark {
  scrollbar-color: #475569 #0F172A;
}
html.dark * {
  scrollbar-color: #475569 #0F172A;
}
html.dark *::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
html.dark *::-webkit-scrollbar-track {
  background: #0F172A;
}
html.dark *::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 9999px;
  border: 2px solid #0F172A;
}
html.dark *::-webkit-scrollbar-thumb:hover {
  background: #64748B;
}
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #F1F5F9;
  color: var(--ip-text);
}
body.app-layout:not(.ip30-auth-ready) {
  visibility: hidden;
}
.dark body,
html.dark body,
body.dark {
  background: #0F172A !important;
  color: #F1F5F9;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
.dark .app-main,
.dark main,
html.dark .app-main,
html.dark main {
  background: #0F172A !important;
  color: #F1F5F9;
}
.dark .app-main-wrap,
html.dark .app-main-wrap {
  background: #0F172A !important;
}
.dark h1, .dark h2, .dark h3 {
  color: #F1F5F9;
}
.dark p, .dark span:not(.ip30-badge) {
  color: inherit;
}
.dark .text-slate-800,
.dark .text-slate-900 {
  color: #F1F5F9 !important;
}
.dark .text-slate-500,
.dark .text-slate-600 {
  color: #94A3B8 !important;
}
.dark .text-slate-700 {
  color: #CBD5E1 !important;
}
.dark .text-slate-400 {
  color: #94A3B8 !important;
}

/* Fallbacks para páginas antigas que ainda usam apenas classes Tailwind claras. */
.dark .bg-white {
  background-color: #1E293B !important;
}
.dark .bg-slate-50,
.dark .bg-slate-100 {
  background-color: #334155 !important;
}
.dark .border-slate-100,
.dark .border-slate-200,
.dark .border-slate-300 {
  border-color: #334155 !important;
}
.dark .hover\:bg-slate-50:hover,
.dark .hover\:bg-slate-100:hover {
  background-color: #334155 !important;
}
.dark .hover\:text-slate-600:hover,
.dark .hover\:text-slate-700:hover {
  color: #E2E8F0 !important;
}

/* Acessibilidade: label apenas para leitores de ecrã */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========== TIPOGRAFIA ========== */
.section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ip-secondary);
  letter-spacing: -0.01em;
}
.dark .section-title {
  color: #F1F5F9;
}
.header-subtitle {
  font-size: 0.75rem;
  color: var(--ip-muted-accessible);
}
@media (min-width: 640px) {
  .header-subtitle { font-size: 0.8125rem; }
}
.label-uppercase {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ip-muted-accessible);
}

/* ========== LAYOUT ========== */
/* Layout flex: permite crescer para acomodar menu sem barra de rolagem interna */
.app-layout {
  display: flex;
  min-height: 100vh;
  height: 100vh;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: hidden;
}

.app-sidebar {
  width: var(--ip-sidebar-width);
  min-width: var(--ip-sidebar-width);
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 20;
    overflow-y: auto;
  }
  .app-main-wrap {
    margin-left: var(--ip-sidebar-width);
    max-height: 100vh;
  }
}

.app-main-wrap {
  flex: 1 1 0%;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-main {
  flex: 1 1 0%;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  padding: 1rem;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
.app-main-inner {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
}

/* Áreas com scroll interno (ex: caixa de mensagens, listas) */
.scroll-area {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.scroll-area::-webkit-scrollbar {
  width: 8px;
}
.scroll-area::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 4px;
}
.scroll-area::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
.scroll-area::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}
.dark .scroll-area::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}
.dark .scroll-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}
.dark .scroll-area::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
@media (min-width: 640px) {
  .app-main { padding: 1.5rem 2rem; }
}
@media (min-width: 1024px) {
  .app-main { padding: 2rem 2.5rem; }
}

/* ========== SIDEBAR ========== */
#sidebar {
  width: var(--ip-sidebar-width);
  min-width: var(--ip-sidebar-width);
  flex-shrink: 0;
  border-right: 1px solid var(--ip-border);
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
}
.dark #sidebar {
  background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
  border-right-color: #334155;
}
@media (min-width: 768px) {
  #sidebar {
    box-shadow: 2px 0 24px -4px rgba(0,0,0,0.06);
  }
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color var(--ip-transition), color var(--ip-transition), transform var(--ip-transition);
}
.sidebar-link i[data-lucide] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.sidebar-link:hover {
  background-color: var(--ip-primary-light);
  color: var(--ip-primary);
  transform: translateX(2px);
}
.sidebar-link.bg-red-50 {
  background: linear-gradient(90deg, rgba(185,28,28,0.12) 0%, rgba(185,28,28,0.06) 100%) !important;
  color: var(--ip-primary);
  font-weight: 600;
  border-left: 3px solid var(--ip-primary);
  padding-left: calc(0.75rem - 3px);
}

#sidebar .sidebar-brand-sep {
  border-top: 1px solid var(--ip-border);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}
#sidebar nav + button,
#sidebar .sidebar-logout-wrap {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.logo-ip {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 50%;
}
@media (min-width: 1024px) {
  .logo-ip { width: 52px; height: 52px; }
}
.logo-ip-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ip-primary);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 1024px) {
  .logo-ip-fallback { width: 52px; height: 52px; }
}

/* ========== HEADER ========== */
.glass-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ip-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.dark .glass-header {
  background: rgba(30, 41, 59, 0.95);
  border-bottom-color: #334155;
}
.user-info-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.875rem;
  background: #F8FAFC;
  border: 1px solid var(--ip-border);
  border-radius: 9999px;
  font-size: 0.8125rem;
  color: var(--ip-muted-accessible);
  font-weight: 500;
}
.dark .user-info-chip {
  background: #1E293B;
  border-color: #334155;
  color: #CBD5E1;
}

.glass-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

/* ========== LINKS ========== */
a.text-primary:hover,
a[href].text-primary:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ========== FORMULÁRIOS ========== */
.input-ip {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--ip-border);
  border-radius: var(--ip-radius-xl);
  transition: border-color var(--ip-transition), box-shadow var(--ip-transition);
  min-height: 42px;
  background: #fff;
  color: var(--ip-text);
}
.dark .input-ip,
.dark input:not([type="checkbox"]):not([type="radio"]),
.dark textarea,
.dark select {
  background: #1E293B;
  border-color: #334155;
  color: #F1F5F9;
}
.dark .input-ip::placeholder,
.dark input::placeholder,
.dark textarea::placeholder {
  color: #64748B;
}
.input-ip:focus {
  outline: none;
  border-color: var(--ip-primary);
  box-shadow: 0 0 0 3px var(--ip-primary-light);
}
.label-ip {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ip-muted-accessible);
  margin-bottom: 0.25rem;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--ip-primary);
  box-shadow: 0 0 0 3px var(--ip-primary-light);
}

/* ========== CARDS ========== */
.card-list-item {
  border: 1px solid rgba(226, 232, 240, 0.9);
  transition: transform var(--ip-transition), box-shadow var(--ip-transition), border-color var(--ip-transition);
}
.card-list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -8px rgba(185, 28, 28, 0.12);
  border-color: rgba(185, 28, 28, 0.15);
}

.dashboard-card {
  background: var(--ip-surface);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--ip-radius-xl);
  box-shadow: var(--ip-shadow-card);
  transition: box-shadow var(--ip-transition), border-color var(--ip-transition), transform var(--ip-transition);
}
.dark .dashboard-card {
  background: #1E293B;
  border-color: #334155;
  color: #F1F5F9;
}
.dashboard-card:hover {
  box-shadow: var(--ip-shadow-hover);
  border-color: rgba(185, 28, 28, 0.1);
}

.kpi-card {
  background: linear-gradient(145deg, #fff 0%, #fafafa 100%);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--ip-radius-xl);
  box-shadow: var(--ip-shadow-card);
  border-left: 3px solid var(--ip-primary);
  padding-left: calc(1.25rem - 3px);
}
.dark .kpi-card {
  background: linear-gradient(145deg, #1E293B 0%, #0F172A 100%);
  border-color: #334155;
  color: #F1F5F9;
}
.dark .kpi-card .label-uppercase,
.dark .kpi-card .text-slate-500 {
  color: #94A3B8 !important;
}
.kpi-card .kpi-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--ip-radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-chart {
  background: linear-gradient(145deg, #fff 0%, #fcfcfc 100%);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: var(--ip-radius-xl);
  box-shadow: var(--ip-shadow-card);
}
.dark .section-chart {
  background: linear-gradient(145deg, #1E293B 0%, #0F172A 100%);
  border-color: #334155;
  color: #F1F5F9;
}

.card-ip {
  border: 1px solid rgba(226, 232, 240, 0.9);
  transition: transform var(--ip-transition), box-shadow var(--ip-transition), border-color var(--ip-transition);
}
.dark .card-ip {
  background: #1E293B;
  border-color: #334155;
  color: #F1F5F9;
}
.card-ip:hover {
  transform: translateY(-2px);
  box-shadow: var(--ip-shadow-hover);
  border-color: rgba(185, 28, 28, 0.12);
}

/* Menu colapsável "Dados do educando" - encarregado */
.encarregado-submenu.expanded {
  max-height: 450px !important;
  overflow-y: auto !important;
}
.encarregado-chevron.expanded {
  transform: rotate(180deg);
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 180px;
}
@media (min-width: 768px) {
  .chart-wrap { height: 200px; }
}
@media (min-width: 1024px) {
  .chart-wrap { height: 220px; }
}
.chart-wrap canvas {
  max-height: 100% !important;
}

/* ========== BOTÕES ========== */
.btn-ip {
  transition: transform var(--ip-transition), box-shadow var(--ip-transition);
}
.btn-ip:hover {
  transform: translateY(-2px);
  box-shadow: var(--ip-shadow-hover);
}
.btn-ip:active {
  transform: translateY(0) scale(0.98);
}

/* ========== PAGINAÇÃO ========== */
.pagination-pill {
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid var(--ip-border);
  background: var(--ip-surface);
  color: var(--ip-muted-accessible);
  transition: background var(--ip-transition), border-color var(--ip-transition), color var(--ip-transition);
}
.pagination-pill:hover {
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(185, 28, 28, 0.2);
  color: var(--ip-primary);
}
.pagination-pill.active {
  background: var(--ip-primary);
  border-color: var(--ip-primary);
  color: white;
}

/* ========== ESTADO VAZIO ========== */
.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: rgba(248, 250, 252, 0.8);
  border: 1px dashed var(--ip-border);
  border-radius: var(--ip-radius-xl);
}
.dark .empty-state {
  background: rgba(30, 41, 59, 0.8);
  border-color: #334155;
  color: #CBD5E1;
}
.empty-state .empty-state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  color: var(--ip-muted);
}
.empty-state .empty-state-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ip-muted-accessible);
  margin-bottom: 0.25rem;
}
.empty-state .empty-state-text {
  font-size: 0.8125rem;
  color: var(--ip-muted);
}

/* ========== SKELETON (shimmer) ========== */
@keyframes ip30-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--ip-border) 0%, #e2e8f0 20%, #f1f5f9 50%, #e2e8f0 80%, var(--ip-border) 100%);
  background-size: 200% 100%;
  animation: ip30-skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--ip-radius);
}
.dark .skeleton,
html.dark .skeleton {
  background: linear-gradient(90deg, #334155 0%, #475569 20%, #64748b 50%, #475569 80%, #334155 100%) !important;
  background-size: 200% 100%;
  animation: ip30-skeleton-shimmer 1.5s ease-in-out infinite;
}
.skeleton-text { height: 0.875rem; }
.skeleton-title { height: 1.25rem; width: 60%; }
.skeleton-card { height: 8rem; border-radius: var(--ip-radius-xl); }

/* ========== SIDEBAR NAV - expandir em vez de scroll interno ========== */
#sidebar nav {
  overflow-y: visible;
  flex: 1 1 auto;
  min-height: 0;
}
#sidebar nav ul li a.sidebar-link {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}
#sidebar nav ul.space-y-1 > li + li { margin-top: 0.125rem; }

/* ========== SCROLLBAR SIDEBAR ========== */
#sidebar nav {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.dark #sidebar nav {
  scrollbar-color: #475569 transparent;
}
#sidebar nav::-webkit-scrollbar {
  width: 6px;
}
#sidebar nav::-webkit-scrollbar-track {
  background: transparent;
}
#sidebar nav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
#sidebar nav::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ========== TOAST GLOBAL ========== */
#ip30-toast {
  border-radius: var(--ip-radius-xl);
  box-shadow: 0 10px 40px -10px rgba(0,0,0,0.15);
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* ========== LOGIN / AUTH ========== */
.auth-page {
  min-height: 100vh;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.auth-card {
  background: var(--ip-surface);
  border: 1px solid var(--ip-border);
  border-radius: 1.25rem;
  box-shadow: var(--ip-shadow-card);
  padding: 1.5rem;
}
.dark .auth-card {
  background: #1E293B;
  border-color: #334155;
  color: #F1F5F9;
}
@media (min-width: 640px) {
  .auth-card { padding: 2rem; }
}
.auth-card .auth-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.12);
}
.btn-auth {
  transition: transform var(--ip-transition), box-shadow var(--ip-transition), background-color var(--ip-transition);
}
.btn-auth:hover {
  background-color: var(--ip-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.2);
}
.btn-auth:active {
  transform: translateY(0) scale(0.98);
}

/* ========== UTILITÁRIOS ========== */
body .flex-1.min-w-0 {
  min-width: 0;
  flex: 1 1 0%;
  width: 100%;
  max-width: 100%;
}
main.layout-wide,
main.layout-full {
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

/* Dashboard — último item do feed totalmente acessível ao scroll (flex + padding inferior) */
.ip30-dashboard-feed-scroll {
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: 2rem;
  padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
}

a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--ip-primary);
  outline-offset: 2px;
}

.dark a:focus-visible,
.dark button:focus-visible,
.dark input:focus-visible,
.dark [tabindex]:focus-visible {
  outline-color: #f87171;
  outline-offset: 3px;
}

/* ========== ANIMAÇÕES ========== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.4s ease-out forwards; }
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }

/* Menu colapsável "Dados do Aluno" para encarregado */
.encarregado-submenu.expanded { max-height: 120px !important; }
.encarregado-chevron.expanded { transform: rotate(180deg); }
#encarregado-aluno-menu .sidebar-link { font-size: 0.8125rem; }

/* ========== RESPONSIVO ========== */
@media (max-width: 767px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 40;
    width: 280px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    box-shadow: 8px 0 32px rgba(0,0,0,0.12);
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
    pointer-events: none;
  }
  #sidebar.open {
    transform: translateX(0);
    pointer-events: auto;
  }
}
@media (max-width: 639px) {
  .app-main { padding: 1rem; }
}

/* Modal de perfil - janela flutuante com transições suaves */
#ip30-profile-modal-wrap {
  transition: opacity 0.2s ease-out;
}
#ip30-profile-modal-wrap .ip30-profile-modal-box {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
#ip30-profile-modal-wrap .ip30-profile-modal-box.scale-95 {
  transform: scale(0.95);
}
#ip30-profile-modal-wrap .ip30-profile-modal-box:not(.scale-95) {
  transform: scale(1);
}
@media (max-width: 480px) {
  #ip30-profile-modal-wrap { padding: 0.5rem; }
  #ip30-profile-modal-wrap .ip30-profile-modal-box { max-width: 100%; }
}

/* Modal "Dados do educando" - janela flutuante grande para encarregado */
#ip30-aluno-panel-wrap {
  transition: opacity 0.2s ease-out;
}
#ip30-aluno-panel-wrap .ip30-aluno-modal-box {
  width: 100%;
  max-width: min(1400px, 95vw);
  height: min(900px, 90vh);
  max-height: 90vh;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
#ip30-aluno-panel-wrap .ip30-aluno-modal-box.scale-95 {
  transform: scale(0.95);
}
#ip30-aluno-panel-wrap .ip30-aluno-modal-box:not(.scale-95) {
  transform: scale(1);
}
@media (max-width: 768px) {
  #ip30-aluno-panel-wrap { padding: 0.5rem; }
  #ip30-aluno-panel-wrap .ip30-aluno-modal-box {
    max-width: 100%;
    height: 85vh;
  }
}

/* Modo embed: página sem sidebar nem header - só conteúdo (para modal do encarregado) */
html.ip30-embed-mode body,
body.ip30-embed-mode {
  padding: 0;
  margin: 0;
}
.ip30-embed-mode #sidebar-overlay,
.ip30-embed-mode #sidebar,
.ip30-embed-mode .app-main-wrap > header,
.ip30-embed-mode .glass-header {
  display: none !important;
}
.ip30-embed-mode .app-main-wrap {
  flex: 1;
  min-width: 0;
  padding: 0;
  margin: 0;
}
.ip30-embed-mode .app-main,
.ip30-embed-mode main {
  padding: 1rem;
  min-height: 100%;
}

/* Acessibilidade: foco visível (teclado) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 2px solid var(--ip-primary);
  outline-offset: 2px;
}
.dark a:focus-visible,
.dark button:focus-visible,
.dark input:focus-visible,
.dark select:focus-visible,
.dark textarea:focus-visible,
html.dark a:focus-visible,
html.dark button:focus-visible {
  outline-color: #f87171;
}

/* ========== MENSAGENS — RESPOSTA/CITAÇÃO DESTACADA ========== */
.msg-bubble > .border-l-2 {
  display: block;
  margin: 0 0 0.55rem 0 !important;
  padding: 0.5rem 0.65rem !important;
  border-left-width: 4px !important;
  border-left-style: solid !important;
  border-left-color: #B91C1C !important;
  border-radius: 0.55rem;
  background: #FFFFFF !important;
  color: #334155 !important;
  opacity: 1 !important;
  line-height: 1.35;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
  overflow: hidden;
}

.msg-bubble > .border-l-2::before {
  content: "Mensagem respondida";
  display: block;
  margin-bottom: 0.25rem;
  color: #B91C1C;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.msg-bubble > .border-l-2 > .font-medium {
  display: inline-block;
  margin-bottom: 0.12rem;
  color: #0F172A !important;
  font-weight: 700 !important;
}

.msg-bubble.bg-primary > .border-l-2,
.msg-bubble.bg-red-700 > .border-l-2,
.msg-bubble.bg-red-600 > .border-l-2 {
  background: rgba(255, 255, 255, 0.96) !important;
  color: #475569 !important;
  border-left-color: #FCA5A5 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.msg-bubble.bg-primary > .border-l-2::before,
.msg-bubble.bg-red-700 > .border-l-2::before,
.msg-bubble.bg-red-600 > .border-l-2::before {
  color: #991B1B !important;
}

.msg-bubble > .border-l-2 + div {
  margin-top: 0.2rem;
}

.dark .msg-bubble > .border-l-2,
html.dark .msg-bubble > .border-l-2 {
  background: #0F172A !important;
  color: #CBD5E1 !important;
  border-left-color: #F87171 !important;
  box-shadow: inset 0 0 0 1px #334155;
}

.dark .msg-bubble > .border-l-2::before,
html.dark .msg-bubble > .border-l-2::before {
  color: #FCA5A5 !important;
}

.dark .msg-bubble > .border-l-2 > .font-medium,
html.dark .msg-bubble > .border-l-2 > .font-medium {
  color: #F8FAFC !important;
}

