@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* --- Cores UECE & Identidade --- */
    --primary-color: #26b030;   /* UECE Green */
    --secondary-color: #0277bd; /* Accent Blue */
    --bg-color: #fafbfe;        /* Background Geral */
    --surface-color: #ffffff;   /* Cards e Tabelas */
    --text-primary: #1e293b;    /* Slate 800 */
    --text-secondary: #64748b;  /* Slate 500 */
    --alert-bg: #fef3c7;        /* Amarelo-âmbar claro */
    --alert-text: #78350f;      /* Marrom-escuro */
    --border-radius: 8px;

    /* --- Mapeamento para Compatibilidade --- */
    --primary: var(--primary-color);
    --primary-hover: #1b4d1c;
    --primary-light: #e8f5e9;
    --primary-alpha: rgba(27, 94, 32, 0.08);

    --accent: var(--secondary-color);
    --accent-hover: #01579b;
    --accent-light: #e1f5fe;

    /* --- Status e Alertas --- */
    --success: hsl(150, 75%, 38%);                      /* Verde Sucesso Clínico */
    --success-light: hsl(150, 80%, 95%);
    --error: hsl(0, 78%, 52%);                          /* Vermelho Alerta/Pré-requisito */
    --error-light: hsl(0, 85%, 97%);
    --info: hsl(205, 85%, 48%);                         /* Azul Informação/Cursando */
    --info-light: hsl(205, 95%, 95%);

    /* --- Cores Neutras (Light Mode) --- */
    --background: var(--bg-color);
    --surface: var(--surface-color);
    --surface-elevated: #f8fafc;
    --border: #e2e8f0;                                  /* Slate 200 - Bordas Leves */
    --border-hover: #cbd5e1;                            /* Slate 300 - Foco de Borda */

    /* --- Efeitos --- */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(27, 94, 32, 0.06), 0 2px 4px -2px rgba(27, 94, 32, 0.04);
    --shadow-lg: 0 12px 20px -3px rgba(27, 94, 32, 0.08), 0 4px 12px -2px rgba(27, 94, 32, 0.04);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: var(--border-radius);
    --radius-circle: 9999px;

    /* --- Tipografia & Transição --- */
    --font-heading: 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* --- Backward Compatibility Aliases --- */
    --font: var(--font-body);
    --radius: var(--radius-lg);
    --shadow: var(--shadow-md);
}

/* --- Dark Mode Nativo --- */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #0f172a;                          /* Slate 900 Noturno */
        --surface: #1e293b;                             /* Slate 800 - Painéis Escuros */
        --surface-color: #1e293b;                       /* Compatibilidade com legado */
        --surface-elevated: #334155;                    /* Slate 700 - Cards Elevados */
        
        --text-primary: #f8fafc;                        /* Slate 50 - Branco Gelo */
        --text-secondary: #94a3b8;                      /* Slate 400 - Cinza Médio Leitura */
        --border: #334155;                              /* Slate 700 - Divisores Escuros */
        --border-hover: #475569;

        --primary-light: rgba(27, 94, 32, 0.25);
        --primary-alpha: rgba(27, 94, 32, 0.15);
        --accent-light: rgba(2, 119, 189, 0.15);

        --success-light: rgba(21, 171, 111, 0.1);
        --error-light: rgba(232, 46, 46, 0.1);
        --info-light: rgba(25, 143, 237, 0.1);

        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.5);

        --shadow: var(--shadow-md);
    }
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem; /* Adjusted for min-height 44px elements */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    z-index: 100;
    position: relative;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
    min-height: 44px; /* Touch target */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-nav-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
    margin-left: 2rem;
}

.header-center {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}

.header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.nav-links, .nav-links-auth {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    list-style: none;
}

.nav-links a, .nav-links-auth a:not(.nav-btn-outline) {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.25rem;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px; /* Touch target */
    min-width: 44px;  /* Touch target */
}

.nav-links a:hover, .nav-links-auth a:not(.nav-btn-outline):hover {
    color: var(--primary);
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 700;
    border-bottom: 2px solid var(--accent);
}

/* Outlined Button do Header */
.nav-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary);
    background-color: transparent;
    color: var(--primary) !important;
    padding: 0.5rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    text-decoration: none;
    min-height: 44px; /* Touch target */
    box-sizing: border-box;
}

.nav-btn-outline:hover {
    background-color: var(--primary);
    color: white !important;
}

