﻿:root {
    --navy: #14315D;
    --teal: #0E7490;
    --teal-deep: #0b5f78;
    --green: #6ABF57;
    --green-soft: rgba(22,163,74,0.12);
    --amber-soft: rgba(245, 158, 11, 0.14);
    --bg: #edf4f8;
    --surface: rgba(255,255,255,0.92);
    --surface-strong: #ffffff;
    --text: #10213f;
    --muted: #5f6f8d;
    --border: rgba(20,49,93,0.10);
    --shadow: 0 18px 40px rgba(14, 41, 73, 0.10);
    --danger: #dc2626;
    --warning: #b45309;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; border: none; background: transparent; }

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 28px;
    border-radius: 30px;
    color: white;
    background:
        radial-gradient(circle at 82% 12%, rgba(106, 191, 87, 0.22), transparent 28%),
        linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
    box-shadow: 0 28px 60px rgba(10, 46, 90, 0.24);
}

.hero::after {
    content: '';
    position: absolute;
    inset: auto -40px -60px auto;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    filter: blur(8px);
}

.hero-top {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 28px;
}

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
}

.brand img {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: rgba(255,255,255,0.15);
    padding: 6px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    color: #dff8ff;
    font-size: 11px;
    letter-spacing: 0.08em;
    font-weight: 800;
    text-transform: uppercase;
}

.brand h1 {
    margin: 8px 0 4px;
    font-family: 'Manrope', sans-serif;
    font-size: clamp(28px, 5vw, 40px);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.brand p {
    margin: 0;
    max-width: 560px;
    color: rgba(255,255,255,0.82);
    line-height: 1.45;
    font-size: 15px;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.10);
    color: white;
    font-weight: 700;
}

.hero-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.hero-panels {
    display: grid;
    gap: 18px;
}

.card {
    border: 1px solid var(--border);
    border-radius: 26px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.login-card {
    padding: 20px;
    color: var(--text);
}

.login-card h2,
.panel-card h2,
.detail-card h2,
.classes-card h2,
.diary-card h2 {
    margin: 0 0 6px;
    font-family: 'Manrope', sans-serif;
    font-size: 24px;
    letter-spacing: -0.03em;
}

.login-card p,
.panel-head p,
.detail-head p,
.classes-head p,
.diary-head p,
.empty-state p,
.session-meta,
.metric-label,
.student-meta,
.class-meta,
.diary-note,
.diary-column,
.export-note {
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; }
.field input,
.field select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(20,49,93,0.12);
    background: white;
    outline: none;
}

.field input:focus,
.field select:focus {
    border-color: rgba(14, 116, 144, 0.55);
    box-shadow: 0 0 0 4px rgba(14, 116, 144, 0.10);
}

.btn {
    min-height: 48px;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn-primary {
    background: linear-gradient(135deg, var(--navy), var(--teal));
    color: white;
    box-shadow: 0 16px 28px rgba(14, 94, 118, 0.22);
}
.btn-secondary {
    background: white;
    color: var(--navy);
    border: 1px solid rgba(20,49,93,0.12);
}
.btn-inline {
    min-height: 34px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 8px;
}
.btn-inline.btn-primary {
    box-shadow: 0 4px 12px rgba(14,94,118,0.20);
}

.btn:disabled {
    transform: none;
    cursor: not-allowed;
    opacity: 0.58;
    box-shadow: none;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    font-size: 13px;
    font-weight: 700;
}

.hero-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.10);
    color: #eaf8fd;
    font-weight: 700;
    font-size: 13px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #d1d5db;
}

.status-dot.ok { background: #86efac; }
.status-dot.warn { background: #facc15; }
.status-dot.err { background: #f87171; }

.portal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 360px;
    gap: 20px;
    margin-top: 22px;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
    margin-top: 22px;
    align-items: start;
}

.panel-card,
.detail-card,
.classes-card,
.diary-card {
    padding: 20px;
}

.panel-head,
.detail-head,
.classes-head,
.diary-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 14px;
    margin-bottom: 18px;
}

.diary-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 4px 10px;
    background: rgba(20, 49, 93, 0.06);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--navy);
}

.toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.metric {
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(20,49,93,0.08);
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(238,247,250,0.92));
}

.metric strong {
    display: block;
    margin-bottom: 4px;
    font-size: 28px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: var(--text);
}

.metric-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sessions,
.classes-list,
.diary-students {
    display: grid;
    gap: 12px;
}

.session-item,
.class-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid rgba(20,49,93,0.08);
    background: white;
}

.class-item.active {
    background: linear-gradient(135deg, rgba(20,49,93,0.96), rgba(14,116,144,0.92));
    color: white;
    box-shadow: 0 16px 28px rgba(20, 49, 93, 0.20);
}

