:root {
    --ink: #12161c;
    --muted: #5b6673;
    --line: #e2e6ec;
    --ground: #f5f6f8;
    --panel: #ffffff;
    --accent: #1f6feb;
    --accent-soft: #eaf1fe;
    --danger: #b42318;
    --ok: #067647;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background: var(--ground);
    color: var(--ink);
    font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1 {
    font-size: 22px;
    margin: 0 0 4px;
}

h2 {
    font-size: 15px;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.shell {
    display: grid;
    grid-template-columns: 232px 1fr;
    min-height: 100%;
}

.side {
    background: #101724;
    color: #c9d4e4;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.side .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    margin-bottom: 22px;
    padding: 0 8px;
}

.side .mark {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--accent);
    font-weight: 700;
}

.side .item {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    color: #c9d4e4;
}

.side .item:hover {
    background: #1b2435;
    text-decoration: none;
}

.side .item.active {
    background: var(--accent);
    color: #fff;
}

main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 12px 28px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.top .who {
    color: var(--muted);
}

article {
    padding: 28px;
    min-width: 0;
}

.lede {
    color: var(--muted);
    margin: 0 0 22px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
}

.card.narrow {
    max-width: 460px;
    margin: 80px auto;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
}

.stat .value {
    font-size: 26px;
    font-weight: 600;
}

.stat .label {
    color: var(--muted);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

th,
td {
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

th {
    background: #fafbfc;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover td {
    background: #fafbfd;
}

.scroll {
    overflow-x: auto;
}

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"] {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    font: inherit;
    min-width: 260px;
}

input:focus {
    outline: 2px solid var(--accent-soft);
    border-color: var(--accent);
}

.button {
    padding: 8px 14px;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.button:hover {
    filter: brightness(1.06);
}

.button.subtle {
    background: var(--panel);
    border-color: var(--line);
    color: var(--ink);
}

.button.danger {
    background: #b42318;
}

.button.danger:hover {
    background: #912018;
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tag {
    display: inline-block;
    white-space: nowrap;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #1a4fa8;
    font-size: 12px;
    margin: 1px 2px 1px 0;
}

.tag.warn {
    background: #fef3f2;
    color: var(--danger);
}

.tag.ok {
    background: #ecfdf3;
    color: var(--ok);
}

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

.error {
    background: #fef3f2;
    border: 1px solid #fecdc9;
    color: var(--danger);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.field {
    display: block;
    margin-bottom: 12px;
}

.field span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
}

.field input {
    width: 100%;
}

.pager {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

dl {
    margin: 0;
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 6px 12px;
}

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

dd {
    margin: 0;
}

/* A page whose only content fills the frame: no chrome of ours around it. */
body:has(.full-bleed) .shell {
    height: 100%;
    overflow: hidden;
}

body:has(.full-bleed) article {
    padding: 0;
    flex: 1;
    display: flex;
    min-height: 0;
}

.full-bleed {
    flex: 1;
    width: 100%;
    border: 0;
    background: var(--panel);
}

th.number,
td.number {
    text-align: right;
}

.error-cell {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--danger);
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    font: inherit;
    resize: vertical;
}

textarea:focus {
    outline: 2px solid var(--accent-soft);
    border-color: var(--accent);
}

.thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
    max-width: 760px;
}

.message {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
}

.message.ours {
    background: var(--accent-soft);
    border-color: #cfe0fd;
    margin-left: 48px;
}

.message .meta {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 6px;
}

.message .body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.event {
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.reply {
    max-width: 760px;
}

.reply .toolbar {
    margin-top: 10px;
}

.card.features {
    margin-bottom: 24px;
}

.feature + .feature {
    border-top: 1px solid var(--line);
    margin-top: 14px;
    padding-top: 14px;
}
