:root {
    --fds-bg: #f5f7fb;
    --fds-panel: #ffffff;
    --fds-text: #152033;
    --fds-muted: #64748b;
    --fds-border: #dde5ef;
    --fds-primary: #2457d6;
    --fds-secondary: #17a2b8;
    --fds-sidebar: #101827;
    --fds-sidebar-text: #e5edf7;
    --fds-player-bg: #05070b;
    --fds-player-text: #ffffff;
    --fds-player-accent: #2457d6;
}

* {
    box-sizing: border-box;
}

body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--fds-text);
    background: var(--fds-bg);
}

a {
    text-decoration: none;
}

.btn {
    border-radius: 999px;
    font-weight: 500;
    letter-spacing: 0.01em;
    box-shadow: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:hover,
.btn:focus,
.btn:active,
.btn.active,
.btn:first-child:active,
:not(.btn-check) + .btn:active {
    box-shadow: none;
}

.btn:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--fds-primary) 28%, transparent);
    outline-offset: 2px;
}

.btn-primary {
    --bs-btn-bg: var(--fds-primary);
    --bs-btn-border-color: var(--fds-primary);
    --bs-btn-hover-bg: color-mix(in srgb, var(--fds-primary) 86%, #000000);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--fds-primary) 86%, #000000);
    --bs-btn-active-bg: color-mix(in srgb, var(--fds-primary) 78%, #000000);
    --bs-btn-active-border-color: color-mix(in srgb, var(--fds-primary) 78%, #000000);
    --bs-btn-focus-shadow-rgb: none;
    --bs-btn-box-shadow: none;
    --bs-btn-active-shadow: none;
}

.btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding-inline: 16px;
    border: 0;
    box-shadow: none;
}

.btn-modern:hover,
.btn-modern:focus-visible {
    transform: none;
    box-shadow: none;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 999px;
}

.btn-soft {
    border: 1px solid var(--fds-border);
    background: var(--fds-panel);
    color: var(--fds-text);
    box-shadow: none;
}

.btn-soft:hover,
.btn-soft:focus-visible {
    border-color: color-mix(in srgb, var(--fds-primary) 35%, var(--fds-border));
    background: color-mix(in srgb, var(--fds-primary) 6%, var(--fds-panel));
    color: var(--fds-primary);
    box-shadow: none;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--fds-border);
    border-radius: 999px;
    background: var(--fds-panel);
    color: var(--fds-muted);
    line-height: 1;
    box-shadow: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn.btn-action {
    min-height: 34px;
    box-shadow: none;
}

.btn-action:hover,
.btn-action:focus-visible {
    border-color: color-mix(in srgb, var(--fds-primary) 40%, var(--fds-border));
    background: color-mix(in srgb, var(--fds-primary) 8%, var(--fds-panel));
    color: var(--fds-primary);
    transform: none;
    box-shadow: none;
}

.btn-action--primary {
    border-color: color-mix(in srgb, var(--fds-primary) 24%, var(--fds-border));
    color: var(--fds-primary);
}

.btn-action--danger:hover,
.btn-action--danger:focus-visible {
    border-color: color-mix(in srgb, #dc3545 35%, var(--fds-border));
    background: color-mix(in srgb, #dc3545 8%, var(--fds-panel));
    color: #dc3545;
}

.form-control,
.form-select {
    border-color: var(--fds-border);
    border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--fds-primary);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--fds-primary) 18%, transparent);
}

.login-page {
    min-height: 100vh;
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--fds-bg);
    color: var(--fds-text);
}

.login-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
}

.login-showcase {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: clamp(32px, 6vw, 72px);
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--fds-primary) 28%, transparent), transparent 42%),
        radial-gradient(circle at bottom right, color-mix(in srgb, var(--fds-secondary) 22%, transparent), transparent 36%),
        linear-gradient(145deg, var(--fds-sidebar) 0%, color-mix(in srgb, var(--fds-sidebar) 82%, var(--fds-primary)) 100%);
    color: #eef4ff;
}

.login-showcase-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

.login-showcase-glow--one {
    top: -80px;
    left: -40px;
    width: 240px;
    height: 240px;
    background: color-mix(in srgb, var(--fds-primary) 42%, transparent);
}

.login-showcase-glow--two {
    right: -60px;
    bottom: -80px;
    width: 280px;
    height: 280px;
    background: color-mix(in srgb, var(--fds-secondary) 34%, transparent);
}

.login-showcase-grid {
    position: absolute;
    inset: 0;
    opacity: 0.16;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 95%);
}

.login-showcase-content {
    position: relative;
    z-index: 1;
    max-width: 520px;
}

.login-brand-logo {
    display: block;
    max-width: min(100%, 200px);
    max-height: 52px;
    margin-bottom: 28px;
    object-fit: contain;
    object-position: left center;
}

.login-brand-logo--light {
    filter: brightness(0) invert(1);
}

.login-mobile-brand {
    display: none;
    justify-content: center;
    width: min(100%, 420px);
    margin-bottom: 18px;
}

.login-mobile-brand .login-brand-logo {
    margin-bottom: 0;
    max-width: min(100%, 160px);
}

.login-mobile-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-align: center;
}

.login-showcase-content h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.08;
}

.login-showcase-content > p {
    margin: 0 0 28px;
    max-width: 460px;
    color: rgba(238, 244, 255, 0.76);
    font-size: 1rem;
    line-height: 1.65;
}

.login-showcase-content .login-brand-logo + p {
    margin-top: 0;
}

.login-showcase-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.login-showcase-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(238, 244, 255, 0.88);
    font-size: 0.94rem;
    font-weight: 500;
}

.login-showcase-features i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 0.95rem;
}

.login-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 48px);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--fds-primary) 4%, var(--fds-bg)), var(--fds-bg));
}

.login-card {
    width: min(100%, 420px);
    padding: clamp(28px, 4vw, 36px);
    border: 1px solid var(--fds-border);
    border-radius: 24px;
    background: var(--fds-panel);
}

