:root {
    --bg: #0b0d16;
    --bg-2: #141827;
    --panel: #171d31;
    --panel-2: #1e253c;
    --text: #eef2ff;
    --muted: #a8b0d0;
    --border: rgba(255, 255, 255, 0.08);
    --gold: #e9c46a;
    --accent: #8c6cff;
    --danger: #ff8080;
    --success: #8dd3a6;
    --radius: 20px;
    --radius-sm: 14px;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(140, 108, 255, 0.18), transparent 28%),
        linear-gradient(180deg, #0b0d16 0%, #101522 100%);
    color: var(--text);
    font: 16px/1.55 "Inter", "Segoe UI", system-ui, sans-serif;
}

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

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

button {
    cursor: pointer;
}

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

.panel-sidebar {
    padding: 1.4rem;
    border-right: 1px solid var(--border);
    background: rgba(9, 12, 21, 0.72);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.panel-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
}

.panel-brand .brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(233, 196, 106, 0.18), rgba(140, 108, 255, 0.3));
    color: var(--gold);
    border: 1px solid rgba(233, 196, 106, 0.28);
}

.panel-brand small {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
}

.panel-nav {
    display: grid;
    gap: 0.4rem;
}

.panel-nav a {
    padding: 0.82rem 0.95rem;
    border-radius: 14px;
    color: var(--muted);
    transition: 0.2s ease;
}

.panel-nav a:hover,
.panel-nav a.is-active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.panel-sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 1rem;
}

.panel-content {
    padding: 2rem;
}

.panel-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.eyebrow {
    display: inline-block;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.12;
}

h1 {
    font-size: clamp(2rem, 3vw, 3rem);
}

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

.button,
.button-link,
button.button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 0.9rem 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold), #ffd98e);
    color: #140f20;
    box-shadow: 0 16px 32px rgba(233, 196, 106, 0.16);
}

.button-full {
    width: 100%;
}

.button-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}

.button-link {
    background: none;
    box-shadow: none;
    padding: 0;
    color: var(--text);
}

.button-link.danger {
    color: #ffb3b3;
}

.flash,
.panel-card,
.auth-card {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(22, 28, 48, 0.92), rgba(13, 16, 28, 0.95));
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.flash {
    padding: 0.95rem 1rem;
    margin-bottom: 1rem;
}

.flash-success {
    border-color: rgba(141, 211, 166, 0.28);
    color: #dff7e6;
}

.flash-error {
    border-color: rgba(255, 128, 128, 0.28);
    color: #ffdada;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.stat-card,
.auth-head {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius);
    padding: 1.2rem;
}

.stat-card span {
    color: var(--muted);
    display: block;
    margin-bottom: 0.55rem;
}

.stat-card strong {
    font-size: 2rem;
    line-height: 1;
    color: var(--text);
}

.panel-card {
    padding: 1.3rem;
}

.panel-card-head {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

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

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

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

.admin-table th {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.status {
    display: inline-flex;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.82rem;
}

.status-published {
    color: #dff7e6;
    border: 1px solid rgba(141, 211, 166, 0.2);
}

.status-draft,
.status-review,
.status-archived {
    color: #e7ecff;
}

.panel-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) 360px;
    gap: 1rem;
    align-items: start;
}

.form-main,
.form-side {
    display: grid;
    gap: 1rem;
}

.field-group,
.panel-two-columns {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-two-columns > .panel-card:first-child {
    min-width: 0;
}

label {
    display: grid;
    gap: 0.45rem;
}

label span {
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
select,
textarea,
input[type="file"] {
    width: 100%;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-radius: 14px;
    padding: 0.85rem 0.95rem;
    outline: none;
}

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

.stack-form {
    display: grid;
    gap: 1rem;
}

.checkbox-list {
    display: grid;
    gap: 0.65rem;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.checkbox input {
    width: auto;
}

.cover-preview {
    width: 100%;
    border-radius: 16px;
    margin-bottom: 0.9rem;
    max-height: 220px;
    object-fit: cover;
}

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

.divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 0.5rem 0;
}

.theme-auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.auth-shell {
    width: min(540px, 100%);
}

.auth-card {
    padding: 1.5rem;
}

.auth-head {
    margin-bottom: 1rem;
}

.auth-back {
    color: var(--muted);
    text-align: center;
}

@media (max-width: 1100px) {
    .panel-form-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid,
    .field-group,
    .panel-two-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .theme-panel .panel-shell {
        grid-template-columns: 1fr;
    }

    .panel-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .panel-content {
        padding: 1rem;
    }

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