:root {
    --bg: #05070d;
    --surface: #0e1523;
    --surface-2: #162033;
    --surface-3: #1d2c42;

    --primary: #12b5ff;
    --primary-soft: rgba(18, 181, 255, 0.12);

    --text: #ffffff;
    --text-secondary: #c7d2e0;
    --muted: #8895a7;

    --border: #263549;

    --success: #34d399;
    --error: #ff5f6d;

    --sidebar-width: 260px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        Arial,
        sans-serif;
}

/* =====================================
   LOGIN
===================================== */

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background:
        radial-gradient(circle at top,
            rgba(18, 181, 255, 0.12),
            transparent 35%),
        var(--bg);
}

.login-shell {
    width: 100%;
    max-width: 1080px;

    display: flex;
    align-items: stretch;

    background: rgba(14, 21, 35, 0.96);

    border: 1px solid var(--border);
    border-radius: 24px;

    overflow: hidden;

    box-shadow:
        0 30px 80px
        rgba(0, 0, 0, 0.35);
}

.login-hero {
    flex: 1.3 1 0;
    min-width: 0;

    padding: 44px 48px;

    border-right: 1px solid var(--border);

    display: flex;
    flex-direction: column;
    justify-content: center;

    background:
        radial-gradient(circle at 0% 0%,
            rgba(18, 181, 255, 0.08),
            transparent 55%);
}

.login-card {
    flex: 1 1 0;
    min-width: 320px;

    padding: 44px 40px;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;

    margin-bottom: 32px;
}

.brand-mark {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;
    flex-shrink: 0;

    background: linear-gradient(135deg, #2fc2ff, #0a84e0);
    color: #00131d;

    font-weight: 900;
    font-size: 20px;
}

.login-brand h1 {
    margin: 0;
    font-size: 18px;
}

.login-brand p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.login-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;

    margin-bottom: 22px;

    color: var(--success);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.status-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--success);
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.15);
}

.login-headline {
    margin: 0 0 18px;

    font-size: 42px;
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.login-headline span {
    display: block;

    background: linear-gradient(90deg, #2fc2ff, #0a84e0);

    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.login-lede {
    margin: 0 0 32px;
    max-width: 440px;

    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.login-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.feature-card {
    padding: 14px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.02);
}

.feature-icon {
    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 10px;

    border-radius: 9px;

    background: var(--primary-soft);
    color: var(--primary);
}

.feature-icon svg {
    width: 15px;
    height: 15px;
}

.feature-card strong {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
}

.feature-card span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.login-header h2 {
    margin: 0;
    font-size: 24px;
}

.login-header p {
    margin: 8px 0 26px;
    color: var(--muted);
    font-size: 13px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon .input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);

    width: 16px;
    height: 16px;

    color: var(--muted);

    pointer-events: none;
}

.login-card .form-group input {
    padding-left: 42px;
}

.input-icon-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);

    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 8px;

    background: transparent;
    color: var(--muted);

    cursor: pointer;
}

.input-icon-toggle:hover,
.input-icon-toggle.is-visible {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.04);
}

.input-icon-toggle svg {
    width: 17px;
    height: 17px;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;

    margin: -4px 0 22px;

    font-size: 12.5px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-row input {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    color: var(--success);
    font-weight: 600;
}

.secure-badge svg {
    width: 14px;
    height: 14px;
}

.login-card .primary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    background: linear-gradient(90deg, #2fc2ff, #0a84e0);
    box-shadow:
        0 14px 30px
        rgba(18, 181, 255, 0.25);
}

.login-card .primary-button svg {
    width: 16px;
    height: 16px;
}

.login-footnote {
    margin: 22px 0 0;

    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.6;
    text-align: center;
}

@media (max-width: 860px) {
    .login-shell {
        flex-direction: column;
    }

    .login-hero {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .login-headline {
        font-size: 32px;
    }
}

@media (max-width: 520px) {
    .login-hero,
    .login-card {
        padding: 32px 24px;
    }

    .login-features {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    color: var(--text-secondary);
    font-size: 13px;
}

.form-group input {
    width: 100%;

    padding: 14px 15px;

    border:
        1px solid var(--border);

    border-radius: 11px;

    background: var(--surface-2);
    color: var(--text);

    outline: none;

    font-size: 14px;
}

.form-group input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(18, 181, 255, 0.1);
}

.primary-button {
    width: 100%;

    padding: 14px;

    border: 0;
    border-radius: 11px;

    background: var(--primary);

    color: #00131d;

    font-weight: 800;
    font-size: 14px;

    cursor: pointer;
}

.alert {
    padding: 12px 14px;

    margin-bottom: 18px;

    border-radius: 10px;

    font-size: 13px;
}

.alert-error {
    color: var(--error);

    background:
        rgba(255, 95, 109, 0.1);

    border:
        1px solid rgba(255, 95, 109, 0.2);
}

/* =====================================
   ADMIN LAYOUT
===================================== */
/* ============================================================
   ADVANCED STREAMING DASHBOARD
============================================================ */

.dashboard-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    overflow-x: auto;
}

.dashboard-meta > div {
    min-width: 150px;
    padding: 12px 14px;
    border: 1px solid #243047;
    border-radius: 12px;
    background: #101827;
}

.dashboard-meta span {
    display: block;
    margin-bottom: 4px;
    color: #8491a6;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.dashboard-meta strong {
    color: #f5f8ff;
    font-size: 12px;
    font-weight: 700;
}


/* ============================================================
   TELEMETRY STRIP
============================================================ */

.telemetry-strip {
    display: flex;
    align-items: stretch;
    width: 100%;
    margin-bottom: 18px;
    overflow-x: auto;
    border: 1px solid #27334a;
    border-radius: 16px;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, .025),
            transparent
        ),
        #0e1726;
    box-shadow:
        0 12px 35px
        rgba(0, 0, 0, .18);
}

.telemetry-strip::-webkit-scrollbar {
    height: 5px;
}

.telemetry-strip::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: #33415b;
}

.telemetry-item {
    position: relative;
    display: flex;
    flex: 1 0 auto;
    min-width: 110px;
    min-height: 62px;
    padding: 10px 15px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.telemetry-item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 14px;
    right: 0;
    width: 1px;
    height: calc(100% - 28px);
    background: #2a364d;
}

.telemetry-item span {
    margin-bottom: 5px;
    color: #7f8da4;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .1em;
}

.telemetry-item strong {
    color: #f7f9ff;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.telemetry-in strong {
    color: #38bdf8;
}

.telemetry-out strong {
    color: #a78bfa;
}


/* ============================================================
   SYSTEM STATUS
============================================================ */

.system-online {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid #2b374c;
    border-radius: 999px;
    color: #cbd5e1;
    background: #111a2a;
    font-size: 12px;
    font-weight: 800;
}

.system-online.good {
    color: #4ade80;
}

.system-online.warning {
    color: #fbbf24;
}

.system-online.bad {
    color: #fb7185;
}

.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow:
        0 0 12px
        currentColor;
}


/* ============================================================
   STAT GRID
============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    min-width: 0;
    padding: 17px;
    border: 1px solid #243047;
    border-radius: 15px;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, .018),
            transparent
        ),
        #101827;
}

.stat-card > span {
    display: block;
    margin-bottom: 10px;
    color: #8794a9;
    font-size: 11px;
    font-weight: 700;
}

.stat-card > strong {
    display: block;
    margin-bottom: 7px;
    overflow: hidden;
    color: #f8faff;
    font-size: 25px;
    font-weight: 850;
    text-overflow: ellipsis;
}

.stat-card > small {
    color: #7d8ba1;
    font-size: 10px;
}


/* ============================================================
   ADVANCED MONITOR GRID
============================================================ */

.advanced-monitor-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.7fr)
        minmax(320px, .8fr);
    gap: 18px;
    margin-bottom: 18px;
}

.monitor-panel,
.full-monitor-panel,
.panel {
    min-width: 0;
    border: 1px solid #253148;
    border-radius: 18px;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, .015),
            transparent
        ),
        #0f1828;
    box-shadow:
        0 14px 38px
        rgba(0, 0, 0, .14);
}

.monitor-panel,
.full-monitor-panel {
    padding: 20px;
}

.full-monitor-panel {
    margin-bottom: 18px;
}

.monitor-header,
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #202c40;
}

.monitor-header h2,
.panel-header h2 {
    margin: 0 0 5px;
    color: #f6f8fd;
    font-size: 16px;
    font-weight: 800;
}

.monitor-header p,
.panel-header p {
    margin: 0;
    color: #8390a5;
    font-size: 11px;
}

.monitor-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #4ade80;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
}

.monitor-live span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow:
        0 0 12px
        currentColor;
}


/* ============================================================
   CHART LEGEND
============================================================ */

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 14px 0 5px;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #94a0b4;
    font-size: 11px;
    font-weight: 700;
}

.chart-legend i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.legend-cpu {
    background: #38bdf8;
}

.legend-ram {
    background: #a78bfa;
}

.legend-network-in {
    background: #22d3ee;
}

.legend-network-out {
    background: #f59e0b;
}

.legend-requests {
    background: #60a5fa;
}

.legend-errors {
    background: #fb7185;
}


/* ============================================================
   SVG CHARTS
============================================================ */

.svg-chart-wrap {
    position: relative;
    height: 280px;
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid #202d43;
    border-radius: 14px;
    background:
        linear-gradient(
            rgba(255, 255, 255, .035) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, .035) 1px,
            transparent 1px
        ),
        #111c2e;
    background-size:
        100% 25%,
        10% 100%;
}

.svg-chart-wrap svg {
    display: block;
    width: 100%;
    height: 100%;
}

.chart-line {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect:
        non-scaling-stroke;
}

.cpu-line {
    stroke: #38bdf8;
    filter:
        drop-shadow(
            0 0 5px
            rgba(56, 189, 248, .35)
        );
}

.ram-line {
    stroke: #a78bfa;
    filter:
        drop-shadow(
            0 0 5px
            rgba(167, 139, 250, .35)
        );
}

.network-in-line {
    stroke: #22d3ee;
    filter:
        drop-shadow(
            0 0 5px
            rgba(34, 211, 238, .35)
        );
}

.network-out-line {
    stroke: #f59e0b;
    filter:
        drop-shadow(
            0 0 5px
            rgba(245, 158, 11, .35)
        );
}

.request-line {
    stroke: #60a5fa;
}

.error-line {
    stroke: #fb7185;
}


/* ============================================================
   PROCESS METRICS
============================================================ */

.process-grid {
    display: grid;
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );
    gap: 12px;
    padding-top: 18px;
}

.process-metric {
    min-width: 0;
    padding: 15px;
    border: 1px solid #263249;
    border-radius: 13px;
    background: #141f32;
}

.process-metric span {
    display: block;
    margin-bottom: 8px;
    color: #8997ab;
    font-size: 10px;
    font-weight: 700;
}

.process-metric strong {
    display: block;
    overflow: hidden;
    color: #f7f9ff;
    font-size: 17px;
    font-weight: 800;
    text-overflow: ellipsis;
}


/* ============================================================
   NETWORK VALUES
============================================================ */

.network-live-values {
    display: flex;
    align-items: center;
    gap: 12px;
}

.network-live-values > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid #2b374d;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.network-in-value {
    color: #22d3ee;
}

.network-out-value {
    color: #f59e0b;
}

.network-live-values strong {
    color: inherit;
}


/* ============================================================
   DASHBOARD GRID
============================================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.7fr)
        minmax(320px, .8fr);
    gap: 18px;
    margin-bottom: 18px;
}

.panel {
    padding: 20px;
}

.panel-value {
    text-align: right;
}

.panel-value strong {
    display: block;
    color: #f7f9ff;
    font-size: 19px;
}

.panel-value span {
    color: #8390a5;
    font-size: 10px;
}

.panel-link {
    color: #60a5fa;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.panel-link:hover {
    text-decoration: underline;
}


/* ============================================================
   STATUS LIST
============================================================ */

.status-list {
    padding-top: 8px;
}

.status-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 48px;
    border-bottom: 1px solid #29364c;
}

.status-list > div:last-child {
    border-bottom: 0;
}

.status-list > div > span {
    color: #dce3ef;
    font-size: 12px;
}

.status-list > div > span > span {
    display: block;
}

.status-list small {
    display: block;
    margin-top: 3px;
    color: #748198;
    font-size: 9px;
}

.status-list strong {
    color: #f6f8fd;
    font-size: 12px;
}

.status-list strong.good {
    color: #4ade80;
}

.status-list strong.warning {
    color: #fbbf24;
}

.status-list strong.bad {
    color: #fb7185;
}


/* ============================================================
   ACTIVITY
============================================================ */

.activity-list {
    padding-top: 8px;
}

.activity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    padding: 12px 0;
    border-bottom: 1px solid #263249;
}

.activity-row:last-child {
    border-bottom: 0;
}

.activity-main {
    min-width: 0;
    flex: 1;
}

.activity-request {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.activity-request strong {
    flex: 0 0 auto;
    padding: 3px 6px;
    border-radius: 5px;
    color: #7dd3fc;
    background: rgba(56, 189, 248, .1);
    font-size: 9px;
}

.activity-request span {
    min-width: 0;
    overflow: hidden;
    color: #e5eaf3;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-main > small {
    display: block;
    margin-top: 6px;
    overflow: hidden;
    color: #7d8a9f;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-meta {
    flex: 0 0 auto;
    text-align: right;
}

.activity-meta strong {
    display: block;
    font-size: 11px;
}

.activity-meta strong.good {
    color: #4ade80;
}

.activity-meta strong.warning {
    color: #fbbf24;
}

.activity-meta strong.bad {
    color: #fb7185;
}

.activity-meta small {
    display: block;
    margin-top: 4px;
    color: #7f8ca0;
    font-size: 9px;
}


/* ============================================================
   RANKING LIST
============================================================ */

.ranking-list {
    padding-top: 8px;
}

.ranking-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px 0;
    border-bottom: 1px solid #273349;
}

.ranking-row:last-child {
    border-bottom: 0;
}

.ranking-number {
    display: grid;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid #33415a;
    border-radius: 8px;
    color: #9eabc0;
    background: #141f31;
    font-size: 10px;
    font-weight: 800;
}

.ranking-main {
    min-width: 0;
    flex: 1;
}

.ranking-main strong {
    display: block;
    overflow: hidden;
    color: #e9edf5;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-main small {
    display: block;
    margin-top: 4px;
    color: #7d899e;
    font-size: 9px;
}

.ranking-value {
    flex: 0 0 auto;
    text-align: right;
}

.ranking-value strong {
    display: block;
    color: #f8faff;
    font-size: 13px;
}

.ranking-value small {
    display: block;
    margin-top: 3px;
    color: #7f8ca1;
    font-size: 9px;
}


/* ============================================================
   EMPTY STATES
============================================================ */

.empty-chart {
    display: flex;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    color: #7f8ca2;
    text-align: center;
}

.empty-chart strong {
    color: #9ba7ba;
    font-size: 12px;
}

.empty-chart span {
    font-size: 10px;
}

.empty-mini {
    padding: 25px 10px;
    color: #7f8ca1;
    font-size: 11px;
    text-align: center;
}


/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 1350px) {

    .stats-grid {
        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );
    }

}


@media (max-width: 1100px) {

    .advanced-monitor-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 850px) {

    .stats-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

    .network-live-values {
        align-items: flex-end;
        flex-direction: column;
    }

}


@media (max-width: 620px) {

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .process-grid {
        grid-template-columns: 1fr;
    }

    .monitor-header,
    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .network-live-values {
        width: 100%;
        align-items: stretch;
    }

    .svg-chart-wrap {
        height: 220px;
    }

}

.admin-layout {
    min-height: 100vh;
}

.sidebar {
    position: fixed;

    left: 0;
    top: 0;
    bottom: 0;

    width: var(--sidebar-width);

    display: flex;
    flex-direction: column;

    padding: 20px 14px;

    background: var(--surface);

    border-right:
        1px solid var(--border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 4px 8px 22px;
}

.sidebar-brand strong {
    display: block;
}

.sidebar-brand span {
    display: block;

    margin-top: 3px;

    color: var(--muted);
    font-size: 12px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;

    overflow-y: auto;
}

.nav-item {
    padding: 11px 13px;

    border-radius: 9px;

    color: var(--text-secondary);

    text-decoration: none;

    font-size: 14px;

    transition: 0.2s;
}

.nav-item:hover {
    color: var(--text);
    background: var(--surface-2);
}

.nav-item.active {
    color: var(--primary);

    background: var(--primary-soft);
}

.sidebar-footer {
    margin-top: auto;

    padding-top: 18px;

    border-top:
        1px solid var(--border);
}

.admin-user {
    margin-bottom: 12px;
}

.admin-user strong {
    display: block;
}

.admin-user span {
    color: var(--muted);
    font-size: 12px;
}

.logout-button {
    width: 100%;

    padding: 10px;

    border:
        1px solid var(--border);

    border-radius: 9px;

    background: transparent;

    color: var(--text-secondary);

    cursor: pointer;
}

.main-content {
    margin-left: var(--sidebar-width);

    min-height: 100vh;

    padding: 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 28px;
}

.topbar h1 {
    margin: 0;

    font-size: 27px;
}

.topbar p {
    margin: 7px 0 0;

    color: var(--muted);
}

.system-online {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 9px 13px;

    border:
        1px solid var(--border);

    border-radius: 999px;

    color: var(--text-secondary);

    font-size: 13px;
}

.online-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--success);

    box-shadow:
        0 0 12px rgba(52, 211, 153, 0.8);
}

/* =====================================
   STATS
===================================== */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit,
            minmax(190px, 1fr));

    gap: 16px;

    margin-bottom: 22px;
}

.stat-card {
    padding: 19px;

    border:
        1px solid var(--border);

    border-radius: 15px;

    background: var(--surface);
}

.stat-card span {
    display: block;

    color: var(--muted);

    font-size: 13px;
}

.stat-card strong {
    display: block;

    margin: 10px 0 7px;

    font-size: 28px;
}

.stat-card small {
    color: var(--text-secondary);
}

/* =====================================
   PANELS
===================================== */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 2fr) minmax(280px, 1fr);

    gap: 18px;
}

.panel {
    padding: 20px;

    border:
        1px solid var(--border);

    border-radius: 15px;

    background: var(--surface);
}

.panel-header h2 {
    margin: 0;

    font-size: 17px;
}

.panel-header p {
    margin: 6px 0 0;

    color: var(--muted);

    font-size: 13px;
}

.empty-chart {
    min-height: 280px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-top: 18px;

    border-radius: 12px;

    background: var(--surface-2);

    color: var(--muted);
}

.status-list {
    margin-top: 18px;
}

.status-list>div {
    display: flex;
    justify-content: space-between;

    padding: 14px 0;

    border-bottom:
        1px solid var(--border);
}

.good {
    color: var(--success);
}

/* =====================================
   RESPONSIVE
===================================== */

@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.page-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
}

.primary-link-button,
.secondary-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 15px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.primary-link-button {
    background: var(--primary);
    color: #00131d;
}

.secondary-link-button {
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.data-table th {
    color: var(--muted);
    font-weight: 600;
}

.channel-cell {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 220px;
}

.channel-cell img,
.channel-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: contain;
    background: var(--surface-2);
}

.channel-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 800;
}

.channel-cell strong,
.channel-cell small {
    display: block;
}

.channel-cell small {
    margin-top: 4px;
    color: var(--muted);
}

.badge,
.status-badge {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
}

.badge {
    background: var(--surface-2);
    color: var(--text-secondary);
}

.status-badge.enabled {
    color: var(--success);
    background: rgba(52, 211, 153, 0.1);
}

.status-badge.disabled {
    color: var(--error);
    background: rgba(255, 95, 109, 0.1);
}

.small-button {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
}

.empty-state {
    padding: 50px 20px;
    text-align: center;
    color: var(--muted);
}

.channel-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-section {
    padding: 22px;
}

.section-title {
    margin-bottom: 20px;
}

.section-title h2 {
    margin: 0;
    font-size: 17px;
}

.section-title p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.form-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.full-width {
    grid-column: 1 / -1;
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    outline: none;
    font: inherit;
}

.form-group textarea {
    resize: vertical;
}

.switch-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.check-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-bottom: 30px;
}

.auto-width {
    width: auto;
    padding-left: 20px;
    padding-right: 20px;
}

@media (max-width: 700px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .full-width {
        grid-column: auto;
    }
}

.sidebar-brand-text {
    min-width: 0;
}

.sidebar-brand-text strong {
    display: block;

    white-space: nowrap;
}

.sidebar-brand-text span {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 12px;
}

.sidebar-nav {
    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 4px;

    overflow-y: auto;
    overflow-x: hidden;

    padding-right: 3px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border);

    border-radius: 999px;
}

.nav-item {
    display: flex;
    align-items: center;

    gap: 11px;

    min-height: 42px;

    padding: 10px 12px;

    border-radius: 9px;

    color: var(--text-secondary);

    text-decoration: none;

    font-size: 14px;

    transition:
        background 0.18s ease,
        color 0.18s ease;
}

.nav-item:hover {
    color: var(--text);

    background: var(--surface-2);
}

.nav-item.active {
    color: var(--primary);

    background: var(--primary-soft);
}

.nav-icon {
    width: 22px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    color: currentColor;

    font-size: 17px;
}

.nav-label {
    min-width: 0;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.nav-section-title {
    margin:
        18px 10px 7px;

    color: var(--muted);

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 0.11em;

    text-transform: uppercase;
}

.sidebar-footer {
    margin-top: 14px;

    padding-top: 14px;

    border-top:
        1px solid var(--border);
}

.admin-user {
    display: flex;
    align-items: center;

    gap: 10px;

    margin-bottom: 12px;

    padding: 0 4px;
}

.admin-avatar {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 11px;

    background:
        var(--primary-soft);

    color: var(--primary);

    font-weight: 900;
}

.admin-user-info {
    min-width: 0;
}

.admin-user-info strong {
    display: block;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    font-size: 13px;
}

.admin-user-info span {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;

    text-transform: capitalize;
}

.logout-form {
    margin: 0;
}

.logout-button {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 10px 12px;

    border:
        1px solid var(--border);

    border-radius: 9px;

    background: transparent;

    color: var(--text-secondary);

    cursor: pointer;

    transition:
        background 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease;
}

.logout-button:hover {
    color: var(--error);

    border-color:
        rgba(255, 95, 109, 0.35);

    background:
        rgba(255, 95, 109, 0.08);
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.row-actions form {
    margin: 0;
}

.small-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 7px 10px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface-2);
    color: var(--text);

    text-decoration: none;
    font-size: 13px;
}

.small-button.danger {
    color: var(--error);

    border-color:
        rgba(255, 95, 109, 0.25);

    background:
        rgba(255, 95, 109, 0.07);
}

.source-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.source-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    padding: 16px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-2);
}

.source-card-main {
    min-width: 0;
    flex: 1;
}

.source-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;

    margin-bottom: 8px;
}

.source-url {
    max-width: 760px;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    margin-bottom: 7px;

    color: var(--text-secondary);

    font-size: 12px;

    font-family:
        Consolas,
        monospace;
}

.source-card small {
    color: var(--muted);
}

@media (max-width: 800px) {
    .source-card {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ========================================= CHANNEL CREATE PAGE ========================================= */
.channel-page-header {
    align-items: flex-start;
}

.page-eyebrow {
    margin-bottom: 7px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.channel-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-section {
    padding: 24px;
}

/* ========================================= SECTION HEADER ========================================= */
.section-heading-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}

.section-heading-row.no-margin {
    margin: 0;
}

.section-number {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(18, 181, 255, 0.25);
    border-radius: 11px;
    background: rgba(18, 181, 255, 0.08);
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
}

.section-title {
    min-width: 0;
}

.section-title h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 750;
}

.section-title p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

/* ========================================= FORM GRID ========================================= */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-group {
    min-width: 0;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 650;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form-group input,
.form-group select {
    min-height: 46px;
    padding: 0 14px;
}

.form-group textarea {
    padding: 13px 14px;
    resize: vertical;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: rgba(255, 255, 255, 0.16);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(18, 181, 255, 0.10);
    background: rgba(18, 181, 255, 0.025);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(136, 149, 167, 0.72);
}

.required {
    color: var(--error);
}

.field-help {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 11px;
}

/* ========================================= LABEL ACTION ========================================= */
.label-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.text-action-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.text-action-button:hover {
    text-decoration: underline;
}

/* ========================================= READ ONLY FIELD ========================================= */
.readonly-field {
    min-height: 46px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--muted);
    font-size: 13px;
}

/* ========================================= SOURCE SECURITY BOX ========================================= */
.source-highlight-box {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 22px;
    padding: 15px;
    border: 1px solid rgba(18, 181, 255, 0.16);
    border-radius: 12px;
    background: rgba(18, 181, 255, 0.045);
}

.source-security-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9px;
    background: rgba(18, 181, 255, 0.1);
}

.source-highlight-box strong {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
}

.source-highlight-box p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

/* ========================================= SOURCE EDITOR CARDS =========================================
   Cards rendered from #sourceTemplate into #sourcesContainer when
   adding/restoring stream sources on the channel create/edit forms.
*/
.dynamic-sources-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.source-editor-card {
    padding: 18px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--surface-2);
}

.source-editor-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;

    margin-bottom: 18px;
}

.source-editor-header .source-title {
    margin-bottom: 4px;
}

.source-editor-header small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.source-editor-card .form-grid {
    margin-bottom: 4px;
}

.small-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========================================= ADVANCED PANELS ========================================= */
.advanced-panel {
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.018);
}

.advanced-panel.compact {
    margin-top: 16px;
}

.advanced-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 16px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.advanced-panel summary::-webkit-details-marker {
    display: none;
}

.advanced-panel summary strong {
    display: block;
    font-size: 12px;
}

.advanced-panel summary small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

.summary-chevron {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--text-secondary);
    font-size: 16px;
    transition: transform 0.18s ease;
}

details[open]>summary .summary-chevron {
    transform: rotate(45deg);
}

.advanced-panel-content {
    padding: 18px 16px;
    border-top: 1px solid var(--border);
}

/* ========================================= CONDITIONAL DRM ========================================= */
.drm-selector-group {
    max-width: 480px;
}

.conditional-fields {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid rgba(18, 181, 255, 0.18);
    border-radius: 13px;
    background: rgba(18, 181, 255, 0.035);
}

.conditional-fields[hidden],
.nested-conditional[hidden],
.empty-option-state[hidden] {
    display: none !important;
}

.conditional-header {
    margin-bottom: 18px;
}

.conditional-header strong {
    display: block;
    font-size: 13px;
}

.conditional-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.nested-conditional {
    margin-top: 18px;
}

/* ========================================= DRM CHOICE CARDS ========================================= */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.choice-card {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.choice-card:hover {
    border-color: rgba(18, 181, 255, 0.35);
}

.choice-card:has(input:checked) {
    border-color: var(--primary);
    background: rgba(18, 181, 255, 0.07);
}

.choice-card input {
    margin-top: 3px;
    accent-color: var(--primary);
}

.choice-card strong {
    display: block;
    font-size: 12px;
}

.choice-card small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
}

/* ========================================= NO DRM STATE ========================================= */
.empty-option-state {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.018);
}

.empty-option-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(52, 211, 153, 0.1);
    color: var(--success);
    font-weight: 800;
}

.empty-option-state strong {
    display: block;
    font-size: 12px;
}

.empty-option-state p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 10px;
}

/* ========================================= COLLAPSIBLE SECTION ========================================= */
.section-details>summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    list-style: none;
}

.section-details>summary::-webkit-details-marker {
    display: none;
}

.section-details-content {
    padding-top: 24px;
}

/* ========================================= SETTINGS ========================================= */
.settings-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    cursor: pointer;
}

.setting-row-content strong {
    display: block;
    font-size: 12px;
}

.setting-row-content span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

/* ========================================= MODERN SWITCH ========================================= */
.modern-switch {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.modern-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-slider {
    position: absolute;
    inset: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.switch-slider::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: transform 0.2s ease, background 0.2s ease;
}

.modern-switch input:checked+.switch-slider {
    border-color: var(--primary);
    background: rgba(18, 181, 255, 0.25);
}

.modern-switch input:checked+.switch-slider::after {
    transform: translateX(18px);
    background: var(--primary);
}

/* ========================================= STICKY ACTIONS ========================================= */
.sticky-form-actions {
    position: sticky;
    bottom: 16px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    background: rgba(14, 21, 35, 0.92);
    backdrop-filter: blur(18px);
    box-shadow: 0 14px 45px rgba(0, 0, 0, 0.28);
}

.action-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 11px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.55);
}

.form-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========================================= MODAL ========================================= */
body.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2, 5, 10, 0.76);
    backdrop-filter: blur(7px);
}

.modal-backdrop[hidden] {
    display: none !important;
}

.modal-card {
    width: min(460px, 100%);
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.modal-header h2 {
    margin: 0;
    font-size: 17px;
}

.modal-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.modal-close-button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 19px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.secondary-button {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.inline-form-error {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 95, 109, 0.22);
    border-radius: 9px;
    background: rgba(255, 95, 109, 0.07);
    color: var(--error);
    font-size: 11px;
}

/* ========================================= ALERT ========================================= */
.alert-error {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 95, 109, 0.22);
    border-radius: 12px;
    background: rgba(255, 95, 109, 0.07);
    color: var(--error);
}