.login-card-head {
    margin-bottom: 28px;
}

.login-card-head h2 {
    margin: 0 0 4px;
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.login-card-head p {
    margin: 0;
    color: var(--fds-muted);
    font-size: 0.92rem;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, #dc3545 28%, var(--fds-border));
    border-radius: 14px;
    background: color-mix(in srgb, #dc3545 8%, var(--fds-panel));
    color: #b42318;
    font-size: 0.9rem;
    font-weight: 500;
}

.login-alert i {
    flex-shrink: 0;
    margin-top: 1px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-field .form-label {
    margin-bottom: 8px;
    font-size: 0.88rem;
    font-weight: 500;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap > i {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--fds-muted);
    pointer-events: none;
}

.login-input-wrap .form-control {
    min-height: 50px;
    padding-left: 42px;
    padding-right: 44px;
    border-color: var(--fds-border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--fds-panel) 92%, var(--fds-bg));
}

.login-input-wrap .form-control:focus {
    border-color: color-mix(in srgb, var(--fds-primary) 45%, var(--fds-border));
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--fds-primary) 12%, transparent);
}

.login-toggle-password {
    position: absolute;
    top: 50%;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--fds-muted);
    transform: translateY(-50%);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.login-toggle-password:hover,
.login-toggle-password:focus-visible {
    background: color-mix(in srgb, var(--fds-primary) 8%, transparent);
    color: var(--fds-primary);
    outline: none;
}

.login-submit {
    justify-content: center;
    width: 100%;
    min-height: 50px;
    margin-top: 4px;
    font-size: 0.96rem;
}

.login-footnote {
    margin: 22px 0 0;
    color: var(--fds-muted);
    font-size: 0.82rem;
    text-align: center;
}

.login-page .brand-mark,
.login-page .brand-logo-img {
    display: none;
}

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

    .login-showcase {
        display: none;
    }

    .login-mobile-brand {
        display: flex;
    }

    .login-panel {
        min-height: 100vh;
        padding: 24px 18px;
    }

    .login-card {
        border-radius: 20px;
    }
}

.brand-mark,
.sidebar-logo-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--fds-primary), var(--fds-secondary));
    color: #ffffff;
    font-weight: 600;
}

.brand-mark.has-image {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.brand-logo-img {
    display: block;
    max-width: 78%;
    max-height: 78%;
    object-fit: contain;
}

.admin-shell-page {
    min-height: 100vh;
    background: var(--fds-bg);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 400;
}

.admin-page-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: color-mix(in srgb, var(--fds-bg) 72%, transparent);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.admin-page-loader.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.admin-page-loader-inner {
    display: grid;
    justify-items: center;
    gap: 14px;
    min-width: 148px;
    padding: 22px 24px;
    border: 1px solid var(--fds-border);
    border-radius: 18px;
    background: var(--fds-panel);
    box-shadow: 0 18px 42px rgba(21, 32, 51, 0.12);
}

.admin-page-loader-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid color-mix(in srgb, var(--fds-primary) 16%, transparent);
    border-top-color: var(--fds-primary);
    border-radius: 50%;
    animation: admin-page-loader-spin 0.75s linear infinite;
}

.admin-page-loader-inner span {
    color: var(--fds-muted);
    font-size: 0.84rem;
    font-weight: 500;
}

@keyframes admin-page-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-page-loader-spinner {
        animation: none;
        border-top-color: var(--fds-primary);
    }

    .admin-page-loader {
        transition: none;
    }
}

.admin-shell-page h1,
.admin-shell-page h2,
.admin-shell-page h3,
.admin-shell-page h4,
.admin-shell-page h5,
.admin-shell-page h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1030;
    width: 272px;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--fds-sidebar) 94%, var(--fds-primary)), var(--fds-sidebar)),
        var(--fds-sidebar);
    color: var(--fds-sidebar-text);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    transition: width 0.24s ease, padding 0.24s ease;
}

.admin-shell-page.sidebar-collapsed .admin-sidebar {
    width: 78px;
    padding-inline: 12px;
}

.admin-mobile-sidebar {
    background: var(--fds-sidebar);
    color: var(--fds-sidebar-text);
}

.admin-mobile-sidebar .offcanvas-body {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 72px);
    padding: 0 18px 18px;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 44px;
    margin-bottom: 14px;
}

.sidebar-brand {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 40px;
    overflow: hidden;
}

.sidebar-logo-full {
    display: block;
    max-width: 100%;
    max-height: 38px;
    object-fit: contain;
    object-position: left center;
    filter: brightness(0) invert(1);
}

.sidebar-logo-full.sidebar-logo-text {
    width: auto;
    height: auto;
    padding: 0;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #ffffff;
    filter: none;
}

.sidebar-logo-icon {
    display: none;
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex: 0 0 32px;
}

.sidebar-logo-icon.sidebar-logo-text {
    display: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
}

.sidebar-logo-icon--mono {
    filter: none;
}

.admin-shell-page.sidebar-collapsed .sidebar-head {
    justify-content: center;
}

.admin-shell-page.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    width: 100%;
}

.admin-shell-page.sidebar-collapsed .sidebar-logo-full {
    display: none;
}

.admin-shell-page.sidebar-collapsed .sidebar-logo-icon {
    display: block;
}

.admin-shell-page.sidebar-collapsed .sidebar-logo-icon.sidebar-logo-text {
    display: inline-flex;
}