/* Botão do Menu Hambúrguer */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    align-items: center;
    justify-content: center;
    width: 44px; /* Touch target */
    height: 44px; /* Touch target */
}

.mobile-menu-toggle svg {
    width: 28px;
    height: 28px;
}

.mobile-menu-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    .mobile-menu-toggle:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

@media (max-width: 992px) {
    .header-nav-menu {
        margin-left: 1rem;
    }
    .nav-links, .nav-links-auth {
        gap: 1rem;
    }
}

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

    header {
        padding: 0.75rem 1.5rem;
        justify-content: space-between;
    }

    .header-nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        display: none;
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
        z-index: 999;
        margin-left: 0;
    }

    .header-nav-menu.active {
        display: flex;
    }

    .header-center, .header-right {
        width: 100%;
        text-align: left;
        justify-content: flex-start;
    }

    .nav-links, .nav-links-auth {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
        gap: 0.5rem;
    }

    .nav-links a, .nav-links-auth a:not(.nav-btn-outline) {
        width: 100%;
        justify-content: flex-start;
        padding: 0.75rem 0.5rem;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    @media (prefers-color-scheme: dark) {
        .nav-links a, .nav-links-auth a:not(.nav-btn-outline) {
            border-bottom-color: rgba(255,255,255,0.05);
        }
    }

    .nav-btn-outline {
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }
}

main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 4.5rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: 3.5rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: 2.75rem;
    margin-bottom: 1.25rem;
    font-weight: 800;
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.95;
    max-width: 650px;
    margin: 0 auto 2.5rem;
    font-family: var(--font-body);
}

.btn {
    display: inline-block;
    background-color: var(--accent);
    color: #1e293b;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-family: var(--font-heading);
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

/* Small button variant for compact UI */
.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background-color: var(--accent-hover);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-lg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3.5rem;
}

.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    padding: 2.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card h2 {
    color: var(--primary);
    font-size: 1.4rem;
    margin-bottom: 0.85rem;
    font-family: var(--font-heading);
    font-weight: 700;
}

footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2.5rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    margin-top: auto;
    font-size: 0.925rem;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.25rem;
    }
}

/* Grade Page Styles */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.semester-section {
    margin-bottom: 4rem;
}

.semester-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    border-left: 5px solid var(--primary);
    padding-left: 0.75rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}


.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.subject-code {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

.badge-required {
    background-color: var(--primary-light);
    color: var(--primary);
}

.badge-optative {
    background-color: #fef3c7; /* Amber 100 */
    color: #b45309; /* Amber 700 */
}

.subject-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.subject-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.subject-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.meta-subtitle {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    letter-spacing: 0.05em;
}

.prerequisites-section, .professors-section {
    margin-top: 0.75rem;
    border-top: 1px dashed var(--border);
    padding-top: 0.5rem;
}

.prereq-tags, .professor-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.prereq-tag {
    font-size: 0.75rem;
    background-color: #f1f5f9; /* Slate 100 */
    color: #475569;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.prof-tag {
    font-size: 0.75rem;
    background-color: #ecfdf5; /* Emerald 50 */
    color: var(--success);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

@media (prefers-color-scheme: dark) {
    .prereq-tag {
        background-color: #334155;
        color: #cbd5e1;
    }
    .prof-tag {
        background-color: #064e3b;
        color: #a7f3d0;
    }
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 1.1rem;
}


/* ==========================================
 * Grade Curricular (Semesters & Subjects)
 * ========================================== */

.grade-container {
    max-width: 1000px;
    margin: 2rem auto;
}

.grade-header {
    text-align: center;
    margin-bottom: 3rem;
}

.grade-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.grade-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Accordion */
.semester-accordion {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.semester-accordion:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 12px -2px rgb(0 0 0 / 0.1);
}

.semester-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    background-color: var(--surface);
    transition: var(--transition);
}

.semester-header:hover {
    background-color: rgba(15, 118, 110, 0.05); /* very light teal */
}

.semester-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.semester-number {
    background-color: #ffffff;
    color: var(--primary);
    border: 2px solid var(--primary);
    font-weight: 700;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.1rem;
}

.semester-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.semester-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.semester-chevron {
    font-size: 1.25rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
}

.semester-accordion.open .semester-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

.semester-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    border-top: 1px solid transparent;
}

