:root {
    --tm-bg: #f3f1ea;
    --tm-surface: #fffdf8;
    --tm-surface-alt: #f7f4ec;
    --tm-sidebar: #132025;
    --tm-sidebar-soft: #1b2c32;
    --tm-text: #122025;
    --tm-muted: #5f6d72;
    --tm-border: rgba(18, 32, 37, 0.08);
    --tm-shadow: 0 22px 60px rgba(14, 29, 35, 0.10);
    --tm-primary: #007f73;
    --tm-primary-deep: #05645b;
    --tm-warning: #b77800;
    --tm-danger: #b7402a;
    --tm-success: #1f8a4c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
    color: var(--tm-text);
    background:
        radial-gradient(circle at top left, rgba(0, 127, 115, 0.12), transparent 28%),
        linear-gradient(180deg, #fbfaf6 0%, var(--tm-bg) 100%);
}

body.admin-surface {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
}

.eyebrow,
.sidebar-kicker,
.topbar-kicker {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--tm-primary);
    font-weight: 700;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 1.2fr) minmax(320px, 0.9fr);
}

.auth-brand-panel {
    padding: 3rem;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 30%),
        linear-gradient(135deg, #163036 0%, #0d4b49 48%, #0b6460 100%);
    color: #f5f8f7;
    display: flex;
    align-items: center;
}

.auth-brand-wrap {
    max-width: 620px;
}

.auth-brand-panel h1 {
    font-size: clamp(2.6rem, 5vw, 4.8rem);
    line-height: 0.95;
    margin: 0.75rem 0 1.25rem;
}

.auth-brand-panel p {
    color: rgba(245, 248, 247, 0.88);
    font-size: 1.02rem;
    max-width: 48rem;
}

