/* PayLoad theme. Change the colour scheme here: every colour below comes from these variables. */
:root {
  --bg: #0b0f14;
  --surface: #131a22;
  --surface-2: #1a232d;
  --border: #2a3644;
  --text: #e8eef5;
  --muted: #93a1b1;
  --accent: #2ee6a6;        /* brand accent (cyber green) */
  --accent-contrast: #04140e;
  --primary: #2ee6a6;
  --warn: #f5b942;
  --danger: #ff4d5e;        /* destructive / consequential actions are always red */
  --danger-contrast: #ffffff;
  --ok: #3ddc84;
  --live: #4cc2ff;
  --radius: 12px;
  --nav-h: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: .2em 0 .5em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; color: var(--muted); }
.container { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.container.with-nav { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 1.5rem); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem 1rem;
  padding-top: calc(.6rem + env(safe-area-inset-top, 0px)); background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { text-decoration: none; color: var(--text); display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 1.3rem; letter-spacing: .02em; font-family: var(--mono); }
.accent { color: var(--accent); }
.tagline { font-size: .7rem; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.topbar-actions { display: flex; gap: .25rem; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; }
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.center { text-align: center; } .right { text-align: right; }
.muted { color: var(--muted); } .mono { font-family: var(--mono); font-size: .8rem; }
.inline { display: inline; margin: 0; }
.plain { list-style: none; padding: 0; margin: 0; }
.stack > * + * { margin-top: .9rem; }
.icon { display: inline-block; min-width: 1.2em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .5rem 1rem;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--live); outline-offset: 2px; }
.btn-primary { background: var(--primary); color: var(--accent-contrast); border-color: transparent; }
.btn-danger { background: var(--danger); color: var(--danger-contrast); border-color: transparent; }
.btn-warn { background: var(--warn); color: #1c1400; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-small { min-height: 36px; padding: .25rem .7rem; font-size: .9rem; }
.btn-xl { min-height: 76px; font-size: 1.3rem; width: 100%; max-width: 420px; }
.btn.busy { opacity: .6; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.actions.big .btn { flex: 1 1 8rem; min-height: 56px; font-size: 1.05rem; }
.actions.big form { display: contents; }
.danger-zone { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

input, select, textarea { width: 100%; max-width: 100%; padding: .6rem .7rem; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
input[type=checkbox] { width: auto; min-height: 0; transform: scale(1.3); margin-right: .5rem; }
select[multiple] { min-height: 8rem; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
form > div, .stack > div { margin-bottom: .9rem; }
.errorlist { list-style: none; margin: .25rem 0; padding: .5rem .75rem; color: #fff; background: color-mix(in srgb, var(--danger) 55%, var(--bg));
  border-left: 4px solid var(--danger); border-radius: 6px; }
.helptext { display: block; color: var(--muted); font-size: .8rem; }
fieldset.pause { border: 1px dashed var(--border); border-radius: 10px; padding: .6rem; margin: 0 0 .6rem; }

.flashes { margin-bottom: 1rem; }
.flash { padding: .75rem 1rem; border-radius: 10px; border: 1px solid var(--border); margin-bottom: .5rem; background: var(--surface-2); }
.flash-success { border-color: var(--ok); } .flash-error { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 25%, var(--surface)); }
.flash-warning { border-color: var(--warn); }
.notice-ok { border-color: var(--ok); } .notice-warn { border-color: var(--warn); }

.badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid var(--border); }
.badge-ok { color: var(--ok); border-color: var(--ok); } .badge-warn { color: var(--warn); border-color: var(--warn); }
.badge-live { color: var(--live); border-color: var(--live); }

.live { border-color: var(--live); }
.live-head { display: flex; justify-content: space-between; align-items: center; }
.big-clock { font: 700 3rem/1.1 var(--mono); text-align: center; margin-top: .5rem; font-variant-numeric: tabular-nums; }
.big-value { font: 700 1.6rem/1.2 var(--mono); text-align: center; color: var(--accent); margin: .4rem 0 1rem; }
.big-value .muted { font-size: .9rem; font-weight: 400; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0 0 1rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.entries .entry { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem; margin-bottom: .6rem; }
.entries .entry.unsubmitted { border-left: 5px solid var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.entry-head { display: flex; justify-content: space-between; gap: 1rem; }
.entry-head .value { font: 700 1rem var(--mono); color: var(--accent); }
.entry-meta { color: var(--muted); font-size: .9rem; }
.entry-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .5rem; }

.table-wrap { overflow-x: auto; }
table.grid { border-collapse: collapse; width: 100%; font-size: .9rem; }
.grid th, .grid td { padding: .45rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; white-space: nowrap; }
.grid td:last-child, .grid .notes { white-space: normal; }
.grid thead th, .grid tfoot th { background: var(--surface-2); position: sticky; top: 0; }
.grid tr.inactive td { opacity: .6; } .pause-row td { color: var(--muted); font-size: .85rem; }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.report-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; align-items: center; }
.tabs { display: flex; gap: .4rem; overflow-x: auto; margin-bottom: 1rem; }
.tabs a { padding: .5rem .9rem; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); white-space: nowrap; }
.tabs a.active { background: var(--accent); color: var(--accent-contrast); border-color: transparent; }

.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: var(--surface);
  border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 10; }
.bottom-nav a { flex: 1; min-height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: var(--muted); font-size: .8rem; gap: .1rem; }
.bottom-nav a .icon { font-size: 1.4rem; } .bottom-nav a.active { color: var(--accent); }
@media (max-width: 600px) { .lbl { display: none; } .big-clock { font-size: 2.4rem; } .kv { font-size: .95rem; } }
@media (min-width: 900px) { form.filters, .grid-2 { max-width: 760px; } }
