:root{
    --bg:#08111f;
    --bg-2:#0d1728;
    --panel:#121d31;
    --panel-2:#18253d;
    --border:#273754;
    --text:#ecf2ff;
    --muted:#a9b7d1;
    --primary:#3b82f6;
    --primary-hover:#2563eb;
    --primary-soft:#1d4ed8;
    --danger:#dc2626;
    --danger-hover:#b91c1c;
    --success:#16a34a;
    --warning:#d97706;
    --shadow:0 18px 50px rgba(0,0,0,.28);
    --shadow-soft:0 10px 30px rgba(0,0,0,.20);
    --radius:16px;
    --radius-sm:10px;
    --shell:1200px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}

body{
    font-family:Inter,Arial,Helvetica,sans-serif;
    color:var(--text);
    background:
        radial-gradient(circle at top right, rgba(59,130,246,.10), transparent 30%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    min-height:100vh;
}

a{color:#a9cbff;text-decoration:none}
a:hover{text-decoration:underline}

img,video{max-width:100%;display:block}

.shell{
    width:min(calc(100% - 32px), var(--shell));
    margin:0 auto;
}

/* HEADER */

.site-header{
    position:sticky;
    top:0;
    z-index:30;
    backdrop-filter:blur(16px);
    background:linear-gradient(180deg, rgba(8,17,31,.92), rgba(8,17,31,.80));
    border-bottom:1px solid rgba(61,90,136,.35);
    box-shadow:0 8px 24px rgba(0,0,0,.18);
}

.header-inner{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    min-height:82px;
    padding:12px 0;
}

.brand{
    display:flex;
    align-items:center;
    gap:12px;
    color:#fff;
    text-decoration:none;
    min-width:0;
}

.brand:hover{
    text-decoration:none;
}

.brand-logo-wrap{
    width:44px;
    height:44px;
    min-width:44px;
    min-height:44px;
    border-radius:12px;
    display:grid;
    place-items:center;
    background:linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
    border:1px solid rgba(255,255,255,.12);
    box-shadow:var(--shadow-soft);
    overflow:hidden;
}

.brand-logo{
    width:26px;
    height:26px;
    max-width:26px;
    max-height:26px;
    display:block;
    object-fit:contain;
}

.brand-text{
    display:flex;
    flex-direction:column;
    gap:2px;
    line-height:1.05;
}

.brand-title{
    font-size:1rem;
    font-weight:800;
    letter-spacing:.02em;
    color:#fff;
}

.brand-subtitle{
    font-size:.78rem;
    color:#b9c9e6;
    font-weight:600;
    letter-spacing:.02em;
}

.nav{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}

.nav-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:40px;
    padding:10px 14px;
    border-radius:12px;
    border:1px solid rgba(255,255,255,.08);
    background:rgba(255,255,255,.04);
    color:var(--text);
    font-weight:700;
    line-height:1;
    text-decoration:none;
    transition:all .18s ease;
    box-shadow:0 6px 16px rgba(0,0,0,.12);
}

.nav-btn:hover{
    text-decoration:none;
    transform:translateY(-1px);
    background:rgba(255,255,255,.08);
    border-color:rgba(255,255,255,.14);
}

.nav-btn-primary{
    background:linear-gradient(180deg, var(--primary), var(--primary-soft));
    color:#fff;
    border-color:rgba(255,255,255,.10);
    box-shadow:0 10px 24px rgba(37,99,235,.28);
}

.nav-btn-primary:hover{
    background:linear-gradient(180deg, #4a8cff, var(--primary));
    color:#fff;
}

.nav-btn-admin{
    background:rgba(59,130,246,.14);
    border-color:rgba(59,130,246,.26);
    color:#dbeafe;
}

.nav-btn-admin:hover{
    background:rgba(59,130,246,.22);
}

.nav-btn-danger{
    background:rgba(220,38,38,.12);
    border-color:rgba(220,38,38,.22);
    color:#fecaca;
}

.nav-btn-danger:hover{
    background:rgba(220,38,38,.18);
}

/* MAIN */

.main-shell{
    padding:28px 0 56px;
}

.site-footer{
    border-top:1px solid var(--border);
    color:var(--muted);
    margin-top:36px;
}

.footer-inner{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    min-height:72px;
}

/* CARDS */

.card,
.stat-card{
    background:linear-gradient(180deg, rgba(18,29,49,.98), rgba(16,25,42,.98));
    border:1px solid var(--border);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
}

.card{
    padding:22px;
    margin-bottom:22px;
}

.auth-card{
    max-width:560px;
    margin:30px auto;
}

.form-card{
    max-width:920px;
}

.hero{
    padding:42px;
}

.hero h1{
    margin:10px 0 12px;
    font-size:clamp(2rem, 4vw, 3rem);
    line-height:1.12;
}

.hero p,
.lead{
    color:var(--muted);
    line-height:1.7;
    max-width:900px;
}

.eyebrow{
    display:inline-block;
    padding:6px 10px;
    border-radius:999px;
    background:rgba(59,130,246,.12);
    color:#b9d3ff;
    border:1px solid rgba(59,130,246,.25);
    font-size:.82rem;
    font-weight:700;
    letter-spacing:.03em;
    text-transform:uppercase;
}

.page-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    margin-bottom:20px;
}

.page-head.split{
    align-items:center;
}

.page-head h1{
    margin:8px 0 6px;
    font-size:2rem;
}

.section-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:14px;
}

