/* ===== EduCheck — Professional Teacher Management System ===== */

/* === Reset & Variables === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #161923;
    --bg-card: #1c1f2e;
    --bg-card-hover: #222639;
    --bg-sidebar: #12141e;
    --bg-input: #1a1d2b;
    --border: #2a2d3e;
    --border-light: #353849;
    --text-primary: #e8eaf0;
    --text-secondary: #8b8fa8;
    --text-muted: #5c6080;
    --accent: #6c5ce7;
    --accent-hover: #7d6ff0;
    --accent-glow: rgba(108, 92, 231, 0.25);
    --green: #00d68f;
    --green-bg: rgba(0, 214, 143, 0.12);
    --red: #ff6b7a;
    --red-bg: rgba(255, 107, 122, 0.12);
    --blue: #4da6ff;
    --blue-bg: rgba(77, 166, 255, 0.12);
    --yellow: #ffcb57;
    --yellow-bg: rgba(255, 203, 87, 0.12);
    --purple: #a78bfa;
    --purple-bg: rgba(167, 139, 250, 0.12);
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --transition: 0.2s ease;
}

html {
    font-size: 14px;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* === Sidebar === */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
}

.brand-name {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-primary);
    display: block;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.sidebar-user {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
    font-weight: 600;
}

.nav-item .material-icons-round {
    font-size: 20px;
}

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--border);
}

/* === Mobile Topbar === */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 999;
}

.mobile-title {
    flex: 1;
    font-weight: 700;
    font-size: 1.1rem;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    color: #fff;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
}

/* === Main Content === */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 32px;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Page Header === */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* === Buttons === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary .material-icons-round {
    font-size: 18px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.btn-ghost:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.btn-icon:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 16px;
}

.btn-action:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.btn-action .material-icons-round {
    font-size: 16px;
}

/* === Stats Row === */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.si-blue {
    background: var(--blue-bg);
    color: var(--blue);
}

.si-purple {
    background: var(--purple-bg);
    color: var(--purple);
}

.si-green {
    background: var(--green-bg);
    color: var(--green);
}

.si-red {
    background: var(--red-bg);
    color: var(--red);
}

.si-yellow {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.stat-data {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === Filters === */
.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    transition: border-color var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent);
}

.search-box .material-icons-round {
    color: var(--text-muted);
    font-size: 20px;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 12px 0;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.filter-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition);
    appearance: auto;
}

.filter-select:focus {
    border-color: var(--accent);
}

/* === Card / Table === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.table-card {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.87rem;
    vertical-align: middle;
}

tbody tr {
    transition: background var(--transition);
}

tbody tr:hover {
    background: var(--bg-card-hover);
}

tbody tr:last-child td {
    border-bottom: none;
}

.th-num {
    width: 50px;
    text-align: center;
}

.th-turma {
    width: 100px;
}

.th-points {
    width: 100px;
    text-align: center;
}

.th-actions {
    width: 150px;
    text-align: center;
}

.th-score {
    width: 80px;
    text-align: center;
}

.th-falta {
    width: 100px;
    text-align: center;
}

td:first-child {
    text-align: center;
    color: var(--text-muted);
    font-weight: 500;
}

.td-name {
    font-weight: 500;
}

.td-name-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.table-avatar-initials {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.6rem;
    color: #fff;
    flex-shrink: 0;
}

.td-turma {
    color: var(--text-secondary);
}

.td-points {
    text-align: center;
    font-weight: 700;
}

.td-points.positive {
    color: var(--green);
}

.td-points.negative {
    color: var(--red);
}

.td-points.zero {
    color: var(--text-muted);
}

.actions-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.no-results {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.no-results .material-icons-round {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.no-results p {
    font-size: 0.9rem;
}

/* === Selector Bar (Atividades/Presença) === */
.selector-bar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.selector-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.selector-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === Activity Header Bar === */
.ativ-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
    gap: 12px;
}

.summary-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.chip .material-icons-round {
    font-size: 16px;
}