.class-item.active .class-meta,
.class-item.active .session-meta,
.class-item.active .class-chip,
.class-item.active .summary-chip {
    color: rgba(255,255,255,0.86);
}

.session-title-row,
.class-title-row {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: flex-start;
}

.session-item h3,
.class-item h3 {
    margin: 0 0 4px;
    font-size: 18px;
    line-height: 1.1;
}

.session-chip,
.class-chip,
.summary-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(14, 116, 144, 0.10);
    color: var(--teal-deep);
    font-size: 12px;
    font-weight: 800;
}

.class-item.active .class-chip,
.class-item.active .summary-chip {
    background: rgba(255,255,255,0.14);
    color: white;
}

.session-meta,
.class-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    font-size: 13px;
}

.session-actions,
.class-actions,
.diary-actions {
    display: grid;
    gap: 8px;
    min-width: 132px;
}

.detail-card,
.diary-card {
    min-height: 580px;
}

.classes-card {
    position: sticky;
    top: 22px;
    align-self: start;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 260px;
    text-align: center;
    padding: 20px;
    border: 1px dashed rgba(20,49,93,0.14);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(241,247,250,0.86));
}

.detail-summary,
.diary-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.detail-box,
.summary-box {
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(239,246,249,0.90));
    border: 1px solid rgba(20,49,93,0.08);
}

.detail-box strong,
.summary-box strong {
    display: block;
    margin-bottom: 3px;
    font-size: 22px;
    line-height: 1;
}

.students {
    display: grid;
    gap: 10px;
}

.student-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 18px;
    background: white;
    border: 1px solid rgba(20,49,93,0.07);
}

.student-row.present { background: linear-gradient(135deg, rgba(236, 253, 245, 0.98), rgba(255,255,255,0.98)); }
.student-row.absent { background: linear-gradient(135deg, rgba(254, 242, 242, 0.98), rgba(255,255,255,0.98)); }

.student-row h4,
.diary-student-card h4 {
    margin: 0 0 4px;
    font-size: 15px;
}

.student-meta,
.diary-student-card p {
    font-size: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.badge.present { background: rgba(22, 163, 74, 0.12); color: #166534; }
.badge.absent { background: rgba(220, 38, 38, 0.10); color: #991b1b; }

.diary-controls {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.diary-card {
    overflow: hidden;
}

.diary-card.flash-focus {
    box-shadow: 0 0 0 4px rgba(14, 116, 144, 0.14), var(--shadow);
    transition: box-shadow 0.28s ease;
}

.diary-month-field {
    flex: 0 0 auto;
}

.month-input-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.month-input-wrap input[type="month"] {
    padding-right: 36px;
    min-width: 148px;
}

.month-cal-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 6px;
    transition: color 0.15s;
}

.month-cal-btn:hover {
    color: var(--teal);
}

.month-picker-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 300;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.13);
    padding: 14px;
    min-width: 220px;
    user-select: none;
}

.mp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.mp-year {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}

.mp-nav {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}

.mp-nav:hover {
    background: var(--teal-light, rgba(14,116,144,0.08));
    color: var(--teal);
}

.mp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.mp-month {
    background: none;
    border: 1.5px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    padding: 7px 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    text-align: center;
}

.mp-month:hover {
    background: var(--teal-light, rgba(14,116,144,0.08));
    border-color: var(--teal);
    color: var(--teal);
}

.mp-month.active {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
}

.diary-class-field {
    flex: 1;
    min-width: 180px;
}

.diary-class-field select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6f8d' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 34px;
}
.diary-class-field select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(14,116,144,0.12);
}

.diary-selected {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(20,49,93,0.08);
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(239,246,249,0.90));
}

.diary-selected strong {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
}

.diary-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(20,49,93,0.08);
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(239,246,249,0.90));
}

.diary-toolbar-copy {
    max-width: 540px;
}

.diary-toolbar-copy strong {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
}

.diary-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.reports-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 23, 44, 0.44);
    backdrop-filter: blur(8px);
    z-index: 90;
}

.reports-modal.show {
    display: flex;
}

.reports-modal-card {
    width: min(760px, 100%);
    border-radius: 28px;
    border: 1px solid rgba(20,49,93,0.10);
    background: rgba(255,255,255,0.98);
    box-shadow: 0 28px 60px rgba(10, 46, 90, 0.24);
    overflow: hidden;
}

.reports-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    border-bottom: 1px solid rgba(20,49,93,0.08);
}

.reports-modal-head h3 {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    font-size: 28px;
    letter-spacing: -0.03em;
}

.reports-modal-close {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(20,49,93,0.12);
    border-radius: 14px;
    background: white;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
}

.reports-modal-body {
    padding: 24px;
    display: grid;
    gap: 20px;
}

