:root {

    /* Paleta Chamada FÃƒÆ’Ã‚Â¡cil */
    --primary: #1a4f86;
    --primary-gradient: linear-gradient(145deg, #1a4f86 0%, #3f6f9d 52%, #244f7e 100%);
    --primary-dark: #0b3766;
    --primary-light: #3f6f9d;
    --primary-soft: linear-gradient(180deg, #2f6396 0%, #3f6f9d 100%);
    --primary-line: rgba(255, 255, 255, 0.18);
    --primary-shadow: rgba(7, 34, 66, 0.22);
    --secondary: #6ABF57;
    --app-green: #6ABF57;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --light: #f8fafc;
    --white: #ffffff;

    /* Grays especÃƒÆ’Ã‚Â­ficos para UI moderna */
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Sombras e Efeitos */
    --shadow-sm: 0 8px 20px rgba(25, 55, 94, 0.08);
    --shadow-md: 0 12px 28px rgba(25, 55, 94, 0.12);
    --shadow-lg: 0 18px 38px rgba(20, 45, 78, 0.16);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);

    --border-radius: 16px;
    --border-radius-sm: 10px;
    --border-radius-lg: 24px;

    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;

    --accent-escolas: #6f879d;
    --accent-turmas: #6d86ad;
    --accent-alunos: #8f829f;
    --accent-chamadas: #6d9a84;

    --transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease,
        box-shadow 0.2s ease, transform 0.18s ease, opacity 0.2s ease;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #edf3f9;
    color: #1f2937;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    background: radial-gradient(circle at top right, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.logo {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.loading-screen h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    margin: 20px auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== ONBOARDING ===== */
.onboarding-content {
    max-width: 620px;
    margin: 0 auto;
    padding: 0 20px 32px;
    text-align: center;
}

.onboarding-header {
    background: var(--primary-gradient);
    margin: 0 -20px 18px;
    padding: 34px 24px 28px;
    border-radius: 0;
    box-shadow: 0 18px 36px rgba(7, 34, 66, 0.18);
}

.onboarding-header .logo-img {
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
}

.onboarding-header h1 {
    font-size: 44px;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.onboarding-wordmark-top {
    color: #ffffff;
}

.onboarding-wordmark-bottom {
    color: #6ABF57;
}

.subtitle {
    font-size: 17px;
    color: rgba(255,255,255,0.88);
    margin: 14px 0 0;
}

.app-version-badge--onboarding {
    margin: 0 auto;
    width: fit-content;
    background: rgba(255,255,255,0.16);
    color: rgba(255,255,255,0.96);
    border-color: rgba(255,255,255,0.28);
    box-shadow: none;
}

.onboarding-highlight-card {
    text-align: left;
    background: linear-gradient(145deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #d6e0ec;
    border-radius: 26px;
    padding: 18px 18px 16px;
    margin-bottom: 14px;
    box-shadow: 0 14px 34px rgba(7, 34, 66, 0.10);
}


.onboarding-highlight-content h3 {
    font-size: 22px;
    margin: 2px 0 10px;
    color: var(--primary-dark);
}

.onboarding-highlight-content p {
    margin: 0 0 8px;
    color: var(--gray-700);
    line-height: 1.5;
}

.onboarding-highlight-content p:last-child {
    margin-bottom: 0;
}

.onboarding-profile {
    text-align: left;
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 14px;
    margin-bottom: 10px;
}

.onboarding-profile label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.onboarding-profile input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition);
}

.onboarding-profile input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.12);
}

.onboarding-profile .text-muted {
    display: block;
    margin-top: 8px;
    color: var(--gray-600);
}

.onboarding-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.onboarding-cta {
    width: 100%;
    max-width: 320px;
    background: #ffffff;
    color: var(--primary-dark);
    border: 1px solid rgba(26, 79, 134, 0.12);
    box-shadow: 0 14px 26px rgba(7, 34, 66, 0.14);
}

.onboarding-cta:hover,
.onboarding-cta:focus {
    background: #ffffff;
    color: var(--primary-dark);
}

/* ===== APP CONTAINER ===== */
.app-container {
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
}

.app-header {
    background:
        radial-gradient(circle at top center, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 42%),
        var(--primary-gradient);
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 18px var(--primary-shadow);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    text-align: center;
    color: #ffffff;
}

/* Wordmark: visÃƒÆ’Ã‚Â­vel sÃƒÆ’Ã‚Â³ na tela principal */
.header-wordmark {
    display: none;
    flex-direction: column;
    line-height: 1.15;
    margin-left: 8px;
}

