:root {
    --bg: #050814;
    --bg-soft: #08111f;
    --panel: #0d1728;
    --panel-soft: #111d31;
    --panel-hover: #17243a;
    --border: #223047;
    --border-soft: #2f405d;
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-2: #64748b;
    --primary: #2f6df6;
    --primary-hover: #4b82ff;
    --cyan: #38bdf8;
    --green: #22c55e;
    --yellow: #f59e0b;
    --red: #ef4444;
    --radius: 18px;
    --shadow: 0 24px 70px rgba(0,0,0,.35);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(47,109,246,.16), transparent 38%),
        radial-gradient(circle at top right, rgba(56,189,248,.10), transparent 34%),
        var(--bg);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
}

a {
    color: inherit;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: rgba(8, 17, 31, .88);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(18px);
    padding: 24px 18px;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    text-decoration: none;
    padding: 10px 10px 22px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    font-weight: 900;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--cyan));
    box-shadow: 0 12px 35px rgba(47,109,246,.32);
}

.brand-name {
    font-size: 18px;
    font-weight: 850;
    letter-spacing: -.02em;
}

.brand-caption {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.nav-group {
    margin-top: 22px;
}

.nav-heading {
    color: var(--muted-2);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 11px;
    font-weight: 800;
    padding: 0 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    padding: 11px 12px;
    color: #cbd5e1;
    border-radius: 13px;
    margin-bottom: 5px;
    font-weight: 650;
}

.nav-item:hover {
    background: var(--panel-hover);
    color: white;
}

.nav-icon {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(255,255,255,.06);
    color: #bfdbfe;
    font-size: 14px;
}

.main {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 106px;
    padding: 24px 34px;
    border-bottom: 1px solid var(--border);
    background: rgba(5, 8, 20, .78);
    backdrop-filter: blur(18px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.breadcrumb {
    color: var(--muted-2);
    font-size: 13px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 6px;
}

.topbar h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: -.04em;
}

.topbar p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
}

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

.search-box input {
    width: 260px;
    background: rgba(15, 23, 42, .9);
    border: 1px solid var(--border);
    color: white;
    border-radius: 999px;
    padding: 12px 15px;
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary);
}

.content {
    padding: 34px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0;
    font-size: 34px;
    letter-spacing: -.04em;
}

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

.grid {
    display: grid;
    gap: 18px;
}

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

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

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

.card {
    background: linear-gradient(180deg, rgba(17, 29, 49, .98), rgba(13, 23, 40, .98));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 15px;
    font-weight: 800;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.card-value {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -.04em;
}

.card-caption {
    color: var(--muted);
    margin-top: 6px;
    font-size: 14px;
}

.btn,
button.btn {
    border: none;
    border-radius: 13px;
    padding: 12px 16px;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    min-height: 44px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #24324a;
    color: white;
}

.btn-ghost {
    background: transparent;
    color: #cbd5e1;
}

.btn-danger {
    background: var(--red);
    color: white;
}

input,
textarea,
select {
    width: 100%;
    background: #050b18;
    color: white;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 15px;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(47,109,246,.16);
}

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

label {
    display: block;
    margin: 18px 0 8px;
    color: #dbeafe;
    font-weight: 800;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: rgba(2, 6, 23, .8);
    padding: 7px 10px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 800;
}

.badge-draft {
    color: #cbd5e1;
}

.badge-queued {
    border-color: rgba(245,158,11,.45);
    color: #fbbf24;
}

.badge-processing {
    border-color: rgba(56,189,248,.45);
    color: #7dd3fc;
}

.badge-published {
    border-color: rgba(34,197,94,.45);
    color: #86efac;
}

.badge-failed {
    border-color: rgba(239,68,68,.45);
    color: #fca5a5;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
}

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

.table th,
.table td {
    padding: 15px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

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

.table tr:last-child td {
    border-bottom: none;
}

.empty-state {
    border: 1px dashed var(--border-soft);
    border-radius: var(--radius);
    background: rgba(2, 6, 23, .42);
    padding: 42px;
    text-align: center;
    color: var(--muted);
}

.progress {
    height: 10px;
    border-radius: 999px;
    background: #020617;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--cyan));
}

.wizard-card {
    background: linear-gradient(180deg, rgba(17, 29, 49, .98), rgba(13, 23, 40, .98));
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    max-width: 1100px;
    box-shadow: var(--shadow);
}

.wizard-steps {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-bottom: 1px solid var(--border);
}

.wizard-step {
    padding: 18px;
    text-align: center;
    color: var(--muted);
    border-right: 1px solid var(--border);
    font-weight: 850;
}

.wizard-step:last-child {
    border-right: none;
}

.wizard-step.active {
    color: white;
    background: rgba(47,109,246,.18);
}

.wizard-panel {
    display: none;
    padding: 34px;
}

.wizard-panel.active {
    display: block;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.type-card {
    text-align: left;
    background: #050b18;
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    color: white;
    padding: 24px;
    cursor: pointer;
    min-height: 132px;
}

.type-card:hover {
    border-color: var(--primary);
}

.type-card strong {
    display: block;
    font-size: 21px;
    margin-bottom: 9px;
}

.type-card span {
    color: var(--muted);
    line-height: 1.4;
}

.type-card.selected {
    border-color: var(--cyan);
    background: rgba(8, 47, 73, .8);
}

.upload-zone {
    border: 2px dashed var(--border-soft);
    border-radius: 22px;
    padding: 34px;
    background: rgba(2, 6, 23, .5);
}

.queue-preview {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    padding: 24px 34px;
    border-top: 1px solid var(--border);
    background: rgba(5, 11, 24, .65);
}

@media (max-width: 1100px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .topbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .search-box,
    .search-box input {
        width: 100%;
    }
}

@media (max-width: 850px) {
    .shell {
        display: block;
    }

    .sidebar {
        position: relative;
        height: auto;
    }

    .content {
        padding: 22px;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .type-grid {
        grid-template-columns: 1fr;
    }

    .wizard-steps {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 22px;
    }
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(47,109,246,.28), rgba(56,189,248,.12));
    color: white;
}

.nav-item.active .nav-icon {
    background: var(--primary);
    color: white;
}
