:root {
    --bg: #f3f7f6;
    --bg-accent: #dcefe7;
    --surface: rgba(255, 255, 255, 0.94);
    --surface-strong: #ffffff;
    --border: #d4e0db;
    --text: #16302b;
    --muted: #5f7770;
    --primary: #0f766e;
    --primary-strong: #115e59;
    --secondary: #f0b429;
    --danger: #c2410c;
    --success: #15803d;
    --shadow: 0 24px 60px rgba(15, 118, 110, 0.12);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    min-height: 100%;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    font-family: "Poppins", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(240, 180, 41, 0.18), transparent 26%),
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.16), transparent 22%),
        linear-gradient(180deg, #f6fbfa 0%, var(--bg) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 118, 110, 0.4) rgba(15, 118, 110, 0.08);
}

html:not(.display-html)::-webkit-scrollbar,
body:not(.display-body)::-webkit-scrollbar {
    width: 12px;
}

html:not(.display-html)::-webkit-scrollbar-track,
body:not(.display-body)::-webkit-scrollbar-track {
    background: rgba(15, 118, 110, 0.08);
}

html:not(.display-html)::-webkit-scrollbar-thumb,
body:not(.display-body)::-webkit-scrollbar-thumb {
    background: rgba(15, 118, 110, 0.4);
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.7);
}

html:not(.display-html)::-webkit-scrollbar-thumb:hover,
body:not(.display-body)::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 118, 110, 0.58);
}

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

img {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

.shell {
    display: grid;
    min-height: 100vh;
}

.shell-main {
    min-width: 0;
}

.guest-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1.25rem;
    background:
        radial-gradient(circle at top left, rgba(240, 180, 41, 0.14), transparent 24%),
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.12), transparent 20%),
        linear-gradient(180deg, #18302d 0%, #264643 48%, #35605b 100%);
}

.guest-card,
.panel,
.table-card,
.stat-card,
.metric-card,
.form-card {
    background: var(--surface);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.guest-card {
    width: min(460px, 100%);
    padding: 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-weight: 700;
}

.brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    flex: 0 0 56px;
}

.brand-badge {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), #22c55e);
    color: white;
    font-size: 1.15rem;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(243, 247, 246, 0.82);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(21, 94, 89, 0.08);
}

.topbar-user {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.topbar-user-line {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.section-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 1rem 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.section-menu-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(21, 94, 89, 0.08);
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.section-menu-link:hover,
.section-menu-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    border-color: transparent;
    color: #ffffff;
    transform: translateY(-1px);
}

.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: white;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(88vw, 290px);
    padding: 1rem;
    background: rgba(12, 34, 31, 0.95);
    color: #ecfdf5;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    z-index: 60;
    overflow-y: auto;
}

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

.sidebar nav {
    display: grid;
    gap: 0.35rem;
    margin-top: 1.5rem;
}

.nav-link {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    color: rgba(236, 253, 245, 0.9);
}

.nav-link.active,
.nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 55;
}

.overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.content {
    padding: 1rem;
    display: grid;
    gap: 1rem;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.page-head h1,
.guest-card h1 {
    margin: 0;
    font-size: clamp(1.5rem, 2vw, 2rem);
}

.subtle {
    color: var(--muted);
}

.actions,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn,
.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 14px;
    padding: 0.85rem 1.1rem;
    min-height: 46px;
    border: 0;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: white;
}

.occurrence-submit-button {
    background: #f97316;
    color: #ffffff;
}

