:root {
    --bg: #edf3f8;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-strong: #ffffff;
    --text: #122033;
    --muted: #607286;
    --line: rgba(18, 32, 51, 0.1);
    --brand: #0f6d95;
    --brand-deep: #0b3f62;
    --accent: #17a699;
    --success: #157347;
    --error: #b42318;
    --warning: #c77f04;
    --shadow: 0 24px 60px rgba(10, 28, 45, 0.12);
    --radius: 22px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(23, 166, 153, 0.14), transparent 32%),
        radial-gradient(circle at top right, rgba(15, 109, 149, 0.18), transparent 28%),
        linear-gradient(180deg, #f8fbfe 0%, #ebf2f8 100%);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
input, textarea, select, button {
    font: inherit;
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.sidebar {
    padding: 1.5rem;
    background: linear-gradient(180deg, #0f1f31 0%, #153850 100%);
    color: #eef5fb;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: inline-flex;
    align-items: center;
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-nav a {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    color: rgba(238, 245, 251, 0.82);
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.main-panel {
    padding: 1.75rem;
}

.topbar, .panel-head, .split, .public-wrap, .public-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.topbar {
    margin-bottom: 1.5rem;
}

.topbar-actions, .inline-actions, .inline-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    color: var(--brand);
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.panel, .metric-card, .plugin-card, .auth-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.66);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel {
    padding: 1.5rem;
}

.narrow {
    max-width: 760px;
}

.grid {
    display: grid;
    gap: 1rem;
}

.cards-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1.5rem;
}

.metric-card {
    padding: 1.25rem;
}

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

.metric-card strong {
    font-size: 2rem;
    letter-spacing: -0.04em;
}

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

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

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

.stack-form label {
    display: grid;
    gap: 0.45rem;
    font-weight: 600;
}

input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    background: var(--surface-strong);
    color: var(--text);
}

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

.primary-button,
.ghost-button,
button {
    border: 0;
    border-radius: 999px;
    padding: 0.85rem 1.2rem;
    cursor: pointer;
    font-weight: 800;
}

.primary-button {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #fff;
}

.ghost-button {
    background: rgba(15, 109, 149, 0.08);
    color: var(--brand-deep);
}

.plugin-grid,
.public-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.plugin-card {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.flash {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    margin-bottom: 1rem;
}

.flash-success { background: rgba(21, 115, 71, 0.12); color: var(--success); }
.flash-error { background: rgba(180, 35, 24, 0.12); color: var(--error); }

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

.auth-card {
    width: min(100%, 460px);
    padding: 2rem;
}

.public-header {
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(14px);
}

.public-wrap {
    width: min(calc(100% - 2rem), 1160px);
    margin: 0 auto;
}

.public-nav {
    display: flex;
    gap: 1rem;
}

.public-main {
    padding: 2rem 0 4rem;
}

.hero {
    padding: 4rem 0 2rem;
}

.hero h1 {
    max-width: 920px;
    font-size: clamp(2.8rem, 6vw, 5rem);
    line-height: 0.96;
    letter-spacing: -0.05em;
}

.large { font-size: 1.1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.details-list div { display: grid; grid-template-columns: 140px 1fr; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.split { align-items: flex-start; }
.split > * { flex: 1 1 0; }
.checkbox { display: flex; align-items: center; gap: 0.6rem; }
.checkbox input { width: auto; }
.stack-list { display: grid; gap: 0.75rem; }
.stack-list a { padding: 0.85rem 1rem; border-radius: 14px; background: rgba(15, 109, 149, 0.06); }
.user-badge { color: var(--muted); }

.content-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.content-toolbar button {
    background: rgba(15, 109, 149, 0.08);
    color: var(--brand-deep);
}

.editor-surface {
    min-height: 220px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem;
    background: var(--surface-strong);
}

.article-body {
    line-height: 1.75;
}

@media (max-width: 960px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: static;
        height: auto;
    }
    .cards-4,
    .plugin-grid,
    .public-grid,
    .split {
        grid-template-columns: 1fr;
        display: grid;
    }
    .topbar,
    .panel-head,
    .public-header,
    .public-wrap {
        flex-direction: column;
        align-items: flex-start;
    }
}