.auth-feature-grid {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.auth-feature-card {
    padding: 1rem 1.15rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

.auth-feature-card strong,
.auth-feature-card span {
    display: block;
}

.auth-feature-card span {
    color: rgba(245, 248, 247, 0.72);
    font-size: 0.92rem;
    margin-top: 0.35rem;
}

.auth-content-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card-wrap {
    width: 100%;
    max-width: 520px;
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid rgba(18, 32, 37, 0.08);
    border-radius: 28px;
    padding: 2rem;
    box-shadow: var(--tm-shadow);
}

.auth-card-header h2,
.hero-panel h2,
.panel-card h3,
.error-shell h2 {
    margin: 0.4rem 0 0.75rem;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    line-height: 1.05;
}

.auth-card-header p,
.hero-panel p,
.panel-card p,
.error-shell p {
    color: var(--tm-muted);
}

.form-control,
.form-select {
    border-radius: 16px;
    padding: 0.85rem 1rem;
    border-color: rgba(18, 32, 37, 0.12);
    background: #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(0, 127, 115, 0.4);
    box-shadow: 0 0 0 0.25rem rgba(0, 127, 115, 0.14);
}

.btn-brand {
    background: linear-gradient(135deg, var(--tm-primary) 0%, #0b988a 100%);
    color: #fff;
    border: 0;
    border-radius: 16px;
    padding: 0.9rem 1.25rem;
    font-weight: 700;
}

.btn-brand:hover,
.btn-brand:focus {
    color: #fff;
    background: linear-gradient(135deg, var(--tm-primary-deep) 0%, #08766b 100%);
}

.subtle-link {
    color: var(--tm-primary-deep);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
}

.hint-card {
    margin-top: 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: var(--tm-surface-alt);
    border: 1px solid var(--tm-border);
}

.hint-card strong,
.hint-card span {
    display: block;
}

.hint-card span {
    color: var(--tm-muted);
    font-size: 0.92rem;
}

.admin-layout {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 300px 1fr;
    align-items: stretch;
}

.admin-sidebar {
    background:
        radial-gradient(circle at top left, rgba(15, 181, 167, 0.12), transparent 22%),
        linear-gradient(180deg, var(--tm-sidebar) 0%, var(--tm-sidebar-soft) 100%);
    color: #edf6f4;
    padding: 1.4rem;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sidebar-brand {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 1.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand strong {
    display: block;
    font-size: 1.35rem;
    margin-top: 0.35rem;
}

.sidebar-nav {
    padding: 1.35rem 0;
    display: grid;
    gap: 0.45rem;
}

.sidebar-section {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(237, 246, 244, 0.5);
    margin-top: 0.9rem;
    margin-bottom: 0.25rem;
}

.sidebar-link {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    color: #eef7f6;
    text-decoration: none;
    background: transparent;
    border: 1px solid transparent;
    transition: 0.18s ease-in-out;
}

.sidebar-link span,
.sidebar-link small {
    display: block;
}

.sidebar-link small {
    color: rgba(238, 247, 246, 0.62);
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.disabled-link {
    opacity: 0.72;
    cursor: default;
}

.sidebar-footer {
    margin-top: auto;
}

.user-badge-card {
    border-radius: 22px;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-badge-label,
.user-badge-card small {
    color: rgba(237, 246, 244, 0.68);
}

.user-badge-card strong,
.user-badge-card small,
.user-badge-label {
    display: block;
}

.user-badge-card strong {
    margin: 0.35rem 0;
}

.admin-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

.topbar {
    padding: 1.5rem 2rem 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-left h1 {
    margin: 0.2rem 0 0;
    font-size: 2rem;
}

.topbar-search {
    min-width: min(34vw, 360px);
}

.topbar-search input {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
}

.profile-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--tm-border);
    background: rgba(255, 255, 255, 0.82);
}

.notification-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--tm-border);
    background: rgba(255, 255, 255, 0.82);
    font-weight: 700;
}

.notification-chip strong {
    min-width: 1.65rem;
    height: 1.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--tm-danger);
    color: #fff;
    font-size: 0.78rem;
}

.profile-chip-avatar {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tm-primary) 0%, #0b988a 100%);
    color: #fff;
    font-weight: 700;
}

.profile-chip-text,
.profile-chip-text strong,
.profile-chip-text small {
    display: block;
    text-align: left;
}

.profile-chip-text small {
    color: var(--tm-muted);
}

.profile-menu {
    min-width: 280px;
    border-radius: 20px;
}

.notification-menu {
    min-width: min(420px, 92vw);
    border-radius: 22px;
}

.notification-stack {
    display: grid;
    gap: 0.8rem;
}

.notification-dropdown-item {
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: var(--tm-surface-alt);
    border: 1px solid var(--tm-border);
}

.notification-dropdown-item.unread {
    border-color: rgba(0, 127, 115, 0.22);
    background: rgba(0, 127, 115, 0.06);
}

.notification-dropdown-item strong,
.notification-dropdown-item small {
    display: block;
}

.notification-dropdown-item small {
    color: var(--tm-muted);
    margin-top: 0.28rem;
}

.notification-dropdown-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.55rem;
}

.profile-menu-header {
    padding-bottom: 0.9rem;
    margin-bottom: 0.9rem;
    border-bottom: 1px solid var(--tm-border);
}

.profile-menu-header strong,
.profile-menu-header small {
    display: block;
}

.profile-menu-header small {
    color: var(--tm-muted);
}

.admin-content {
    padding: 0 2rem 2rem;
}

.page-section {
    margin-bottom: 1.5rem;
}

.hero-panel,
.panel-card,
.metric-card {
    border-radius: 28px;
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid var(--tm-border);
    box-shadow: var(--tm-shadow);
}

.hero-panel {
    padding: 1.65rem;
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-end;
}

.hero-panel.compact {
    align-items: center;
}

.hero-meta-grid {
    display: grid;
    gap: 0.85rem;
    min-width: min(28rem, 100%);
}

.hero-meta-card,
.panel-card,
.metric-card {
    padding: 1.25rem;
}

.hero-meta-card {
    border-radius: 22px;
    background: var(--tm-surface-alt);
    border: 1px solid var(--tm-border);
}

.hero-meta-card span,
.hero-meta-card strong,
.metric-card span,
.metric-card strong,
.metric-card small {
    display: block;
}

.hero-meta-card span,
.metric-card span,
.metric-card small,
.timeline-item p,
.feature-list li {
    color: var(--tm-muted);
}

.metric-card strong {
    font-size: 2.2rem;
    line-height: 1;
    margin: 0.7rem 0 0.45rem;
}

.metric-card.tone-primary {
    border-top: 4px solid var(--tm-primary);
}

.metric-card.tone-success {
    border-top: 4px solid var(--tm-success);
}

.metric-card.tone-warning {
    border-top: 4px solid var(--tm-warning);
}

.metric-card.tone-danger {
    border-top: 4px solid var(--tm-danger);
}

.panel-card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.timeline-list,
.quick-action-list,
.feature-list {
    display: grid;
    gap: 0.9rem;
}

.timeline-item,
.quick-action-item {
    padding: 1rem 1.05rem;
    border-radius: 20px;
    background: var(--tm-surface-alt);
    border: 1px solid var(--tm-border);
}

.quick-action-item {
    text-decoration: none;
    color: inherit;
}

.quick-action-item span,
.quick-action-item small {
    display: block;
}

.error-shell {
    max-width: 520px;
    margin: 6rem auto;
    padding: 2rem;
    border-radius: 26px;
    background: rgba(255, 253, 248, 0.92);
    box-shadow: var(--tm-shadow);
    border: 1px solid var(--tm-border);
    text-align: center;
}

.sidebar-close,
.topbar-toggle {
    color: inherit;
    text-decoration: none;
}

@media (max-width: 1199.98px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        min-height: 280px;
    }

    .hero-panel {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 991.98px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: fixed;
        z-index: 1040;
        width: 300px;
        max-width: calc(100vw - 1rem);
        transform: translateX(-100%);
        transition: transform 0.2s ease-in-out;
    }

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

    .topbar,
    .admin-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-right {
        justify-content: space-between;
    }

    .topbar-search {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 767.98px) {
    .auth-brand-panel,
    .auth-content-panel {
        padding: 1.25rem;
    }

    .auth-card-wrap,
    .hero-panel,
    .panel-card,
    .metric-card,
    .error-shell {
        border-radius: 22px;
    }

    .profile-chip-text small,
    .sidebar-link small {
        display: none;
    }
}


.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-toolbar h2 {
    margin: 0.35rem 0 0.6rem;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.page-toolbar p {
    margin: 0;
    color: var(--tm-muted);
    max-width: 56rem;
}

.filter-card,
.table-card,
.form-shell {
    border-radius: 28px;
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid var(--tm-border);
    box-shadow: var(--tm-shadow);
}

.filter-card,
.form-shell {
    padding: 1.25rem;
}

.table-card {
    overflow: hidden;
}

.admin-table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tm-muted);
    border-bottom-color: var(--tm-border);
    background: rgba(255, 255, 255, 0.7);
}

.admin-table tbody td {
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-bottom-color: var(--tm-border);
}

.table-meta {
    color: var(--tm-muted);
    font-size: 0.88rem;
    margin-top: 0.22rem;
}

.table-actions {
    white-space: nowrap;
}

.inline-form {
    display: inline;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-pill.active,
.status-pill.completed {
    background: rgba(31, 138, 76, 0.12);
    color: var(--tm-success);
}

.status-pill.inactive,
.status-pill.terminated,
.status-pill.failed {
    background: rgba(183, 64, 42, 0.12);
    color: var(--tm-danger);
}

.status-pill.on_leave,
.status-pill.overdue {
    background: rgba(183, 120, 0, 0.14);
    color: var(--tm-warning);
}

.form-page .panel-card {
    padding: 1.35rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.empty-state {
    min-height: 220px;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 2rem;
}

.empty-state.compact {
    min-height: auto;
}

.notification-item.unread {
    border-color: rgba(0, 127, 115, 0.2);
    background: rgba(0, 127, 115, 0.06);
}

.empty-state strong,
.empty-state span {
    display: block;
}

.empty-state span {
    color: var(--tm-muted);
    margin-top: 0.35rem;
}

.form-text {
    color: var(--tm-muted);
}

.account-toggle-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.toolbar-cluster {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

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

.training-card {
    border-radius: 24px;
    border: 1px solid var(--tm-border);
    background: var(--tm-surface-alt);
    padding: 1.1rem;
    display: grid;
    gap: 1rem;
}

.training-card-kicker {
    display: inline-block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tm-primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.training-card h3 {
    margin: 0 0 0.4rem;
    font-size: 1.25rem;
}

.training-card p {
    margin: 0 0 0.75rem;
    color: var(--tm-muted);
}

.training-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
}

.training-meta-row.stack {
    flex-direction: column;
    align-items: flex-start;
}

.training-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(18, 32, 37, 0.08);
    overflow: hidden;
    margin: 0.85rem 0 0.55rem;
}

.training-progress-bar.large {
    height: 12px;
}

.training-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--tm-primary) 0%, #08a694 100%);
}

.path-course-stack {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.path-course-link,
.support-material-item {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 18px;
    border: 1px solid var(--tm-border);
    background: rgba(255, 255, 255, 0.72);
    padding: 0.9rem 1rem;
}

.path-course-link span,
.path-course-link small,
.support-material-item strong,
.support-material-item span {
    display: block;
}

.path-course-link small,
.support-material-item span,
.player-inline-note span,
.player-stage-meta small {
    color: var(--tm-muted);
}

.player-shell {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.player-sidebar {
    position: sticky;
    top: 1rem;
    display: grid;
    gap: 1rem;
}

.player-course-card,
.player-lesson-list,
.player-stage,
.support-material-list,
.document-stage {
    border-radius: 28px;
}

.player-course-card {
    padding: 1.25rem;
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid var(--tm-border);
    box-shadow: var(--tm-shadow);
}

.player-course-card strong {
    display: block;
    font-size: 2.4rem;
    line-height: 1;
    margin: 0.5rem 0 0.85rem;
}

.player-course-card small {
    color: var(--tm-muted);
}

.player-lesson-list {
    display: grid;
    gap: 0.75rem;
}

.lesson-nav-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: flex-start;
    padding: 0.95rem;
    border-radius: 22px;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid var(--tm-border);
    box-shadow: var(--tm-shadow);
}

.lesson-nav-item.active {
    border-color: rgba(0, 127, 115, 0.22);
    box-shadow: 0 18px 35px rgba(0, 127, 115, 0.10);
}

.lesson-nav-item.locked {
    opacity: 0.72;
    cursor: not-allowed;
}

.lesson-nav-index {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--tm-surface-alt);
    font-weight: 700;
}

.lesson-nav-content strong,
.support-material-item strong {
    display: block;
}

.player-main {
    min-width: 0;
    display: grid;
    gap: 1rem;
}

.player-stage {
    padding: 1.35rem;
}

.player-stage-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.player-stage-header h3 {
    margin: 0.35rem 0 0.5rem;
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
}

.player-stage-header p {
    margin: 0;
    color: var(--tm-muted);
}

.player-stage-meta {
    text-align: right;
}

.player-stage-meta small {
    display: block;
}

.video-player-wrap {
    border-radius: 24px;
    overflow: hidden;
    background: #0f171a;
}

.training-video {
    display: block;
    width: 100%;
    max-height: min(70vh, 680px);
    background: #0f171a;
}

.player-inline-note {
    margin-top: 0.95rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: var(--tm-surface-alt);
    border: 1px solid var(--tm-border);
}

.player-inline-note strong,
.player-inline-note span {
    display: block;
}

.content-block p {
    margin: 0;
    color: var(--tm-text);
    line-height: 1.7;
}

.support-material-list {
    display: grid;
    gap: 0.75rem;
}

.document-stage {
    padding: 1.35rem;
    background: var(--tm-surface-alt);
    border: 1px solid var(--tm-border);
    display: grid;
    gap: 1rem;
}

.document-stage p {
    margin: 0.5rem 0 0;
    color: var(--tm-muted);
}

.quiz-builder,
.quiz-question-stack,
.quiz-result-stack,
.quiz-requirement-grid {
    display: grid;
    gap: 1rem;
}

.quiz-question-card,
.quiz-play-card,
.quiz-result-card,
.quiz-requirement-card {
    border-radius: 22px;
    border: 1px solid var(--tm-border);
    background: var(--tm-surface-alt);
    padding: 1rem;
}

.quiz-question-header,
.quiz-play-card-header,
.quiz-result-card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0.85rem;
}