.app-header.tela-principal .header-wordmark {
    display: flex;
}

.app-header.tela-principal h1 {
    display: none;
}

.wordmark-top {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.03em;
}

.wordmark-bottom {
    font-size: 18px;
    font-weight: 800;
    color: #6ABF57;
    letter-spacing: 0.03em;
}

/* ÃƒÆ’Ã‚Âcones do header ficam brancos */
.app-header .btn-icon {
    color: #ffffff;
}

.app-header .btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
}

.modal-header h3 {
    font-size: 18px;
    color: var(--dark);
    font-weight: 600;
}

.avatar-placeholder {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px dashed var(--primary-light);
    transition: var(--transition);
}

.avatar-placeholder:hover {
    background: var(--white);
    border-color: var(--primary);
    transform: scale(1.05);
}

.header-logo {
    display: flex;
    align-items: center;
    margin-right: 8px;
}

.logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 4px;
}

.btn-icon {
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--gray-200);
}

/* ===== SCREENS ===== */
.screen {
    display: none;
    animation: slideIn 0.3s ease-out;
}

.screen.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== STATS ROW ===== */
.turmas-header {
    margin: 16px 16px 12px;
    padding: 18px;
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 38%),
        var(--primary-gradient);
    border-radius: 22px;
    border: 1px solid var(--primary-line);
    box-shadow: 0 12px 30px var(--primary-shadow);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-card {
    background: #ffffff;
    padding: var(--space-2) var(--space-1);
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid #d7e1ec;
    transition: var(--transition);
}

.stat-card[data-action] {
    cursor: pointer;
}

.stat-card[data-action]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #c7d5e6;
}

/* stat-cards sÃƒÆ’Ã‚Â£o apenas informativos, sem aparÃƒÆ’Ã‚Âªncia de clicÃƒÆ’Ã‚Â¡vel */

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.stat-icon--escolas { color: var(--accent-escolas); }
.stat-icon--turmas  { color: var(--accent-turmas); }
.stat-icon--alunos  { color: var(--accent-alunos); }
.stat-icon--chamadas { color: var(--accent-chamadas); }

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.1;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.stat-label--escolas { color: var(--accent-escolas); }
.stat-label--turmas  { color: var(--accent-turmas); }
.stat-label--alunos  { color: var(--accent-alunos); }
.stat-label--chamadas { color: var(--accent-chamadas); }

/* ===== SEARCH BOX ===== */
.search-box {
    padding: 0 20px 20px;
}

.search-box input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(33, 47, 82, 0.15);
}

/* ===== SEARCH CONTROLS & MULTI-ESCOLA TOGGLE ===== */
.search-controls {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: 0 var(--space-2) var(--space-3);
}

@media (min-width: 600px) {
    .search-controls {
        flex-direction: row;
        align-items: flex-start;
    }

    .search-controls .search-box {
        flex: 1;
    }
}

.search-controls .search-box {
    padding: 0;
}

/* .multi-escola-hint {
    font-size: 11px;
    color: var(--gray-500);
    margin-left: 4px;
    font-style: italic;
} */


.multi-escola-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-left: 4px;
    font-style: italic;
}

@media (max-width: 480px) {
    .multi-escola-hint {
        font-size: 13px;
    }
}

/* ===== TURMAS LIST ===== */
.turmas-list {
    padding: 0 var(--space-2) 56px;
}

.turma-card {
    background: #ffffff;
    padding: 20px;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-2);
    box-shadow: var(--shadow-sm);
    border: 1px solid #d7e1ec;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.turma-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #c7d5e6;
}

.turma-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-light);
}

.turma-card:active {
    transform: scale(0.98);
}

.turma-card h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 8px;
}

.turma-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.turma-card-header h3 {
    margin-bottom: 8px;
}

.turma-delete-btn {
    border: 1px solid var(--gray-300);
    background: #f8fafc;
    color: var(--gray-500);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    flex: 0 0 auto;
    transition: var(--transition);
}

.turma-delete-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

.turma-delete-btn.holding {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
    transform: scale(0.94);
}

.turma-card p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
}

.turma-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
}

.turma-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 100%),
        var(--primary-gradient);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 16px var(--primary-shadow);
}

.btn-primary:hover {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 100%),
        linear-gradient(145deg, var(--primary-light) 0%, var(--primary) 58%, var(--primary-dark) 100%);
    box-shadow: 0 10px 20px rgba(7, 34, 66, 0.28);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-success {
    background: #2e7d32;
    color: #fff;
}

