:root {
    color-scheme: dark;
    --bg: #0d1321;
    --panel: rgba(17, 25, 40, 0.9);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text: #f5f7fb;
    --muted: #9aa7bd;
    --accent: #ffb703;
    --accent-strong: #fb8500;
    --danger: #ff6b6b;
    --success: #7ae582;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 183, 3, 0.16), transparent 34%),
        radial-gradient(circle at top right, rgba(251, 133, 0, 0.18), transparent 28%),
        linear-gradient(180deg, var(--bg), #070b14 100%);
}

button,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
    border-radius: 999px;
    padding: 0.85rem 1.2rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #160f04;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    filter: brightness(1.05);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

button[type="reset"],
#logoutButton {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: 0.9rem 1rem;
}

input:focus,
textarea:focus {
    outline: 2px solid rgba(255, 183, 3, 0.45);
    outline-offset: 2px;
}

.app-shell,
.auth-shell {
    width: min(1100px, calc(100vw - 2rem));
    margin: 0 auto;
    padding: 2rem 0 3rem;
}

.app-hero,
.auth-panel,
.card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
    border-radius: 28px;
}

.app-hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

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

.card {
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

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

.eyebrow {
    margin: 0 0 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    color: var(--muted);
}

.status-message {
    min-height: 1.5rem;
    color: var(--muted);
}

.status-message[data-state="error"] {
    color: var(--danger);
}

.status-message[data-state="success"] {
    color: var(--success);
}

.items-list {
    display: grid;
    gap: 0.75rem;
}

.item-card {
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 1rem 1.15rem;
    background: rgba(255, 255, 255, 0.03);
}

.item-card--expanded {
    border-color: rgba(255, 183, 3, 0.45);
}

.item-card__toggle {
    width: 100%;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0;
    text-align: left;
    background: transparent;
    color: inherit;
    border-radius: 0;
}

.item-card__summary {
    display: grid;
    gap: 0.2rem;
}

.item-card__actions,
.user-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.item-card__actions button,
.user-card__actions button,
.card-header button {
    white-space: nowrap;
}

.item-card__details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--panel-border);
}

.draft-images {
    display: grid;
    gap: 0.75rem;
}

.draft-image {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.article-image {
    width: 100%;
    max-width: 260px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.05);
}

.article-image--fallback {
    display: grid;
    place-items: center;
    padding: 1rem;
    color: var(--muted);
}

.article-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.article-thumb {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--panel-border);
}

.inline-control {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--muted);
}

.inline-control--wide {
    flex: 1 1 240px;
}

.inline-control select,
.inline-control input {
    width: auto;
    min-width: 140px;
}

.admin-card__form {
    margin-bottom: 1rem;
}

.admin-card__form label {
    margin-top: 0.4rem;
}

.admin-card__header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.users-list {
    display: grid;
    gap: 0.75rem;
}

.user-card {
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 1rem 1.15rem;
    background: rgba(255, 255, 255, 0.03);
}

.user-card__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.user-card__actions {
    align-items: flex-end;
}

.user-card__actions button {
    align-self: end;
}

.user-card__actions input,
.user-card__actions select {
    min-width: 180px;
}

.item-title {
    margin: 0;
    font-size: 1.05rem;
}

.item-meta {
    margin: 0.3rem 0 0;
    color: var(--muted);
}

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

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

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

.auth-note {
    color: var(--muted);
    line-height: 1.55;
}

.overlay-card {
    animation: fadeIn 180ms ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 720px) {
    .app-hero {
        flex-direction: column;
    }

    .hero-actions,
    .form-actions {
        width: 100%;
    }

    .hero-actions button,
    .form-actions button {
        flex: 1 1 100%;
    }

    .card-header {
        flex-direction: column;
    }
}