:root {
    --bg: #0f172a;
    --panel: #111827;
    --border: #1f2937;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --danger: #fca5a5;
    --success: #86efac;
}

html, body {
    margin: 0;
    font-family: "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: #93c5fd;
}

.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: #020617;
    border-right: 1px solid var(--border);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.brand strong {
    display: block;
    font-size: 1.1rem;
}

.brand span {
    color: var(--muted);
    font-size: 0.85rem;
}

.admin-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-sidebar nav a {
    color: var(--text);
    text-decoration: none;
    padding: 0.5rem 0.65rem;
    border-radius: 0.5rem;
}

.admin-sidebar nav a.active {
    background: rgba(37, 99, 235, 0.2);
    color: #bfdbfe;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.user-chip {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.admin-main {
    padding: 1.5rem 2rem;
}

h1 {
    margin-top: 0;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.85rem;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 0.5rem;
    text-align: left;
    vertical-align: top;
}

.data-table.compact td,
.data-table.compact th {
    padding: 0.45rem 0.35rem;
}

.row-warning {
    background: rgba(248, 113, 113, 0.08);
}

.field {
    margin-bottom: 0.85rem;
}

.field label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
select {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    padding: 0.55rem 0.65rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: #0b1220;
    color: var(--text);
}

.btn-primary,
.btn-secondary {
    border: 0;
    border-radius: 0.5rem;
    padding: 0.55rem 1rem;
    cursor: pointer;
    color: white;
    background: var(--accent);
}

.btn-secondary {
    background: #374151;
}

.btn-link {
    background: none;
    border: 0;
    color: #93c5fd;
    cursor: pointer;
    padding: 0;
}

.alert {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: var(--danger);
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    margin: 0.75rem 0;
}

.success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: var(--success);
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    margin: 0.75rem 0;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-card {
    width: min(420px, 100%);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.plain-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.plain-list li {
    margin-bottom: 0.5rem;
}

.masked-key {
    font-size: 1.05rem;
}

code {
    color: #fda4af;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}