.btn-success:hover {
    filter: brightness(1.1);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    min-height: 36px;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
    min-height: 56px;
}

.btn-block {
    width: 100%;
    margin-bottom: 12px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 72px;
    margin-bottom: 24px;
    display: block;
    filter: grayscale(1) opacity(0.3);
}

.empty-state h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--gray-500);
    font-size: 16px;
    max-width: 300px;
    margin: 0 auto 32px;
}

/* ===== TURMA DETALHE ===== */
.turma-info-card {
    background: var(--primary-gradient);
    color: white;
    padding: 30px 20px;
    margin-bottom: 20px;
}

.turma-top-row {
    position: relative;
    min-height: 0;
    padding-right: 184px;
    margin: 0 0 8px;
}

.btn-turma-chamada {
    --btn-chamada-scale: 1.05;
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: calc(38px * var(--btn-chamada-scale));
    padding: calc(8px * var(--btn-chamada-scale)) calc(14px * var(--btn-chamada-scale));
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: #ffffff;
    color: var(--primary);
    font-size: calc(14px * var(--btn-chamada-scale));
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
}

.btn-turma-chamada .icon-16 {
    font-size: calc(16px * var(--btn-chamada-scale));
}

.btn-turma-chamada:hover {
    background: #f8fbff;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.28);
    transform: translateY(-1px);
}

.btn-turma-chamada:active {
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.22);
    transform: translateY(0);
}

.turma-escola-detalhe {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.86);
    opacity: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.turma-info-card h2 {
    font-size: 24px;
    line-height: 1.15;
    margin: 0 0 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.turma-headline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.95;
}

.turma-info-card p {
    opacity: 0.9;
    margin: 0 0 10px;
}

#turma-descricao-detalhe {
    line-height: 1.25;
    margin-bottom: 8px;
}

.turma-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    margin-bottom: 20px;
}

.turma-stats strong {
    font-size: 18px;
}

.turma-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.turma-action-btn {
    min-height: 36px;
    padding: 8px 14px;
    font-size: 14px;
    min-width: 190px;
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.turma-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.65);
    color: #ffffff;
}

.turma-footer-row {
    margin-top: 16px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.turma-segundo-horario-toggle {
    margin: 0;
    min-width: 0;
    max-width: 420px;
    padding: 12px;
}

.turma-segundo-horario-toggle .toggle-field-title {
    font-size: 16px;
}

#segundo-horario-status-detalhe {
    color: var(--gray-700);
    font-weight: 600;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 72px;
    z-index: 90;
}