.semester-accordion.open .semester-content {
    border-top-color: var(--border);
}

.semester-inner-content {
    padding: 1.5rem;
}

/* Subject Grid */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.empty-semester {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem 0;
}

/* Subject Card */
.subject-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    box-shadow: var(--shadow-sm);
    /* hardware acceleration and specific property transitions */
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

.subject-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    background-color: var(--surface-elevated);
}

.subject-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.subject-code-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    background-color: var(--primary-light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.badge-mandatory {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-optative {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--accent);
}

.subject-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.subject-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: var(--surface);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.2), 0 10px 10px -5px rgb(0 0 0 / 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background-color: var(--surface);
}

.modal-title-area {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 85%;
}

.modal-title-code {
    align-self: flex-start;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    padding: 0.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
}

.modal-close:hover {
    background-color: var(--border);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Info Grid in Modal */
.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.info-card {
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.info-card-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.info-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--primary);
    padding-left: 0.5rem;
}

.info-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.info-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.info-list-item {
    background-color: var(--background);
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.info-list-item.none {
    border-style: dashed;
    color: var(--text-secondary);
    background-color: transparent;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    background-color: var(--background);
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
    .semester-number {
        background-color: #ffffff;
        color: var(--primary);
        border: 2px solid var(--primary);
    }
    .subject-code-badge {
        background-color: var(--primary-light);
        color: var(--accent);
    }
    .semester-header:hover {
        background-color: var(--primary-alpha);
    }
    .info-card-value {
        color: var(--accent);
    }
    .info-section-title {
        border-left-color: var(--primary);
    }
}

@media (max-width: 600px) {
    .semester-meta {
        display: none; /* Hide count/workload on mobile to save space */
    }
    .info-grid {
        grid-template-columns: 1fr;
    }
    .modal-container {
        width: 95%;
        height: auto;
        max-height: 95vh;
    }
}

/* ==========================================
 * Professores Page Styles (Forms, Tables, Alerts)
 * ========================================== */

.professors-container {
    max-width: 1200px;
    margin: 2rem auto;
}

.professors-header {
    margin-bottom: 2rem;
}

.professors-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.professors-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Alert Messages */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideDown 0.3s ease-out;
    border: 1px solid transparent;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #047857; /* Emerald 700 */
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #b91c1c; /* Red 700 */
    border-color: rgba(239, 68, 68, 0.2);
}

@media (prefers-color-scheme: dark) {
    .alert-success {
        background-color: rgba(16, 185, 129, 0.2);
        color: #34d399; /* Emerald 400 */
    }
    .alert-danger {
        background-color: rgba(239, 68, 68, 0.2);
        color: #f87171; /* Red 400 */
    }
}

/* Layout Split: Cards/Forms & Table */
.professors-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .professors-grid {
        grid-template-columns: 1fr 2fr;
    }
}

/* Cards & Forms */
.form-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.form-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.form-control:hover {
    border-color: var(--border-hover);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-alpha);
    background-color: var(--surface);
}