.stats-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:18px;
    margin-bottom:22px;
}

.stat-card{
    padding:24px;
}

.stat-value{
    font-size:2rem;
    font-weight:800;
    margin-bottom:8px;
}

.stat-label{
    color:var(--muted);
}

.cards-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:18px;
}

.card-link{
    display:block;
    color:inherit;
    transition:transform .16s ease, border-color .16s ease;
}

.card-link:hover{
    text-decoration:none;
    transform:translateY(-2px);
    border-color:#3d5a88;
}

.meta-line{
    color:var(--muted);
    margin-top:10px;
    font-size:.95rem;
}

.form-stack{
    display:grid;
    gap:16px;
}

label{
    display:block;
    margin:0 0 8px;
    font-weight:700;
    color:#e8efff;
}

input,
textarea,
select{
    width:100%;
    border:1px solid var(--border);
    background:var(--panel-2);
    color:var(--text);
    border-radius:12px;
    padding:12px 14px;
    outline:none;
}

input:focus,
textarea:focus,
select:focus{
    border-color:#4e7fd1;
    box-shadow:0 0 0 4px rgba(59,130,246,.12);
}

textarea{
    min-height:120px;
    resize:vertical;
}

.checkbox-row{
    display:flex;
    align-items:center;
    gap:10px;
    font-weight:600;
}

.checkbox-row input{
    width:auto;
    margin:0;
}

/* SETTINGS / TOGGLE */

.setting-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding:16px 18px;
    border:1px solid var(--border);
    border-radius:14px;
    background:rgba(255,255,255,.03);
}

.setting-copy{
    display:flex;
    flex-direction:column;
    gap:6px;
}

.setting-title{
    font-weight:800;
    color:#f3f7ff;
}

.setting-description{
    color:var(--muted);
    line-height:1.5;
    font-size:.95rem;
}

.switch{
    position:relative;
    display:inline-flex;
    align-items:center;
    width:62px;
    height:36px;
    flex-shrink:0;
    cursor:pointer;
}

.switch input{
    position:absolute;
    opacity:0;
    width:0;
    height:0;
}

.switch-slider{
    position:relative;
    width:62px;
    height:36px;
    border-radius:999px;
    background:rgba(255,255,255,.10);
    border:1px solid rgba(255,255,255,.14);
    box-shadow:inset 0 1px 3px rgba(0,0,0,.25);
    transition:all .2s ease;
}