.tab-btn {
    flex: 1;
    padding: 16px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== SECTION HEADER ===== */
.section-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h3 {
    font-size: 18px;
    color: var(--dark);
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.alunos-context-row {
    margin: 0 20px 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.alunos-context-row-wrap {
    position: sticky;
    top: 126px;
    z-index: 95;
    padding-top: 2px;
    background: var(--gray-100);
}

.alunos-politica-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 4px 6px;
    border-radius: 999px;
    border: 1px solid #dbe3ef;
    background: #f8fbff;
    color: #1f355d;
}

.alunos-politica-control label {
    font-size: 12px;
    font-weight: 600;
    color: #1f355d;
}

.alunos-politica-control select {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    min-height: 28px;
    padding: 4px 28px 4px 10px;
    outline: none;
}

.alunos-politica-control select:disabled {
    opacity: 0.7;
}

.alunos-reordenacao-toolbar {
    padding: 0 20px 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.alunos-acoes-row {
    padding: 12px 20px 4px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.alunos-acoes-row .btn {
    width: 100%;
}

#btn-alunos-reordenar {
    min-height: 34px;
    padding: 8px 14px;
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #334155;
}

#btn-alunos-reordenar:hover {
    background: #eef2f7;
    border-color: #94a3b8;
}

#btn-alunos-reordenar:disabled {
    opacity: 0.65;
}

@media (max-width: 420px) {
    .alunos-context-row-wrap {
        top: 118px;
    }
}

.modal-importacao-alunos-content {
    max-height: 85vh;
    overflow: hidden;
}

.modal-importacao-alunos-content .modal-body {
    overflow-y: auto;
}

/* ===== ALUNOS LIST ===== */
.alunos-list {
    padding: 0 20px 56px;
}

.aluno-card {
    background: #ffffff;
    padding: 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid #e5e7eb;
}

.aluno-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.aluno-info {
    flex: 1;
}

.aluno-info h4 {
    font-size: 16px;
    color: var(--dark);
    margin-bottom: 4px;
}

.aluno-info p {
    font-size: 13px;
    color: #6b7280;
}

.aluno-actions {
    display: flex;
    gap: 8px;
}

.aluno-card.reorder-enabled {
    border-color: #bfdbfe;
}

.aluno-card.dragging {
    border-color: var(--primary);
    box-shadow: 0 10px 22px rgba(33, 47, 82, 0.22);
    transform: scale(1.01);
}

.btn-drag-aluno {
    border-color: #cbd5e1;
    color: #475569;
    background: #f8fafc;
    touch-action: none;
}

.btn-drag-aluno.drag-armed {
    background: #dbeafe;
    border-color: #93c5fd;
}

.drag-handle-bars {
    width: 14px;
    height: 14px;
    display: inline-block;
    background:
        radial-gradient(circle, currentColor 1.4px, transparent 1.6px) 0 0 / 7px 7px;
    opacity: 0.9;
}

.btn-icon-sm {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-200);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

.btn-icon-sm:hover {
    background: var(--gray-300);
}

.btn-deletar-aluno.holding {
    background: #fecaca;
    color: #b91c1c;
    transform: scale(0.94);
}

.aluno-pontos-section {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}

.aluno-pontos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.aluno-pontos-header h4 {
    font-size: 16px;
    color: var(--dark);
}

.aluno-pontos-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.aluno-pontos-total {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
}

.lista-eventos-pontos {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.evento-ponto-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    background: var(--white);
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.evento-ponto-principal {
    min-width: 0;
}

.evento-ponto-titulo {
    font-size: 14px;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.evento-ponto-valor {
    font-weight: 700;
    color: var(--success);
    margin-right: 8px;
}

.evento-ponto-meta {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.evento-ponto-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ===== HISTÃƒÆ’Ã¢â‚¬Å“RICO LIST ===== */
.historico-list {
    padding: 0 20px 100px;
}

.historico-card {
    background: #ffffff;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid #e5e7eb;
}

.historico-card:active {
    transform: scale(0.98);
}

.historico-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.historico-header h4 {
    font-size: 16px;
    color: var(--dark);
}

.historico-badge {
    background: var(--success);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.historico-meta {
    font-size: 13px;
    color: var(--text-muted);
}

.historico-card-actions {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.historico-select-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-700);
}

.historico-select-checkbox {
    width: 16px;
    height: 16px;
}

.historico-card-select-mode {
    border-color: var(--primary-light);
    background: #f8fafc;
}

.relatorio-mensal-container {
    padding: 0 20px 16px;
}

.relatorio-mensal-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.relatorio-mensal-controls label {
    font-weight: 600;
}

.relatorio-mensal-controls .btn {
    min-height: 40px;
}

.relatorio-mensal-controls input[type="month"] {
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
}

.relatorio-mensal-tabela-wrap {
    overflow: auto;
    max-height: 55vh;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
}

.relatorio-horario-section {
    min-width: max-content;
}

.relatorio-horario-section + .relatorio-horario-section {
    margin-top: 16px;
    border-top: 1px dashed var(--gray-300);
    padding-top: 16px;
}

.relatorio-horario-section h4 {
    padding: 10px 12px 0;
    color: var(--gray-700);
    font-size: 14px;
}

.table-relatorio-mensal {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-relatorio-mensal th,
.table-relatorio-mensal td {
    border: 1px solid var(--gray-200);
    padding: 6px 8px;
    text-align: center;
    white-space: nowrap;
}

.table-relatorio-mensal th:first-child,
.table-relatorio-mensal td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
}

.table-relatorio-mensal thead th {
    background: var(--gray-100);
    position: sticky;
    top: 0;
    z-index: 2;
}

.table-relatorio-mensal thead th:first-child {
    z-index: 3;
}

.cell-status-P {
    background: #dff5e3;
    color: #1e4620;
    font-weight: 600;
    text-align: center;
}

.cell-status-F {
    background: #fde2e1;
    color: #611a15;
    font-weight: 600;
    text-align: center;
}

/* ===== DIÃƒÆ’Ã‚ÂRIO DE CLASSE ===== */
.diario-classe-section {
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.diario-historico-header {
    margin-top: 10px;
    padding-top: 10px;
    padding-bottom: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.diario-historico-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.diario-historico-actions .btn {
    width: 100%;
    justify-content: center;
}

.diario-historico-header h3 {
    margin: 0;
    text-align: center;
}

@media (max-width: 768px) {
    .diario-historico-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.diario-resumo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    padding: 0 20px 8px;
}

.diario-resumo-cards[hidden] {
    display: none;
}

.diario-resumo-card {
    background: var(--gray-50, #f9fafb);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    padding: 8px 10px;
}

.diario-resumo-card-nome {
    font-size: 12px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.diario-resumo-card-stats {
    display: flex;
    gap: 5px;
    font-size: 11px;
    flex-wrap: wrap;
}

.diario-resumo-card-stats .stat-p {
    color: #1e4620;
    background: #dff5e3;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
}

.diario-resumo-card-stats .stat-f {
    color: #611a15;
    background: #fde2e1;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
}

.diario-resumo-card-stats .stat-pct {
    font-weight: 700;
    color: var(--dark);
}

.diario-resumo-card-stats .stat-pct.freq-ok {
    color: #1e6620;
}

.diario-resumo-card-stats .stat-pct.freq-low {
    color: #b91c1c;
}

.diario-tabela-toggle {
    padding: 4px 20px 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== SCANNER ===== */
.scanner-info {
    padding: 20px;
}

.chamada-info-card {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.chamada-info-card h3 {
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 8px;
}

.chamada-info-card p {
    color: var(--gray-600);
    font-size: 14px;
    margin-bottom: 16px;
}

.presencas-counter {
    background: var(--primary-gradient);
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
}

.counter-value {
    font-size: 32px;
    font-weight: 700;
}

.scanner-reader-wrap {
    position: relative;
    width: calc(100% - 40px);
    max-width: 500px;
    margin: 20px auto 12px;
}

.qr-reader {
    width: 100%;
    margin: 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.feedback {
    text-align: center;
    padding: 12px 16px;
    margin: 0;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 17px;
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: slideIn 0.3s ease-out;
    position: absolute;
    z-index: 20;
    left: 12px;
    right: 12px;
    top: 12px;
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.feedback:empty {
    display: none;
}

.feedback-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.feedback-text {
    line-height: 1.2;
    font-size: 22px;
    font-weight: 700;
}

.feedback-avatar {
    width: 84px;
    height: 84px;
    min-width: 84px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    border: 4px solid transparent;
    overflow: hidden;
}

.feedback-avatar.success {
    border-color: var(--success);
}

.feedback-avatar.warning {
    border-color: var(--warning);
}

.feedback-avatar.error {
    border-color: var(--danger);
}

.feedback-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Scanner Pulse Animation */
@keyframes pulseGreen {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
        border-color: var(--success);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
        border-color: var(--success);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
        border-color: transparent;
    }
}

@keyframes pulseRed {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 83, 80, 0.7);
        border-color: var(--danger);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(239, 83, 80, 0);
        border-color: var(--danger);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 83, 80, 0);
        border-color: transparent;
    }
}

.qr-reader {
    transition: box-shadow 0.3s, border-color 0.3s;
    border: 4px solid transparent;
}

.pulse-success {
    animation: pulseGreen 1s ease-out;
}

.pulse-error {
    animation: pulseRed 1s ease-out;
}

.feedback.success {
    background: rgba(102, 187, 106, 0.1);
    color: var(--success);
    border: 2px solid var(--success);
}

.feedback.warning {
    background: rgba(255, 167, 38, 0.1);
    color: var(--warning);
    border: 2px solid var(--warning);
}

.feedback.error {
    background: rgba(239, 83, 80, 0.1);
    color: var(--danger);
    border: 2px solid var(--danger);
}

.scanner-controls {
    display: flex;
    gap: 12px;
    padding: 20px;
    justify-content: center;
}

.presencas-live-list {
    padding: 12px 20px 20px;
    max-height: 230px;
    overflow-y: auto;
}

.presencas-live-list h4 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--dark);
}

.presenca-item {
    background: white;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

.presenca-item-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--success);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.presenca-item-icon-photo {
    background: #fff;
    border: 2px solid var(--success);
    overflow: hidden;
}

.presenca-item-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.presenca-item-info h5 {
    font-size: 15px;
    color: var(--dark);
    margin-bottom: 2px;
}

.presenca-item-info small {
    font-size: 12px;
    color: var(--gray-600);
}

.camera-status {
    text-align: center;
    padding: 12px;
    font-size: 13px;
    color: var(--gray-600);
    background: var(--gray-200);
    margin: 20px;
    border-radius: var(--border-radius-sm);
}

@media (max-width: 600px) {
    .feedback {
        min-height: 72px;
        font-size: 15px;
        left: 10px;
        right: 10px;
        top: 10px;
    }

    .feedback-avatar {
        width: 68px;
        height: 68px;
        min-width: 68px;
        font-size: 20px;
    }
}

/* ===== RESUMO ===== */
.resumo-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--success) 0%, #4CAF50 100%);
    color: white;
}

.resumo-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 20px;
}

.resumo-header h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.resumo-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px;
}

.stat-large {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-large .stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
}

.resumo-lista {
    padding: 20px;
}

.resumo-lista h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--dark);
}

