/* Loud Owl Admin (design/admin-panel): the brand guide's colors and type, laid out as the
   Penpot boards are: a dark sidebar, a white top bar, and white cards on warm paper. */
@font-face {
  font-family: Nunito;
  src: url("/assets/fonts/nunito-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Nunito Sans";
  src: url("/assets/fonts/nunito-sans-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
:root {
  --ink: #17254b;
  --ink-soft: #26386f;
  --blue: #3448c5;
  --blue-tint: #e9ecfb;
  --paper: #f7f5ef;
  --gold: #f6ce55;
  --gold-tint: #fdf3d0;
  --white: #fff;
  --mint: #c9ebdd;
  --lilac: #dfd9fa;
  --coral: #ee927d;
  --muted: #536384;
  --faint: #7c89a6;
  --line: #d8dce5;
  --hair: #e6e8ee;
  --row: #fafaf7;
  --green: #246749;
  --green-tint: #ddf2e8;
  --amber: #815409;
  --amber-tint: #fbefd2;
  --red: #ab3445;
  --red-tint: #f8e1e4;
  --gray-tint: #eef0f4;
  --side-text: #c5cde6;
  --heading: Nunito, ui-rounded, sans-serif;
  --body: "Nunito Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 14px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--heading); margin: 0; }
.hidden { display: none !important; }
/* Every icon is 18 points unless where it sits says otherwise. */
svg[viewBox="0 0 24 24"] { width: 18px; height: 18px; flex: none; }

/* ---------- the shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: var(--side-text); padding: 14px 12px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px 18px; color: var(--white); }
.brand img { width: 40px; height: 40px; }
.brand strong { display: block; font: 900 19px/1.1 var(--heading); }
.brand small { color: var(--gold); font-weight: 800; font-size: 10px; letter-spacing: 1.5px; }
.nav-group { margin: 12px 12px 6px; font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--faint); text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-text); font-weight: 600; text-decoration: none; margin-bottom: 4px; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.nav a:hover { background: var(--ink-soft); }
.nav a.active { background: var(--blue); color: var(--white); font-weight: 800; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav .count { margin-left: auto; background: var(--gold); color: var(--ink); border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 800; }
.nav a.active .count { background: var(--white); }
.me { margin-top: auto; border-top: 1px solid var(--ink-soft); padding: 14px 4px 2px; display: flex; gap: 10px; align-items: center; color: var(--white); }
.me .who { flex: 1; min-width: 0; }
.me .who b { display: block; font-size: 14px; }
.me .who small { color: var(--side-text); text-transform: capitalize; }
.me button { background: none; border: 0; color: var(--side-text); font-weight: 700; font-size: 12px; }

.topbar { height: 64px; background: var(--white); border-bottom: 1px solid var(--hair); display: flex; align-items: center; gap: 16px; padding: 0 32px; position: sticky; top: 0; z-index: 5; }
.topbar .search { flex: 0 1 440px; position: relative; }
.topbar .search input { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--row); padding: 0 12px 0 36px; }
.topbar .search svg { position: absolute; left: 10px; top: 9px; width: 18px; color: var(--muted); }
.env { margin-left: auto; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; font-weight: 700; font-size: 13px; }
.env::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.env.prod::before { background: var(--red); }
.main { min-width: 0; }
.content { padding: 24px 32px 48px; max-width: 1240px; }

/* ---------- headers */
.crumbs { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); font-weight: 600; }
.crumbs span:last-child { color: var(--ink); font-weight: 700; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.page-head .titles { flex: 1; min-width: 0; }
.page-head h1 { font-size: 28px; font-weight: 900; line-height: 1.2; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; background: var(--blue); color: var(--white); font-weight: 700; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; }
.btn.secondary { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--red); }
.btn.danger-outline { background: var(--white); color: var(--red); border-color: var(--red); }
.btn.ghost { background: none; color: var(--blue); padding: 0 8px; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { background: var(--gray-tint); color: var(--faint); border-color: transparent; cursor: default; }
.btn.wide { width: 100%; }
label.field { display: block; margin-bottom: 14px; }
label.field > span, .label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="date"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--white); padding: 9px 12px; min-height: 40px;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; justify-content: space-between; gap: 12px; }
.row { display: flex; gap: 16px; }
.row > * { flex: 1; min-width: 0; }
.checkline { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; font-weight: 600; }
.checkline input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--blue); }
.segment { display: flex; background: var(--gray-tint); border-radius: 10px; padding: 4px; gap: 4px; }
.segment button { flex: 1; border: 0; background: none; border-radius: 8px; padding: 6px 10px; color: var(--muted); font-weight: 600; }
.segment button.on { background: var(--white); color: var(--ink); font-weight: 800; box-shadow: 0 0 0 1px var(--line); }

/* ---------- tabs and filters */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 9px 0 10px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; display: flex; gap: 8px; align-items: center; }
.tabs button.on { color: var(--blue); font-weight: 800; border-color: var(--blue); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters input[type="search"] { width: 440px; min-height: 36px; padding-left: 12px; }
.filters select { width: auto; min-height: 36px; padding: 6px 10px; }

/* ---------- chips */
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 12px; padding: 2px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 20px; }
.chip.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.green { background: var(--green-tint); color: var(--green); }
.chip.amber { background: var(--amber-tint); color: var(--amber); }
.chip.red { background: var(--red-tint); color: var(--red); }
.chip.blue { background: var(--blue-tint); color: var(--blue); }
.chip.gray { background: var(--gray-tint); color: var(--muted); }
.chip.gold { background: var(--gold-tint); color: var(--amber); }
.chip.lilac { background: var(--lilac); color: var(--ink); }
.chip.ink { background: var(--ink); color: var(--white); }
.chip.count { padding: 0 8px; }