.quiz-option-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.quiz-answer-option {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--tm-border);
    background: rgba(255, 255, 255, 0.72);
}

.quiz-play-options,
.quiz-result-options {
    display: grid;
    gap: 0.75rem;
}

.quiz-result-card.is-correct {
    border-color: rgba(31, 138, 76, 0.18);
}

.quiz-result-card.is-incorrect {
    border-color: rgba(183, 64, 42, 0.16);
}

.quiz-result-option {
    border-radius: 16px;
    padding: 0.85rem 0.95rem;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid var(--tm-border);
}

.quiz-result-option.correct {
    border-color: rgba(31, 138, 76, 0.25);
}

.quiz-result-option.selected {
    box-shadow: inset 0 0 0 2px rgba(0, 127, 115, 0.16);
}

.quiz-result-option strong,
.quiz-result-option small,
.quiz-requirement-card strong,
.quiz-requirement-card span,
.quiz-requirement-card small {
    display: block;
}

.quiz-result-option small,
.quiz-result-explanation,
.quiz-requirement-card span,
.quiz-requirement-card small {
    color: var(--tm-muted);
}

.quiz-result-explanation {
    margin: 0.9rem 0 0;
}

.quiz-requirement-card {
    text-decoration: none;
    color: inherit;
}

@media (max-width: 991.98px) {
    .page-toolbar,
    .form-actions,
    .account-toggle-row,
    .toolbar-cluster,
    .player-stage-header,
    .training-meta-row,
    .quiz-question-header,
    .quiz-play-card-header,
    .quiz-result-card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .player-stage-meta {
        text-align: left;
    }
}