.alert-error strong {
    font-size: 12px;
}

.alert-error span {
    font-size: 11px;
}

/* ========================================= RESPONSIVE ========================================= */
@media (max-width: 760px) {

    .form-grid,
    .choice-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: auto;
    }

    .sticky-form-actions {
        position: static;
        align-items: stretch;
        flex-direction: column;
    }

    .form-action-buttons {
        width: 100%;
    }

    .form-action-buttons>* {
        flex: 1;
    }

    .channel-page-header {
        gap: 16px;
    }
}

/* =========================================
   LIVE EVENTS
========================================= */

.event-stats-grid {
    margin-bottom: 18px;
}

.live-stat-value {
    color: var(--error);
}
.event-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

.event-action-button {
    min-height: 34px;
    padding: 0 11px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid
        rgba(255, 255, 255, 0.08);

    border-radius: 9px;

    color: #cbd5e1;

    background:
        rgba(255, 255, 255, 0.055);

    text-decoration: none;

    font-family: inherit;
    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.event-action-button:hover {
    transform:
        translateY(-1px);

    border-color:
        rgba(56, 189, 248, 0.3);

    background:
        rgba(56, 189, 248, 0.1);
}

.event-action-warning {
    color: #fde68a;

    border-color:
        rgba(234, 179, 8, 0.18);

    background:
        rgba(202, 138, 4, 0.12);
}

.event-action-success {
    color: #86efac;

    border-color:
        rgba(34, 197, 94, 0.18);

    background:
        rgba(22, 163, 74, 0.12);
}

.event-action-danger {
    color: #fca5a5;

    border-color:
        rgba(239, 68, 68, 0.18);

    background:
        rgba(220, 38, 38, 0.12);
}

/* =========================================
   EVENT TOOLBAR
========================================= */

.event-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    margin-bottom: 18px;

    padding: 14px;
}

.event-search-box {
    flex: 1;

    max-width: 420px;
}

.event-search-box input {
    width: 100%;
    min-height: 42px;

    box-sizing: border-box;

    padding: 0 14px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface-2);
    color: var(--text);

    outline: none;
}

.event-search-box input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(18, 181, 255, 0.10);
}

.event-filter-tabs {
    display: flex;
    align-items: center;

    gap: 6px;

    overflow-x: auto;
}

.event-filter-button {
    min-height: 36px;

    padding: 0 12px;

    border: 1px solid transparent;
    border-radius: 9px;

    background: transparent;
    color: var(--muted);

    cursor: pointer;

    font-size: 11px;
    font-weight: 700;

    white-space: nowrap;
}

.event-filter-button:hover {
    color: var(--text-secondary);

    background:
        rgba(255, 255, 255, 0.035);
}

.event-filter-button.active {
    border-color:
        rgba(18, 181, 255, 0.2);

    background:
        rgba(18, 181, 255, 0.09);

    color: var(--primary);
}


/* =========================================
   EVENTS PANEL
========================================= */

.events-panel {
    overflow: hidden;
}

.event-result-count {
    color: var(--muted);

    font-size: 11px;
}

.event-result-count span {
    color: var(--text-secondary);

    font-weight: 750;
}


/* =========================================
   EVENT LIST
========================================= */

.event-list {
    display: flex;
    flex-direction: column;
}

.event-row {
    display: grid;

    grid-template-columns:
        28px 76px minmax(220px, 1.6fr) minmax(160px, 0.9fr) 130px auto;

    align-items: center;

    gap: 18px;

    padding: 16px 0;

    border-bottom:
        1px solid var(--border);
}

.event-row.is-checked {
    background: rgba(47, 158, 107, 0.06);
}

.event-select-cell {
    margin: 0;
    cursor: pointer;
}

.event-row:last-child {
    border-bottom: 0;
}

.event-row[hidden] {
    display: none !important;
}


/* =========================================
   EVENT ARTWORK
========================================= */

.event-artwork {
    position: relative;

    width: 76px;
    height: 54px;

    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface-2);
}

.event-artwork img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: contain;

    padding: 6px;

    box-sizing: border-box;
}

.event-artwork-placeholder {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(135deg,
            rgba(18, 181, 255, 0.12),
            rgba(138, 99, 255, 0.10));

    color: var(--primary);

    font-size: 20px;
    font-weight: 800;
}

.event-live-overlay {
    position: absolute;

    left: 5px;
    bottom: 5px;

    padding: 3px 5px;

    border-radius: 5px;

    background: var(--error);
    color: #ffffff;

    font-size: 8px;
    font-weight: 900;

    letter-spacing: 0.06em;
}


/* =========================================
   EVENT INFO
========================================= */

.event-main-info {
    min-width: 0;
}

.event-title-row {
    display: flex;
    align-items: center;

    gap: 8px;

    min-width: 0;
}

.event-title-row h3 {
    margin: 0;

    overflow: hidden;

    color: var(--text);

    font-size: 13px;
    font-weight: 750;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.featured-badge {
    flex-shrink: 0;

    padding: 3px 6px;

    border:
        1px solid rgba(138, 99, 255, 0.22);

    border-radius: 5px;

    background:
        rgba(138, 99, 255, 0.08);

    color: #a98cff;

    font-size: 8px;
    font-weight: 800;
}

.event-meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 6px;

    margin-top: 6px;
}

.event-meta-line span {
    color: var(--muted);

    font-size: 9px;
}

.event-meta-line span:not(:last-child)::after {
    content: "•";

    margin-left: 6px;

    color:
        rgba(136, 149, 167, 0.45);
}

.event-matchup {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-top: 9px;
}

.event-matchup strong {
    color: var(--text-secondary);

    font-size: 10px;
}

.event-matchup span {
    color: var(--primary);

    font-size: 8px;
    font-weight: 900;
}

.event-participants {
    margin-top: 8px;

    overflow: hidden;

    color: var(--text-secondary);

    font-size: 10px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================
   EVENT SCHEDULE
========================================= */

.event-schedule-info {
    min-width: 0;
}

.event-date-label {
    display: block;

    margin-bottom: 4px;

    color: var(--muted);

    font-size: 8px;

    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.event-schedule-info strong {
    display: block;

    color: var(--text-secondary);

    font-size: 10px;
    line-height: 1.45;
}

.event-schedule-info small {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 8px;
}


/* =========================================
   STATUS
========================================= */

.event-status-column {
    display: flex;
    align-items: flex-start;
    flex-direction: column;

    gap: 6px;
}

.event-status-column small {
    color: var(--muted);

    font-size: 8px;
}

.event-status-badge {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    padding: 5px 8px;

    border-radius: 7px;

    font-size: 9px;
    font-weight: 800;

    text-transform: capitalize;
}

.status-live {
    border:
        1px solid rgba(255, 95, 109, 0.22);

    background:
        rgba(255, 95, 109, 0.08);

    color: var(--error);
}

.status-scheduled {
    border:
        1px solid rgba(18, 181, 255, 0.2);

    background:
        rgba(18, 181, 255, 0.07);

    color: var(--primary);
}

.status-ended {
    border:
        1px solid var(--border);

    background:
        rgba(255, 255, 255, 0.035);

    color: var(--muted);
}

.status-cancelled {
    border:
        1px solid rgba(255, 184, 77, 0.18);

    background:
        rgba(255, 184, 77, 0.06);

    color: #ffb84d;
}

.live-pulse-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: currentColor;

    animation:
        eventLivePulse 1.5s infinite;
}

@keyframes eventLivePulse {

    0% {
        box-shadow:
            0 0 0 0 rgba(255, 95, 109, 0.45);
    }

    70% {
        box-shadow:
            0 0 0 6px rgba(255, 95, 109, 0);
    }

    100% {
        box-shadow:
            0 0 0 0 rgba(255, 95, 109, 0);
    }

}


/* =========================================
   EVENT ACTIONS
========================================= */

.event-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.event-action-button {
    min-height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 11px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface-2);
    color: var(--text-secondary);

    font-size: 10px;
    font-weight: 700;

    text-decoration: none;
}

.event-action-button:hover {
    border-color:
        rgba(18, 181, 255, 0.3);

    color: var(--primary);
}


/* =========================================
   EMPTY STATE
========================================= */

.event-empty-state {
    display: flex;
    align-items: center;
    flex-direction: column;

    padding: 60px 20px;

    text-align: center;
}

.event-empty-state[hidden] {
    display: none !important;
}

.event-empty-icon {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 14px;

    border-radius: 14px;

    background:
        rgba(18, 181, 255, 0.08);

    color: var(--primary);

    font-size: 20px;
}

.event-empty-state h3 {
    margin: 0;

    font-size: 14px;
}

.event-empty-state p {
    margin: 7px 0 18px;

    color: var(--muted);

    font-size: 11px;
}


/* =========================================
   EVENT AUTOMATION
========================================= */

.schedule-settings {
    margin-top: 22px;
}

.automation-option-box {
    padding: 14px 16px;

    border:
        1px solid rgba(18, 181, 255, 0.14);

    border-radius: 11px;

    background:
        rgba(18, 181, 255, 0.035);
}

.automation-option-box[hidden] {
    display: none !important;
}

.input-suffix-wrap {
    display: flex;
    align-items: center;

    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface-2);
}

.input-suffix-wrap input {
    flex: 1;

    min-width: 0;

    border: 0 !important;

    box-shadow: none !important;
}

.input-suffix-wrap span {
    padding: 0 13px;

    color: var(--muted);

    font-size: 10px;
}

.priority-grid {
    margin-top: 20px;
}


/* =========================================
   RESPONSIVE EVENTS
========================================= */

@media (max-width: 1100px) {

    .event-row {
        grid-template-columns:
            28px 70px minmax(200px, 1fr) 150px auto;
    }

    .event-status-column {
        display: none;
    }

}


@media (max-width: 820px) {

    .event-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .event-search-box {
        max-width: none;
    }

    .event-row {
        grid-template-columns:
            24px 64px minmax(0, 1fr) auto;

        gap: 12px;
    }

    .event-artwork {
        width: 64px;
        height: 48px;
    }

    .event-schedule-info {
        display: none;
    }

}


@media (max-width: 560px) {

    .event-row {
        grid-template-columns:
            22px 56px minmax(0, 1fr);
    }

    .event-artwork {
        width: 56px;
        height: 44px;
    }

    .event-actions {
        grid-column: 1 / -1;

        justify-content: flex-end;
    }

}

/* =========================================================
   PLAYLIST ADMIN
   ========================================================= */

:root {
    --pl-bg: #070b14;
    --pl-surface: #0d1422;
    --pl-surface-2: #111b2d;
    --pl-surface-3: #162238;

    --pl-border: rgba(255, 255, 255, 0.08);
    --pl-border-strong: rgba(255, 255, 255, 0.14);

    --pl-text: #f7f9fc;
    --pl-text-secondary: #a9b4c7;
    --pl-text-muted: #738096;

    --pl-primary: #2f81f7;
    --pl-primary-hover: #4a91f8;

    --pl-success: #2dd4a8;
    --pl-warning: #f6b94a;
    --pl-danger: #ff627d;

    --pl-radius-sm: 8px;
    --pl-radius: 12px;
    --pl-radius-lg: 18px;

    --pl-shadow:
        0 18px 45px rgba(0, 0, 0, 0.24);
}


/* =========================================================
   TOPBAR ACTIONS
   ========================================================= */

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 42px;
    padding: 0 16px;

    border: 1px solid transparent;
    border-radius: 10px;

    font: inherit;
    font-size: 14px;
    font-weight: 700;

    text-decoration: none;
    cursor: pointer;

    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: #ffffff;
    background: var(--pl-primary);
}

.button-primary:hover {
    background: var(--pl-primary-hover);
}

.button-secondary {
    color: var(--pl-text);
    background: var(--pl-surface-2);
    border-color: var(--pl-border);
}

.button-secondary:hover {
    background: var(--pl-surface-3);
    border-color: var(--pl-border-strong);
}


/* =========================================================
   ALERTS
   ========================================================= */

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;

    border: 1px solid var(--pl-border);
    border-radius: var(--pl-radius);

    font-size: 14px;
    line-height: 1.5;
}

.alert-success {
    color: #9ff3dc;
    background: rgba(45, 212, 168, 0.09);
    border-color: rgba(45, 212, 168, 0.24);
}

.alert-error {
    color: #ffb2bf;
    background: rgba(255, 98, 125, 0.09);
    border-color: rgba(255, 98, 125, 0.24);
}

.alert-warning {
    color: #ffd990;
    background: rgba(246, 185, 74, 0.09);
    border-color: rgba(246, 185, 74, 0.24);
}


/* =========================================================
   SUMMARY GRID
   ========================================================= */

.playlist-summary-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;
    margin-bottom: 20px;
}

.playlist-summary-grid .stat-card {
    min-width: 0;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.playlist-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 330px;
    padding: 40px 20px;

    text-align: center;
}

.playlist-empty-icon {
    display: grid;
    place-items: center;

    width: 64px;
    height: 64px;

    margin-bottom: 18px;

    border: 1px solid var(--pl-border);
    border-radius: 18px;

    color: var(--pl-primary);
    background: rgba(47, 129, 247, 0.09);

    font-size: 28px;
}

.playlist-empty-state h3 {
    margin: 0 0 8px;
    color: var(--pl-text);
}

.playlist-empty-state p {
    max-width: 430px;
    margin: 0 0 20px;

    color: var(--pl-text-secondary);
    line-height: 1.6;
}


/* =========================================================
   TABLE
   ========================================================= */

.playlist-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.playlist-table {
    width: 100%;
    min-width: 1100px;

    border-collapse: collapse;
}

.playlist-table th,
.playlist-table td {
    padding: 15px 14px;

    border-bottom:
        1px solid var(--pl-border);

    text-align: left;
    vertical-align: middle;
}

.playlist-table th {
    color: var(--pl-text-muted);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.playlist-table td {
    color: var(--pl-text-secondary);
    font-size: 13px;
}

.playlist-table tbody tr {
    transition:
        background-color 0.16s ease;
}

.playlist-table tbody tr:hover {
    background:
        rgba(255, 255, 255, 0.025);
}


/* =========================================================
   PLAYLIST NAME CELL
   ========================================================= */

.playlist-name-cell {
    display: flex;
    align-items: center;

    min-width: 250px;
    gap: 12px;
}

.playlist-logo {
    display: grid;
    place-items: center;

    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    overflow: hidden;

    border: 1px solid var(--pl-border);
    border-radius: 12px;

    color: #ffffff;
    background:
        linear-gradient(135deg,
            rgba(47, 129, 247, 0.9),
            rgba(111, 76, 255, 0.75));

    font-size: 16px;
    font-weight: 800;
}

.playlist-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-title-link {
    display: block;

    margin-bottom: 4px;

    color: var(--pl-text);
    text-decoration: none;

    font-size: 14px;
    font-weight: 750;
}

.playlist-title-link:hover {
    color: var(--pl-primary-hover);
}

.playlist-source-url {
    display: block;

    max-width: 290px;

    overflow: hidden;

    color: var(--pl-text-muted);

    white-space: nowrap;
    text-overflow: ellipsis;
}


/* =========================================================
   BADGES
   ========================================================= */

.type-badge,
.sync-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 27px;
    padding: 0 9px;

    border: 1px solid var(--pl-border);
    border-radius: 999px;

    font-size: 11px;
    font-weight: 800;

    text-transform: capitalize;
}

.type-remote {
    color: #8dc0ff;
    background: rgba(47, 129, 247, 0.1);
    border-color: rgba(47, 129, 247, 0.22);
}

.type-manual {
    color: #c4b4ff;
    background: rgba(128, 94, 255, 0.1);
    border-color: rgba(128, 94, 255, 0.22);
}

.sync-success {
    color: #91efd5;
    background: rgba(45, 212, 168, 0.09);
    border-color: rgba(45, 212, 168, 0.22);
}

.sync-failed {
    color: #ffacba;
    background: rgba(255, 98, 125, 0.09);
    border-color: rgba(255, 98, 125, 0.22);
}

.sync-syncing {
    color: #8dc0ff;
    background: rgba(47, 129, 247, 0.1);
    border-color: rgba(47, 129, 247, 0.22);
}

.sync-never {
    color: var(--pl-text-muted);
    background: rgba(255, 255, 255, 0.035);
}


/* =========================================================
   COUNTS
   ========================================================= */

.channel-count-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.channel-count-cell strong {
    color: var(--pl-text);
    font-size: 15px;
}

.channel-count-cell small {
    color: var(--pl-text-muted);
}

.text-warning {
    color: var(--pl-warning) !important;
}

.text-muted {
    color: var(--pl-text-muted);
}

.refresh-info {
    color: var(--pl-text-secondary);
}


/* =========================================================
   STATUS TOGGLE
   ========================================================= */

.status-toggle {
    min-height: 31px;
    padding: 0 10px;

    border-radius: 999px;

    font: inherit;
    font-size: 11px;
    font-weight: 800;

    cursor: pointer;
}

.status-toggle.is-enabled {
    color: #91efd5;
    background: rgba(45, 212, 168, 0.09);
    border: 1px solid rgba(45, 212, 168, 0.22);
}

.status-toggle.is-disabled {
    color: #ffacba;
    background: rgba(255, 98, 125, 0.09);
    border: 1px solid rgba(255, 98, 125, 0.22);
}


/* =========================================================
   TABLE ACTIONS
   ========================================================= */

.table-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.table-actions form {
    margin: 0;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 32px;
    padding: 0 10px;

    border: 1px solid var(--pl-border);
    border-radius: 8px;

    color: var(--pl-text-secondary);
    background: var(--pl-surface-2);

    font: inherit;
    font-size: 12px;
    font-weight: 700;

    text-decoration: none;
    cursor: pointer;

    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease;
}

.action-button:hover {
    color: var(--pl-text);
    background: var(--pl-surface-3);
    border-color: var(--pl-border-strong);
}

.action-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.action-danger {
    color: #ff9aac;
}

.action-danger:hover {
    color: #ffc1cb;
    background: rgba(255, 98, 125, 0.08);
    border-color: rgba(255, 98, 125, 0.22);
}


/* =========================================================
   BACK LINK
   ========================================================= */

.back-link {
    display: inline-flex;

    margin-bottom: 10px;

    color: var(--pl-text-secondary);
    text-decoration: none;

    font-size: 13px;
    font-weight: 700;
}

.back-link:hover {
    color: var(--pl-primary-hover);
}


/* =========================================================
   PLAYLIST FORM
   ========================================================= */

.playlist-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;

    min-width: 0;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    color: var(--pl-text);

    font-size: 13px;
    font-weight: 750;
}

.form-group small {
    color: var(--pl-text-muted);
    line-height: 1.5;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;

    border: 1px solid var(--pl-border);
    border-radius: 10px;

    outline: none;

    color: var(--pl-text);
    background: var(--pl-surface-2);

    font: inherit;
    font-size: 14px;

    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background-color 0.16s ease;
}

.form-group input,
.form-group select {
    min-height: 44px;
    padding: 0 12px;
}

.form-group textarea {
    min-height: 110px;
    padding: 12px;

    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #59667a;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color:
        rgba(47, 129, 247, 0.7);

    box-shadow:
        0 0 0 3px rgba(47, 129, 247, 0.11);

    background: var(--pl-surface-3);
}


/* =========================================================
   INPUT SUFFIX
   ========================================================= */

.input-with-suffix {
    display: flex;
    align-items: stretch;

    overflow: hidden;

    border: 1px solid var(--pl-border);
    border-radius: 10px;

    background: var(--pl-surface-2);
}

.input-with-suffix:focus-within {
    border-color:
        rgba(47, 129, 247, 0.7);

    box-shadow:
        0 0 0 3px rgba(47, 129, 247, 0.11);
}

.input-with-suffix input {
    min-width: 0;

    border: 0 !important;
    border-radius: 0 !important;

    box-shadow: none !important;
}

.input-with-suffix span {
    display: flex;
    align-items: center;

    padding: 0 12px;

    border-left:
        1px solid var(--pl-border);

    color: var(--pl-text-muted);

    font-size: 12px;
    white-space: nowrap;
}


/* =========================================================
   SETTINGS / SWITCHES
   ========================================================= */

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-switch {
    display: grid;
    grid-template-columns:
        auto minmax(0, 1fr);

    align-items: center;
    gap: 13px;

    padding: 14px;

    border: 1px solid var(--pl-border);
    border-radius: 12px;

    background:
        rgba(255, 255, 255, 0.018);

    cursor: pointer;

    transition:
        background-color 0.16s ease,
        border-color 0.16s ease;
}

.setting-switch:hover {
    background:
        rgba(255, 255, 255, 0.03);

    border-color:
        var(--pl-border-strong);
}

.setting-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-ui {
    position: relative;

    width: 42px;
    height: 24px;

    border-radius: 999px;

    background: #273246;

    transition:
        background-color 0.18s ease;
}

.switch-ui::after {
    content: "";

    position: absolute;
    top: 3px;
    left: 3px;

    width: 18px;
    height: 18px;

    border-radius: 50%;

    background: #ffffff;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.28);

    transition:
        transform 0.18s ease;
}

.setting-switch input:checked+.switch-ui {
    background: var(--pl-primary);
}

.setting-switch input:checked+.switch-ui::after {
    transform: translateX(18px);
}

.setting-switch input:focus-visible+.switch-ui {
    box-shadow:
        0 0 0 3px rgba(47, 129, 247, 0.2);
}

.setting-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.setting-copy strong {
    color: var(--pl-text);
    font-size: 13px;
}

.setting-copy small {
    color: var(--pl-text-muted);
    line-height: 1.45;
}


/* =========================================================
   CONDITIONAL SETTINGS
   ========================================================= */

.conditional-settings {
    margin-top: 14px;
    padding: 16px;

    border: 1px solid var(--pl-border);
    border-radius: 12px;

    background:
        rgba(47, 129, 247, 0.035);
}


/* =========================================================
   ADVANCED FIELDS
   ========================================================= */

#advancedFields {
    padding-top: 4px;
}

#advancedFields[hidden],
#remoteSourcePanel[hidden],
#syncBehaviorPanel[hidden],
#missingGraceSettings[hidden] {
    display: none !important;
}


/* =========================================================
   FORM ACTIONS
   ========================================================= */

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;

    padding:
        4px 0 28px;
}


/* =========================================================
   LOADING BUTTON
   ========================================================= */

.button.is-loading {
    pointer-events: none;
    opacity: 0.72;
}

.button.is-loading::before {
    content: "";

    width: 14px;
    height: 14px;

    border:
        2px solid rgba(255, 255, 255, 0.35);

    border-top-color:
        currentColor;

    border-radius: 50%;

    animation:
        playlist-spin 0.7s linear infinite;
}

@keyframes playlist-spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1180px) {
    .playlist-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .playlist-summary-grid {
        grid-template-columns:
            1fr;
    }

    .form-grid {
        grid-template-columns:
            1fr;
    }

    .form-group-full {
        grid-column: auto;
    }

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .form-actions .button {
        width: 100%;
    }

    .topbar-actions {
        width: 100%;
    }

    .topbar-actions .button {
        width: 100%;
    }
}

/* =========================================================
   PLAYLIST DETAILS
   ========================================================= */

.playlist-detail-topbar {
    align-items: flex-end;
}

.playlist-heading-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.playlist-detail-logo {
    display: grid;
    place-items: center;

    width: 58px;
    height: 58px;

    flex: 0 0 58px;

    overflow: hidden;

    border: 1px solid var(--pl-border);
    border-radius: 16px;

    color: #ffffff;

    background:
        linear-gradient(135deg,
            rgba(47, 129, 247, 0.95),
            rgba(111, 76, 255, 0.78));

    font-size: 21px;
    font-weight: 850;
}

.playlist-detail-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-heading-row h1 {
    margin: 0 0 5px;
}

.playlist-heading-row p {
    margin: 0;
}


/* =========================================================
   DETAIL STATS
   ========================================================= */

.playlist-detail-stats {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;
    margin-bottom: 20px;
}

.detail-status-text {
    text-transform: capitalize;
}


/* =========================================================
   INFO GRID
   ========================================================= */

.playlist-info-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;
    margin-bottom: 18px;
}

.detail-list {
    display: flex;
    flex-direction: column;
}

.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 13px 0;

    border-bottom:
        1px solid var(--pl-border);
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-row span {
    color: var(--pl-text-muted);
    font-size: 13px;
}

.detail-row strong {
    max-width: 65%;

    color: var(--pl-text);
    font-size: 13px;
    font-weight: 750;

    text-align: right;
    word-break: break-word;
}

.detail-row .good {
    color: var(--pl-success);
}

.detail-row .bad {
    color: var(--pl-danger);
}


/* =========================================================
   REMOTE SOURCE
   ========================================================= */

.source-url-box {
    overflow-x: auto;

    padding: 14px 16px;

    border: 1px solid var(--pl-border);
    border-radius: 11px;

    background: #080d17;
}

.source-url-box code {
    color: #9fc8ff;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 12px;
    white-space: nowrap;
}


/* =========================================================
   ERROR PANEL
   ========================================================= */

.playlist-error-panel {
    border-color:
        rgba(255, 98, 125, 0.2);
}

.sync-error-box {
    max-height: 300px;
    overflow: auto;

    margin: 0;
    padding: 15px;

    border: 1px solid rgba(255, 98, 125, 0.18);

    border-radius: 11px;

    color: #ffb1be;
    background: rgba(255, 98, 125, 0.055);

    font-family:
        Consolas,
        monospace;

    font-size: 12px;
    line-height: 1.6;

    white-space: pre-wrap;
    word-break: break-word;
}


/* =========================================================
   CHANNEL TOOLBAR
   ========================================================= */

.playlist-channel-header {
    align-items: flex-end;
}

.channel-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.playlist-search-box input,
.playlist-filter-select {
    min-height: 40px;

    border: 1px solid var(--pl-border);
    border-radius: 9px;

    outline: none;

    color: var(--pl-text);
    background: var(--pl-surface-2);

    font: inherit;
    font-size: 13px;
}

.playlist-search-box input {
    width: 240px;
    padding: 0 12px;
}

.playlist-filter-select {
    min-width: 145px;
    padding: 0 10px;
}

.playlist-search-box input:focus,
.playlist-filter-select:focus {
    border-color:
        rgba(47, 129, 247, 0.7);

    box-shadow:
        0 0 0 3px rgba(47, 129, 247, 0.1);
}

.channel-filter-summary {
    margin-bottom: 12px;

    color: var(--pl-text-muted);
    font-size: 12px;
}

.channel-filter-summary strong {
    color: var(--pl-text-secondary);
}


/* =========================================================
   CHANNEL TABLE
   ========================================================= */

.channel-detail-table {
    min-width: 980px;
}

.channel-name-cell {
    display: flex;
    align-items: center;
    gap: 11px;

    min-width: 220px;
}

.channel-mini-logo {
    display: grid;
    place-items: center;

    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    overflow: hidden;

    border: 1px solid var(--pl-border);
    border-radius: 10px;

    color: #ffffff;
    background: var(--pl-surface-3);

    font-size: 13px;
    font-weight: 800;
}

.channel-mini-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.channel-name-cell>div:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.channel-name-cell strong {
    color: var(--pl-text);
    font-size: 13px;
}

.channel-name-cell small {
    max-width: 230px;

    overflow: hidden;

    color: var(--pl-text-muted);

    white-space: nowrap;
    text-overflow: ellipsis;
}

.format-badge,
.presence-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 26px;
    padding: 0 8px;

    border: 1px solid var(--pl-border);
    border-radius: 999px;

    font-size: 10px;
    font-weight: 800;

    text-transform: uppercase;
}

.format-badge {
    color: #9fc8ff;
    background: rgba(47, 129, 247, 0.08);
}

.presence-badge.is-present {
    color: #91efd5;

    background:
        rgba(45, 212, 168, 0.08);

    border-color:
        rgba(45, 212, 168, 0.2);
}

.presence-badge.is-missing {
    color: #ffacba;

    background:
        rgba(255, 98, 125, 0.08);

    border-color:
        rgba(255, 98, 125, 0.2);
}

.channel-no-results,
.history-empty {
    padding: 34px 18px;

    color: var(--pl-text-muted);

    text-align: center;
    font-size: 13px;
}


/* =========================================================
   HISTORY
   ========================================================= */

.history-table {
    min-width: 1000px;
}

.history-error-row td {
    padding-top: 10px;
    padding-bottom: 10px;

    color: #ffacba;

    background:
        rgba(255, 98, 125, 0.045);

    font-size: 12px;
}


/* =========================================================
   DANGER ZONE
   ========================================================= */

.playlist-danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin: 18px 0 30px;
    padding: 18px;

    border: 1px solid rgba(255, 98, 125, 0.2);

    border-radius: var(--pl-radius);

    background:
        rgba(255, 98, 125, 0.045);
}

.playlist-danger-zone strong {
    display: block;

    margin-bottom: 5px;

    color: #ffb0bd;
}

.playlist-danger-zone p {
    margin: 0;

    color: var(--pl-text-muted);

    font-size: 13px;
    line-height: 1.5;
}

.danger-button {
    flex: 0 0 auto;

    color: #ffffff;

    background:
        rgba(255, 98, 125, 0.88);

    border-color:
        rgba(255, 98, 125, 0.4);
}