.sidebar-nav {
    display: grid;
    gap: 4px;
    flex: 1 1 auto;
    align-content: start;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    color: color-mix(in srgb, var(--fds-sidebar-text) 78%, transparent);
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.sidebar-nav i {
    flex: 0 0 20px;
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
    opacity: 0.92;
}

.sidebar-nav span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-shell-page.sidebar-collapsed .sidebar-nav a {
    justify-content: center;
    padding-inline: 0;
}

.admin-shell-page.sidebar-collapsed .sidebar-nav span {
    display: none;
}

.sidebar-storage {
    margin-top: auto;
    padding: 14px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-storage-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.sidebar-storage-label {
    color: color-mix(in srgb, var(--fds-sidebar-text) 72%, transparent);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-storage-value {
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 600;
}

.sidebar-storage-track {
    overflow: hidden;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-storage-bar {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22a06b, #198754);
    transition: width 0.35s ease;
}

.sidebar-storage-meta {
    display: block;
    margin-top: 8px;
    color: color-mix(in srgb, var(--fds-sidebar-text) 58%, transparent);
    font-size: 0.72rem;
    line-height: 1.35;
}

.admin-shell-page.sidebar-collapsed .sidebar-storage {
    display: none;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: color-mix(in srgb, var(--fds-sidebar-text) 76%, transparent);
    font-size: 0.84rem;
}

.sidebar-footer-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-footer-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 500;
    white-space: nowrap;
}

.sidebar-footer-logout:hover {
    color: #ffffff;
}

.admin-shell-page.sidebar-collapsed .sidebar-footer {
    flex-direction: column;
    gap: 8px;
}

.admin-shell-page.sidebar-collapsed .sidebar-footer-name {
    display: none;
}

.admin-mobile-sidebar .sidebar-head {
    justify-content: center;
    margin-bottom: 18px;
}

.admin-mobile-sidebar .sidebar-brand {
    justify-content: center;
}

.admin-mobile-sidebar .sidebar-logo-full {
    display: block !important;
}

.admin-mobile-sidebar .sidebar-logo-icon {
    display: none !important;
}

.admin-table .btn-outline-danger.btn-sm:hover {
    border-color: color-mix(in srgb, #dc3545 35%, var(--fds-border));
    background: color-mix(in srgb, #dc3545 8%, var(--fds-panel));
    color: #dc3545;
}

.admin-table .btn-outline-primary.btn-sm {
    border-radius: 999px;
}

.badge {
    font-weight: 500;
}

.admin-action-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-action-group form {
    display: inline-flex;
    margin: 0;
}

.admin-main {
    min-height: 100vh;
    transition: padding-left 0.24s ease;
}

@media (min-width: 992px) {
    .admin-main {
        padding-left: 272px;
    }

    .admin-shell-page.sidebar-collapsed .admin-main {
        padding-left: 78px;
    }
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 82px;
    padding: 16px clamp(18px, 3vw, 34px);
    background: color-mix(in srgb, var(--fds-bg) 88%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--fds-border) 72%, transparent);
    backdrop-filter: blur(16px);
}

.admin-topbar-start {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 auto;
}

.sidebar-toggle-header {
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--fds-border);
    border-radius: 999px;
    background: var(--fds-panel);
    color: var(--fds-text);
    cursor: pointer;
    box-shadow: none;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

.sidebar-toggle-header:hover,
.sidebar-toggle-header:focus-visible {
    border-color: color-mix(in srgb, var(--fds-primary) 34%, var(--fds-border));
    background: color-mix(in srgb, var(--fds-primary) 6%, var(--fds-panel));
    color: var(--fds-primary);
    box-shadow: none;
    outline: none;
}

.sidebar-toggle-header:active {
    transform: none;
}

.sidebar-toggle-header i {
    font-size: 1.12rem;
    line-height: 1;
}

.btn-mobile-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--fds-border);
    border-radius: 999px;
    background: var(--fds-panel);
    color: var(--fds-text);
    box-shadow: none;
}

.btn-mobile-menu:hover,
.btn-mobile-menu:focus-visible {
    border-color: color-mix(in srgb, var(--fds-primary) 34%, var(--fds-border));
    background: color-mix(in srgb, var(--fds-primary) 6%, var(--fds-panel));
    color: var(--fds-primary);
    outline: none;
}

.btn-mobile-menu i {
    font-size: 1.25rem;
    line-height: 1;
}

.admin-topbar-title {
    min-width: 0;
}

.admin-topbar h1 {
    margin: 0;
    font-size: clamp(1.28rem, 2vw, 1.65rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 600;
}

.page-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--fds-muted);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.admin-toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(calc(100vw - 32px), 380px);
    pointer-events: none;
}

.admin-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--fds-border);
    border-radius: 16px;
    background: var(--fds-panel);
    color: var(--fds-text);
    box-shadow: none;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(18px);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.admin-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.admin-toast.is-leaving {
    opacity: 0;
    transform: translateX(18px);
}

.admin-toast--success {
    border-color: color-mix(in srgb, #198754 28%, var(--fds-border));
    background: color-mix(in srgb, #198754 8%, var(--fds-panel));
}

.admin-toast--danger {
    border-color: color-mix(in srgb, #dc3545 28%, var(--fds-border));
    background: color-mix(in srgb, #dc3545 8%, var(--fds-panel));
}

.admin-toast--warning {
    border-color: color-mix(in srgb, #ffc107 35%, var(--fds-border));
    background: color-mix(in srgb, #ffc107 10%, var(--fds-panel));
}

.admin-toast-icon {
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 1.05rem;
}

.admin-toast--success .admin-toast-icon {
    color: #198754;
}

.admin-toast--danger .admin-toast-icon {
    color: #dc3545;
}

.admin-toast--warning .admin-toast-icon {
    color: #b78103;
}

.admin-toast-body {
    flex: 1;
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.45;
}

.admin-toast-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--fds-muted);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.admin-toast-close:hover,
.admin-toast-close:focus-visible {
    background: color-mix(in srgb, currentColor 8%, transparent);
    color: var(--fds-text);
    outline: none;
}

.admin-user-menu {
    position: relative;
}

.admin-user-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 4px 12px 4px 4px;
    border: 1px solid var(--fds-border);
    border-radius: 999px;
    background: var(--fds-panel);
    color: var(--fds-text);
    cursor: pointer;
    box-shadow: none;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.admin-user-toggle:hover,
.admin-user-toggle:focus-visible,
.admin-user-toggle.show {
    border-color: color-mix(in srgb, var(--fds-primary) 34%, var(--fds-border));
    background: color-mix(in srgb, var(--fds-primary) 4%, var(--fds-panel));
    box-shadow: none;
    outline: none;
}

.admin-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fds-primary), var(--fds-secondary));
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    flex: 0 0 36px;
}

.admin-user-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-user-avatar--lg {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    font-size: 0.92rem;
}

.admin-user-name {
    max-width: 150px;
    overflow: hidden;
    font-size: 0.88rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-toggle .bi-chevron-down {
    color: var(--fds-muted);
    font-size: 0.78rem;
}

.admin-user-dropdown {
    min-width: 260px;
    padding: 10px;
    border: 1px solid var(--fds-border);
    border-radius: 16px;
    box-shadow: 0 18px 42px rgba(21, 32, 51, 0.12);
}

.admin-user-dropdown-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 10px;
}

.admin-user-dropdown-head strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
}

.admin-user-dropdown-head small {
    display: block;
    color: var(--fds-muted);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 170px;
}

.admin-user-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 500;
}