.report-section {
    display: grid;
    gap: 12px;
    padding: 18px 20px;
    border-radius: 22px;
    border: 1px solid rgba(20,49,93,0.08);
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(239,246,249,0.90));
}

.report-section h4 {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    font-size: 22px;
    letter-spacing: -0.02em;
}

.report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.report-preview {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.78);
    border: 1px solid rgba(20,49,93,0.08);
    color: var(--muted);
    font-size: 14px;
}

.summary-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.summary-chip.ok { background: var(--green-soft); color: #166534; }
.summary-chip.warn { background: var(--amber-soft); color: #92400e; }

.diary-students {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.diary-student-card {
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(20,49,93,0.08);
    background: white;
}

.table-wrap {
    overflow: auto;
    border: 1px solid rgba(20,49,93,0.08);
    border-radius: 22px;
    background: white;
}

.diary-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
}

.diary-table th,
.diary-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(20,49,93,0.08);
    border-right: 1px solid rgba(20,49,93,0.06);
    text-align: center;
    font-size: 14px;
    white-space: nowrap;
}

.diary-table th:first-child,
.diary-table td:first-child,
.diary-table th:nth-child(2),
.diary-table td:nth-child(2) {
    text-align: left;
    position: sticky;
    background: white;
    z-index: 2;
}

.diary-table th:first-child,
.diary-table td:first-child { left: 0; min-width: 58px; }
.diary-table th:nth-child(2),
.diary-table td:nth-child(2) { left: 58px; min-width: 220px; }

.diary-table th {
    position: sticky;
    top: 0;
    background: #f5fafc;
    z-index: 3;
    font-weight: 800;
}

.diary-table td.present-cell {
    background: rgba(22,163,74,0.08);
    color: #166534;
    font-weight: 800;
}

.diary-table td.absent-cell {
    background: rgba(220,38,38,0.08);
    color: #991b1b;
    font-weight: 800;
}

.message {
    display: none;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
}

.message.show { display: block; }
.message.info { background: rgba(14,116,144,0.10); color: var(--teal-deep); }
.message.error { background: rgba(220,38,38,0.10); color: #991b1b; }
.message.success { background: rgba(22,163,74,0.10); color: #166534; }

.hidden { display: none !important; }

.export-note {
    font-size: 13px;
    margin-top: 8px;
}

@media (max-width: 1100px) {
    .portal-grid,
    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .detail-card,
    .diary-card { min-height: 0; }
}

@media (max-width: 860px) {
    .diary-students { grid-template-columns: 1fr 1fr; }
    .diary-controls { flex-direction: column; align-items: stretch; }
    .diary-month-field { flex: none; }
    .diary-class-field { min-width: unset; }
    .diary-actions { min-width: 0; grid-template-columns: 1fr 1fr; }
    .diary-toolbar {
        display: grid;
        grid-template-columns: 1fr;
        align-items: start;
    }
    .diary-toolbar-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .page { width: min(100% - 20px, 1180px); }
    .hero { padding: 20px; border-radius: 24px; }
    .hero-top,
    .panel-head,
    .detail-head,
    .classes-head,
    .diary-head,
    .session-item,
    .class-item,
    .session-title-row,
    .class-title-row {
        grid-template-columns: 1fr;
        display: grid;
    }
    .toolbar,
    .metrics,
    .detail-summary,
    .diary-summary {
        grid-template-columns: 1fr 1fr;
    }
    .session-actions,
    .class-actions,
    .diary-actions { min-width: 0; }
    .diary-students { grid-template-columns: 1fr; }
    .classes-card {
        position: static;
    }
}

@media (max-width: 520px) {
    .toolbar,
    .metrics,
    .detail-summary,
    .diary-summary {
        grid-template-columns: 1fr;
    }
    .student-row {
        align-items: flex-start;
        flex-direction: column;
    }
    .report-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

/* â”€â”€ APP-STYLE HEADER â”€â”€ */
.app-top {
    position: sticky;
    top: 0;
    z-index: 50;
}

.app-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
    color: white;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px 10px;
    max-width: 1180px;
    margin: 0 auto;
    gap: 16px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,0.14);
    border: 2px solid rgba(255,255,255,0.20);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.header-info strong {
    display: block;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.header-info span {
    font-size: 12px;
    opacity: 0.72;
    letter-spacing: 0.03em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right .status-pill {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.16);
    color: white;
    font-size: 12px;
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* â”€â”€ STATS STRIP â”€â”€ */
.stats-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0 24px 14px;
    border-radius: 18px;
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.16);
    overflow: hidden;
    max-width: calc(1180px - 48px);
}

.stat-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    gap: 2px;
    color: white;
}

.stat-col + .stat-col {
    border-left: 1px solid rgba(255,255,255,0.14);
}

.stat-col svg { width: 22px; height: 22px; opacity: 0.80; }
.stat-col span { font-size: 10px; opacity: 0.72; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.stat-col strong { font-size: 24px; font-weight: 900; letter-spacing: -0.04em; line-height: 1; }

/* â”€â”€ TAB NAVIGATION â”€â”€ */
.tab-nav {
    background: white;
    border-bottom: 1px solid rgba(20,49,93,0.10);
    box-shadow: 0 2px 8px rgba(14,41,73,0.07);
}

.tab-nav-inner {
    display: flex;
    max-width: 1180px;
    margin: 0 auto;
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 11px 6px 9px;
    border: none;
    outline: none;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    position: relative;
    transition: color 0.16s;
    cursor: pointer;
}

.tab-btn svg {
    width: 22px;
    height: 22px;
    transition: transform 0.16s;
}

.tab-btn.active { color: var(--teal); }

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 18%; right: 18%;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--teal);
}

.tab-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* â”€â”€ TAB SECTIONS â”€â”€ */
.tab-section { display: none; }
.tab-section.active { display: block; }

/* â”€â”€ SECTION HEADER â”€â”€ */
.section-head {
    margin-bottom: 20px;
}

.section-head h2 {
    margin: 0 0 6px;
    font-family: 'Manrope', sans-serif;
    font-size: 26px;
    letter-spacing: -0.03em;
}

.section-head p { color: var(--muted); margin: 0; }

/* â”€â”€ SESSION CARD (new layout) â”€â”€ */
.session-card {
    padding: 22px;
    margin-bottom: 20px;
}

.session-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.session-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(20,49,93,0.08), rgba(14,116,144,0.10));
    border: 1px solid rgba(20,49,93,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--teal);
}

