:root {
    --bg: #050b18;
    --bg2: #071426;
    --sidebar: #07101f;
    --panel: rgba(13, 28, 51, .72);
    --panel-hover: rgba(18, 38, 68, .85);
    --border: rgba(130, 160, 210, .16);
    --text: #f5f7ff;
    --muted: #8f9bb3;
    --purple: #7c3aed;
    --purple2: #4f46e5;
    --blue: #2563eb;
    --green: #10b981;
    --orange: #f97316;
    --red: #ef4444;
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at 75% 5%, rgba(79,70,229,.13), transparent 30%),
        radial-gradient(circle at 35% 25%, rgba(14,165,233,.07), transparent 30%),
        var(--bg);
    color: var(--text);
}

body {
    min-height: 100vh;
}

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

button,
input,
select {
    font: inherit;
}

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

/* SIDEBAR */

.sidebar {
    position: fixed;
    width: 250px;
    height: 100vh;
    padding: 28px 18px;
    background: rgba(5, 13, 28, .92);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.brand {
    padding: 4px 12px 35px;
}

.brand-main {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.5px;
}

.brand-main span {
    background: linear-gradient(135deg, #b84cff, #4d7cff);
    -webkit-background-clip: text;
    color: transparent;
}

.brand-sub {
    color: #8b5cf6;
    font-size: 11px;
    letter-spacing: 2px;
    font-weight: 700;
    margin-top: 4px;
}

.nav-label {
    color: #58657c;
    font-size: 10px;
    letter-spacing: 1.6px;
    font-weight: 700;
    margin: 10px 14px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #9da8bb;
    padding: 13px 14px;
    margin-bottom: 5px;
    border-radius: 10px;
    transition: .2s ease;
}

.nav-item:hover {
    color: white;
    background: rgba(255,255,255,.045);
}

.nav-item.active {
    color: white;
    background: linear-gradient(
        90deg,
        rgba(124,58,237,.35),
        rgba(79,70,229,.20)
    );
    border: 1px solid rgba(139,92,246,.25);
}

.nav-icon {
    width: 22px;
    text-align: center;
    font-size: 17px;
}

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

.profile {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,.025);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9333ea, #4f46e5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 10px;
}

/* MAIN */

.main {
    margin-left: 250px;
    width: calc(100% - 250px);
    padding: 34px 40px 60px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.page-title h1 {
    margin: 0;
    font-size: 30px;
    letter-spacing: -.7px;
}

.page-title p {
    color: var(--muted);
    margin: 7px 0 0;
}

.actions {
    display: flex;
    gap: 12px;
}

.btn {
    border: 1px solid var(--border);
    color: white;
    background: rgba(255,255,255,.04);
    padding: 11px 17px;
    border-radius: 10px;
    cursor: pointer;
    transition: .2s;
}

.btn:hover {
    background: rgba(255,255,255,.08);
}

.btn-primary {
    border: none;
    background: linear-gradient(135deg, var(--purple), var(--purple2));
    box-shadow: 0 8px 30px rgba(124,58,237,.20);
}

.btn-danger {
    color: #ff8585;
}

/* STAT CARDS */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat {
    padding: 21px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(
        145deg,
        rgba(14,31,55,.8),
        rgba(8,18,35,.72)
    );
    box-shadow: 0 15px 40px rgba(0,0,0,.12);
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
}

.stat-value {
    font-size: 28px;
    font-weight: 750;
    margin-top: 8px;
}

.stat-note {
    color: #69778e;
    font-size: 12px;
    margin-top: 7px;
}

/* PANELS */

.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    backdrop-filter: blur(12px);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,.15);
}

.panel-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header h2 {
    font-size: 17px;
    margin: 0;
}

.panel-body {
    padding: 22px;
}

/* TABLES */

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

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    color: #6f7e96;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .7px;
    font-weight: 700;
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 16px 12px;
    border-bottom: 1px solid rgba(130,160,210,.09);
    color: #cbd3e1;
    font-size: 13px;
}

tr:last-child td {
    border-bottom: 0;
}

tr:hover td {
    background: rgba(255,255,255,.018);
}

.video-title {
    color: white;
    font-weight: 600;
}

.video-url {
    color: #818cf8;
    font-family: Consolas, monospace;
    font-size: 12px;
}

/* FORMS */

.field {
    margin-bottom: 17px;
}

.field label {
    display: block;
    color: #9aa6bb;
    font-size: 12px;
    margin-bottom: 7px;
}

.input {
    width: 100%;
    background: rgba(2,8,20,.65);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 12px 13px;
    color: white;
    outline: none;
}

.input:focus {
    border-color: rgba(124,58,237,.75);
    box-shadow: 0 0 0 3px rgba(124,58,237,.09);
}

/* STORAGE */

.progress {
    height: 7px;
    background: #121d31;
    border-radius: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, #7c3aed, #2563eb);
}

/* BADGES */

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
}

.badge-admin {
    color: #c4b5fd;
    background: rgba(124,58,237,.15);
}

.badge-uploader {
    color: #7dd3fc;
    background: rgba(14,165,233,.12);
}

.badge-active {
    color: #6ee7b7;
    background: rgba(16,185,129,.12);
}

.badge-disabled {
    color: #fca5a5;
    background: rgba(239,68,68,.12);
}

/* LOGIN */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 410px;
    max-width: calc(100% - 30px);
    padding: 38px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(8,20,39,.82);
    backdrop-filter: blur(18px);
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
}

.login-logo {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 6px;
}

.login-subtitle {
    color: var(--muted);
    margin-bottom: 28px;
}

.flash {
    padding: 12px 14px;
    border-radius: 9px;
    background: rgba(124,58,237,.12);
    border: 1px solid rgba(124,58,237,.25);
    margin-bottom: 18px;
    font-size: 13px;
}

/* RESPONSIVE */

@media (max-width: 1000px) {
    .stats {
        grid-template-columns: repeat(2,1fr);
    }
}

@media (max-width: 760px) {
    .sidebar {
        width: 75px;
        padding: 25px 10px;
    }

    .brand-main {
        font-size: 18px;
    }

    .brand-sub,
    .nav-item span:not(.nav-icon),
    .nav-label,
    .profile .profile-text {
        display: none;
    }

    .main {
        margin-left: 75px;
        width: calc(100% - 75px);
        padding: 25px 18px;
    }

    .stats {
        grid-template-columns: 1fr;
    }
}