.occurrence-submit-button:hover,
.occurrence-submit-button:focus-visible {
    background: #ea580c;
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-danger {
    background: #fff7ed;
    color: var(--danger);
    border: 1px solid #fed7aa;
}

.evaluation-action-btn {
    min-height: 40px;
    padding: 0.65rem 0.95rem;
    color: #ffffff;
}

.evaluation-actions-cell {
    white-space: nowrap;
}

.evaluation-edit-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.evaluation-grades-btn {
    background: linear-gradient(135deg, #0f766e, #0d9488);
}

.evaluation-create-btn {
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-color: #ea580c;
    color: #ffffff;
}

.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid-cards {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card,
.metric-card {
    padding: 1.1rem;
    position: relative;
    overflow: hidden;
}

.kpi {
    display: block;
    margin-top: 0.45rem;
    font-size: 1.9rem;
    font-weight: 700;
}

.dashboard-evaluation-card {
    display: grid;
    gap: 0.85rem;
    color: inherit;
}

.dashboard-inline-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-inline-stat .kpi {
    margin-top: 0;
    font-size: 1.45rem;
    flex: 0 0 auto;
}

.dashboard-card-actions {
    justify-content: center;
    margin-top: 0.25rem;
}

.dashboard-occurrence-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.dashboard-occurrence-card,
.dashboard-ranking-card {
    display: grid;
    gap: 0.35rem;
    color: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-ranking-card {
    padding: 0;
    gap: 0;
    overflow: hidden;
}

.dashboard-ranking-card-banner {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
}

.dashboard-occurrence-card:hover,
.dashboard-occurrence-card.is-active,
.dashboard-ranking-card:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 118, 110, 0.28);
    box-shadow: 0 24px 54px rgba(15, 118, 110, 0.16);
}

.dashboard-occurrence-students {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.dashboard-occurrence-student {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
}

.dashboard-occurrence-student-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.dashboard-occurrence-student-photo,
.dashboard-occurrence-student-fallback {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 16px;
}

.dashboard-occurrence-student-photo {
    object-fit: cover;
    border: 1px solid var(--border);
}

.dashboard-occurrence-student-fallback {
    font-size: 1.1rem;
}

.dashboard-icon-button {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #b91c1c;
    font-size: 1.1rem;
    cursor: pointer;
}

.dashboard-icon-button:hover,
.dashboard-icon-button:focus-visible {
    background: #ffe4e6;
}

.panel,
.table-card,
.form-card {
    padding: 1rem;
}

.split {
    display: grid;
    gap: 1rem;
}

.settings-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    align-items: start;
}

.settings-form-card {
    padding: 1.3rem;
}

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

.audit-log-card {
    padding: 0;
}

.audit-log-card h2 {
    margin: 0;
    padding: 0.35rem 0.45rem 0.15rem;
    font-size: 1rem;
}

.audit-log-card .table-wrap {
    margin: 0;
    padding: 0;
}

.audit-log-card th,
.audit-log-card td {
    text-align: left;
    padding: 0.1rem 0.1rem;
    border-bottom: 1px solid #d6e0db;
    vertical-align: top;
    font-size: 0.76rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

th,
td {
    text-align: left;
    padding: 0.95rem 0.75rem;
    border-bottom: 1px solid #d6e0db;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    background: #ecfeff;
    color: #155e75;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-processing-grade {
    background: #1d4ed8;
    color: #ffffff;
}

.badge-pending-realization {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #ffffff;
    border: 1px solid rgba(194, 65, 12, 0.22);
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.35);
    isolation: isolate;
    animation: pending-realization-pulse 1.8s ease-in-out infinite;
}

.badge-pending-realization::after {
    content: "";
    position: absolute;
    inset: -20% auto -20% -35%;
    width: 38%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0));
    transform: skewX(-22deg);
    opacity: 0.9;
    pointer-events: none;
    animation: pending-realization-shine 2.4s ease-in-out infinite;
    z-index: -1;
}

@keyframes pending-realization-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.34);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 0 8px rgba(249, 115, 22, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }
}

@keyframes pending-realization-shine {
    0% {
        left: -45%;
    }
    55% {
        left: 125%;
    }
    100% {
        left: 125%;
    }
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.4rem;
}

.field label {
    font-weight: 600;
}

.field-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.required-mark {
    color: #b91c1c;
    font-weight: 700;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
}

.field textarea {
    min-height: 120px;
    resize: vertical;
}

.setting-toggle {
    gap: 0.7rem;
}

.toggle-control {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    width: fit-content;
    cursor: pointer;
}

.toggle-control input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-switch {
    position: relative;
    width: 56px;
    height: 32px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.toggle-switch::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
    transition: transform 0.2s ease;
}