.field-error {
    font-size: 0.8rem;
    color: #ef4444; /* Red 500 */
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Table Card */
.table-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

/* Table Wrapper for scroll on mobile */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.premium-table th {
    background-color: var(--background);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--border);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.premium-table td {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

.premium-table tbody tr:last-child td {
    border-bottom: none;
}

.premium-table tbody tr {
    transition: var(--transition);
}

.premium-table tbody tr:hover {
    background-color: rgba(15, 118, 110, 0.02);
}

@media (prefers-color-scheme: dark) {
    .premium-table tbody tr:hover {
        background-color: rgba(45, 212, 191, 0.02);
    }
}

/* Subjects list inside table */
.teacher-subjects-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.teacher-subject-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(15, 118, 110, 0.1);
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.teacher-subject-tag:hover {
    background-color: var(--primary-color);
    color: #ffffff !important;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.teacher-subject-tag a {
    color: inherit;
    text-decoration: none;
}

@media (prefers-color-scheme: dark) {
    .teacher-subject-tag {
        background-color: var(--primary-light);
        color: var(--accent);
        border-color: var(--primary-alpha);
    }
}

/* Unassign Button */
.btn-unassign {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-unassign:hover {
    background-color: rgba(239, 68, 68, 0.1);
    transform: scale(1.1);
}

.no-subjects {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.85rem;
}

.empty-table-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1.5rem;
}

.btn-block {
    width: 100%;
}

/* ==========================================
 * Grade Page Layout & Form Grid Styles
 * ========================================== */

.grade-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

@media (min-width: 1024px) {
    .grade-grid {
        grid-template-columns: 1fr 2fr;
        align-items: start;
    }
}

.form-aside {
    position: sticky;
    top: 2rem;
}

/* Status Badges */
.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    display: inline-block;
}

.status-active {
    background-color: #d1fae5; /* Green 100 */
    color: #065f46; /* Green 800 */
}

.status-inactive {
    background-color: #fee2e2; /* Red 100 */
    color: #991b1b; /* Red 800 */
}

.status-neutral {
    background-color: #e5e7eb; /* Gray 200 */
    color: #4b5563; /* Gray 600 */
}

/* Search Box styling */
.search-bar-container {
    width: 100%;
    margin-bottom: 1.5rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input-wrapper .search-input {
    padding-left: 1rem;
    padding-right: 2.75rem;
    height: 46px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.search-input-wrapper .clear-search-btn {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
    padding: 0.25rem;
    line-height: 1;
    transition: var(--transition);
}

.search-input-wrapper .clear-search-btn:hover {
    color: var(--primary);
    transform: scale(1.15);
}

/* Modo de Edição - Controle de Visibilidade de Elementos */
.grade-grid.edit-mode-hidden,
.professors-grid.edit-mode-hidden {
    grid-template-columns: 1fr !important;
}

.grade-grid.edit-mode-hidden .form-aside,
.professors-grid.edit-mode-hidden .forms-aside {
    display: none !important;
}

.professors-grid.edit-mode-hidden .btn-unassign {
    display: none !important;
}

/* Ocultar última coluna da tabela de professores (Ações / Editar) */
.professors-grid.edit-mode-hidden .premium-table th:nth-child(7),
.professors-grid.edit-mode-hidden .premium-table td:nth-child(7) {
    display: none !important;
}

.clickable-link {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    transition: var(--transition);
}

.clickable-link:hover {
    color: #0d9488;
}

/* Clickable cards/chips in info lists */
.info-list-item.clickable {
    cursor: pointer;
    transition: var(--transition);
    color: var(--primary) !important;
    font-weight: 500;
}

.info-list-item.clickable:hover {
    background-color: rgba(15, 118, 110, 0.08);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.info-list-item.clickable span,
.info-list-item.clickable a {
    color: var(--primary) !important;
    font-weight: 500;
    text-decoration: none !important;
}

.info-list-item.clickable a:hover {
    text-decoration: none !important;
}

@media (prefers-color-scheme: dark) {
    .info-list-item.clickable:hover {
        background-color: var(--primary-alpha);
        border-color: var(--accent);
    }
    .info-list-item.clickable,
    .info-list-item.clickable span,
    .info-list-item.clickable a {
        color: var(--accent) !important;
    }
}

/* ==========================================================================
   Grupos de Estudo FAVET Styling
   ========================================================================== */

.groups-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 3.5rem 2rem;
    border-radius: var(--radius);
    margin-bottom: 2.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.groups-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.groups-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
    color: #ffffff;
}

.groups-hero p {
    font-size: 1.125rem;
    color: #ffffff;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* Grid layout */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Card basic styling */
.group-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.group-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

/* Image styling */
.group-card-image-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background-color: var(--border);
}

.group-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.group-card:hover .group-card-image {
    transform: scale(1.05);
}

.placeholder-image-gradient {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.gega-gradient {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--accent) 100%);
}

.placeholder-icon {
    font-size: 4rem;
    opacity: 0.8;
}

.group-card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: rgba(15, 118, 110, 0.95);
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Card content */
.group-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.group-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
    transition: color 0.2s ease;
}

.group-card:hover .group-card-title {
    color: var(--primary);
}

.group-card-compact-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.expand-prompt {
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    transition: var(--transition);
}

.expand-prompt::after {
    content: " ↓";
    display: inline-block;
    transition: transform 0.3s ease;
}

.group-card.expanded .expand-prompt::after {
    transform: rotate(180deg);
}

/* Expanded details section */
.group-card-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, margin-top 0.4s ease;
}

.group-card.expanded .group-card-details {
    max-height: 600px;
    opacity: 1;
    margin-top: 1.25rem;
}

.divider {
    height: 1px;
    background-color: var(--border);
    margin-bottom: 1.25rem;
}