.chip-accent {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: var(--accent);
    font-weight: 700;
}

.chip-green {
    background: var(--green-bg);
    color: var(--green);
    border-color: rgba(0, 214, 143, 0.3);
}

.chip-red {
    background: var(--red-bg);
    color: var(--red);
    border-color: rgba(255, 107, 122, 0.3);
}

.activity-count-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-count {
    width: 30px;
    height: 30px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.btn-count:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-count .material-icons-round {
    font-size: 18px;
}

.count-display {
    font-weight: 800;
    font-size: 1.1rem;
    min-width: 24px;
    text-align: center;
}

.page-actions {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

/* === Checkboxes === */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-checkbox {
    cursor: pointer;
    display: flex;
}

.custom-checkbox input {
    display: none;
}

.checkmark-box {
    width: 28px;
    height: 28px;
    background: var(--bg-input);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.checkmark-box .material-icons-round {
    font-size: 18px;
    color: transparent;
    transition: all 0.15s ease;
}

.custom-checkbox input:checked+.checkmark-box {
    background: var(--green);
    border-color: var(--green);
}

.custom-checkbox input:checked+.checkmark-box .material-icons-round {
    color: #fff;
}

.custom-checkbox:hover .checkmark-box {
    border-color: var(--accent);
}

/* Falta checkbox */
.falta-checkbox input:checked+.checkmark-box {
    background: var(--red);
    border-color: var(--red);
}

.falta-checkbox:hover .checkmark-box {
    border-color: var(--red);
}

/* Score badges */
.score-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.78rem;
}

.score-none {
    background: var(--red-bg);
    color: var(--red);
}

.score-low {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.score-mid {
    background: var(--blue-bg);
    color: var(--blue);
}

.score-full {
    background: var(--green-bg);
    color: var(--green);
}

/* === Modals === */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 440px;
    animation: modalSlide 0.25s ease;
    box-shadow: var(--shadow);
}

.modal-sm {
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-lg {
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-weight: 700;
    font-size: 1.1rem;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all var(--transition);
}

.btn-close:hover {
    color: var(--text-primary);
    background: var(--bg-input);
}

.btn-close-abs {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-group .optional {
    text-transform: none;
    font-weight: 400;
    color: var(--text-muted);
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

.form-group textarea {
    resize: vertical;
}

.toggle-group {
    display: flex;
    gap: 8px;
}

.toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--transition);
}

.toggle-btn:hover {
    border-color: var(--border-light);
}

.toggle-btn.active[data-tipo="atribuir"] {
    background: var(--green-bg);
    color: var(--green);
    border-color: var(--green);
}

.toggle-btn.active[data-tipo="tirar"] {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red);
}

.toggle-btn .material-icons-round {
    font-size: 18px;
}

.points-student-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.points-current {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.points-current strong {
    color: var(--accent);
    font-weight: 800;
}

/* === Profile Modal === */
.profile-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 24px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.profile-avatar-wrapper {
    position: relative;
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
}

.profile-avatar-wrapper:hover .avatar-overlay {
    opacity: 1;
}

.profile-avatar-lg {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.4rem;
    color: #fff;
    flex-shrink: 0;
}

.profile-avatar-img {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.avatar-overlay .material-icons-round {
    font-size: 22px;
    color: #fff;
}

.btn-remove-foto {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 10px;
    background: var(--red-bg);
    border: 1px solid rgba(255, 107, 122, 0.3);
    border-radius: 8px;
    color: var(--red);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-remove-foto:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

.btn-remove-foto .material-icons-round {
    font-size: 14px;
}

.profile-hero-info h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-purple {
    background: var(--purple-bg);
    color: var(--purple);
}

.profile-points-display {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--yellow);
    font-weight: 700;
}

.profile-points-display .material-icons-round {
    font-size: 18px;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 20px 24px;
}

.pstat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pstat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pstat-icon .material-icons-round {
    font-size: 18px;
}

.psi-green {
    background: var(--green-bg);
    color: var(--green);
}

.psi-red {
    background: var(--red-bg);
    color: var(--red);
}

.psi-blue {
    background: var(--blue-bg);
    color: var(--blue);
}

.psi-yellow {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.pstat-val {
    font-weight: 800;
    font-size: 1rem;
    display: block;
    line-height: 1.2;
}

.pstat-lbl {
    font-size: 0.68rem;
    color: var(--text-muted);
    display: block;
}

.profile-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 0 24px 16px;
}

.chart-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.chart-card h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.chart-card canvas {
    max-height: 180px;
}

.profile-section {
    padding: 0 24px 20px;
}

.profile-section h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* Ranking Bars */
.ranking-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ranking-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    width: 80px;
    flex-shrink: 0;
}

.ranking-bar {
    flex: 1;
    height: 24px;
    background: var(--bg-input);
    border-radius: 12px;
    overflow: hidden;
}

.ranking-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.6s ease;
    min-width: 8px;
}

.rf-green {
    background: linear-gradient(90deg, var(--green), #00e6a0);
}

.rf-blue {
    background: linear-gradient(90deg, var(--blue), #6dc0ff);
}

.rf-yellow {
    background: linear-gradient(90deg, var(--yellow), #ffe082);
}

.ranking-pos {
    font-weight: 800;
    font-size: 0.85rem;
    min-width: 50px;
    text-align: right;
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    gap: 12px;
}

.history-item .hi-date {
    color: var(--text-muted);
    font-weight: 500;
    min-width: 80px;
}

.history-item .hi-valor {
    font-weight: 700;
    min-width: 60px;
    text-align: right;
}

.history-item .hi-valor.hi-pos {
    color: var(--green);
}

.history-item .hi-valor.hi-neg {
    color: var(--red);
}

.history-item .hi-obs {
    flex: 1;
    color: var(--text-secondary);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item .hi-faltou {
    color: var(--red);
    font-weight: 600;
}

.history-item .hi-presente {
    color: var(--green);
    font-weight: 600;
}

.empty-state {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* === Toast === */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    z-index: 5000;
    font-weight: 500;
    font-size: 0.85rem;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* === Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes bounceCheck {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.3);
    }

    50% {
        transform: scale(0.9);
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Page entrance animations */
.page {
    animation: fadeIn 0.3s ease;
}

.page-header {
    animation: fadeInUp 0.4s ease;
}

.stats-row .stat-card {
    animation: fadeInUp 0.5s ease backwards;
}

.stats-row .stat-card:nth-child(1) {
    animation-delay: 0.05s;
}

.stats-row .stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stats-row .stat-card:nth-child(3) {
    animation-delay: 0.15s;
}

/* Card hover effects */
.stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.05), transparent);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(108, 92, 231, 0.3);
    box-shadow: 0 8px 32px rgba(108, 92, 231, 0.1);
}

.stat-card:hover::after {
    opacity: 1;
}

/* Table row animations */
.students-table tbody tr,
.ativ-row {
    animation: fadeInUp 0.3s ease backwards;
    transition: all 0.2s ease;
}

.students-table tbody tr:hover,
.ativ-row:hover {
    background: var(--bg-card-hover) !important;
}

/* Button glow effects */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Checkbox bounce animation */
.custom-checkbox input:checked+.checkmark-box {
    animation: bounceCheck 0.35s ease;
}

/* === New Activities Page === */
.ativ-create-card {
    padding: 24px 28px;
    animation: fadeInUp 0.5s ease 0.1s backwards;
}

.card-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.card-section-title .material-icons-round {
    color: var(--accent);
    font-size: 22px;
}

.ativ-create-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.ativ-name-group {
    flex: 1;
    min-width: 200px;
}

.ativ-name-group input {
    width: 100%;
}

/* Activity Edit Section */
.ativ-edit-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ativ-edit-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-purple {
    background: var(--purple-bg);
    color: var(--purple);
}

/* Table scroll for wide tables */
.table-scroll {
    overflow-x: auto;
    margin: -1px;
}

/* Activity header columns */
.th-prev-ativ,
.th-current-ativ,
.th-total {
    text-align: center !important;
    min-width: 80px;
    max-width: 110px;
}

.th-ativ-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 0;
}

.th-ativ-name {
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 90px;
}

.th-ativ-date {
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--text-muted);
}

.th-ativ-current {
    color: var(--accent);
}

.th-ativ-current .th-ativ-date {
    color: var(--accent);
    font-weight: 700;
    background: var(--accent-glow);
    padding: 1px 6px;
    border-radius: 4px;
}

.th-total {
    font-weight: 700;
}

/* Previous activity checks */
.td-prev-check {
    text-align: center !important;
}

.prev-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.prev-check .material-icons-round {
    font-size: 20px;
}

.prev-done {
    color: var(--green);
    opacity: 0.7;
}

.prev-miss {
    color: var(--red);
    opacity: 0.35;
}

/* Total badge */
.td-total {
    text-align: center !important;
}

.total-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 10px;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--purple-bg);
    color: var(--purple);
    border: 1px solid rgba(167, 139, 250, 0.2);
}