.resumo-lista-item {
    background: white;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}

.resumo-actions {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== CONFIGURAÃƒÆ’Ã¢â‚¬Â¡ÃƒÆ’Ã¢â‚¬Â¢ES ===== */
.config-section {
    background: white;
    margin: 20px;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid #d9e3ee;
}

.config-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--dark);
}

.config-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-200);
}

.config-item:last-child {
    border-bottom: none;
}

.config-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 16px;
}

.config-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.config-item select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    margin-top: 8px;
}

.config-profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.config-profile-actions .btn {
    min-width: 140px;
}

.text-muted {
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    /* Slate profundo semi-transparente */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border: 1px solid #d7e1ec;
    border-radius: var(--border-radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-dialog-compact {
    max-width: 420px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 20px;
    color: var(--dark);
}

.btn-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 28px;
    color: var(--gray-600);
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
}

.btn-close:hover {
    background: var(--gray-200);
}

.modal-body {
    padding: 20px;
}

.modal-helper-text {
    color: var(--gray-600);
    margin-bottom: 16px;
    line-height: 1.45;
    white-space: pre-line;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.modal-choice-options {
    display: grid;
    gap: 12px;
}

.modal-choice-options .btn {
    justify-content: flex-start;
    text-align: left;
    min-height: 52px;
}

.toggle-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    background: var(--gray-100);
    cursor: pointer;
}

.toggle-field-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-field-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
}