.switch-slider::before{
    content:"";
    position:absolute;
    top:4px;
    left:4px;
    width:26px;
    height:26px;
    border-radius:50%;
    background:linear-gradient(180deg, #ffffff, #dbeafe);
    box-shadow:0 4px 10px rgba(0,0,0,.25);
    transition:transform .2s ease;
}

.switch input:checked + .switch-slider{
    background:linear-gradient(180deg, var(--primary), var(--primary-soft));
    border-color:rgba(59,130,246,.45);
    box-shadow:0 8px 20px rgba(37,99,235,.22);
}

.switch input:checked + .switch-slider::before{
    transform:translateX(26px);
}

.switch input:focus + .switch-slider{
    box-shadow:
        0 0 0 4px rgba(59,130,246,.18),
        inset 0 1px 3px rgba(0,0,0,.25);
}

/* BUTTONS */

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    border:none;
    border-radius:12px;
    padding:12px 16px;
    background:linear-gradient(180deg, var(--primary), var(--primary-soft));
    color:#fff;
    cursor:pointer;
    text-decoration:none;
    font-weight:700;
    transition:background .15s ease, transform .15s ease, box-shadow .15s ease;
    box-shadow:0 10px 24px rgba(37,99,235,.22);
}

.btn:hover{
    text-decoration:none;
    background:linear-gradient(180deg, #4a8cff, var(--primary));
    box-shadow:0 14px 28px rgba(37,99,235,.28);
}

.btn:active{
    transform:translateY(1px);
}

.btn-secondary{
    background:rgba(255,255,255,.03);
    border:1px solid var(--border);
    color:var(--text);
    box-shadow:none;
}

.btn-secondary:hover{
    background:rgba(255,255,255,.06);
}

.btn-danger{
    background:linear-gradient(180deg, var(--danger), #b91c1c);
    box-shadow:0 10px 24px rgba(185,28,28,.22);
}

.btn-danger:hover{
    background:linear-gradient(180deg, #ef4444, var(--danger));
}

.btn-small{
    padding:8px 12px;
    border-radius:10px;
    font-size:.9rem;
}

.actions-row{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:center;
}

.inline-form{
    display:inline-flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
}

.alert{
    border-radius:14px;
    padding:13px 16px;
    margin-bottom:16px;
    border:1px solid transparent;
}

.alert-success{
    background:rgba(22,163,74,.14);
    border-color:rgba(22,163,74,.3);
}

.alert-error{
    background:rgba(220,38,38,.14);
    border-color:rgba(220,38,38,.3);
}

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

.table th,
.table td{
    text-align:left;
    padding:12px 10px;
    border-bottom:1px solid var(--border);
    vertical-align:top;
}

.table th{
    color:#c8d7f4;
    font-weight:700;
}

.empty,
.muted{
    color:var(--muted);
}

.list-stack{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.list-item{
    display:flex;
    justify-content:space-between;
    gap:16px;
    padding:16px;
    border-radius:14px;
    border:1px solid var(--border);
    background:rgba(24,37,61,.9);
    color:inherit;
}

.list-item:hover{
    text-decoration:none;
    border-color:#3d5a88;
}

.breadcrumbs{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    color:var(--muted);
    margin-bottom:8px;
}

.article-card .rich-content{
    line-height:1.75;
}

.article-card .rich-content h1,
.article-card .rich-content h2,
.article-card .rich-content h3{
    margin-top:1.4em;
}

.article-card .rich-content p{
    margin:.9em 0;
}

.article-card .rich-content pre,
.article-card .rich-content code{
    background:#0d1728;
    border-radius:10px;
}

.article-card .rich-content pre{
    padding:12px;
    overflow:auto;
}

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

.media-card{
    border:1px solid var(--border);
    border-radius:16px;
    overflow:hidden;
    background:rgba(24,37,61,.9);
}

.media-card img{
    width:100%;
    aspect-ratio:16/9;
    object-fit:cover;
}

.media-card video{
    width:100%;
    aspect-ratio:16/9;
    background:#000;
}

.media-meta{
    padding:14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.media-name{
    word-break:break-word;
}

.file-placeholder{
    height:180px;
    display:grid;
    place-items:center;
    background:#0d1728;
    color:var(--muted);
}

@media (max-width: 900px){
    .header-inner,
    .page-head,
    .footer-inner{
        flex-direction:column;
        align-items:flex-start;
    }

    .brand{
        width:100%;
    }

    .brand-subtitle{
        display:none;
    }

    .nav{
        width:100%;
    }

    .nav-btn{
        width:auto;
    }

    .table{
        display:block;
        overflow-x:auto;
    }

    .list-item{
        flex-direction:column;
    }

    .media-meta{
        flex-direction:column;
        align-items:flex-start;
    }

    .setting-card{
        align-items:flex-start;
        flex-direction:column;
    }
}