/* Activity List Section */
.ativ-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ativ-list-header .card-section-title {
    margin-bottom: 0;
}

.ativ-list-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ativ-list-item {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    animation: slideIn 0.4s ease backwards;
    transition: all 0.2s ease;
    overflow: hidden;
}

.ativ-list-item:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.ativ-list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ativ-list-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ativ-list-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--purple-bg);
    color: var(--purple);
}

.ativ-list-icon .material-icons-round {
    font-size: 20px;
}

.ativ-list-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.ativ-list-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 3px 10px;
    border-radius: 12px;
}

.ativ-list-item-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ativ-list-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.ativ-list-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ativ-list-bar-fill.pct-high {
    background: var(--green);
}

.ativ-list-bar-fill.pct-mid {
    background: var(--yellow);
}

.ativ-list-bar-fill.pct-low {
    background: var(--red);
}

/* Current check column highlight */
.td-current-check {
    text-align: center !important;
    background: rgba(108, 92, 231, 0.06);
}

.th-current-ativ {
    background: rgba(108, 92, 231, 0.08) !important;
}

/* Badge green */
.badge-green {
    background: var(--green-bg);
    color: var(--green);
}

/* Modal md size */
.modal-md {
    max-width: 600px;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.25s ease;
    box-shadow: var(--shadow);
    padding: 28px 32px;
    width: 100%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    z-index: 10;
}

