:root {
    --bg: #11151c;
    --panel: #1a2029;
    --panel-2: #222a35;
    --line: #2e3845;
    --text: #e3e8ef;
    --muted: #8b96a5;
    --accent: #4f8ef7;
    --good: #45b36b;
    --warn: #e0a33a;
    --bad: #e5534b;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 2rem 0 .6rem; }
h1 small, h2 small { color: var(--muted); font-weight: normal; font-size: .9rem; margin-left: .4rem; }
code { font-size: .85em; background: var(--panel-2); padding: .1em .35em; border-radius: 4px; }

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

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

.side a { color: var(--text); padding: .45rem .7rem; border-radius: 6px; }
.side a:hover { background: var(--panel-2); text-decoration: none; }
.side a.active { background: var(--accent); color: #fff; }

.brand { font-weight: 700; font-size: 1.25rem; margin-bottom: 1rem; }
.brand span, .login h1 span { color: var(--accent); font-weight: 400; }

.server-pick { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); margin-bottom: 1rem; gap: .25rem; }
.who { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; color: var(--muted); }

main { flex: 1; padding: 1.6rem 2rem; min-width: 0; }
main.bare { display: flex; justify-content: center; align-items: center; min-height: 100vh; }

select, input {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: .45rem .6rem;
    font: inherit;
}

button {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: .45rem 1rem;
    font: inherit;
    cursor: pointer;
}

button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.link { background: none; border: none; color: var(--accent); padding: .2rem; }

.login { width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 2rem; }
.login form { display: flex; flex-direction: column; gap: 1rem; }
.login label { display: flex; flex-direction: column; gap: .3rem; color: var(--muted); font-size: .9rem; }
.validation-message { color: var(--bad); font-size: .85rem; }

.problem { background: rgba(229, 83, 75, .12); border: 1px solid var(--bad); color: #ffb3ad; padding: .7rem 1rem; border-radius: 8px; }
.muted { color: var(--muted); font-size: .85rem; }
.empty { color: var(--muted); padding: 2rem 0; }
.bad { color: var(--bad); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; color: var(--text); }
a.card:hover { border-color: var(--accent); text-decoration: none; }
.card .label { color: var(--muted); font-size: .85rem; }
.card .value { font-size: 2rem; font-weight: 600; }
.card .value.small { font-size: 1.2rem; padding: .5rem 0 .2rem; }

.filters { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-bottom: 1rem; color: var(--muted); font-size: .9rem; }
.filters label { display: flex; align-items: center; gap: .4rem; }

table.list { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.list th { text-align: left; font-weight: 600; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: var(--panel-2); }
table.list th, table.list td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: none; }
table.list .num { text-align: right; font-variant-numeric: tabular-nums; }
table.list td.message { max-width: 640px; word-break: break-word; }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.badge.open { background: rgba(229, 83, 75, .18); color: #ff9c95; }
.badge.regressed { background: rgba(224, 163, 58, .2); color: #f4c36b; }
.badge.resolved { background: rgba(69, 179, 107, .18); color: #84d9a1; }

.error-title { word-break: break-word; font-size: 1.3rem; }
.resolve { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; }
.resolve p { margin-top: 0; }
.resolve .row { display: flex; gap: .6rem; }
.resolve input { flex: 1; max-width: 480px; }

pre.stack {
    background: #0b0e13;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    overflow: auto;
    max-height: 480px;
    font: 12.5px/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

details summary { cursor: pointer; color: var(--accent); font-size: .85rem; }
details pre.stack { margin-top: .5rem; max-width: 60vw; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--bad); color: #fff; padding: .6rem 1rem; z-index: 10; }
#blazor-error-ui a { color: #fff; text-decoration: underline; margin-left: .5rem; }

@media (max-width: 760px) {
    .shell { flex-direction: column; }
    .side { width: auto; border-right: none; border-bottom: 1px solid var(--line); }
    main { padding: 1rem; }
}

/* Players and moderation */
h3 { font-size: .95rem; margin: 1.2rem 0 .4rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.notice { background: rgba(69, 179, 107, .12); border: 1px solid var(--good); color: #9be3b3; padding: .7rem 1rem; border-radius: 8px; }
.badge.online { background: rgba(79, 142, 247, .2); color: #9cc0ff; }
input.search { min-width: 260px; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row input { flex: 1; min-width: 180px; }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1.5rem; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; }
.panel h2 { margin-top: 0; }
table.kv { border-collapse: collapse; margin-bottom: .5rem; }
table.kv td { padding: .2rem 1.5rem .2rem 0; }
table.kv .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: .6rem; }
.grid4 label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); gap: .2rem; }
.grid4 input { width: 100%; }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.small { padding: .2rem .6rem; font-size: .85rem; }
button:disabled { opacity: .45; cursor: default; }
.confirm { display: inline-flex; gap: .3rem; align-items: center; }
tr.deleted td { opacity: .55; }
tr.deleted td.message { text-decoration: line-through; }
td.data { font: 12px/1.4 ui-monospace, Consolas, monospace; color: var(--muted); word-break: break-all; max-width: 560px; }

.warn-text { color: var(--warn); }
.card .value small { font-size: .9rem; color: var(--muted); font-weight: normal; }
