body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.home-wrap {
    min-height: calc(100vh - 150px);
}

.home-card {
    transition: transform .15s ease, box-shadow .15s ease;
    color: #212529;
}

.home-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 .75rem 1.5rem rgba(0, 0, 0, .12) !important;
}

.home-icon {
    font-size: 3rem;
}

.section-card {
    border: 0;
    box-shadow: 0 .125rem .5rem rgba(0, 0, 0, .06);
}

.required::after {
    content: " *";
    color: #dc3545;
}

.turma-option.lotada {
    opacity: .65;
}

.responsavel-item {
    transition: background-color .15s ease;
}

.responsavel-item:hover {
    background: #f8f9fa;
}

.table td,
.table th {
    vertical-align: middle;
}

.form-hint {
    font-size: .85rem;
    color: #6c757d;
}

/* =========================
   HEADER / NAVBAR
========================= */

.school-navbar {
    background: #ffffff;
    min-height: 76px;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}


/* Marca */

.school-navbar .navbar-brand {
    text-decoration: none;
}

.brand-icon {
    width: 45px;
    height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(135deg, #0d6efd, #0a58ca);

    color: #ffffff;

    border-radius: 12px;

    font-size: 22px;

    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}


.brand-text {
    display: flex;
    flex-direction: column;

    line-height: 1.1;
}


.brand-title {
    font-size: 17px;
    font-weight: 700;

    color: #212529;
}


.brand-text small {
    margin-top: 4px;

    font-size: 11px;
    font-weight: 500;

    color: #8a94a3;
}


/* =========================
   LINKS
========================= */

.school-nav-link {
    display: flex;
    align-items: center;
    gap: 7px;

    padding: 10px 15px !important;

    color: #5f6875 !important;

    font-size: 14px;
    font-weight: 600;

    border-radius: 9px;

    transition: all 0.2s ease;
}


.school-nav-link i {
    font-size: 17px;
}


/* Hover */

.school-nav-link:hover {
    background: #f0f6ff;

    color: #0d6efd !important;

    transform: translateY(-1px);
}


/* Página ativa - mantém cores e posição originais */

.school-nav-link.active {
    position: relative;
    color: #0d6efd !important;
}

.school-nav-link.active::after {
    content: "";
    position: absolute;
    left: 15px;
    right: 15px;
    bottom: 0;
    height: 2px;
    background: #0d6efd;
    border-radius: 2px 2px 0 0;
}


/* =========================
   FOOTER
========================= */

.school-footer {
    background: #1e3a5f;
    color: #ffffff;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.school-footer strong {
    font-size: 15px;
}

.school-footer .small {
    color: #cbd5e1;
    font-size: 12px;
}

/* =========================
   FOOTER
========================= */

.school-footer {
    background: #1e3a5f;
    color: #ffffff;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.school-footer strong {
    font-size: 15px;
}

.school-footer .small {
    color: #cbd5e1;
    font-size: 12px;
}

/* Mobile */

@media (max-width: 991px) {

    .school-navbar {
        padding: 12px 0;
    }

    .school-nav-link {
        margin-bottom: 5px;
    }

}

main {
    flex: 1;
}

/* =========================
   ÁREA ÚTIL DA APLICAÇÃO
========================= */

/*
 * O Bootstrap limita .container a 1320px em telas XXL.
 * Em desktops maiores, aproveitamos melhor a largura disponível sem
 * alterar o comportamento responsivo já existente em telas menores.
 */
@media (min-width: 1400px) {
    .school-navbar > .container,
    main.container,
    .school-footer > .container {
        width: calc(100% - 64px);
        max-width: 1760px;
    }
}
/* =========================
   DASHBOARD FINANCEIRO
========================= */

.finance-overview {
    background: #ffffff;
    border: 1px solid #e6e9ee;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.finance-overview-body {
    padding: 18px;
}

.finance-info-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
}

.finance-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 2px 18px;
}

.finance-info-item:first-child {
    padding-left: 0;
}

.finance-info-item:last-child {
    padding-right: 0;
}