/* ---------- cards and grids */
.card { background: var(--white); border: 1px solid var(--hair); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.card > h2, .section-title { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card > h2 .more, .section-title .more { margin-left: auto; font: 700 13px var(--body); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 376px; gap: 16px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { background: var(--white); border: 1px solid var(--hair); border-radius: 14px; padding: 16px 20px; position: relative; }
.stat .k { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: 0.4px; text-transform: uppercase; }
.stat .v { font: 900 30px/1.2 var(--heading); margin: 6px 0 8px; }
.stat .s { font-size: 13px; color: var(--muted); }
.stat .s.red { color: var(--red); font-weight: 700; }
.stat .s.amber { color: var(--amber); font-weight: 700; }
.stat .s.green { color: var(--green); font-weight: 700; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.empty { color: var(--muted); padding: 24px; text-align: center; }

/* ---------- tables */
.table { background: var(--white); border: 1px solid var(--hair); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; padding: 12px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover { background: var(--row); }
tbody tr.selected { background: var(--blue-tint); }
td .t1 { font-weight: 700; display: block; }
td .t2 { font-size: 12px; color: var(--muted); display: block; }
td.clip .t1, td.clip .t2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-top: 1px solid var(--hair); color: var(--muted); font-size: 13px; }
.icons { display: inline-flex; gap: 8px; }
.icons svg { width: 18px; height: 18px; }
.ok { color: var(--green); }
.off { color: var(--line); }
.thumb { width: 40px; height: 40px; border-radius: 8px; background: var(--mint) center / cover; flex: none; display: inline-grid; place-items: center; color: var(--green); }
.thumb svg { width: 20px; }
.cell { display: flex; align-items: center; gap: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--lilac); color: var(--ink); display: inline-grid; place-items: center; font: 800 12px var(--body); flex: none; }

/* ---------- lists inside cards */
.list > div { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.list > div:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow b { display: block; }
.list .grow small { color: var(--muted); display: block; }
.qrow { display: grid; grid-template-columns: 22px 26px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.qrow .n { color: var(--muted); font-weight: 700; text-align: right; }
.qrow .w b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrow .w small { color: var(--muted); }
.qrow .moves { display: flex; gap: 2px; }
.qrow .moves button { border: 0; background: none; color: var(--muted); padding: 2px 4px; font-weight: 800; }
.checks div { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.checks .yes { color: var(--green); }
.checks .no { color: var(--amber); font-weight: 700; }
.timeline div { display: flex; gap: 10px; margin-bottom: 8px; }
.steps { display: flex; gap: 4px; }
.steps i { width: 10px; height: 5px; border-radius: 3px; background: var(--gray-tint); }
.steps i.done { background: var(--blue); }
.bar { height: 8px; background: var(--gray-tint); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; border-bottom: 1px solid var(--line); padding-top: 10px; }
.chart i { flex: 1; background: var(--blue); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.chart i:last-child { background: var(--gold); }
.chart-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- notes, toasts and dialogs */
.note { border-radius: 10px; padding: 10px 14px; display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 13px; margin-bottom: 16px; background: var(--blue-tint); }
.note svg { width: 18px; flex: none; margin-top: 1px; color: var(--blue); }
.note.red { background: var(--red-tint); color: var(--red); }
.note.red svg, .note.amber svg { color: inherit; }
.note.amber { background: var(--amber-tint); color: var(--amber); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--white); padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 50; box-shadow: 0 8px 24px rgba(23, 37, 75, 0.25); }
.toast.error { background: var(--red); }
.scrim { position: fixed; inset: 0; background: rgba(23, 37, 75, 0.5); display: grid; place-items: center; z-index: 40; padding: 24px; }
.dialog { background: var(--white); border-radius: 18px; width: min(600px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.dialog header { padding: 24px 28px 8px; display: flex; gap: 12px; }
.dialog header h2 { font-size: 22px; font-weight: 900; flex: 1; }
.dialog header p { margin: 6px 0 0; color: var(--muted); }
.dialog header button { border: 0; background: none; font-size: 22px; color: var(--muted); line-height: 1; height: 28px; }
.dialog .body { padding: 12px 28px 20px; overflow-y: auto; }
.dialog footer { border-top: 1px solid var(--hair); padding: 18px 28px; display: flex; align-items: center; gap: 12px; }
.dialog footer small { margin-right: auto; color: var(--muted); }
.option { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; cursor: pointer; }
.option input { margin-top: 4px; accent-color: var(--blue); }
.option b { display: block; font-size: 15px; }
.option small { color: var(--muted); font-size: 13px; }
.option.on { border: 2px solid var(--blue); background: var(--blue-tint); }
.option.on.danger { border-color: var(--red); background: var(--red-tint); }
.option.on.danger input { accent-color: var(--red); }

/* ---------- sign-in */
.signin { display: grid; grid-template-columns: 640px 1fr; min-height: 100vh; }
.signin .brandside { background: var(--ink); color: var(--white); padding: 72px; display: flex; flex-direction: column; justify-content: center; }
.signin .brandside img { width: 150px; }
.signin .brandside h1 { font-size: 52px; font-weight: 900; margin: 20px 0 16px; }
.signin .brandside p { color: var(--side-text); font-size: 20px; max-width: 420px; }
.signin form { align-self: center; justify-self: center; width: 420px; }
.signin form h2 { font-size: 34px; font-weight: 900; }
.signin form > p { color: var(--muted); font-size: 15px; }
.signin #google { min-height: 44px; margin: 24px 0 16px; }

@media (max-width: 1100px) {
  .grid { grid-template-columns: 1fr; }
  .signin { grid-template-columns: 1fr; }
  .signin .brandside { display: none; }
}