.admin-user-dropdown .dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--fds-muted);
}

.admin-user-dropdown .dropdown-item:hover,
.admin-user-dropdown .dropdown-item:focus {
    background: color-mix(in srgb, var(--fds-primary) 7%, var(--fds-panel));
    color: var(--fds-text);
}

.admin-user-logout {
    color: #dc3545 !important;
}

.admin-user-logout i {
    color: #dc3545 !important;
}

.profile-preview-card {
    display: grid;
    justify-items: center;
    text-align: center;
}

.profile-preview-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 112px;
    margin-bottom: 16px;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fds-primary), var(--fds-secondary));
    color: #ffffff;
    font-size: 2rem;
    font-weight: 600;
    box-shadow: 0 16px 36px color-mix(in srgb, var(--fds-primary) 24%, transparent);
}

.profile-preview-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-preview-name {
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 600;
}

.profile-preview-email {
    margin: 0 0 14px;
    color: var(--fds-muted);
    font-size: 0.88rem;
    word-break: break-word;
}

.profile-form .form-label {
    font-size: 0.88rem;
    font-weight: 500;
}

.admin-content {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: clamp(18px, 3vw, 34px);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.metric-grid--wide {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metric-card small {
    display: block;
    margin-top: 8px;
    color: var(--fds-muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.dashboard-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    padding: 24px 26px;
    border: 1px solid var(--fds-border);
    border-radius: 18px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--fds-primary) 8%, var(--fds-panel)), var(--fds-panel)),
        var(--fds-panel);
    box-shadow: 0 14px 36px rgba(21, 32, 51, 0.05);
}

.dashboard-welcome-kicker {
    margin: 0 0 6px;
    color: var(--fds-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.dashboard-welcome-title {
    margin: 0 0 8px;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.dashboard-welcome-text {
    margin: 0;
    color: var(--fds-muted);
    font-size: 0.92rem;
}

.dashboard-welcome-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

.dashboard-empty-state {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 160px;
    text-align: center;
    color: var(--fds-muted);
}

.dashboard-empty-state i {
    font-size: 2rem;
    color: #198754;
}

.dashboard-empty-state p {
    margin: 0;
}

.dashboard-alert-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dashboard-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--fds-border);
    border-radius: 12px;
    background: var(--fds-panel);
    color: var(--fds-text);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-alert:hover {
    color: var(--fds-text);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(21, 32, 51, 0.06);
}

.dashboard-alert > .bi:first-child {
    flex: 0 0 auto;
    font-size: 1.05rem;
}

.dashboard-alert > span {
    flex: 1 1 auto;
    font-size: 0.9rem;
}

.dashboard-alert > .bi-chevron-right {
    color: var(--fds-muted);
    font-size: 0.85rem;
}

.dashboard-alert--danger {
    border-color: color-mix(in srgb, #dc3545 18%, var(--fds-border));
    background: color-mix(in srgb, #dc3545 5%, var(--fds-panel));
}

.dashboard-alert--danger > .bi:first-child {
    color: #dc3545;
}

.dashboard-alert--warning {
    border-color: color-mix(in srgb, #ffc107 24%, var(--fds-border));
    background: color-mix(in srgb, #ffc107 8%, var(--fds-panel));
}

.dashboard-alert--warning > .bi:first-child {
    color: #b78103;
}

.dashboard-alert--secondary > .bi:first-child {
    color: var(--fds-muted);
}

.dashboard-hls-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.dashboard-hls-item {
    display: grid;
    gap: 4px;
    padding: 16px;
    border: 1px solid var(--fds-border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--fds-bg) 50%, var(--fds-panel));
}

.dashboard-hls-item strong {
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.dashboard-hls-item span {
    color: var(--fds-muted);
    font-size: 0.82rem;
}

.dashboard-rank-list {
    display: grid;
    gap: 14px;
}

.dashboard-rank-item {
    display: grid;
    gap: 8px;
}

.dashboard-rank-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-rank-pos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--fds-primary) 10%, var(--fds-panel));
    color: var(--fds-primary);
    font-size: 0.82rem;
    font-weight: 600;
}

.dashboard-rank-info {
    flex: 1 1 auto;
    min-width: 0;
}

.dashboard-rank-info strong {
    display: block;
    overflow: hidden;
    font-size: 0.92rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-rank-info small {
    color: var(--fds-muted);
    font-size: 0.78rem;
}

.dashboard-rank-value {
    color: var(--fds-text);
    font-size: 0.88rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.dashboard-rank-bar {
    height: 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--fds-border) 70%, transparent);
    overflow: hidden;
}

.dashboard-rank-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--fds-primary), color-mix(in srgb, var(--fds-secondary) 70%, var(--fds-primary)));
}