@media (max-width: 1199.98px) {
    .player-shell {
        grid-template-columns: 1fr;
    }

    .player-sidebar {
        position: static;
    }
}

/* Product-grade visual refresh */
:root {
    --tm-bg: #e8edf5;
    --tm-surface: rgba(255, 255, 255, 0.82);
    --tm-surface-alt: rgba(246, 249, 253, 0.92);
    --tm-sidebar: #0f172a;
    --tm-sidebar-soft: #1e293b;
    --tm-text: #0f172a;
    --tm-muted: #475569;
    --tm-border: rgba(15, 23, 42, 0.10);
    --tm-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    --tm-primary: #0f6dff;
    --tm-primary-deep: #0a4fbc;
    --tm-warning: #b7791f;
    --tm-danger: #c53030;
    --tm-success: #2f855a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 10% -10%, rgba(15, 109, 255, 0.20), transparent 38%),
        radial-gradient(circle at 100% 0%, rgba(56, 189, 248, 0.16), transparent 36%),
        linear-gradient(180deg, #f7fbff 0%, #e8edf5 100%);
}

body.admin-surface::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(15, 23, 42, 0.05) 0.6px, transparent 0.6px);
    background-size: 16px 16px;
    opacity: 0.25;
    z-index: -1;
}

.spa-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.spa-progress span {
    display: block;
    width: 100%;
    height: 100%;
    transform-origin: 0 50%;
    transform: scaleX(0);
    background: linear-gradient(90deg, #0f6dff 0%, #38bdf8 100%);
}

body.is-loading .spa-progress {
    opacity: 1;
}

body.is-loading .spa-progress span {
    animation: tm-load-progress 1.05s ease-in-out infinite;
}

@keyframes tm-load-progress {
    0% { transform: scaleX(0.08); }
    70% { transform: scaleX(0.72); }
    100% { transform: scaleX(1); }
}

.admin-layout {
    grid-template-columns: 316px 1fr;
}

.admin-sidebar {
    border-right: 1px solid rgba(148, 163, 184, 0.20);
    backdrop-filter: blur(20px);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

.sidebar-link {
    border-radius: 16px;
    backdrop-filter: blur(8px);
}

.sidebar-link:hover,
.sidebar-link.active {
    transform: translateX(2px);
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(15, 109, 255, 0.28) 0%, rgba(56, 189, 248, 0.16) 100%);
    border-color: rgba(148, 197, 255, 0.35);
}

.user-badge-card {
    background: linear-gradient(150deg, rgba(15, 109, 255, 0.20) 0%, rgba(15, 23, 42, 0.22) 100%);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    margin: 0 1.2rem;
    padding: 1.1rem 1.4rem;
    border-radius: 0 0 24px 24px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-top: 0;
    background: rgba(247, 251, 255, 0.78);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.topbar-kicker,
.eyebrow,
.sidebar-kicker {
    color: #0a4fbc;
    letter-spacing: 0.14em;
}

.topbar-left h1,
.page-toolbar h2,
.hero-panel h2,
.panel-card h3,
.player-stage-header h3,
.auth-card-header h2 {
    letter-spacing: -0.03em;
}

.topbar-search {
    min-width: min(32vw, 360px);
}

.topbar-search input {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.topbar-search input.is-invalid {
    border-color: rgba(197, 48, 48, 0.42);
    box-shadow: 0 0 0 0.2rem rgba(197, 48, 48, 0.15);
}

.profile-chip,
.notification-chip {
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.admin-content {
    padding: 1.2rem 2rem 2.2rem;
}

.hero-panel,
.panel-card,
.metric-card,
.filter-card,
.table-card,
.form-shell,
.player-course-card,
.lesson-nav-item,
.auth-card-wrap,
.error-shell {
    background: var(--tm-surface);
    backdrop-filter: blur(16px);
    border-color: rgba(148, 163, 184, 0.24);
}

.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: "";
    position: absolute;
    inset: auto -35% -55% auto;
    width: 180px;
    height: 180px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(15, 109, 255, 0.14) 0%, transparent 70%);
    pointer-events: none;
}

.panel-card-header {
    margin-bottom: 1.1rem;
}

.timeline-item,
.quick-action-item,
.training-card,
.path-course-link,
.support-material-item,
.quiz-question-card,
.quiz-play-card,
.quiz-result-card,
.quiz-requirement-card,
.document-stage,
.player-inline-note,
.notification-dropdown-item {
    background: var(--tm-surface-alt);
    border-color: rgba(148, 163, 184, 0.24);
}

.quick-action-item,
.path-course-link,
.support-material-item,
.quiz-requirement-card,
.lesson-nav-item,
.notification-dropdown-item {
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.quick-action-item:hover,
.path-course-link:hover,
.support-material-item:hover,
.quiz-requirement-card:hover,
.lesson-nav-item:hover,
.notification-dropdown-item:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 109, 255, 0.28);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.form-control,
.form-select {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.95);
}

.form-control:hover,
.form-select:hover {
    border-color: rgba(100, 116, 139, 0.55);
}

.btn {
    border-radius: 14px;
}

.btn-brand {
    background: linear-gradient(140deg, #0f6dff 0%, #0a4fbc 100%);
    box-shadow: 0 12px 22px rgba(10, 79, 188, 0.28);
}

.btn-brand:hover,
.btn-brand:focus {
    background: linear-gradient(140deg, #0a61e6 0%, #0848aa 100%);
    transform: translateY(-1px);
}

.btn-light {
    border-color: rgba(148, 163, 184, 0.32);
    background: rgba(255, 255, 255, 0.85);
}

.btn-light:hover,
.btn-outline-dark:hover,
.btn-dark:hover {
    transform: translateY(-1px);
}

.admin-table thead th {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(148, 163, 184, 0.28);
}

.admin-table tbody tr {
    transition: background-color 0.14s ease;
}

.admin-table tbody tr:hover {
    background: rgba(15, 109, 255, 0.05);
}

.alert {
    border-radius: 16px;
}

.empty-state {
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px dashed rgba(148, 163, 184, 0.40);
}

.page-section,
.panel-card,
.metric-card,
.filter-card,
.table-card,
.form-shell {
    animation: tm-fade-up 0.28s ease both;
}

@keyframes tm-fade-up {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

@media (max-width: 991.98px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .topbar {
        margin: 0;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .admin-content {
        padding-top: 1rem;
    }
}

/* Layout fixes and realtime feedback layer */
.form-side-stack {
    display: grid;
    gap: 1rem;
    align-content: start;
}

.form-side-stack .side-card {
    margin: 0;
}

.filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    width: 100%;
}

.filter-actions .btn {
    min-width: 112px;
}

.live-form-meta {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding: 0.65rem 0.8rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.72);
}

.live-form-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: #0a4fbc;
}

.live-form-progress {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.2);
}

.live-form-progress > span {
    display: block;
    width: 6%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f6dff 0%, #38bdf8 100%);
    transition: width 0.22s ease;
}

.live-form-hint {
    color: var(--tm-muted);
    font-size: 0.84rem;
}

.form-shell.is-complete .live-form-meta {
    border-color: rgba(47, 133, 90, 0.38);
    background: rgba(47, 133, 90, 0.06);
}

.filter-live-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 0.8rem;
    border-radius: 999px;
    padding: 0.32rem 0.66rem;
    font-size: 0.76rem;
    font-weight: 700;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.74);
    color: var(--tm-muted);
}

