/* NU shared UI: tokens, top bar, cards, buttons, inputs, badges, tables.
   Used by the public page and the client portal. Blue, cool neutrals, one typeface. */

:root {
  --bg: #f1f5fb;
  --surface: #ffffff;
  --ink: #0e1e3a;
  --ink-2: #41516b;
  --ink-3: #6c7a91;
  --line: #e0e7f1;
  --line-2: #c8d2e2;
  --brand: #1b5fe0;
  --brand-600: #154bb9;
  --brand-50: #e9f0ff;
  --navy: #0a2250;
  --navy-2: #113a8c;
  --teal: #0aa39e;
  --teal-50: #e0f6f4;
  --logo: #ef4423;
  --ok: #0c7847; --ok-bg: #def5e8;
  --warn: #8a5a00; --warn-bg: #fff1cc;
  --bad: #b3261e; --bad-bg: #fde6e3;
  --live: #154bb9; --live-bg: #e3ecff;
  --mute: #4c5a72; --mute-bg: #ecf0f6;
  --sans: "Figtree", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(14, 30, 58, .06), 0 8px 24px rgba(14, 30, 58, .06);
  --bar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 20px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, dl, dd, ul, ol, table, figure { margin: 0; padding: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 2 * var(--gutter), 1180px); margin-inline: auto; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Top bar: stays at the top of the window while the page scrolls */
.bar { position: sticky; top: 0; z-index: 50; background: linear-gradient(90deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; box-shadow: 0 6px 20px rgba(10, 34, 80, .22); }
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: var(--bar-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font: 600 16px/1 var(--sans); letter-spacing: .005em; white-space: nowrap; }
.brand .logo { height: 20px; width: auto; fill: var(--logo); display: block; }
.bar nav { display: flex; align-items: center; gap: clamp(6px, 1.2vw, 14px); }
.bar nav a.l { display: inline-flex; align-items: center; gap: 8px; font: 500 14.5px/1 var(--sans); color: #cdd9f3; text-decoration: none; padding: 9px 12px; border-radius: 9px; white-space: nowrap; transition: background .12s, color .12s; }
.bar nav a.l:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.bar nav a.l.on { color: #fff; background: rgba(255, 255, 255, .16); }
.bar .who { display: inline-flex; align-items: center; gap: 9px; font: 500 14px/1 var(--sans); color: #e3eaf9; white-space: nowrap; margin-left: 6px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #fff; color: var(--navy); font: 700 12px/1 var(--sans); font-style: normal; letter-spacing: .02em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 14.5px/1 var(--sans); padding: 11px 17px; border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, color .12s, box-shadow .12s; box-shadow: 0 1px 2px rgba(21, 75, 185, .3); }
.btn:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line-2); box-shadow: 0 1px 2px rgba(14, 30, 58, .06); }
.btn.secondary:hover { background: #f5f8fc; border-color: #a9b7cd; }
.btn.accent { background: var(--ok); border-color: var(--ok); box-shadow: 0 1px 2px rgba(12, 120, 71, .3); }
.btn.accent:hover { background: #095f38; border-color: #095f38; }
.btn.danger { background: #fff; color: var(--bad); border-color: #ecb6b0; box-shadow: none; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.small { padding: 8px 12px; font-size: 13.5px; border-radius: 8px; }
.btn .ic { width: 16px; height: 16px; }
.btn:disabled { opacity: .55; cursor: default; }
.bar .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .35); color: #fff; box-shadow: none; }
.bar .btn:hover { background: rgba(255, 255, 255, .2); border-color: #fff; }
.bar .btn.solid { background: #fff; color: var(--navy); border-color: #fff; }
.bar .btn.solid:hover { background: #e6eeff; border-color: #e6eeff; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(18px, 2.4vw, 28px); }
.card + .card, .card + .grid2, .grid2 + .card, .banner + .card, .card + .banner { margin-top: 18px; }
.card > h2, .card-h h2 { font: 700 18px/1.3 var(--sans); letter-spacing: -.01em; }
.card > h2 { margin-bottom: 16px; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.card h2 .n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--brand-50); color: var(--brand-600); font: 700 13px/1 var(--sans); margin-right: 12px; vertical-align: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid2.wide-left { grid-template-columns: 3fr 2fr; } }
.grid2 > .card { margin-top: 0; }
.sub { color: var(--ink-2); font-size: 15px; max-width: 62em; }
.card > h2 + .sub { margin-top: -8px; margin-bottom: 16px; }

/* Forms: white fields, visible borders, labels above */
form.f { display: grid; grid-template-columns: 1fr; gap: 16px 18px; }
@media (min-width: 720px) { form.f.c2 { grid-template-columns: 1fr 1fr; } form.f.c3 { grid-template-columns: repeat(3, 1fr); } form.f.c4 { grid-template-columns: repeat(4, 1fr); } .full { grid-column: 1 / -1; } }
label { display: block; font: 600 13.5px/1.3 var(--sans); color: var(--ink); }
label .opt { font-weight: 400; color: var(--ink-3); }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 13px; background: #fff; color: var(--ink); border: 1px solid var(--line-2); border-radius: 10px; font: 400 15px/1.4 var(--sans); box-shadow: inset 0 1px 2px rgba(14, 30, 58, .05); outline: none; transition: border-color .12s, box-shadow .12s; }
textarea { resize: vertical; min-height: 84px; }
input:hover, select:hover, textarea:hover { border-color: #a9b7cd; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(27, 95, 224, .18); }
input::placeholder, textarea::placeholder { color: #9aa6b9; }
input[type=file] { padding: 9px; font-size: 13.5px; background: #f7f9fc; border-style: dashed; }
input[type=checkbox] { display: inline-block; width: 17px; height: 17px; margin: 0 9px 0 0; padding: 0; vertical-align: -3px; box-shadow: none; accent-color: var(--brand); }
label.check { font-weight: 500; display: flex; align-items: center; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status { font: 500 13.5px/1.4 var(--sans); color: var(--ink-2); }
.status.err { color: var(--bad); }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--sans); padding: 5px 10px 5px 8px; border-radius: 999px; white-space: nowrap; background: var(--mute-bg); color: var(--mute); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.live { background: var(--live-bg); color: var(--live); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.big { font-size: 13.5px; padding: 7px 13px 7px 11px; }

/* Tables and key-value rows */
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
.t thead th { font: 600 12.5px/1.3 var(--sans); color: var(--ink-3); text-align: left; padding: 0 16px 10px 0; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.t tbody th, .t tbody td { text-align: left; vertical-align: top; padding: 13px 16px 13px 0; border-bottom: 1px solid var(--line); font-weight: 400; }
.t tbody th { font-weight: 600; }
.t tbody tr:last-child th, .t tbody tr:last-child td { border-bottom: 0; }
.t td:last-child, .t th:last-child { padding-right: 0; }
.t a { color: var(--brand-600); font-weight: 600; text-decoration: none; }
.t a:hover { text-decoration: underline; }
.t a.btn { color: var(--ink); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.kv > div { display: grid; grid-template-columns: 1fr; gap: 2px 20px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv > div:first-child { padding-top: 0; }
@media (min-width: 640px) { .kv > div { grid-template-columns: 200px 1fr; } }
dt { font: 500 13.5px/1.6 var(--sans); color: var(--ink-3); }
code { font: 500 13.5px/1.4 ui-monospace, Menlo, Consolas, monospace; background: var(--mute-bg); padding: 2px 7px; border-radius: 6px; }

/* Phone: tables stack, each cell carries its column label */
@media (max-width: 760px) {
  .t.stack thead { display: none; }
  .t.stack tbody tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .t.stack tbody tr:last-child { border-bottom: 0; }
  .t.stack tbody th, .t.stack tbody td { display: flex; gap: 12px; align-items: baseline; padding: 3px 0; border: 0; text-align: left !important; }
  .t.stack tbody th { display: block; padding-bottom: 6px; }
  .t.stack td:empty { display: none; }
  .t.stack td[data-l]::before { content: attr(data-l); flex: 0 0 104px; font: 500 12.5px/1.5 var(--sans); color: var(--ink-3); }
}

.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 26px 0 44px; font: 400 13.5px/1.6 var(--sans); color: var(--ink-3); }
.foot a { color: var(--ink-2); }

@media print {
  .bar, .tabs, form, .btn, .foot, .noprint { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #bbb; break-inside: avoid; }
}
