:root {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-alt: #1e232d;
    --border: #262b36;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --accent: #e50914;
    --accent-hover: #c50812;
    --healthy: #22c55e;
    --unhealthy: #ef4444;
    --draft: #f59e0b;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
}

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

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
}

.brand {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.brand-subtitle {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.nav-section {
    margin-top: 1.25rem;
    margin-bottom: 0.25rem;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.06em;
}

.nav-item {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
}

.nav-item:hover:not(.disabled) {
    background: var(--surface-alt);
}

.nav-item.active {
    background: rgba(229, 9, 20, 0.16);
    color: #fff;
    font-weight: 600;
}

.nav-item.disabled {
    color: var(--muted);
    opacity: 0.6;
    cursor: default;
}

.content {
    padding: 2rem;
    max-width: 1200px;
}

.header {
    margin-bottom: 1.5rem;
}

.header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.75rem;
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.panel h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.85rem;
}

.checks {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0;
}

.checks li {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
}

.status.healthy {
    color: var(--healthy);
}

.status.unhealthy {
    color: var(--unhealthy);
}

.link {
    color: var(--accent);
}

.toolbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.toolbar input,
.toolbar select,
.form-panel input[type="text"],
.form-panel input[type="number"],
.form-panel input[type="url"],
.form-panel input[type="date"],
.form-panel input[type="datetime-local"],
.form-panel select,
.form-panel textarea {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.92rem;
}

.toolbar input {
    flex: 1;
    min-width: 220px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.form-panel label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.9rem;
}

.form-panel label.full-width {
    margin-bottom: 0.85rem;
}

.form-panel label.checkbox-inline,
.checkbox-inline {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.category-picker {
    margin-bottom: 1rem;
}

.field-label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn:hover:not(:disabled) {
    border-color: #4b5563;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

.btn.primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn.danger {
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.btn.small {
    padding: 0.28rem 0.6rem;
    font-size: 0.82rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

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

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

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

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge.published {
    background: rgba(34, 197, 94, 0.16);
    color: var(--healthy);
}

.badge.draft {
    background: rgba(245, 158, 11, 0.16);
    color: var(--draft);
}

.badge.archived {
    background: rgba(156, 163, 175, 0.16);
    color: var(--muted);
}

.badge.live {
    background: rgba(229, 9, 20, 0.22);
    color: #fca5a5;
}

.badge.scheduled {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
}

.badge.featured {
    background: rgba(168, 85, 247, 0.18);
    color: #d8b4fe;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.chip {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1rem 0.45rem;
    font-size: 0.78rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

.alert.success {
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
}

.alert.error {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
}

.confirm-panel {
    border-color: rgba(239, 68, 68, 0.45);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #3f1d1d;
    color: #fff;
    padding: 0.75rem 1.25rem;
    z-index: 1000;
}