.danger-button:hover {
    background: #ff627d;
}


/* =========================================================
   HIDDEN FILTER ROW
   ========================================================= */

.js-channel-row[hidden] {
    display: none !important;
}


/* =========================================================
   RESPONSIVE DETAILS
   ========================================================= */

@media (max-width: 1180px) {
    .playlist-detail-stats {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .playlist-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .playlist-detail-stats {
        grid-template-columns: 1fr;
    }

    .playlist-channel-header {
        align-items: stretch;
    }

    .channel-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .playlist-search-box input {
        width: 100%;
    }

    .playlist-filter-select {
        width: 100%;
    }

    .playlist-danger-zone {
        flex-direction: column;
        align-items: stretch;
    }

    .playlist-danger-zone .button {
        width: 100%;
    }
}

.presence-badge.is-manual {
    color: #c7b8ff;

    background:
        rgba(128, 94, 255, 0.09);

    border-color:
        rgba(128, 94, 255, 0.22);
}

/* =========================================================
   PLAYLIST EDITOR
   ========================================================= */

.playlist-edit-topbar {
    align-items: flex-end;
}

.playlist-editor-form {
    padding-bottom: 110px;
}

.playlist-editor-section {
    margin-bottom: 18px;
}

.editor-section-number {
    display: grid;
    place-items: center;

    min-width: 34px;
    height: 28px;

    padding: 0 8px;

    border: 1px solid var(--pl-border);
    border-radius: 999px;

    color: var(--pl-text-muted);
    background: var(--pl-surface-2);

    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.08em;
}


/* =========================================================
   FORM GRID
   ========================================================= */

.playlist-form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;
}

.form-span-2 {
    grid-column: span 2;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--pl-text-secondary);

    font-size: 12px;
    font-weight: 750;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;

    border: 1px solid var(--pl-border);
    border-radius: 10px;

    outline: none;

    color: var(--pl-text);
    background: var(--pl-surface-2);

    font: inherit;
    font-size: 13px;

    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

.form-group input,
.form-group select {
    min-height: 44px;
    padding: 0 12px;
}

.form-group textarea {
    min-height: 100px;
    padding: 12px;

    resize: vertical;
    line-height: 1.55;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color:
        rgba(47, 129, 247, 0.72);

    box-shadow:
        0 0 0 3px rgba(47, 129, 247, 0.1);

    background: #0d1524;
}

.form-group small {
    color: var(--pl-text-muted);

    font-size: 11px;
    line-height: 1.5;
}

.required-mark {
    color: var(--pl-danger);
}

.code-input {
    font-family:
        Consolas,
        "SFMono-Regular",
        monospace !important;

    font-size: 12px !important;
}


/* =========================================================
   LOGO EDITOR
   ========================================================= */

.logo-url-editor {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr) 54px;

    align-items: center;
    gap: 12px;
}

.playlist-logo-preview {
    display: grid;
    place-items: center;

    width: 54px;
    height: 54px;

    overflow: hidden;

    border: 1px solid var(--pl-border);
    border-radius: 13px;

    color: #ffffff;

    background:
        linear-gradient(135deg,
            rgba(47, 129, 247, 0.9),
            rgba(111, 76, 255, 0.75));

    font-size: 18px;
    font-weight: 850;
}

.playlist-logo-preview img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* =========================================================
   TYPE SELECTOR
   ========================================================= */

.playlist-type-selector {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}

.playlist-type-card {
    position: relative;

    display: flex;
    align-items: center;
    gap: 13px;

    min-height: 104px;

    padding: 16px;

    border: 1px solid var(--pl-border);
    border-radius: 13px;

    cursor: pointer;

    background: var(--pl-surface-2);

    transition:
        border-color 160ms ease,
        background 160ms ease,
        transform 160ms ease,
        box-shadow 160ms ease;
}

.playlist-type-card:hover {
    transform: translateY(-1px);

    border-color:
        rgba(47, 129, 247, 0.38);

    background:
        rgba(47, 129, 247, 0.045);
}

.playlist-type-card.is-selected {
    border-color:
        rgba(47, 129, 247, 0.65);

    background:
        rgba(47, 129, 247, 0.08);

    box-shadow:
        inset 0 0 0 1px rgba(47, 129, 247, 0.08);
}

.playlist-type-card input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
    pointer-events: none;
}

.type-card-icon {
    display: grid;
    place-items: center;

    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    border: 1px solid var(--pl-border);
    border-radius: 12px;

    color: #9fc8ff;
    background: rgba(47, 129, 247, 0.08);

    font-size: 20px;
    font-weight: 800;
}

.type-card-content {
    display: flex;
    flex-direction: column;
    gap: 5px;

    min-width: 0;
}

.type-card-content strong {
    color: var(--pl-text);

    font-size: 14px;
}

.type-card-content small {
    color: var(--pl-text-muted);

    font-size: 11px;
    line-height: 1.5;
}

.type-card-check {
    display: grid;
    place-items: center;

    width: 22px;
    height: 22px;

    margin-left: auto;

    flex: 0 0 22px;

    border: 1px solid var(--pl-border);
    border-radius: 50%;

    color: transparent;
    background: transparent;

    font-size: 11px;
    font-weight: 900;
}

.playlist-type-card.is-selected .type-card-check {
    color: #ffffff;
    border-color: var(--pl-primary);
    background: var(--pl-primary);
}

.playlist-type-warning {
    margin-top: 14px;
    padding: 12px 14px;

    border: 1px solid rgba(255, 184, 77, 0.2);

    border-radius: 10px;

    color: #ffd28c;
    background:
        rgba(255, 184, 77, 0.06);

    font-size: 12px;
    line-height: 1.5;
}


/* =========================================================
   SETTINGS
   ========================================================= */

.settings-stack {
    display: flex;
    flex-direction: column;
}

.setting-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;

    padding: 16px 0;

    border-bottom:
        1px solid var(--pl-border);
}

.setting-switch-row:first-child {
    padding-top: 0;
}

.setting-switch-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.setting-switch-row strong {
    display: block;

    margin-bottom: 5px;

    color: var(--pl-text);
    font-size: 13px;
}

.setting-switch-row p {
    max-width: 700px;

    margin: 0;

    color: var(--pl-text-muted);

    font-size: 11px;
    line-height: 1.55;
}


/* =========================================================
   SWITCH
   ========================================================= */

.switch-control {
    position: relative;

    display: inline-flex;

    width: 46px;
    height: 26px;

    flex: 0 0 46px;

    cursor: pointer;
}

.switch-control input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
}

.switch-slider {
    position: absolute;
    inset: 0;

    border: 1px solid var(--pl-border);
    border-radius: 999px;

    background: var(--pl-surface-3);

    transition:
        background 180ms ease,
        border-color 180ms ease;
}

.switch-slider::after {
    content: "";

    position: absolute;

    top: 3px;
    left: 3px;

    width: 18px;
    height: 18px;

    border-radius: 50%;

    background: #8c99aa;

    transition:
        transform 180ms ease,
        background 180ms ease;
}

.switch-control input:checked+.switch-slider {
    border-color:
        rgba(47, 129, 247, 0.7);

    background:
        rgba(47, 129, 247, 0.32);
}

.switch-control input:checked+.switch-slider::after {
    transform: translateX(20px);
    background: #ffffff;
}


/* =========================================================
   CONDITIONAL SETTINGS
   ========================================================= */

.conditional-settings {
    margin-top: 16px;
    padding: 16px;

    border: 1px solid var(--pl-border);
    border-radius: 12px;

    background:
        rgba(255, 255, 255, 0.018);
}

.conditional-settings[hidden] {
    display: none !important;
}


/* =========================================================
   INPUT SUFFIX
   ========================================================= */

.input-with-suffix {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr) auto;
}

.input-with-suffix input {
    border-radius:
        10px 0 0 10px;
}

.input-with-suffix span {
    display: flex;
    align-items: center;

    padding: 0 13px;

    border:
        1px solid var(--pl-border);

    border-left: 0;

    border-radius:
        0 10px 10px 0;

    color: var(--pl-text-muted);
    background: var(--pl-surface-3);

    font-size: 11px;
}


/* =========================================================
   QUICK INTERVALS
   ========================================================= */

.quick-intervals {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.quick-interval-button {
    min-height: 34px;

    padding: 0 11px;

    border: 1px solid var(--pl-border);
    border-radius: 8px;

    cursor: pointer;

    color: var(--pl-text-secondary);
    background: var(--pl-surface-2);

    font: inherit;
    font-size: 11px;
    font-weight: 750;

    transition:
        border-color 150ms ease,
        background 150ms ease,
        color 150ms ease;
}

.quick-interval-button:hover,
.quick-interval-button.is-active {
    color: #ffffff;

    border-color:
        rgba(47, 129, 247, 0.55);

    background:
        rgba(47, 129, 247, 0.14);
}


/* =========================================================
   SOURCE CHANGE
   ========================================================= */

.source-change-indicator {
    display: flex;
    align-items: center;

    min-height: 44px;

    padding: 0 12px;

    border: 1px solid var(--pl-border);
    border-radius: 10px;

    color: var(--pl-text-muted);
    background: var(--pl-surface-2);

    font-size: 12px;
}

.source-change-indicator.has-change {
    color: #ffd28c;

    border-color:
        rgba(255, 184, 77, 0.25);

    background:
        rgba(255, 184, 77, 0.055);
}


/* =========================================================
   ADVANCED HEADERS
   ========================================================= */

.advanced-header-fields {
    margin-top: 4px;
}

.advanced-header-fields[hidden] {
    display: none !important;
}

.json-validation-message {
    color: var(--pl-text-muted);

    font-size: 11px;
}

.json-validation-message.is-valid {
    color: var(--pl-success);
}

.json-validation-message.is-invalid {
    color: var(--pl-danger);
}


/* =========================================================
   STICKY ACTION BAR
   ========================================================= */

.playlist-editor-actions {
    position: fixed;

    right: 24px;
    bottom: 20px;

    z-index: 50;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;

    min-width: 520px;

    padding: 12px 14px 12px 16px;

    border: 1px solid var(--pl-border);
    border-radius: 14px;

    background:
        rgba(12, 18, 30, 0.94);

    box-shadow:
        0 18px 55px rgba(0, 0, 0, 0.38);

    backdrop-filter:
        blur(16px);
}

.editor-change-status {
    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--pl-text-muted);

    font-size: 11px;
}

.editor-change-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #667386;
}

.editor-change-status.has-changes .editor-change-dot {
    background: #ffb84d;

    box-shadow:
        0 0 0 4px rgba(255, 184, 77, 0.1);
}

.editor-action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}


/* =========================================================
   REMOTE HIDDEN
   ========================================================= */

.js-remote-section[hidden] {
    display: none !important;
}


/* =========================================================
   RESPONSIVE EDITOR
   ========================================================= */

@media (max-width: 900px) {

    .playlist-form-grid,
    .playlist-type-selector {
        grid-template-columns: 1fr;
    }

    .form-span-2 {
        grid-column: span 1;
    }

    .playlist-editor-actions {
        left: 16px;
        right: 16px;
        bottom: 16px;

        min-width: 0;
    }
}

@media (max-width: 620px) {
    .setting-switch-row {
        align-items: flex-start;
    }

    .playlist-editor-actions {
        flex-direction: column;
        align-items: stretch;

        gap: 10px;
    }

    .editor-action-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .editor-action-buttons .button {
        width: 100%;
    }
}

/* ==========================================================
   PLAYLIST CREATE / EDIT
========================================================== */

.playlist-create-page {
    max-width: 1180px;
    margin: 0 auto;
}

.page-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.page-eyebrow {
    margin-bottom: 8px;
    color: #5caeff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.page-title {
    margin: 0;
    color: #f7f9fc;
    font-size: 32px;
    line-height: 1.15;
}

.page-description {
    max-width: 650px;
    margin: 10px 0 0;
    color: #8f9bad;
    font-size: 14px;
    line-height: 1.6;
}

.playlist-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-panel {
    overflow: hidden;
    padding: 24px;
    border: 1px solid #202a38;
    border-radius: 16px;
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.025),
            rgba(255, 255, 255, 0)),
        #111722;
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.16);
}

.form-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 20px;
    margin-bottom: 22px;
    border-bottom: 1px solid #202a38;
}

.form-panel-header h2 {
    margin: 5px 0 0;
    color: #f4f7fb;
    font-size: 18px;
}

.form-panel-header p {
    margin: 7px 0 0;
    color: #7f8b9e;
    font-size: 13px;
    line-height: 1.55;
}

.form-panel-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(70, 158, 255, 0.28);
    border-radius: 999px;
    background: rgba(70, 158, 255, 0.09);
    color: #68b5ff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.form-grid {
    display: grid;
    gap: 20px;
}

.form-grid-2 {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group {
    min-width: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #dbe2ec;
    font-size: 13px;
    font-weight: 650;
}

.required {
    color: #ff6b78;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #293547;
    border-radius: 10px;
    outline: none;
    background: #0c111a;
    color: #f1f5f9;
    font: inherit;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.form-group input,
.form-group select {
    min-height: 46px;
    padding: 0 13px;
}

.form-group textarea {
    min-height: 110px;
    padding: 13px;
    resize: vertical;
    line-height: 1.55;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3f9fff;
    background: #0e1520;
    box-shadow:
        0 0 0 3px rgba(63, 159, 255, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #596578;
}

.form-help {
    display: block;
    margin-top: 7px;
    color: #6f7b8e;
    font-size: 11px;
    line-height: 1.5;
}

.input-with-suffix {
    display: flex;
    overflow: hidden;
    border: 1px solid #293547;
    border-radius: 10px;
    background: #0c111a;
}

.input-with-suffix:focus-within {
    border-color: #3f9fff;
    box-shadow:
        0 0 0 3px rgba(63, 159, 255, 0.12);
}

.input-with-suffix input {
    min-width: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
}

.input-with-suffix span {
    display: flex;
    align-items: center;
    padding: 0 13px;
    border-left: 1px solid #293547;
    color: #7f8b9e;
    font-size: 11px;
    white-space: nowrap;
}

.settings-card-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.switch-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 72px;
    padding: 14px;
    box-sizing: border-box;
    border: 1px solid #263244;
    border-radius: 12px;
    background: #0d131d;
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        background 0.18s ease;
}

.switch-card:hover {
    border-color: #34455d;
    background: #101824;
}

.switch-card-wide {
    width: 100%;
}

.switch-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-ui {
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #2a3443;
    transition: background 0.18s ease;
}

.switch-ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.18s ease;
}

.switch-card input:checked+.switch-ui {
    background: #2e93f7;
}

.switch-card input:checked+.switch-ui::after {
    transform: translateX(18px);
}

.switch-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.switch-content strong {
    color: #e8edf5;
    font-size: 13px;
}

.switch-content small {
    margin-top: 4px;
    color: #778397;
    font-size: 11px;
    line-height: 1.45;
}

.refresh-options {
    margin-top: 20px;
}

.refresh-preview-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 98px;
    padding: 16px;
    box-sizing: border-box;
    border: 1px solid #263244;
    border-radius: 12px;
    background: #0d131d;
}

.refresh-preview-card span {
    color: #718096;
    font-size: 11px;
}

.refresh-preview-card strong {
    margin-top: 6px;
    color: #64b5ff;
    font-size: 17px;
}

.refresh-preview-card small {
    margin-top: 7px;
    color: #69768a;
    font-size: 11px;
    line-height: 1.45;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.status-pill-blue {
    border:
        1px solid rgba(75, 163, 255, 0.25);
    background:
        rgba(75, 163, 255, 0.1);
    color: #67b5ff;
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.collapsible-header>span:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
}

.collapsible-header strong {
    display: block;
    color: #eef2f7;
    font-size: 16px;
}

.collapsible-header small {
    display: block;
    margin-top: 5px;
    color: #758195;
    font-size: 12px;
}

.collapse-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #2b384b;
    border-radius: 9px;
    background: #0d131d;
    color: #8fc7ff;
    font-size: 20px;
}

.collapsible-content {
    padding-top: 24px;
    margin-top: 20px;
    border-top: 1px solid #202a38;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 18px 0 8px;
}

.form-actions .btn {
    min-width: 130px;
}

[hidden] {
    display: none !important;
}

@media (max-width: 900px) {

    .form-grid-2,
    .settings-card-grid {
        grid-template-columns: 1fr;
    }

    .page-heading-row {
        flex-direction: column;
    }

    .page-heading-row .btn {
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .form-panel {
        padding: 18px;
        border-radius: 13px;
    }

    .page-title {
        font-size: 26px;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* ============================================================
   PLAYLIST MANUAL SELECTION (Sync Mode = Manual)
============================================================ */

.manual-selection-panel {
    margin-top: 18px;
    padding-top: 18px;

    border-top: 1px solid var(--border);
}

.manual-destination-field {
    margin-bottom: 18px;
}

.manual-destination-field > .form-label {
    display: block;
    margin-bottom: 10px;
}

.choice-card.compact {
    padding: 12px 14px;
}

.choice-card.compact small {
    line-height: 1.5;
}

.manual-selection-intro {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;

    margin-bottom: 18px;
}

.manual-selection-intro p {
    flex: 1 1 260px;
    margin: 0;

    color: var(--muted);
    font-size: 13px;
}

.manual-load-status {
    color: var(--muted);
    font-size: 12px;
}

.manual-selection-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;

    margin-bottom: 14px;
    padding: 12px 14px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-2);

    font-size: 13px;
}

.manual-selection-summary-actions {
    display: flex;
    gap: 8px;
}

.manual-category-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;

    max-height: 320px;
    margin-bottom: 8px;
    padding-right: 4px;

    overflow-y: auto;
}

.manual-category-row {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 12px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface-2);

    cursor: pointer;

    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.manual-category-row:hover {
    border-color: rgba(18, 181, 255, 0.3);
}

.manual-category-row input {
    accent-color: var(--primary);
}

.manual-category-name {
    flex: 1;
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 13px;
}

.manual-category-count {
    flex-shrink: 0;

    padding: 2px 8px;

    border-radius: 999px;

    background: var(--surface-3);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.manual-browser-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;

    margin-bottom: 12px;
}

.manual-browser-toolbar select,
.manual-browser-toolbar input {
    flex: 1 1 200px;

    padding: 10px 12px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface-2);
    color: var(--text);

    font: inherit;
    outline: none;
}

.manual-channel-browser-list {
    display: flex;
    flex-direction: column;
    gap: 6px;

    min-height: 60px;
    max-height: 360px;
    margin-bottom: 12px;

    overflow-y: auto;
}

.manual-browser-row {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 8px 10px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--surface-2);

    cursor: pointer;
}

.manual-browser-row input {
    flex-shrink: 0;

    accent-color: var(--primary);
}

.manual-browser-row img {
    width: 26px;
    height: 26px;
    flex-shrink: 0;

    border-radius: 6px;

    background: var(--surface-3);

    object-fit: cover;
}

.manual-browser-name {
    flex: 1;
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 12.5px;
}

.manual-browser-category {
    flex-shrink: 0;

    color: var(--muted);
    font-size: 11px;
}

.manual-browser-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.manual-browser-pagination span {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 700px) {
    .manual-category-list {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   M3U IMPORT PAGE
   Uses existing admin.css theme variables
============================================================ */

/* ============================================================
   PAGE HEADER
============================================================ */

.m3u-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 22px;
}

.m3u-page-header__content {
    min-width: 0;
}

.m3u-page-header__eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 8px;

    color: var(--primary);

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.m3u-page-header__eyebrow-dot {
    width: 7px;
    height: 7px;

    flex-shrink: 0;

    border-radius: 50%;

    background: var(--primary);

    box-shadow:
        0 0 12px rgba(18, 181, 255, 0.65);
}

.m3u-page-header__title {
    margin: 0;

    color: var(--text);

    font-size: 28px;
    font-weight: 800;

    line-height: 1.15;
}

.m3u-page-header__description {
    max-width: 720px;

    margin: 8px 0 0;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.6;
}

.m3u-page-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;

    flex-shrink: 0;
}


/* ============================================================
   GENERIC M3U BUTTON SUPPORT
============================================================ */

.m3u-page-header .btn,
.m3u-action-bar .btn {
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 0 16px;

    border-radius: 10px;

    font: inherit;
    font-size: 12px;
    font-weight: 750;

    cursor: pointer;

    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        color 0.18s ease,
        opacity 0.18s ease,
        transform 0.18s ease;
}

.m3u-page-header .btn:hover,
.m3u-action-bar .btn:hover {
    transform: translateY(-1px);
}

.m3u-page-header .btn-secondary,
.m3u-action-bar .btn-secondary {
    border: 1px solid var(--border);

    background: var(--surface-2);

    color: var(--text-secondary);
}

.m3u-page-header .btn-secondary:hover,
.m3u-action-bar .btn-secondary:hover {
    border-color:
        rgba(18, 181, 255, 0.28);

    background: var(--surface-3);

    color: var(--text);
}

.m3u-action-bar .btn-primary {
    border: 1px solid var(--primary);

    background: var(--primary);

    color: #00131d;
}

.m3u-action-bar .btn-primary:hover {
    box-shadow:
        0 8px 24px rgba(18, 181, 255, 0.18);
}

.m3u-page-header .btn:disabled,
.m3u-action-bar .btn:disabled {
    opacity: 0.42;

    cursor: not-allowed;

    transform: none;
}


/* ============================================================
   FLASH MESSAGE
============================================================ */

.m3u-flash {
    display: flex;
    align-items: center;
    gap: 11px;

    margin-bottom: 18px;

    padding: 13px 15px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface);

    color: var(--text-secondary);

    font-size: 12px;
    line-height: 1.5;
}

.m3u-flash__icon {
    width: 28px;
    height: 28px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 8px;

    font-size: 12px;
    font-weight: 900;
}

.m3u-flash--success {
    border-color:
        rgba(52, 211, 153, 0.22);

    background:
        rgba(52, 211, 153, 0.055);

    color: var(--success);
}

.m3u-flash--success .m3u-flash__icon {
    background:
        rgba(52, 211, 153, 0.12);
}

.m3u-flash--error {
    border-color:
        rgba(255, 95, 109, 0.24);

    background:
        rgba(255, 95, 109, 0.055);

    color: var(--error);
}

.m3u-flash--error .m3u-flash__icon {
    background:
        rgba(255, 95, 109, 0.12);
}

.m3u-flash--warning {
    border-color:
        rgba(255, 184, 77, 0.24);

    background:
        rgba(255, 184, 77, 0.055);

    color: #ffb84d;
}

.m3u-flash--warning .m3u-flash__icon {
    background:
        rgba(255, 184, 77, 0.12);
}

.m3u-flash--info {
    border-color:
        rgba(18, 181, 255, 0.22);

    background:
        rgba(18, 181, 255, 0.05);

    color: var(--primary);
}


/* ============================================================
   WORKSPACE
============================================================ */

.m3u-workspace {
    overflow: hidden;

    margin-bottom: 22px;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: var(--surface);
}


/* ============================================================
   SOURCE TABS
============================================================ */

.m3u-source-tabs {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 1px;

    padding: 6px;

    border-bottom:
        1px solid var(--border);

    background:
        rgba(255, 255, 255, 0.018);
}

.m3u-source-tab {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 14px 16px;

    border: 1px solid transparent;
    border-radius: 11px;

    background: transparent;

    color: var(--muted);

    text-align: left;

    cursor: pointer;

    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        color 0.18s ease;
}

.m3u-source-tab:hover {
    background:
        rgba(255, 255, 255, 0.035);

    color: var(--text-secondary);
}

.m3u-source-tab.is-active {
    border-color:
        rgba(18, 181, 255, 0.2);

    background:
        rgba(18, 181, 255, 0.08);

    color: var(--primary);
}

.m3u-source-tab__icon {
    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 10px;

    background: var(--surface-2);

    color: currentColor;

    font-size: 17px;
    font-weight: 800;

    transition:
        background 0.18s ease;
}

.m3u-source-tab.is-active .m3u-source-tab__icon {
    background:
        rgba(18, 181, 255, 0.12);
}

.m3u-source-tab__content {
    min-width: 0;
}

.m3u-source-tab__content strong {
    display: block;

    overflow: hidden;

    color: currentColor;

    font-size: 12px;
    font-weight: 750;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.m3u-source-tab__content small {
    display: block;

    overflow: hidden;

    margin-top: 4px;

    color: var(--muted);

    font-size: 9px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ============================================================
   SOURCE PANELS
============================================================ */

.m3u-source-panels {
    position: relative;
}

.m3u-source-panel {
    padding: 24px;
}

.m3u-source-panel[hidden] {
    display: none !important;
}

.m3u-source-panel.is-active {
    display: block;
}


/* ============================================================
   SECTION HEADING
============================================================ */

.m3u-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 18px;

    margin-bottom: 22px;
}

.m3u-section-heading h2 {
    margin: 0;

    color: var(--text);

    font-size: 16px;
    font-weight: 750;
}

.m3u-section-heading p {
    margin: 6px 0 0;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.55;
}

.m3u-section-badge {
    flex-shrink: 0;

    padding: 5px 8px;

    border:
        1px solid rgba(18, 181, 255, 0.2);

    border-radius: 7px;

    background:
        rgba(18, 181, 255, 0.07);

    color: var(--primary);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 0.03em;
}


/* ============================================================
   FORM GRID
============================================================ */

.m3u-form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 17px;
}

.m3u-form-span-2 {
    grid-column: 1 / -1;
}

.m3u-workspace .form-group,
.m3u-source-panel .form-group {
    min-width: 0;

    margin: 0;
}

.m3u-workspace .form-label,
.m3u-source-panel .form-label {
    display: block;

    margin-bottom: 8px;

    color: var(--text-secondary);

    font-size: 11px;
    font-weight: 700;
}

.m3u-workspace .form-control,
.m3u-source-panel .form-control {
    width: 100%;

    box-sizing: border-box;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface-2);

    color: var(--text);

    font: inherit;
    font-size: 12px;

    outline: none;

    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.m3u-workspace input.form-control,
.m3u-workspace select.form-control,
.m3u-source-panel input.form-control,
.m3u-source-panel select.form-control {
    min-height: 44px;

    padding: 0 13px;
}

.m3u-workspace textarea.form-control,
.m3u-source-panel textarea.form-control {
    padding: 12px 13px;

    resize: vertical;

    line-height: 1.55;
}

.m3u-workspace .form-control:hover,
.m3u-source-panel .form-control:hover {
    border-color:
        rgba(255, 255, 255, 0.15);
}

.m3u-workspace .form-control:focus,
.m3u-source-panel .form-control:focus {
    border-color: var(--primary);

    background:
        rgba(18, 181, 255, 0.025);

    box-shadow:
        0 0 0 3px rgba(18, 181, 255, 0.09);
}

.m3u-workspace .form-control::placeholder,
.m3u-source-panel .form-control::placeholder {
    color:
        rgba(136, 149, 167, 0.68);
}

.m3u-workspace .form-help,
.m3u-source-panel .form-help {
    display: block;

    margin-top: 7px;

    color: var(--muted);

    font-size: 9px;
    line-height: 1.45;
}

.m3u-workspace .required,
.m3u-source-panel .required {
    color: var(--error);
}

.m3u-textarea-small {
    min-height: 70px;
}

.m3u-code-input {
    font-family:
        Consolas,
        "Courier New",
        monospace !important;

    font-size: 11px !important;

    tab-size: 2;
}

.m3u-code-input--large {
    min-height: 340px;

    line-height: 1.65 !important;
}

.m3u-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
}

.m3u-field-chip {
    padding: 4px 7px;

    border: 1px solid var(--border);
    border-radius: 6px;

    background:
        rgba(255, 255, 255, 0.025);

    color: var(--muted);

    font-size: 8px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: 0.05em;
}


/* ============================================================
   FILE DROPZONE
============================================================ */

.m3u-dropzone {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 16px;

    min-height: 190px;

    padding: 28px;

    border:
        1px dashed rgba(18, 181, 255, 0.32);

    border-radius: 14px;

    background:
        rgba(18, 181, 255, 0.025);

    cursor: pointer;

    outline: none;

    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        transform 0.18s ease;
}

.m3u-dropzone:hover,
.m3u-dropzone:focus {
    border-color: var(--primary);

    background:
        rgba(18, 181, 255, 0.055);
}

.m3u-dropzone.is-dragging {
    border-color: var(--primary);

    background:
        rgba(18, 181, 255, 0.09);

    transform: scale(0.995);
}

.m3u-dropzone__icon {
    width: 54px;
    height: 54px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 15px;

    background:
        rgba(18, 181, 255, 0.11);

    color: var(--primary);

    font-size: 24px;
    font-weight: 800;
}

.m3u-dropzone__content {
    min-width: 0;
}

.m3u-dropzone__content strong {
    display: block;

    color: var(--text);

    font-size: 13px;
}

.m3u-dropzone__content span {
    display: block;

    margin-top: 5px;

    color: var(--text-secondary);

    font-size: 11px;
}

.m3u-dropzone__content small {
    display: block;

    margin-top: 8px;

    color: var(--muted);

    font-size: 9px;
}


/* ============================================================
   SELECTED FILE
============================================================ */

.m3u-selected-file {
    display: flex;
    align-items: center;

    gap: 12px;

    margin-top: 14px;

    padding: 13px 14px;

    border:
        1px solid rgba(52, 211, 153, 0.2);

    border-radius: 11px;

    background:
        rgba(52, 211, 153, 0.045);
}