.filter-live-chip.is-active {
    color: #0a4fbc;
    border-color: rgba(15, 109, 255, 0.34);
    background: rgba(15, 109, 255, 0.08);
}

.tm-stagger-item {
    animation: tm-item-rise 0.34s ease both;
    animation-delay: var(--tm-stagger-delay, 0ms);
}

@keyframes tm-item-rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.tm-toast-viewport {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2050;
    display: grid;
    gap: 0.55rem;
    width: min(360px, calc(100vw - 32px));
}

.tm-toast {
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(12px);
    padding: 0.78rem 0.9rem;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tm-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tm-toast strong,
.tm-toast span {
    display: block;
}

.tm-toast strong {
    font-size: 0.86rem;
}

.tm-toast span {
    margin-top: 0.2rem;
    color: var(--tm-muted);
    font-size: 0.84rem;
}

.tm-toast-success {
    border-color: rgba(47, 133, 90, 0.28);
}

.tm-toast-error {
    border-color: rgba(197, 48, 48, 0.32);
}

.btn.is-submitting {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: wait;
}

.panel-card.tm-invalid-pulse {
    animation: tm-invalid-pulse 0.4s ease;
}

@keyframes tm-invalid-pulse {
    0% { box-shadow: 0 0 0 0 rgba(197, 48, 48, 0.02); }
    50% { box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.2); }
    100% { box-shadow: 0 0 0 0 rgba(197, 48, 48, 0.02); }
}

@media (max-width: 767.98px) {
    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .tm-toast-viewport {
        left: 12px;
        right: 12px;
        top: 12px;
        width: auto;
    }
}
