:root {
    --bg: #f3f4f6;
    --panel: #ffffff;
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --accent: #b4161b;
    --accent-dark: #7d0f13;
    --success: #047857;
    --warning: #b45309;
    --danger: #b91c1c;
    --sans: Inter, Arial, Helvetica, sans-serif;
    --serif: Georgia, "Times New Roman", serif;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

input,
textarea,
select {
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    padding: 11px 12px;
    width: 100%;
}

textarea {
    resize: vertical;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

button,
.button {
    background: var(--accent);
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    padding: 10px 16px;
}

button:hover,
.button:hover {
    background: var(--accent-dark);
}

.button.secondary,
button.secondary {
    background: #111827;
}

button.danger {
    background: var(--danger);
}

.dashboard-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: #111111;
    color: #ffffff;
    padding: 24px;
}

.dashboard-brand {
    border-bottom: 1px solid #333333;
    display: block;
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 22px;
    padding-bottom: 18px;
}

.sidebar nav {
    display: grid;
    gap: 8px;
}

.sidebar nav a {
    border-radius: 12px;
    color: #d1d5db;
    font-weight: 700;
    padding: 11px 12px;
}

.sidebar nav a:hover {
    background: #252525;
    color: #ffffff;
}

.dashboard-main {
    min-width: 0;
}

.dashboard-topbar {
    align-items: center;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 16px 28px;
}

.dashboard-topbar span,
.help-text,
.eyebrow {
    color: var(--muted);
}

.dashboard-content {
    padding: 28px;
}

.page-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.page-heading h1,
.panel h2,
.login-card h1 {
    margin: 0;
}

.eyebrow {
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.stat-card,
.panel,
.login-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(17, 24, 39, 0.06);
    padding: 22px;
}

.stat-card span {
    color: var(--muted);
    display: block;
    font-weight: 800;
    margin-bottom: 8px;
}

.stat-card strong {
    font-size: 2.6rem;
}

.activity-list {
    display: grid;
    gap: 10px;
}

.activity-list a {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: grid;
    gap: 4px;
    padding: 14px;
}

.status {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    padding: 4px 9px;
    text-transform: uppercase;
    width: max-content;
}

.status.published {
    background: #d1fae5;
    color: var(--success);
}

.status.draft {
    background: #fef3c7;
    color: var(--warning);
}

.status.archived {
    background: #e5e7eb;
    color: #374151;
}

.filter-bar,
.inline-form {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 18px;
}

.table-panel {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    min-width: 900px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.actions form,
.row-form {
    display: contents;
}

.actions button,
.actions a {
    background: #f3f4f6;
    border: 0;
    border-radius: 999px;
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 800;
    padding: 8px 11px;
}

.actions .danger {
    background: #fee2e2;
    color: var(--danger);
}

.editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
}

.editor-main,
.editor-side,
.narrow {
    display: grid;
    gap: 16px;
}

.preview-article {
    max-width: 860px;
}

.preview-article h1 {
    font-family: var(--serif);
    font-size: clamp(2.2rem, 6vw, 4rem);
    line-height: 1;
}

.preview-article .featured-image-figure {
    margin: 0 0 22px;
}

.preview-article .featured-image {
    display: block;
    height: auto;
    max-width: 100%;
    width: 100%;
}

.preview-article .featured-image-figure figcaption {
    color: var(--muted);
    display: grid;
    font-size: 0.9rem;
    gap: 3px;
    line-height: 1.45;
    margin-top: 8px;
    text-align: center;
}

.preview-article .image-attribution {
    font-size: 0.82rem;
    font-weight: 800;
}

.preview-body {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.13rem;
    line-height: 1.7;
}

.flash-stack {
    display: grid;
    gap: 10px;
    padding: 20px 28px 0;
}

.flash {
    border-radius: 12px;
    padding: 12px 14px;
}

.flash.success {
    background: #d1fae5;
    color: var(--success);
}

.flash.error {
    background: #fee2e2;
    color: var(--danger);
}

.login-body {
    align-items: center;
    display: grid;
    min-height: 100vh;
    padding: 22px;
}

.login-card {
    margin: 0 auto;
    max-width: 440px;
    width: 100%;
}

.login-card h1 {
    font-family: var(--serif);
    font-size: 2.5rem;
    line-height: 1;
}

.login-card form {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.narrow {
    max-width: 560px;
}

@media (max-width: 900px) {
    .dashboard-shell,
    .editor-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .stat-grid,
    .filter-bar,
    .inline-form {
        grid-template-columns: 1fr;
    }

    .dashboard-topbar,
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}
