/* ============================================
   GLOBAL STYLES - Estilos compartilhados por todas as páginas
   ============================================ */

/* Local Fonts */
@font-face {
    font-family: 'Poppins';
    src: url('../assets/fonts/poppins-300.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('../assets/fonts/poppins-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('../assets/fonts/poppins-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('../assets/fonts/poppins-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('../assets/fonts/poppins-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Variáveis de Tema - Nature Brand (Verde e Amarelo harmonizados com login) */
:root {
    --bg-main: #e2e8f0; /* Slate 200 - Fundo mais repousante */
    --bg-gradient: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    --card-bg: #f8fafc; /* Slate 50 - Off-white nítido para as seções */
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --text-main: #0f172a; /* Slate 900 */
    --text-muted: #475569; /* Slate 600 */
    --glass-bg: #f8fafc; /* Slate 50 sólido para clareza */
    --glass-border: #cbd5e1; /* Slate 300 para bordas suaves */
    --accent-glow: rgba(22, 163, 74, 0.03); /* Verde 600 Glow */
    --input-bg: #ffffff; 
    --border-color: #94a3b8; /* Slate 400 */
    --sidebar-bg: #cbd5e1;
    --sidebar-text: #1e293b;
    --sidebar-hover: #e2e8f0;
    --sidebar-active-bg: #16a34a; /* Verde 600 - Principal */
    --sidebar-active-text: #ffffff; 
    --scrollbar-thumb: #94a3b8;
}

.dark {
    --bg-main: #0a0c1a;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #080a0f 100%);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --sidebar-bg: rgba(255, 255, 255, 0.01);
    --sidebar-text: rgba(255, 255, 255, 0.6);
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active-bg: rgba(255, 255, 255, 0.1);
    --sidebar-active-text: #818cf8;
    --scrollbar-thumb: rgba(129, 140, 248, 0.2);
    --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --input-bg: rgba(0, 0, 0, 0.2);
    --border-color: rgba(255, 255, 255, 0.1);
}

/* Reset e variáveis globais */
* {
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

body {
    background: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Responsive Sidebar Visibility */
@media (max-width: 1024px) {
    #navigation-container {
        display: none;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 100;
    }
    #navigation-container.show-mobile {
        display: block !important;
    }
    #main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
}

/* Mobile Toggle Visibility */
#mobile-menu-toggle {
    display: none;
}

@media (max-width: 1024px) {
    #mobile-menu-toggle {
        display: flex;
    }
}

body.mobile-mode #mobile-menu-toggle {
    display: none !important;
}

/* Force Mobile Mode (Class Based) */
body.mobile-mode #navigation-container {
    display: none !important;
}

body.mobile-mode #main-content {
    margin-left: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
}

body.mobile-mode #app {
    display: block !important; /* Remove flex which might reserve space */
}

/* Global Hidden Scrollbar */
html,
body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body::-webkit-scrollbar {
    display: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
}

p,
span,
div,
label {
    transition: color 0.3s ease;
}

/* Forçar herança de cor em elementos que comumente usam classes de cor fixa */
.text-main {
    color: var(--text-main);
}

.text-muted {
    color: var(--text-muted);
}

/* Ajuste fino para a transição de tema */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Gradiente de fundo */
.gradient-bg {
    background: var(--bg-gradient);
    background-attachment: fixed;
}

/* Efeito glass */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.05);
}

.dark .glass-effect {
    box-shadow: none;
}

/* NUCLEAR THEME OVERRIDES - Forcing consistency without !important abuse where possible */
:root:not(.dark) body {
    background: var(--bg-gradient) !important;
    color: var(--text-main) !important;
}

:root:not(.dark) .glass-effect,
:root:not(.dark) .sidebar-item:hover,
:root:not(.dark) .card,
:root:not(.dark) .modal-content {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--card-shadow) !important;
}

/* Force dark text on common "white text" classes */
:root:not(.dark) :is(.text-white, .text-slate-100, .text-indigo-100, .text-indigo-200, .text-slate-300, .nav-label, .logo-text) {
    color: var(--text-main) !important;
}

:root:not(.dark) :is(.text-indigo-300, .text-slate-400, .text-white\/60, .text-indigo-200\/60, .text-indigo-300\/60, [class*="text-indigo-300"], [class*="text-indigo-200"]) {
    color: var(--text-muted) !important;
    opacity: 1 !important;
}

/* Force total opacity on background icons in light mode system-wide */
:root:not(.dark) :is(.absolute.opacity-10, .absolute.opacity-20, .absolute.opacity-25, .absolute.opacity-30, .absolute.opacity-50) {
    opacity: 1 !important;
}

