/* Guardrounds — UI theme */
:root {
  --bg: #0d1524; --bg2: #131e33; --card: #182540; --card2: #1f2e4d;
  --line: #2a3b5e; --text: #e8edf7; --muted: #93a3c2; --accent: #e8b84b;
  --accent-ink: #211a05; --good: #4cc38a; --bad: #e5645a; --info: #5aa7e5;
  --radius: 12px; --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15.5px; line-height: 1.5; }
.boot { padding: 60px 20px; text-align: center; color: var(--muted); }

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
p.sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }

/* top bar */
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--bg2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .04em; }
.brand .shield { width: 22px; height: 22px; }
.brand small { color: var(--muted); font-weight: 400; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--muted); padding: 6px 11px; border-radius: 8px; font-size: 14px; }
.nav a.active, .nav a:hover { color: var(--text); background: var(--card); text-decoration: none; }
.topbar .spacer { flex: 1; }
.whoami { color: var(--muted); font-size: 13px; text-align: right; line-height: 1.3; }
.whoami b { color: var(--text); }

.wrap { max-width: 1060px; margin: 0 auto; padding: 22px 16px 80px; }

/* cards, tables */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
/* mobile: wide admin tables (People, Audit, …) have more columns than fit a phone —
   let the card scroll horizontally so the action-button column can't spill outside the box */
@media (max-width: 768px) { .card { overflow-x: auto; } }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
td { padding: 9px 10px; border-bottom: 1px solid rgba(42,59,94,.5); vertical-align: top; }
tr:last-child td { border-bottom: 0; }

/* forms */
label.f { display: block; margin-bottom: 12px; }
label.f span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }
input, select, textarea { width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-family: var(--font); font-size: 15px; }
input[type="checkbox"], input[type="radio"] { width: auto; background: none; border: none; padding: 0; border-radius: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
textarea { min-height: 90px; resize: vertical; }

/* buttons */
button { font-family: var(--font); font-size: 15px; font-weight: 600; border: 0; border-radius: 9px; padding: 10px 16px; cursor: pointer; background: var(--card2); color: var(--text); }
button:hover { filter: brightness(1.12); }
button.primary { background: var(--accent); color: var(--accent-ink); }
button.danger { background: #57231f; color: #ffb4ad; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
button.small { font-size: 13px; padding: 6px 11px; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

/* badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.good { background: rgba(76,195,138,.15); color: var(--good); }
.badge.bad { background: rgba(229,100,90,.15); color: var(--bad); }
.badge.info { background: rgba(90,167,229,.15); color: var(--info); }
.badge.warn { background: rgba(232,184,75,.15); color: var(--accent); }
.badge.dim { background: var(--card2); color: var(--muted); }

/* task list (guard) */
.task { display: flex; gap: 12px; padding: 13px 6px; border-bottom: 1px solid rgba(42,59,94,.5); align-items: flex-start; }
.task:last-child { border-bottom: 0; }
.task .tick { width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--line); background: var(--bg2); flex: none; margin-top: 2px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; }
.task.done .tick { background: var(--good); border-color: var(--good); color: #06281a; }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.task .t-title { font-weight: 600; }
.task .t-meta { font-size: 13px; color: var(--muted); }
.task .t-note { font-size: 13.5px; color: var(--text); background: var(--bg2); border-left: 3px solid var(--accent); padding: 6px 10px; border-radius: 0 7px 7px 0; margin-top: 6px; white-space: pre-wrap; }

/* login */
.login-wrap { max-width: 400px; margin: 8vh auto 0; padding: 0 16px; }
.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo .shield { width: 54px; height: 54px; }
.login-logo h1 { letter-spacing: .05em; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* toggles */
.switch { position: relative; width: 46px; height: 26px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .sl { position: absolute; inset: 0; background: var(--card2); border: 1px solid var(--line); border-radius: 999px; transition: .15s; }
.switch .sl::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: var(--muted); transition: .15s; }
.switch input:checked + .sl { background: rgba(232,184,75,.25); border-color: var(--accent); }
.switch input:checked + .sl::before { transform: translateX(20px); background: var(--accent); }

/* misc */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--card2); border: 1px solid var(--line); color: var(--text); padding: 11px 18px; border-radius: 10px; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.45); max-width: 90vw; }
.toast.err { border-color: var(--bad); color: #ffc4be; }
.stat { text-align: center; padding: 14px 8px; }
.stat b { display: block; font-size: 26px; color: var(--accent); }
.stat span { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
pre.dar { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 18px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; }
.thumb { width: 92px; height: 92px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.empty { color: var(--muted); text-align: center; padding: 26px 10px; font-size: 14px; }
.modal-bg { position: fixed; inset: 0; background: rgba(5,9,17,.72); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; }

/* red 06:00 divider between 24-hour cycles on the audit tables */
tr.cycle-break td { border-top: 2px solid var(--bad); color: var(--bad); text-align: center; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 6px 8px; white-space: nowrap; overflow: hidden; }

@media print {
  body { background: #fff; color: #000; }
  .topbar, .no-print { display: none !important; }
  pre.dar { border: 0; background: #fff; color: #000; }
  .card { border: 0; background: #fff; }
  table, .sub, td, th { color: #000; }
  tr.cycle-break td { color: #c0392b; border-top-color: #c0392b; }
}
