/* Hand-rolled on purpose: a framework would add more bytes than the whole
   application to render five cards and a table. Dark first, light honoured. */

:root {
    color-scheme: dark light;
    --bg: #101418;
    --card: #171d24;
    --edge: #242c36;
    --text: #d7dde4;
    --dim: #8a94a0;
    --good: #4cc38a;
    --bad: #e5534b;
    --accent: #4f8fd0;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f4f6f8;
        --card: #ffffff;
        --edge: #dde3e9;
        --text: #1c2430;
        --dim: #5b6570;
    }
}

* {
    box-sizing: border-box;
}

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

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--edge);
}

header .brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

header .brand img {
    width: 28px;
    height: 28px;
}

header h1 {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

main {
    max-width: 60rem;
    margin: 0 auto;
    padding: 1.25rem;
    display: grid;
    gap: 1.25rem;
}

footer {
    max-width: 60rem;
    margin: 0 auto;
    padding: 0 1.25rem 2rem;
    color: var(--dim);
    font-size: 0.85rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--edge);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.card h2 {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dim);
}

dl {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 0.35rem 1rem;
    margin: 0;
}

dt {
    color: var(--dim);
}

dd {
    margin: 0;
}

.card.live {
    border-color: var(--good);
}

.card.live h2 {
    color: var(--good);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* The liveness tell: a page that only says "running" cannot be told apart
   from one that is wedged. */
.pulse {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--good);
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.8); }
}

.activity {
    margin: 0 0 0.6rem;
    font: 14px/1.4 ui-monospace, Consolas, monospace;
}

.bar {
    height: 6px;
    border-radius: 3px;
    background: var(--edge);
    overflow: hidden;
}

.bar div {
    height: 100%;
    background: var(--good);
    transition: width 0.4s ease;
}

.card.live .note {
    margin: 0.5rem 0 0;
}

.tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.tabs button {
    background: transparent;
    color: var(--dim);
    border: 1px solid var(--edge);
}

.tabs button.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* A symbol with no calendar yet is dimmed rather than absent, so the tab
   strip shows at a glance what is ready and what is still queued. */
.tabs button.pending {
    opacity: 0.55;
    border-style: dashed;
}

.rolls {
    margin: 0 0 0.75rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table + table {
    margin-top: 1rem;
}

.note {
    color: var(--dim);
    font-size: 0.85rem;
}

.ledger tr.front td {
    color: var(--good);
    font-weight: 600;
}

th,
td {
    text-align: left;
    padding: 0.35rem 0.75rem 0.35rem 0;
    border-bottom: 1px solid var(--edge);
}

th {
    color: var(--dim);
    font-weight: 500;
}

.num {
    text-align: right;
}

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

.problem {
    color: var(--bad);
}

.actions {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

button {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 0.45rem 1rem;
    font: inherit;
    cursor: pointer;
}

button:disabled {
    opacity: 0.5;
    cursor: default;
}

button.quiet {
    background: transparent;
    color: var(--dim);
    border: 1px solid var(--edge);
}

.quiet-note {
    color: var(--dim);
}

.log {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 24rem;
    overflow-y: auto;
    font: 12.5px/1.6 ui-monospace, Consolas, monospace;
}

.log .when {
    color: var(--dim);
    margin-right: 0.6rem;
}

/* The sign-in page. */

body.login main {
    max-width: 22rem;
    margin-top: 4rem;
    text-align: center;
}

body.login .mascot {
    width: 96px;
    height: 96px;
}

body.login form {
    text-align: left;
}

body.login form {
    display: grid;
    gap: 0.75rem;
    background: var(--card);
    border: 1px solid var(--edge);
    border-radius: 8px;
    padding: 1.25rem;
}

body.login input {
    font: inherit;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--edge);
    background: var(--bg);
    color: var(--text);
}
