:root {
    --bg: #f5f7fb;
    --panel: rgba(255, 255, 255, 0.92);
    --panel-strong: #ffffff;
    --line: #e7ebf3;
    --text: #132238;
    --muted: #708198;
    --brand: #0f6fff;
    --brand-soft: #edf4ff;
    --danger: #d64545;
    --danger-soft: #fff1f1;
    --shadow: 0 18px 60px rgba(18, 35, 56, 0.08);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(15, 111, 255, 0.10), transparent 28%),
        linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
}

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

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

button {
    cursor: pointer;
    border: 0;
    background: transparent;
}

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

.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px;
    background: rgba(255, 255, 255, 0.76);
    border-right: 1px solid rgba(231, 235, 243, 0.9);
    backdrop-filter: blur(22px);
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand span {
    color: var(--brand);
}

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

.sidebar-nav {
    display: grid;
    gap: 8px;
    margin: 36px 0 auto;
}

.sidebar-nav a,
.ghost-button,
.primary-button {
    border-radius: 16px;
    padding: 13px 16px;
    font-weight: 700;
    transition: 180ms ease;
}

.sidebar-nav a {
    color: var(--muted);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--brand-soft);
    color: var(--brand);
}

.sidebar-footer {
    display: grid;
    gap: 14px;
}

.user-chip {
    display: grid;
    gap: 2px;
    padding: 16px;
    border-radius: 18px;
    background: var(--panel-strong);
    border: 1px solid var(--line);
}

.main-content {
    padding: 28px;
}

.topbar,
.section-header,
.button-row,
.post-footer,
.article-header,
.filter-bar,
.table-actions,
.stacked-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar {
    margin-bottom: 26px;
}

.topbar h1,
.section-header h2,
.auth-copy h1,
.article-header h1 {
    margin: 0;
    letter-spacing: -0.04em;
}

.eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    color: var(--brand);
    font-weight: 800;
}

.panel,
.stat-card {
    background: var(--panel);
    border: 1px solid rgba(231, 235, 243, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel {
    padding: 24px;
}

.stats-grid,
.card-grid,
.gallery-grid,
.posts-grid {
    display: grid;
    gap: 18px;
}

.dashboard-stack {
    display: grid;
    gap: 22px;
}

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

.stat-card {
    padding: 24px;
}

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

.stat-card strong {
    font-size: 2rem;
    letter-spacing: -0.06em;
}

.card-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    margin-top: 18px;
}

.posts-results {
    transition: opacity 140ms ease;
}

.posts-results.is-loading {
    opacity: 0.55;
}

.info-card,
.post-card {
    display: grid;
    gap: 14px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.88rem;
    font-weight: 700;
}

.list-stack {
    display: grid;
    gap: 12px;
}

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 18px;
    background: #fbfcff;
    border: 1px solid var(--line);
}

.list-row p,
.post-card p,
.info-card p,
.article-summary {
    margin: 6px 0 0;
    color: var(--muted);
}

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

.primary-button:hover {
    transform: translateY(-1px);
}

.ghost-button {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--text);
}

.danger-ghost,
.danger-link {
    color: var(--danger);
}

.danger-ghost {
    background: var(--danger-soft);
    border-color: #ffd7d7;
}

.text-link {
    font-weight: 700;
    color: var(--brand);
}

.full-width {
    width: 100%;
}

.alert {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    font-weight: 600;
}

.alert-success {
    background: #effaf2;
    color: #1b7d42;
}

.alert-error {
    background: #fff2f2;
    color: #b73838;
}

.narrow {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 28px;
}

.login-panel {
    width: min(460px, 100%);
}

.stacked-form,
.field {
    display: grid;
    gap: 10px;
}

.stacked-form {
    gap: 18px;
}

.field label {
    font-size: 0.95rem;
    font-weight: 700;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 15px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    resize: vertical;
}

.field textarea {
    min-height: 120px;
}

.editor-shell {
    position: relative;
    display: grid;
    gap: 12px;
}

.editor-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.editor-button {
    padding: 10px 14px;
}

.editor-help {
    color: var(--muted);
    font-size: 0.92rem;
}

.editor-suggestions {
    position: absolute;
    top: calc(100% - 6px);
    left: 0;
    right: 0;
    z-index: 20;
    display: grid;
    gap: 6px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
}

.editor-suggestion {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    text-align: left;
    border-radius: 14px;
    background: #fff;
}

.editor-suggestion span {
    color: var(--muted);
    font-size: 0.88rem;
}

.editor-suggestion.active,
.editor-suggestion:hover {
    background: var(--brand-soft);
}

.filter-bar {
    align-items: end;
}

.grow {
    flex: 1;
}

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

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

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

.data-table th {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.table-actions {
    justify-content: flex-start;
}

.post-thumb,
.gallery-image,
.image-check img {
    width: 100%;
    border-radius: 20px;
    object-fit: cover;
}

.post-thumb {
    aspect-ratio: 16 / 10;
}

.gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin: 24px 0;
}

.gallery-image {
    aspect-ratio: 4 / 3;
}

.compact {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.image-check {
    display: grid;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--muted);
}

.article-content {
    line-height: 1.9;
    font-size: 1.03rem;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    margin: 1.4em 0 0.4em;
    letter-spacing: -0.04em;
}

.article-content h1 {
    font-size: 2rem;
}

.article-content h2 {
    font-size: 1.55rem;
}

.article-content h3 {
    font-size: 1.2rem;
}

.article-content p {
    margin: 0 0 1em;
}

.article-content strong {
    font-weight: 800;
}

.content-link {
    color: var(--brand);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

.article-summary {
    max-width: 70ch;
    font-size: 1.05rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
}

.empty-state {
    color: var(--muted);
    text-align: center;
    padding: 24px;
}

.narrow-panel,
.form-panel {
    max-width: 920px;
}

.setup-list {
    display: grid;
    gap: 12px;
    margin: 20px 0;
}

.setup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fbfcff;
}

.text-link,
.primary-button,
.ghost-button {
    text-align: center;
}

code {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

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

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .main-content,
    .sidebar,
    .auth-shell {
        padding: 18px;
    }

    .topbar,
    .section-header,
    .button-row,
    .article-header,
    .filter-bar,
    .stacked-actions {
        flex-direction: column;
        align-items: stretch;
    }

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