.finance-info-item + .finance-info-item {
    border-left: 1px solid #eceff3;
}

.finance-info-icon {
    width: 28px;
    flex: 0 0 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
}

.finance-info-icon-blue {
    color: #0d6efd;
}

.finance-info-icon-purple {
    color: #6f42c1;
}

.finance-info-icon-teal {
    color: #20a6a6;
}

.finance-info-icon-green {
    color: #20a464;
}

.finance-info-content {
    min-width: 0;
}

.finance-info-label {
    margin-bottom: 3px;
    color: #7b8491;
    font-size: 12px;
    font-weight: 500;
}

.finance-info-value {
    color: #212529;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.finance-metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.finance-metric {
    min-height: 66px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 9px;
}

.finance-metric-icon {
    font-size: 22px;
    flex: 0 0 auto;
}

.finance-metric-value {
    color: #212529;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.1;
}

.finance-metric-label {
    margin-top: 3px;
    color: #626b77;
    font-size: 11px;
    line-height: 1.1;
}

.finance-metric-blue {
    background: #f4f8ff;
    border-color: #e4edfb;
}

.finance-metric-blue .finance-metric-icon {
    color: #0d6efd;
}

.finance-metric-green {
    background: #f1fbf5;
    border-color: #dff3e7;
}

.finance-metric-green .finance-metric-icon {
    color: #20a464;
}

.finance-metric-orange {
    background: #fff9ee;
    border-color: #f8ecd3;
}

.finance-metric-orange .finance-metric-icon {
    color: #f3a21b;
}

.finance-metric-red {
    background: #fff3f4;
    border-color: #f7dfe2;
}

.finance-metric-red .finance-metric-icon {
    color: #dc3545;
}

.finance-metric-slate {
    background: #f5f7fa;
    border-color: #e6eaf0;
}

.finance-metric-slate .finance-metric-icon {
    color: #60758a;
}

@media (max-width: 991px) {
    .finance-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .finance-info-item,
    .finance-info-item:first-child,
    .finance-info-item:last-child {
        padding: 8px 0;
        border-left: 0;
    }

    .finance-info-item + .finance-info-item {
        border-left: 0;
    }

    .finance-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .finance-info-grid,
    .finance-metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================
   DASHBOARD DA HOME
========================= */

.home-dashboard {
    width: 100%;
}

.home-dashboard-period {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    color: #5f6875;
    background: #ffffff;
    border: 1px solid #e6e9ee;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.home-dashboard-period i {
    color: #0d6efd;
}

.home-metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.home-metrics-grid-dashboard {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.home-metric-card {
    min-width: 0;
    min-height: 132px;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #e6e9ee;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.045);
}

.home-metric-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 20px;
}

.home-metric-content {
    min-width: 0;
}

.home-metric-label {
    margin-bottom: 5px;
    color: #6c757d;
    font-size: 12px;
    font-weight: 600;
}

.home-metric-value {
    color: #212529;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.home-metric-help {
    margin-top: 7px;
    color: #8a94a3;
    font-size: 11px;
    line-height: 1.35;
}

.home-metric-blue .home-metric-icon {
    color: #0d6efd;
    background: #eef5ff;
}

.home-metric-purple .home-metric-icon {
    color: #6f42c1;
    background: #f4effb;
}

.home-metric-green .home-metric-icon {
    color: #198754;
    background: #edf8f2;
}

.home-metric-orange .home-metric-icon {
    color: #e58b11;
    background: #fff7e9;
}

.home-metric-red .home-metric-icon {
    color: #dc3545;
    background: #fff0f1;
}

.home-quick-card {
    border: 1px solid #e6e9ee;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.home-quick-card:hover {
    transform: translateY(-2px);
    border-color: #cfd8e3;
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.07);
}

.home-quick-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 20px;
}

.home-quick-icon-blue {
    color: #0d6efd;
    background: #eef5ff;
}

.home-quick-icon-purple {
    color: #6f42c1;
    background: #f4effb;
}

.home-quick-icon-green {
    color: #198754;
    background: #edf8f2;
}