.m3u-selected-file[hidden] {
    display: none !important;
}

.m3u-selected-file__icon {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 9px;

    background:
        rgba(52, 211, 153, 0.11);

    color: var(--success);

    font-size: 16px;
}

.m3u-selected-file__content {
    min-width: 0;
    flex: 1;
}

.m3u-selected-file__content strong {
    display: block;

    overflow: hidden;

    color: var(--text);

    font-size: 11px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.m3u-selected-file__content span {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 9px;
}

.m3u-file-options {
    margin-top: 18px;
}


/* ============================================================
   ICON BUTTON
============================================================ */

.m3u-icon-button {
    width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    padding: 0;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--surface-2);

    color: var(--text-secondary);

    cursor: pointer;

    font-size: 18px;

    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        color 0.18s ease;
}

.m3u-icon-button:hover {
    border-color:
        rgba(255, 95, 109, 0.28);

    background:
        rgba(255, 95, 109, 0.07);

    color: var(--error);
}


/* ============================================================
   IMPORT OPTIONS
============================================================ */

.m3u-options-section {
    padding: 24px;

    border-top:
        1px solid var(--border);

    background:
        rgba(255, 255, 255, 0.012);
}

.m3u-options-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;
}

.m3u-option-card {
    min-width: 0;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    padding: 15px 16px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-2);

    cursor: pointer;

    transition:
        border-color 0.18s ease,
        background 0.18s ease;
}

.m3u-option-card:hover {
    border-color:
        rgba(18, 181, 255, 0.24);

    background:
        rgba(18, 181, 255, 0.025);
}

.m3u-option-card--wide {
    grid-column: 1 / -1;

    display: block;

    cursor: default;
}

.m3u-option-card__header {
    margin-bottom: 14px;
}

.m3u-option-card__header strong,
.m3u-option-card__content strong {
    display: block;

    color: var(--text);

    font-size: 11px;
    font-weight: 750;
}

.m3u-option-card__header span,
.m3u-option-card__content span {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 9px;
    line-height: 1.45;
}

.m3u-option-card__content {
    min-width: 0;
}


/* ============================================================
   SEGMENTED DUPLICATE CONTROL
============================================================ */

.m3u-segmented-control {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 7px;
}

.m3u-segment {
    position: relative;

    min-width: 0;

    padding: 12px 13px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.018);

    cursor: pointer;

    transition:
        border-color 0.18s ease,
        background 0.18s ease;
}

.m3u-segment:hover {
    border-color:
        rgba(18, 181, 255, 0.26);
}

.m3u-segment.is-active,
.m3u-segment:has(input:checked) {
    border-color:
        rgba(18, 181, 255, 0.5);

    background:
        rgba(18, 181, 255, 0.075);
}

.m3u-segment input {
    position: absolute;

    opacity: 0;

    pointer-events: none;
}

.m3u-segment span {
    display: block;
}

.m3u-segment strong {
    display: block;

    color: var(--text-secondary);

    font-size: 10px;
}

.m3u-segment.is-active strong,
.m3u-segment:has(input:checked) strong {
    color: var(--primary);
}

.m3u-segment small {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 8px;
}


/* ============================================================
   M3U SWITCH
============================================================ */

.m3u-switch {
    position: relative;

    width: 42px;
    height: 24px;

    flex-shrink: 0;
}

.m3u-switch input {
    position: absolute;

    opacity: 0;

    pointer-events: none;
}

.m3u-switch__track {
    position: absolute;

    inset: 0;

    border: 1px solid var(--border);
    border-radius: 999px;

    background:
        rgba(255, 255, 255, 0.06);

    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.m3u-switch__track::after {
    content: "";

    position: absolute;

    top: 3px;
    left: 3px;

    width: 16px;
    height: 16px;

    border-radius: 50%;

    background: var(--text-secondary);

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.m3u-switch input:checked+.m3u-switch__track {
    border-color: var(--primary);

    background:
        rgba(18, 181, 255, 0.24);
}

.m3u-switch input:checked+.m3u-switch__track::after {
    transform:
        translateX(18px);

    background: var(--primary);
}


/* ============================================================
   ACTION BAR
============================================================ */

.m3u-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 15px 18px;

    border-top:
        1px solid var(--border);

    background:
        rgba(5, 7, 13, 0.35);
}

.m3u-action-bar__status {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 9px;

    color: var(--muted);

    font-size: 10px;
}

.m3u-action-status-dot {
    width: 7px;
    height: 7px;

    flex-shrink: 0;

    border-radius: 50%;

    background: var(--muted);
}

.m3u-action-status-dot.is-ready {
    background: var(--success);

    box-shadow:
        0 0 10px rgba(52, 211, 153, 0.5);
}

.m3u-action-status-dot.is-error {
    background: var(--error);

    box-shadow:
        0 0 10px rgba(255, 95, 109, 0.45);
}

.m3u-action-status-dot.is-loading {
    background: var(--primary);

    box-shadow:
        0 0 10px rgba(18, 181, 255, 0.5);
}

.m3u-action-bar__buttons {
    display: flex;
    align-items: center;

    gap: 9px;

    flex-shrink: 0;
}


/* ============================================================
   PREVIEW SECTION
============================================================ */

.m3u-preview-section {
    margin-bottom: 22px;

    padding: 22px;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: var(--surface);
}

.m3u-preview-section[hidden] {
    display: none !important;
}

.m3u-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}

.m3u-preview-header__eyebrow {
    margin-bottom: 6px;

    color: var(--primary);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.m3u-preview-header h2 {
    margin: 0;

    color: var(--text);

    font-size: 18px;
}

.m3u-preview-header p {
    margin: 6px 0 0;

    color: var(--muted);

    font-size: 11px;
}

.m3u-preview-header__actions {
    flex-shrink: 0;
}


/* ============================================================
   SUMMARY GRID
============================================================ */

.m3u-summary-grid {
    display: grid;

    grid-template-columns:
        repeat(6, minmax(0, 1fr));

    gap: 10px;

    margin-bottom: 18px;
}

.m3u-summary-card {
    min-width: 0;

    padding: 14px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: var(--surface-2);
}

.m3u-summary-card__label {
    display: block;

    color: var(--muted);

    font-size: 8px;
    font-weight: 800;

    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.m3u-summary-card strong {
    display: block;

    margin: 8px 0 5px;

    color: var(--text);

    font-size: 21px;
    font-weight: 800;
}

.m3u-summary-card small {
    display: block;

    overflow: hidden;

    color: var(--muted);

    font-size: 8px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ============================================================
   PREVIEW BLOCK
============================================================ */

.m3u-preview-block {
    margin-bottom: 16px;

    padding: 16px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background:
        rgba(255, 255, 255, 0.014);
}

.m3u-preview-block__header {
    margin-bottom: 13px;
}

.m3u-preview-block__header h3 {
    margin: 0;

    color: var(--text);

    font-size: 12px;
}

.m3u-preview-block__header p {
    margin: 5px 0 0;

    color: var(--muted);

    font-size: 9px;
    line-height: 1.5;
}


/* ============================================================
   CATEGORY CLOUD
============================================================ */

.m3u-category-cloud {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 7px;
}

.m3u-category-chip {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    padding: 6px 8px;

    border: 1px solid var(--border);
    border-radius: 7px;

    background: var(--surface-2);

    color: var(--text-secondary);

    font-size: 9px;
}

.m3u-category-chip strong {
    color: var(--primary);

    font-size: 8px;
}


/* ============================================================
   PREVIEW TOOLBAR
============================================================ */

.m3u-preview-toolbar {
    display: grid;

    grid-template-columns:
        minmax(220px, 1fr) 180px 180px;

    gap: 10px;

    margin-bottom: 14px;
}

.m3u-preview-search {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 9px;

    min-height: 42px;

    padding: 0 12px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface-2);
}

.m3u-preview-search:focus-within {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(18, 181, 255, 0.08);
}

.m3u-preview-search span {
    flex-shrink: 0;

    color: var(--muted);

    font-size: 15px;
}

.m3u-preview-search input {
    min-width: 0;
    width: 100%;

    border: 0;
    outline: 0;

    background: transparent;

    color: var(--text);

    font: inherit;
    font-size: 11px;
}

.m3u-preview-search input::placeholder {
    color: var(--muted);
}

.m3u-preview-filter {
    min-height: 42px !important;

    padding: 0 11px !important;

    border: 1px solid var(--border) !important;
    border-radius: 10px !important;

    background: var(--surface-2) !important;

    color: var(--text-secondary) !important;

    font-size: 10px !important;
}


/* ============================================================
   TABLE CARD
============================================================ */

.m3u-table-card {
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface);
}

.m3u-table-card .table-responsive {
    width: 100%;

    overflow-x: auto;
}

.m3u-table-card .table-responsive::-webkit-scrollbar {
    height: 7px;
}

.m3u-table-card .table-responsive::-webkit-scrollbar-track {
    background: var(--surface);
}

.m3u-table-card .table-responsive::-webkit-scrollbar-thumb {
    border-radius: 999px;

    background: var(--border);
}

.m3u-table-card .admin-table {
    width: 100%;

    border-collapse: collapse;

    white-space: nowrap;
}

.m3u-table-card .admin-table th {
    padding: 12px 13px;

    border-bottom:
        1px solid var(--border);

    background:
        rgba(255, 255, 255, 0.018);

    color: var(--muted);

    font-size: 8px;
    font-weight: 800;

    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
}

.m3u-table-card .admin-table td {
    padding: 12px 13px;

    border-bottom:
        1px solid var(--border);

    color: var(--text-secondary);

    font-size: 10px;

    vertical-align: middle;
}

.m3u-table-card .admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.m3u-table-card .admin-table tbody tr {
    transition:
        background 0.16s ease;
}

.m3u-table-card .admin-table tbody tr:hover {
    background:
        rgba(18, 181, 255, 0.025);
}


/* ============================================================
   PREVIEW TABLE CONTENT
============================================================ */

.m3u-preview-table {
    min-width: 920px;
}

.m3u-preview-channel {
    display: flex;
    align-items: center;

    gap: 10px;

    min-width: 190px;
}

.m3u-preview-channel__logo {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--surface-2);
}

.m3u-preview-channel__logo img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: contain;

    padding: 4px;

    box-sizing: border-box;
}

.m3u-preview-channel__logo span {
    color: var(--primary);

    font-size: 11px;
    font-weight: 800;
}

.m3u-preview-channel__content {
    min-width: 0;
}

