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

:root {
    --bg-body: #f4f7fb;
    --bg-white: #ffffff;
    --bg-soft: #f9fafb;
    --bg-soft-2: #f3f4f6;
    --bg-sidebar: linear-gradient(180deg, #0f172a, #020617);

    --text-main: #1f2937;
    --text-soft: #6b7280;
    --text-light: #e5e7eb;
    --text-group: #94a3b8;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, 0.18);

    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;

    --border: #d1d5db;
    --border-soft: #e5e7eb;

    --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-login: 0 10px 30px rgba(0, 0, 0, 0.08);

    --radius-sm: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.45;
}

a {
    text-decoration: none;
    color: inherit;
}

/* LOGIN */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eaf2ff, #f8fbff);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
    background: var(--bg-white);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-login);
}

.login-logo {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--primary-hover);
}

.login-subtitle {
    color: var(--text-soft);
    margin-bottom: 24px;
}

/* FORMULÁRIOS */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 15px;
    background: var(--bg-white);
    color: var(--text-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: auto;
}

/* BOTÕES */
.btn {
    display: inline-block;
    width: 100%;
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}

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

.btn:active {
    transform: translateY(1px);
}

/* ALERTAS */
.alert {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

/* LAYOUT PRINCIPAL */
.dashboard-wrapper {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
    width: 100%;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    min-width: 260px;
    min-height: 100vh;
    background: var(--bg-sidebar);
    color: #fff;
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.logo-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
}

.logo {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
    color: #fff;
    font-weight: 700;
}

.sidebar-user {
    margin: 14px 0 24px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-user-name {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

.sidebar-user-role {
    margin-top: 4px;
    font-size: 12px;
    color: #cbd5e1;
    font-weight: 600;
}

.sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.sidebar-nav a {
    display: flex !important;
    width: 100%;
}

.nav-section-title {
    display: block;
    width: 100%;
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.nav-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    color: #e5e7eb;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.22);
    color: #fff;
}

.nav-icon {
    width: 22px;
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.nav-label {
    display: inline-block !important;
    line-height: 1.2;
    white-space: normal;
}

.sidebar-footer {
    margin-top: 24px;
}

.sidebar-footer a {
    display: flex !important;
    width: 100%;
}

.nav-item-logout {
    color: #fca5a5;
}

.nav-item-logout:hover {
    background: rgba(220, 38, 38, 0.16);
    color: #fff;
}

/* CONTEÚDO */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 32px;
}

/* TOPO */
.topbar {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
}

.topbar h1 {
    font-size: 28px;
    margin-bottom: 8px;
    color: #111827;
}

.topbar p {
    color: var(--text-soft);
}

/* CARDS */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #111827;
}

.card p {
    color: var(--text-soft);
    font-size: 14px;
}

.card-number {
    font-size: 30px;
    font-weight: 800;
    color: var(--primary);
    margin-top: 10px;
}

/* GRID DE INFORMAÇÕES */
.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 15px;
}

.info-item {
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.info-item strong {
    display: block;
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 6px;
}

.info-item span {
    font-size: 16px;
    color: #111827;
    font-weight: 700;
}

.info-item.full {
    grid-column: span 3;
}

/* STATUS */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    color: #fff;
    display: inline-block;
    font-size: 14px;
}

.status-ativo {
    background: var(--success);
}

.status-encerrado {
    background: var(--danger);
}

.status-pausado {
    background: var(--warning);
}

/* TABELAS */
.table-wrap {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.table-default,
.tabela-padrao,
.tabela-alunos {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-top: 15px;
    font-size: 14px;
}

.table-default th,
.table-default td,
.tabela-padrao th,
.tabela-padrao td,
.tabela-alunos th,
.tabela-alunos td {
    border: 1px solid var(--border);
    padding: 10px;
    vertical-align: middle;
}

.table-default th,
.tabela-padrao th,
.tabela-alunos th {
    background: var(--bg-soft-2);
    text-align: center;
    color: #111827;
    white-space: nowrap;
}

/* PRESENÇA */
.presenca-cell {
    transition: 0.2s ease;
    border-radius: 6px;
}

.presenca-presente {
    background: #dcfce7 !important;
}

.presenca-faltou,
.presenca-cancelado {
    background: #fee2e2 !important;
}

.presenca-falta-justificada {
    background: #fed7aa !important;
}

/* CALENDÁRIO / IMPRESSÃO */
table.calendario {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

table.calendario th,
table.calendario td {
    border: 1px solid #bdbdbd;
}

table.calendario th {
    background: #f3f3f3;
    text-align: center;
    padding: 8px 4px;
    font-size: 14px;
    font-weight: 800;
    color: #111827;
}

table.calendario td {
    height: 136px;
    vertical-align: top;
    padding: 5px;
    color: #222;
}

.dia-domingo {
    background: #fafafa;
}

.dia-agendado {
    background: #dfeeff !important;
}

.dia-com-anotacao {
    background-image: linear-gradient(to bottom, rgba(255, 248, 220, 0.65), rgba(255, 248, 220, 0.2));
}

.topo-dia {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.numero-dia {
    font-size: 15px;
    font-weight: 800;
    color: #222;
}

.badge-anotacao {
    font-size: 10px;
    font-weight: 800;
    background: #f59e0b;
    color: #fff;
    padding: 3px 6px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.linha-agendado {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.checkbox-grande {
    width: 22px;
    height: 22px;
    border: 2px solid #333;
    display: inline-block;
    position: relative;
    background: #fff;
    box-sizing: border-box;
    flex-shrink: 0;
}

.texto-agendado {
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    color: #222;
}

.espaco-carimbo {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 54px;
    margin-bottom: 6px;
}

.carimbo-circular {
    width: 44px;
    height: 44px;
    border: 2px dashed #999;
    border-radius: 50%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-size: 10px;
    font-weight: 800;
    background: #fff;
}

.espaco-vazio {
    height: 70px;
}

.valor-rhema {
    font-size: 36px;
    font-weight: 900;
    color: var(--primary);
}

.cabecalho-print {
    text-align: center;
    margin-bottom: 10px;
}

.empresa {
    font-size: 20px;
    font-weight: 900;
}

.titulo-principal {
    font-size: 42px;
    line-height: 1.05;
    font-weight: 800;
    margin-bottom: 2px;
    letter-spacing: -0.5px;
}

.titulo-mes {
    font-size: 32px;
    line-height: 1.1;
    font-weight: 700;
    margin-top: 2px;
}

.bloco-anotacoes-dia {
    margin-top: 4px;
}

.nota-dia {
    font-size: 11px;
    line-height: 1.25;
    padding: 4px 5px;
    border-radius: 4px;
    margin-bottom: 4px;
    word-break: break-word;
}

.nota-periodo {
    background: #fff3cd;
    border: 1px solid #f6d776;
}

.nota-data {
    background: #dbeafe;
    border: 1px solid #93c5fd;
}

/* CÉLULA FIXA DE MODELO */
.celula-modelo-fixa {
    background: #eef4fb;
}

.dia-modelo {
    vertical-align: top;
}

.topo-modelo {
    justify-content: flex-start;
    margin-bottom: 10px;
}

.modelo-linha-agendado {
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.checkbox-marcado::after {
    content: "✓";
    position: absolute;
    left: 3px;
    top: -4px;
    font-size: 19px;
    font-weight: 800;
    color: #111;
    line-height: 1;
}

.espaco-carimbo-modelo {
    justify-content: flex-start;
    height: auto;
}

.carimbo-modelo {
    width: 52px;
    height: 52px;
    border-style: solid;
    border-color: #8a8a8a;
    color: #666;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
    background: #fff;
}

/* UTILITÁRIOS */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* RELATÓRIO DIÁRIO - ANÁLISE FUNCIONAL */
.btn-sm {
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.btn-analise {
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.18);
}

.btn-analise:hover {
    background: var(--primary-hover);
}

.btn-analise:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.linha-analise-funcional {
    display: none;
}

.linha-analise-funcional td {
    background: #eef4ff;
    padding: 14px;
}

.box-analise-funcional {
    background: var(--bg-white);
    border: 1px solid #dbe7ff;
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.box-analise-funcional h4 {
    font-size: 17px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 8px;
}

.box-analise-funcional .subtitulo-analise {
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 18px;
}

.form-group-check {
    margin-bottom: 18px;
}

.form-group-check label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
}

.form-group-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.analise-bloco {
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.analise-bloco:last-child {
    margin-bottom: 0;
}

.analise-bloco h5 {
    font-size: 14px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 12px;
}

.grid-ocorrencias,
.grid-abc,
.grid-funcao {
    display: grid;
    gap: 14px;
}

.grid-ocorrencias {
    grid-template-columns: repeat(6, minmax(140px, 1fr));
}

.grid-abc {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.grid-funcao {
    grid-template-columns: 220px 1fr 1fr;
}

.box-analise-funcional .form-group {
    margin-bottom: 0;
}

.box-analise-funcional .form-group label {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #374151;
}

.box-analise-funcional .form-control {
    background: #ffffff;
    border-color: var(--border);
    font-size: 14px;
    padding: 11px 12px;
}

.box-analise-funcional textarea.form-control {
    min-height: 92px;
}

.box-analise-funcional .form-control::placeholder {
    color: #9ca3af;
}

.coluna-analise {
    min-width: 140px;
    text-align: center;
}

.tabela-alunos td .btn-analise,
.tabela-padrao td .btn-analise,
.table-default td .btn-analise {
    margin: 0 auto;
}

.analise-resumo-vazio {
    font-size: 12px;
    color: var(--text-soft);
    margin-top: 6px;
}

.analise-aberta td {
    border-bottom-color: #c7dbff;
}

.analise-destaque {
    border-left: 4px solid var(--primary);
    padding-left: 12px;
}

.tabela-alunos td .form-control,
.tabela-padrao td .form-control,
.table-default td .form-control {
    min-width: 120px;
}

.campo-observacao-relatorio {
    min-width: 220px;
}

.linha-analise-funcional .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

/* CORES PARA SELECTS */
.select-verde {
    background: #dcfce7 !important;
    border-color: #16a34a !important;
}

.select-amarelo {
    background: #fef9c3 !important;
    border-color: #f59e0b !important;
}

.select-vermelho {
    background: #fee2e2 !important;
    border-color: #dc2626 !important;
}

/* RESPONSIVIDADE */
@media (max-width: 1400px) {
    .grid-ocorrencias {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }

    .grid-funcao {
        grid-template-columns: 1fr 1fr;
    }

    .grid-funcao > div:first-child {
        grid-column: span 2;
    }
}

@media (max-width: 1100px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-item.full {
        grid-column: span 2;
    }

    .grid-abc {
        grid-template-columns: 1fr;
    }

    .grid-funcao {
        grid-template-columns: 1fr;
    }

    .grid-funcao > div:first-child {
        grid-column: span 1;
    }
}

@media (max-width: 900px) {
    .dashboard-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        min-height: auto;
        padding: 18px 16px;
    }

    .main-content {
        padding: 20px;
    }

    .topbar {
        padding: 20px;
    }

    .cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .linha-analise-funcional td {
        padding: 10px;
    }

    .box-analise-funcional {
        padding: 14px;
    }

    .grid-ocorrencias {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .btn-sm {
        width: 100%;
        padding: 10px 12px;
    }

    .coluna-analise {
        min-width: 120px;
    }

    .campo-observacao-relatorio {
        min-width: 180px;
    }
}

@media (max-width: 640px) {
    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-item.full {
        grid-column: span 1;
    }

    .topbar h1 {
        font-size: 24px;
    }

    .card {
        padding: 18px;
    }

    .btn {
        font-size: 14px;
        padding: 11px 14px;
    }

    .nav-item {
        font-size: 14px;
    }
}

@media (max-width: 520px) {
    .grid-ocorrencias {
        grid-template-columns: 1fr;
    }

    .box-analise-funcional h4 {
        font-size: 15px;
    }

    .analise-bloco {
        padding: 12px;
    }
}

@media print {
    body {
        background: #fff;
    }

    .checkbox-grande {
        width: 18px;
        height: 18px;
    }

    .checkbox-marcado::after {
        left: 2px;
        top: -3px;
        font-size: 13px;
    }

    .texto-agendado {
        font-size: 10px;
    }

    .espaco-carimbo {
        height: 34px;
    }

    .carimbo-circular {
        width: 32px;
        height: 32px;
        font-size: 7px;
    }

    .carimbo-modelo {
        width: 32px;
        height: 32px;
        font-size: 7px;
    }

    .topo-modelo {
        margin-bottom: 6px;
    }

    .modelo-linha-agendado {
        gap: 5px;
        margin-bottom: 6px;
    }

    .numero-dia {
        font-size: 11px;
    }

    table.calendario td {
        height: 78px;
        padding: 2px;
    }

    table.calendario th {
        font-size: 10px;
        padding: 3px 2px;
    }
}

/* Ajuste específico da página escolas */
.page-escolas .lista-escolas {
    display: flex;
    flex-direction: column;
    gap: 6px; /* controla o espaço entre linhas */
}

/* cada item da lista */
.page-escolas .item-escola {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    line-height: 1.2;
}

/* remove espaçamento exagerado */
.page-escolas .item-escola:last-child {
    border-bottom: none;
}

/* título */
.page-escolas h1 {
    margin-bottom: 10px;
}

/* card principal */
.page-escolas .card {
    padding: 16px;
}