.dashboard-link {
    color: var(--fds-text);
}

.dashboard-link:hover {
    color: var(--fds-primary);
}

.metric-card,
.content-panel,
.action-card {
    background: var(--fds-panel);
    border: 1px solid var(--fds-border);
    border-radius: 16px;
    box-shadow: 0 14px 36px rgba(21, 32, 51, 0.05);
}

.metric-card {
    min-height: 128px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-card span {
    color: var(--fds-muted);
    font-size: 0.86rem;
    font-weight: 500;
}

.metric-card strong {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.metric-card i {
    align-self: flex-end;
    color: var(--fds-primary);
    font-size: 1.25rem;
    opacity: 0.9;
}

.content-panel {
    padding: 22px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-header h2,
.panel-header h3 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 600;
}

.panel-header p {
    margin: 4px 0 0;
    color: var(--fds-muted);
    font-size: 0.9rem;
}

.admin-table {
    margin-bottom: 0;
}

.admin-table th {
    color: var(--fds-muted);
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom-color: var(--fds-border);
}

.admin-table td {
    border-color: color-mix(in srgb, var(--fds-border) 72%, transparent);
    font-size: 0.92rem;
}

.admin-table .btn-sm,
.admin-table .btn-action {
    width: 34px;
    height: 34px;
    padding: 0;
}

.admin-table .btn-outline-secondary.btn-sm {
    border-radius: 999px;
    border-color: var(--fds-border);
    color: var(--fds-muted);
}

.admin-table .btn-outline-secondary.btn-sm:hover {
    border-color: color-mix(in srgb, var(--fds-primary) 35%, var(--fds-border));
    background: color-mix(in srgb, var(--fds-primary) 7%, var(--fds-panel));
    color: var(--fds-primary);
}

.admin-table .btn-outline-primary.btn-sm,
.admin-table .btn-outline-secondary.btn-sm,
.admin-table .btn-outline-danger.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-card {
    display: block;
    min-height: 132px;
    padding: 20px;
    color: var(--fds-text);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.action-card:hover {
    border-color: color-mix(in srgb, var(--fds-primary) 42%, var(--fds-border));
    color: var(--fds-text);
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(21, 32, 51, 0.08);
}

.action-card i {
    color: var(--fds-primary);
    font-size: 1.35rem;
}

.action-card h2,
.action-card .h5 {
    font-weight: 600;
}

.item-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
}

.item-thumb {
    width: 58px;
    height: 38px;
    flex: 0 0 58px;
    object-fit: cover;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--fds-primary), var(--fds-secondary));
}

.item-meta {
    color: var(--fds-muted);
    font-size: 0.84rem;
}

.link-copy {
    min-width: 310px;
}

.links-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.links-intro {
    padding: 14px 16px;
    border: 1px solid var(--fds-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--fds-panel) 92%, var(--fds-bg));
    color: var(--fds-muted);
    font-size: 0.92rem;
}

.links-intro p {
    margin: 0;
}

.links-metrics {
    margin-bottom: 0;
}

.links-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.links-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--fds-border);
    border-radius: 999px;
    background: var(--fds-panel);
    color: var(--fds-text);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: none;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.links-tab:hover,
.links-tab:focus-visible {
    border-color: color-mix(in srgb, var(--fds-primary) 35%, var(--fds-border));
    color: var(--fds-primary);
}

.links-tab.is-active {
    border-color: color-mix(in srgb, var(--fds-primary) 45%, var(--fds-border));
    background: color-mix(in srgb, var(--fds-primary) 10%, var(--fds-panel));
    color: var(--fds-primary);
}

.links-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 12%, transparent);
    font-size: 0.78rem;
    font-weight: 600;
}

.links-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.links-card,
.links-group {
    border: 1px solid var(--fds-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--fds-panel) 96%, var(--fds-bg));
}

.links-card {
    padding: 16px;
}

.links-card-head,
.links-group-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.links-card-head h3,
.links-group-info h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
}

.links-card-head p,
.links-group-info p {
    margin: 0;
    color: var(--fds-muted);
    font-size: 0.84rem;
}

.links-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.links-group-head {
    padding: 16px 16px 0;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.links-group-course-link {
    flex: 1 1 320px;
    min-width: min(100%, 320px);
}

.links-group-label {
    display: block;
    margin-bottom: 8px;
    color: var(--fds-muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.links-lesson-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 12px;
    border-top: 1px solid var(--fds-border);
    background: var(--fds-border);
}

.links-lesson {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: var(--fds-panel);
}

.links-lesson-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.links-lesson-main strong {
    font-size: 0.95rem;
    font-weight: 600;
}

.links-lesson-side {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.link-share {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.link-share-url {
    flex: 1 1 180px;
    min-width: 0;
    padding: 8px 10px;
    overflow: hidden;
    border: 1px solid var(--fds-border);
    border-radius: 6px;
    background: var(--fds-bg);
    color: var(--fds-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.link-share-actions {
    display: inline-flex;
    flex-shrink: 0;
    gap: 6px;
}

.link-share--compact .link-share-actions {
    justify-content: flex-end;
}

.upload-progress {
    margin-top: 10px;
}

.upload-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--fds-muted);
    font-size: 0.84rem;
}

.upload-progress-meta strong {
    color: #198754;
    font-size: 0.88rem;
    font-weight: 600;
}

.upload-progress-track {
    overflow: hidden;
    height: 10px;
    border-radius: 999px;
    background: color-mix(in srgb, #198754 10%, var(--fds-border));
}

.upload-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22a06b, #198754);
    transition: width 0.18s ease;
}

.lesson-video-replace {
    padding: 16px;
    border: 1px solid var(--fds-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--fds-panel) 94%, var(--fds-bg));
}

.lesson-video-current {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid var(--fds-border);
    border-radius: 10px;
    background: var(--fds-panel);
}

.lesson-video-current > i {
    flex-shrink: 0;
    color: var(--fds-primary);
    font-size: 1.35rem;
}

.lesson-video-current strong {
    display: block;
    font-size: 0.92rem;
    word-break: break-all;
}

.lesson-video-current .badge {
    margin-left: auto;
    flex-shrink: 0;
}

.links-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 36px 20px;
    text-align: center;
}

.links-empty i {
    color: var(--fds-muted);
    font-size: 2rem;
}

.links-empty h3 {
    margin: 0;
    font-size: 1.05rem;
}

.links-empty p {
    max-width: 360px;
    margin: 0;
    color: var(--fds-muted);
    font-size: 0.92rem;
}

.links-group--avulsa .links-group-head {
    padding-bottom: 0;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.logo-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.logo-field {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--fds-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--fds-panel) 92%, var(--fds-bg));
}

.logo-preview-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 104px;
    height: 104px;
    padding: 12px;
    border-radius: 8px;
    background: var(--fds-sidebar);
    color: #ffffff;
    font-weight: 600;
    overflow: hidden;
}