.toggle-control input[type="checkbox"]:checked + .toggle-switch {
    background: linear-gradient(135deg, var(--primary), #14b8a6);
}

.toggle-control input[type="checkbox"]:checked + .toggle-switch::after {
    transform: translateX(24px);
}

.toggle-control input[type="checkbox"]:disabled + .toggle-switch {
    opacity: 0.6;
}

.toggle-state {
    font-weight: 600;
    color: var(--text);
}

.hint,
.error-text {
    font-size: 0.86rem;
}

.hint {
    color: var(--muted);
}

.error-text {
    color: #b91c1c;
}

.flash {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    font-weight: 500;
}

.flash-success {
    background: #dcfce7;
    color: #166534;
}

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

.text-success {
    color: #166534;
    font-weight: 700;
}

.text-danger {
    color: #b91c1c;
    font-weight: 700;
}

.student-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.student-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: white;
    padding: 1rem;
}

.student-card input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.student-card.selected {
    background: #fee2e2;
    border-color: #fca5a5;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}

.student-card-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.student-card-avatar {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #d4e0db;
}

.student-card-placeholder {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    font-size: 1.05rem;
    border-radius: 14px;
}

.student-card-meta {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    flex: 1 1 auto;
}

.student-card-meta strong,
.student-card-meta .subtle {
    word-break: break-word;
}

.rank-list {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}

.rank-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.3rem;
    border-radius: 10px;
    background: #d3f7f0;
    border: 1px solid #e5efeb;
}

.rank-position {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.6rem;
}

.event-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.student-event-actions .btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #1d4ed8;
    color: #ffffff;
}

.student-event-content {
    min-width: 0;
    display: grid;
    gap: 0.45rem;
}

.student-event-item-table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    background: #d3f7f0;
    border: 1px solid #e5efeb;
    border-radius: 10px;
    overflow: hidden;
}

.student-event-item-table td {
    min-width: 0;
    padding: 0.7rem 0.8rem;
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.student-event-item-points-cell {
    width: 76px;
    padding-right: 0.35rem;
}

.student-event-item-points-cell .rank-position {
    width: 56px;
    height: 56px;
}

.student-event-item-title-cell {
    width: auto;
    padding-bottom: 0.3rem;
}

.student-event-item-meta-cell {
    width: auto;
    padding-top: 0;
}

.student-event-item-meta-cell .event-meta {
    width: 100%;
    margin-top: 0;
}

.student-event-item-action-cell {
    width: auto;
    padding-top: 0.7rem;
    border-top: 1px solid #d7e4df;
}

.student-event-content strong,
.student-event-content .subtle {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.event-management-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.student-events-table {
    min-width: 0;
    table-layout: fixed;
}

.student-events-table th,
.student-events-table td {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.student-events-table tbody {
    outline: 1px solid #d7e4df;
    outline-offset: -1px;
}

.student-events-table tbody td {
    border-bottom-color: #d7e4df;
}

.event-checkin-summary {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.event-checkin-kpi {
    font-size: 1.05rem;
    line-height: 1.35;
}

.event-checkin-grid {
    display: grid;
    gap: 1rem;
}

.event-checkin-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #d7e4df;
}

.event-checkin-student {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.event-checkin-meta {
    min-width: 0;
}

.event-checkin-meta strong,
.event-checkin-meta .subtle {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.event-checkin-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.55rem;
}

.event-checkin-actions form {
    margin: 0;
}

.student-activity-item {
    grid-template-columns: auto 1fr auto;
}

.student-activity-date {
    width: 56px;
    height: 56px;
    font-size: 0.86rem;
    line-height: 1.1;
    text-align: center;
}

.student-activity-content,
.student-activity-side {
    min-width: 0;
}

.student-activity-content strong,
.student-activity-content .subtle {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.student-activity-side {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.student-activities-summary-card {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem 1.2rem;
}

.student-activities-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.student-activities-summary-item .subtle {
    margin: 0;
}

.student-activities-summary-item .kpi {
    margin-top: 0;
    flex: 0 0 auto;
}

.hide-mobile {
    display: table-cell;
}

.progress {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
}

.student-card-highlight {
    min-height: 150px;
}

.student-card-highlight .subtle {
    color: rgba(255, 255, 255, 0.88);
}

.student-card-highlight .kpi {
    color: #ffffff;
}

.student-dashboard-center-card {
    text-align: center;
    display: grid;
    align-content: center;
    justify-items: center;
}

.student-dashboard-icon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    text-align: center;
    text-decoration: none;
}

.student-dashboard-card-image {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.16));
}

.student-dashboard-card-label {
    display: block;
    margin-top: 0.45rem;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    color: #ffffff;
    text-align: center;
}

.dashboard-student-event-main {
    min-width: 0;
}

.dashboard-student-event-main strong,
.dashboard-student-event-main .subtle {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dashboard-student-ledger-main {
    min-width: 0;
    display: grid;
    gap: 0.22rem;
}

.dashboard-student-ledger-main strong,
.dashboard-student-ledger-main .subtle {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dashboard-student-ledger-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dashboard-student-ledger-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #ffffff;
    white-space: nowrap;
}

.dashboard-student-ledger-marker-credit {
    background: #15803d;
}

.dashboard-student-ledger-marker-debit {
    background: #b91c1c;
}

.dashboard-student-ledger-amount {
    display: inline-block;
    white-space: nowrap;
    line-height: 1;
}

.student-dashboard-alert-icon {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 34px;
    height: 34px;
    object-fit: contain;
    z-index: 3;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.2));
    animation: student-dashboard-alert-float 1.9s ease-in-out infinite;
}

@keyframes student-dashboard-alert-float {
    0% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.2));
    }
    50% {
        transform: translateY(-2px) scale(1.08);
        filter: drop-shadow(0 14px 22px rgba(249, 115, 22, 0.38));
    }
    100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.2));
    }
}

