/* --- Base Layout --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--cor-fundo);
    color: var(--cor-texto);
    margin: 0;
    line-height: 1.6;
}

.container {
    width: 85%;
    max-width: 1800px;
    margin: auto;
}

.container-fluid {
    width: 95%;
    max-width: none;
    margin: auto;
}

.navbar {
    background-color: var(--cor-primaria);
    background: linear-gradient(135deg, var(--cor-primaria) 0%, #003d73 100%);
    color: var(--cor-texto-claro);
    padding: 0.75rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-left, .navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-brand-wrapper {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-text {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: var(--cor-texto-claro);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.brand-subtitle {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
}

.navbar-tenant-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.navbar-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.navbar-nav a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.navbar-link-special {
    color: #ffeb3b !important;
}

.navbar-user-container {
    position: relative;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.navbar-user:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
}

.user-role-badge {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cor-primaria);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* User Dropdown Card */
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    padding: 16px;
    display: none;
    flex-direction: column;
    gap: 12px;
    z-index: 1100;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-dropdown.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.dropdown-header {
    padding: 4px 8px;
}

.dropdown-user-name {
    font-size: 1rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.dropdown-user-email {
    font-size: 0.8rem;
    color: #64748b;
    margin: 2px 0 0 0;
}

.dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0;
}

.dropdown-section {
    padding: 4px 8px;
}

.section-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 8px;
}

.context-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 10px;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
}

.context-info svg {
    color: var(--cor-primaria);
    flex-shrink: 0;
}

.dropdown-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #fff1f2;
    color: #e11d48;
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s;
}

.dropdown-logout:hover {
    background: #ffe4e6;
    transform: translateX(4px);
}

.btn-login {
    background: white;
    color: var(--cor-primaria) !important;
    font-weight: 800 !important;
}

/* --- Generic Cards --- */
.card {
    background: var(--cor-fundo-card);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    max-width: 400px;
    margin: 0 auto;
}

.card-large {
    max-width: 1000px;
}

.card-xl {
    max-width: 900px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.header-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.back-button {
    color: var(--cor-texto);
    text-decoration: none;
}

/* --- Page Wrapper (modern layout) --- */
.page-wrapper {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.page-wrapper-xl {
    max-width: 100%;
}

.page-wrapper-full {
    max-width: 100%;
}

.page-header {
    background: var(--cor-fundo-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--cor-borda-leve);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
    gap: 12px;
}

.page-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--cor-texto);
}

.page-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-body {
    background: var(--cor-fundo-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--cor-borda-leve);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

/* --- Typography & Utilities --- */
h1 {
    color: var(--cor-primaria);
    text-align: center;
    margin-bottom: 1.5rem;
}

.mt-1 { margin-top: 1rem; }
.ml-1 { margin-left: 1rem; }
.mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.text-muted { color: var(--cor-texto-leve); }
.text-primary { color: var(--cor-primaria); }
.text-danger { color: var(--cor-secundaria) !important; }
.text-nowrap { white-space: nowrap; }
.fw-bold { font-weight: bold; }
.fs-small { font-size: 0.85rem; }
.flex-grow { flex: 1; flex-grow: 1; }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--cor-texto-leve);
}

.empty-state svg {
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #666;
    margin-top: 0;
}

.empty-state p {
    color: #888;
}

.turma-info-horizontal {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.info-item {
    text-align: center;
}

/* --- About Page --- */
.about-container {
    padding: 1rem 2rem;
    text-align: left !important;
}

.about-section {
    margin-bottom: 2.5rem;
}

.about-section h3 {
    color: var(--cor-primaria);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.about-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    flex-shrink: 0;
}

.about-list {
    list-style-type: none;
    padding-left: 0;
}

.about-list li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.about-list li::before {
    content: "•";
    color: var(--cor-primaria);
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

.legal-box {
    background-color: #fcfcfc;
    border: 1px solid var(--cor-borda);
    border-left: 5px solid var(--cor-secundaria);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.legal-box h4 {
    margin-top: 0;
    color: var(--cor-secundaria);
    display: flex;
    align-items: center;
    gap: 10px;
}

.legal-box p {
    margin-bottom: 0;
}

.contact-box {
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border: 1px dashed var(--cor-borda);
    border-radius: var(--radius-md);
    margin-top: 3rem;
}

.contact-box h4 {
    margin-top: 0;
    color: var(--cor-texto);
}

.contact-box p {
    color: #666;
    margin-bottom: 5px;
}

.dev-email {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--cor-primaria);
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
}

.page-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--cor-borda);
    color: #888;
    font-size: 0.85rem;
}

@media (max-width: 992px) {
    .brand-subtitle {
        display: none;
    }
}

@media (max-width: 768px) {
    .navbar-inner {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .navbar-left, .navbar-right {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .navbar-nav {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .navbar-user {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 12px;
        justify-content: center;
        width: 100%;
    }

    .user-info {
        align-items: center;
    }
}