:root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --ink: #17181c;
    --muted: #727782;
    --line: #e4e7ec;
    --dark: #111216;
    --dark-2: #1b1d22;
    --accent: #1268f3;
    --accent-dark: #0f51c0;
    --green: #0f8a4b;
    --green-soft: #e6f6ee;
    --orange: #b86a0b;
    --orange-soft: #fff2dc;
    --red: #b42318;
    --red-soft: #fde7e4;
    --blue-soft: #e8f1ff;
    --gray-soft: #eef0f3;
    --shadow: 0 16px 36px rgba(20, 24, 31, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

code {
    padding: 3px 6px;
    border-radius: 6px;
    background: var(--gray-soft);
    color: #333842;
}

.admin-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: 260px;
    padding: 22px;
    background: var(--dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.brand,
.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--dark);
    font-weight: 800;
    letter-spacing: 0;
}

.brand small {
    display: block;
    color: #a9afba;
    font-size: 12px;
}

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

.sidebar-nav a {
    padding: 11px 12px;
    border-radius: 8px;
    color: #c9ced7;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--dark-2);
    color: #fff;
}

.admin-main {
    min-height: 100vh;
    margin-left: 260px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 32px;
    background: rgba(245, 246, 248, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.topbar h1,
.login-card h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
}

.topbar-actions,
.actions,
.actions-wrap,
.form-actions,
.filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.content {
    padding: 28px 32px 48px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.panel,
.stat-card,
.login-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

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

.narrow-panel {
    max-width: 760px;
}

.panel-heading,
.detail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.panel-heading h2,
.detail-heading h2,
.panel h2 {
    margin: 0;
    font-size: 18px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    padding: 18px;
}

.stat-card span {
    display: block;
    min-height: 42px;
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    display: block;
    font-size: 30px;
    line-height: 1;
}

.split-grid,
.detail-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.compact-list {
    display: grid;
    gap: 10px;
}

.compact-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.compact-list small,
.table-title + small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.button {
    min-height: 38px;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
}

.button-small {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 13px;
}

.button-primary {
    color: #fff;
    background: var(--accent);
}

.button-primary:hover {
    background: var(--accent-dark);
}

.button-light {
    color: var(--ink);
    background: #fff;
    border-color: var(--line);
}

.button-danger {
    color: #fff;
    background: var(--red);
}

.button-success {
    color: #fff;
    background: var(--green);
}

.profile-chip {
    min-height: 38px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-weight: 700;
}

.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
}

.alert-success {
    color: var(--green);
    background: var(--green-soft);
    border-color: #bde7d0;
}

.alert-error {
    color: var(--red);
    background: var(--red-soft);
    border-color: #f5beb7;
}

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

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

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

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

td form {
    margin: 0;
}

.table-title {
    font-weight: 800;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.badge-muted {
    color: #575d68;
    background: var(--gray-soft);
}

.badge-danger-soft {
    color: var(--red);
    background: var(--red-soft);
}

.badge-warning {
    color: var(--orange);
    background: var(--orange-soft);
}

.badge-info {
    color: #0f51c0;
    background: var(--blue-soft);
}

.badge-success {
    color: var(--green);
    background: var(--green-soft);
}

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

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

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

.filters-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    margin-bottom: 22px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbfc;
}

label span {
    display: block;
    margin-bottom: 6px;
    color: #424750;
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d5dae2;
    border-radius: 8px;
    padding: 10px 11px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(18, 104, 243, 0.14);
}

.full-span {
    grid-column: 1 / -1;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check-row input {
    width: auto;
}

.check-row span {
    margin: 0;
}

.upload-box {
    padding: 16px;
    border: 1px dashed #cbd2dc;
    border-radius: 8px;
    background: #fafbfc;
}

.asset-upload-rows {
    display: grid;
    gap: 12px;
}

.asset-upload-row {
    display: grid;
    grid-template-columns: 2fr 1fr 110px 1.4fr auto;
    gap: 10px;
    align-items: end;
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.asset-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    display: grid;
    gap: 10px;
}

.asset-preview {
    min-height: 150px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
}

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

.asset-meta strong,
.asset-meta span,
.asset-meta small {
    display: block;
    overflow-wrap: anywhere;
}

.asset-meta span,
.asset-meta small {
    color: var(--muted);
    font-size: 12px;
}

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

.detail-grid div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fafbfc;
}

.detail-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-grid strong {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.content-block {
    min-height: 74px;
    color: #30343b;
    overflow-wrap: anywhere;
}

.pre-wrap {
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.login-page {
    min-height: 100vh;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(17, 18, 22, 0.94), rgba(17, 18, 22, 0.78)),
        #111216;
}

.login-card {
    width: min(100%, 430px);
    padding: 28px;
}

.login-card .brand-mark {
    background: var(--dark);
    color: #fff;
}

.mobile-menu-button {
    display: none;
}

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

    .wide-form,
    .filters-grid,
    .detail-grid,
    .asset-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .asset-upload-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .mobile-menu-button {
        position: fixed;
        z-index: 30;
        top: 14px;
        left: 14px;
        width: 42px;
        height: 42px;
        border: 1px solid var(--line);
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #fff;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 180ms ease;
    }

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

    .admin-main {
        margin-left: 0;
    }

    .topbar {
        padding: 18px 18px 18px 70px;
        align-items: flex-start;
        flex-direction: column;
    }

    .content {
        padding: 20px 16px 36px;
    }

    .dashboard-grid,
    .split-grid,
    .detail-sections,
    .form-grid,
    .wide-form,
    .filters-grid,
    .detail-grid,
    .asset-grid,
    .asset-upload-row {
        grid-template-columns: 1fr;
    }

    .panel-heading,
    .detail-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .stat-card span {
        min-height: auto;
    }

    .login-page {
        padding: 16px;
    }
}