.logo-preview-box img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-preview-box.sidebar-logo-filter img,
.theme-preview-logo {
    filter: brightness(0) invert(1);
}

.color-field {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--fds-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--fds-panel) 92%, var(--fds-bg));
}

.color-field input[type="color"] {
    width: 100%;
    height: 46px;
    padding: 4px;
    border-radius: 8px;
}

.theme-preview {
    display: grid;
    grid-template-columns: 170px 1fr;
    min-height: 220px;
    overflow: hidden;
    border: 1px solid var(--fds-border);
    border-radius: 8px;
}

.theme-preview-sidebar {
    padding: 18px;
    background: var(--fds-sidebar);
    color: var(--fds-sidebar-text);
}

.theme-preview-logo {
    display: block;
    max-width: 118px;
    max-height: 42px;
    object-fit: contain;
}

.theme-preview-main {
    padding: 18px;
    background: var(--fds-bg);
}

.theme-preview-panel {
    height: 120px;
    padding: 16px;
    border: 1px solid var(--fds-border);
    border-radius: 8px;
    background: var(--fds-panel);
}

.media-toolbar,
.admin-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.media-toolbar .form-select,
.admin-filter-bar .form-select {
    width: min(100%, 220px);
}

.admin-filter-search {
    position: relative;
    flex: 1 1 240px;
    min-width: min(100%, 240px);
    max-width: 360px;
}

.admin-filter-search i {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--fds-muted);
    pointer-events: none;
}

.admin-filter-search .form-control {
    padding-left: 36px;
}

.admin-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.admin-filter-summary {
    margin: -8px 0 16px;
    color: var(--fds-muted);
    font-size: 0.84rem;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
    gap: 16px;
}

.media-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: var(--fds-panel);
    border: 1px solid var(--fds-border);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(21, 32, 51, 0.06);
}

.media-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: color-mix(in srgb, var(--fds-sidebar) 92%, #000000);
    overflow: hidden;
}

.media-preview img,
.media-preview video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-type-badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 8px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.62);
    font-size: 0.76rem;
    font-weight: 800;
}

.media-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
}

