:root {
    --sd-ink: #18214d;
    --sd-muted: #6b7290;
    --sd-primary: #6d5dfc;
    --sd-blue: #4f7cff;
    --sd-bg: #f2f6ff;
    --sd-sidebar: #5c50c7;
    --sd-border: #dfe7fb;
    --sd-soft: #eef3ff;
}

body {
    background:
        radial-gradient(circle at top right, rgba(109, 93, 252, .18), transparent 30%),
        radial-gradient(circle at 18% 18%, rgba(103, 232, 249, .16), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #edf3ff 100%);
    color: #17213f;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.container-fluid {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.row {
    display: flex;
    flex-wrap: wrap;
}

.g-2,
.g-3,
.g-4 {
    gap: 16px;
}

.row.g-2,
.row.g-3,
.row.g-4 {
    gap: 0;
    margin-left: -8px;
    margin-right: -8px;
}

.row.g-2 > *,
.row.g-3 > *,
.row.g-4 > * {
    padding: 8px;
}

.col-4 { flex: 0 0 auto; width: 33.333333%; }
.col-8 { flex: 0 0 auto; width: 66.666667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

.card {
    border: 0;
}

.btn {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    font-weight: 750;
    gap: 8px;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    text-decoration: none;
}

.btn-sm {
    min-height: 34px;
    padding: 7px 11px;
}

.btn-lg {
    min-height: 50px;
}

.btn-outline-primary {
    border-color: #2563eb;
    color: #2563eb;
}

.btn-outline-secondary {
    border-color: #94a3b8;
    color: #475569;
}

.btn-outline-danger {
    border-color: #ef4444;
    color: #dc2626;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-light {
    background: #fff;
    color: #0f172a;
}

.w-100 {
    width: 100%;
}

.d-inline {
    display: inline;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.align-items-center {
    align-items: center;
}

.gap-2 {
    gap: 8px;
}

.text-center {
    text-align: center;
}

.text-end {
    text-align: right;
}

.text-muted {
    color: var(--sd-muted) !important;
}

.fw-bold {
    font-weight: 800;
}

.bg-light {
    background: #f8fafc !important;
}

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

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

.alert {
    border-radius: 12px;
    margin-bottom: 18px;
    padding: 14px 16px;
}

.alert-success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #14532d;
}

.alert-danger {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #7f1d1d;
}

@media (min-width: 768px) {
    .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-md-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-md-8 { flex: 0 0 auto; width: 66.666667%; }
}

@media (min-width: 992px) {
    .col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-lg-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .col-lg-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-lg-8 { flex: 0 0 auto; width: 66.666667%; }
}

@media (min-width: 1200px) {
    .col-xl-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-xl-8 { flex: 0 0 auto; width: 66.666667%; }
}

.app-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar-backdrop {
    display: none;
}

.app-sidebar {
    background:
        radial-gradient(circle at 25% 92%, rgba(52, 211, 153, .36), transparent 22%),
        linear-gradient(180deg, #6155d8 0%, #4d45b8 54%, #45398f 100%);
    color: #e5eefb;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 18px;
    position: sticky;
    top: 0;
}

.sidebar-brand {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
    padding: 8px;
}

.brand-mark {
    align-items: center;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 18px;
    color: #fff;
    display: inline-flex;
    font-weight: 950;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.brand-logo {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 18px;
    height: 50px;
    object-fit: contain;
    padding: 6px;
    width: 50px;
}

.sidebar-brand strong,
.sidebar-footer strong {
    display: block;
    font-weight: 900;
}

.sidebar-brand small,
.sidebar-footer small {
    color: rgba(255, 255, 255, .72);
    display: block;
    font-size: 12px;
}

.sidebar-meta {
    color: #cbd5e1;
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.sidebar-nav a {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 16px;
    color: rgba(255, 255, 255, .82);
    display: flex;
    font-weight: 850;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    transition: .18s ease;
}

.sidebar-nav a i {
    color: #fff;
    font-size: 18px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .24);
    color: #fff;
    transform: translateX(2px);
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, .12);
    margin-top: auto;
    padding: 16px 8px 4px;
}

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

.app-topbar {
    align-items: center;
    backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, .88);
    border-bottom: 1px solid rgba(148, 163, 184, .24);
    display: flex;
    gap: 14px;
    min-height: 72px;
    padding: 14px 28px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.app-topbar span {
    color: var(--sd-muted);
    display: block;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.app-topbar strong {
    color: var(--sd-ink);
    font-size: 20px;
    font-weight: 950;
}

.topbar-actions {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.theme-toggle-btn {
    background: #ffffff;
    border-color: var(--sd-border);
    color: #17213f;
    min-height: 40px;
    padding: 8px 14px;
}

.theme-toggle-btn:hover,
.theme-toggle-btn:focus {
    background: #eef3ff;
    border-color: #b8c7ee;
    color: #17213f;
}

.theme-toggle-btn span {
    color: inherit;
    display: inline;
    font-size: 13px;
    text-transform: none;
}

.sidebar-toggle {
    border: 1px solid var(--sd-border);
    display: none;
}

.app-navbar {
    background: linear-gradient(90deg, #0f172a, #0f766e);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
}

.app-navbar .navbar-brand,
.app-navbar .nav-link,
.app-navbar .navbar-text {
    color: #fff;
    font-weight: 800;
}

.app-navbar .nav-link.active,
.app-navbar .nav-link:hover {
    color: #c7f9ec;
}

.app-shell {
    padding: 28px;
}

.page-title h1 {
    font-size: clamp(1.45rem, 2.4vw, 2.15rem);
    font-weight: 850;
    letter-spacing: 0;
    margin-bottom: 4px;
}

.page-title p {
    color: var(--sd-muted);
    margin-bottom: 22px;
}

.smart-card {
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--sd-border);
    border-radius: 22px;
    box-shadow: 0 22px 55px rgba(76, 68, 157, .12);
    overflow: hidden;
}

.smart-card .card-header {
    background: linear-gradient(90deg, #eef3ff, #f9fbff);
    border-bottom: 1px solid var(--sd-border);
    color: var(--sd-ink);
    font-weight: 800;
    padding: 16px 18px;
}

.smart-card .card-body {
    padding: 20px;
}

.smart-panel {
    background:
        linear-gradient(135deg, rgba(109, 93, 252, .09), rgba(79, 124, 255, .08)),
        rgba(255, 255, 255, .94);
    border: 1px solid var(--sd-border);
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, .08);
    padding: 22px;
}

.btn-smart {
    background: linear-gradient(90deg, #6d5dfc, #3b82f6);
    border: 0;
    color: #fff;
    font-weight: 900;
}

.btn-smart:hover {
    color: #fff;
    filter: brightness(.96);
}

.metric-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.metric-card {
    background: rgba(255, 255, 255, .95);
    border-left: 5px solid var(--sd-primary);
    border-radius: 20px;
    box-shadow: 0 18px 42px rgba(76, 68, 157, .1);
    padding: 18px;
}

.metric-card span {
    color: var(--sd-muted);
    display: block;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.metric-card strong {
    color: var(--sd-ink);
    display: block;
    font-size: 26px;
    font-weight: 850;
    margin-top: 8px;
}

.team-table th {
    background: #edf2ff;
    color: #183153;
    font-size: 12px;
    text-transform: uppercase;
}

.team-table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.team-table thead th {
    border: 0;
    padding: 14px 12px;
}

.team-table tbody tr {
    background: #fff;
    box-shadow: 0 8px 20px rgba(76, 68, 157, .07);
}

.team-table tbody td {
    border-color: #e5edfb;
    padding: 10px 8px;
}

.team-table tbody tr.team-odd td {
    background: #fbf8ff;
}

.team-table tbody tr.team-even td {
    background: #f3f8ff;
}

.team-table tbody tr.team-start td {
    border-top: 2px solid rgba(109, 93, 252, .2);
}

.team-table tbody tr.team-end td {
    border-bottom: 10px solid #e9eefb;
}

.team-table tbody tr.team-start td:first-child {
    border-left: 4px solid var(--sd-primary);
}

.team-table .form-control,
.team-table .form-select {
    background-color: rgba(255, 255, 255, .9);
}

.team-code-cell {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: auto minmax(120px, 1fr);
    min-width: 210px;
}

.team-line-label {
    background: #e8fff8;
    border: 1px solid #bff1e7;
    border-radius: 999px;
    color: #0f766e;
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    justify-content: center;
    min-width: 76px;
    padding: 7px 10px;
    white-space: nowrap;
}

.form-control,
.form-select {
    border-color: #cbd8e6;
    border-radius: 14px;
    min-height: 42px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--sd-primary);
    box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .15);
}

.table {
    --bs-table-bg: transparent;
}

.table thead th {
    background: #edf2ff;
    color: #183153;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.table tbody td {
    border-color: #e3ebf5;
    vertical-align: middle;
}

.action-cell {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    white-space: nowrap;
}

.smart-confirm-overlay {
    align-items: center;
    background: rgba(15, 23, 42, .55);
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 18px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 2000;
}

.smart-confirm-box {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
    max-width: 460px;
    overflow: hidden;
    width: 100%;
}

.smart-confirm-head {
    align-items: center;
    background: #eef7ff;
    display: flex;
    justify-content: space-between;
    padding: 16px 18px;
}

.smart-confirm-head h5 {
    font-size: 18px;
    font-weight: 950;
    margin: 0;
}

.smart-confirm-head button {
    background: transparent;
    border: 0;
    color: #64748b;
    font-size: 28px;
    line-height: 1;
}

.smart-confirm-box p {
    color: #334155;
    margin: 0;
    padding: 20px 18px;
}

.smart-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 0 18px 18px;
}

.public-page {
    min-height: 100vh;
}

.public-shell {
    min-height: 100vh;
    padding: 28px;
}

.auth-screen {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 56px);
}

.auth-card {
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(223, 231, 251, .92);
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(76, 68, 157, .18);
    display: grid;
    grid-template-columns: minmax(280px, .95fr) minmax(320px, 1.05fr);
    max-width: 1040px;
    overflow: hidden;
    width: 100%;
}

.auth-visual {
    background:
        radial-gradient(circle at 75% 80%, rgba(45, 212, 191, .55), transparent 18%),
        radial-gradient(circle at 28% 22%, rgba(255, 255, 255, .18), transparent 20%),
        linear-gradient(155deg, #5c50c7, #6d5dfc 56%, #403889);
    color: #fff;
    min-height: 520px;
    padding: 42px;
    position: relative;
}

.auth-visual::after {
    background:
        linear-gradient(135deg, transparent 40%, rgba(255,255,255,.16) 40% 42%, transparent 42%),
        linear-gradient(45deg, transparent 40%, rgba(255,255,255,.12) 40% 42%, transparent 42%);
    bottom: 28px;
    content: "";
    height: 150px;
    position: absolute;
    right: 34px;
    transform: rotate(-10deg);
    width: 150px;
}

.auth-badge {
    align-items: center;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    display: inline-flex;
    gap: 8px;
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 80px;
    padding: 10px 16px;
}

.auth-badge img {
    height: 24px;
    object-fit: contain;
    width: 24px;
}

.auth-visual h1 {
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1;
    max-width: 420px;
}

.auth-visual p {
    color: rgba(255, 255, 255, .78);
    font-weight: 700;
    max-width: 420px;
}

.auth-mini-grid {
    bottom: 42px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    left: 42px;
    position: absolute;
    right: 42px;
}

.auth-mini-grid span {
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    font-weight: 900;
    padding: 10px 12px;
}

.auth-form-panel {
    padding: 46px;
}

.smart-accordion {
    background: #f7f9ff;
    border: 1px solid var(--sd-border);
    border-radius: 18px;
    overflow: hidden;
}

.smart-accordion summary {
    align-items: center;
    color: var(--sd-ink);
    cursor: pointer;
    display: flex;
    font-weight: 950;
    gap: 10px;
    list-style: none;
    padding: 16px 18px;
}

.smart-accordion summary::-webkit-details-marker {
    display: none;
}

.smart-accordion summary::after {
    content: "\F282";
    font-family: "bootstrap-icons";
    margin-left: auto;
}

.smart-accordion[open] summary::after {
    content: "\F286";
}

.smart-accordion-body {
    border-top: 1px solid var(--sd-border);
    color: #475569;
    display: grid;
    gap: 8px;
    padding: 16px 18px;
}

.smart-accordion-body p {
    margin: 0;
}

.table-wide {
    margin-left: -8px;
    margin-right: -8px;
    padding: 0 8px;
}

.team-table {
    min-width: 1100px;
}

.team-table th:nth-child(3),
.team-table td:nth-child(3) {
    min-width: 260px;
}

.team-table th:nth-child(2),
.team-table td:nth-child(2) {
    min-width: 180px;
}

.encode-hero {
    align-items: center;
    background:
        radial-gradient(circle at right, rgba(45, 212, 191, .28), transparent 22%),
        linear-gradient(135deg, #5d55d8, #6d5dfc 55%, #3f8cff);
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(76, 68, 157, .22);
    color: #fff;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    overflow: hidden;
    padding: 26px;
    position: relative;
}

.encode-hero::after {
    background: rgba(255, 255, 255, .15);
    border-radius: 999px;
    content: "";
    height: 150px;
    position: absolute;
    right: -34px;
    top: -42px;
    width: 150px;
}

.encode-hero > * {
    position: relative;
    z-index: 1;
}

.hero-kicker {
    color: rgba(255,255,255,.75);
    display: block;
    font-size: 12px;
    font-weight: 950;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.encode-hero strong {
    display: block;
    font-size: clamp(1.5rem, 3vw, 2.6rem);
    font-weight: 950;
}

.encode-hero p {
    color: rgba(255,255,255,.78);
    font-weight: 800;
    margin: 6px 0 0;
}

.hero-progress {
    min-width: min(310px, 100%);
}

.hero-progress span {
    display: block;
    font-size: 34px;
    font-weight: 950;
    margin-bottom: 10px;
    text-align: right;
}

.hero-progress-track {
    background: rgba(255, 255, 255, .28);
    border-radius: 999px;
    height: 13px;
    overflow: hidden;
}

.hero-progress-track div {
    background: #fff;
    border-radius: inherit;
    height: 100%;
}

.chart-bars {
    display: grid;
    gap: 12px;
}

.chart-row {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(120px, 220px) 1fr 70px;
}

.chart-track {
    background: #e2e8f0;
    border-radius: 999px;
    height: 13px;
    overflow: hidden;
}

.chart-fill {
    background: linear-gradient(90deg, #6d5dfc, #3b82f6);
    border-radius: inherit;
    height: 100%;
}

.chart-fill-warm {
    background: linear-gradient(90deg, #f6b65f, #7c5cff);
}

.chart-row strong small {
    color: var(--sd-muted);
    display: block;
    font-size: 11px;
    font-weight: 650;
    margin-top: 3px;
}

.user-progress-grid {
    align-items: center;
    display: grid;
    gap: 22px;
    grid-template-columns: 170px 1fr;
}

.ring-chart {
    --value: 0;
    align-items: center;
    aspect-ratio: 1;
    background:
        radial-gradient(circle at center, var(--sd-card, #fff) 0 56%, transparent 57%),
        conic-gradient(#f6b65f calc(var(--value) * 1%), rgba(124, 92, 255, .18) 0);
    border-radius: 50%;
    display: grid;
    justify-items: center;
    width: 150px;
}

.ring-chart span {
    color: var(--sd-ink);
    font-size: 28px;
    font-weight: 850;
}

.mini-bars {
    display: grid;
    gap: 16px;
}

.mini-bar-row {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 150px 1fr 44px;
}

.mini-bar-row strong {
    color: var(--sd-ink);
    font-weight: 800;
}

.mini-bar-row strong small {
    color: var(--sd-muted);
    display: block;
    font-size: 11px;
    font-weight: 650;
    margin-top: 3px;
}

.mini-bar-track {
    background: rgba(124, 92, 255, .15);
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
}

.mini-bar-fill {
    background: linear-gradient(90deg, #f6b65f, #7c5cff);
    border-radius: inherit;
    height: 100%;
}

.mini-bar-muted {
    background: linear-gradient(90deg, #475569, #94a3b8);
}

.daily-line-chart .mini-bar-row {
    grid-template-columns: minmax(170px, 240px) 1fr 92px;
}

.daily-line-chart .mini-bar-row span {
    color: var(--sd-ink);
    font-weight: 800;
    text-align: right;
}

.line-chart-note {
    color: var(--sd-muted);
    font-size: 12px;
    font-weight: 650;
    margin: 14px auto 0;
    max-width: 210px;
    text-align: center;
}

.logo-preview {
    align-items: center;
    display: flex;
    gap: 14px;
}

.logo-preview img {
    background: #fff;
    border: 1px solid var(--sd-border);
    border-radius: 16px;
    height: 56px;
    object-fit: contain;
    padding: 6px;
    width: 56px;
}

.form-control-color {
    padding: 6px;
    width: 100%;
}

.fullscreen-list-card .table {
    min-width: 760px;
}

.table-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.table-search {
    flex: 1 1 360px;
    position: relative;
}

.table-search i {
    color: var(--sd-muted);
    left: 14px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.table-search .form-control {
    padding-left: 42px;
}

.table-count {
    color: var(--sd-muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.smart-filter-table th {
    vertical-align: top;
}

.filter-heading {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.column-filter-btn {
    align-items: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 10px;
    color: currentColor;
    cursor: pointer;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.column-filter-btn:hover,
.column-filter-btn.is-active {
    background: rgba(45, 212, 191, .16);
    border-color: rgba(45, 212, 191, .46);
    color: #99f6e4;
}

.column-filter-panel {
    display: none;
    margin-top: 10px;
}

.column-filter-panel.is-open {
    display: block;
}

.column-filter-panel .form-control {
    min-height: 34px;
}

.theme-dark {
    --sd-ink: #fff8ef;
    --sd-muted: #b8c3d7;
    --sd-primary: #2dd4bf;
    --sd-blue: #7c5cff;
    --sd-bg: #0b1020;
    --sd-sidebar: #0d1326;
    --sd-border: rgba(255, 255, 255, .12);
    --sd-soft: rgba(255, 255, 255, .08);
    --sd-card: #151b2d;
    background:
        radial-gradient(circle at 84% 7%, rgba(45, 212, 191, .24), transparent 28%),
        radial-gradient(circle at 18% 82%, rgba(124, 92, 255, .22), transparent 30%),
        radial-gradient(circle at 55% 38%, rgba(246, 182, 95, .12), transparent 26%),
        linear-gradient(135deg, #080d19 0%, #12182a 48%, #0c101d 100%);
    color: #fff8ef;
}

.theme-dark .app-sidebar {
    background:
        radial-gradient(circle at 74% 12%, rgba(45, 212, 191, .18), transparent 25%),
        radial-gradient(circle at 18% 88%, rgba(124, 92, 255, .26), transparent 28%),
        linear-gradient(180deg, #0f172a 0%, #101827 54%, #090d18 100%);
    border-right: 1px solid rgba(255, 255, 255, .08);
}

.theme-dark .sidebar-nav a:hover,
.theme-dark .sidebar-nav a.active {
    background: rgba(45, 212, 191, .14);
    border-color: rgba(45, 212, 191, .32);
    color: #fff;
}

.theme-dark .sidebar-footer {
    border-color: rgba(255, 255, 255, .1);
}

.theme-dark .app-topbar {
    background: rgba(11, 16, 32, .86);
    border-bottom-color: rgba(255, 255, 255, .08);
}

.theme-dark .theme-toggle-btn {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .18);
    color: #fff8ef;
}

.theme-dark .theme-toggle-btn:hover,
.theme-dark .theme-toggle-btn:focus {
    background: rgba(45, 212, 191, .16);
    border-color: rgba(45, 212, 191, .46);
    color: #fff8ef;
}

.theme-dark .theme-toggle-btn span {
    color: inherit !important;
}

.theme-dark .app-topbar strong,
.theme-dark .page-title h1,
.theme-dark .smart-card .card-header,
.theme-dark .mini-bar-row strong,
.theme-dark .ring-chart span {
    color: #fff8ef;
}

.theme-dark .text-muted,
.theme-dark .page-title p,
.theme-dark .app-topbar span {
    color: #b8c3d7 !important;
}

.theme-dark .app-topbar .theme-toggle-btn span,
.theme-dark .app-topbar .theme-toggle-btn:hover span,
.theme-dark .app-topbar .theme-toggle-btn:focus span {
    color: #fff8ef !important;
}

.theme-dark label,
.theme-dark .form-label,
.theme-dark .form-check-label,
.theme-dark .card-body small,
.theme-dark .smart-panel small {
    color: #d7e2f3 !important;
}

.theme-dark .smart-panel strong {
    color: #fff8ef;
}

.theme-dark .smart-panel {
    color: #fff8ef;
}

.theme-dark .page-title p,
.theme-dark .auth-form-panel .page-title p {
    color: #c8d5e8 !important;
}

.theme-dark .smart-card,
.theme-dark .metric-card,
.theme-dark .smart-panel {
    background: rgba(21, 27, 45, .84);
    border-color: rgba(255, 255, 255, .11);
    box-shadow: 0 26px 70px rgba(0, 0, 0, .3);
}

.theme-dark .smart-card .card-header {
    background:
        linear-gradient(90deg, rgba(45, 212, 191, .13), rgba(124, 92, 255, .12)),
        rgba(255, 255, 255, .03);
    border-bottom-color: rgba(255, 255, 255, .1);
}

.theme-dark .metric-card {
    border-left-color: #2dd4bf;
}

.theme-dark .metric-card span {
    color: #b8c3d7;
}

.theme-dark .metric-card strong {
    color: #fff8ef;
}

.theme-dark .btn-smart {
    background: linear-gradient(100deg, #2dd4bf, #7c5cff 72%, #4f7cff);
    box-shadow: 0 14px 32px rgba(124, 92, 255, .28);
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .28);
}

.theme-dark .btn-smart:hover,
.theme-dark .btn-smart:focus,
.theme-dark .btn-smart:active {
    background: linear-gradient(100deg, #5eead4, #8d6bff 68%, #5f8dff);
    color: #fff !important;
    filter: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .36);
}

.theme-dark .btn-outline-primary {
    border-color: rgba(45, 212, 191, .48);
    color: #99f6e4;
}

.theme-dark .btn-outline-primary:hover,
.theme-dark .btn-outline-primary:focus {
    background: rgba(45, 212, 191, .15);
    border-color: #5eead4;
    color: #ecfeff;
}

.theme-dark .btn-outline-secondary {
    border-color: rgba(255, 255, 255, .24);
    color: #dfd2c5;
}

.theme-dark .btn-outline-secondary:hover,
.theme-dark .btn-outline-secondary:focus {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .42);
    color: #fff8ef;
}

.theme-dark .sidebar-brand strong,
.theme-dark .sidebar-footer strong {
    color: #fff8ef;
    font-weight: 850;
}

.theme-dark .sidebar-brand small,
.theme-dark .sidebar-footer small {
    color: #dbc7b4;
}

.theme-dark .sidebar-footer .btn-outline-light {
    border-color: rgba(45, 212, 191, .44);
    color: #99f6e4;
}

.theme-dark .sidebar-footer .btn-outline-light:hover,
.theme-dark .sidebar-footer .btn-outline-light:focus {
    background: rgba(45, 212, 191, .16);
    border-color: #5eead4;
    color: #fff8ef;
}

.theme-dark .btn-light {
    background: #fff8ef;
    border-color: #fff8ef;
    color: #0f172a !important;
}

.theme-dark .btn-light:hover,
.theme-dark .btn-light:focus,
.theme-dark .btn-light:active,
.theme-dark .sidebar-footer .btn-light:hover,
.theme-dark .sidebar-footer .btn-light:focus,
.theme-dark .sidebar-footer .btn-light:active {
    background: #ffffff;
    border-color: #2dd4bf;
    color: #0f172a !important;
    box-shadow: 0 0 0 .18rem rgba(45, 212, 191, .18);
    text-shadow: none;
}

.theme-dark .form-control,
.theme-dark .form-select {
    background-color: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .18);
    color: #fff8ef;
}

.theme-dark .form-control::placeholder,
.theme-dark .form-select::placeholder {
    color: rgba(215, 226, 243, .68);
}

.theme-dark .form-control:disabled,
.theme-dark .form-select:disabled,
.theme-dark .form-control[readonly] {
    background-color: rgba(255, 255, 255, .12);
    color: rgba(255, 248, 239, .72);
}

.theme-dark a,
.theme-dark .auth-form-panel a {
    color: #ffd59b;
}

.theme-dark a:hover,
.theme-dark .auth-form-panel a:hover {
    color: #fff2d8;
}

.theme-dark .form-select option {
    background: #1e1720;
    color: #fff8ef;
}

.theme-dark .table thead th,
.theme-dark .team-table th {
    background: rgba(45, 212, 191, .13);
    color: #dffcff;
}

.theme-dark .table tbody td,
.theme-dark .team-table tbody td {
    border-color: rgba(255, 255, 255, .09);
    color: #fff8ef;
}

.theme-dark .team-table tbody tr {
    box-shadow: 0 10px 28px rgba(0, 0, 0, .2);
}

.theme-dark .team-table tbody tr.team-odd td {
    background: #ffffff;
    color: #334155;
}

.theme-dark .team-table tbody tr.team-even td {
    background: #f8fafc;
    color: #334155;
}

.theme-dark .team-table tbody tr.team-end td {
    border-bottom-color: #dbeafe;
}

.theme-dark .team-table tbody tr.team-start td:first-child {
    border-left-color: #2dd4bf;
}

.theme-dark .team-table .form-control,
.theme-dark .team-table .form-select {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.theme-dark .team-line-label {
    background: #e8fff8;
    border-color: #a7f3d0;
    color: #0f766e;
}

.theme-dark .team-table .form-control::placeholder {
    color: #64748b;
}

.theme-dark .team-table .form-control:focus,
.theme-dark .team-table .form-select:focus {
    background-color: #ffffff;
    border-color: #2dd4bf;
    box-shadow: 0 0 0 .18rem rgba(45, 212, 191, .18);
    color: #0f172a;
}

.theme-dark .team-table .form-select option {
    background: #ffffff;
    color: #334155;
}

.theme-dark .smart-accordion {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .11);
}

.theme-dark .smart-accordion summary {
    color: #fff8ef;
}

.theme-dark .smart-accordion-body {
    border-top-color: rgba(255, 255, 255, .1);
    color: #d8c9bd;
}

.theme-dark .encode-hero {
    background:
        radial-gradient(circle at 88% 18%, rgba(45, 212, 191, .38), transparent 24%),
        radial-gradient(circle at 42% 86%, rgba(124, 92, 255, .42), transparent 28%),
        radial-gradient(circle at 18% 18%, rgba(246, 182, 95, .18), transparent 22%),
        linear-gradient(135deg, #0e1726, #182135 46%, #15162a);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .32);
}

.theme-dark .hero-progress-track {
    background: rgba(255, 255, 255, .2);
}

.theme-dark .hero-progress-track div {
    background: linear-gradient(90deg, #2dd4bf, #f6b65f);
}

.theme-dark .chart-track,
.theme-dark .mini-bar-track {
    background: rgba(255, 255, 255, .12);
}

.theme-dark .chart-row strong {
    color: #fff4df;
}

.theme-dark .chart-row strong small {
    color: #99f6e4;
}

.theme-dark .chart-row span {
    color: #f5dfc3;
    font-weight: 800;
}

.theme-dark .mini-bar-row strong small,
.theme-dark .line-chart-note {
    color: #99f6e4;
}

.theme-dark .daily-line-chart .mini-bar-row span {
    color: #f5dfc3;
}

.theme-dark .public-shell {
    background:
        radial-gradient(circle at 88% 12%, rgba(45, 212, 191, .28), transparent 30%),
        radial-gradient(circle at 16% 78%, rgba(124, 92, 255, .3), transparent 26%),
        radial-gradient(circle at 58% 26%, rgba(246, 182, 95, .13), transparent 24%),
        linear-gradient(135deg, #080d19, #12182a 48%, #0c101d);
}

.theme-dark .auth-card {
    background: rgba(21, 27, 45, .88);
    border-color: rgba(255, 255, 255, .12);
    box-shadow: 0 34px 90px rgba(0, 0, 0, .34);
}

.theme-dark .auth-visual {
    background:
        radial-gradient(circle at 78% 16%, rgba(45, 212, 191, .42), transparent 28%),
        radial-gradient(circle at 24% 80%, rgba(124, 92, 255, .48), transparent 28%),
        radial-gradient(circle at 48% 38%, rgba(246, 182, 95, .2), transparent 25%),
        linear-gradient(155deg, #0e1726, #182135 48%, #15162a);
}

.theme-dark .auth-badge,
.theme-dark .auth-mini-grid span {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .18);
}

.theme-dark .auth-form-panel {
    background: rgba(255, 255, 255, .02);
}

.theme-dark .smart-confirm-box {
    background: #211a20;
    border: 1px solid rgba(255, 255, 255, .12);
    color: #fff8ef;
}

.theme-dark .smart-confirm-head {
    background: rgba(45, 212, 191, .12);
}

.theme-dark .smart-confirm-box p {
    color: #dfd2c5;
}

.theme-dark .alert-success {
    background: rgba(22, 163, 74, .18);
    border-color: rgba(34, 197, 94, .36);
    color: #bbf7d0;
}

.theme-dark .alert-danger {
    background: rgba(220, 38, 38, .18);
    border-color: rgba(248, 113, 113, .36);
    color: #fecaca;
}

.print-sheet {
    background: #fff;
    color: #000;
    padding: 24px;
}

.theme-dark .print-sheet,
.theme-dark section.print-sheet.smart-card {
    background: #fff !important;
    border-color: #e5e7eb !important;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .32);
    color: #000 !important;
}

.theme-dark .print-sheet h1,
.theme-dark .print-sheet h2,
.theme-dark .print-sheet h3,
.theme-dark .print-sheet p,
.theme-dark .print-sheet th,
.theme-dark .print-sheet td {
    color: #000 !important;
}

.theme-dark .print-sheet table {
    background: #fff !important;
}

.print-sheet table {
    border-collapse: collapse;
    width: 100%;
}

.print-sheet th,
.print-sheet td {
    border: 1px solid #111;
    min-height: 26px;
    padding: 6px;
}

@media (max-width: 768px) {
    .app-layout {
        display: block;
    }

    .app-sidebar {
        bottom: 0;
        left: 0;
        max-width: 86vw;
        position: fixed;
        top: 0;
        transform: translateX(-105%);
        transition: transform .2s ease;
        width: 280px;
        z-index: 1050;
    }

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

    .sidebar-backdrop {
        background: rgba(15, 23, 42, .48);
        bottom: 0;
        display: none;
        left: 0;
        position: fixed;
        right: 0;
        top: 0;
        z-index: 1040;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .app-topbar {
        padding: 12px;
    }

    .app-shell {
        padding: 18px 12px;
    }
    .chart-row {
        grid-template-columns: 1fr;
    }

    .user-progress-grid {
        grid-template-columns: 1fr;
    }

    .ring-chart {
        margin: 0 auto;
    }

    .mini-bar-row {
        grid-template-columns: 1fr;
    }

    .public-shell {
        padding: 14px;
    }

    .auth-card {
        grid-template-columns: 1fr;
        border-radius: 22px;
    }

    .auth-visual {
        min-height: 300px;
        padding: 28px;
    }

    .auth-badge {
        margin-bottom: 42px;
    }

    .auth-mini-grid {
        bottom: 24px;
        left: 28px;
        right: 28px;
    }

    .auth-form-panel {
        padding: 28px;
    }

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

    .hero-progress span {
        text-align: left;
    }
}

@media print {
    .no-print,
    .app-navbar,
    .app-sidebar,
    .app-topbar,
    .sidebar-backdrop {
        display: none !important;
    }
    .app-layout {
        display: block;
    }
    body {
        background: #fff;
    }
    .app-shell {
        padding: 0;
    }
}
