:root {
    --bg: #0d0d0f;
    --panel: #17171a;
    --border: #2a2a2e;
    --text: #f2f2f4;
    --muted: #8a8a92;
    --red: #c1121f;
    --red-dark: #8d0801;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h1:focus { outline: none; }
h2 { font-size: 1.1rem; color: var(--muted); margin: 1.5rem 0 0.5rem; }

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.brand { display: flex; align-items: center; gap: 0.6rem; padding: 0 1rem 1rem; }

.brand-a {
    font-family: Georgia, serif;
    font-weight: bold;
    font-size: 1.8rem;
    color: var(--red);
    text-shadow: 0 2px 6px rgba(193, 18, 31, 0.6);
}

.brand-name { font-weight: 600; }

.sidebar nav { display: flex; flex-direction: column; flex: 1; }

.sidebar nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 0.55rem 1.25rem;
    border-left: 3px solid transparent;
}

.sidebar nav a:hover { color: var(--text); }
.sidebar nav a.active { color: var(--text); border-left-color: var(--red); background: rgba(193, 18, 31, 0.08); }

.logout-form { padding: 0 1rem; }
.logout-form button { width: 100%; }

.api-health {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.api-health .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-healthy { background: #3fb66b; box-shadow: 0 0 8px rgba(63, 182, 107, 0.7); }
.dot-degraded { background: #ffb020; box-shadow: 0 0 8px rgba(255, 176, 32, 0.7); }
.dot-down { background: #ff5c5c; box-shadow: 0 0 8px rgba(255, 92, 92, 0.8); animation: pulse-down 1.2s infinite; }
.dot-unknown { background: var(--muted); }

.api-health-latency { color: var(--muted); margin-left: 0.35rem; opacity: 0.7; }

@keyframes pulse-down {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.content { flex: 1; padding: 1.5rem 2rem; overflow-x: auto; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); }
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
th { color: var(--muted); font-weight: 600; }
table.inner { margin: 0.25rem 0; }

.content-cell { max-width: 380px; }
.mono { font-family: Consolas, monospace; font-size: 0.8rem; }

button {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.35rem 0.8rem;
    cursor: pointer;
    font-size: 0.85rem;
}

button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: 0.4; cursor: default; }
button.primary { background: var(--red); border-color: var(--red-dark); }
button.primary:hover { background: var(--red-dark); }
button.danger { color: #ff6b6b; border-color: #5c2020; }
button.danger:hover { background: rgba(193, 18, 31, 0.15); }

.actions { white-space: nowrap; }
.actions button { margin-right: 0.35rem; }

input, select, textarea {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.45rem 0.6rem;
    font-size: 0.9rem;
}

/* Inline suggestion-reply composer (SuggestionsPage) */
.reply-form { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.5rem 0; }
.reply-form input, .reply-form textarea { width: 100%; max-width: 640px; font-family: inherit; }

.filters { display: flex; gap: 0.75rem; margin-bottom: 1rem; align-items: center; }
.filters input { min-width: 240px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }

.stat {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 0.8rem; }
.stat.warn .stat-value { color: #ffb020; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.hint { color: var(--muted); font-size: 0.85rem; }
.severe { color: #ff6b6b; font-weight: 600; }
.warn-text { color: #ffb020; }
.error { color: #ff6b6b; }
.pager { display: flex; gap: 0.75rem; align-items: center; margin-top: 0.75rem; }

.login-wrap { display: flex; justify-content: center; align-items: center; min-height: 90vh; }

.login-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    width: 340px;
}

.login-brand { justify-content: center; padding-bottom: 1.5rem; }
.login-card form { display: flex; flex-direction: column; gap: 0.9rem; }
.login-card label { display: flex; flex-direction: column; gap: 0.3rem; color: var(--muted); font-size: 0.85rem; }

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    color: #111;
    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;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