.toggle-field-copy .text-muted {
    margin: 0;
    line-height: 1.35;
}

.escolas-contexto-group {
    margin-bottom: 24px;
}

.modal-section-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray-500);
    margin: 0 0 12px;
}

.modal-section-title--list {
    margin-top: 28px;
}

.about-section {
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--gray-200);
}

.about-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.about-section p + p {
    margin-top: 10px;
}

.about-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.about-actions--footer {
    margin-top: 8px;
    justify-content: center;
}

.toggle-switch {
    position: relative;
    flex-shrink: 0;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-slider {
    display: inline-block;
    width: 56px;
    height: 32px;
    border-radius: 999px;
    background: var(--gray-300);
    transition: var(--transition);
    position: relative;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    top: 4px;
    left: 4px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-switch input:focus-visible + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* ===== MODAL MENU ===== */
.modal-menu-content {
    position: fixed;
    right: 20px;
    top: 70px;
    max-width: 300px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-item {
    width: 100%;
    padding: 14px 16px;
    min-height: 52px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    cursor: pointer;
    font-size: 16px;
    text-align: left;
    transition: var(--transition);
    border-radius: var(--border-radius-sm);
}

.menu-item span:last-child {
    flex: 1;
    text-align: left;
}

.menu-item:hover {
    background: var(--gray-100);
}

.menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    width: 24px;
    height: 24px;
}

.icon-svg {
    width: 1em;
    height: 1em;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

.icon-14 {
    font-size: 14px;
}

.icon-16 {
    font-size: 16px;
}

.icon-20 {
    font-size: 20px;
}

.icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-right: 6px;
    color: currentColor;
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: var(--dark);
    color: white;
    padding: 16px 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    animation: toastIn 0.3s ease-out;
    pointer-events: auto;
    max-width: 400px;
    font-size: 15px;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .stats-row {
        gap: 8px;
    }

    .stat-value {
        font-size: 24px;
    }

    .action-buttons {
        width: 100%;
    }

    .action-buttons .btn {
        flex: 1;
    }

    .modal-content {
        margin: 0;
        border-radius: var(--border-radius);
    }

    .btn-turma-chamada {
        position: absolute;
        top: 0;
        right: 0;
        min-height: calc(36px * var(--btn-chamada-scale));
        padding: calc(8px * var(--btn-chamada-scale)) calc(12px * var(--btn-chamada-scale));
        font-size: calc(13px * var(--btn-chamada-scale));
    }

    .turma-footer-row {
        flex-direction: column;
        align-items: stretch;
    }

    .turma-segundo-horario-toggle {
        min-width: 0;
        max-width: none;
    }

    .turma-actions {
        align-items: stretch;
    }

    .turma-action-btn {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .resumo-stats {
        grid-template-columns: 1fr;
    }

    .toggle-field {
        align-items: flex-start;
    }

    .toggle-switch {
        align-self: flex-end;
    }
}

/* ===== UTILITIES ===== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}


/* ===== MULTI-ESCOLA STYLES ===== */

/* Badge de Escola nos Cards de Turma */
.escola-badge {
    display: inline-block;
    background: var(--primary-gradient);
    color: white;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(33, 47, 82, 0.3);
}

/* Badge "PadrÃƒÆ’Ã‚Â£o" no gerenciamento */
.badge-default {
    display: inline-block;
    background: var(--gray-200);
    color: var(--gray-700);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* Filtro de Escola */
.filter-container {
    padding: 16px 20px;
    background: white;
    border-radius: var(--border-radius);
    margin: 0 20px 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.filter-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.filter-container select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    background: white;
    color: var(--gray-800);
    cursor: pointer;
    transition: var(--transition);
}

.filter-container select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(33, 47, 82, 0.15);
}

/* Lista de Escolas (Modal Gerenciar) */
.escolas-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 350px;
    overflow-y: auto;
}

.escola-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    border: 1px solid var(--gray-200);
    cursor: pointer;
}

.escola-item:hover {
    background: white;
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.escola-item:active {
    transform: scale(0.995);
}

.escola-item-info {
    flex: 1;
    font-size: 15px;
    margin-left: 12px;
}

.escola-item-info strong {
    color: var(--dark);
}

.escola-item-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.count-badge {
    font-size: 11px;
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 500;
}

.count-badge.empty {
    opacity: 0.6;
}

.escola-item-info .text-muted {
    font-size: 13px;
    color: var(--gray-600);
}

.escola-item-actions {
    display: flex;
    gap: 6px;
}

.escola-item-actions .btn-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
}

.escola-item-actions .btn-icon:hover {
    background: var(--gray-200);
    transform: scale(1.05);
}

.escola-item-actions .btn-icon.holding {
    background: #fecaca;
    color: #b91c1c;
    transform: scale(0.94);
}

.importacao-alunos-card {
    margin: 0 20px 14px;
    padding: 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    background: var(--gray-100);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.importacao-alunos-head h4 {
    margin: 0 0 4px;
    font-size: 15px;
    color: var(--dark);
}

.importacao-alunos-head p {
    margin: 0;
    font-size: 13px;
    color: var(--gray-600);
}

.importacao-alunos-btn {
    align-self: flex-start;
}

.importacao-alunos-apoio {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.importacao-alunos-apoio a {
    font-size: 13px;
    color: var(--primary);
    text-decoration: underline;
    width: fit-content;
}

.importacao-alunos-hint {
    font-size: 12px;
    color: var(--gray-500);
}

.gerenciar-qrcodes-card {
    margin: 0 0 10px;
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    background: var(--gray-100);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gerenciar-qrcodes-head h4 {
    margin: 0 0 3px;
    font-size: 15px;
    color: var(--dark);
}

.gerenciar-qrcodes-head p {
    margin: 0;
    font-size: 13px;
    color: var(--gray-600);
}

.gerenciar-qrcodes-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== MOBILE EMPTY STATE SPACING FIX ===== */
@media (max-width: 600px) {

    .turmas-list,
    .alunos-list {
        padding-bottom: 56px !important;
    }

    .empty-state {
        padding: 12px 20px !important;
    }
}


/* BotÃƒÆ’Ã‚Â£o Adicionar Turma: pill centralizado, largura total */
.adicionar-turma-wrapper {
    padding: 0 20px 4px;
}

.btn-adicionar-turma {
    width: 100%;
    border-radius: 50px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 700;
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 40%),
        var(--primary-gradient);
    color: #ffffff;
    border: 1px solid var(--primary-line);
    box-shadow: 0 10px 22px var(--primary-shadow);
    cursor: pointer;
    transition: var(--transition);
    display: block;
    text-align: center;
    letter-spacing: 0.02em;
}

.btn-adicionar-turma:hover {
    box-shadow: 0 6px 18px rgba(33, 47, 82, 0.5);
    transform: translateY(-1px);
}

.btn-adicionar-turma:active {
    transform: scale(0.98);
}

/* ===== MODAL RELATÃƒÆ’Ã¢â‚¬Å“RIOS ===== */
.modal-relatorios-content {
    max-width: 800px;
}

.modal-gerenciar-turmas-content {
    max-width: 760px;
}

.gerenciar-turmas-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.gerenciar-turmas-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 52vh;
    overflow-y: auto;
}

.gerenciar-turma-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    background: #fff;
    padding: 12px;
}

.gerenciar-turma-card-select {
    border-color: var(--primary-light);
}

.gerenciar-turma-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.gerenciar-turma-card-head strong {
    display: block;
    color: var(--dark);
}

.gerenciar-turma-card-head small {
    color: var(--gray-600);
}

.gerenciar-turma-select {
    font-size: 13px;
    color: var(--gray-700);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gerenciar-turma-meta {
    margin-top: 6px;
    font-size: 13px;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.gerenciar-turma-meta .meta-dot {
    color: var(--gray-400);
    margin: 0 2px;
}

.gerenciar-turma-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.relatorio-secao {
    margin-bottom: 4px;
}

.relatorio-secao-titulo {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
}

.relatorio-secao-acoes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.relatorio-pontos-preview {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    font-size: 13px;
    color: var(--gray-600);
    min-height: 40px;
}

/* ===== FOTO DA ESCOLA ===== */
.escola-foto-add-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.escola-foto-preview-mini {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-sm);
    border: 2px dashed var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    overflow: hidden;
    background: var(--gray-100);
    flex-shrink: 0;
    transition: var(--transition);
}

.escola-foto-preview-mini:hover {
    border-color: var(--primary);
    background: var(--white);
}

.escola-foto-preview-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--border-radius-sm) - 2px);
}

