/* Nomad suite glass, after Nomad Control's globals.css.
 * Surface  one recipe: glass + 1px hair border + elev shadow. Floating things (dialogs, menus, toasts) use the denser --float.
 * Colour   --ink / --ink-2 / --ink-3 on a tinted, blurred colour field. --accent = needs you. --danger = destructive. --ok = approved.
 * Each app sets its own field with data-app on <html>. Inside the desktop shell the field is partly see-through (html.desktop).
 */
@font-face { font-family: Outfit; font-weight: 200 500; font-display: swap; src: url(../assets/outfit.woff2) format("woff2"); }

:root {
  --ink: #fff; --ink-2: rgba(255,255,255,.88); --ink-3: rgba(255,255,255,.68);
  --accent: #f6f23a; --accent-rgb: 246,242,58; --danger: #ff6a4a; --ok: #8ef0b4; --warn: #ffc163;
  --on-light: #111; --focus: #fff;
  --base: #2c6a63; --glow-a: #4fa597; --glow-b: #2f5f7e; --shade: #061412; --scrim: .32;
  --font-display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-sans: Outfit, system-ui, -apple-system, sans-serif;
  --t-xs: 12px; --t-sm: 13px; --t-md: 14px; --t-body: 16px; --t-lg: 18px; --t-xl: 22px; --t-2xl: 30px; --t-3xl: 40px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;
  --r-control: 14px; --r-card: 26px; --r-pill: 999px;
  --h-sm: 36px; --h-md: 44px; --h-lg: 52px;
  --hair: rgba(255,255,255,.26); --line: rgba(255,255,255,.34);
  --fill: rgba(255,255,255,.08); --fill-hover: rgba(255,255,255,.18);
  --glass-bg: linear-gradient(160deg, rgba(255,255,255,.18), rgba(255,255,255,.05) 55%, rgba(255,255,255,.09)), rgba(10,8,12,.56);
  --float: rgba(16,18,22,.86);
  --elev: inset 0 1px 0 rgba(255,255,255,.42), inset 0 -18px 40px rgba(0,0,0,.12), 0 34px 70px -20px rgba(0,0,0,.45);
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms; --ease: cubic-bezier(.2,0,0,1);
  color-scheme: dark;
}
[data-app="hr"]  { --base: #2c6a63; --glow-a: #59b3a2; --glow-b: #2f5f7e; --shade: #061412; }
[data-app="one"] { --base: #4b3f86; --glow-a: #8a6fd8; --glow-b: #3a6fb0; --shade: #0b0718; }

* { box-sizing: border-box; margin: 0; }
html, body { min-height: 100%; }
body { font-family: var(--font-sans); font-weight: 300; font-size: var(--t-body); line-height: 1.45; color: var(--ink);
       background: #0b100f; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px rgba(8,6,10,.7); border-radius: 6px; }
/* Regions focused by script after a page change (tabindex="-1", e.g. <main>) are not controls: no ring, no dark halo box. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: 0; box-shadow: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Skip links: hidden until reached with the keyboard. */
a.sr-only:focus-visible { position: fixed; left: 16px; top: 16px; width: auto; height: auto; clip: auto; z-index: 200;
  padding: 10px 16px; border-radius: var(--r-pill); background: var(--float); color: var(--ink); }

/* ---------- backdrop: colour field, blurred figures, grain, scrim ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; background: var(--base); overflow: hidden; }
.backdrop::after { content: ""; position: absolute; inset: 0; background: rgba(8,6,10,var(--scrim)); }
.backdrop .glow { position: absolute; border-radius: 50%; filter: blur(80px); }
.backdrop .a { width: 60vw; height: 60vw; left: -15vw; bottom: -20vw; background: var(--glow-a); opacity: .8; }
.backdrop .b { width: 45vw; height: 45vw; right: -10vw; top: -15vw; background: var(--glow-b); opacity: .7; }
.backdrop .c { width: 40vw; height: 34vw; left: 34vw; top: 30vh; background: var(--shade); opacity: .9; }
.backdrop .grain { position: absolute; inset: -50%; opacity: .45; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
/* In the desktop app the window itself is frosted glass: let some of the desktop show through. */
html.desktop body { background: transparent; }
html.desktop .backdrop { opacity: .72; }

/* ---------- primitives ---------- */
.glass { position: relative; border-radius: var(--r-card); background: var(--glass-bg);
  -webkit-backdrop-filter: blur(30px) saturate(150%); backdrop-filter: blur(30px) saturate(150%);
  border: 1px solid var(--hair); box-shadow: var(--elev); padding: var(--s-5); }
.glass.tight { padding: var(--s-4); }
.glass.flush { padding: 0; overflow: hidden; }
.glass.live { box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 0 0 1px rgba(var(--accent-rgb),.5), 0 0 50px -12px rgba(var(--accent-rgb),.45), 0 34px 70px -20px rgba(0,0,0,.45); }

.title { font-size: var(--t-sm); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); font-weight: 400; }
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -.01em; line-height: 1.1; }
h1.display { font-size: var(--t-3xl); }
h2.display { font-size: var(--t-2xl); }
h3 { font-size: var(--t-lg); font-weight: 400; }
.muted { color: var(--ink-3); }
.small { font-size: var(--t-sm); }
.num { font-size: var(--t-3xl); font-weight: 200; line-height: 1; }

.btn, .chip { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: var(--h-md);
  padding: 0 var(--s-4); border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--fill); color: var(--ink);
  font-size: var(--t-md); font-weight: 400; white-space: nowrap; text-decoration: none;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.btn:not(:disabled):hover, button.chip:not(:disabled):hover { background: var(--fill-hover); }
.btn:not(:disabled):active { transform: scale(.98); }
.btn.primary, .chip[aria-pressed="true"], a.chip[aria-current="page"] { background: #fff; color: var(--on-light); border-color: #fff; font-weight: 500; }
.btn.primary:not(:disabled):hover, .chip[aria-pressed="true"]:hover, a.chip[aria-current="page"]:hover { background: rgba(255,255,255,.86); }
.btn.accent { background: var(--accent); color: var(--on-light); border-color: var(--accent); font-weight: 500; }
.btn.danger { border-color: rgba(255,106,74,.7); color: #ffd6cc; }
.btn.danger:not(:disabled):hover { background: rgba(255,106,74,.22); }
.btn.quiet { border-color: transparent; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--ink-2); }
.btn.quiet:not(:disabled):hover { background: var(--fill); color: var(--ink); }
.btn.sm, .chip.sm { min-height: var(--h-sm); padding: 0 var(--s-3); font-size: var(--t-sm); }
.btn svg, .chip svg { width: 20px; height: 20px; flex: none; }
.link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ink-3); }
.link:hover { text-decoration-color: var(--ink); }