.m3u-preview-channel__content strong {
    display: block;

    max-width: 220px;

    overflow: hidden;

    color: var(--text);

    font-size: 10px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.m3u-preview-channel__content small {
    display: block;

    max-width: 220px;

    overflow: hidden;

    margin-top: 4px;

    color: var(--muted);

    font-size: 8px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.m3u-stream-url {
    display: block;

    max-width: 260px;

    overflow: hidden;

    color: var(--muted);

    font-family:
        Consolas,
        monospace;

    font-size: 8px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ============================================================
   SMALL BADGES
============================================================ */

.m3u-type-badge,
.m3u-format-badge,
.m3u-drm-badge,
.m3u-header-badge {
    display: inline-flex;
    align-items: center;

    padding: 5px 7px;

    border: 1px solid var(--border);
    border-radius: 6px;

    background: var(--surface-2);

    color: var(--text-secondary);

    font-size: 8px;
    font-weight: 750;
}

.m3u-drm-badge--none {
    color: var(--muted);
}

.m3u-drm-badge--widevine,
.m3u-drm-badge--clearkey,
.m3u-drm-badge--playready,
.m3u-drm-badge--fairplay,
.m3u-drm-badge--custom {
    border-color:
        rgba(255, 184, 77, 0.2);

    background:
        rgba(255, 184, 77, 0.065);

    color: #ffb84d;
}

.m3u-header-badge.has-headers {
    border-color:
        rgba(18, 181, 255, 0.2);

    background:
        rgba(18, 181, 255, 0.065);

    color: var(--primary);
}


/* ============================================================
   EMPTY TABLE CELL
============================================================ */

.m3u-empty-cell {
    padding: 38px 18px !important;

    color: var(--muted) !important;

    text-align: center !important;
}


/* ============================================================
   HISTORY SECTION
============================================================ */

.m3u-history-section {
    margin-bottom: 30px;

    padding: 22px;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: var(--surface);
}

.m3u-history-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 18px;

    margin-bottom: 17px;
}

.m3u-history-header h2 {
    margin: 0;

    color: var(--text);

    font-size: 16px;
}

.m3u-history-header p {
    margin: 6px 0 0;

    color: var(--muted);

    font-size: 10px;
}

.m3u-history-count {
    flex-shrink: 0;

    padding: 5px 8px;

    border: 1px solid var(--border);
    border-radius: 7px;

    background: var(--surface-2);

    color: var(--muted);

    font-size: 9px;
}

.m3u-history-source {
    min-width: 180px;
    max-width: 320px;
}

.m3u-history-source strong {
    display: block;

    overflow: hidden;

    color: var(--text);

    font-size: 10px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.m3u-history-source small {
    display: block;

    overflow: hidden;

    margin-top: 4px;

    color: var(--muted);

    font-size: 8px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ============================================================
   STATUS BADGES
============================================================ */

.m3u-status-badge {
    display: inline-flex;
    align-items: center;

    padding: 5px 7px;

    border: 1px solid var(--border);
    border-radius: 6px;

    background: var(--surface-2);

    color: var(--muted);

    font-size: 8px;
    font-weight: 800;

    text-transform: capitalize;
}

.m3u-status-badge--completed,
.m3u-status-badge--success {
    border-color:
        rgba(52, 211, 153, 0.22);

    background:
        rgba(52, 211, 153, 0.07);

    color: var(--success);
}

.m3u-status-badge--failed,
.m3u-status-badge--error {
    border-color:
        rgba(255, 95, 109, 0.22);

    background:
        rgba(255, 95, 109, 0.07);

    color: var(--error);
}

.m3u-status-badge--running,
.m3u-status-badge--processing {
    border-color:
        rgba(18, 181, 255, 0.22);

    background:
        rgba(18, 181, 255, 0.07);

    color: var(--primary);
}

.m3u-status-badge--pending {
    border-color:
        rgba(255, 184, 77, 0.2);

    background:
        rgba(255, 184, 77, 0.06);

    color: #ffb84d;
}


/* ============================================================
   BUSY OVERLAY
============================================================ */

.m3u-busy-overlay {
    position: fixed;

    inset: 0;

    z-index: 10000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(2, 5, 10, 0.76);

    backdrop-filter:
        blur(7px);
}

.m3u-busy-overlay[hidden] {
    display: none !important;
}

.m3u-busy-card {
    width: min(380px, 100%);

    padding: 28px;

    border:
        1px solid rgba(255, 255, 255, 0.1);

    border-radius: 17px;

    background: var(--surface);

    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.48);

    text-align: center;
}

.m3u-busy-card strong {
    display: block;

    margin-top: 17px;

    color: var(--text);

    font-size: 14px;
}

.m3u-busy-card p {
    margin: 7px 0 0;

    color: var(--muted);

    font-size: 10px;
    line-height: 1.5;
}


/* ============================================================
   SPINNER
============================================================ */

.m3u-spinner {
    width: 38px;
    height: 38px;

    margin: 0 auto;

    border:
        3px solid rgba(18, 181, 255, 0.14);

    border-top-color:
        var(--primary);

    border-radius: 50%;

    animation:
        m3uSpinnerRotate 0.8s linear infinite;
}

@keyframes m3uSpinnerRotate {
    to {
        transform:
            rotate(360deg);
    }
}


/* ============================================================
   TOAST CONTAINER
============================================================ */

.m3u-toast-container {
    position: fixed;

    right: 20px;
    bottom: 20px;

    z-index: 10020;

    width:
        min(360px, calc(100vw - 40px));

    display: flex;
    flex-direction: column;

    gap: 9px;

    pointer-events: none;
}

.m3u-toast {
    display: flex;
    align-items: flex-start;

    gap: 10px;

    padding: 13px 14px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background:
        rgba(14, 21, 35, 0.96);

    color: var(--text-secondary);

    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.38);

    backdrop-filter:
        blur(16px);

    pointer-events: auto;

    animation:
        m3uToastEnter 0.22s ease both;
}

.m3u-toast__icon {
    width: 27px;
    height: 27px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 8px;

    background: var(--surface-2);

    font-size: 11px;
    font-weight: 900;
}

.m3u-toast__content {
    min-width: 0;
    flex: 1;
}

.m3u-toast__content strong {
    display: block;

    color: var(--text);

    font-size: 10px;
}

.m3u-toast__content span,
.m3u-toast__content p {
    display: block;

    margin: 4px 0 0;

    color: var(--muted);

    font-size: 9px;
    line-height: 1.45;
}

.m3u-toast--success {
    border-color:
        rgba(52, 211, 153, 0.22);
}

.m3u-toast--success .m3u-toast__icon {
    background:
        rgba(52, 211, 153, 0.1);

    color: var(--success);
}

.m3u-toast--error {
    border-color:
        rgba(255, 95, 109, 0.22);
}

.m3u-toast--error .m3u-toast__icon {
    background:
        rgba(255, 95, 109, 0.1);

    color: var(--error);
}

.m3u-toast--warning {
    border-color:
        rgba(255, 184, 77, 0.22);
}

.m3u-toast--warning .m3u-toast__icon {
    background:
        rgba(255, 184, 77, 0.1);

    color: #ffb84d;
}

.m3u-toast--info {
    border-color:
        rgba(18, 181, 255, 0.22);
}

.m3u-toast--info .m3u-toast__icon {
    background:
        rgba(18, 181, 255, 0.1);

    color: var(--primary);
}

@keyframes m3uToastEnter {
    from {
        opacity: 0;

        transform:
            translateY(10px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }
}


/* ============================================================
   HIDDEN SUPPORT
============================================================ */

.m3u-workspace [hidden],
.m3u-preview-section[hidden],
.m3u-selected-file[hidden],
.m3u-busy-overlay[hidden] {
    display: none !important;
}


/* ============================================================
   ACCESSIBILITY FOCUS
============================================================ */

.m3u-source-tab:focus-visible,
.m3u-dropzone:focus-visible,
.m3u-icon-button:focus-visible,
.m3u-segment:focus-within,
.m3u-option-card:focus-within {
    outline:
        2px solid rgba(18, 181, 255, 0.7);

    outline-offset: 2px;
}


/* ============================================================
   RESPONSIVE - LARGE TABLET
============================================================ */

@media (max-width: 1200px) {

    .m3u-summary-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}


/* ============================================================
   RESPONSIVE - TABLET
============================================================ */

@media (max-width: 900px) {

    .m3u-page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .m3u-page-header__actions {
        justify-content: flex-start;
    }

    .m3u-source-tabs {
        grid-template-columns: 1fr;
    }

    .m3u-source-tab__content small {
        white-space: normal;
    }

    .m3u-options-grid {
        grid-template-columns: 1fr;
    }

    .m3u-option-card--wide {
        grid-column: auto;
    }

    .m3u-preview-toolbar {
        grid-template-columns:
            1fr 1fr;
    }

    .m3u-preview-search {
        grid-column: 1 / -1;
    }

}


/* ============================================================
   RESPONSIVE - MOBILE
============================================================ */

@media (max-width: 700px) {

    .m3u-page-header__title {
        font-size: 24px;
    }

    .m3u-source-panel,
    .m3u-options-section {
        padding: 18px;
    }

    .m3u-form-grid {
        grid-template-columns: 1fr;
    }

    .m3u-form-span-2 {
        grid-column: auto;
    }

    .m3u-section-heading {
        flex-direction: column;
    }

    .m3u-dropzone {
        align-items: center;
        flex-direction: column;

        min-height: 210px;

        text-align: center;
    }

    .m3u-segmented-control {
        grid-template-columns: 1fr;
    }

    .m3u-action-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .m3u-action-bar__buttons {
        width: 100%;
    }

    .m3u-action-bar__buttons .btn {
        flex: 1;
    }

    .m3u-preview-section,
    .m3u-history-section {
        padding: 17px;
    }

    .m3u-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .m3u-preview-toolbar {
        grid-template-columns: 1fr;
    }

    .m3u-preview-search {
        grid-column: auto;
    }

    .m3u-history-header {
        flex-direction: column;
    }

}


/* ============================================================
   RESPONSIVE - SMALL MOBILE
============================================================ */

@media (max-width: 480px) {

    .m3u-page-header__actions .btn {
        width: 100%;
    }

    .m3u-source-panel,
    .m3u-options-section {
        padding: 15px;
    }

    .m3u-source-tab {
        padding: 12px;
    }

    .m3u-option-card {
        padding: 13px;
    }

    .m3u-summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .m3u-summary-card {
        padding: 12px;
    }

    .m3u-summary-card strong {
        font-size: 18px;
    }

    .m3u-action-bar__buttons {
        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .m3u-action-bar__buttons .btn-primary {
        grid-column: 1 / -1;
    }

    .m3u-toast-container {
        right: 12px;
        bottom: 12px;

        width:
            calc(100vw - 24px);
    }

}

/* ============================================================
   CATEGORIES PAGE
   Works with:
   views/admin/categories/index.ejs
============================================================ */


/* ============================================================
   PAGE HEADER
============================================================ */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 24px;
}

.page-header>div:first-child {
    min-width: 0;
}

.page-header h1 {
    margin: 0;

    color: var(--text-primary, #ffffff);

    font-size: clamp(24px, 3vw, 32px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.page-header p {
    max-width: 720px;

    margin: 8px 0 0;

    color: var(--text-muted, #8895a7);

    font-size: 13px;
    line-height: 1.65;
}

.page-header-actions {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}


/* ============================================================
   FLASH / ALERTS
============================================================ */

.alert {
    position: relative;

    margin-bottom: 20px;
    padding: 14px 16px;

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;

    font-size: 13px;
    line-height: 1.55;
}

.alert-success {
    border-color: rgba(52, 211, 153, 0.22);

    background: rgba(52, 211, 153, 0.08);

    color: #8ce8c3;
}

.alert-error,
.alert-danger {
    border-color: rgba(255, 95, 109, 0.24);

    background: rgba(255, 95, 109, 0.08);

    color: #ff9ba4;
}

.alert-warning {
    border-color: rgba(245, 184, 67, 0.25);

    background: rgba(245, 184, 67, 0.08);

    color: #f6cf7b;
}

.alert-info {
    border-color: rgba(18, 181, 255, 0.22);

    background: rgba(18, 181, 255, 0.08);

    color: #8edcff;
}


/* ============================================================
   SUMMARY / STAT CARDS
============================================================ */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;

    margin-bottom: 22px;
}

.stat-card {
    position: relative;

    min-width: 0;
    min-height: 104px;

    padding: 18px;

    display: flex;
    align-items: center;
    gap: 14px;

    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 15px;

    background:
        linear-gradient(145deg,
            rgba(255, 255, 255, 0.045),
            rgba(255, 255, 255, 0.015));

    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.12);

    transition:
        transform 160ms ease,
        border-color 160ms ease,
        background 160ms ease,
        box-shadow 160ms ease;
}

.stat-card::after {
    content: "";

    position: absolute;

    width: 100px;
    height: 100px;

    top: -55px;
    right: -55px;

    border-radius: 50%;

    background:
        radial-gradient(circle,
            rgba(18, 181, 255, 0.12),
            transparent 68%);

    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-2px);

    border-color:
        rgba(18, 181, 255, 0.18);

    background:
        linear-gradient(145deg,
            rgba(255, 255, 255, 0.055),
            rgba(18, 181, 255, 0.025));

    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.16);
}

.stat-card-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid rgba(18, 181, 255, 0.2);

    border-radius: 13px;

    background:
        linear-gradient(135deg,
            rgba(18, 181, 255, 0.15),
            rgba(93, 124, 255, 0.08));

    color:
        var(--primary, #12b5ff);

    font-size: 17px;
}

.stat-card-content {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-card-label {
    color:
        var(--text-muted, #8895a7);

    font-size: 11px;
    font-weight: 650;

    line-height: 1.35;

    text-transform: uppercase;
    letter-spacing: 0.055em;
}

.stat-card-value {
    color:
        var(--text-primary, #ffffff);

    font-size: 25px;
    font-weight: 800;
    line-height: 1;
}


/* ============================================================
   PANELS
============================================================ */

.panel {
    position: relative;

    margin-bottom: 22px;

    overflow: hidden;

    border:
        1px solid rgba(255, 255, 255, 0.075);

    border-radius: 15px;

    background:
        var(--surface,
            #0e1523);

    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.12);
}

.panel-header {
    min-height: 74px;

    padding: 17px 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.065);
}

.panel-header>div {
    min-width: 0;
}

.panel-header h2 {
    margin: 0;

    color:
        var(--text-primary, #ffffff);

    font-size: 16px;
    font-weight: 750;
    line-height: 1.3;
}

.panel-header p {
    max-width: 700px;

    margin: 5px 0 0;

    color:
        var(--text-muted, #8895a7);

    font-size: 12px;
    line-height: 1.5;
}

.panel-body {
    padding: 20px;
}


/* ============================================================
   GENERIC BADGE
============================================================ */

.badge {
    flex: 0 0 auto;

    min-height: 28px;

    padding: 5px 10px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid rgba(18, 181, 255, 0.18);

    border-radius: 999px;

    background:
        rgba(18, 181, 255, 0.07);

    color:
        var(--primary, #12b5ff);

    font-size: 11px;
    font-weight: 700;

    white-space: nowrap;
}


/* ============================================================
   FILTER FORM
============================================================ */

.filter-form {
    display: grid;

    grid-template-columns:
        minmax(240px, 1fr) minmax(180px, 240px) auto;

    gap: 16px;

    align-items: end;
}

.filter-form .form-group {
    min-width: 0;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 9px;

    padding-bottom: 1px;
}


/* ============================================================
   FORM GROUP
============================================================ */

.form-group {
    min-width: 0;
}

.form-label {
    display: block;

    margin-bottom: 7px;

    color:
        var(--text-secondary, #c7d2e0);

    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
}

.form-control {
    width: 100%;
    min-width: 0;
    min-height: 43px;

    padding: 10px 12px;

    border:
        1px solid rgba(255, 255, 255, 0.09);

    border-radius: 10px;

    outline: none;

    background:
        rgba(255, 255, 255, 0.035);

    color:
        var(--text-primary, #ffffff);

    font: inherit;
    font-size: 13px;

    transition:
        border-color 160ms ease,
        background 160ms ease,
        box-shadow 160ms ease;
}

.form-control::placeholder {
    color:
        rgba(136, 149, 167, 0.72);
}

.form-control:hover {
    border-color:
        rgba(255, 255, 255, 0.14);
}

.form-control:focus {
    border-color:
        rgba(18, 181, 255, 0.6);

    background:
        rgba(18, 181, 255, 0.035);

    box-shadow:
        0 0 0 3px rgba(18, 181, 255, 0.11);
}

select.form-control {
    cursor: pointer;
}

select.form-control option {
    background:
        var(--surface, #0e1523);

    color:
        var(--text-primary, #ffffff);
}


/* ============================================================
   SEARCH INPUT ICON
============================================================ */

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap>i {
    position: absolute;

    left: 14px;
    top: 50%;

    z-index: 1;

    transform:
        translateY(-50%);

    color:
        var(--text-muted, #8895a7);

    font-size: 13px;

    pointer-events: none;
}

.input-icon-wrap .form-control {
    padding-left: 40px;
}


/* ============================================================
   BUTTONS
============================================================ */

.btn {
    min-height: 40px;

    padding: 9px 14px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border:
        1px solid transparent;

    border-radius: 10px;

    outline: none;

    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;

    text-decoration: none;

    white-space: nowrap;

    cursor: pointer;

    user-select: none;

    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background 150ms ease,
        color 150ms ease,
        box-shadow 150ms ease,
        opacity 150ms ease;
}

.btn:hover {
    text-decoration: none;
}

.btn:active:not(:disabled) {
    transform:
        scale(0.975);
}

.btn:focus-visible {
    outline:
        2px solid rgba(18, 181, 255, 0.65);

    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.58;

    cursor: not-allowed;
}

.btn-primary {
    border-color:
        rgba(18, 181, 255, 0.65);

    background:
        linear-gradient(135deg,
            var(--primary, #12b5ff),
            #3f8cff);

    color: #ffffff;

    box-shadow:
        0 8px 22px rgba(18, 181, 255, 0.16);
}

.btn-primary:hover:not(:disabled) {
    border-color:
        rgba(99, 207, 255, 0.9);

    box-shadow:
        0 10px 28px rgba(18, 181, 255, 0.24);

    transform:
        translateY(-1px);
}

.btn-secondary {
    border-color:
        rgba(255, 255, 255, 0.09);

    background:
        rgba(255, 255, 255, 0.045);

    color:
        var(--text-secondary, #c7d2e0);
}

.btn-secondary:hover:not(:disabled) {
    border-color:
        rgba(18, 181, 255, 0.22);

    background:
        rgba(18, 181, 255, 0.065);

    color:
        var(--text-primary, #ffffff);
}

.btn-danger {
    border-color:
        rgba(255, 95, 109, 0.22);

    background:
        rgba(255, 95, 109, 0.09);

    color: #ff8993;
}

.btn-danger:hover:not(:disabled) {
    border-color:
        rgba(255, 95, 109, 0.4);

    background:
        rgba(255, 95, 109, 0.16);

    color: #ffb0b7;
}

.btn-sm {
    min-width: 34px;
    min-height: 34px;

    padding: 7px 9px;

    border-radius: 9px;

    font-size: 11px;
}


/* ============================================================
   TABLE WRAPPER
============================================================ */

.table-responsive {
    width: 100%;

    overflow-x: auto;
    overflow-y: visible;

    -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background:
        rgba(255, 255, 255, 0.02);
}

.table-responsive::-webkit-scrollbar-thumb {
    border-radius: 999px;

    background:
        rgba(255, 255, 255, 0.12);
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background:
        rgba(255, 255, 255, 0.2);
}


/* ============================================================
   ADMIN TABLE
============================================================ */

.admin-table {
    width: 100%;
    min-width: 1120px;

    border-collapse: collapse;
    border-spacing: 0;
}

.admin-table thead th {
    padding: 13px 14px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.075);

    background:
        rgba(255, 255, 255, 0.025);

    color:
        var(--text-muted, #8895a7);

    font-size: 10px;
    font-weight: 750;

    line-height: 1.35;

    text-align: left;

    text-transform: uppercase;
    letter-spacing: 0.055em;

    white-space: nowrap;
}

.admin-table tbody td {
    padding: 14px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.05);

    color:
        var(--text-secondary, #c7d2e0);

    font-size: 12px;
    line-height: 1.45;

    vertical-align: middle;
}

.admin-table tbody tr {
    transition:
        background 150ms ease;
}

.admin-table tbody tr:hover {
    background:
        rgba(18, 181, 255, 0.025);
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}


/* ============================================================
   CATEGORY NAME CELL
============================================================ */

.category-name-cell {
    min-width: 190px;

    display: flex;
    align-items: center;
    gap: 12px;
}

.category-name-cell>div {
    min-width: 0;
}

.category-name-cell strong {
    display: block;

    max-width: 210px;

    overflow: hidden;

    color:
        var(--text-primary, #ffffff);

    font-size: 13px;
    font-weight: 750;
    line-height: 1.4;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-name-cell small {
    display: block;

    margin-top: 3px;

    color:
        var(--text-muted, #8895a7);

    font-size: 10px;
    line-height: 1.35;
}


/* ============================================================
   CATEGORY ICON
============================================================ */

.category-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid rgba(18, 181, 255, 0.18);

    border-radius: 11px;

    background:
        linear-gradient(135deg,
            rgba(18, 181, 255, 0.13),
            rgba(93, 124, 255, 0.07));

    color:
        var(--primary, #12b5ff);

    font-size: 14px;
}


/* ============================================================
   SLUG CODE
============================================================ */

.table-code {
    display: inline-block;

    max-width: 200px;

    padding: 5px 8px;

    overflow: hidden;

    border:
        1px solid rgba(255, 255, 255, 0.07);

    border-radius: 7px;

    background:
        rgba(255, 255, 255, 0.035);

    color: #b8c7da;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        Menlo,
        monospace;

    font-size: 11px;
    line-height: 1.35;

    text-overflow: ellipsis;
    white-space: nowrap;

    vertical-align: middle;
}


/* ============================================================
   COUNT BADGES
============================================================ */

.count-badge {
    min-width: 32px;
    min-height: 27px;

    padding: 4px 8px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid rgba(255, 255, 255, 0.075);

    border-radius: 999px;

    background:
        rgba(255, 255, 255, 0.04);

    color:
        var(--text-secondary, #c7d2e0);

    font-size: 11px;
    font-weight: 750;
}


/* ============================================================
   STATUS BADGES
============================================================ */

.status-badge {
    min-height: 26px;

    padding: 4px 9px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid transparent;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 750;

    line-height: 1;

    white-space: nowrap;
}

.status-success {
    border-color:
        rgba(52, 211, 153, 0.2);

    background:
        rgba(52, 211, 153, 0.08);

    color: #71dfb4;
}

.status-muted {
    border-color:
        rgba(136, 149, 167, 0.16);

    background:
        rgba(136, 149, 167, 0.07);

    color:
        var(--text-muted, #8895a7);
}


/* ============================================================
   TABLE ACTIONS
============================================================ */

.table-actions {
    display: flex;
    align-items: center;
    gap: 6px;

    white-space: nowrap;
}

.inline-form {
    display: inline-flex;

    margin: 0;
    padding: 0;
}


/* ============================================================
   EMPTY STATE
============================================================ */

.empty-table-cell {
    padding: 0 !important;
}

.empty-state {
    min-height: 330px;

    padding: 48px 24px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
}

.empty-state>i {
    width: 68px;
    height: 68px;

    margin-bottom: 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid rgba(18, 181, 255, 0.2);

    border-radius: 20px;

    background:
        linear-gradient(135deg,
            rgba(18, 181, 255, 0.14),
            rgba(138, 99, 255, 0.08));

    color:
        var(--primary, #12b5ff);

    font-size: 24px;
}

.empty-state h3 {
    margin: 0;

    color:
        var(--text-primary, #ffffff);

    font-size: 18px;
    font-weight: 750;
}

.empty-state p {
    max-width: 520px;

    margin: 9px 0 20px;

    color:
        var(--text-muted, #8895a7);

    font-size: 12px;
    line-height: 1.65;
}


/* ============================================================
   CATEGORY CREATE PAGE
============================================================ */

.category-form-panel {
    max-width: 900px;
}

.category-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.category-info-box {
    display: flex;
    align-items: flex-start;
    gap: 13px;

    padding: 15px;

    border: 1px solid rgba(18, 181, 255, 0.16);
    border-radius: 12px;

    background: rgba(18, 181, 255, 0.045);
}

.category-info-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: rgba(18, 181, 255, 0.1);
    color: var(--primary);
}

.category-info-box strong {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
}

.category-info-box p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

@media (max-width: 700px) {
    .category-form-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   CATEGORY EDIT PAGE
============================================================ */

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 10px;

    color: var(--muted);
    font-size: 12px;
}

.page-breadcrumb a {
    color: var(--muted);
    text-decoration: none;
}

.page-breadcrumb a:hover {
    color: var(--primary);
}

.page-breadcrumb i {
    font-size: 9px;
}

.page-breadcrumb span {
    color: var(--text-secondary);
}

.category-edit-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;

    margin-bottom: 22px;
}

.category-edit-summary-card {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 18px;

    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 15px;

    background:
        linear-gradient(145deg,
            rgba(255, 255, 255, 0.045),
            rgba(255, 255, 255, 0.015));
}

.category-edit-summary-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(18, 181, 255, 0.2);
    border-radius: 13px;

    background:
        linear-gradient(135deg,
            rgba(18, 181, 255, 0.15),
            rgba(93, 124, 255, 0.08));

    color: var(--primary);
    font-size: 17px;
}

.category-edit-summary-content {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-edit-summary-content strong {
    color: var(--text);
    font-size: 18px;
    font-weight: 800;
}

.category-edit-summary-content small {
    color: var(--muted);
    font-size: 11px;
}

.category-edit-summary-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.055em;
}

.category-edit-panel {
    max-width: 900px;
}

.category-edit-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.category-edit-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;

    padding: 16px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-2);
}

.category-edit-option-copy strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.category-edit-option-copy span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.category-switch {
    position: relative;
    flex-shrink: 0;

    display: inline-flex;

    cursor: pointer;
}

.category-switch input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
}

.category-switch-track {
    width: 44px;
    height: 26px;

    display: inline-flex;
    align-items: center;

    padding: 3px;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--surface-3);

    transition:
        background 0.18s ease,
        border-color 0.18s ease;
}

.category-switch-thumb {
    width: 18px;
    height: 18px;

    border-radius: 50%;

    background: var(--text-secondary);

    transition:
        transform 0.18s ease,
        background 0.18s ease;
}

.category-switch input:checked + .category-switch-track {
    border-color: var(--primary);
    background: rgba(18, 181, 255, 0.35);
}

.category-switch input:checked + .category-switch-track .category-switch-thumb {
    background: var(--primary);
    transform: translateX(18px);
}

.category-switch input:focus-visible + .category-switch-track {
    box-shadow: 0 0 0 3px rgba(18, 181, 255, 0.2);
}

.category-edit-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.category-edit-meta > div {
    padding: 14px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-2);
}

.category-edit-meta span {
    display: block;
    margin-bottom: 6px;

    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-edit-meta strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
}

.category-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.category-danger-panel {
    border-color: rgba(255, 95, 109, 0.25);
}

.category-danger-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.category-danger-row strong {
    display: block;
    margin-bottom: 4px;

    color: var(--error);
    font-size: 13px;
}

.category-danger-row p {
    margin: 0;
    max-width: 520px;

    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

@media (max-width: 780px) {
    .category-edit-summary {
        grid-template-columns: 1fr;
    }

    .category-edit-meta {
        grid-template-columns: 1fr;
    }

    .category-edit-option,
    .category-danger-row {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* ============================================================
   FORM HELP TEXT
============================================================ */

.form-help {
    display: block;

    margin-top: 7px;

    color:
        var(--text-muted, #8895a7);

    font-size: 10px;
    line-height: 1.5;
}


/* ============================================================
   CHECKBOX ROW
============================================================ */

.checkbox-row {
    min-height: 52px;

    padding: 13px 14px;

    display: flex;
    align-items: center;
    gap: 11px;

    border:
        1px solid rgba(255, 255, 255, 0.075);

    border-radius: 11px;

    background:
        rgba(255, 255, 255, 0.025);

    color:
        var(--text-secondary, #c7d2e0);

    font-size: 12px;
    line-height: 1.4;

    cursor: pointer;

    user-select: none;

    transition:
        border-color 150ms ease,
        background 150ms ease;
}

.checkbox-row:hover {
    border-color:
        rgba(18, 181, 255, 0.22);

    background:
        rgba(18, 181, 255, 0.035);
}

.checkbox-row input[type="checkbox"] {
    width: 17px;
    height: 17px;

    flex: 0 0 17px;

    margin: 0;

    accent-color:
        var(--primary, #12b5ff);

    cursor: pointer;
}


/* ============================================================
   CREATE CATEGORY MODAL BACKDROP
============================================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;

    z-index: 10000;

    padding: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow-y: auto;

    background:
        rgba(2, 6, 15, 0.78);

    -webkit-backdrop-filter:
        blur(8px);

    backdrop-filter:
        blur(8px);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transition:
        opacity 180ms ease,
        visibility 180ms ease;
}


/* ============================================================
   CRITICAL HIDDEN FIX

   This prevents invisible modal overlay from blocking:
   - mouse
   - buttons
   - sidebar
   - page interaction
============================================================ */

.modal-backdrop[hidden] {
    display: none !important;

    opacity: 0 !important;
    visibility: hidden !important;

    pointer-events: none !important;
}


/* ============================================================
   MODAL OPEN STATE
============================================================ */

.modal-backdrop.is-open {
    display: flex;

    opacity: 1;
    visibility: visible;

    pointer-events: auto;
}


/* ============================================================
   MODAL CARD
============================================================ */

.modal-card {
    position: relative;

    width: min(100%, 560px);
    max-height:
        calc(100vh - 48px);

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border:
        1px solid rgba(255, 255, 255, 0.095);

    border-radius: 18px;

    background:
        linear-gradient(180deg,
            rgba(22, 32, 51, 0.995),
            rgba(14, 21, 35, 0.995));

    box-shadow:
        0 30px 100px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(18, 181, 255, 0.025);

    transform:
        translateY(14px) scale(0.985);

    transition:
        transform 180ms ease;
}

.modal-backdrop.is-open .modal-card {
    transform:
        translateY(0) scale(1);
}


/* ============================================================
   MODAL HEADER
============================================================ */

.modal-header {
    flex: 0 0 auto;

    padding: 19px 21px;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.07);
}

.modal-header>div {
    min-width: 0;
}

.modal-header h2 {
    margin: 0;

    color:
        var(--text-primary, #ffffff);

    font-size: 18px;
    font-weight: 780;
    line-height: 1.3;
}

.modal-header p {
    margin: 5px 0 0;

    color:
        var(--text-muted, #8895a7);

    font-size: 11px;
    line-height: 1.5;
}


/* ============================================================
   MODAL CLOSE BUTTON
============================================================ */

.modal-close {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;

    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid rgba(255, 255, 255, 0.08);

    border-radius: 10px;

    outline: none;

    background:
        rgba(255, 255, 255, 0.04);

    color:
        var(--text-secondary, #c7d2e0);

    font-size: 14px;

    cursor: pointer;

    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background 150ms ease,
        color 150ms ease;
}

.modal-close:hover {
    border-color:
        rgba(255, 255, 255, 0.15);

    background:
        rgba(255, 255, 255, 0.08);

    color: #ffffff;
}

.modal-close:active {
    transform:
        scale(0.95);
}

.modal-close:focus-visible {
    outline:
        2px solid rgba(18, 181, 255, 0.6);

    outline-offset: 2px;
}


/* ============================================================
   MODAL FORM
============================================================ */

.modal-card>form {
    min-height: 0;

    display: flex;
    flex-direction: column;
}


/* ============================================================
   MODAL BODY
============================================================ */

.modal-body {
    min-height: 0;

    padding: 21px;

    display: flex;
    flex-direction: column;
    gap: 18px;

    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-body::-webkit-scrollbar {
    width: 7px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    border-radius: 999px;

    background:
        rgba(255, 255, 255, 0.12);
}


/* ============================================================
   MODAL FOOTER
============================================================ */

.modal-footer {
    flex: 0 0 auto;

    padding: 15px 21px;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;

    border-top:
        1px solid rgba(255, 255, 255, 0.07);

    background:
        rgba(0, 0, 0, 0.08);
}


/* ============================================================
   BODY MODAL LOCK
============================================================ */

body.modal-open {
    overflow: hidden;
}


/* ============================================================
   LOADING BUTTON STATE
============================================================ */

button[aria-busy="true"] {
    cursor: wait !important;
}

button[aria-busy="true"]:disabled {
    opacity: 0.68;
}


/* ============================================================
   RESPONSIVE - LARGE TABLET
============================================================ */

@media (max-width: 1180px) {
    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .filter-form {
        grid-template-columns:
            minmax(220px, 1fr) minmax(170px, 220px);
    }

    .filter-actions {
        grid-column:
            1 / -1;
    }
}


/* ============================================================
   RESPONSIVE - TABLET
============================================================ */

@media (max-width: 820px) {
    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header-actions {
        justify-content: flex-start;
    }

    .panel-header {
        align-items: flex-start;
    }

    .filter-form {
        grid-template-columns:
            1fr;
    }

    .filter-actions {
        grid-column:
            auto;
    }
}


/* ============================================================
   RESPONSIVE - MOBILE
============================================================ */

@media (max-width: 640px) {
    .page-header {
        gap: 16px;

        margin-bottom: 18px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns:
            1fr;

        gap: 11px;
    }

    .stat-card {
        min-height: 90px;

        padding: 15px;
    }

    .panel {
        border-radius: 13px;
    }

    .panel-header {
        min-height: auto;

        padding: 15px;

        flex-direction: column;
        align-items: stretch;
    }

    .panel-header .badge {
        align-self: flex-start;
    }

    .panel-body {
        padding: 15px;
    }

    .filter-actions {
        width: 100%;

        flex-direction: column;
    }

    .filter-actions .btn {
        width: 100%;
    }

    .modal-backdrop {
        padding: 12px;

        align-items: flex-end;
    }

    .modal-card {
        width: 100%;

        max-height:
            calc(100vh - 24px);

        border-radius:
            18px 18px 12px 12px;
    }

    .modal-header {
        padding: 17px;
    }

    .modal-body {
        padding: 17px;
    }

    .modal-footer {
        padding: 14px 17px;

        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .category-name-cell {
        min-width: 165px;
    }
}


/* ============================================================
   RESPONSIVE - SMALL MOBILE
============================================================ */

@media (max-width: 420px) {
    .modal-backdrop {
        padding: 0;
    }

    .modal-card {
        max-height: 100vh;

        border-left: 0;
        border-right: 0;
        border-bottom: 0;

        border-radius:
            18px 18px 0 0;
    }

    .stat-card-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .stat-card-value {
        font-size: 22px;
    }
}


/* ============================================================
   REDUCED MOTION
============================================================ */

@media (prefers-reduced-motion: reduce) {

    .stat-card,
    .btn,
    .form-control,
    .modal-backdrop,
    .modal-card,
    .modal-close,
    .checkbox-row {
        transition: none !important;
    }
}

/* ============================================================
   API ACCESS MODULE
   Pages:
   - /admin/api-access
   - /admin/api-access/create
   - /admin/api-access/:id
   - /admin/api-access/:id/edit
   - /admin/api-access/:id/credentials
============================================================ */


/* ============================================================
   API ACCESS STATS
============================================================ */

.api-access-stats,
.api-client-detail-stats {
    display: grid;
    grid-template-columns:
        repeat(5,
            minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.api-client-detail-stats {
    grid-template-columns:
        repeat(4,
            minmax(0, 1fr));
}

.api-access-stats .stat-card,
.api-client-detail-stats .stat-card {
    min-width: 0;
}

.stat-value-text {
    font-size: 18px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}


/* ============================================================
   FILTER PANEL
============================================================ */

.api-access-filter-panel {
    margin-bottom: 20px;
}

.api-access-filter-panel .filter-form {
    width: 100%;
}

.api-access-filter-panel .filter-grid {
    display: grid;
    grid-template-columns:
        minmax(240px, 2fr) minmax(160px, 1fr) minmax(130px, 0.7fr) auto;
    gap: 16px;
    align-items: end;
}

.api-access-filter-panel .filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.api-access-filter-panel .input-icon-wrap {
    position: relative;
}

.api-access-filter-panel .input-icon-wrap>i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: none;
    opacity: 0.7;
}

.api-access-filter-panel .input-icon-wrap .form-control {
    padding-left: 42px;
}


/* ============================================================
   API CLIENT LIST
============================================================ */

.api-access-list-panel {
    overflow: visible;
}

.api-access-list-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.api-access-list-panel .panel-header p {
    margin: 5px 0 0;
    opacity: 0.72;
}

.api-client-table {
    width: 100%;
    min-width: 1180px;
}

.api-client-table th,
.api-client-table td {
    vertical-align: middle;
}

.api-client-table td {
    max-width: 280px;
}

.table-actions-column {
    width: 160px;
    text-align: right;
}


/* ============================================================
   CLIENT IDENTITY
============================================================ */

.api-client-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 210px;
}

.api-client-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        rgba(18, 181, 255, 0.12);

    border:
        1px solid rgba(18, 181, 255, 0.2);
}

.api-client-avatar i {
    font-size: 17px;
}

.api-client-identity-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.api-client-name {
    display: block;

    font-weight: 700;
    line-height: 1.3;

    text-decoration: none;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.api-client-name:hover {
    text-decoration: underline;
}

.api-client-public-id {
    display: block;

    max-width: 190px;

    font-size: 11px;
    line-height: 1.4;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    opacity: 0.65;
}


/* ============================================================
   COPY FIELD
============================================================ */

.copy-field {
    display: flex;
    align-items: center;
    gap: 8px;

    width: 100%;
    min-width: 0;

    padding: 10px 12px;

    border-radius: 10px;

    border:
        1px solid rgba(255, 255, 255, 0.1);

    background:
        rgba(255, 255, 255, 0.035);
}

.copy-field-value {
    flex: 1;
    min-width: 0;

    display: block;

    font-size: 12px;
    line-height: 1.5;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-copy-field {
    min-width: 220px;
    max-width: 300px;
    padding: 7px 8px 7px 10px;
}

.copy-success {
    pointer-events: none;
}


/* ============================================================
   SECURITY INFO
============================================================ */

.api-security-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.api-security-info small {
    font-size: 11px;
    opacity: 0.65;
}


/* ============================================================
   MINI BADGES
============================================================ */

.mini-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    max-width: 100%;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;

    background:
        rgba(255, 255, 255, 0.07);

    border:
        1px solid rgba(255, 255, 255, 0.09);
}

.mini-badge-secure {
    background:
        rgba(18, 181, 255, 0.1);

    border-color:
        rgba(18, 181, 255, 0.22);
}

.mini-badge-danger {
    background:
        rgba(239, 68, 68, 0.11);

    border-color:
        rgba(239, 68, 68, 0.24);
}


/* ============================================================
   STATUS BADGES
============================================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 6px 10px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;

    white-space: nowrap;

    border:
        1px solid transparent;
}

.status-active {
    background:
        rgba(34, 197, 94, 0.12);

    border-color:
        rgba(34, 197, 94, 0.24);
}

.status-disabled {
    background:
        rgba(148, 163, 184, 0.1);

    border-color:
        rgba(148, 163, 184, 0.2);
}

.status-expired {
    background:
        rgba(239, 68, 68, 0.11);

    border-color:
        rgba(239, 68, 68, 0.23);
}


/* ============================================================
   LIMIT LIST
============================================================ */

.api-limit-list {
    display: flex;
    flex-direction: column;
    gap: 7px;

    min-width: 150px;
}

.api-limit-list span {
    display: flex;
    align-items: center;
    gap: 7px;

    font-size: 12px;
    line-height: 1.35;

    white-space: nowrap;
}

.api-limit-list i {
    width: 14px;
    text-align: center;
    opacity: 0.7;
}


/* ============================================================
   TABLE ACTIONS
============================================================ */

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;

    position: relative;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}


/* ============================================================
   ACTION DROPDOWN
============================================================ */

.action-menu {
    position: relative;
    display: inline-flex;
}

.action-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;

    z-index: 120;

    min-width: 210px;

    padding: 7px;

    border-radius: 12px;

    background:
        #101827;

    border:
        1px solid rgba(255, 255, 255, 0.11);

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.42);

    opacity: 0;
    visibility: hidden;
    transform:
        translateY(-5px) scale(0.98);

    transform-origin:
        top right;

    pointer-events: none;

    transition:
        opacity 0.16s ease,
        transform 0.16s ease,
        visibility 0.16s ease;
}

.action-menu.is-open .action-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform:
        translateY(0) scale(1);

    pointer-events: auto;
}

.action-menu-dropdown form {
    margin: 0;
}

.action-menu-item {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 11px;

    border: 0;
    border-radius: 8px;

    background: transparent;

    color: inherit;

    font: inherit;
    font-size: 13px;
    font-weight: 600;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.16s ease,
        color 0.16s ease;
}

.action-menu-item:hover {
    background:
        rgba(255, 255, 255, 0.07);
}

.action-menu-item i {
    width: 16px;
    text-align: center;
}

.action-menu-item.danger {
    color:
        #f87171;
}

.action-menu-item.danger:hover {
    background:
        rgba(239, 68, 68, 0.1);
}

.action-menu-divider {
    height: 1px;

    margin: 6px 4px;

    background:
        rgba(255, 255, 255, 0.08);
}


/* ============================================================
   API FORM
============================================================ */

.api-client-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.api-form-panel {
    overflow: hidden;
}

.api-form-panel .panel-header,
.api-detail-panel .panel-header,
.api-credentials-panel .panel-header,
.api-secret-panel .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.api-form-panel .panel-header p,
.api-detail-panel .panel-header p,
.api-credentials-panel .panel-header p,
.api-secret-panel .panel-header p {
    margin: 5px 0 0;
    opacity: 0.7;
}

.api-form-panel .panel-body,
.api-detail-panel .panel-body,
.api-credentials-panel .panel-body,
.api-secret-panel .panel-body {
    padding-top: 4px;
}

.panel-header-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        rgba(18, 181, 255, 0.1);

    border:
        1px solid rgba(18, 181, 255, 0.18);
}


/* ============================================================
   FORM GRID
============================================================ */

.api-client-form .form-grid {
    display: grid;

    grid-template-columns:
        repeat(2,
            minmax(0, 1fr));

    gap: 20px;
}

.api-client-form .form-group-full {
    grid-column: 1 / -1;
}


/* ============================================================
   INPUT ICON
============================================================ */

.api-client-form .input-icon-wrap {
    position: relative;
}

.api-client-form .input-icon-wrap>i {
    position: absolute;

    left: 14px;
    top: 50%;

    transform:
        translateY(-50%);

    z-index: 2;

    pointer-events: none;

    opacity: 0.7;
}

.api-client-form .input-icon-wrap .form-control {
    padding-left: 42px;
}


/* ============================================================
   REQUIRED MARK
============================================================ */

.required-mark {
    margin-left: 3px;
    color: #f87171;
}


/* ============================================================
   SETTING TOGGLE CARD
============================================================ */

.setting-toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    width: 100%;

    padding: 16px;

    border-radius: 14px;

    border:
        1px solid rgba(255, 255, 255, 0.09);

    background:
        rgba(255, 255, 255, 0.025);

    cursor: pointer;

    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        transform 0.18s ease;
}

.setting-toggle-card:hover {
    border-color:
        rgba(18, 181, 255, 0.25);

    background:
        rgba(18, 181, 255, 0.035);
}

.setting-toggle-content {
    display: flex;
    align-items: center;
    gap: 13px;

    min-width: 0;
}

.setting-toggle-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        rgba(18, 181, 255, 0.1);

    border:
        1px solid rgba(18, 181, 255, 0.18);
}

.setting-toggle-content>span:last-child {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-toggle-content strong {
    font-size: 14px;
    line-height: 1.35;
}

.setting-toggle-content small {
    font-size: 12px;
    line-height: 1.5;
    opacity: 0.68;
}


/* ============================================================
   SWITCH CONTROL
============================================================ */

.switch-control {
    position: relative;

    width: 46px;
    height: 26px;

    flex: 0 0 46px;
}

.switch-control input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
    pointer-events: none;
}

.switch-slider {
    position: absolute;
    inset: 0;

    border-radius: 999px;

    background:
        rgba(148, 163, 184, 0.28);

    cursor: pointer;

    transition:
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.switch-slider::before {
    content: "";

    position: absolute;

    width: 20px;
    height: 20px;

    left: 3px;
    top: 3px;

    border-radius: 50%;

    background: #ffffff;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.25);

    transition:
        transform 0.2s ease;
}

.switch-control input:checked+.switch-slider {
    background:
        #12b5ff;

    box-shadow:
        0 0 0 3px rgba(18, 181, 255, 0.12);
}

.switch-control input:checked+.switch-slider::before {
    transform:
        translateX(20px);
}

.switch-control input:focus-visible+.switch-slider {
    outline:
        2px solid rgba(18, 181, 255, 0.85);

    outline-offset: 3px;
}


/* ============================================================
   IP LOCK SECTION
============================================================ */

.api-ip-lock-section {
    margin-top: 18px;

    padding: 18px;

    border-radius: 14px;

    border:
        1px solid rgba(255, 255, 255, 0.09);

    background:
        rgba(255, 255, 255, 0.022);
}

.api-ip-lock-section[hidden] {
    display: none !important;
}

.api-ip-lock-section.is-active {
    animation:
        apiSectionReveal 0.2s ease;
}

@keyframes apiSectionReveal {
    from {
        opacity: 0;
        transform:
            translateY(-5px);
    }

    to {
        opacity: 1;
        transform:
            translateY(0);
    }
}

.api-ip-textarea {
    min-height: 150px;

    resize: vertical;

    font-family:
        Consolas,
        "Courier New",
        monospace;

    line-height: 1.6;
}

.api-security-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    margin-top: 12px;

    padding: 11px 13px;

    border-radius: 10px;

    background:
        rgba(18, 181, 255, 0.07);

    border:
        1px solid rgba(18, 181, 255, 0.14);

    font-size: 12px;
    line-height: 1.5;
}

.api-security-note i {
    margin-top: 2px;
}


/* ============================================================
   EXPIRY PREVIEW
============================================================ */

.api-expiry-preview-card {
    display: flex;
    align-items: center;
    gap: 13px;

    min-height: 92px;

    padding: 16px;

    border-radius: 14px;

    border:
        1px solid rgba(255, 255, 255, 0.09);

    background:
        rgba(255, 255, 255, 0.025);
}

.api-expiry-preview-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        rgba(18, 181, 255, 0.1);

    border:
        1px solid rgba(18, 181, 255, 0.18);
}

.api-expiry-preview-card>div:last-child {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 5px;
}

.api-expiry-preview-label {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.65;
}

#expiryPreview {
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

#expiryPreview.is-expired {
    color: #f87171;
}

#expiryPreview.is-future {
    color: #4ade80;
}


/* ============================================================
   CREDENTIAL WARNING
============================================================ */

.api-credential-warning-panel {
    border-color:
        rgba(245, 158, 11, 0.18);
}

.api-credential-warning {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.api-credential-warning-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background:
        rgba(245, 158, 11, 0.1);

    border:
        1px solid rgba(245, 158, 11, 0.2);
}

.api-credential-warning h3 {
    margin: 0 0 6px;
    font-size: 15px;
}

.api-credential-warning p {
    margin: 0;

    font-size: 13px;
    line-height: 1.6;

    opacity: 0.72;
}


/* ============================================================
   FORM ACTIONS
============================================================ */

.api-form-actions-panel {
    position: sticky;
    bottom: 12px;
    z-index: 30;

    backdrop-filter:
        blur(14px);

    background:
        rgba(14, 21, 35, 0.88);
}

.panel-form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}


/* ============================================================
   ONE-TIME SECRET WARNING
============================================================ */

.api-secret-warning-panel {
    border-color:
        rgba(245, 158, 11, 0.25);

    background:
        linear-gradient(135deg,
            rgba(245, 158, 11, 0.08),
            rgba(239, 68, 68, 0.035));
}

.api-secret-warning {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.api-secret-warning-icon {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background:
        rgba(245, 158, 11, 0.12);

    border:
        1px solid rgba(245, 158, 11, 0.22);
}

.api-secret-warning-content h2 {
    margin: 0 0 7px;
    font-size: 17px;
}

.api-secret-warning-content p {
    margin: 0;

    max-width: 760px;

    font-size: 13px;
    line-height: 1.65;

    opacity: 0.76;
}


/* ============================================================
   CREDENTIAL GRID
============================================================ */

.api-credential-grid {
    display: grid;

    grid-template-columns:
        repeat(2,
            minmax(0, 1fr));

    gap: 16px;
}

.api-credential-item {
    min-width: 0;

    padding: 16px;

    border-radius: 13px;

    border:
        1px solid rgba(255, 255, 255, 0.09);

    background:
        rgba(255, 255, 255, 0.025);
}

.api-credential-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    margin-bottom: 10px;
}

.api-credential-label {
    display: block;

    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;

    opacity: 0.66;
}

.api-credential-display {
    min-width: 0;
}

.api-credential-value,
.api-credential-plain-value {
    display: block;

    max-width: 100%;

    font-size: 13px;
    line-height: 1.55;

    overflow-wrap: anywhere;
}


/* ============================================================
   LARGE CREDENTIAL BOX
============================================================ */

.api-large-credential-box,
.api-secret-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 18px;

    border-radius: 14px;

    border:
        1px solid rgba(255, 255, 255, 0.1);

    background:
        rgba(255, 255, 255, 0.025);
}

.api-large-credential-content,
.api-secret-box-content {
    flex: 1;
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 9px;
}

.api-large-credential-value {
    display: block;

    max-width: 100%;

    font-size: 13px;
    line-height: 1.6;

    overflow-wrap: anywhere;
    word-break: break-all;
}


/* ============================================================
   SECRET PANEL
============================================================ */

.api-secret-panel {
    border-color:
        rgba(239, 68, 68, 0.18);
}

.api-secret-value-row {
    display: flex;
    align-items: center;
    gap: 9px;

    min-width: 0;
}

.api-secret-value {
    flex: 1;
    min-width: 0;
}

.api-secret-security-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    margin-top: 16px;

    padding: 14px;

    border-radius: 12px;

    background:
        rgba(239, 68, 68, 0.055);

    border:
        1px solid rgba(239, 68, 68, 0.12);
}

.api-secret-security-note>i {
    margin-top: 3px;
}

.api-secret-security-note strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.api-secret-security-note p {
    margin: 0;

    font-size: 12px;
    line-height: 1.55;

    opacity: 0.72;
}


/* ============================================================
   CREDENTIAL EXPORT
============================================================ */

.api-credential-export {
    width: 100%;

    padding: 16px;

    border-radius: 12px;

    border:
        1px solid rgba(255, 255, 255, 0.09);

    background:
        rgba(0, 0, 0, 0.18);

    font-family:
        Consolas,
        "Courier New",
        monospace;

    font-size: 12px;
    line-height: 1.75;

    white-space: pre-wrap;
    overflow-wrap: anywhere;

    user-select: text;
}

.api-copy-all-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;

    margin-top: 14px;
}


/* ============================================================
   SECURITY GUIDANCE
============================================================ */

.api-guidance-grid {
    display: grid;

    grid-template-columns:
        repeat(2,
            minmax(0, 1fr));

    gap: 14px;
}

.api-guidance-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    padding: 15px;

    border-radius: 13px;

    border:
        1px solid rgba(255, 255, 255, 0.08);

    background:
        rgba(255, 255, 255, 0.022);
}

.api-guidance-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background:
        rgba(18, 181, 255, 0.09);

    border:
        1px solid rgba(18, 181, 255, 0.16);
}

.api-guidance-item strong {
    display: block;

    margin-bottom: 4px;

    font-size: 13px;
}

.api-guidance-item p {
    margin: 0;

    font-size: 12px;
    line-height: 1.55;

    opacity: 0.68;
}


/* ============================================================
   CREDENTIAL ACTIONS
============================================================ */

.api-credentials-actions-panel .panel-form-footer {
    justify-content: space-between;
}


/* ============================================================
   PAGE TITLE ROW
============================================================ */

.page-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}


/* ============================================================
   DETAIL GRID
============================================================ */

.api-detail-grid {
    display: grid;

    grid-template-columns:
        repeat(2,
            minmax(0, 1fr));

    gap: 15px;
}

.api-detail-item {
    min-width: 0;

    padding: 15px;

    border-radius: 13px;

    border:
        1px solid rgba(255, 255, 255, 0.08);

    background:
        rgba(255, 255, 255, 0.022);
}

.api-detail-item-full {
    grid-column: 1 / -1;
}

.api-detail-label {
    display: block;

    margin-bottom: 7px;

    font-size: 11px;
    font-weight: 800;

    opacity: 0.64;
}

.api-detail-value {
    display: block;

    font-size: 14px;
    line-height: 1.5;

    overflow-wrap: anywhere;
}

.api-detail-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    margin-bottom: 8px;
}

.api-detail-label-row .api-detail-label {
    margin-bottom: 0;
}


/* ============================================================
   SECRET UNAVAILABLE CARD
============================================================ */

.api-secret-unavailable-card {
    display: flex;
    align-items: center;
    gap: 15px;

    padding: 16px;

    border-radius: 14px;

    border:
        1px solid rgba(255, 255, 255, 0.09);

    background:
        rgba(255, 255, 255, 0.025);
}

.api-secret-unavailable-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background:
        rgba(18, 181, 255, 0.09);

    border:
        1px solid rgba(18, 181, 255, 0.17);
}

.api-secret-unavailable-content {
    flex: 1;
    min-width: 0;
}

.api-secret-unavailable-content strong {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.api-secret-unavailable-content p {
    margin: 0;

    font-size: 12px;
    line-height: 1.55;

    opacity: 0.7;
}


/* ============================================================
   IP LIST
============================================================ */

.api-ip-list {
    display: grid;

    grid-template-columns:
        repeat(2,
            minmax(0, 1fr));

    gap: 10px;
}

.api-ip-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    min-width: 0;

    padding: 11px 12px;

    border-radius: 11px;

    border:
        1px solid rgba(255, 255, 255, 0.08);

    background:
        rgba(255, 255, 255, 0.025);
}

.api-ip-item-content {
    display: flex;
    align-items: center;
    gap: 9px;

    min-width: 0;
}

.api-ip-item-content code {
    min-width: 0;

    font-size: 12px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ============================================================
   SECURITY WARNING / OPEN NETWORK
============================================================ */

.api-security-warning,
.api-open-network-card {
    display: flex;
    align-items: flex-start;
    gap: 13px;

    padding: 15px;

    border-radius: 13px;
}

.api-security-warning {
    background:
        rgba(245, 158, 11, 0.07);

    border:
        1px solid rgba(245, 158, 11, 0.16);
}

.api-open-network-card {
    background:
        rgba(18, 181, 255, 0.055);

    border:
        1px solid rgba(18, 181, 255, 0.13);
}

.api-open-network-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        rgba(18, 181, 255, 0.09);
}

.api-security-warning strong,
.api-open-network-card strong {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
}

.api-security-warning p,
.api-open-network-card p {
    margin: 0;

    font-size: 12px;
    line-height: 1.55;

    opacity: 0.7;
}


/* ============================================================
   LIMIT DETAIL CARDS
============================================================ */

.api-limit-detail-grid {
    display: grid;

    grid-template-columns:
        repeat(2,
            minmax(0, 1fr));

    gap: 15px;
}

.api-limit-detail-card {
    display: flex;
    align-items: flex-start;
    gap: 13px;

    padding: 16px;

    border-radius: 14px;

    border:
        1px solid rgba(255, 255, 255, 0.08);

    background:
        rgba(255, 255, 255, 0.022);
}

.api-limit-detail-icon {
    width: 43px;
    height: 43px;
    flex: 0 0 43px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        rgba(18, 181, 255, 0.09);

    border:
        1px solid rgba(18, 181, 255, 0.16);
}

.api-limit-detail-card strong {
    display: block;

    margin: 3px 0 5px;

    font-size: 15px;
}

.api-limit-detail-card p {
    margin: 0;

    font-size: 12px;
    line-height: 1.55;

    opacity: 0.68;
}


/* ============================================================
   CLIENT ACTION GRID
============================================================ */

.api-client-action-grid {
    display: grid;

    grid-template-columns:
        repeat(2,
            minmax(0, 1fr));

    gap: 14px;
}

.api-action-card-form {
    display: block;
    margin: 0;
}

.api-action-card {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: flex-start;
    gap: 13px;

    padding: 16px;

    border-radius: 14px;

    border:
        1px solid rgba(255, 255, 255, 0.09);

    background:
        rgba(255, 255, 255, 0.025);

    color: inherit;

    font: inherit;
    text-align: left;
    text-decoration: none;

    cursor: pointer;

    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        transform 0.18s ease;
}

.api-action-card:hover {
    transform:
        translateY(-1px);

    border-color:
        rgba(18, 181, 255, 0.24);

    background:
        rgba(18, 181, 255, 0.04);
}

.api-action-card-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        rgba(18, 181, 255, 0.09);

    border:
        1px solid rgba(18, 181, 255, 0.16);
}

.api-action-card strong {
    display: block;

    margin-bottom: 5px;

    font-size: 13px;
}

.api-action-card p {
    margin: 0;

    font-size: 12px;
    line-height: 1.55;

    opacity: 0.68;
}

.api-action-card-danger {
    border-color:
        rgba(239, 68, 68, 0.15);
}

.api-action-card-danger:hover {
    border-color:
        rgba(239, 68, 68, 0.3);

    background:
        rgba(239, 68, 68, 0.055);
}

.api-action-card-danger .api-action-card-icon {
    background:
        rgba(239, 68, 68, 0.09);

    border-color:
        rgba(239, 68, 68, 0.17);
}


/* ============================================================
   MODAL
============================================================ */

.modal-backdrop[hidden] {
    display: none !important;
}

.modal-backdrop {
    position: fixed;
    inset: 0;

    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(0, 0, 0, 0.68);

    backdrop-filter:
        blur(5px);
}

.modal-backdrop.is-open {
    animation:
        apiModalBackdropIn 0.16s ease;
}

@keyframes apiModalBackdropIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-card {
    width: min(100%,
            520px);

    max-height:
        calc(100vh - 40px);

    overflow: auto;

    border-radius: 16px;

    background:
        #0e1523;

    border:
        1px solid rgba(255, 255, 255, 0.11);

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.52);

    animation:
        apiModalCardIn 0.18s ease;
}

@keyframes apiModalCardIn {
    from {
        opacity: 0;

        transform:
            translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;

        transform:
            translateY(0) scale(1);
    }
}

.modal-header,
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding: 16px 18px;
}

.modal-header {
    border-bottom:
        1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.modal-body {
    padding: 18px;
}

.modal-body>p {
    margin: 0;

    font-size: 13px;
    line-height: 1.65;

    opacity: 0.76;
}

.modal-footer {
    justify-content: flex-end;

    border-top:
        1px solid rgba(255, 255, 255, 0.08);
}

body.modal-open {
    overflow: hidden;
}


/* ============================================================
   ROTATE SECRET MODAL WARNING
============================================================ */

.api-modal-warning {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.api-modal-warning-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        rgba(245, 158, 11, 0.1);

    border:
        1px solid rgba(245, 158, 11, 0.2);
}

.api-modal-warning strong {
    display: block;

    margin-bottom: 6px;

    font-size: 13px;
    line-height: 1.45;
}

.api-modal-warning p {
    margin: 0;

    font-size: 12px;
    line-height: 1.6;

    opacity: 0.7;
}


/* ============================================================
   API TOAST
============================================================ */

.api-toast {
    position: fixed;

    right: 22px;
    bottom: 22px;

    z-index: 2000;

    display: flex;
    align-items: center;
    gap: 10px;

    max-width:
        min(420px,
            calc(100vw - 32px));

    padding: 12px 15px;

    border-radius: 12px;

    background:
        #111a2a;

    border:
        1px solid rgba(255, 255, 255, 0.11);

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.4);

    font-size: 13px;
    font-weight: 600;

    opacity: 0;

    transform:
        translateY(10px);

    pointer-events: none;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.api-toast.show {
    opacity: 1;

    transform:
        translateY(0);
}

.api-toast-success {
    border-color:
        rgba(34, 197, 94, 0.25);
}

.api-toast-error {
    border-color:
        rgba(239, 68, 68, 0.28);
}

.api-toast-warning {
    border-color:
        rgba(245, 158, 11, 0.28);
}
/* =========================================================
   TOKEN ACCESS PAGE
========================================================= */

.token-access-page {
  display: grid;
  gap: 22px;
}

.token-access-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 28px;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;

  background:
    linear-gradient(
      135deg,
      rgba(18, 181, 255, 0.12),
      rgba(255, 255, 255, 0.03)
    );
}

.token-access-eyebrow {
  display: block;

  margin-bottom: 8px;

  color: #12b5ff;

  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.token-access-hero h1 {
  margin: 0 0 8px;

  color: #fff;

  font-size: 30px;
}

.token-access-hero p {
  margin: 0;

  color: rgba(255, 255, 255, 0.62);
}

.token-access-stats {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 14px;
}

.token-stat-card {
  padding: 20px;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;

  background: #0e1523;
}

.token-stat-card span {
  display: block;

  margin-bottom: 10px;

  color: rgba(255, 255, 255, 0.58);

  font-size: 12px;
  font-weight: 700;
}

.token-stat-card strong {
  color: #fff;

  font-size: 28px;
}

.token-stat-card.active strong {
  color: #43d17a;
}

.token-stat-card.expired strong {
  color: #ffb020;
}

.token-stat-card.revoked strong {
  color: #ff5f6d;
}

.token-access-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;

  background: #0e1523;

  overflow: hidden;
}

.token-access-filters {
  display: grid;

  grid-template-columns:
    minmax(220px, 1fr)
    180px
    180px
    auto
    auto;

  gap: 12px;

  padding: 18px;
}

.token-access-filters input,
.token-access-filters select {
  width: 100%;

  min-height: 44px;

  padding: 0 13px;

  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;

  background: #09101c;

  color: #fff;

  outline: none;
}

.token-access-filters button,
.token-access-filters a {
  min-height: 44px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0 18px;

  border: 0;
  border-radius: 11px;

  text-decoration: none;

  cursor: pointer;
}

.token-access-filters button {
  background: #12b5ff;

  color: #031019;

  font-weight: 900;
}

.token-access-filters a {
  background: rgba(255, 255, 255, 0.07);

  color: #fff;
}

.token-access-table-wrap {
  overflow-x: auto;
}

.token-access-table {
  width: 100%;

  border-collapse: collapse;
}

.token-access-table th,
.token-access-table td {
  padding: 15px;

  border-bottom:
    1px solid rgba(255, 255, 255, 0.07);

  text-align: left;
  vertical-align: middle;
}

.token-access-table th {
  color: rgba(255, 255, 255, 0.5);

  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.token-access-table td {
  color: rgba(255, 255, 255, 0.82);

  font-size: 13px;
}

.token-id-cell,
.token-target-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.token-id-cell {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.token-id-cell strong {
  max-width: 220px;

  overflow: hidden;
  text-overflow: ellipsis;

  color: #fff;
}

.token-id-cell small,
.token-target-cell small {
  color: rgba(255, 255, 255, 0.46);
}

.token-target-cell img,
.token-target-placeholder {
  width: 40px;
  height: 40px;

  flex: 0 0 40px;

  border-radius: 10px;
}

.token-target-cell img {
  object-fit: contain;

  background: rgba(255, 255, 255, 0.06);
}

.token-target-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(18, 181, 255, 0.12);

  color: #12b5ff;

  font-weight: 900;
}

.token-target-cell strong {
  display: block;

  margin-bottom: 3px;

  color: #fff;
}

.token-status-badge {
  display: inline-flex;

  padding: 6px 9px;

  border-radius: 999px;

  font-size: 11px;
  font-weight: 900;

  text-transform: uppercase;
}

.token-status-badge.active {
  background: rgba(67, 209, 122, 0.12);
  color: #43d17a;
}

.token-status-badge.expired {
  background: rgba(255, 176, 32, 0.12);
  color: #ffb020;
}

.token-status-badge.revoked {
  background: rgba(255, 95, 109, 0.12);
  color: #ff5f6d;
}

.token-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.token-action-button {
  min-height: 34px;

  padding: 0 10px;

  border:
    1px solid rgba(255, 255, 255, 0.09);

  border-radius: 9px;

  background:
    rgba(255, 255, 255, 0.06);

  color: #fff;

  font-size: 11px;
  font-weight: 800;

  cursor: pointer;
}

.token-action-button.success {
  color: #43d17a;
}

.token-action-button.warning {
  color: #ffb020;
}

.token-action-button.danger {
  color: #ff5f6d;
}

.token-access-empty {
  padding: 50px !important;

  text-align: center !important;

  color:
    rgba(255, 255, 255, 0.5) !important;
}


/* =========================================================
   TOKEN EDIT MODAL
========================================================= */

.token-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 22px;

  background:
    rgba(0, 0, 0, 0.72);

  backdrop-filter:
    blur(8px);
}

.token-modal-overlay[hidden] {
  display: none;
}

.token-modal {
  width: min(620px, 100%);

  border:
    1px solid rgba(255, 255, 255, 0.1);

  border-radius: 20px;

  background: #0e1523;

  box-shadow:
    0 30px 100px
    rgba(0, 0, 0, 0.55);

  overflow: hidden;
}

.token-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 20px;

  border-bottom:
    1px solid rgba(255, 255, 255, 0.08);
}

.token-modal-head h2 {
  margin: 0 0 5px;

  color: #fff;
}

.token-modal-head p {
  margin: 0;

  color: rgba(255, 255, 255, 0.5);

  font-size: 12px;
}

.token-modal-head button {
  width: 38px;
  height: 38px;

  border: 0;
  border-radius: 10px;

  background:
    rgba(255, 255, 255, 0.07);

  color: #fff;

  font-size: 22px;

  cursor: pointer;
}

.token-modal-body {
  padding: 20px;
}

.token-edit-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 15px;
}

.token-edit-field {
  display: grid;
  gap: 7px;
}

.token-edit-field label {
  color: #fff;

  font-size: 12px;
  font-weight: 800;
}

.token-edit-field input,
.token-edit-field select {
  width: 100%;
  min-height: 44px;

  padding: 0 12px;

  border:
    1px solid rgba(255, 255, 255, 0.1);

  border-radius: 10px;

  background: #09101c;

  color: #fff;

  outline: none;
}

.token-edit-field small {
  color: rgba(255, 255, 255, 0.45);
}

.token-modal-error {
  margin-top: 16px;

  padding: 12px 14px;

  border:
    1px solid rgba(255, 95, 109, 0.25);

  border-radius: 10px;

  background:
    rgba(255, 95, 109, 0.08);

  color: #ff8d97;
}

.token-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;

  padding: 18px 20px;

  border-top:
    1px solid rgba(255, 255, 255, 0.08);
}

.token-modal-footer button {
  min-height: 42px;

  padding: 0 16px;

  border: 0;
  border-radius: 10px;

  cursor: pointer;
}

#cancelTokenEditModal {
  background:
    rgba(255, 255, 255, 0.07);

  color: #fff;
}

#saveTokenEditButton {
  background: #12b5ff;

  color: #031019;

  font-weight: 900;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1000px) {
  .token-access-stats {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .token-access-filters {
    grid-template-columns:
      1fr 1fr;
  }
}

@media (max-width: 640px) {
  .token-access-stats,
  .token-access-filters,
  .token-edit-grid {
    grid-template-columns: 1fr;
  }

  .token-access-hero {
    padding: 20px;
  }
}

/* ============================================================
   LOADING BUTTON
============================================================ */

.btn.is-loading {
    cursor: wait;
    opacity: 0.78;
}


/* ============================================================
   PAGINATION
============================================================ */

.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding-top: 18px;
    margin-top: 18px;

    border-top:
        1px solid rgba(255, 255, 255, 0.08);
}

