:root {
    --navy: #0c2d3a;
    --navy-mid: #164a5e;
    --gold: #b7862f;
    --ink: #1e293b;
    --muted: #64748b;
    --line: #e7dfd0;
    --paper: #f6f4ee;
    --card: #fffdf8;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at top, rgba(22, 74, 94, 0.07), transparent 42%),
        var(--paper);
    color: var(--ink);
    font-family: Inter, "Segoe UI", sans-serif;
}
.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 28px;
    background: linear-gradient(90deg, var(--navy), var(--navy-mid));
    color: #f7f1e3;
    border-bottom: 3px solid var(--gold);
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}
.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand strong {
    font-family: Fraunces, Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.brand small {
    color: #e8d5ab;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid var(--gold);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.top-actions { display: flex; align-items: center; gap: 12px; }
.who {
    color: #e8d5ab;
    font-size: 13px;
    font-weight: 600;
}
main { max-width: 1120px; margin: 0 auto; padding: 24px; }
h1 { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 30px; font-weight: 700; letter-spacing: -0.03em; color: var(--navy); }
.lede { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; max-width: 640px; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 18px; }
.count-chip {
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--navy);
    font-size: 13px;
    font-weight: 700;
}
.site-name { font-weight: 700; color: var(--navy); }
.site-host { margin-top: 2px; color: var(--muted); font-size: 12px; }
.db {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 6px;
    background: #f3efe6;
    color: #3f3a32;
    font-size: 12px;
    font-weight: 600;
}
.eyebrow { margin: 0 0 8px; color: #2563eb; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.auth { background: var(--paper); }
.auth main { display: flex; justify-content: center; padding-top: 48px; }
.auth-card, .form-card, .panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
.auth-card, .form-card { width: min(480px, 100%); padding: 28px 24px; }
.form-card { width: min(640px, 100%); }
label { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 700; }
input[type=text], input[type=password], input[type=date] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    font: inherit;
}
input:focus { outline: 2px solid #93c5fd; border-color: #2563eb; }
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--navy);
    background: var(--navy);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}
.auth-card button, .form-card button[type=submit] { margin-top: 18px; }
button.link { background: transparent; border-color: transparent; color: #fff; min-height: 0; padding: 0; }
button.quiet, .quiet { background: #fff; color: var(--navy); }
button.warn { background: #b45309; border-color: #b45309; }
button.danger { background: #fff; color: #b91c1c; border-color: #fecaca; }
button.signout {
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid rgba(247, 241, 227, 0.45);
    background: transparent;
    color: #f7f1e3;
}
button.signout:hover { background: rgba(255, 255, 255, 0.08); }
.form-actions, .row-actions, .date-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.date-row > div { flex: 1; min-width: 160px; }
.form-actions { margin-top: 8px; }
.form-actions .quiet { margin-top: 18px; }
.toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 16px; }
.toolbar .button { flex-shrink: 0; }
.panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { padding: 14px 16px; border-bottom: 1px solid #f0ebe3; text-align: left; vertical-align: middle; font-size: 13px; }
th { background: #faf7f1; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fffaf3; }
.panel-foot { padding: 12px 14px; background: #f8fafc; }
.muted { color: var(--muted); }
.bad { color: #b91c1c; font-weight: 700; }
.pill { display: inline-flex; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; }
.pill.ok { background: #ecfdf5; color: #047857; }
.pill.soon { background: #fff7ed; color: #c2410c; }
.pill.bad { background: #fef2f2; color: #b91c1c; }
.pill.muted { background: #f1f5f9; color: #64748b; }
code { font-size: 12px; color: #334155; }
button.date-link {
    gap: 6px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--navy);
    font-weight: 700;
}
button.date-link span {
    text-decoration: underline;
    text-underline-offset: 3px;
}
button.date-link:hover { color: #1d4ed8; }
.edit-icon { width: 14px; height: 14px; flex: 0 0 auto; }
.end-dialog {
    width: min(420px, calc(100% - 32px));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}
.end-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.end-dialog form { padding: 22px 22px 18px; }
.end-dialog h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.end-dialog button[type=submit] { margin-top: 18px; }
.flash { margin-bottom: 16px; padding: 12px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; line-height: 1.45; }
.flash-ok { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.flash-error { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
@media (max-width: 720px) {
    .toolbar, .page-head { align-items: stretch; flex-direction: column; }
    .top { padding: 12px 16px; }
    .who { display: none; }
    main { padding: 16px; }
}