.bits-card {
    background: linear-gradient(135deg, #08a045 0%, #14b85f 55%, #7bc96f 100%);
}

.school-position-card {
    background: linear-gradient(135deg, #1f4e79 0%, #1d7ddc 100%);
}

.shift-position-card {
    background: linear-gradient(135deg, #ffb703 0%, #ffd166 100%);
}

.average-score-card {
    background: linear-gradient(135deg, #ff5a5f 0%, #ff8a5b 100%);
}

.shift-position-card .subtle,
.shift-position-card .kpi {
    color: #263447;
}

.student-card-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 34px;
    height: 34px;
    object-fit: contain;
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.18));
    opacity: 0.96;
}

.dashboard-bits-card .student-card-icon {
    top: 2.35rem;
}

.statement-summary-card {
    display: grid;
    gap: 0.9rem;
}

.statement-summary-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.statement-summary-grid strong {
    display: block;
    font-size: 0.95rem;
    color: var(--muted);
}

.statement-summary-grid .kpi {
    margin-top: 0.35rem;
    font-size: 1.45rem;
}

.auth-footer,
.footer-note {
    color: var(--muted);
    font-size: 0.92rem;
}

html.display-html,
body.display-body {
    height: 100%;
    overflow: hidden;
    scrollbar-width: none;
}

body.display-body::-webkit-scrollbar {
    display: none;
}

.display-body {
    min-height: 100vh;
    height: 100vh;
    overflow: clip;
    background:
        radial-gradient(circle at 10% 10%, rgba(240, 180, 41, 0.18), transparent 20%),
        radial-gradient(circle at 90% 15%, rgba(34, 197, 94, 0.15), transparent 18%),
        linear-gradient(135deg, #052e2b 0%, #0f3d39 45%, #164e63 100%);
    color: #f0fdfa;
}

.display-shell {
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 0.12rem;
    padding: 0.12rem 0.22rem 0.18rem;
    overflow: clip;
}

.display-header,
.display-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.display-header {
    position: relative;
}

.display-header h1 {
    margin: 0.15rem 0 0;
    font-size: clamp(1.8rem, 3.3vw, 3rem);
}

.display-header p,
.display-footer .subtle,
.display-panel-head p,
.display-ad p {
    margin: 0;
    color: rgba(240, 253, 250, 0.78);
}

.display-kicker {
    letter-spacing: 0em;
    text-transform: uppercase;
    font-size: 2rem;
    font-weight: 700;
    color: #99f6e4;
    text-align: center;
}

.display-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    text-align: center;
    margin: 0 auto;
}

.display-brand-logo {
    width: clamp(64px, 7vw, 92px);
    height: auto;
    object-fit: contain;
}

.display-actions {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.display-stage {
    position: relative;
    min-height: 0;
    height: 100%;
    width: 100%;
    overflow: clip;
    display: grid;
    place-items: start center;
}

.display-slide {
    display: none;
    height: 100%;
    width: 100%;
    min-height: 0;
    place-items: start center;
    overflow: clip;
}

.display-slide.active {
    display: grid;
}

.display-fit-box {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: start center;
    overflow: clip;
}

.display-panel,
.display-ad {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    box-shadow: 0 28px 70px rgba(2, 12, 27, 0.28);
    backdrop-filter: blur(14px);
}

.display-panel {
    width: min(96vw, 1720px);
    max-width: min(96vw, 1720px);
    height: auto;
    padding: 0.5rem 0.75rem 0.58rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0 auto;
    overflow: visible;
    transform-origin: center top;
    transform: scale(var(--display-fit-scale, 1));
}

.display-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.2rem;
    margin-bottom: 0;
    width: 100%;
}

.display-panel-head h1 {
    margin: 0;
    font-size: clamp(2.18rem, 3.68vw, 3.23rem);
    line-height: 1.05;
}

.display-heading-accent {
    color: #facc15;
}

.display-ranking-list {
    display: grid;
    gap: 0.85rem;
}

.display-table-wrap {
    overflow: visible;
    flex: 0 0 auto;
    min-height: auto;
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: stretch;
    margin-top: -0.08rem;
}

.display-ranking-table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 0.22rem;
    margin: 0;
    table-layout: fixed;
}