.session-card-user strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 2px;
}

.session-card-user span {
    font-size: 13px;
    color: var(--muted);
}

.session-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* â”€â”€ REPORTS TAB â”€â”€ */
.reports-class-info {
    margin-bottom: 18px;
}

.reports-modal-body {
    display: grid;
    gap: 16px;
}

/* â”€â”€ CHAMADAS TAB specifics â”€â”€ */
.panel-stack {
    display: grid;
    gap: 20px;
}

.detail-panel {
    border: 1px solid var(--border);
    border-radius: 26px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    padding: 20px;
}

/* â”€â”€ PAGE adjustments â”€â”€ */
.page {
    padding-top: 28px;
}

/* â”€â”€ RESPONSIVE for new elements â”€â”€ */
@media (max-width: 720px) {
    .header-inner { padding: 12px 16px 8px; }
    .stats-strip { margin: 0 16px 12px; }
    .tab-btn { font-size: 10px; padding: 10px 4px 8px; }
    .tab-btn svg { width: 20px; height: 20px; }
    .header-right .status-pill { display: none; }
}

@media (max-width: 480px) {
    .tab-btn span { display: none; }
    .tab-btn { padding: 12px 6px; }
}

/* === Portal Professor 2026-05-14 desktop app redesign === */
.portal-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
    background: linear-gradient(180deg, #eef5f8 0%, #e7f0f5 100%);
}