.input, select.input, textarea.input { width: 100%; min-height: var(--h-md); padding: 0 var(--s-3); border-radius: var(--r-control);
  border: 1px solid var(--line); background: rgba(0,0,0,.18); color: var(--ink); }
textarea.input { padding: var(--s-3); min-height: 88px; resize: vertical; }
select.input option { color: #111; }
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: 0; border-color: #fff; }
.input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .8; }
label.field { display: grid; gap: 6px; font-size: var(--t-sm); color: var(--ink-2); }
.check { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--t-sm); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: #fff; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--r-pill); border: 1px solid var(--line); white-space: nowrap; }
.badge.pending { border-color: rgba(var(--accent-rgb),.7); color: var(--accent); }
.badge.approved { border-color: rgba(142,240,180,.6); color: var(--ok); }
.badge.declined, .badge.cancelled { border-color: rgba(255,106,74,.6); color: #ffb3a3; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }

.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 500; font-size: 14px;
  background: rgba(255,255,255,.16); border: 1px solid var(--hair); color: var(--ink); }
.avatar.lg { width: 96px; height: 96px; font-size: 32px; font-weight: 300; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.stack { display: flex; }
.stack .avatar { margin-left: -8px; box-shadow: 0 0 0 2px rgba(0,0,0,.35); }
.stack .avatar:first-child { margin-left: 0; }

.row { display: flex; align-items: center; gap: var(--s-3); }
.list { display: grid; }
.list > * { padding: var(--s-3) var(--s-4); border-top: 1px solid rgba(255,255,255,.12); }
.list > *:first-child { border-top: 0; }
a.item, button.item { display: flex; align-items: center; gap: var(--s-3); width: 100%; text-align: left; text-decoration: none;
  transition: background var(--dur-1) var(--ease); }
a.item:hover, button.item:hover { background: var(--fill); }

/* ---------- dialog, toast ---------- */
dialog { border: 1px solid var(--hair); border-radius: var(--r-card); background: var(--float); color: var(--ink); padding: 0;
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: var(--elev);
  -webkit-backdrop-filter: blur(30px) saturate(150%); backdrop-filter: blur(30px) saturate(150%); }
dialog::backdrop { background: rgba(4,6,8,.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog .dhead { display: flex; align-items: center; justify-content: space-between; padding: var(--s-5) var(--s-5) 0; }
dialog .dbody { padding: var(--s-4) var(--s-5); display: grid; gap: var(--s-4); }
dialog .dfoot { padding: 0 var(--s-5) var(--s-5); display: flex; gap: var(--s-2); justify-content: flex-end; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--float); border: 1px solid var(--hair);
  border-radius: var(--r-pill); padding: 12px 20px; z-index: 100; box-shadow: var(--elev); max-width: calc(100vw - 32px); }
.toast.err { border-color: rgba(255,106,74,.7); }
.callout { padding: var(--s-3) var(--s-4); border-radius: var(--r-control); border: 1px solid rgba(var(--accent-rgb),.5);
  background: rgba(var(--accent-rgb),.08); font-size: var(--t-sm); }
.callout.err { border-color: rgba(255,106,74,.6); background: rgba(255,106,74,.1); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
@media (prefers-reduced-transparency: reduce) {
  .glass, dialog { background: #1b2321; -webkit-backdrop-filter: none; backdrop-filter: none; }
  html.desktop body, body { background: #101615; } .backdrop { display: none; }
}