.display-ranking-table th,
.display-ranking-table td {
    border: 0;
    padding: 0.22rem 0.72rem;
    font-size: clamp(1.72rem, 2vw, 2.1rem);
    line-height: 1;
    vertical-align: middle;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.display-ranking-table th {
    color: #99f6e4;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 1.08rem;
    padding: 0.48rem 1.24rem;
}

.display-ranking-table tbody tr {
    height: 60px;
}

.display-ranking-table tbody td {
    background: #ffffff;
    color: #111827 !important;
}

.display-ranking-table tbody tr.is-unclassified td {
    background: #d1d5db;
    color: #4b5563 !important;
}

.display-ranking-table tbody td:first-child {
    background: #2563eb;
    color: #ffffff !important;
    border-radius: 10px 0 0 10px;
    width: 130px;
    font-weight: 700;
    text-align: center;
}

.display-ranking-table tbody tr.is-unclassified td:first-child {
    background: #9ca3af;
    color: #ffffff !important;
}

.display-ranking-table tbody td:last-child {
    border-radius: 0 10px 10px 0;
    text-align: center;
    font-size: clamp(1.88rem, 2.15vw, 2.28rem);
    font-weight: 700;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.display-ranking-table th:last-child,
.display-ranking-table td:last-child {
    width: 182px;
}

.display-ranking-table-top50 th:nth-child(3),
.display-ranking-table-top50 td:nth-child(3) {
    width: 170px;
    text-align: center;
}

.display-ranking-table-top50 th:nth-child(4),
.display-ranking-table-top50 td:nth-child(4) {
    width: 132px;
    text-align: center;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

.display-ranking-table tbody tr.is-empty td {
    color: transparent !important;
}

.display-rank-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.display-rank-position {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, #f0b429, #f59e0b);
    color: #052e2b;
    font-size: 1.25rem;
    font-weight: 800;
}

.display-rank-score {
    text-align: right;
}

.display-rank-score span {
    display: block;
    font-size: 1.7rem;
    font-weight: 800;
}

.display-rank-score small {
    color: rgba(240, 253, 250, 0.72);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.display-secret {
    display: inline-block;
    min-width: 24px;
    color: #fcd34d;
    font-size: 1.4rem;
}

.display-merit-box {
    width: 100%;
    min-width: 100%;
    min-height: 54px;
    height: 54px;
    max-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    overflow: hidden;
    background: transparent;
    border: 0;
    margin: 0 auto;
}

.display-merit-image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.display-ad {
    padding: 1.2rem;
}

.display-dots {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.display-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
}

.display-dot.active {
    background: #99f6e4;
    transform: scale(1.15);
}

.display-flash {
    padding: 1rem 1.2rem;
    border-radius: 18px;
    font-weight: 600;
}

.display-flash-success {
    background: rgba(34, 197, 94, 0.18);
    color: #dcfce7;
}

.display-flash-error {
    background: rgba(239, 68, 68, 0.18);
    color: #fee2e2;
}

.display-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(3, 7, 18, 0.72);
    z-index: 90;
}

.display-modal-card {
    width: min(420px, 100%);
    padding: 1.5rem;
    border-radius: 24px;
    background: rgba(10, 28, 26, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.display-modal-card h3 {
    margin: 0.35rem 0 0.75rem;
    font-size: 1.7rem;
}

.display-modal-card p {
    margin: 0 0 1rem;
    color: rgba(240, 253, 250, 0.78);
}

@media (max-width: 767px) {
    .student-events-panel {
        overflow: hidden;
    }

    .dashboard-student-events-list {
        gap: 0.65rem;
    }

    .dashboard-student-event-item {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 0.55rem;
        padding: 0.7rem 0.8rem;
    }

    .dashboard-student-event-item .dashboard-student-event-marker {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        min-width: 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        overflow: hidden !important;
    }

    .dashboard-student-event-main {
        display: grid;
        gap: 0.25rem;
    }

    .dashboard-student-event-main strong {
        line-height: 1.15;
    }

    .dashboard-student-event-main .subtle {
        line-height: 1.22;
    }

    .dashboard-student-event-cost {
        font-weight: 700;
        color: #1d4ed8;
    }

    .dashboard-student-event-form,
    .dashboard-student-event-form .btn {
        width: 100%;
    }

    .dashboard-student-ledger-list {
        gap: 0.65rem;
    }

    .dashboard-student-ledger-item {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 0.35rem;
        padding: 0.7rem 0.8rem;
    }

    .dashboard-student-ledger-head {
        gap: 0.45rem;
    }

    .dashboard-student-ledger-marker {
        min-height: 28px;
        padding: 0.26rem 0.68rem;
        font-size: 0.7rem;
    }

    .dashboard-student-ledger-main {
        gap: 0.18rem;
    }

    .dashboard-student-ledger-main strong {
        line-height: 1.15;
    }

    .dashboard-student-ledger-date {
        line-height: 1.18;
    }

    .dashboard-student-ledger-amount {
        color: #1d4ed8;
        line-height: 1;
    }

    .student-events-list {
        gap: 0.9rem;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .student-activities-summary-card {
        grid-template-columns: 1fr;
    }

    .student-activities-summary-item {
        align-items: flex-start;
    }

    .student-activity-item {
        grid-template-columns: 1fr;
    }

    .student-activity-side {
        justify-content: stretch;
    }

    .student-activity-side .badge {
        width: 100%;
    }

    .student-event-item-table td {
        padding: 0.55rem 0.65rem;
    }

    .student-event-item-table {
        min-width: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .student-event-item-points-cell {
        width: 64px;
        padding-right: 0.25rem;
    }

    .student-event-item-points-cell .rank-position {
        width: 48px;
        height: 48px;
    }

    .student-event-title {
        display: block;
        line-height: 1.15;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .student-event-description {
        display: none;
    }

    .student-event-item-title-cell,
    .student-event-item-description-cell,
    .student-event-item-meta-cell {
        width: auto;
        min-width: 0;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .student-event-item-meta-cell .event-meta {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
        gap: 0.45rem;
    }

    .student-event-item-meta-cell .event-meta > * {
        min-width: 0;
        max-width: 100%;
    }

    .student-event-item-meta-cell .event-meta .badge,
    .student-event-item-meta-cell .event-meta .subtle {
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .student-event-actions {
        display: grid;
        width: 100%;
    }

    .student-event-actions .btn,
    .student-event-actions form,
    .student-event-actions .badge {
        width: 100%;
    }

    .student-event-actions .badge-event-insufficient {
        grid-column: 1 / -1;
        width: 100%;
    }

    .event-management-actions {
        width: 100%;
    }

    .event-management-actions .btn {
        width: 100%;
    }

    .event-checkin-item {
        grid-template-columns: 1fr;
    }

    .event-checkin-student {
        align-items: flex-start;
    }

    .event-checkin-actions {
        align-items: stretch;
    }

    .event-checkin-actions .btn,
    .event-checkin-actions form,
    .event-checkin-actions .badge {
        width: 100%;
    }

    .student-events-table-wrap {
        overflow: visible;
    }

    .student-events-table,
    .student-events-table thead,
    .student-events-table tbody,
    .student-events-table tr,
    .student-events-table th,
    .student-events-table td {
        display: block;
        width: 100%;
    }

    .student-events-table {
        min-width: 0;
        border-collapse: separate;
    }

    .student-events-table thead {
        display: none;
    }

    .student-events-table tbody {
        display: grid;
        gap: 0.9rem;
    }

    .student-events-table tbody tr {
        padding: 0.8rem 0.85rem;
        border-radius: 16px;
        background: #ffffff;
        border: 1px solid #d7e4df;
    }

    .student-events-table tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.6rem;
        padding: 0.1rem 0;
        min-width: 0;
        border: 0;
        white-space: normal;
        font-size: 0.84rem;
    }

    .student-events-table tbody td + td {
        margin-top: 0.45rem;
    }

    .student-events-table tbody td::before {
        content: attr(data-label);
        display: inline-block;
        margin-bottom: 0;
        flex: 0 0 38%;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        line-height: 1.3;
    }

    .student-events-table tbody td:not([colspan]) {
        text-align: right;
    }

    .student-events-table tbody td:not([colspan])::before {
        text-align: left;
    }

    .student-events-table tbody td:first-child {
        justify-content: flex-start;
        align-items: baseline;
        text-align: left;
        font-weight: 700;
        color: #173126;
    }

    .student-events-table tbody td:first-child::before {
        order: 2;
        flex: 0 0 auto;
        margin-left: 0.2rem;
        color: #6b7f75;
        font-size: 0.68rem;
        letter-spacing: 0.02em;
    }

    .student-events-table .student-rescue-hide-mobile {
        display: none !important;
    }

    .student-events-table tbody td[colspan] {
        display: block;
        padding: 0;
    }

    .student-events-table tbody td[colspan]::before {
        content: none;
    }

    .student-statement-table {
        min-width: 0;
        table-layout: fixed;
    }

    .student-statement-table th,
    .student-statement-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .student-statement-table .hide-mobile {
        display: none;
    }

    .student-statement-table th:nth-child(2),
    .student-statement-table th:nth-child(3),
    .student-statement-table td:nth-child(2),
    .student-statement-table td:nth-child(3) {
        display: none;
    }

    .student-statement-table th:nth-child(1),
    .student-statement-table td:nth-child(1) {
        width: 22%;
        white-space: nowrap;
    }

    .student-statement-table th:nth-child(4),
    .student-statement-table td:nth-child(4) {
        width: 46%;
    }

    .student-statement-table th:nth-child(5),
    .student-statement-table td:nth-child(5),
    .student-statement-table th:nth-child(6),
    .student-statement-table td:nth-child(6) {
        width: 16%;
        text-align: right;
        white-space: nowrap;
    }

    .statement-summary-grid {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

    .display-shell {
        padding: 0.45rem;
        gap: 0.45rem;
    }

    .display-header,
    .display-footer,
    .display-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .display-header h1 {
        font-size: 1.55rem;
    }

    .display-panel,
    .display-modal-card {
        padding: 0.65rem;
        border-radius: 18px;
    }

    .display-panel {
        width: 100%;
        max-width: 100%;
    }

    .display-panel-head h1 {
        font-size: 1.8rem;
    }

    .display-panel-head p,
    .display-header p,
    .display-footer .subtle {
        font-size: 0.82rem;
    }

    .display-actions {
        display: none;
    }

    .display-stage {
        min-height: auto;
    }

    .display-table-wrap {
        overflow: hidden;
    }

    .display-ranking-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
        border-spacing: 0 0.4rem;
    }

    .display-ranking-table thead {
        display: table-header-group;
    }

    .display-ranking-table tbody {
        display: table-row-group;
    }

    .display-ranking-table tbody tr {
        display: table-row;
    }

    .display-ranking-table th,
    .display-ranking-table td {
        display: table-cell;
        padding: 0.3rem;
        font-size: 0.76rem;
        line-height: 1.2;
        vertical-align: middle;
    }

    .display-ranking-table th {
        font-size: 0.64rem;
        letter-spacing: 0.03em;
        white-space: nowrap;
    }

    .display-ranking-table td {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .display-ranking-table tbody td::before {
        display: none;
    }

    .display-ranking-table tbody td:first-child {
        width: 48px;
        border-radius: 14px 0 0 14px;
        text-align: center;
    }

    .display-ranking-table tbody td:last-child {
        border-radius: 0 14px 14px 0;
    }

    .display-ranking-table th:first-child {
        width: 48px;
    }

    .display-ranking-table th:last-child,
    .display-ranking-table td:last-child {
        width: 72px;
    }

    .display-merit-box {
        width: 60px;
        min-height: 34px;
        margin-left: auto;
        margin-right: auto;
        border-radius: 14px;
    }

    .display-merit-image {
        max-height: 34px;
        border-radius: 50%;
    }

    .display-dots {
        justify-content: center;
    }

    .display-modal {
        padding: 1rem;
    }
}

@media (min-width: 1024px) {
    .shell {
        grid-template-columns: 290px 1fr;
    }

    .sidebar {
        position: sticky;
        inset: 0;
        transform: none;
        min-height: 100vh;
    }

    .overlay,
    .nav-toggle {
        display: none;
    }

    .topbar {
        padding: 1.2rem 1.75rem 0;
        background: transparent;
        border-bottom: 0;
    }

    .section-menu {
        padding: 0.55rem 1.75rem 0;
    }

    .content {
        padding: 0 1.75rem 1.75rem;
    }

    .split {
        grid-template-columns: 1.3fr 0.9fr;
    }

    .form-grid.two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Hard overrides for the public display so generic table rules never break the telão. */
.display-body .display-slide.active {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.display-body .display-panel {
    width: min(96vw, 1720px);
    max-width: min(96vw, 1720px);
}

.display-body .display-table-wrap {
    overflow: visible;
}

.display-body table.display-ranking-table {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 0.22rem !important;
}

.display-body table.display-ranking-table th,
.display-body table.display-ranking-table td {
    border: 0 !important;
    padding: 0.22rem 0.72rem !important;
    font-size: clamp(1.72rem, 2vw, 2.1rem) !important;
    line-height: 1;
    vertical-align: middle;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.display-body table.display-ranking-table th {
    font-size: 1.08rem !important;
    letter-spacing: 0.08em;
    padding: 0.48rem 1.24rem !important;
}

.display-body table.display-ranking-table tbody td:first-child {
    width: 130px !important;
}

.display-body table.display-ranking-table th:first-child,
.display-body table.display-ranking-table td:first-child {
    width: 130px !important;
    text-align: center;
}

.display-body table.display-ranking-table th:last-child,
.display-body table.display-ranking-table td:last-child {
    width: 182px !important;
}

.display-body table.display-ranking-table-top50 th:nth-child(3),
.display-body table.display-ranking-table-top50 td:nth-child(3) {
    width: 170px !important;
    text-align: center !important;
}

.display-body table.display-ranking-table-top50 th:nth-child(4),
.display-body table.display-ranking-table-top50 td:nth-child(4) {
    width: 132px !important;
    text-align: center !important;
    padding-left: 0.2rem !important;
    padding-right: 0.2rem !important;
}

.display-body .display-merit-box,
.display-body .display-merit-image {
    width: 100% !important;
    min-width: 100% !important;
    min-height: 54px !important;
    height: 54px !important;
    max-height: 54px !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

@media (max-width: 980px) {
    .settings-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}