.details-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.details-section-title:first-of-type {
    margin-top: 0;
}

.group-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.group-professor {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.group-contacts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    width: fit-content;
}

.contact-link:hover {
    color: var(--primary);
    transform: translateX(2px);
}

/* Custom icons in styling (simulating fonts with CSS before elements) */
.icon-calendar::before { content: "📅 "; }
.icon-email::before { content: "✉️ "; }
.icon-instagram::before { content: "📸 "; }
.icon-phone::before { content: "📞 "; }

/* Dark mode adjustment override */
@media (prefers-color-scheme: dark) {
    .groups-hero {
        background: linear-gradient(135deg, var(--primary) 0%, var(--background) 100%);
    }
    .group-card-badge {
        background-color: var(--accent);
        color: #1e293b;
    }
    .expand-prompt {
        color: var(--accent);
    }
    .details-section-title {
        color: var(--accent);
    }
    .contact-link:hover {
        color: var(--accent);
    }
}

/* User Greeting in Header */
.user-greeting {
    font-size: 0.85rem;
    font-weight: 600;
    background-color: #ebfaf8;
    color: #0f766e;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
}

@media (prefers-color-scheme: dark) {
    .user-greeting {
        background-color: rgba(13, 148, 136, 0.15);
        color: #2dd4bf;
    }
}

/* Student Progress Highlight Classes */
.subject-card.status-cursando {
    border-left: 5px solid #0ea5e9 !important; /* Azul celeste/turquesa vibrante */
}
.subject-card.status-concluida {
    border-left: 5px solid #10b981 !important; /* Verde esmeralda vibrante */
}

.badge-progress-state {
    margin-left: auto;
}

.badge-cursando {
    background-color: #e0f2fe;
    color: #0369a1;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
}

.badge-concluida {
    background-color: #d1fae5;
    color: #047857;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

@media (prefers-color-scheme: dark) {
    .badge-cursando {
        background-color: rgba(14, 165, 233, 0.2);
        color: #38bdf8;
    }
    .badge-concluida {
        background-color: rgba(16, 185, 129, 0.2);
        color: #34d399;
    }
}

/* Student Actions styling */
.student-actions-container {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.student-status-info {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: auto;
}

.student-status-info.cursando {
    color: #0ea5e9;
}

.student-status-info.concluida {
    color: #10b981;
}

.modal-error-message {
    background-color: #fef2f2;
    border: 1px solid #fee2e2;
    color: #b91c1c;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: none;
    animation: fadeIn 0.2s ease-out;
}

@media (prefers-color-scheme: dark) {
    .modal-error-message {
        background-color: rgba(220, 38, 38, 0.1);
        border: 1px solid rgba(220, 38, 38, 0.2);
        color: #fca5a5;
    }
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.05);
    color: #dc2626;
    border-color: #dc2626;
}

.btn-secondary-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary-outline:hover {
    background: rgba(15, 118, 110, 0.05);
    border-color: var(--primary);
    color: var(--primary);
}

/* ==========================================
   STUDENT PROFILE PAGE STYLES (Minha Conta)
   ========================================== */

.profile-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr 2fr;
    }
}

.profile-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Info Card (Left Panel) */
.info-card {
    align-items: center;
    text-align: center;
}

.avatar-container {
    margin-bottom: 1.5rem;
}

.avatar-initial {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 12px var(--primary-alpha);
    border: 4px solid var(--surface);
}

.student-details {
    width: 100%;
}

.student-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.student-email {
    font-size: 0.95rem;
    color: var(--text-secondary);
    word-break: break-all;
}

.divider {
    width: 100%;
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

.edit-name-section {
    width: 100%;
}

.edit-name-section .btn-secondary-outline {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
}

.edit-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    text-align: left;
    width: 100%;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease;
}

.edit-form.hidden {
    display: none;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--background);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-actions .btn {
    padding: 0.6rem;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
}

/* Progress Card (Right Panel) */
.progress-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.progress-card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary);
    border-radius: 2px;
}

.progress-overview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

@media (min-width: 992px) {
    .progress-overview {
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
        width: 100%;
    }
}

.progress-ring-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.progress-ring__circle-bg {
    stroke: var(--border);
    stroke-width: 8px !important;
}