.media-body h3 {
    margin: 0;
    overflow: hidden;
    color: var(--fds-text);
    font-size: 0.95rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-meta {
    color: var(--fds-muted);
    font-size: 0.82rem;
}

.media-usage {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 750;
}

.media-usage.in-use {
    color: #0f5132;
    background: #d1e7dd;
}

.media-usage.orphan {
    color: #664d03;
    background: #fff3cd;
}

.media-links {
    display: grid;
    gap: 4px;
    min-height: 24px;
    font-size: 0.82rem;
}

.media-links a {
    overflow: hidden;
    color: var(--fds-primary);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-page {
    min-height: 100vh;
    background:
        radial-gradient(ellipse 90% 55% at 50% -15%, color-mix(in srgb, var(--fds-player-accent) 14%, transparent), transparent),
        var(--fds-player-bg);
    color: var(--fds-player-text);
}

.player-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.player-topbar {
    padding: 18px clamp(16px, 3vw, 32px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(10px);
}

.player-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    max-width: 880px;
    margin-inline: auto;
}

.player-topbar-inner--wide {
    max-width: 1180px;
}

.player-topbar-brand {
    display: flex;
    align-items: center;
    min-width: 0;
}

.player-topbar-logo {
    display: block;
    height: 36px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.player-topbar-course {
    text-align: right;
    font-size: 0.84rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: color-mix(in srgb, var(--fds-player-text) 65%, transparent);
    max-width: min(40vw, 380px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-layout {
    flex: 1;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    padding: 24px clamp(16px, 3vw, 32px) 40px;
    align-items: start;
}

.player-layout:not(.player-layout--with-playlist) {
    min-height: calc(100vh - 72px);
    align-items: center;
}

.player-layout--with-playlist {
    display: grid;
    grid-template-columns: 1fr auto auto 1fr;
    gap: 20px;
    align-items: start;
    min-height: auto;
    max-width: none;
}

.player-main {
    min-width: 0;
    grid-column: 2;
}

.player-layout:not(.player-layout--with-playlist) .player-main {
    grid-column: auto;
    width: 100%;
    display: flex;
    justify-content: center;
}

.player-stage {
    width: min(100%, 880px);
    margin-inline: auto;
    padding: 22px 22px 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.player-layout--with-playlist .player-stage {
    width: min(72vw, 880px);
    max-width: 880px;
}

.player-lesson-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-lesson-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--fds-player-accent) 22%, transparent);
    border: 1px solid color-mix(in srgb, var(--fds-player-accent) 45%, transparent);
    color: color-mix(in srgb, var(--fds-player-text) 92%, var(--fds-player-accent));
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.player-lesson-meta h1 {
    margin: 0;
    font-size: clamp(1.2rem, 2vw, 1.65rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.player-lesson-desc {
    margin: 0;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.94rem;
    line-height: 1.65;
    color: color-mix(in srgb, var(--fds-player-text) 68%, transparent);
}

.player-frame-wrap {
    position: relative;
    isolation: isolate;
}

.player-frame-wrap::before {
    content: "";
    position: absolute;
    inset: 12% 8% -10%;
    background: color-mix(in srgb, var(--fds-player-accent) 35%, transparent);
    filter: blur(52px);
    opacity: 0.28;
    z-index: 0;
    pointer-events: none;
}

.player-frame {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 836px;
    aspect-ratio: 16 / 9;
    max-height: min(54vh, 470px);
    margin-inline: auto;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.player-layout--with-playlist .player-frame {
    max-width: 100%;
    max-height: min(50vh, 440px);
}

.player-frame video,
.player-video {
    display: block;
    width: 100%;
    height: 100%;
    background: #000000;
    object-fit: contain;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.player-chrome {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    padding: 18px 10px 8px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.72) 58%, rgba(0, 0, 0, 0.92) 100%);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.player-chrome.is-hidden {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

.player-chrome-bar,
.player-chrome-bar * {
    pointer-events: auto;
}

.player-chrome-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
}

.player-chrome-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.player-chrome-btn:hover,
.player-chrome-btn:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

.player-chrome-btn i {
    font-size: 1rem;
    line-height: 1;
}

.player-chrome-time {
    flex: 0 0 auto;
    min-width: 4.6rem;
    font-size: 0.78rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.92);
    white-space: nowrap;
}

.player-chrome-seek {
    flex: 1 1 auto;
    min-width: 0;
    height: 4px;
    margin: 0 2px;
    accent-color: var(--fds-player-accent, #2457d6);
    cursor: pointer;
}

.player-chrome-right {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.player-chrome-volume {
    width: 72px;
    height: 4px;
    accent-color: #ffffff;
    cursor: pointer;
}

.player-watermark {
    position: absolute;
    top: 12px;
    left: 12px;
    right: auto;
    bottom: auto;
    z-index: 3;
    display: block;
    max-width: min(14%, 110px);
    max-height: 40px;
    object-fit: contain;
    opacity: 0.55;
    pointer-events: none;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
}

.player-quality {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.player-quality-toggle {
    width: 32px;
    height: 32px;
}

.player-quality-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    top: auto;
    min-width: 168px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(8, 10, 16, 0.94);
    backdrop-filter: blur(14px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    z-index: 20;
}

.player-quality-option {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.84rem;
    text-align: left;
    cursor: pointer;
}

.player-quality-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.player-quality-option.is-active {
    background: color-mix(in srgb, var(--fds-player-accent) 24%, transparent);
    color: #ffffff;
    font-weight: 600;
}

.player-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 2px;
}

.player-nav-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: var(--fds-player-text);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.9rem;
    font-weight: 600;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.player-nav-button:hover {
    color: var(--fds-player-text);
    border-color: color-mix(in srgb, var(--fds-player-accent) 60%, transparent);
    background: color-mix(in srgb, var(--fds-player-accent) 12%, transparent);
    transform: translateY(-1px);
}

.player-nav-button--primary {
    border-color: color-mix(in srgb, var(--fds-player-accent) 55%, transparent);
    background: color-mix(in srgb, var(--fds-player-accent) 18%, transparent);
}

.player-nav-button--primary:hover {
    background: color-mix(in srgb, var(--fds-player-accent) 28%, transparent);
}

.playlist-panel {
    min-width: 0;
    width: 280px;
    grid-column: 3;
    align-self: start;
    position: sticky;
    top: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.playlist-header {
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.playlist-header strong {
    display: block;
    color: var(--fds-player-text);
    font-size: 0.95rem;
    font-weight: 700;
}

.playlist-header span {
    color: color-mix(in srgb, var(--fds-player-text) 55%, transparent);
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

.playlist-list {
    max-height: calc(100vh - 200px);
    overflow: auto;
}

.playlist-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 12px;
    padding: 13px 16px;
    color: color-mix(in srgb, var(--fds-player-text) 75%, transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s ease, color 0.15s ease;
}

.playlist-item:hover,
.playlist-item.active {
    color: var(--fds-player-text);
    background: rgba(255, 255, 255, 0.06);
}

.playlist-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--fds-player-text);
    font-weight: 700;
    font-size: 0.85rem;
}

.playlist-item.active .playlist-number {
    background: var(--fds-player-accent);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--fds-player-accent) 40%, transparent);
}

.playlist-title {
    display: block;
    color: inherit;
    font-weight: 750;
    line-height: 1.25;
}

.playlist-meta {
    display: block;
    margin-top: 4px;
    color: color-mix(in srgb, var(--fds-player-text) 56%, transparent);
    font-size: 0.82rem;
}

.player-message {
    width: min(100%, 620px);
    margin: auto;
    padding: 34px;
    text-align: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
}

@media (max-width: 1100px) {
    .player-topbar-inner--wide {
        max-width: 880px;
    }

    .player-layout--with-playlist {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .player-main,
    .playlist-panel {
        grid-column: auto;
        width: 100%;
        max-width: none;
    }

    .playlist-panel {
        position: static;
    }
}

@media (max-width: 1399.98px) {
    .metric-grid--wide {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1199.98px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .playlist-list {
        max-height: 360px;
    }
}

@media (max-width: 767.98px) {
    .topbar-actions span {
        display: none;
    }

    .admin-user-name {
        display: none;
    }

    .admin-user-toggle {
        padding: 4px;
        border-radius: 50%;
    }

    .admin-user-toggle .bi-chevron-down {
        display: none;
    }

    .admin-content,
    .admin-topbar {
        padding-inline: 16px;
    }

    .admin-toast-stack {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .dashboard-welcome {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px;
    }

    .dashboard-welcome-actions {
        width: 100%;
    }

    .dashboard-welcome-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .metric-grid--wide {
        grid-template-columns: 1fr;
    }

    .metric-grid,
    .color-grid,
    .logo-settings-grid {
        grid-template-columns: 1fr;
    }

    .logo-field {
        grid-template-columns: 88px 1fr;
    }

    .logo-preview-box {
        width: 88px;
        height: 88px;
    }

    .content-panel {
        padding: 17px;
    }

    .link-copy {
        min-width: 240px;
    }

    .links-card-grid {
        grid-template-columns: 1fr;
    }

    .links-group-head,
    .links-lesson {
        flex-direction: column;
        align-items: stretch;
    }

    .links-lesson-side {
        justify-content: space-between;
    }

    .link-share {
        flex-wrap: wrap;
    }

    .player-page {
        min-height: 100dvh;
        -webkit-tap-highlight-color: transparent;
        overscroll-behavior-y: none;
    }

    .player-app {
        min-height: 100dvh;
    }

    .player-topbar {
        position: sticky;
        top: 0;
        z-index: 100;
        padding: max(10px, env(safe-area-inset-top)) 16px 10px;
        background: rgba(5, 7, 11, 0.92);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .player-topbar-inner,
    .player-topbar-inner--wide {
        max-width: none;
    }

    .player-topbar-logo {
        height: 30px;
        max-width: 140px;
    }

    .player-topbar-course {
        font-size: 0.78rem;
        max-width: 52vw;
    }

    .player-layout,
    .player-layout:not(.player-layout--with-playlist),
    .player-layout--with-playlist {
        min-height: auto;
        align-items: stretch;
        padding: 0 16px;
        box-sizing: border-box;
    }

    .player-layout--with-playlist {
        gap: 0;
    }

    .player-main {
        width: 100%;
        max-width: none;
        grid-column: auto;
        display: block;
    }

    .player-layout:not(.player-layout--with-playlist) .player-main {
        display: block;
        justify-content: stretch;
    }

    .player-stage,
    .player-layout--with-playlist .player-stage {
        width: 100%;
        max-width: none;
        margin-inline: 0;
        padding: 0;
        gap: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .player-lesson-meta {
        padding: 14px 0 10px;
        gap: 8px;
    }

    .player-lesson-meta h1 {
        font-size: 1.15rem;
        line-height: 1.35;
    }

    .player-lesson-badge {
        font-size: 0.68rem;
        padding: 4px 10px;
    }

    .player-frame-wrap {
        width: 100%;
    }

    .player-frame-wrap::before {
        display: none;
    }

    .player-frame,
    .player-layout--with-playlist .player-frame {
        width: 100%;
        max-width: 100%;
        max-height: none;
        aspect-ratio: 16 / 9;
        height: auto;
        margin: 0;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
    }

    .player-frame video,
    .player-video {
        width: 100%;
        height: 100%;
        max-width: none;
        object-fit: contain;
    }

    .player-chrome.is-hidden {
        opacity: 0;
        pointer-events: none;
    }

    .player-chrome:not(.is-hidden) {
        opacity: 1;
    }

    .player-watermark {
        top: 10px;
        left: 10px;
        right: auto;
        bottom: auto;
        max-width: 24%;
        max-height: 34px;
        opacity: 0.5;
    }

    .player-chrome {
        padding: 14px 8px 6px;
    }

    .player-chrome-bar {
        gap: 6px;
    }

    .player-chrome-time {
        min-width: 4.1rem;
        font-size: 0.72rem;
    }

    .player-chrome-volume {
        display: none;
    }

    .player-chrome-btn {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    .player-lesson-desc {
        padding: 12px 0 4px;
        border-top: none;
        font-size: 0.88rem;
        line-height: 1.55;
    }

    .player-controls-row {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 90;
        flex-direction: row;
        align-items: stretch;
        gap: 10px;
        margin: 0;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: rgba(5, 7, 11, 0.96);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .player-controls-row:not(:has(.player-nav-button)) {
        display: none;
    }

    .player-controls-row > div {
        flex: 1;
        min-width: 0;
    }

    .player-controls-row > div:empty {
        display: none;
    }

    .player-nav-button {
        width: 100%;
        min-height: 48px;
        justify-content: center;
        font-size: 0.88rem;
    }

    .player-page--has-nav .player-layout {
        padding-bottom: calc(68px + env(safe-area-inset-bottom));
    }

    .player-page--has-nav.player-page--playlist .player-layout {
        padding-bottom: calc(68px + env(safe-area-inset-bottom));
    }

    .playlist-panel {
        width: 100%;
        max-width: none;
        margin: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        backdrop-filter: none;
    }

    .playlist-header {
        padding: 18px 0 10px;
        border-bottom: none;
    }

    .playlist-header strong {
        font-size: 0.82rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: color-mix(in srgb, var(--fds-player-text) 58%, transparent);
    }

    .playlist-header span {
        font-size: 0.88rem;
        color: var(--fds-player-text);
        margin-top: 6px;
    }

    .playlist-list {
        max-height: none;
        padding: 0 0 calc(12px + env(safe-area-inset-bottom));
    }

    .player-page--has-nav .playlist-list {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }

    .playlist-item {
        grid-template-columns: 36px 1fr;
        gap: 10px;
        padding: 12px;
        margin-bottom: 6px;
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        background: rgba(255, 255, 255, 0.03);
    }

    .playlist-item.active {
        background: color-mix(in srgb, var(--fds-player-accent) 14%, transparent);
        border-color: color-mix(in srgb, var(--fds-player-accent) 35%, transparent);
    }

    .playlist-number {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
        border-radius: 10px;
    }

    .playlist-title {
        font-size: 0.92rem;
    }

    .playlist-meta {
        font-size: 0.76rem;
    }

    .player-message {
        margin: 16px;
        width: auto;
        border-radius: 14px;
    }
}
