/* One dark sheet, sized for reading a lot of rows.
   Deliberately close to the in-game /logs console: the same colours
   per category and the same three severity tints, so somebody who
   knows one already knows the other. */

:root {
    --bg:        #0f1014;
    --panel:     #16181e;
    --panel-2:   #1c1f26;
    --row:       #181a20;
    --row-alt:   #1c1e25;
    --row-hover: #2a2e38;
    --line:      #ffffff14;
    --text:      #e0e4ea;
    --dim:       #969ca4;
    --accent:    #78aaeb;
    --warn:      #46381488;
    --danger:    #501a1a99;
    --good:      #183c1e77;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.45 Roboto, "Segoe UI", system-ui, sans-serif;
}

.hidden { display: none !important; }
.dim { color: var(--dim); }
.error { color: #e0807c; min-height: 1.2em; }

h1 {
    font: 700 18px/1 "Roboto Condensed", Roboto, sans-serif;
    letter-spacing: .12em;
    margin: 0;
    color: var(--accent);
}

/* ── login ─────────────────────────────────────────── */
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 28px;
    width: min(360px, calc(100vw - 32px));
    margin: 14vh auto 0;
}
.card form { display: flex; gap: 8px; margin-top: 16px; }

input, select, button {
    font: inherit;
    color: var(--text);
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 7px 10px;
}
input:focus, select:focus { outline: 1px solid var(--accent); }

button { cursor: pointer; background: #26426b; border-color: #38598e; }
button:hover { background: #33527f; }
button.ghost { background: var(--panel-2); }
button.ghost:hover { background: var(--row-hover); }

/* ── shell ─────────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100%; }

header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--accent);
}
.head-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.live { display: flex; align-items: center; gap: 5px; color: var(--dim); }

/* Two rows: what to look for on top, when to look on the bottom.
   Each row is its own flex line rather than one wrapping strip, so a
   narrow window breaks it where it makes sense instead of stranding a
   date input on its own. */
.filters {
    padding: 8px 16px;
    background: var(--panel-2);
    border-bottom: 1px solid var(--line);
}
.frow {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.frow + .frow { margin-top: 8px; }
.frow input[type="search"] { flex: 1 1 200px; min-width: 150px; }
.frow select { flex: 0 1 auto; }

.rangelabel {
    color: var(--dim);
    font: 700 11px/1 Roboto, sans-serif;
    letter-spacing: .1em;
    text-transform: uppercase;
}
input[type="datetime-local"] {
    font-family: Consolas, ui-monospace, monospace;
    color-scheme: dark;
}

.quick { display: flex; gap: 4px; margin-left: auto; }
.quick button { padding: 7px 9px; }

/* What the current filter actually selects, said once above the table.
   A time range is invisible after you scroll, and "where did yesterday
   go" is the question that produces. */
.scope {
    padding: 7px 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    color: var(--dim);
    font-size: 12px;
}

/* ── the table ─────────────────────────────────────── */
.table-wrap { flex: 1; overflow: auto; }

table { width: 100%; border-collapse: collapse; }
thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    font: 700 11px/1 Roboto, sans-serif;
    letter-spacing: .1em;
    color: var(--dim);
    background: var(--panel);
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
}
tbody td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
tbody tr { background: var(--row); cursor: pointer; }
tbody tr:nth-child(even) { background: var(--row-alt); }
tbody tr:hover { background: var(--row-hover); }

tbody tr.f1 { background-image: linear-gradient(var(--good), var(--good)); }
tbody tr.f2 { background-image: linear-gradient(var(--warn), var(--warn)); }
tbody tr.f3 { background-image: linear-gradient(var(--danger), var(--danger)); }

.col-t { width: 148px; }
.col-c { width: 108px; }
.col-a { width: 210px; }

td.t { color: var(--dim); font-family: Consolas, ui-monospace, monospace; white-space: nowrap; }
td.c { font: 700 11px/1.5 Roboto, sans-serif; letter-spacing: .06em; }
/* WHO is two lines: the character on top in reading weight, the
   account underneath in the dim monospace an id wants. */
td.a { color: var(--text); }
.who-top { display: block; }
.who-sub {
    display: block;
    color: var(--dim);
    font: 11px/1.4 Consolas, ui-monospace, monospace;
}
.who-sub.linky { cursor: pointer; }
.who-sub.linky:hover { color: var(--accent); text-decoration: underline; }
td.m { word-break: break-word; }

/* ── footer + detail ───────────────────────────────── */
footer {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    background: var(--panel);
    border-top: 1px solid var(--line);
}

.overlay {
    position: fixed;
    inset: 0;
    background: #000b;
    display: flex;
    align-items: center;
    justify-content: center;
}
.detail-card { margin: 0; width: min(640px, calc(100vw - 32px)); position: relative; }
.close {
    position: absolute; top: 10px; right: 10px;
    background: none; border: none; font-size: 22px; color: var(--dim);
    padding: 0 6px;
}
dl { margin: 0; display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; }
dt { color: var(--dim); font: 700 11px/1.6 Roboto, sans-serif; letter-spacing: .08em; }
dd { margin: 0; word-break: break-word; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.actions button { font-size: 12px; padding: 5px 9px; }

/* ── the person card ───────────────────────────────── */
/* Taller and scrollable: an account with a year of history has more
   characters and more days than fits, and the useful ones are at the
   top of each list rather than the bottom. */
.person-card {
    margin: 0;
    width: min(780px, calc(100vw - 32px));
    max-height: calc(100vh - 64px);
    overflow: auto;
    position: relative;
    padding: 24px;
}
.person-card h2 {
    font: 700 12px/1 "Roboto Condensed", Roboto, sans-serif;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 20px 0 8px;
}
.person-card h2:first-child {
    margin-top: 0;
    font-size: 16px;
    font-family: Consolas, ui-monospace, monospace;
    letter-spacing: .04em;
    text-transform: none;
}
.person-card p { margin: 0 0 10px; }

table.mini { font-size: 13px; }
table.mini thead th {
    position: static;
    padding: 4px 8px 4px 0;
    background: none;
}
table.mini tbody tr { background: none; cursor: default; }
table.mini tbody tr:hover { background: var(--row-hover); }
table.mini tbody td {
    padding: 4px 8px 4px 0;
    white-space: nowrap;
    vertical-align: middle;
}
table.mini tbody td:first-child { white-space: normal; }
table.mini button { font-size: 11px; padding: 3px 8px; }

.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
    background: var(--panel-2);
    border: 1px solid var(--line);
    font: 11px/1.4 Consolas, ui-monospace, monospace;
    padding: 4px 8px;
}
.chip:hover { background: var(--row-hover); }

@media (max-width: 860px) {
    .quick { margin-left: 0; }
}
@media (max-width: 700px) {
    .col-c { display: none; }
    td.c { display: none; }
    .col-a { width: 140px; }
    .head-right { gap: 8px; }
    .person-card { padding: 18px; }
}