.progress-ring__circle {
    stroke: var(--primary);
    stroke-linecap: round;
    stroke-width: 8px !important;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-ring-text {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.progress-ring-text .percentage {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.progress-ring-text .percent-symbol {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.progress-ring-text .label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 2px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    width: 100%;
}

@media (min-width: 992px) {
    .stats-grid {
        max-width: 400px;
    }
}

.stat-box {
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: var(--transition);
}

.stat-box:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.stat-total {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-unit, .stat-total {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Tabs Section */
.subjects-tabs-section {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 1rem;
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border);
    background-color: var(--background);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 1.25rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.tab-btn:hover {
    color: var(--primary);
    background-color: var(--primary-alpha);
}

.tab-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background-color: var(--surface);
}

.tabs-content {
    padding: 2rem;
}

.tab-pane {
    display: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.tab-pane.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Subjects Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.subjects-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.subjects-table th {
    background-color: var(--background);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--border);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.subjects-table td {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.subjects-table tbody tr {
    transition: var(--transition);
}

.subjects-table tbody tr:hover {
    background-color: rgba(15, 118, 110, 0.03);
}

.col-code {
    font-weight: 700;
    color: var(--primary);
    font-family: monospace;
    font-size: 1rem;
}

.col-name {
    font-weight: 600;
}

.col-semester, .col-credits, .col-workload {
    color: var(--text-secondary);
}

/* Empty States */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite ease-in-out;
}

.empty-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 450px;
    line-height: 1.6;
}

.empty-state a.empty-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.empty-state a.empty-link:hover {
    border-bottom-color: var(--primary);
}

/* Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Batch Grade Edit Styles */
.bulk-edit-section {
    animation: fadeIn 0.4s ease;
    padding: 1.5rem 0;
}

.bulk-edit-header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.bulk-edit-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.bulk-edit-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 800px;
}

.semesters-edit-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.semester-edit-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.semester-edit-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.05);
}

.semester-edit-card h3 {
    font-size: 1.15rem;
    color: var(--primary);
    margin-bottom: 1.25rem;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 0.75rem;
    font-weight: 700;
}

.semester-subjects-list,
.subject-edit-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.subject-edit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.subject-edit-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.subject-info {
    display: flex;
    flex-direction: column;
    max-width: 60%;
}

.subject-info .subject-code {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    font-family: monospace;
}

.subject-info .subject-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 0.15rem;
    line-height: 1.3;
}

.subject-info .subject-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.subject-status-select {
    width: 38%;
    display: flex;
    justify-content: flex-end;
}

.status-select {
    width: 100%;
    max-width: 120px;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background-color: var(--background);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.status-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.bulk-edit-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.bulk-edit-actions button, 
.bulk-edit-actions a {
    min-width: 160px;
    text-align: center;
    display: inline-block;
    padding: 0.75rem 1.5rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 420px;
    width: 100%;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 0.4s ease-out forwards;
    opacity: 0;
    transform: translateX(100%);
    pointer-events: auto;
    backdrop-filter: blur(8px);
}

@keyframes toastSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-fade-out {
    animation: toastFadeOut 0.4s ease-in forwards !important;
}

@keyframes toastFadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.toast-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.toast-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
    flex-shrink: 0;
    transition: color 0.2s;
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .toast-container {
        right: 0.75rem;
        left: 0.75rem;
        max-width: none;
    }
}

@media (prefers-color-scheme: dark) {
    .toast {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }
}

/* Accessibility helper class for screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Seção de Redesenho UX/UI WebFAVET (Novos Componentes)
   ========================================================================== */

/* 1. Novo Banner de Aviso dismissible */
.banner-aviso {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--alert-bg);
    color: var(--alert-text);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(217, 119, 6, 0.2);
    margin: 1rem auto 2rem;
    max-width: 1200px;
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
    animation: slideDown 0.3s ease-out;
}

.banner-aviso-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.banner-aviso-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--alert-text);
}

.banner-aviso-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--alert-text);
    opacity: 0.8;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

.banner-aviso-close:hover {
    opacity: 1;
    background-color: rgba(120, 53, 15, 0.1);
}

/* 2. Hero Section Redesenhada */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 5.5rem 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 3.5rem;
    box-shadow: 0 10px 25px -5px rgba(27, 94, 32, 0.2), 0 8px 10px -6px rgba(2, 119, 189, 0.2);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.hero-content p {
    font-size: 1.25rem;
    line-height: 1.7;
    opacity: 0.95;
    margin-bottom: 2.5rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    color: var(--primary-color);
    padding: 0.95rem 2.25rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
    border: 2px solid #ffffff;
    min-height: 48px; /* Touch target superior */
}