.escola-item-logo {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--gray-200);
    flex-shrink: 0;
}

/* ===== ALUNO CARD HOVER (clicÃƒÆ’Ã‚Â¡vel para editar) ===== */
.aluno-card {
    transition: var(--transition);
}

.aluno-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.aluno-card:active {
    transform: scale(0.98);
}

/* ===== BTN-BACK (seta voltar) ===== */
.btn-back {
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-back svg {
    display: block;
}

.btn-back:hover {
    background: var(--primary-light);
    color: var(--white);
    border-radius: 50%;
}

/* ===== OBSERVAÃƒÆ’Ã¢â‚¬Â¡ÃƒÆ’Ã¢â‚¬Â¢ES ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â toggle olho ===== */
.obs-label-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.obs-label-row label {
    margin-bottom: 0;
    flex: 1;
}

.btn-obs-eye {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    color: var(--gray-500);
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-obs-eye:hover {
    background: var(--gray-200);
    color: var(--dark);
}

.btn-obs-eye.obs-eye-oculta {
    color: var(--warning);
    background: rgba(255, 167, 38, 0.12);
}

.obs-oculta-hint {
    display: block;
    font-size: 11px;
    color: var(--warning);
    margin-bottom: 4px;
    font-weight: 500;
}

.obs-privada-badge {
    font-size: 12px;
    vertical-align: middle;
    margin-left: 4px;
    opacity: 0.75;
}





.coffee-fab {
    position: fixed;
    right: 18px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 18px;
    background: var(--primary-gradient);
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 35;
}

.coffee-fab img {
    width: 30px;
    height: 30px;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(18, 42, 74, 0.20));
}

.modal-cafe-body {
    text-align: center;
}

.coffee-card-image {
    width: 100%;
    max-width: 320px;
    height: auto;
    display: block;
    margin: 0 auto 16px;
    border-radius: 22px;
    box-shadow: var(--shadow-md);
    border: 1px solid #e6d8c9;
}

.app-version-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.28);
    color: rgba(255,255,255,0.96);
    background: rgba(255,255,255,0.12);
    box-shadow: 0 8px 20px rgba(7, 34, 66, 0.14);
}

.app-version-badge--loading {
    margin: 10px auto 0;
}

.app-version-badge--header {
    margin-left: 10px;
    align-self: center;
}



@media (max-width: 560px) {
    .onboarding-header {
        padding: 30px 18px 24px;
        border-radius: 0;
    }

    .onboarding-header h1 {
        font-size: 38px;
    }

    .onboarding-highlight-card {
        text-align: center;
        padding: 18px 16px;
    }
}


@media (max-width: 560px) {
    .onboarding-header {
        padding: 30px 18px 24px;
        border-radius: 0;
    }

    .onboarding-header h1 {
        font-size: 38px;
    }
}