/* Reduce size of big numbers in stat cards for a more refined look */
:root:not(.dark) :is(.text-3xl, .text-4xl, .text-5xl, .text-6xl).font-black {
    font-size: 1.5rem !important; /* text-2xl equivalent */
    line-height: 2rem !important;
    letter-spacing: -0.025em !important;
}

:root:not(.dark) .tab-button.active {
    background: #16a34a !important;
    color: #ffffff !important;
    box-shadow: 0 8px 20px -5px rgba(22, 163, 74, 0.4) !important;
}

/* Ensure Interactive Elements stay Visible in Light Mode */
:root:not(.dark) :is(#sidebar-collapse-btn, #mobile-menu-toggle) {
    background-color: #4f46e5 !important; /* Indigo 600 */
    color: #ffffff !important;
}

:root:not(.dark) :is(#sidebar-collapse-btn, #mobile-menu-toggle) i {
    color: #ffffff !important;
}

/* Force white backgrounds on secretaria dynamic cards in light mode */
:root:not(.dark) :is(.bg-slate-900\/20, .bg-slate-900\/40, .bg-slate-900\/50) {
    background-color: #ffffff !important;
}

/* Force white backgrounds on dynamic table containers */
:root:not(.dark) #sec-student-profile-view [class*="bg-slate-900"] {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
}

/* Fix text colors in secretaria profile for light mode */
:root:not(.dark) #sec-student-profile-view :is(
    .text-white,
    .text-indigo-300\/40,
    [class*="text-white"],
    [class*="text-white\/"]
) {
    color: #1e293b !important;
}

/* Fix specific financial view cards */
:root:not(.dark) #sec-student-profile-view [class*="rounded-2xl"][class*="bg-white\/\[0\.02\]"] {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

:root:not(.dark) #sec-student-profile-view [class*="bg-white\/5"] {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}

/* Fix financial plan cards with dark: prefix text */
:root:not(.dark) #sec-student-profile-view [class*="dark:text-white"] {
    color: #1e293b !important;
}

:root:not(.dark) #sec-student-profile-view [class*="dark:text-white\/"] {
    color: #1e293b !important;
}

/* Fix the search input in secretaria */
:root:not(.dark) #sec-student-search {
    background-color: #ffffff !important;
    color: #1e293b !important;
}



/* NUCLEAR OVERRIDE: Neutralizing residual dark backgrounds and gradients in light mode */
:root:not(.dark) :is(
    .bg-slate-900, .bg-slate-800, .bg-gray-900, .bg-gray-800,
    [class*="bg-[#1e1b4b]"], [class*="bg-[#0f172a]"], [class*="bg-[#1a1c2e]"],
    .glass-effect, .sec-profile-main-card, [class*="bg-gradient-"]
) {
    background-color: #ffffff !important;
    background-image: none !important;
    color: #1e293b !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Specific Fix for Student Profile Header */
:root:not(.dark) #sec-student-profile-view :is(.bg-gradient-to-br, header, .sec-profile-main-card > div:first-child) {
    background-color: #ffffff !important;
    background-image: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

/* Ensure all text in the profile is dark and visible */
:root:not(.dark) #sec-student-profile-view :is(h2, h3, h4, p, span, label, i, .text-white, .text-indigo-300, .text-indigo-400, .text-slate-300, .text-white\/60) {
    color: #1e293b !important;
    opacity: 1 !important;
}

/* High Opacity for Cards and Elements in Light Mode */
:root:not(.dark) :is(.bg-white\/5, .bg-white\/10, .bg-slate-800\/50, .bg-indigo-500\/5) {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
}

/* Monthly Fee Cards - Specific Light Mode Contrast */
:root:not(.dark) .monthly-fee-card {
    background-color: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
}