.pagination-info {
    font-size: 12px;
    opacity: 0.72;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 9px;
}


/* ============================================================
   EMPTY STATE
============================================================ */

.api-access-list-panel .empty-state {
    min-height: 320px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 40px 20px;

    text-align: center;
}

.api-access-list-panel .empty-state-icon {
    width: 64px;
    height: 64px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 16px;

    border-radius: 18px;

    background:
        rgba(18, 181, 255, 0.09);

    border:
        1px solid rgba(18, 181, 255, 0.17);
}

.api-access-list-panel .empty-state-icon i {
    font-size: 24px;
}

.api-access-list-panel .empty-state h3 {
    margin: 0 0 7px;
}

.api-access-list-panel .empty-state p {
    max-width: 440px;

    margin: 0 0 18px;

    font-size: 13px;
    line-height: 1.6;

    opacity: 0.68;
}


/* ============================================================
   RESPONSIVE - LARGE LAPTOP
============================================================ */

@media (max-width: 1400px) {
    .api-access-stats {
        grid-template-columns:
            repeat(3,
                minmax(0, 1fr));
    }

    .api-access-filter-panel .filter-grid {
        grid-template-columns:
            minmax(220px, 2fr) minmax(150px, 1fr) minmax(120px, 0.7fr);
    }

    .api-access-filter-panel .filter-actions {
        grid-column: 1 / -1;
    }
}


/* ============================================================
   RESPONSIVE - TABLET / SMALL LAPTOP
============================================================ */

@media (max-width: 1100px) {
    .api-client-detail-stats {
        grid-template-columns:
            repeat(2,
                minmax(0, 1fr));
    }

    .api-client-form .form-grid,
    .api-detail-grid,
    .api-credential-grid,
    .api-guidance-grid,
    .api-limit-detail-grid,
    .api-client-action-grid,
    .api-ip-list {
        grid-template-columns:
            1fr;
    }

    .api-detail-item-full {
        grid-column: auto;
    }
}


/* ============================================================
   RESPONSIVE - TABLET
============================================================ */

@media (max-width: 820px) {
    .api-access-stats {
        grid-template-columns:
            repeat(2,
                minmax(0, 1fr));
    }

    .api-access-filter-panel .filter-grid {
        grid-template-columns:
            1fr;
    }

    .api-access-filter-panel .filter-actions {
        grid-column: auto;
    }

    .api-large-credential-box,
    .api-secret-box,
    .api-secret-unavailable-card {
        align-items: stretch;
        flex-direction: column;
    }

    .api-large-credential-box>.btn,
    .api-secret-box>.btn,
    .api-secret-unavailable-card>.btn,
    .api-secret-unavailable-card>form {
        width: 100%;
    }

    .api-secret-unavailable-card>form .btn {
        width: 100%;
    }

    .pagination-wrap {
        align-items: stretch;
        flex-direction: column;
    }

    .pagination {
        justify-content: space-between;
    }
}


/* ============================================================
   RESPONSIVE - MOBILE
============================================================ */

@media (max-width: 600px) {

    .api-access-stats,
    .api-client-detail-stats {
        grid-template-columns:
            1fr;
    }

    .api-form-panel .panel-header,
    .api-detail-panel .panel-header,
    .api-credentials-panel .panel-header,
    .api-secret-panel .panel-header {
        align-items: flex-start;
    }

    .panel-header-icon {
        display: none;
    }

    .setting-toggle-card {
        align-items: flex-start;
    }

    .setting-toggle-content {
        align-items: flex-start;
    }

    .api-secret-warning,
    .api-credential-warning {
        flex-direction: column;
    }

    .api-copy-all-actions,
    .panel-form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .api-copy-all-actions .btn,
    .panel-form-footer .btn {
        width: 100%;
    }

    .api-credentials-actions-panel .panel-form-footer {
        align-items: stretch;
    }

    .api-toast {
        right: 16px;
        left: 16px;
        bottom: 16px;

        max-width: none;
    }

    .modal-backdrop {
        padding: 12px;
    }

    .modal-footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .api-form-actions-panel {
        bottom: 6px;
    }
}

/* ============================================================
   API ACCESS INDEX - FIXED TABLE AND ACTIONS
============================================================ */

.api-client-table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}

.api-client-table {
    width: 100%;
    min-width: 1450px;
    border-collapse: collapse;
}

.api-client-table th {
    white-space: nowrap;
}

.api-client-table td {
    vertical-align: middle;
}


/* ============================================================
   CLIENT AVATAR
============================================================ */

.api-client-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        rgba(18, 181, 255, 0.12);

    border:
        1px solid rgba(18, 181, 255, 0.3);

    color:
        #12b5ff;

    font-size: 15px;
    font-weight: 800;
}


/* ============================================================
   PUBLIC ID ROW
============================================================ */

.api-public-id-row {
    display: flex;
    align-items: center;
    gap: 7px;

    min-width: 0;
    max-width: 240px;
}

.api-client-public-id {
    flex: 1;
    min-width: 0;

    display: block;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ============================================================
   SMALL COPY ICON
============================================================ */

.api-copy-icon-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border-radius: 7px;

    border:
        1px solid rgba(255, 255, 255, 0.1);

    background:
        rgba(255, 255, 255, 0.045);

    color:
        #aebbd0;

    cursor: pointer;

    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        transform 0.16s ease;
}

.api-copy-icon-btn:hover {
    color:
        #ffffff;

    background:
        rgba(18, 181, 255, 0.12);

    border-color:
        rgba(18, 181, 255, 0.35);

    transform:
        translateY(-1px);
}

.api-copy-icon-btn i {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
}


/* ============================================================
   CLIENT KEY CELL
============================================================ */

.api-key-cell {
    display: flex;
    align-items: center;
    gap: 8px;

    width: 100%;
    min-width: 300px;
    max-width: 390px;

    padding: 7px 8px 7px 12px;

    border-radius: 10px;

    border:
        1px solid rgba(255, 255, 255, 0.1);

    background:
        rgba(255, 255, 255, 0.025);
}

.api-key-text {
    flex: 1;
    min-width: 0;

    display: block;

    color:
        #b9c5d8;

    font-family:
        Consolas,
        "Courier New",
        monospace;

    font-size: 11px;
    line-height: 1.4;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ============================================================
   VISIBLE COPY BUTTON
============================================================ */

.api-copy-button {
    min-width: 68px;
    height: 32px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 0 10px;

    border-radius: 8px;

    border:
        1px solid rgba(18, 181, 255, 0.25);

    background:
        rgba(18, 181, 255, 0.1);

    color:
        #7dd8ff;

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        transform 0.16s ease;
}

.api-copy-button:hover {
    color:
        #ffffff;

    background:
        rgba(18, 181, 255, 0.2);

    border-color:
        rgba(18, 181, 255, 0.48);

    transform:
        translateY(-1px);
}

.api-copy-button i {
    display: inline-block;
    font-size: 11px;
    line-height: 1;
}


/* ============================================================
   STATUS DOT
============================================================ */

.status-dot {
    width: 6px;
    height: 6px;

    display: inline-block;

    border-radius: 50%;

    background:
        currentColor;
}


/* ============================================================
   ROW ACTIONS
============================================================ */

.table-actions-column {
    min-width: 350px;
    width: 350px;
    text-align: left;
}

.api-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;

    min-width: 330px;
}


/* ============================================================
   ACTION BUTTON BASE
============================================================ */

.api-action-button {
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 0 11px;

    border-radius: 8px;

    border:
        1px solid rgba(255, 255, 255, 0.1);

    background:
        rgba(255, 255, 255, 0.045);

    color:
        #c7d2e3;

    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;

    white-space: nowrap;
    text-decoration: none;

    cursor: pointer;

    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        transform 0.16s ease;
}

.api-action-button:hover {
    color:
        #ffffff;

    transform:
        translateY(-1px);
}

.api-action-button i {
    display: inline-block;

    font-size: 11px;
    line-height: 1;
}


/* ============================================================
   VIEW
============================================================ */

.api-action-view {
    color:
        #75d6ff;

    background:
        rgba(18, 181, 255, 0.09);

    border-color:
        rgba(18, 181, 255, 0.22);
}

.api-action-view:hover {
    background:
        rgba(18, 181, 255, 0.18);

    border-color:
        rgba(18, 181, 255, 0.42);
}


/* ============================================================
   EDIT
============================================================ */

.api-action-edit {
    color:
        #c4b5fd;

    background:
        rgba(139, 92, 246, 0.09);

    border-color:
        rgba(139, 92, 246, 0.22);
}

.api-action-edit:hover {
    background:
        rgba(139, 92, 246, 0.18);

    border-color:
        rgba(139, 92, 246, 0.42);
}


/* ============================================================
   ENABLE
============================================================ */

.api-action-enable {
    color:
        #86efac;

    background:
        rgba(34, 197, 94, 0.09);

    border-color:
        rgba(34, 197, 94, 0.22);
}

.api-action-enable:hover {
    background:
        rgba(34, 197, 94, 0.18);

    border-color:
        rgba(34, 197, 94, 0.42);
}