.modal-close:hover {
    background: var(--red-bg);
    border-color: var(--red);
    color: var(--red);
}

.modal-close .material-icons-round {
    font-size: 18px;
}

/* Activity Detail Modal */
.ativ-detail-header {
    margin-bottom: 24px;
}

.ativ-detail-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.ativ-detail-meta {
    display: flex;
    gap: 8px;
}

.ativ-detail-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ativ-detail-col h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.ativ-detail-col h4 .material-icons-round {
    font-size: 18px;
}

.ativ-detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

.ativ-detail-list li {
    padding: 10px 14px;
    font-size: 0.85rem;
    border-radius: var(--radius-xs);
    animation: fadeInUp 0.2s ease backwards;
    margin-bottom: 2px;
}

.ativ-detail-list li:nth-child(even) {
    background: var(--bg-input);
}

.ativ-detail-list .empty-li {
    color: var(--text-muted);
    font-style: italic;
}

.ativ-list-pct {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 90px;
    text-align: right;
}

.pct-high {
    color: var(--green);
}

.pct-mid {
    color: var(--yellow);
}

.pct-low {
    color: var(--red);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 24px;
    color: var(--text-muted);
    text-align: center;
    animation: fadeIn 0.4s ease;
}

.empty-state .material-icons-round {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
}

/* Sidebar animation */
.nav-item {
    transition: all 0.2s ease;
}

.nav-item:hover {
    transform: translateX(4px);
}

/* Card entrance animation */
.card {
    transition: all 0.2s ease;
}