/* Specific vibrant colors for Financial Summary Cards in Light Mode */
:root:not(.dark) .bg-indigo-500\/10 { background-color: #eef2ff !important; border-color: #c7d2fe !important; }
:root:not(.dark) .bg-emerald-500\/10 { background-color: #ecfdf5 !important; border-color: #a7f3d0 !important; }
:root:not(.dark) .bg-rose-500\/10 { background-color: #fff1f2 !important; border-color: #fecdd3 !important; }

/* Ensure icons inside summary cards keep their color */
:root:not(.dark) .bg-indigo-500\/10 i { color: #4338ca !important; }
:root:not(.dark) .bg-emerald-500\/10 i { color: #047857 !important; }
:root:not(.dark) .bg-rose-500\/10 i { color: #be123c !important; }

/* BUTTONS & INTERACTIVE */
:root:not(.dark) :is(button, .btn, [role="button"]) {
    opacity: 1 !important;
}

/* Primary Buttons - Restore Original Palette */
:root:not(.dark) :is(button, .btn, [role="button"]).bg-indigo-600 { background-color: #4f46e5 !important; color: #ffffff !important; }
:root:not(.dark) :is(button, .btn, [role="button"]).bg-emerald-600 { background-color: #10b981 !important; color: #ffffff !important; }
:root:not(.dark) :is(button, .btn, [role="button"]).bg-sky-500 { background-color: #0ea5e9 !important; color: #ffffff !important; }
:root:not(.dark) :is(button, .btn, [role="button"]).bg-indigo-500 { background-color: #6366f1 !important; color: #ffffff !important; }

/* Restore icons color in primary buttons */
:root:not(.dark) :is(button, .btn, [role="button"]):is(.bg-indigo-600, .bg-emerald-600, .bg-sky-500, .bg-indigo-500) i {
    color: #ffffff !important;
}

/* Secondary/Glass Buttons */
:root:not(.dark) :is(button, .btn, [role="button"]):is(.bg-white\/5, .bg-white\/10, .bg-indigo-500\/10) {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}

/* Keep white text for buttons with colored backgrounds */
:root:not(.dark) :is(button, .btn).bg-indigo-600 :is(i, span, .text-white) {
    color: #ffffff !important;
}

/* Input & Select & Textarea */
:root:not(.dark) :is(input, select, textarea) {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1.5px solid #cbd5e1 !important;
    opacity: 1 !important;
}

/* Explicit Academic Year Selector Fix */
:root:not(.dark) #sec-student-profile-view select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%234338ca' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 0.75rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.5em 1.5em !important;
    padding-right: 2.5rem !important;
}

/* Gradient overrides: Blue/Indigo to Green ONLY for buttons/interactive elements */
:root:not(.dark) :is(button, .btn, [role="button"]):is(.bg-gradient-to-r, .bg-gradient-to-br, .bg-gradient-to-tr) {
    --tw-gradient-from: #16a34a !important;
    --tw-gradient-to: #15803d !important;
    background-image: linear-gradient(to right, var(--tw-gradient-from), var(--tw-gradient-to)) !important;
    color: #ffffff !important;
}

:root:not(.dark) .nav-section-title {
    color: #475569 !important;
    opacity: 1 !important;
}

:root:not(.dark) .nav-label,
:root:not(.dark) .logo-text {
    color: #0f172a !important;
}

:root:not(.dark) .sidebar-item:hover {
    background: #f1f5f9 !important;
    color: #4f46e5 !important;
}

:root:not(.dark) .active-nav {
    background: #16a34a !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3) !important;
}

:root:not(.dark) .active-nav i,
:root:not(.dark) .active-nav span {
    color: #ffffff !important;
}

:root:not(.dark) .sidebar-item i {
    color: #64748b;
}

:root:not(.dark) .sidebar-item:hover i {
    color: #4f46e5;
}

:root:not(.dark) .bg-white\/5,
:root:not(.dark) .bg-slate-800\/50,
:root:not(.dark) .bg-slate-900\/50,
:root:not(.dark) .bg-indigo-500\/5 {
    background: rgba(15, 23, 42, 0.04) !important;
    border: 1.5px solid rgba(15, 23, 42, 0.15) !important;
}

:root:not(.dark) .divide-white\/5 > * + *,
:root:not(.dark) .border-white\/10,
:root:not(.dark) .border-slate-200 {
    border-color: #cbd5e1 !important;
}

:root:not(.dark) .form-label,
:root:not(.dark) label {
    color: #0f172a !important;
    font-weight: 700 !important;
}

:root:not(.dark) .stat-card i,
:root:not(.dark) .card i,
:root:not(.dark) .sidebar-item i {
    color: #4f46e5 !important;
    opacity: 1 !important;
    filter: drop-shadow(0 2px 4px rgba(79, 70, 229, 0.2));
}

:root:not(.dark) .text-indigo-400,
:root:not(.dark) .text-indigo-500,
:root:not(.dark) .text-indigo-600 { color: #4338ca !important; }

:root:not(.dark) .text-emerald-400,
:root:not(.dark) .text-emerald-500,
:root:not(.dark) .text-emerald-600 { color: #059669 !important; }

:root:not(.dark) .text-blue-400,
:root:not(.dark) .text-blue-500,
:root:not(.dark) .text-blue-600 { color: #1d4ed8 !important; }

:root:not(.dark) .text-orange-400,
:root:not(.dark) .text-orange-500,
:root:not(.dark) .text-orange-600 { color: #c2410c !important; }

:root:not(.dark) .text-rose-400,
:root:not(.dark) .text-rose-500,
:root:not(.dark) .text-rose-600 { color: #be123c !important; }

/* NUCLEAR DARK MODE VISIBILITY - Force all text to be light in dark mode */
.dark .text-black,
.dark .text-slate-900,
.dark .text-slate-800,
.dark .text-slate-700,
.dark .text-slate-600,
.dark .text-slate-500,
.dark .text-gray-900,
.dark .text-gray-800,
.dark .text-gray-700,
.dark .text-gray-600,
.dark .text-gray-500,
.dark .text-zinc-900,
.dark .text-zinc-800,
.dark .text-zinc-700,
.dark .text-zinc-600,
.dark .text-zinc-500,
.dark .text-neutral-900,
.dark .text-neutral-800,
.dark .text-neutral-700,
.dark .text-neutral-600,
.dark .text-neutral-500,
.dark .text-stone-900,
.dark .text-stone-800,
.dark .text-stone-700,
.dark .text-stone-600,
.dark .text-stone-500,
.dark .text-indigo-900,
.dark .text-indigo-800,
.dark .text-indigo-950,
.dark .text-blue-900,
.dark .text-blue-800,
.dark .text-blue-950 {
    color: #ffffff !important;
}

/* Improve readable muted text in dark mode */
.dark .text-slate-400,
.dark .text-indigo-300,
.dark .text-indigo-200 {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Fix bg-white conflict in dark mode for glass cards */
.dark .bg-white {
    background-color: var(--glass-bg) !important;
}

/* Fix dropdown options in dark mode - texto branco em fundo escuro */
.dark select option {
    background-color: #1e1b4b !important;
    color: #e0e7ff !important;
}
.dark select option:hover,
.dark select option:checked {
    background-color: #4338ca !important;
}
.dark select,
.dark input,
.dark textarea {
    color-scheme: dark;
}

:root:not(.dark) .text-white\/10,
:root:not(.dark) .text-white\/20,
:root:not(.dark) .text-white\/30,
:root:not(.dark) .text-white\/40,
:root:not(.dark) .text-white\/50,
:root:not(.dark) .text-indigo-300,
:root:not(.dark) .text-indigo-300\/30,
:root:not(.dark) .text-indigo-300\/40,
:root:not(.dark) .text-indigo-400\/50 {
    color: var(--text-muted) !important;
    opacity: 1 !important;
}

/* Melhorar textos acinzentados do Tailwind no modo claro */
:root:not(.dark) .text-gray-500, 
:root:not(.dark) .text-gray-400,
:root:not(.dark) .text-slate-500,
:root:not(.dark) .text-slate-400 {
    color: var(--text-muted) !important;
}

:root:not(.dark) .text-gray-600,
:root:not(.dark) .text-slate-600 {
    color: #475569 !important; /* Um cinza um pouco mais escuro e legível */
}

:root:not(.dark) .bg-gray-50,
:root:not(.dark) .bg-slate-50 {
    background-color: #f8faff !important;
}

:root:not(.dark) .bg-gray-100,
:root:not(.dark) .bg-slate-100 {
    background-color: #f1f5ff !important; /* Tom azulado suave */
}

/* Sombras Premium com toque Índigo */
:root:not(.dark) .shadow-sm { box-shadow: 0 1px 2px 0 rgba(99, 102, 241, 0.05) !important; }
:root:not(.dark) .shadow, :root:not(.dark) .shadow-md { box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.07), 0 2px 4px -2px rgba(99, 102, 241, 0.05) !important; }
:root:not(.dark) .shadow-lg { box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.08), 0 4px 6px -4px rgba(99, 102, 241, 0.05) !important; }
:root:not(.dark) .card, :root:not(.dark) .glass-effect {
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.1), 0 4px 6px -4px rgba(99, 102, 241, 0.05) !important;
    background-color: #ffffff !important;
}

/* Stat Cards com Cores Visíveis no Tema Claro */
:root:not(.dark) .stat-card {
    background: #ffffff !important;
    border: 1px solid rgba(99, 102, 241, 0.1) !important;
    border-left: 5px solid #6366f1 !important;
}

:root:not(.dark) .stat-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
}

:root:not(.dark) .stat-card:nth-child(1) { border-left: 4px solid #4f46e5 !important; background: #ffffff !important; }
:root:not(.dark) .stat-card:nth-child(2) { border-left: 4px solid #10b981 !important; background: #ffffff !important; }
:root:not(.dark) .stat-card:nth-child(3) { border-left: 4px solid #3b82f6 !important; background: #ffffff !important; }
:root:not(.dark) .stat-card:nth-child(4) { border-left: 4px solid #f59e0b !important; background: #ffffff !important; }

/* Variantes de Cards Coloridos Visíveis */
:root:not(.dark) .card-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
    color: #ffffff !important;
}
:root:not(.dark) .card-primary * { color: #ffffff !important; }

:root:not(.dark) .card-success {
    background: linear-gradient(135deg, #10b981 0%, #065f46 100%) !important;
    color: #ffffff !important;
}
:root:not(.dark) .card-success * { color: #ffffff !important; }

:root:not(.dark) .card-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%) !important;
    color: #ffffff !important;
}
:root:not(.dark) .card-warning * { color: #ffffff !important; }

:root:not(.dark) .card-danger {
    background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%) !important;
    color: #ffffff !important;
}
:root:not(.dark) .card-danger * { color: #ffffff !important; }

:root:not(.dark) .bg-white\/5 {
    background-color: rgba(99, 102, 241, 0.03) !important;
}

:root:not(.dark) .bg-white\/10 {
    background-color: rgba(99, 102, 241, 0.06) !important;
}

:root:not(.dark) .border-white\/5 {
    border-color: rgba(99, 102, 241, 0.05) !important;
}

:root:not(.dark) .border-white\/10 {
    border-color: rgba(99, 102, 241, 0.08) !important;
}

:root:not(.dark) .hover\:bg-white\/10:hover {
    background-color: rgba(99, 102, 241, 0.04) !important;
}

:root:not(.dark) .divide-white\/5>*+* {
    border-color: rgba(99, 102, 241, 0.05) !important;
}

/* Exceções críticas para manter botões e badges legíveis */
:root:not(.dark) :is(.bg-indigo-600, .bg-indigo-500, .bg-emerald-600, .bg-red-500, .bg-purple-600, .bg-gradient-to-br, .status-badge) :is(.text-white, .text-indigo-100, i) {
    color: #ffffff !important;
}

/* Estilo para botões de ação em tabelas que funcionam em ambos os temas */
.action-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-muted);
}

.action-btn i {
    font-size: 16px;
    color: inherit;
}

.action-btn:hover {
    background-color: #6366f1 !important;
    border-color: #6366f1 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

:root:not(.dark) .action-btn {
    color: #475569 !important;
    background-color: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
}

:root:not(.dark) .action-btn:hover {
    background-color: #4f46e5 !important;
    color: #ffffff !important;
}

:root:not(.dark) .bg-indigo-500\/10,
:root:not(.dark) .bg-indigo-600\/10 {
    background-color: rgba(79, 70, 229, 0.15) !important;
    color: #4338ca !important;
}

:root:not(.dark) .bg-green-500\/10,
:root:not(.dark) .bg-emerald-600\/10 {
    background-color: rgba(5, 150, 105, 0.15) !important;
    color: #059669 !important;
}

:root:not(.dark) .bg-red-500\/10,
:root:not(.dark) .bg-red-600\/10 {
    background-color: rgba(185, 28, 28, 0.15) !important;
    color: #b91c1c !important;
}

:root:not(.dark) .bg-orange-500\/10,
:root:not(.dark) .bg-orange-600\/10 {
    background-color: rgba(194, 65, 12, 0.15) !important;
    color: #c2410c !important;
}

/* Ajuste adicional para o Diário de Caixa e Tabelas */
:root:not(.dark) .divide-y.divide-white\/5 {
    border-color: rgba(99, 102, 241, 0.05);
}

/* Overrides para Inputs e Selects em modo claro */
:root:not(.dark) select,
:root:not(.dark) input:not([type="checkbox"]):not([type="radio"]),
:root:not(.dark) textarea {
    color: var(--text-main) !important;
    background-color: #ffffff !important;
    border-color: var(--glass-border) !important;
}

:root:not(.dark) select option {
    background-color: #ffffff;
    color: var(--text-main);
}

/* Forçar visibilidade total em Tabelas, Modais e Formulários */
:root:not(.dark) .modal-overlay,
:root:not(.dark) [id*="modal-backdrop"],
:root:not(.dark) .fixed.inset-0.bg-black\/50 {
    background-color: rgba(15, 23, 42, 0.6) !important; /* Overlay mais escuro para destaque */
    backdrop-filter: blur(8px) !important;
}

:root:not(.dark) .modal-content, 
:root:not(.dark) .modal-content-full,
:root:not(.dark) .bg-white {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

/* Dark Mode Modal Visibility Fix */
.dark .modal-content,
.dark .modal-content-full {
    background-color: #0f172a !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

:root:not(.dark) .table-header-cell {
    color: #1e293b !important;
    font-weight: 800 !important;
    background-color: #f8fafc !important;
}

:root:not(.dark) .form-label,
:root:not(.dark) label {
    color: #1e293b !important;
    font-weight: 600 !important;
}

:root:not(.dark) .text-gray-800,
:root:not(.dark) .text-slate-800,
:root:not(.dark) .text-gray-700,
:root:not(.dark) .text-slate-700 {
    color: #0f172a !important;
}

/* NUCLEAR SIDEBAR FIX */
:root:not(.dark) .sidebar-item span {
    color: #334155 !important;
    font-weight: 600 !important;
    opacity: 1 !important;
}

:root:not(.dark) .sidebar-item:hover i,
:root:not(.dark) .sidebar-item.active-nav i {
    color: var(--sidebar-active-text) !important;
}

/* Ajuste para ícones que podem ficar invisíveis */
:root:not(.dark) .fas,
:root:not(.dark) .far,
:root:not(.dark) .fab {
    opacity: 1 !important;
}

:root:not(.dark) i.text-white:not(button i, .bg-indigo-600 i, .bg-emerald-600 i, .bg-blue-600 i, .bg-red-500 i) {
    color: var(--text-main) !important;
}

:root:not(.dark) .text-white\/5,
:root:not(.dark) .text-white\/10 {
    color: var(--text-muted) !important;
    opacity: 0.15 !important;
}

/* Menu Lateral - Ícones e Textos */
.sidebar-item i {
    font-size: 1.1rem;
    width: 2rem;
    display: flex;
    justify-content: center;
    transition: all 0.3s ease;
}

:root:not(.dark) .sidebar-item {
    color: #1e293b !important; /* Slate 800 */
}

:root:not(.dark) .sidebar-item i {
    color: #020617 !important; /* Slate 950 para visibilidade total */
}

:root:not(.dark) .sidebar-item {
    border: 1.5px solid #94a3b8 !important; /* Borda Slate 400 visível */
    margin-bottom: 6px !important;
    transition: all 0.3s ease;
}

:root:not(.dark) .sidebar-item.active-nav {
    background: #16a34a !important;
    color: #ffffff !important;
    border-color: #15803d !important;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3) !important;
}

:root:not(.dark) .sidebar-item.active-nav i {
    color: #4338ca !important;
}

:root:not(.dark) .sidebar-item:hover {
    background: #f1f5f9;
    color: #16a34a;
    border-color: #16a34a !important;
}

.dark .sidebar-item {
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 4px;
}

.dark .sidebar-item.active-nav {
    border-color: rgba(129, 140, 248, 0.5);
}

/* Sidebar Collapsed State */
.sidebar-collapsed #navigation-container>div {
    width: 5rem !important;
    /* w-20 */
}

.sidebar-collapsed #main-content {
    margin-left: 5rem !important;
}

.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-section-title {
    display: none !important;
}

.sidebar-collapsed .sidebar-item {
    justify-content: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.sidebar-collapsed .sidebar-item span {
    display: none;
}

.sidebar-collapsed .logo-text {
    display: none;
}

.sidebar-collapsed .user-info {
    display: none;
}

.sidebar-collapsed .sidebar-item i {
    font-size: 1.25rem;
}

.sidebar-collapsed #collapse-icon {
    transform: rotate(180deg);
}

/* Cards de estatísticas */
.stat-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stat-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Scrollbar customizada */
::-webkit-scrollbar {
    width: 6px;
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.4);
}

/* Animações */
.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form controls (Standard CSS instead of @apply) */
.form-input {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Tabs padronizadas */
.tab-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 4px;
    display: inline-flex;
    gap: 4px;
}

.tab-button {
    padding: 0.5rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-button.active {
    background: var(--sidebar-active-bg) !important;
    color: var(--text-main) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.tab-button:not(.active):hover {
    background: var(--sidebar-hover);
    color: var(--text-main);
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-pending {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Premium Form Controls */
.form-input-premium {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input-premium:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.dark .form-input-premium:focus {
    background: rgba(255, 255, 255, 0.05);
}

.form-select-premium {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236366f1'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.form-select-premium:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.dark .form-select-premium {
    background-color: rgba(30, 27, 75, 0.4);
}

.dark .form-input-premium {
    background-color: rgba(30, 27, 75, 0.4);
}

/* Scrollbar customizada */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6366f1;
}

/* Sidebar Elements Theme-Aware */
.nav-section-title {
    color: var(--text-muted);
}

.user-info p {
    color: var(--text-main);
}

.user-info p:last-child {
    color: var(--text-muted);
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-scale-up {
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Utilidade para ocultar scrollbar mas manter o scroll */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Role-based restrictions - Hides action elements for read-only roles */
body.role-diretor .can-create,
body.role-diretor .can-update,
body.role-diretor .can-delete,
body.role-diretor [data-action="create"],
body.role-diretor [data-action="add"],
body.role-diretor [data-action="edit"],
body.role-diretor [data-action="delete"],
body.role-diretor [onclick*="openAdd"],
body.role-diretor [onclick*="delete"],
body.role-diretor [onclick*="apagar"],
body.role-diretor [onclick*="eliminar"],
body.role-diretor [id*="btn-new"],
body.role-diretor [id*="btn-add"],
body.role-diretor [id*="add-btn"] {
    display: none !important;
}

/* Ensure specific containers that only contain creation buttons are also hidden if empty */
body.role-diretor .creation-container:empty {
    display: none !important;
}

/* ============================================================
   MOBILE PORTALS — LIGHT / DARK THEME SUPPORT
   Applies to: #student-portal-dashboard, #teacher-mobile-dashboard, #parent-portal-dashboard
   ============================================================ */

/* ── CSS variables scoped to portals ─────────────────────────── */
:root {
    --portal-bg:          #f0f4f8;
    --portal-card-bg:     #ffffff;
    --portal-card-border: #e2e8f0;
    --portal-header-bg:   rgba(255, 255, 255, 0.85);
    --portal-header-border: #e2e8f0;
    --portal-nav-bg:      rgba(255, 255, 255, 0.95);
    --portal-nav-border:  #e2e8f0;
    --portal-text:        #0f172a;
    --portal-text-muted:  #64748b;
    --portal-text-sub:    #94a3b8;
    --portal-input-bg:    #f8fafc;
    --portal-stat-bg:     #ffffff;
}

.dark {
    --portal-bg:          #020817;
    --portal-card-bg:     rgba(255,255,255,0.03);
    --portal-card-border: rgba(255,255,255,0.07);
    --portal-header-bg:   rgba(2, 8, 23, 0.75);
    --portal-header-border: rgba(255,255,255,0.05);
    --portal-nav-bg:      #0f172a;
    --portal-nav-border:  rgba(255,255,255,0.05);
    --portal-text:        #f1f5f9;
    --portal-text-muted:  rgba(255,255,255,0.6);
    --portal-text-sub:    rgba(255,255,255,0.35);
    --portal-input-bg:    rgba(255,255,255,0.05);
    --portal-stat-bg:     rgba(255,255,255,0.04);
}

/* ── Portal Root Wrappers ────────────────────────────────────── */
#student-portal-dashboard,
#teacher-mobile-dashboard,
#parent-portal-dashboard {
    background: var(--portal-bg) !important;
    color: var(--portal-text) !important;
    transition: background 0.35s ease, color 0.35s ease;
}

/* ── Portal Header ───────────────────────────────────────────── */
#student-portal-dashboard header,
#teacher-mobile-dashboard header,
#parent-portal-dashboard header {
    background: var(--portal-header-bg) !important;
    border-bottom-color: var(--portal-header-border) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

/* ── All Text Inside Portals ─────────────────────────────────── */
#student-portal-dashboard h1,
#student-portal-dashboard h2,
#student-portal-dashboard h3,
#student-portal-dashboard h4,
#teacher-mobile-dashboard h1,
#teacher-mobile-dashboard h2,
#teacher-mobile-dashboard h3,
#teacher-mobile-dashboard h4,
#parent-portal-dashboard h1,
#parent-portal-dashboard h2,
#parent-portal-dashboard h3,
#parent-portal-dashboard h4 {
    color: var(--portal-text) !important;
}

/* Force text colors on white/dark text inside portals */
:root:not(.dark) #student-portal-dashboard :is(.text-white, .text-slate-100, .text-indigo-100),
:root:not(.dark) #teacher-mobile-dashboard :is(.text-white, .text-slate-100, .text-indigo-100),
:root:not(.dark) #parent-portal-dashboard  :is(.text-white, .text-slate-100, .text-indigo-100) {
    color: var(--portal-text) !important;
}

:root:not(.dark) #student-portal-dashboard :is(.text-slate-400, .text-slate-500, .text-slate-600),
:root:not(.dark) #teacher-mobile-dashboard :is(.text-slate-400, .text-slate-500, .text-slate-600),
:root:not(.dark) #parent-portal-dashboard  :is(.text-slate-400, .text-slate-500, .text-slate-600) {
    color: var(--portal-text-muted) !important;
}

/* ── Portal stat cards / content backgrounds ─────────────────── */
:root:not(.dark) #student-portal-dashboard :is([class*="bg-slate-900"], [class*="bg-slate-800"], [class*="bg-white\/5"], [class*="bg-white\/10"]),
:root:not(.dark) #teacher-mobile-dashboard :is([class*="bg-slate-900"], [class*="bg-slate-800"], [class*="bg-white\/5"], [class*="bg-white\/10"]),
:root:not(.dark) #parent-portal-dashboard  :is([class*="bg-slate-900"], [class*="bg-slate-800"], [class*="bg-white\/5"], [class*="bg-white\/10"]) {
    background-color: var(--portal-card-bg) !important;
    border-color: var(--portal-card-border) !important;
}

/* ── Portal Bottom Navigation Bar ───────────────────────────── */
#student-portal-dashboard nav,
#teacher-mobile-dashboard nav,
#parent-portal-dashboard  nav {
    background: var(--portal-nav-bg) !important;
    border-top-color: var(--portal-nav-border) !important;
}

:root:not(.dark) #student-portal-dashboard nav,
:root:not(.dark) #teacher-mobile-dashboard nav,
:root:not(.dark) #parent-portal-dashboard  nav {
    box-shadow: 0 -4px 24px rgba(0,0,0,0.08) !important;
}

/* ── Portal Nav button text (muted state) ────────────────────── */
:root:not(.dark) #student-portal-dashboard nav span,
:root:not(.dark) #teacher-mobile-dashboard nav span,
:root:not(.dark) #parent-portal-dashboard  nav span {
    color: var(--portal-text-muted) !important;
}

/* ── Portal Inputs / Selects / Textareas ─────────────────────── */
:root:not(.dark) #student-portal-dashboard :is(input, select, textarea),
:root:not(.dark) #teacher-mobile-dashboard :is(input, select, textarea),
:root:not(.dark) #parent-portal-dashboard  :is(input, select, textarea) {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

/* ── Portal Day selector buttons (horário tabs) ──────────────── */
:root:not(.dark) #student-portal-dashboard .day-opt:not(.bg-indigo-600),
:root:not(.dark) #teacher-mobile-dashboard .day-opt:not(.bg-indigo-600) {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
}

/* ── Portal grade-type tabs ──────────────────────────────────── */
:root:not(.dark) #teacher-mobile-dashboard .flex.bg-slate-900 {
    background-color: #f1f5f9 !important;
}

/* ── Portal doc-type cards ────────────────────────────────────── */
:root:not(.dark) #student-portal-dashboard .doc-type-card,
:root:not(.dark) #parent-portal-dashboard .doc-type-card {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

/* ── Preserve vibrant accent colors (don't override colored text) ── */
:root:not(.dark) #student-portal-dashboard .text-indigo-400 { color: #4338ca !important; }
:root:not(.dark) #student-portal-dashboard .text-emerald-400 { color: #059669 !important; }
:root:not(.dark) #student-portal-dashboard .text-rose-400 { color: #be123c !important; }
:root:not(.dark) #student-portal-dashboard .text-amber-400 { color: #b45309 !important; }
:root:not(.dark) #student-portal-dashboard .text-purple-400 { color: #7c3aed !important; }
:root:not(.dark) #student-portal-dashboard .text-blue-400 { color: #1d4ed8 !important; }

:root:not(.dark) #teacher-mobile-dashboard .text-emerald-400 { color: #059669 !important; }
:root:not(.dark) #teacher-mobile-dashboard .text-indigo-400 { color: #4338ca !important; }
:root:not(.dark) #teacher-mobile-dashboard .text-rose-400 { color: #be123c !important; }
:root:not(.dark) #teacher-mobile-dashboard .text-amber-400 { color: #b45309 !important; }

:root:not(.dark) #parent-portal-dashboard .text-indigo-400 { color: #4338ca !important; }
:root:not(.dark) #parent-portal-dashboard .text-emerald-400 { color: #059669 !important; }
:root:not(.dark) #parent-portal-dashboard .text-rose-400 { color: #be123c !important; }
:root:not(.dark) #parent-portal-dashboard .text-amber-400 { color: #b45309 !important; }
:root:not(.dark) #parent-portal-dashboard .text-purple-400 { color: #7c3aed !important; }
:root:not(.dark) #parent-portal-dashboard .text-blue-400 { color: #1d4ed8 !important; }

/* Preserve white text in colored action buttons inside portals */
:root:not(.dark) #student-portal-dashboard button:is(.bg-indigo-600, .bg-emerald-600, .bg-rose-500) :is(i, span),
:root:not(.dark) #teacher-mobile-dashboard button:is(.bg-indigo-600, .bg-emerald-600, .bg-rose-500) :is(i, span),
:root:not(.dark) #parent-portal-dashboard  button:is(.bg-indigo-600, .bg-emerald-600, .bg-rose-500) :is(i, span) {
    color: #ffffff !important;
}

/* ── Portal Theme Toggle Button ──────────────────────────────── */
.portal-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.875rem;
    border: 1px solid var(--portal-card-border);
    background: var(--portal-card-bg);
    color: var(--portal-text-muted);
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.portal-theme-toggle:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
    color: #6366f1;
    transform: scale(1.05);
}

.portal-theme-toggle:active {
    transform: scale(0.92);
}

/* Icon swap based on theme */
.portal-theme-toggle .icon-light { display: none; }
.portal-theme-toggle .icon-dark  { display: inline; }

:root:not(.dark) .portal-theme-toggle .icon-light { display: inline; }
:root:not(.dark) .portal-theme-toggle .icon-dark  { display: none; }