.btn-hero:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    background-color: transparent;
    color: #ffffff;
}

/* 3. Dashboard Grid (Cards Clicáveis da Home) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.75rem;
    margin-bottom: 3.5rem;
}

.dashboard-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-height: 240px; /* Touch target e leitura */
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    opacity: 0.7;
    transition: var(--transition);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.dashboard-card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 48px;
    height: 48px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.dashboard-card:hover .card-icon {
    background-color: var(--primary-color);
    color: white;
}

.card-icon svg {
    width: 24px;
    height: 24px;
}

.dashboard-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.dashboard-card:hover h3 {
    color: var(--primary-color);
}

.dashboard-card p {
    font-size: 0.925rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.card-action-link {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition);
}

.dashboard-card:hover .card-action-link {
    color: var(--secondary-color);
    transform: translateX(4px);
}

/* 4. Filtros Rápidos (Grade) */
.filter-tabs-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
    background-color: var(--surface);
    padding: 0.35rem;
    border-radius: 9999px;
    border: 1px solid var(--border);
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: var(--shadow-sm);
}

.filter-tab {
    flex: 1;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.65rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
    text-align: center;
    min-height: 44px; /* Touch target */
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-tab:hover {
    color: var(--primary-color);
}

.filter-tab.active {
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

/* 5. Estilização do Acordeão (Grade) */
.accordion-header {
    width: 100%;
    border: none;
    outline: none;
    text-align: left;
    background: var(--surface);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
    min-height: 48px;
}

.accordion-header:hover {
    background-color: var(--primary-light);
}

.accordion-chevron {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.semester-accordion.open .accordion-chevron {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.accordion-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease-out;
}

.semester-accordion.open .accordion-content {
    max-height: 2000px; /* Suficientemente alto para conter as disciplinas */
    opacity: 1;
}

/* Badges da Grade */
.badge-blue {
    background-color: var(--accent-light);
    color: var(--secondary-color);
    border: 1px solid rgba(2, 119, 189, 0.2);
}

.badge-gray {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid rgba(71, 85, 105, 0.15);
}

/* Badges do Dark Mode */
@media (prefers-color-scheme: dark) {
    .badge-blue {
        background-color: rgba(2, 119, 189, 0.15);
        color: #63b3ed;
    }
    .badge-gray {
        background-color: rgba(71, 85, 105, 0.15);
        color: #cbd5e1;
    }
}

/* CH alinhamento */
.subject-ch {
    margin-left: auto;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* 6. Empty States personalizados */
.empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3.5rem 2rem;
    background-color: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--border-radius);
    max-width: 600px;
    margin: 2rem auto;
    box-shadow: var(--shadow-sm);
}

.empty-state-svg {
    width: 64px;
    height: 64px;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.empty-state-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.empty-state-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 450px;
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.25rem;
    }
    .hero-content p {
        font-size: 1.1rem;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Card de CTA para Cadastro de Usuários Anônimos */
.cta-register-card {
    background: linear-gradient(135deg, rgba(38, 176, 48, 0.03) 0%, rgba(2, 119, 189, 0.03) 100%);
    border: 1px dashed var(--primary-color) !important;
}

.cta-register-card:hover {
    background: linear-gradient(135deg, rgba(38, 176, 48, 0.07) 0%, rgba(2, 119, 189, 0.07) 100%);
    border-style: solid !important;
    border-color: var(--primary-color) !important;
}

.cta-register-card .cta-icon {
    background-color: var(--primary-color);
    color: #ffffff;
    transition: var(--transition);
}

.cta-register-card:hover .cta-icon {
    background-color: var(--secondary-color);
    transform: scale(1.1) rotate(5deg);
}

.cta-register-card .cta-action {
    color: var(--primary-color);
    font-weight: 800;
}

.cta-register-card:hover .cta-action {
    color: var(--secondary-color);
}

/* Layout especial para 5 colunas na Home (Usuários Anônimos) */
@media (min-width: 1025px) {
    .grid-five-cols {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 1.25rem !important;
    }
    .grid-five-cols .dashboard-card {
        padding: 1.5rem 1.25rem !important;
        min-height: 250px !important;
    }
}