.portal-sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    min-height: 100vh;
    padding: 22px 18px;
    background: linear-gradient(180deg, rgba(20,49,93,0.98) 0%, rgba(15,91,118,0.96) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-brand {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.sidebar-brand img {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    padding: 6px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
}

.sidebar-brand strong {
    display: block;
    margin: 8px 0 6px;
    font-family: 'Manrope', sans-serif;
    font-size: 18px;
    letter-spacing: -0.03em;
}

.sidebar-brand p {
    margin: 0;
    color: rgba(255,255,255,0.74);
    font-size: 13px;
    line-height: 1.45;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.sidebar-nav .tab-btn {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 14px;
    border-radius: 16px;
    color: rgba(255,255,255,0.72);
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
}

.sidebar-nav .tab-btn svg {
    width: 20px;
    height: 20px;
}

.sidebar-nav .tab-btn.active {
    background: rgba(255,255,255,0.12);
    color: white;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}

.sidebar-nav .tab-btn.active::after {
    display: none;
}

.sidebar-nav .tab-btn:disabled {
    opacity: 0.35;
}

.sidebar-card {
    background: rgba(255,255,255,0.96);
    border-radius: 22px;
    box-shadow: 0 16px 32px rgba(4, 20, 37, 0.18);
}

.sidebar-eyebrow {
    background: rgba(14,116,144,0.10) !important;
    color: var(--teal-deep) !important;
}

.portal-main {
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
}

.app-header-compact {
    box-shadow: 0 10px 24px rgba(8, 31, 57, 0.12);
}

.app-header-compact .header-inner {
    max-width: none;
    padding: 18px 24px;
}

.header-user.compact {
    gap: 0;
}

.header-user.compact .header-info strong {
    margin: 0 0 4px;
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.04em;
}

.header-user.compact .header-info > span:last-child {
    display: block;
    max-width: 560px;
    color: rgba(255,255,255,0.82);
    font-size: 15px;
    line-height: 1.4;
    letter-spacing: 0;
}

.portal-page {
    width: min(1440px, calc(100% - 40px));
    padding: 28px 0 56px;
}

.section-head-spaced {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
}

.section-head.compact h3 {
    margin: 0 0 6px;
    font-family: 'Manrope', sans-serif;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.section-head.compact p {
    margin: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.dashboard-card {
    padding: 16px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.dashboard-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(20,49,93,0.08), rgba(14,116,144,0.10));
    border: 1px solid rgba(20,49,93,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--teal);
    margin-bottom: 10px;
}

.dashboard-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.metric-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(20,49,93,0.08), rgba(14,116,144,0.10));
    border: 1px solid rgba(20,49,93,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--teal);
    margin-bottom: 12px;
    flex-shrink: 0;
}

.metric-icon svg {
    width: 26px;
    height: 26px;
    display: block;
}

.dashboard-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dashboard-card strong {
    display: block;
    margin-top: 4px;
    font-family: 'Manrope', sans-serif;
    font-size: 26px;
    letter-spacing: -0.04em;
    line-height: 1;
}

.cloud-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.cloud-value.cloud-value-text {
    font-size: 18px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-transform: none;
}

.cloud-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,248,250,.92));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.cloud-panel h3 {
    margin: 0 0 6px;
    font-family: 'Manrope', sans-serif;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.cloud-school-table-wrap {
    margin-top: 20px;
}

.cloud-school-table-wrap h3 {
    font-family: 'Manrope', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 12px;
    color: var(--navy);
}

.cloud-school-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.cloud-school-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--navy);
    color: #fff;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cloud-school-table th:first-child { border-radius: 8px 0 0 8px; }
.cloud-school-table th:last-child  { border-radius: 0 8px 8px 0; }

.cloud-school-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.cloud-school-table tr:last-child td { border-bottom: none; }
.cloud-school-table td:not(:first-child) { text-align: center; }

.cloud-note {
    margin: 0;
    color: var(--muted);
    max-width: 720px;
    line-height: 1.45;
}

.home-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.home-card {
    padding: 22px;
}

.dashboard-list {
    display: grid;
    gap: 12px;
}

.dashboard-empty {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255,255,255,0.75);
    border: 1px dashed rgba(20,49,93,0.14);
    color: var(--muted);
}

.mini-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border-radius: 18px;
    background: white;
    border: 1px solid rgba(20,49,93,0.10);
}

.mini-item strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.mini-item span {
    color: var(--muted);
    font-size: 13px;
}

.mini-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: end;
}

.mini-item.warn {
    border-color: rgba(245, 158, 11, 0.28);
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,248,235,0.92) 100%);
}

.mini-item.err {
    border-color: rgba(239, 68, 68, 0.22);
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,242,242,0.92) 100%);
}

.classes-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    align-items: stretch;
}

.class-item {
    min-height: 220px;
}

.school-card {
    grid-template-columns: minmax(0, 1fr);
    align-content: space-between;
    gap: 18px;
    min-height: 220px;
    padding: 22px;
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(243,250,252,0.94));
    box-shadow: 0 18px 36px rgba(20,49,93,0.10);
}

.school-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 42px rgba(20,49,93,0.14);
}

.school-card-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.school-card h3 {
    margin-top: 4px;
    font-size: 24px;
}

