:root {
    --bg: #091015;
    --bg-soft: #0e171d;
    --panel: rgba(16, 28, 35, 0.88);
    --panel-strong: rgba(10, 18, 24, 0.96);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text: #edf1ea;
    --muted: #9fb0b2;
    --accent: #ff8a5b;
    --accent-deep: #b7421f;
    --accent-soft: rgba(255, 138, 91, 0.16);
    --success: #88c58b;
    --warning: #ffd27d;
    --danger: #ff7a7a;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --content-width: 1180px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(255, 138, 91, 0.18), transparent 32%),
        radial-gradient(circle at 80% 10%, rgba(121, 167, 129, 0.12), transparent 24%),
        linear-gradient(180deg, #0c1419 0%, #091015 100%);
    color: var(--text);
    font-family: "DM Sans", sans-serif;
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 72px 72px;
    pointer-events: none;
    opacity: 0.35;
    z-index: -1;
}

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

img {
    max-width: 100%;
}

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

.site-shell {
    width: min(calc(100% - 2rem), var(--content-width));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(20px);
    background: rgba(9, 16, 21, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-header__inner,
.site-footer {
    width: min(calc(100% - 2rem), var(--content-width));
    margin: 0 auto;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    font-family: "Space Grotesk", sans-serif;
}

.site-brand__mark {
    display: grid;
    place-items: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 0.9rem;
    color: #10161b;
    background: linear-gradient(135deg, var(--accent) 0%, #ffc478 100%);
    font-weight: 700;
    letter-spacing: 0.08em;
    box-shadow: 0 12px 24px rgba(255, 138, 91, 0.28);
}

.site-brand__text {
    display: flex;
    flex-direction: column;
}

.site-brand__name {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.site-brand__sub {
    color: var(--muted);
    font-size: 0.83rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.site-nav a,
.site-nav button {
    border: 1px solid transparent;
    color: var(--muted);
    background: transparent;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    transition: 180ms ease;
    cursor: pointer;
}

.site-nav form {
    margin: 0;
}

.site-nav a:hover,
.site-nav button:hover,
.site-nav .is-active {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.button,
.button-secondary,
.button-ghost,
.button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 999px;
    padding: 0.92rem 1.35rem;
    border: 1px solid transparent;
    transition: 180ms ease;
    font-weight: 700;
    cursor: pointer;
}

.button {
    background: linear-gradient(135deg, var(--accent) 0%, #ffc478 100%);
    color: #161a1d;
    box-shadow: 0 16px 34px rgba(255, 138, 91, 0.28);
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 40px rgba(255, 138, 91, 0.33);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.button-secondary:hover,
.button-ghost:hover,
.button-danger:hover {
    background: rgba(255, 255, 255, 0.11);
}

.button-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.button-danger {
    background: rgba(255, 122, 122, 0.14);
    border-color: rgba(255, 122, 122, 0.2);
    color: #ffd5d5;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 2rem;
    padding: 4.5rem 0 2rem;
    align-items: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #f8c79f;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.8rem;
    margin-bottom: 1.1rem;
}

.eyebrow::before {
    content: "";
    width: 2.8rem;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.hero h1,
.section-heading h2,
.article h1,
.auth-panel h1,
.admin-heading h1 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.hero h1 {
    font-size: clamp(3rem, 7vw, 5.8rem);
    max-width: 10ch;
}

.hero p,
.section-heading p,
.lead,
.article-intro {
    color: var(--muted);
    font-size: 1.06rem;
    max-width: 62ch;
}

.hero-actions,
.stack-inline {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.hero-meta,
.metric-grid,
.card-grid,
.news-grid,
.dashboard-grid,
.admin-grid,
.form-grid,
.split-grid {
    display: grid;
    gap: 1rem;
}

.hero-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1.5rem;
}

.panel,
.metric,
.callout,
.auth-panel,
.form-panel,
.table-panel,
.article,
.news-card,
.hero-panel,
.section-panel {
    position: relative;
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.panel::before,
.metric::before,
.callout::before,
.auth-panel::before,
.form-panel::before,
.table-panel::before,
.article::before,
.news-card::before,
.hero-panel::before,
.section-panel::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), transparent 55%);
    pointer-events: none;
}

.hero-panel {
    padding: 1.5rem;
    background:
        radial-gradient(circle at top right, rgba(255, 138, 91, 0.24), transparent 34%),
        linear-gradient(180deg, rgba(18, 29, 36, 0.96), rgba(9, 16, 21, 0.96));
}

.status-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #ffd1ba;
    padding: 0.45rem 0.8rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.status-label::before,
.pill::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}

.signal-list,
.meta-list,
.footer-links {
    display: grid;
    gap: 0.8rem;
    padding: 0;
    list-style: none;
}

.signal-list li,
.meta-list li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.signal-list li:first-child,
.meta-list li:first-child {
    border-top: 0;
    padding-top: 0;
}

.signal-list strong,
.metric strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.6rem;
    line-height: 1;
}

.signal-list span,
.metric span,
.muted,
.helper-text {
    color: var(--muted);
}

.section {
    padding: 1.2rem 0 1.8rem;
}

.section-heading {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
}

.section-heading h2,
.article h1,
.auth-panel h1,
.admin-heading h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
}

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

.metric,
.news-card,
.callout,
.form-panel,
.table-panel,
.section-panel {
    padding: 1.45rem;
}

.card-grid .panel h3,
.news-card h3,
.callout h3,
.admin-card h3,
.hero-panel h2 {
    margin: 0 0 0.6rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.25rem;
}

.card-grid .panel p,
.news-card p,
.callout p,
.hero-panel p,
.admin-card p {
    margin: 0;
    color: var(--muted);
}

.article {
    padding: 2rem;
}

.article header {
    margin-bottom: 1.5rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.markdown {
    color: #dfe6df;
}

.markdown p,
.markdown ul,
.markdown ol,
.markdown blockquote {
    margin: 0 0 1.1rem;
}

.markdown h2,
.markdown h3 {
    margin: 1.6rem 0 0.8rem;
    font-family: "Space Grotesk", sans-serif;
}

.markdown a {
    color: #ffd9b4;
}

.markdown ul,
.markdown ol {
    padding-left: 1.2rem;
}

.markdown blockquote {
    padding: 1rem 1.2rem;
    border-left: 3px solid var(--accent);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.news-card__meta,
.pill-row,
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.news-card__meta,
.toolbar,
.pill-row {
    color: var(--muted);
    font-size: 0.92rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 0.74rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.pill-success {
    color: #cfeecd;
}

.pill-warning {
    color: #ffe4a6;
}

.pill-danger {
    color: #ffc8c8;
}

.dashboard-grid,
.admin-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.admin-card,
.table-panel,
.form-panel {
    display: grid;
    gap: 1rem;
}

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

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

th,
td {
    text-align: left;
    padding: 0.95rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: top;
}

th {
    color: #d7ddda;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

tr:last-child td {
    border-bottom: 0;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

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

.field {
    display: grid;
    gap: 0.45rem;
}

.field-full {
    grid-column: 1 / -1;
}

label {
    color: #d8ddda;
    font-size: 0.95rem;
    font-weight: 500;
}

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

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(255, 138, 91, 0.55);
    box-shadow: 0 0 0 4px rgba(255, 138, 91, 0.12);
}

textarea {
    min-height: 15rem;
    resize: vertical;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
}

input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
}

.error-list,
.flash,
.empty-state {
    padding: 1rem 1.15rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.error-list {
    background: rgba(255, 122, 122, 0.12);
    color: #ffd6d6;
    margin-bottom: 1rem;
}

.error-list ul {
    margin: 0;
    padding-left: 1.1rem;
}

.flash {
    background: rgba(136, 197, 139, 0.14);
    color: #d7f0d7;
    margin: 1.2rem 0 0;
}

.auth-wrap {
    min-height: calc(100vh - 84px);
    display: grid;
    place-items: center;
    padding: 3rem 0;
}

.auth-panel {
    width: min(100%, 34rem);
    padding: 2rem;
}

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

.admin-shell {
    padding: 2rem 0 4rem;
}

.admin-heading,
.page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-heading p,
.admin-heading p {
    color: var(--muted);
    margin: 0.4rem 0 0;
}

.pager {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

.pager-link,
.pager-link-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 9rem;
    padding: 0.8rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.pager-link:hover {
    background: rgba(255, 255, 255, 0.06);
}

.pager-link-disabled {
    color: rgba(159, 176, 178, 0.45);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 2rem 0 3rem;
    color: var(--muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 960px) {
    .hero,
    .dashboard-grid,
    .admin-grid,
    .metric-grid,
    .card-grid,
    .news-grid,
    .hero-meta {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 3rem;
    }

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

    .page-heading,
    .admin-heading,
    .site-header__inner,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 680px) {
    .site-shell,
    .site-header__inner,
    .site-footer {
        width: min(calc(100% - 1.3rem), var(--content-width));
    }

    .hero h1 {
        max-width: 100%;
    }

    .hero-panel,
    .panel,
    .metric,
    .callout,
    .form-panel,
    .table-panel,
    .article,
    .news-card,
    .auth-panel,
    .section-panel {
        border-radius: 22px;
    }
}