/* ============================================================
   DISABLE
============================================================ */

.api-action-disable {
    color:
        #fbbf24;

    background:
        rgba(245, 158, 11, 0.09);

    border-color:
        rgba(245, 158, 11, 0.22);
}

.api-action-disable:hover {
    background:
        rgba(245, 158, 11, 0.18);

    border-color:
        rgba(245, 158, 11, 0.42);
}


/* ============================================================
   TOGGLE FORM
============================================================ */

.api-toggle-form {
    display: inline-flex;
    align-items: center;

    margin: 0;
    padding: 0;
}


/* ============================================================
   MORE BUTTON
============================================================ */

.api-more-button {
    width: 34px;
    height: 34px;
    min-width: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border-radius: 8px;

    border:
        1px solid rgba(255, 255, 255, 0.1);

    background:
        rgba(255, 255, 255, 0.045);

    color:
        #aebbd0;

    cursor: pointer;

    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease;
}

.api-more-button:hover {
    color:
        #ffffff;

    background:
        rgba(255, 255, 255, 0.09);

    border-color:
        rgba(255, 255, 255, 0.18);
}

.api-more-button i {
    display: inline-block;

    font-size: 13px;
    line-height: 1;
}


/* ============================================================
   ACTION MENU FIX
============================================================ */

.api-row-actions .action-menu {
    position: relative;

    display: inline-flex;
    align-items: center;
}

.api-row-actions .action-menu-dropdown {
    position: absolute;

    top:
        calc(100% + 8px);

    right: 0;

    z-index: 500;

    min-width: 220px;

    padding: 7px;

    border-radius: 12px;

    background:
        #111a2a;

    border:
        1px solid rgba(255, 255, 255, 0.12);

    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transform:
        translateY(-5px);

    transition:
        opacity 0.16s ease,
        visibility 0.16s ease,
        transform 0.16s ease;
}

.api-row-actions .action-menu.is-open .action-menu-dropdown {
    opacity: 1;
    visibility: visible;

    pointer-events: auto;

    transform:
        translateY(0);
}


/* ============================================================
   ACTION MENU LINKS AND BUTTONS
============================================================ */

.api-row-actions .action-menu-item {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 11px;

    border: 0;
    border-radius: 8px;

    background:
        transparent;

    color:
        #c8d3e4;

    font-family:
        inherit;

    font-size:
        12px;

    font-weight:
        600;

    line-height:
        1.3;

    text-align:
        left;

    text-decoration:
        none;

    cursor:
        pointer;
}

.api-row-actions .action-menu-item:hover {
    color:
        #ffffff;

    background:
        rgba(255, 255, 255, 0.07);
}

.api-row-actions .action-menu-item i {
    width:
        16px;

    text-align:
        center;
}

.api-row-actions .action-menu-item.danger {
    color:
        #f87171;
}

.api-row-actions .action-menu-item.danger:hover {
    background:
        rgba(239, 68, 68, 0.1);
}


/* ============================================================
   DATE VALUES
============================================================ */

.api-date-value {
    display: block;

    max-width: 160px;

    font-size: 11px;
    line-height: 1.45;

    white-space: normal;
}


/* ============================================================
   MODAL CLOSE FIX
============================================================ */

.api-modal-close {
    width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border-radius: 8px;

    border:
        1px solid rgba(255, 255, 255, 0.1);

    background:
        rgba(255, 255, 255, 0.04);

    color:
        #c8d3e4;

    cursor:
        pointer;
}

.api-modal-close:hover {
    color:
        #ffffff;

    background:
        rgba(255, 255, 255, 0.09);
}


/* ============================================================
   COPY SUCCESS
============================================================ */

.api-copy-button.copy-success,
.api-copy-icon-btn.copy-success {
    color:
        #86efac;

    background:
        rgba(34, 197, 94, 0.13);

    border-color:
        rgba(34, 197, 94, 0.3);
}


/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 1500px) {
    .api-client-table {
        min-width:
            1380px;
    }

    .table-actions-column {
        min-width:
            320px;

        width:
            320px;
    }

    .api-row-actions {
        min-width:
            300px;
    }

    .api-action-button {
        padding:
            0 9px;
    }
}


@media (max-width: 900px) {
    .api-client-table {
        min-width:
            1300px;
    }
}

/* ============================================================
   API CHANNEL PICKER
============================================================ */

.channel-picker-card {
    overflow: hidden;
}


/* ============================================================
   HEADER
============================================================ */

.channel-picker-header {
    align-items: flex-start;
    gap: 20px;
}

.channel-picker-summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;

    gap: 8px;
}

.channel-summary-pill {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    min-height: 34px;

    padding: 6px 11px;

    border:
        1px solid rgba(255, 255, 255, 0.09);

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.045);

    color:
        rgba(255, 255, 255, 0.65);

    font-size: 12px;
    font-weight: 600;

    white-space: nowrap;
}

.channel-summary-pill i {
    color:
        rgba(255, 255, 255, 0.48);

    font-size: 11px;
}

.channel-summary-pill strong {
    color: #ffffff;

    font-size: 13px;
}

.playlist-count-pill {
    border-color:
        rgba(66, 211, 146, 0.18);

    background:
        rgba(66, 211, 146, 0.07);
}


/* ============================================================
   FILTERS
============================================================ */

.channel-picker-filters {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 16px;
}


/* ============================================================
   SEARCH
============================================================ */

.channel-search-wrap {
    position: relative;
}

.channel-search-wrap>i {
    position: absolute;

    top: 50%;
    left: 14px;

    z-index: 2;

    transform:
        translateY(-50%);

    color:
        rgba(255, 255, 255, 0.36);

    font-size: 13px;

    pointer-events: none;
}

.channel-search-wrap .form-control {
    padding-left: 40px;
    padding-right: 40px;
}

.channel-search-clear {
    position: absolute;

    top: 50%;
    right: 9px;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    padding: 0;

    border: 0;
    border-radius: 7px;

    transform:
        translateY(-50%);

    background: transparent;

    color:
        rgba(255, 255, 255, 0.42);

    cursor: pointer;

    transition:
        color 0.18s ease,
        background 0.18s ease;
}

.channel-search-clear:hover {
    color: #ffffff;

    background:
        rgba(255, 255, 255, 0.07);
}

.channel-search-clear[hidden] {
    display: none !important;
}


/* ============================================================
   ACTIVE SOURCE BAR
============================================================ */

.active-source-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    min-height: 70px;

    margin-bottom: 14px;

    padding: 12px 14px;

    border:
        1px solid rgba(255, 255, 255, 0.08);

    border-radius: 12px;

    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.038),
            rgba(255, 255, 255, 0.018));
}

.active-source-info {
    display: flex;
    align-items: center;

    min-width: 0;

    gap: 11px;
}

.active-source-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 40px;
    height: 40px;

    border:
        1px solid rgba(18, 181, 255, 0.16);

    border-radius: 10px;

    background:
        rgba(18, 181, 255, 0.08);

    color: #58caff;

    font-size: 14px;
}

.active-source-info>div {
    min-width: 0;
}

.active-source-info strong {
    display: block;

    overflow: hidden;

    color:
        rgba(255, 255, 255, 0.92);

    font-size: 13px;
    font-weight: 750;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-source-info span:not(.active-source-icon) {
    display: block;

    margin-top: 3px;

    color:
        rgba(255, 255, 255, 0.45);

    font-size: 11px;
    line-height: 1.4;
}


/* ============================================================
   FULL PLAYLIST ACCESS CONTROL
============================================================ */

.full-playlist-control {
    display: flex;
    align-items: center;

    flex: 0 0 auto;

    gap: 10px;

    min-width: 260px;

    padding: 9px 11px;

    border:
        1px solid rgba(66, 211, 146, 0.17);

    border-radius: 10px;

    background:
        rgba(66, 211, 146, 0.055);

    cursor: pointer;

    transition:
        border-color 0.18s ease,
        background 0.18s ease;
}

.full-playlist-control:hover {
    border-color:
        rgba(66, 211, 146, 0.3);

    background:
        rgba(66, 211, 146, 0.085);
}

.full-playlist-control[hidden] {
    display: none !important;
}

.full-playlist-control>input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;

    pointer-events: none;
}

.full-playlist-switch {
    position: relative;

    flex: 0 0 auto;

    width: 36px;
    height: 20px;

    border:
        1px solid rgba(255, 255, 255, 0.16);

    border-radius: 999px;

    background:
        rgba(255, 255, 255, 0.08);

    transition:
        background 0.18s ease,
        border-color 0.18s ease;
}

.full-playlist-switch-dot {
    position: absolute;

    top: 3px;
    left: 3px;

    width: 12px;
    height: 12px;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.62);

    transition:
        transform 0.18s ease,
        background 0.18s ease;
}

.full-playlist-control input:checked+.full-playlist-switch {
    border-color:
        rgba(66, 211, 146, 0.55);

    background:
        rgba(66, 211, 146, 0.28);
}

.full-playlist-control input:checked+.full-playlist-switch .full-playlist-switch-dot {
    transform:
        translateX(16px);

    background: #63e6aa;
}

.full-playlist-control-text {
    min-width: 0;
}

.full-playlist-control-text strong {
    display: block;

    color:
        rgba(255, 255, 255, 0.88);

    font-size: 11px;
    font-weight: 750;
}

.full-playlist-control-text small {
    display: block;

    margin-top: 2px;

    color:
        rgba(255, 255, 255, 0.42);

    font-size: 10px;
}


/* ============================================================
   TOOLBAR
============================================================ */

.channel-picker-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 12px;

    padding: 9px 10px;

    border:
        1px solid rgba(255, 255, 255, 0.07);

    border-radius: 10px;

    background:
        rgba(0, 0, 0, 0.13);
}

.channel-picker-toolbar-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;
}

.channel-picker-toolbar-right {
    display: flex;
    align-items: center;

    flex: 0 0 auto;
}

.toolbar-divider {
    width: 1px;
    height: 24px;

    margin: 0 2px;

    background:
        rgba(255, 255, 255, 0.09);
}

.picker-result-count {
    color:
        rgba(255, 255, 255, 0.43);

    font-size: 11px;

    white-space: nowrap;
}

.picker-result-count strong {
    color:
        rgba(255, 255, 255, 0.86);
}


/* ============================================================
   MASTER SELECT
============================================================ */

.master-select-control {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    min-height: 32px;

    padding: 5px 8px;

    border-radius: 8px;

    color:
        rgba(255, 255, 255, 0.72);

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.18s ease,
        color 0.18s ease;
}

.master-select-control:hover {
    color: #ffffff;

    background:
        rgba(255, 255, 255, 0.05);
}

.master-select-control input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;

    pointer-events: none;
}

.master-custom-check {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 19px;
    height: 19px;

    border:
        1px solid rgba(255, 255, 255, 0.23);

    border-radius: 5px;

    background:
        rgba(0, 0, 0, 0.18);

    color: transparent;

    font-size: 9px;

    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

.master-select-control input:checked+.master-custom-check {
    border-color: #12b5ff;

    background: #12b5ff;

    color: #041019;
}

.master-select-control input:indeterminate+.master-custom-check {
    border-color: #12b5ff;

    background:
        rgba(18, 181, 255, 0.2);

    color: #12b5ff;
}


/* ============================================================
   CHANNEL LIST
============================================================ */

.channel-access-list {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 8px;

    max-height: 610px;

    padding:
        3px 5px 3px 3px;

    overflow-y: auto;
    overflow-x: hidden;

    overscroll-behavior: contain;
}

.channel-access-list::-webkit-scrollbar {
    width: 7px;
}

.channel-access-list::-webkit-scrollbar-track {
    background: transparent;
}

.channel-access-list::-webkit-scrollbar-thumb {
    border-radius: 999px;

    background:
        rgba(255, 255, 255, 0.13);
}

.channel-access-list::-webkit-scrollbar-thumb:hover {
    background:
        rgba(255, 255, 255, 0.21);
}


/* ============================================================
   CHANNEL ROW
============================================================ */

.channel-access-row {
    position: relative;

    display: flex;
    align-items: center;

    min-width: 0;
    min-height: 76px;

    gap: 11px;

    padding: 10px 11px;

    border:
        1px solid rgba(255, 255, 255, 0.07);

    border-radius: 11px;

    background:
        rgba(255, 255, 255, 0.024);

    cursor: pointer;

    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.channel-access-row:hover {
    border-color:
        rgba(255, 255, 255, 0.14);

    background:
        rgba(255, 255, 255, 0.048);

    transform:
        translateY(-1px);
}

.channel-access-row:has(.channel-access-checkbox:checked) {
    border-color:
        rgba(18, 181, 255, 0.4);

    background:
        linear-gradient(135deg,
            rgba(18, 181, 255, 0.115),
            rgba(18, 181, 255, 0.038));

    box-shadow:
        inset 0 0 0 1px rgba(18, 181, 255, 0.035);
}

.channel-access-row[hidden] {
    display: none !important;
}


/* ============================================================
   ROW CHECKBOX
============================================================ */

.channel-row-check {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 22px;
    height: 22px;
}

.channel-row-check input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;

    pointer-events: none;
}

.channel-custom-check {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 20px;
    height: 20px;

    border:
        1px solid rgba(255, 255, 255, 0.22);

    border-radius: 6px;

    background:
        rgba(0, 0, 0, 0.18);

    color: transparent;

    font-size: 9px;

    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.channel-row-check input:checked+.channel-custom-check {
    border-color: #12b5ff;

    background: #12b5ff;

    color: #041019;

    transform:
        scale(1.04);
}


/* ============================================================
   CHANNEL LOGO
============================================================ */

.channel-row-logo {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 48px;
    height: 48px;

    overflow: hidden;

    border:
        1px solid rgba(255, 255, 255, 0.075);

    border-radius: 10px;

    background:
        rgba(0, 0, 0, 0.2);
}

.channel-row-logo img {
    width: 100%;
    height: 100%;

    padding: 4px;

    object-fit: contain;
}

.channel-row-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    color:
        rgba(255, 255, 255, 0.3);

    font-size: 16px;
}


/* ============================================================
   CHANNEL CONTENT
============================================================ */

.channel-row-content {
    min-width: 0;

    flex: 1;
}

.channel-row-title-line {
    display: flex;
    align-items: center;

    min-width: 0;

    gap: 7px;
}

.channel-row-title {
    min-width: 0;

    flex: 1;

    overflow: hidden;

    color:
        rgba(255, 255, 255, 0.92);

    font-size: 13px;
    font-weight: 720;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-row-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 6px 11px;

    margin-top: 6px;

    color:
        rgba(255, 255, 255, 0.4);

    font-size: 10.5px;
}

.channel-row-meta span {
    display: inline-flex;
    align-items: center;

    min-width: 0;

    gap: 5px;
}

.channel-row-meta i {
    flex: 0 0 auto;

    font-size: 9px;
}


/* ============================================================
   SOURCE BADGES
============================================================ */

.channel-source-badge {
    display: inline-flex;
    align-items: center;

    flex: 0 0 auto;

    max-width: 150px;

    gap: 4px;

    min-height: 21px;

    padding: 3px 7px;

    overflow: hidden;

    border-radius: 999px;

    font-size: 9.5px;
    font-weight: 750;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-source-badge i {
    flex: 0 0 auto;

    font-size: 8px;
}

.channel-source-badge.database {
    color: #78d6ff;

    background:
        rgba(18, 181, 255, 0.12);
}

.channel-source-badge.event {
    color: #ffc46b;

    background:
        rgba(255, 166, 38, 0.13);
}

.channel-source-badge.playlist {
    color: #80e8b8;

    background:
        rgba(49, 205, 137, 0.13);
}


/* ============================================================
   ORIGIN DOT
============================================================ */

.channel-row-side {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 12px;
}

.channel-origin-dot {
    display: block;

    width: 7px;
    height: 7px;

    border-radius: 50%;
}

.channel-origin-dot.database {
    background: #12b5ff;

    box-shadow:
        0 0 8px rgba(18, 181, 255, 0.42);
}

.channel-origin-dot.event {
    background: #ffad3d;

    box-shadow:
        0 0 8px rgba(255, 173, 61, 0.4);
}

.channel-origin-dot.playlist {
    background: #43d895;

    box-shadow:
        0 0 8px rgba(67, 216, 149, 0.4);
}


/* ============================================================
   EMPTY STATE
============================================================ */

.channel-picker-empty {
    grid-column: 1 / -1;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 210px;

    padding: 30px;

    border:
        1px dashed rgba(255, 255, 255, 0.1);

    border-radius: 12px;

    background:
        rgba(255, 255, 255, 0.016);

    text-align: center;
}

.channel-picker-empty[hidden] {
    display: none !important;
}

.channel-picker-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 50px;
    height: 50px;

    margin-bottom: 12px;

    border-radius: 14px;

    background:
        rgba(255, 255, 255, 0.045);

    color:
        rgba(255, 255, 255, 0.24);

    font-size: 20px;
}

.channel-picker-empty h3 {
    margin: 0;

    color:
        rgba(255, 255, 255, 0.76);

    font-size: 14px;
    font-weight: 700;
}

.channel-picker-empty p {
    max-width: 430px;

    margin: 6px 0 0;

    color:
        rgba(255, 255, 255, 0.4);

    font-size: 11.5px;
    line-height: 1.55;
}

.filter-empty {
    margin-top: 4px;
}


/* ============================================================
   SELECTION FOOTER
============================================================ */

.channel-selection-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    margin-top: 13px;

    padding: 10px 12px;

    border:
        1px solid rgba(255, 255, 255, 0.07);

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.022);
}

.selection-footer-info {
    display: flex;
    align-items: center;

    min-width: 0;

    gap: 8px;

    color:
        rgba(255, 255, 255, 0.43);

    font-size: 10.5px;
    line-height: 1.45;
}

.selection-footer-info i {
    flex: 0 0 auto;

    color:
        rgba(18, 181, 255, 0.7);
}

.selection-footer-count {
    flex: 0 0 auto;

    color:
        rgba(255, 255, 255, 0.5);

    font-size: 11px;

    white-space: nowrap;
}

.selection-footer-count strong {
    color: #ffffff;

    font-size: 12px;
}


/* ============================================================
   FOCUS ACCESSIBILITY
============================================================ */

.channel-access-row:focus-within {
    outline:
        2px solid rgba(18, 181, 255, 0.25);

    outline-offset: 1px;
}

.master-select-control:focus-within {
    outline:
        2px solid rgba(18, 181, 255, 0.22);

    outline-offset: 1px;
}


/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 1180px) {

    .channel-access-list {
        grid-template-columns:
            minmax(0, 1fr);
    }

}


@media (max-width: 980px) {

    .channel-picker-filters {
        grid-template-columns:
            minmax(0, 1fr);
    }

    .active-source-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .full-playlist-control {
        width: 100%;
        min-width: 0;
    }

}


@media (max-width: 760px) {

    .channel-picker-header {
        flex-direction: column;
    }

    .channel-picker-summary {
        justify-content: flex-start;
    }

    .channel-picker-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .channel-picker-toolbar-right {
        width: 100%;
    }

    .toolbar-divider {
        display: none;
    }

    .channel-selection-footer {
        align-items: flex-start;
        flex-direction: column;
    }

}


@media (max-width: 560px) {

    .channel-picker-summary {
        width: 100%;
    }

    .channel-summary-pill {
        flex: 1 1 auto;

        justify-content: center;
    }

    .channel-access-row {
        gap: 9px;

        padding: 9px;
    }

    .channel-row-logo {
        width: 42px;
        height: 42px;
    }

    .channel-row-title-line {
        align-items: flex-start;
        flex-direction: column;

        gap: 4px;
    }

    .channel-source-badge {
        max-width: 100%;
    }

    .channel-row-side {
        display: none;
    }

    .channel-picker-toolbar-left {
        width: 100%;
    }

}


/* ============================================================
   API ACCESS PICKER + COPY LINKS
============================================================ */
.api-picker-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(200px, 320px);
    gap: 16px;
    margin-bottom: 18px
}

.api-access-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 12px;
    margin-bottom: 14px;
    scrollbar-width: thin
}

.api-access-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    border: 1px solid var(--border-color, #263247);
    background: var(--surface-2, #111827);
    color: var(--text-muted, #9ca3af);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer
}

.api-access-tab:hover,
.api-access-tab.is-active {
    color: var(--text-primary, #fff);
    border-color: var(--primary, #12b5ff);
    background: rgba(18, 181, 255, .12)
}

.api-picker-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid var(--border-color, #263247);
    border-radius: 12px;
    background: var(--surface-2, #111827);
    margin-bottom: 14px
}

.api-select-all-control {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-weight: 600
}

.api-picker-action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.api-selection-count {
    margin-left: auto;
    display: flex;
    align-items: baseline;
    gap: 7px;
    color: var(--text-muted, #9ca3af)
}

.api-selection-count strong {
    font-size: 18px;
    color: var(--text-primary, #fff)
}

.api-channel-picker-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: 560px;
    overflow: auto;
    padding: 4px
}

.api-channel-picker-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color, #263247);
    border-radius: 12px;
    background: var(--surface-2, #111827);
    cursor: pointer;
    transition: .18s ease
}

.api-channel-picker-item:hover {
    border-color: rgba(18, 181, 255, .55);
    transform: translateY(-1px)
}

.api-channel-picker-item[hidden] {
    display: none !important
}

.api-channel-picker-item>input,
.api-playlist-access-card>input {
    position: absolute;
    opacity: 0;
    pointer-events: none
}

.api-channel-check-ui {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border: 1px solid #526079;
    border-radius: 6px;
    display: grid;
    place-items: center;
    color: transparent
}

.api-channel-picker-item>input:checked~.api-channel-check-ui,
.api-playlist-access-card>input:checked~.api-channel-check-ui {
    background: var(--primary, #12b5ff);
    border-color: var(--primary, #12b5ff);
    color: #00131d
}

.api-channel-logo {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, .06);
    display: grid;
    place-items: center
}

.api-channel-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain
}

.api-channel-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px
}

.api-channel-info strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.api-channel-info small {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
    color: var(--text-muted, #9ca3af)
}

.api-full-playlist-access {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--border-color, #263247)
}

.api-full-playlist-heading {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px
}

.api-full-playlist-heading h3 {
    margin: 0 0 4px
}

.api-full-playlist-heading p {
    margin: 0;
    color: var(--text-muted, #9ca3af)
}

.api-playlist-access-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px
}

.api-playlist-access-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border-color, #263247);
    border-radius: 12px;
    background: var(--surface-2, #111827);
    cursor: pointer
}

.api-playlist-access-card:has(input:checked) {
    border-color: var(--primary, #12b5ff);
    background: rgba(18, 181, 255, .08)
}

.api-playlist-access-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(18, 181, 255, .12);
    color: var(--primary, #12b5ff)
}

.api-playlist-access-card>span:nth-of-type(2) {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1
}

.api-playlist-access-card small {
    color: var(--text-muted, #9ca3af)
}

.channel-picker-empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 32px;
    border: 1px dashed var(--border-color, #263247);
    border-radius: 12px;
    color: var(--text-muted, #9ca3af)
}

.api-link-stack {
    display: grid;
    gap: 14px
}

.api-link-card {
    padding: 14px;
    border: 1px solid var(--border-color, #263247);
    border-radius: 12px;
    background: var(--surface-2, #111827)
}

.api-large-credential-value,
.api-detail-code-value {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    line-height: 1.45;
    font-size: 12.5px;
}

.api-link-card .api-detail-label-row,
.api-large-credential-box {
    gap: 12px;
}

.api-action-button.copy-success,
.api-copy-button.copy-success,
.btn.copy-success {
    border-color: rgba(34, 197, 94, 0.45) !important;
    color: #4ade80 !important;
}

.btn-sm {
    padding: 8px 11px;
    font-size: 13px
}

@media(max-width:900px) {

    .api-picker-toolbar,
    .api-channel-picker-list,
    .api-playlist-access-grid {
        grid-template-columns: 1fr
    }

    .api-selection-count {
        margin-left: 0
    }
}

/* ============================================================
   MONITORING - ACTIVE VIEWERS
============================================================ */

.monitoring-page {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}


.monitoring-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;

  padding: 28px;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;

  background:
    radial-gradient(
      circle at 10% 0%,
      rgba(18, 181, 255, 0.16),
      transparent 34%
    ),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.045),
      rgba(255, 255, 255, 0.018)
    );
}


.monitoring-hero-copy {
  min-width: 0;
}


.monitoring-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  margin-bottom: 10px;

  color: #8fdcff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}


.live-pulse-dot {
  width: 8px;
  height: 8px;

  border-radius: 999px;

  background: #27e58a;

  box-shadow:
    0 0 0 5px rgba(39, 229, 138, 0.1);
}


.monitoring-hero h1 {
  margin: 0;

  color: #ffffff;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.08;
}


.monitoring-hero p {
  max-width: 760px;

  margin:
    10px 0 0;

  color: rgba(255, 255, 255, 0.58);
  font-size: 14px;
  line-height: 1.65;
}


.monitoring-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}


.monitoring-btn {
  min-height: 42px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding:
    0 15px;

  border-radius: 11px;

  font: inherit;
  font-size: 13px;
  font-weight: 800;

  cursor: pointer;

  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    opacity 160ms ease;
}


.monitoring-btn:hover {
  transform:
    translateY(-1px);
}


.monitoring-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}


.monitoring-btn-secondary {
  border:
    1px solid rgba(255, 255, 255, 0.1);

  background:
    rgba(255, 255, 255, 0.055);

  color:
    rgba(255, 255, 255, 0.88);
}


.monitoring-btn-danger-soft {
  border:
    1px solid rgba(255, 91, 112, 0.2);

  background:
    rgba(255, 91, 112, 0.09);

  color:
    #ff9eaa;
}


.monitoring-btn.is-loading span {
  animation:
    monitoringSpin 700ms linear infinite;
}


@keyframes monitoringSpin {
  to {
    transform:
      rotate(360deg);
  }
}


/* ============================================================
   STATS
============================================================ */

.viewer-stat-grid {
  display: grid;

  grid-template-columns:
    repeat(5, minmax(0, 1fr));

  gap: 14px;
}


.viewer-stat-card {
  min-width: 0;

  display: flex;
  align-items: center;
  gap: 13px;

  padding: 17px;

  border:
    1px solid rgba(255, 255, 255, 0.075);

  border-radius: 16px;

  background:
    rgba(255, 255, 255, 0.028);
}


.viewer-stat-icon {
  width: 42px;
  height: 42px;

  flex:
    0 0 42px;

  display: grid;
  place-items: center;

  border-radius: 12px;

  background:
    rgba(18, 181, 255, 0.1);

  color:
    #65cfff;

  font-size:
    18px;
}


.viewer-stat-card > div:last-child {
  min-width: 0;

  display: flex;
  flex-direction: column;
  gap: 4px;
}


.viewer-stat-label {
  overflow: hidden;

  color:
    rgba(255, 255, 255, 0.48);

  font-size:
    11px;

  font-weight:
    700;

  letter-spacing:
    0.04em;

  text-overflow:
    ellipsis;

  white-space:
    nowrap;
}


.viewer-stat-value {
  color:
    #ffffff;

  font-size:
    24px;

  line-height:
    1;
}


/* ============================================================
   PANEL
============================================================ */

.monitoring-panel {
  min-width: 0;

  overflow: hidden;

  border:
    1px solid rgba(255, 255, 255, 0.075);

  border-radius:
    18px;

  background:
    rgba(255, 255, 255, 0.022);
}


.monitoring-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  padding:
    20px 22px;

  border-bottom:
    1px solid rgba(255, 255, 255, 0.065);
}


.monitoring-panel-head h2 {
  margin: 0;

  color:
    #ffffff;

  font-size:
    17px;
}


.monitoring-panel-head p {
  margin:
    5px 0 0;

  color:
    rgba(255, 255, 255, 0.44);

  font-size:
    12px;
}


.auto-refresh-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  color:
    rgba(255, 255, 255, 0.52);

  font-size:
    12px;

  white-space:
    nowrap;
}


.auto-refresh-state strong {
  min-width:
    22px;

  color:
    #ffffff;
}


.auto-refresh-dot {
  width:
    7px;

  height:
    7px;

  border-radius:
    999px;

  background:
    #27e58a;

  box-shadow:
    0 0 0 4px rgba(39, 229, 138, 0.09);
}


/* ============================================================
   FILTERS
============================================================ */

.viewer-filter-bar {
  display: grid;

  grid-template-columns:
    minmax(240px, 1fr)
    180px
    190px;

  gap:
    10px;

  padding:
    15px 18px;

  border-bottom:
    1px solid rgba(255, 255, 255, 0.055);
}


.viewer-search-wrap {
  min-width:
    0;

  display:
    flex;

  align-items:
    center;

  gap:
    9px;

  min-height:
    42px;

  padding:
    0 13px;

  border:
    1px solid rgba(255, 255, 255, 0.085);

  border-radius:
    11px;

  background:
    rgba(0, 0, 0, 0.15);
}


.viewer-search-icon {
  color:
    rgba(255, 255, 255, 0.4);
}


.viewer-search-wrap input {
  width:
    100%;

  min-width:
    0;

  border:
    0;

  outline:
    0;

  background:
    transparent;

  color:
    #ffffff;

  font:
    inherit;

  font-size:
    13px;
}


.viewer-search-wrap input::placeholder {
  color:
    rgba(255, 255, 255, 0.3);
}


.viewer-filter-select {
  width:
    100%;

  min-height:
    42px;

  padding:
    0 12px;

  border:
    1px solid rgba(255, 255, 255, 0.085);

  border-radius:
    11px;

  outline:
    0;

  background:
    #111722;

  color:
    rgba(255, 255, 255, 0.82);

  font:
    inherit;

  font-size:
    13px;
}


/* ============================================================
   TABLE
============================================================ */

.viewer-table-wrap {
  width:
    100%;

  overflow-x:
    auto;
}


.viewer-table {
  width:
    100%;

  min-width:
    1320px;

  border-collapse:
    collapse;
}


.viewer-table th {
  padding:
    12px 14px;

  border-bottom:
    1px solid rgba(255, 255, 255, 0.055);

  color:
    rgba(255, 255, 255, 0.4);

  font-size:
    10px;

  font-weight:
    800;

  letter-spacing:
    0.08em;

  text-align:
    left;

  text-transform:
    uppercase;

  white-space:
    nowrap;
}


.viewer-table td {
  padding:
    14px;

  border-bottom:
    1px solid rgba(255, 255, 255, 0.045);

  color:
    rgba(255, 255, 255, 0.7);

  font-size:
    12px;

  vertical-align:
    middle;
}


.viewer-table tbody tr {
  transition:
    background 150ms ease;
}


.viewer-table tbody tr:hover {
  background:
    rgba(255, 255, 255, 0.025);
}


.viewer-live-badge {
  display:
    inline-flex;

  align-items:
    center;

  gap:
    7px;

  padding:
    6px 9px;

  border-radius:
    999px;

  font-size:
    10px;

  font-weight:
    800;

  text-transform:
    capitalize;

  white-space:
    nowrap;
}


.viewer-live-badge > span {
  width:
    6px;

  height:
    6px;

  border-radius:
    999px;
}


.viewer-live-badge.is-online {
  background:
    rgba(39, 229, 138, 0.1);

  color:
    #72f0b2;
}


.viewer-live-badge.is-online > span {
  background:
    #27e58a;

  box-shadow:
    0 0 0 4px rgba(39, 229, 138, 0.08);
}


.viewer-live-badge.is-stale {
  background:
    rgba(255, 184, 77, 0.1);

  color:
    #ffc76f;
}


.viewer-live-badge.is-stale > span {
  background:
    #ffb84d;
}


.viewer-primary-cell {
  min-width:
    0;

  display:
    flex;

  flex-direction:
    column;

  gap:
    4px;
}


.viewer-primary-cell strong,
.viewer-channel-cell strong {
  max-width:
    220px;

  overflow:
    hidden;

  color:
    rgba(255, 255, 255, 0.9);

  font-size:
    12px;

  font-weight:
    750;

  text-overflow:
    ellipsis;

  white-space:
    nowrap;
}


.viewer-primary-cell span,
.viewer-channel-cell span {
  max-width:
    220px;

  overflow:
    hidden;

  color:
    rgba(255, 255, 255, 0.38);

  font-size:
    10px;

  text-overflow:
    ellipsis;

  white-space:
    nowrap;
}


.viewer-channel-cell {
  display:
    flex;

  align-items:
    center;

  gap:
    10px;

  min-width:
    190px;
}


.viewer-channel-cell > div:last-child {
  min-width:
    0;

  display:
    flex;

  flex-direction:
    column;

  gap:
    4px;
}


.viewer-channel-logo {
  width:
    38px;

  height:
    38px;

  flex:
    0 0 38px;

  border-radius:
    10px;

  object-fit:
    cover;

  background:
    rgba(255, 255, 255, 0.05);
}


.viewer-channel-logo-fallback {
  display:
    grid;

  place-items:
    center;

  color:
    rgba(255, 255, 255, 0.48);

  font-size:
    11px;
}


.heartbeat-age {
  white-space:
    nowrap;
}


.viewer-row-action {
  width:
    32px;

  height:
    32px;

  display:
    grid;

  place-items:
    center;

  border:
    1px solid rgba(255, 91, 112, 0.16);

  border-radius:
    9px;

  background:
    rgba(255, 91, 112, 0.07);

  color:
    #ff91a0;

  font-size:
    18px;

  cursor:
    pointer;
}


.viewer-row-action:hover {
  background:
    rgba(255, 91, 112, 0.14);
}


/* ============================================================
   EMPTY
============================================================ */

.viewer-empty-cell {
  padding:
    0 !important;
}


.viewer-empty-state {
  min-height:
    260px;

  display:
    flex;

  flex-direction:
    column;

  align-items:
    center;

  justify-content:
    center;

  padding:
    30px;

  text-align:
    center;
}


.viewer-empty-icon {
  width:
    54px;

  height:
    54px;

  display:
    grid;

  place-items:
    center;

  margin-bottom:
    14px;

  border-radius:
    16px;

  background:
    rgba(18, 181, 255, 0.08);

  color:
    #5bcaff;

  font-size:
    22px;
}


.viewer-empty-state h3 {
  margin:
    0;

  color:
    #ffffff;

  font-size:
    16px;
}


.viewer-empty-state p {
  max-width:
    420px;

  margin:
    7px 0 0;

  color:
    rgba(255, 255, 255, 0.4);

  font-size:
    12px;

  line-height:
    1.6;
}


/* ============================================================
   RESPONSIVE
============================================================ */

@media (
  max-width: 1250px
) {

  .viewer-stat-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

}


@media (
  max-width: 850px
) {

  .monitoring-hero {
    align-items:
      stretch;

    flex-direction:
      column;
  }


  .monitoring-hero-actions {
    width:
      100%;
  }


  .monitoring-btn {
    flex:
      1;
  }


  .viewer-stat-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }


  .viewer-filter-bar {
    grid-template-columns:
      1fr;
  }

}


@media (
  max-width: 560px
) {

  .monitoring-hero {
    padding:
      20px;
  }


  .viewer-stat-grid {
    grid-template-columns:
      1fr;
  }


  .monitoring-panel-head {
    align-items:
      flex-start;

    flex-direction:
      column;
  }

}
/* ============================================================
   LIVE TRAFFIC + ANALYTICS
============================================================ */

.traffic-page {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.traffic-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  padding: 26px;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;

  background:
    linear-gradient(
      135deg,
      rgba(18, 181, 255, 0.10),
      rgba(255, 255, 255, 0.025)
    );
}

.traffic-hero h1 {
  margin: 7px 0 6px;

  font-size: 30px;
  line-height: 1.1;
}

.traffic-hero p {
  margin: 0;

  color: rgba(255, 255, 255, 0.62);
}

.traffic-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;

  color: #12b5ff;
}

.traffic-live-dot {
  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: #20e39a;

  box-shadow:
    0 0 0 5px rgba(32, 227, 154, 0.12);
}

.traffic-btn,
.traffic-select {
  min-height: 42px;

  padding: 0 15px;

  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 11px;

  background: rgba(255, 255, 255, 0.06);

  color: #fff;
}

.traffic-btn {
  cursor: pointer;
}

.traffic-select option {
  color: #111;
}

.traffic-stat-grid {
  display: grid;

  grid-template-columns:
    repeat(6, minmax(0, 1fr));

  gap: 14px;
}

.traffic-stat-card {
  min-width: 0;

  padding: 18px;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;

  background: rgba(255, 255, 255, 0.035);
}

.traffic-stat-card span {
  display: block;

  margin-bottom: 9px;

  color: rgba(255, 255, 255, 0.56);

  font-size: 12px;
}

.traffic-stat-card strong {
  display: block;

  font-size: 23px;

  color: #fff;
}

.traffic-panel {
  min-width: 0;

  padding: 20px;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;

  background: rgba(255, 255, 255, 0.03);
}

.traffic-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  margin-bottom: 18px;
}

.traffic-panel-head h2 {
  margin: 0 0 4px;

  font-size: 17px;
}

.traffic-panel-head p {
  margin: 0;

  color: rgba(255, 255, 255, 0.52);

  font-size: 12px;
}

.traffic-auto {
  color: #20e39a;

  font-size: 12px;
}

.traffic-chart-wrap {
  width: 100%;

  overflow: hidden;
}

.traffic-split {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 18px;
}

.traffic-type-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 12px;
}