.table-card {
    animation: fadeInUp 0.5s ease 0.15s backwards;
}

/* Refined table styling */
.students-table tbody tr,
#ativ-tbody tr,
#pres-tbody tr {
    transition: background 0.15s ease;
}

/* Action buttons subtle animation */
.action-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn:hover {
    transform: scale(1.1);
}

/* === Responsive === */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-topbar {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 80px 16px 24px;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }
}

/* === Observation Card (Presença) === */
.obs-card {
    padding: 24px 28px;
    margin-bottom: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.obs-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.obs-card-title .material-icons-round {
    font-size: 20px;
    color: var(--accent);
}

.obs-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition);
    min-height: 80px;
}

.obs-textarea:focus {
    border-color: var(--accent);
}

.obs-textarea::placeholder {
    color: var(--text-muted);
}

/* === Chamada Detail Modal === */
.chamada-obs-display {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: var(--accent-glow);
    border: 1px solid rgba(108, 92, 231, 0.25);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.chamada-obs-display .material-icons-round {
    font-size: 18px;
    color: var(--accent);
    margin-top: 2px;
    flex-shrink: 0;
}

.chamada-obs-preview {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.chamada-list-info {
    display: flex;
    flex-direction: column;
}

/* === Detail Student (with avatar in detail lists) === */
.detail-student {
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.list-avatar-initials {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.5rem;
    color: #fff;
    flex-shrink: 0;
}

/* === Sidebar Avatar Image === */
.user-avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-avatar-sm-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-user:hover {
    background: var(--bg-card);
    transition: background var(--transition);
}

/* === Professor Profile Modal === */
.prof-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

/* ===== BIMESTRE SELECTOR (Sidebar) ===== */
.bimestre-selector-block {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.bimestre-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.bimestre-label .material-icons-round {
    font-size: 14px;
}

.bimestre-pills {
    display: flex;
    gap: 4px;
}

.bim-pill {
    flex: 1;
    padding: 6px 4px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-align: center;
}

.bim-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.bim-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 10px var(--accent-glow);
}

/* ===== BIMESTRE BADGE (Page header) ===== */
.page-header-badge {
    display: flex;
    align-items: center;
}

.bimestre-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    animation: fadeIn 0.3s ease;
}

/* ===== BIMESTRE GROUP (Lists) ===== */
.bimestre-group {
    margin-bottom: 28px;
    animation: fadeIn 0.3s ease;
}

.bimestre-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0 12px;
    border-bottom: 2px solid var(--accent);
    margin-bottom: 16px;
}

.bimestre-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--accent);
}

.bimestre-group-title .material-icons-round {
    font-size: 18px;
}

.bimestre-group-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 12px;
}

/* ===== LIST FILTERS (multi-select row) ===== */
.list-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===== ATIV LIST ITEM REWORK (with actions) ===== */
.ativ-list-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all var(--transition);
    animation: slideInCard 0.35s ease both;
    display: flex;
    flex-direction: column;
}

@keyframes slideInCard {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ativ-list-item:hover {
    border-color: var(--border-light);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.ativ-list-item-main {
    cursor: pointer;
    padding: 14px 16px 12px;
    flex: 1;
}

.ativ-list-item-actions {
    display: flex;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.btn-list-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all var(--transition);
    color: var(--text-muted);
}

.btn-list-action .material-icons-round {
    font-size: 15px;
}

.btn-list-edit:hover {
    background: var(--accent-glow);
    color: var(--accent);
}

.btn-list-delete:hover {
    background: var(--red-bg);
    color: var(--red);
}

.btn-list-action + .btn-list-action {
    border-left: 1px solid var(--border);
}

/* ===== BTN-ACTION-DANGER (delete in table) ===== */
.btn-action-danger:hover {
    border-color: var(--red);
    color: var(--red);
    background: var(--red-bg);
}

/* ===== BTN-DANGER (confirm delete button) ===== */
.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.btn-danger:hover {
    background: #e8556a;
    box-shadow: 0 4px 16px rgba(255, 107, 122, 0.35);
    transform: translateY(-1px);
}

.btn-danger .material-icons-round {
    font-size: 18px;
}

/* ===== MODAL DANGER (confirm delete) ===== */
.modal-danger .modal-header {
    border-bottom-color: rgba(255, 107, 122, 0.2);
}

.danger-icon-wrap {
    width: 70px;
    height: 70px;
    margin: 8px auto 16px;
    background: var(--red-bg);
    border: 2px solid rgba(255, 107, 122, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: dangerPulse 1.5s ease-in-out infinite;
}

@keyframes dangerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 122, 0.3); }
    50% { box-shadow: 0 0 0 10px rgba(255, 107, 122, 0); }
}