.school-card-kicker,
.class-card-kicker {
    display: inline-flex;
    color: var(--teal);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.school-card-summary {
    max-width: 260px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
}

.school-card-foot {
    padding-top: 16px;
    border-top: 1px solid rgba(20,49,93,0.08);
}

.school-card-actions {
    min-width: 0;
    justify-items: end;
}

.school-card-actions .btn-inline {
    min-width: 132px;
}

.class-card {
    min-height: 185px;
    background: rgba(255,255,255,0.94);
}

.class-card-kicker {
    margin-bottom: 8px;
}

.class-card-school {
    margin-top: 2px;
}

.class-card-meta {
    color: var(--muted);
}

.school-card.active .school-card-summary,
.school-card.active .school-card-foot,
.school-card.active .school-card-kicker,
.class-card.active .class-card-kicker,
.class-card.active .class-card-meta {
    color: rgba(255,255,255,0.86);
}

.school-card.active .school-card-foot {
    border-top-color: rgba(255,255,255,0.18);
}

.school-drilldown-head {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.school-drilldown-head strong {
    display: block;
    color: var(--navy);
    font-family: 'Manrope', sans-serif;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.school-drilldown-copy {
    max-width: 620px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.school-breadcrumb {
    display: block;
    margin-bottom: 4px;
    color: var(--teal);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.school-back {
    white-space: nowrap;
}

.report-option {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 20px 22px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.report-option h4 {
    margin: 0 0 6px;
    font-family: 'Manrope', sans-serif;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.sessions-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
    gap: 20px;
    align-items: start;
}

.detail-panel {
    position: sticky;
    top: 110px;
}

.hidden {
    display: none !important;
}

@media (max-width: 1240px) {
    .portal-layout {
        grid-template-columns: 1fr;
    }

    .portal-sidebar {
        position: static;
        min-height: auto;
    }

    .sidebar-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .sidebar-nav .tab-btn {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        min-height: 84px;
    }

    .home-columns,
    .sessions-layout {
        grid-template-columns: 1fr;
    }

    .detail-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .portal-page {
        width: min(100%, calc(100% - 24px));
        padding-top: 20px;
    }

    .app-header-compact .header-inner {
        flex-direction: column;
        align-items: start;
    }

    .header-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .header-user.compact .header-info strong {
        font-size: 24px;
    }

    .dashboard-grid,
    .classes-list {
        grid-template-columns: 1fr;
    }

    .report-option,
    .mini-item {
        flex-direction: column;
        align-items: start;
    }

    .school-drilldown-head {
        flex-direction: column;
        align-items: stretch;
    }

    .school-back {
        width: 100%;
    }

    .school-card-header {
        flex-direction: column;
    }

    .school-card-actions {
        justify-items: stretch;
    }

    .school-card-actions .btn-inline {
        width: 100%;
    }

    .mini-item-meta {
        justify-content: start;
    }

    .sidebar-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .sidebar-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
/* === 2026-05-14 mock refine: branding, footer status and bottom taskbar === */
.portal-page {
    padding-bottom: 108px;
}

.portal-sidebar {
    padding-bottom: 30px;
}

.sidebar-brand {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    align-items: start;
}

.sidebar-brand-top {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.sidebar-brand img {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    padding: 6px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
}

.sidebar-brand-subtitle {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.52);
    padding-left: 76px;
}

.sidebar-brand-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: 'Manrope', sans-serif;
    font-size: 25px;
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: -0.05em;
    color: #ffffff;
}

.sidebar-brand-title .brand-line {
    display: block;
}

.sidebar-brand-title .brand-line-bottom {
    white-space: nowrap;
}

.sidebar-brand-title .brand-accent {
    color: #8fe17f;
}

.sidebar-brand .eyebrow {
    width: fit-content;
    margin: 0;
}

.sidebar-divider {
    height: 2px;
    margin: 8px 8px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,0.46);
}

.sidebar-brand strong,
.sidebar-brand p {
    display: none;
}

.session-storage {
    display: none !important;
}

.sidebar-footer {
    margin-top: auto;
    padding: 8px 10px 12px;
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.94);
    font-size: 16px;
    font-weight: 800;
    padding-left: 12px;
}

.sidebar-status .status-dot {
    width: 10px;
    height: 10px;
    box-shadow: none;
}

.header-right .status-pill {
    display: none !important;
}

.portal-taskbar {
    position: fixed;
    left: 304px;
    right: 24px;
    bottom: 18px;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0;
    padding: 14px 24px;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(44, 77, 121, 0.96), rgba(28, 58, 100, 0.96));
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    box-shadow: 0 18px 42px rgba(11, 29, 52, 0.26), 0 4px 14px rgba(11, 29, 52, 0.16);
    backdrop-filter: blur(18px);
}

.portal-taskbar.hidden {
    display: none !important;
}

.taskbar-count,
.taskbar-summary {
    font-family: 'Manrope', sans-serif;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.taskbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-left: auto;
    flex-wrap: wrap;
}

.taskbar-summary {
    opacity: 0.95;
}

.taskbar-link {
    padding: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    background: transparent;
    border: none;
}

.taskbar-link + .taskbar-link,
.taskbar-summary + .taskbar-link {
    position: relative;
    padding-left: 18px;
}

.taskbar-link + .taskbar-link::before,
.taskbar-summary + .taskbar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 1px;
    height: 22px;
    background: rgba(255,255,255,0.28);
    transform: translateY(-50%);
}

@media (max-width: 1080px) {
    .portal-layout {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .sidebar-brand-title {
        font-size: 22px;
    }

    .taskbar-count,
    .taskbar-summary,
    .taskbar-link {
        font-size: 16px;
    }

    .portal-taskbar {
        left: 256px;
        right: 20px;
        bottom: 16px;
        padding: 12px 20px;
    }
}

@media (max-width: 860px) {
    .portal-taskbar {
        left: 16px;
        right: 16px;
        bottom: 16px;
        padding: 12px 16px;
        border-radius: 18px;
    }

    .taskbar-actions {
        gap: 14px;
    }

    .taskbar-link + .taskbar-link,
    .taskbar-summary + .taskbar-link {
        padding-left: 14px;
    }
}



@media (max-width: 980px) {
    .cloud-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cloud-panel {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 620px) {
    .cloud-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Calendário ── */
.cal-section {
    padding: 0;
    overflow: hidden;
}

.cal-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cal-nav-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 20px;
    line-height: 1;
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}
.cal-nav-btn:hover { background: var(--bg); }

.cal-period-label {
    font-weight: 600;
    font-size: 14px;
    min-width: 190px;
    text-align: center;
    color: var(--text);
}

.cal-today-btn {
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--teal);
    border: 1.5px solid var(--teal);
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.cal-today-btn:hover {
    background: var(--teal);
    color: #fff;
}
.cal-today-btn:disabled {
    color: var(--text-muted);
    border-color: var(--border);
    cursor: default;
    background: transparent;
}

.cal-sync-chip {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 10px;
    white-space: nowrap;
    flex-shrink: 0;
}
.cal-sync-chip.stale {
    color: #92400e;
    background: #fffbeb;
    border-color: #fde68a;
}

.cal-view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg);
    border-radius: 10px;
    padding: 4px;
}

.cal-view-btn {
    padding: 5px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s;
}
.cal-view-btn.active {
    background: var(--surface-strong);
    color: var(--navy);
    box-shadow: 0 1px 4px rgba(20,49,93,0.10);
}

/* semana */
.cal-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-day {
    border-right: 1px solid var(--border);
    padding: 10px 6px;
    min-height: 130px;
}
.cal-day:last-child { border-right: none; }
.cal-day-weekend { background: rgba(20,49,93,0.025); }

.cal-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    margin-bottom: 8px;
}

.cal-day-name {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
}

.cal-day-num {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.cal-day-today .cal-day-num {
    background: var(--teal);
    color: white;
}

.cal-day-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* evento */
.cal-event {
    display: block;
    width: 100%;
    text-align: left;
    padding: 5px 7px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    line-height: 1.3;
    transition: filter 0.15s;
    overflow: hidden;
}
.cal-event:hover { filter: brightness(0.92); }

.cal-event.ok  { background: var(--green-soft);               color: #15803d; }
.cal-event.warn{ background: var(--amber-soft);               color: #92400e; }
.cal-event.err { background: rgba(239,68,68,0.12);            color: #b91c1c; }

.cal-event-sub {
    display: block;
    font-size: 10px;
    font-weight: 400;
    opacity: 0.75;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* mês */
.cal-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-month-col-header {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    padding: 10px 4px;
    border-bottom: 1px solid var(--border);
}

.cal-month-cell {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 5px 5px 8px;
    min-height: 76px;
}
.cal-month-cell:nth-child(7n) { border-right: none; }
.cal-month-other { background: rgba(20,49,93,0.02); }
.cal-month-other .cal-month-day-num { opacity: 0.3; }

.cal-month-day-num {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}
.cal-day-today .cal-month-day-num {
    color: var(--teal);
    font-weight: 800;
}

.cal-event-sm {
    padding: 2px 5px;
    font-size: 10px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 5px;
}

.cal-more {
    font-size: 10px;
    color: var(--muted);
    padding: 0 3px;
}

/* filtros */
.cal-filters {
    display: flex;
    gap: 10px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    align-items: center;
}

.cal-select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    min-width: 160px;
}
.cal-select:focus { outline: 2px solid var(--teal); outline-offset: 1px; }

.cal-clear-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.cal-clear-btn:hover { background: var(--bg); color: var(--text); }
.cal-clear-btn.hidden { display: none; }

/* feriado */
.cal-day-holiday {
    background: rgba(99,102,241,0.04);
}

.cal-holiday {
    display: block;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(99,102,241,0.13);
    color: #4338ca;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}

.cal-holiday-sm {
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 5px;
    margin-bottom: 2px;
}

/* estado vazio */
.cal-empty {
    padding: 36px 24px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* modal calendário */
.cal-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,30,60,0.45);
    z-index: 500;
    align-items: center;
    justify-content: center;
}
.cal-modal.show { display: flex; }

.cal-modal-box {
    background: var(--surface-strong);
    border-radius: 20px;
    width: min(500px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 28px;
    position: relative;
    box-shadow: var(--shadow);
}

.cal-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--bg);
    border: none;
    font-size: 15px;
    cursor: pointer;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cal-modal-close:hover { background: var(--border); }

.cal-modal-head { margin-bottom: 18px; }
.cal-modal-head h3 { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.cal-modal-head p  { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

.cal-modal-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.cal-modal-loading { color: var(--muted); font-size: 14px; padding: 12px 0; }

.cal-student-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.cal-student-row:last-child { border-bottom: none; }

/* sem registro */
.cal-no-record {
    display: block;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
    color: var(--muted);
    background: rgba(20,49,93,0.05);
    border: 1px dashed rgba(20,49,93,0.15);
    text-align: center;
    cursor: default;
}

/* resumo de rotina */
.cal-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: rgba(20,49,93,0.02);
}

.cal-summary-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cal-summary-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--muted);
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
}
.cal-summary-stat strong { color: var(--text); font-size: 13px; }
.cal-summary-stat.ok strong { color: #15803d; }
.cal-summary-stat.warn strong { color: #92400e; }

.cal-summary-divider {
    width: 1px;
    height: 18px;
    background: var(--border);
    flex-shrink: 0;
}

.cal-summary-gaps {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cal-summary-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.cal-gap-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: default;
}
.cal-gap-chip.warn { background: var(--amber-soft); color: #92400e; }
.cal-gap-chip.err  { background: rgba(239,68,68,0.12); color: #b91c1c; }

.cal-gap-days {
    font-size: 10px;
    font-weight: 700;
    opacity: 0.75;
}

@media (max-width: 860px) {
    .cal-week-grid { grid-template-columns: repeat(7, minmax(52px, 1fr)); overflow-x: auto; }
    .cal-period-label { min-width: 140px; font-size: 13px; }
}
@media (max-width: 520px) {
    .cal-toolbar { padding: 10px 14px; }
    .cal-view-btn { padding: 4px 10px; }
}

/* ── Tela mínima ────────────────────────────────────────────────────────── */
.screen-too-small {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    padding: 24px;
}
.screen-too-small.hidden { display: none; }
.screen-too-small-box {
    text-align: center;
    max-width: 320px;
    color: var(--text);
}
.screen-too-small-box svg {
    color: var(--teal);
    margin-bottom: 16px;
}
.screen-too-small-box h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}
.screen-too-small-box p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ── Agenda ─────────────────────────────────────────────────────────────── */

.agenda-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.agenda-nav-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}

.agenda-filters {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.agenda-grid {
    overflow-x: auto;
}

/* chips de evento na agenda */
.agenda-chip {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    border-radius: 8px;
    padding: 4px 7px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: filter 0.12s;
}
.agenda-chip:hover { filter: brightness(0.92); }
.agenda-chip.planned  { background: rgba(14,116,144,0.12); color: var(--teal); }
.agenda-chip.done     { background: rgba(22,163,74,0.12);  color: #166534; }
.agenda-chip.missed   { background: rgba(220,38,38,0.10);  color: #991b1b; }
.agenda-chip.compact  { font-size: 10px; padding: 3px 6px; }

/* botão inline "+" para adicionar evento num dia */
.agenda-add-inline {
    display: block;
    width: 100%;
    background: none;
    border: 1.5px dashed var(--border);
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    cursor: pointer;
    margin-top: 2px;
    transition: border-color 0.15s, color 0.15s;
}
.agenda-add-inline:hover {
    border-color: var(--teal);
    color: var(--teal);
}

/* legenda */
.agenda-legend {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.agenda-legend .agenda-chip {
    width: auto;
    display: inline-block;
    margin-bottom: 0;
    cursor: default;
    pointer-events: none;
}

/* modal da agenda */
.agenda-modal-box {
    max-width: 440px;
}
.agenda-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-wrap: wrap;
}
.btn-danger {
    background: #fee2e2;
    color: #991b1b;
    border: none;
    margin-right: auto;
}
.btn-danger:hover { background: #fecaca; }

/* === Mini calendário lateral === */
.sidebar-mini-cal {
    padding-top: 18px;
    padding-bottom: 6px;
    border-top: 1px solid rgba(255,255,255,0.12);
}

.smc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.smc-label {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.80);
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

.smc-nav-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.55);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.smc-nav-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.smc-today-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.20);
    color: rgba(255,255,255,0.45);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.smc-today-btn:hover {
    background: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.80);
    border-color: rgba(255,255,255,0.40);
}

.smc-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 3px;
}
.smc-weekdays span {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.04em;
}

.smc-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.smc-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.60);
    border-radius: 6px;
    background: none;
    border: none;
    cursor: default;
    transition: background 0.12s;
    padding: 0;
}
.smc-empty { pointer-events: none; }

.smc-today {
    background: var(--teal);
    color: #fff;
    font-weight: 700;
}

.smc-session {
    background: rgba(143,225,127,0.16);
    color: #8fe17f;
    font-weight: 700;
    cursor: pointer;
}
.smc-session:hover { background: rgba(143,225,127,0.30); }

.smc-today.smc-session {
    background: var(--teal);
    color: #fff;
    box-shadow: 0 0 0 2px #8fe17f;
}

.smc-holiday {
    color: #a5b4fc;
}
.smc-holiday:not(.smc-session):not(.smc-today) {
    background: rgba(99,102,241,0.18);
}