.traffic-type-grid > div {
  padding: 15px;

  border-radius: 13px;

  background: rgba(255, 255, 255, 0.04);
}

.traffic-type-grid span {
  display: block;

  margin-bottom: 7px;

  color: rgba(255, 255, 255, 0.55);

  font-size: 12px;
}

.traffic-type-grid strong {
  font-size: 20px;
}

.traffic-table-wrap {
  width: 100%;

  overflow-x: auto;
}

.traffic-table {
  width: 100%;

  border-collapse: collapse;
}

.traffic-table th,
.traffic-table td {
  padding: 12px 11px;

  border-bottom:
    1px solid rgba(255, 255, 255, 0.07);

  text-align: left;

  white-space: nowrap;

  font-size: 12px;
}

.traffic-table th {
  color: rgba(255, 255, 255, 0.52);

  font-weight: 700;
}

.traffic-path {
  max-width: 430px;

  overflow: hidden;

  text-overflow: ellipsis;
}

.traffic-type-badge {
  display: inline-flex;

  padding: 5px 8px;

  border-radius: 7px;

  background: rgba(18, 181, 255, 0.12);

  color: #12b5ff;

  font-size: 10px;
  font-weight: 800;

  text-transform: uppercase;
}

.traffic-status {
  display: inline-flex;

  min-width: 42px;

  justify-content: center;

  padding: 5px 8px;

  border-radius: 7px;

  font-weight: 800;
}

.traffic-status.is-good {
  background: rgba(32, 227, 154, 0.12);

  color: #20e39a;
}

.traffic-status.is-error {
  background: rgba(255, 82, 105, 0.12);

  color: #ff5269;
}

.traffic-ranking-row {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 12px 0;

  border-bottom:
    1px solid rgba(255, 255, 255, 0.07);
}

.traffic-rank {
  display: grid;
  place-items: center;

  width: 30px;
  height: 30px;

  border-radius: 9px;

  background: rgba(18, 181, 255, 0.10);

  color: #12b5ff;

  font-weight: 800;
}

.traffic-ranking-row div {
  min-width: 0;
}

.traffic-ranking-row strong {
  display: block;

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;
}

.traffic-ranking-row div span {
  display: block;

  margin-top: 3px;

  color: rgba(255, 255, 255, 0.50);

  font-size: 11px;
}

@media (max-width: 1250px) {

  .traffic-stat-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 850px) {

  .traffic-split {
    grid-template-columns: 1fr;
  }

  .traffic-stat-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .traffic-hero {
    align-items: flex-start;
    flex-direction: column;
  }

}

@media (max-width: 520px) {

  .traffic-stat-grid {
    grid-template-columns: 1fr;
  }

}

/* ============================================================
   SYSTEM - REQUEST LOGS
============================================================ */

.syslogs-page {
  display: flex;
  flex-direction: column;
  gap: 22px;
}


/* ============================================================
   HERO
============================================================ */

.syslogs-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  padding: 26px;

  border:
    1px solid rgba(255, 255, 255, 0.08);

  border-radius: 20px;

  background:
    linear-gradient(
      135deg,
      rgba(18, 181, 255, 0.10),
      rgba(255, 255, 255, 0.025)
    );
}

.syslogs-eyebrow {
  color: #12b5ff;

  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.12em;
}

.syslogs-hero h1 {
  margin: 7px 0 6px;

  font-size: 30px;
  line-height: 1.1;
}

.syslogs-hero p {
  margin: 0;

  color:
    rgba(255, 255, 255, 0.60);
}

.syslogs-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}


/* ============================================================
   BUTTONS
============================================================ */

.syslogs-btn {
  min-height: 40px;

  padding: 0 14px;

  border:
    1px solid rgba(255, 255, 255, 0.10);

  border-radius: 10px;

  background:
    rgba(255, 255, 255, 0.06);

  color: #fff;

  cursor: pointer;
}

.syslogs-btn:hover {
  background:
    rgba(255, 255, 255, 0.10);
}

.syslogs-btn:disabled {
  opacity: 0.45;

  cursor: not-allowed;
}

.syslogs-btn-danger {
  border-color:
    rgba(255, 82, 105, 0.22);

  background:
    rgba(255, 82, 105, 0.10);

  color: #ff7185;
}


/* ============================================================
   STATS
============================================================ */

.syslogs-stat-grid {
  display: grid;

  grid-template-columns:
    repeat(6, minmax(0, 1fr));

  gap: 14px;
}

.syslogs-stat-card {
  min-width: 0;

  padding: 18px;

  border:
    1px solid rgba(255, 255, 255, 0.08);

  border-radius: 16px;

  background:
    rgba(255, 255, 255, 0.035);
}

.syslogs-stat-card span {
  display: block;

  margin-bottom: 9px;

  color:
    rgba(255, 255, 255, 0.55);

  font-size: 12px;
}

.syslogs-stat-card strong {
  display: block;

  color: #fff;

  font-size: 23px;
}


/* ============================================================
   PANEL
============================================================ */

.syslogs-panel {
  min-width: 0;

  padding: 20px;

  border:
    1px solid rgba(255, 255, 255, 0.08);

  border-radius: 18px;

  background:
    rgba(255, 255, 255, 0.03);
}

.syslogs-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  margin-bottom: 18px;
}

.syslogs-panel-head h2 {
  margin: 0 0 4px;

  font-size: 18px;
}

.syslogs-panel-head p {
  margin: 0;

  color:
    rgba(255, 255, 255, 0.52);

  font-size: 12px;
}

.syslogs-selection-actions {
  display: flex;
  align-items: center;
  gap: 10px;

  color:
    rgba(255, 255, 255, 0.60);

  font-size: 12px;
}


/* ============================================================
   FILTERS
============================================================ */

.syslogs-filters {
  display: grid;

  grid-template-columns:
    minmax(240px, 2fr)
    repeat(4, minmax(120px, 1fr));

  gap: 10px;

  margin-bottom: 18px;
}

.syslogs-filters input,
.syslogs-filters select {
  width: 100%;
  min-height: 42px;

  padding: 0 12px;

  border:
    1px solid rgba(255, 255, 255, 0.10);

  border-radius: 10px;

  outline: none;

  background:
    rgba(255, 255, 255, 0.055);

  color: #fff;
}

.syslogs-filters select option {
  color: #111;
}

.syslogs-filters input:focus,
.syslogs-filters select:focus {
  border-color:
    rgba(18, 181, 255, 0.55);

  box-shadow:
    0 0 0 3px
    rgba(18, 181, 255, 0.08);
}

.syslogs-search {
  position: relative;
}

.syslogs-search span {
  position: absolute;

  top: 50%;
  left: 12px;

  transform:
    translateY(-50%);

  color:
    rgba(255, 255, 255, 0.50);
}

.syslogs-search input {
  padding-left: 36px;
}


/* ============================================================
   TABLE
============================================================ */

.syslogs-table-wrap {
  width: 100%;

  overflow-x: auto;
}

.syslogs-table {
  width: 100%;

  border-collapse: collapse;
}

.syslogs-table th,
.syslogs-table td {
  padding: 12px 10px;

  border-bottom:
    1px solid rgba(255, 255, 255, 0.07);

  text-align: left;

  white-space: nowrap;

  font-size: 12px;
}

.syslogs-table th {
  color:
    rgba(255, 255, 255, 0.50);

  font-weight: 700;
}

.syslogs-check-col {
  width: 36px;
}

.syslogs-empty {
  padding: 40px !important;

  text-align: center !important;

  color:
    rgba(255, 255, 255, 0.50);
}

.syslogs-method {
  display: inline-flex;

  padding: 5px 8px;

  border-radius: 7px;

  background:
    rgba(18, 181, 255, 0.11);

  color: #12b5ff;

  font-size: 10px;
  font-weight: 800;
}

.syslogs-status {
  display: inline-flex;

  min-width: 44px;

  justify-content: center;

  padding: 5px 8px;

  border-radius: 7px;

  font-weight: 800;
}

.syslogs-status.is-2xx {
  background:
    rgba(32, 227, 154, 0.12);

  color: #20e39a;
}

.syslogs-status.is-3xx {
  background:
    rgba(255, 196, 74, 0.12);

  color: #ffc44a;
}

.syslogs-status.is-4xx {
  background:
    rgba(255, 139, 64, 0.12);

  color: #ff8b40;
}

.syslogs-status.is-5xx {
  background:
    rgba(255, 82, 105, 0.12);

  color: #ff5269;
}

.syslogs-path {
  max-width: 420px;

  overflow: hidden;

  text-overflow: ellipsis;
}

.syslogs-primary {
  min-width: 0;
}

.syslogs-primary strong,
.syslogs-primary span {
  display: block;
}

.syslogs-primary strong {
  max-width: 180px;

  overflow: hidden;

  text-overflow: ellipsis;
}

.syslogs-primary span {
  margin-top: 3px;

  color:
    rgba(255, 255, 255, 0.45);

  font-size: 10px;
}

.syslogs-response {
  color: #20e39a;
}

.syslogs-response.is-slow {
  color: #ff8b40;
}

.syslogs-row-actions {
  display: flex;
  gap: 7px;
}

.syslogs-icon-btn {
  display: grid;
  place-items: center;

  width: 32px;
  height: 32px;

  padding: 0;

  border:
    1px solid rgba(255, 255, 255, 0.09);

  border-radius: 8px;

  background:
    rgba(255, 255, 255, 0.05);

  color: #fff;

  cursor: pointer;
}

.syslogs-icon-btn.is-danger {
  color: #ff7185;
}


/* ============================================================
   PAGINATION
============================================================ */

.syslogs-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  padding-top: 18px;

  color:
    rgba(255, 255, 255, 0.55);

  font-size: 12px;
}

.syslogs-pagination-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}


/* ============================================================
   MODAL
============================================================ */

.syslogs-modal[hidden] {
  display: none !important;
}

.syslogs-modal {
  position: fixed;

  inset: 0;

  z-index: 9999;

  display: grid;
  place-items: center;

  padding: 20px;
}

.syslogs-modal-backdrop {
  position: absolute;

  inset: 0;

  background:
    rgba(0, 0, 0, 0.72);

  backdrop-filter:
    blur(5px);
}

.syslogs-modal-card {
  position: relative;

  z-index: 1;

  width:
    min(820px, 100%);

  max-height:
    calc(100vh - 40px);

  overflow-y: auto;

  padding: 22px;

  border:
    1px solid rgba(255, 255, 255, 0.10);

  border-radius: 18px;

  background: #0e1523;

  box-shadow:
    0 30px 90px
    rgba(0, 0, 0, 0.55);
}

.syslogs-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;

  margin-bottom: 18px;
}

.syslogs-modal-head h2 {
  margin: 0 0 4px;
}

.syslogs-modal-head p {
  margin: 0;

  color:
    rgba(255, 255, 255, 0.50);
}

.syslogs-modal-close {
  width: 36px;
  height: 36px;

  border: 0;
  border-radius: 9px;

  background:
    rgba(255, 255, 255, 0.07);

  color: #fff;

  font-size: 22px;

  cursor: pointer;
}

.syslogs-detail-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 12px;
}

.syslogs-detail-item {
  min-width: 0;

  padding: 14px;

  border-radius: 12px;

  background:
    rgba(255, 255, 255, 0.045);
}

.syslogs-detail-item.is-wide {
  grid-column:
    1 / -1;
}

.syslogs-detail-item span {
  display: block;

  margin-bottom: 7px;

  color:
    rgba(255, 255, 255, 0.46);

  font-size: 11px;
}

.syslogs-detail-item strong {
  display: block;

  overflow-wrap: anywhere;

  font-size: 13px;
}

.syslogs-modal-error {
  color: #ff7185;
}

body.syslogs-modal-open {
  overflow: hidden;
}


/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 1250px) {

  .syslogs-stat-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

  .syslogs-filters {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

  .syslogs-search {
    grid-column:
      span 2;
  }

}


@media (max-width: 800px) {

  .syslogs-hero {
    align-items: flex-start;

    flex-direction: column;
  }

  .syslogs-stat-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .syslogs-filters {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .syslogs-search {
    grid-column:
      1 / -1;
  }

  .syslogs-panel-head,
  .syslogs-pagination {
    align-items: flex-start;

    flex-direction: column;
  }

}


@media (max-width: 520px) {

  .syslogs-stat-grid,
  .syslogs-filters,
  .syslogs-detail-grid {
    grid-template-columns: 1fr;
  }

  .syslogs-search,
  .syslogs-detail-item.is-wide {
    grid-column: auto;
  }

}

/* ============================================================
   SECURITY + SETTINGS
============================================================ */

.syssec-page,
.syssettings-page {
  display: flex;
  flex-direction: column;
  gap: 22px;
}


/* HERO */

.syssec-hero,
.syssettings-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  padding: 26px;

  border:
    1px solid rgba(255, 255, 255, 0.08);

  border-radius: 20px;

  background:
    linear-gradient(
      135deg,
      rgba(18, 181, 255, 0.10),
      rgba(255, 255, 255, 0.025)
    );
}

.syssec-eyebrow,
.syssettings-eyebrow {
  color: #12b5ff;

  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.12em;
}

.syssec-hero h1,
.syssettings-hero h1 {
  margin: 7px 0 6px;

  font-size: 30px;
}

.syssec-hero p,
.syssettings-hero p {
  margin: 0;

  color:
    rgba(255, 255, 255, 0.58);
}

.syssec-hero-actions {
  display: flex;
  gap: 10px;
}


/* BUTTONS */

.syssec-btn,
.syssec-small-btn,
.syssettings-save {
  min-height: 40px;

  padding: 0 14px;

  border:
    1px solid rgba(255, 255, 255, 0.10);

  border-radius: 10px;

  background:
    rgba(255, 255, 255, 0.06);

  color: #fff;

  cursor: pointer;
}

.syssec-btn-danger,
.syssec-small-btn.is-danger {
  border-color:
    rgba(255, 82, 105, 0.25);

  background:
    rgba(255, 82, 105, 0.10);

  color: #ff7185;
}

.syssettings-save {
  border-color:
    rgba(18, 181, 255, 0.30);

  background:
    rgba(18, 181, 255, 0.14);

  color: #12b5ff;

  font-weight: 800;
}


/* SECURITY STATS */

.syssec-stat-grid {
  display: grid;

  grid-template-columns:
    repeat(6, minmax(0, 1fr));

  gap: 14px;
}

.syssec-stat-card {
  padding: 18px;

  border:
    1px solid rgba(255, 255, 255, 0.08);

  border-radius: 16px;

  background:
    rgba(255, 255, 255, 0.035);
}

.syssec-stat-card span {
  display: block;

  margin-bottom: 8px;

  color:
    rgba(255, 255, 255, 0.52);

  font-size: 12px;
}

.syssec-stat-card strong {
  font-size: 23px;
}


/* PANELS */

.syssec-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 18px;
}

.syssec-panel,
.syssettings-panel {
  min-width: 0;

  padding: 20px;

  border:
    1px solid rgba(255, 255, 255, 0.08);

  border-radius: 18px;

  background:
    rgba(255, 255, 255, 0.03);
}

.syssec-panel-head,
.syssettings-panel-head {
  margin-bottom: 16px;
}

.syssec-panel-head h2,
.syssettings-panel-head h2 {
  margin: 0 0 4px;

  font-size: 18px;
}

.syssec-panel-head p {
  margin: 0;

  color:
    rgba(255, 255, 255, 0.50);

  font-size: 12px;
}


/* TABLE */

.syssec-table-wrap {
  overflow-x: auto;
}

.syssec-table {
  width: 100%;

  border-collapse: collapse;
}

.syssec-table th,
.syssec-table td {
  padding: 11px 10px;

  border-bottom:
    1px solid rgba(255, 255, 255, 0.07);

  text-align: left;

  white-space: nowrap;

  font-size: 12px;
}

.syssec-table th {
  color:
    rgba(255, 255, 255, 0.48);
}

.syssec-empty {
  padding: 35px !important;

  text-align: center !important;

  color:
    rgba(255, 255, 255, 0.45);
}

.syssec-path {
  max-width: 380px;

  overflow: hidden;

  text-overflow: ellipsis;
}

.syssec-badge,
.syssec-status {
  display: inline-flex;

  padding: 5px 8px;

  border-radius: 7px;

  background:
    rgba(255, 82, 105, 0.11);

  color: #ff7185;

  font-weight: 800;
}


/* SECURITY MODAL */

.syssec-modal[hidden] {
  display: none !important;
}

.syssec-modal {
  position: fixed;

  inset: 0;

  z-index: 9999;

  display: grid;
  place-items: center;

  padding: 20px;
}

.syssec-modal-backdrop {
  position: absolute;

  inset: 0;

  background:
    rgba(0, 0, 0, 0.72);

  backdrop-filter:
    blur(5px);
}

.syssec-modal-card {
  position: relative;

  z-index: 1;

  width:
    min(520px, 100%);

  padding: 22px;

  border:
    1px solid rgba(255, 255, 255, 0.10);

  border-radius: 18px;

  background: #0e1523;
}

.syssec-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 18px;
}

.syssec-modal-head h2 {
  margin: 0;
}

.syssec-modal-head button {
  width: 36px;
  height: 36px;

  border: 0;

  border-radius: 8px;

  background:
    rgba(255, 255, 255, 0.07);

  color: #fff;

  cursor: pointer;
}

#syssecBlockForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#syssecBlockForm label {
  display: flex;
  flex-direction: column;
  gap: 7px;

  color:
    rgba(255, 255, 255, 0.68);

  font-size: 12px;
}

#syssecBlockForm input,
#syssecBlockForm select,
#syssecBlockForm textarea {
  width: 100%;

  padding: 11px 12px;

  border:
    1px solid rgba(255, 255, 255, 0.10);

  border-radius: 10px;

  background:
    rgba(255, 255, 255, 0.055);

  color: #fff;
}

#syssecBlockForm select option {
  color: #111;
}


/* SETTINGS */

#syssettingsForm {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.syssettings-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 12px;
}

.syssettings-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  min-height: 72px;

  padding: 14px;

  border:
    1px solid rgba(255, 255, 255, 0.07);

  border-radius: 12px;

  background:
    rgba(255, 255, 255, 0.025);
}

.syssettings-field label {
  display: block;

  font-size: 13px;
  font-weight: 700;
}

.syssettings-field small {
  display: block;

  margin-top: 4px;

  color:
    rgba(255, 255, 255, 0.38);
}

.syssettings-field > input {
  width: 190px;
  min-height: 40px;

  padding: 0 11px;

  border:
    1px solid rgba(255, 255, 255, 0.10);

  border-radius: 9px;

  background:
    rgba(255, 255, 255, 0.055);

  color: #fff;
}


/* SWITCH */

.syssettings-switch {
  position: relative;

  width: 48px;
  height: 27px;

  flex: 0 0 auto;

  cursor: pointer;
}

.syssettings-switch input {
  position: absolute;

  opacity: 0;
}

.syssettings-switch span {
  position: absolute;

  inset: 0;

  border-radius: 999px;

  background:
    rgba(255, 255, 255, 0.14);

  transition: 0.2s;
}

.syssettings-switch span::after {
  content: "";

  position: absolute;

  top: 4px;
  left: 4px;

  width: 19px;
  height: 19px;

  border-radius: 50%;

  background: #fff;

  transition: 0.2s;
}

.syssettings-switch input:checked + span {
  background: #12b5ff;
}

.syssettings-switch input:checked + span::after {
  transform:
    translateX(21px);
}


/* SETTINGS FOOTER */

.syssettings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  padding: 18px 20px;

  border:
    1px solid rgba(255, 255, 255, 0.08);

  border-radius: 16px;

  background:
    rgba(255, 255, 255, 0.035);
}

#syssettingsStatus {
  color:
    rgba(255, 255, 255, 0.50);
}

#syssettingsStatus.is-changed {
  color: #ffc44a;
}


/* RESPONSIVE */

@media (max-width: 1200px) {

  .syssec-stat-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 900px) {

  .syssec-grid,
  .syssettings-grid {
    grid-template-columns: 1fr;
  }

  .syssec-hero,
  .syssettings-hero {
    align-items: flex-start;
    flex-direction: column;
  }

}

@media (max-width: 600px) {

  .syssec-stat-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .syssettings-field {
    align-items: flex-start;
    flex-direction: column;
  }

  .syssettings-field > input {
    width: 100%;
  }

}

.channel-token-link-section {
  margin-top: 18px;
}

.channel-token-link-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  margin-bottom: 10px;
}

.channel-token-link-head > div {
  min-width: 0;
}

.channel-token-link-head span {
  display: block;

  margin-bottom: 4px;

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;

  opacity: 0.62;
}

.channel-token-link-head small {
  display: block;

  opacity: 0.58;
}

.channel-token-url-box input {
  width: 100%;

  padding: 13px 14px;

  border:
    1px solid
    rgba(
      255,
      255,
      255,
      0.1
    );

  border-radius: 10px;

  background:
    rgba(
      0,
      0,
      0,
      0.24
    );

  color: inherit;

  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;
}

@media (
  max-width: 640px
) {
  .channel-token-link-head {
    align-items: stretch;
    flex-direction: column;
  }

  .channel-token-link-head button {
    width: 100%;
  }
}