/* ===== 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);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.25s ease;
    box-shadow: var(--shadow);
}

.modal-sm {
    width: 100%;
    max-width: 440px;
}

.modal-lg {
    width: 100%;
    max-width: 720px;
}

@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;
    gap: 10px;
    padding: 18px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    animation: slideIn 0.4s ease backwards;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ativ-list-item:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.12);
}

.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;
}