@media (max-width: 1399px) and (min-width: 1200px) {
    .home-metrics-grid-dashboard {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1199px) {
    .home-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .home-metrics-grid {
        grid-template-columns: 1fr;
    }

    .home-metric-card {
        min-height: auto;
    }
}

/* =========================
   AGENDA / CALENDÁRIO
========================= */

.agenda-nav-link {
    cursor: pointer;
    font-family: inherit;
}

.agenda-notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.agenda-modal-content {
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 1rem 3rem rgba(15, 23, 42, .18);
}

.agenda-calendar-column,
.agenda-side-column {
    min-height: 660px;
}

.agenda-toolbar {
    background: #fff;
}

.agenda-weekdays,
.agenda-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.agenda-weekdays {
    background: #f8f9fb;
    border-bottom: 1px solid #e9ecef;
}

.agenda-weekdays > div {
    padding: 9px 6px;
    color: #7b8491;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.agenda-calendar {
    background: #e9ecef;
    gap: 1px;
}

.agenda-day {
    min-width: 0;
    min-height: 92px;
    padding: 7px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 0;
    background: #fff;
    color: #212529;
    text-align: left;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.agenda-day:hover {
    background: #f7faff;
}

.agenda-day:focus-visible {
    z-index: 2;
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
}

.agenda-day-outside {
    background: #fbfbfc;
    color: #adb5bd;
}

.agenda-day-selected {
    box-shadow: inset 0 0 0 2px rgba(13, 110, 253, .45);
}

.agenda-day-number {
    width: 27px;
    height: 27px;
    margin-bottom: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.agenda-day-today .agenda-day-number {
    background: #0d6efd;
    color: #fff;
}

.agenda-day-events {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.agenda-event-chip {
    display: block;
    max-width: 100%;
    padding: 3px 5px;
    overflow: hidden;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.agenda-event-evento {
    background: #e7f1ff;
    color: #0a58ca;
}

.agenda-event-lembrete {
    background: #fff3cd;
    color: #856404;
}

.agenda-event-concluido {
    opacity: .55;
    text-decoration: line-through;
}

.agenda-event-more {
    padding-left: 3px;
    color: #6c757d;
    font-size: 9px;
    font-weight: 600;
}

.agenda-side-column {
    background: #fbfcfe;
}

.agenda-today-panel {
    background: #fff;
}

.agenda-today-list {
    max-height: 150px;
    overflow-y: auto;
}

.agenda-today-item {
    padding: 7px 0;
    border-bottom: 1px solid #f0f1f3;
}

.agenda-today-item:last-child {
    border-bottom: 0;
}

.agenda-today-item-button {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
}

.agenda-today-item-button:hover {
    background: #f8f9fa;
}

.agenda-today-meta {
    font-size: 10px;
}

@media (max-width: 991px) {
    .agenda-notification-badge {
        top: 4px;
        left: 86px;
        right: auto;
    }

    .agenda-calendar-column,
    .agenda-side-column {
        min-height: auto;
    }

    .agenda-calendar-column {
        border-right: 0 !important;
        border-bottom: 1px solid #dee2e6;
    }

    .agenda-day {
        min-height: 76px;
        padding: 5px;
    }

    .agenda-event-chip {
        font-size: 9px;
    }
}

@media (max-width: 575px) {
    .agenda-day {
        min-height: 58px;
    }

    .agenda-event-chip {
        width: 7px;
        height: 7px;
        padding: 0;
        border-radius: 50%;
        color: transparent;
    }

    .agenda-event-more {
        display: none;
    }
}


/* =========================
   AUTENTICAÇÃO / ACESSO
========================= */

.auth-page {
    min-height: 100vh;
}

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-shell {
    width: 100%;
    max-width: 470px;
}

.auth-shell-wide {
    max-width: 720px;
}

.auth-card {
    border-radius: 14px;
}

.auth-brand-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: #fff;
    font-size: 30px;
    box-shadow: 0 8px 24px rgba(13, 110, 253, .2);
}

.access-menu {
    min-width: 260px;
}

@media (max-width: 991px) {
    .access-menu {
        min-width: 100%;
    }
}