.danger-icon {
    font-size: 32px !important;
    color: var(--red);
}

.confirm-msg {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.confirm-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ============================================================
   VISUAL OVERHAUL — Professional Effects & Animations
   ============================================================ */

/* ── Glassmorphism Modal Overlay ── */
.modal-overlay {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-box {
    background: rgba(28, 31, 46, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(108, 92, 231, 0.08);
    animation: modalIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.93) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-overlay.active .modal-box {
    animation: modalIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ── Full-Record Edit Modal ── */
.modal-edit-full {
    width: min(680px, 96vw);
    max-width: min(680px, 96vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-edit-full .modal-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 24px;
}

.edit-full-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.edit-full-meta .form-group {
    flex: 1;
    min-width: 160px;
}

/* ── Student Record Section ── */
.student-record-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.student-record-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.student-record-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.student-record-title .material-icons-round {
    font-size: 16px;
    color: var(--accent);
}

.student-record-bulk {
    display: flex;
    gap: 6px;
}

.btn-bulk {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}

.btn-bulk .material-icons-round {
    font-size: 13px;
}

.btn-bulk:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.student-toggle-list {
    max-height: 380px;
    overflow-y: auto;
    padding: 6px 0;
}

/* ── Student Toggle Row ── */
.student-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    transition: background var(--transition);
    animation: fadeInRow 0.3s ease both;
    gap: 12px;
}

@keyframes fadeInRow {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

.student-toggle-row:hover {
    background: var(--bg-card-hover);
}

.student-toggle-row + .student-toggle-row {
    border-top: 1px solid rgba(255,255,255,0.04);
}

.student-toggle-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.student-toggle-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #8b6cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.student-toggle-name {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Toggle Switch ── */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.toggle-slider {
    display: flex;
    align-items: center;
    width: 92px;
    height: 32px;
    background: rgba(255, 107, 122, 0.18);
    border: 1px solid rgba(255, 107, 122, 0.3);
    border-radius: 16px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    width: 26px;
    height: 26px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    z-index: 1;
}

.toggle-label-on,
.toggle-label-off {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    position: absolute;
    transition: opacity 0.2s ease;
}

.toggle-label-on {
    right: 9px;
    color: var(--green);
    opacity: 0;
}

.toggle-label-off {
    right: 9px;
    color: var(--red);
    opacity: 1;
}

/* Checked (presente/fez) state */
.toggle-switch input:checked + .toggle-slider {
    background: rgba(0, 214, 143, 0.18);
    border-color: rgba(0, 214, 143, 0.4);
}

.toggle-switch input:checked + .toggle-slider::before {
    left: calc(100% - 29px);
    background: var(--green);
    box-shadow: 0 2px 10px rgba(0, 214, 143, 0.4);
}

.toggle-switch input:checked + .toggle-slider .toggle-label-on {
    opacity: 1;
    right: auto;
    left: 9px;
}

.toggle-switch input:checked + .toggle-slider .toggle-label-off {
    opacity: 0;
}

.toggle-switch:hover .toggle-slider {
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Skeleton Loaders ── */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
}

.skeleton-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(90deg, var(--border) 25%, var(--border-light) 50%, var(--border) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.4s infinite linear;
}

.skeleton-text-wrap {
    flex: 1;
}

.skeleton-text {
    height: 13px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--border) 25%, var(--border-light) 50%, var(--border) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.4s infinite linear;
}

.skeleton-text.wide { width: 60%; }

.skeleton-toggle {
    width: 92px;
    height: 32px;
    border-radius: 16px;
    flex-shrink: 0;
    background: linear-gradient(90deg, var(--border) 25%, var(--border-light) 50%, var(--border) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.4s infinite linear;
}

/* ── Micro-interactions: Buttons ── */
.btn-primary:active,
.btn-danger:active,
.btn-ghost:active,
.btn-action:active {
    transform: scale(0.96) !important;
    transition: transform 0.08s ease !important;
}

.btn-primary:hover {
    box-shadow: 0 4px 18px var(--accent-glow), 0 0 0 1px var(--accent);
}

/* ── Spinning icon for loading state ── */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.btn-spin {
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

/* ── Enhanced Stat Cards ── */
.stat-card {
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-light);
}

/* Coloured top-border on stat icons */
.stat-card:nth-child(1) { border-top: 2px solid var(--blue); }
.stat-card:nth-child(2) { border-top: 2px solid var(--green); }
.stat-card:nth-child(3) { border-top: 2px solid var(--yellow); }
.stat-card:nth-child(4) { border-top: 2px solid var(--purple); }

.stat-card:nth-child(1):hover { box-shadow: 0 8px 32px rgba(77,166,255,0.15); }
.stat-card:nth-child(2):hover { box-shadow: 0 8px 32px rgba(0,214,143,0.15); }
.stat-card:nth-child(3):hover { box-shadow: 0 8px 32px rgba(255,203,87,0.15); }
.stat-card:nth-child(4):hover { box-shadow: 0 8px 32px rgba(167,139,250,0.15); }

/* ── Sidebar Brand Gradient Accent ── */
.sidebar-brand {
    background: linear-gradient(135deg, rgba(108,92,231,0.08) 0%, transparent 100%);
    border-bottom: 1px solid rgba(108,92,231,0.15);
}

/* ── Toast animation overhaul ── */
/* Remove the always-on animation from .toast - keep show/hide via transform */
/* Override the base transform so .show works with the spring animation */
.toast.show {
    transform: translateX(-50%) translateY(0) !important;
    animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(30px) scale(0.9); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* Override the base transition when hiding so it slides back down */
.toast:not(.show) {
    transform: translateX(-50%) translateY(100px) !important;
    transition: transform 0.3s ease, opacity 0.3s ease !important;
    opacity: 0;
}

/* ── Table row hover lift ── */
.table-row:hover {
    background: var(--bg-card-hover);
    transform: translateX(2px);
    transition: all 0.15s ease;
}

/* ── NavItem slide-in animation ── */
.nav-item {
    animation: navSlideIn 0.4s ease both;
}

.nav-item:nth-child(1) { animation-delay: 0.05s; }
.nav-item:nth-child(2) { animation-delay: 0.10s; }
.nav-item:nth-child(3) { animation-delay: 0.15s; }
.nav-item:nth-child(4) { animation-delay: 0.20s; }

@keyframes navSlideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Card grid stagger ── */
.stat-card {
    animation: cardFadeUp 0.5s ease both;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }

@keyframes cardFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Reduce motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Score Input (tabela de criação) ── */
.td-score {
    width: 80px;
    padding: 4px 6px;
}

.score-input {
    width: 78px;
    padding: 5px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--yellow);
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    text-align: right;
    letter-spacing: 0.03em;
    transition: all var(--transition);
    cursor: text;
}

.score-input:focus {
    outline: none;
    border-color: var(--yellow);
    box-shadow: 0 0 0 2px rgba(255, 203, 87, 0.18);
    background: rgba(255, 203, 87, 0.05);
}

.score-input:hover {
    border-color: var(--border-light);
}

/* Score input compact (inside edit modal rows) */
.score-input-sm {
    width: 72px;
    padding: 4px 7px;
    font-size: 0.78rem;
}

/* Student toggle row with score */
.student-toggle-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}