/* Fragrance Haven portal - the look.
 *
 * The same family as the Unicorp portal (Kyle asked for its feel): a soft
 * ground, white cards with real rounding and a hairline border, a dark brand
 * bar across the top, a white rail of navigation, tinted status chips.
 *
 * Its OWN colours: a warm ivory ground, a deep plum-black brand bar that
 * carries the FH mark in white, and a muted rose accent with a touch of gold.
 * The accent is chrome only; "something is wrong" is always --red.
 *
 * Every colour is a token on :root and redefined for dark mode. */

:root {
  color-scheme: light;
  --ground: #f7f4f2;
  --raised: #ffffff;
  --rail: #ffffff;
  --sunk: #f8f5f3;
  --line: #e8e0dc;
  --line-soft: #f1ebe8;
  --ink: #1d171b;
  --body: #4a4247;
  --muted: #8a8086;
  --brand-bg: #1a1320;
  --brand-fg: #f5f0f3;
  --gold: #c9a45c;
  --accent: #8c3b62;   --accent-soft: #f6e9ef;
  --red: #b3261e;      --red-soft: #fbeae8;
  --amber: #96620a;    --amber-soft: #fdf3e0;
  --green: #17694a;    --green-soft: #e4f3ec;
  --blue: #2b5ac4;     --blue-soft: #e9eefb;
  --violet: #5b44b8;   --violet-soft: #eeebfa;
  --slate: #4d5663;    --slate-soft: #eef0f3;
  --shadow: 0 1px 2px rgba(29,23,27,.04), 0 1px 3px rgba(29,23,27,.03);
  --shadow-up: 0 2px 6px rgba(29,23,27,.06), 0 8px 24px rgba(29,23,27,.06);
  --r: 14px;
  --r-sm: 9px;
  --measure: 1200px;
  --gutter: 28px;
  --rail-w: 232px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #110d11; --raised: #1a151a; --rail: #161216; --sunk: #201a20;
    --line: #2e262d; --line-soft: #241e24;
    --ink: #f4eff2; --body: #cdc4c9; --muted: #958a90;
    --accent: #e59bbd; --accent-soft: #2c1822;
    --red: #ff7b72;    --red-soft: #2c1615;
    --amber: #e3a444;  --amber-soft: #2a2114;
    --green: #4ec994;  --green-soft: #10261c;
    --blue: #7ea3f5;   --blue-soft: #151d2e;
    --violet: #a493f0; --violet-soft: #1d1930;
    --slate: #9aa4b1;  --slate-soft: #1c2129;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    --shadow-up: 0 2px 6px rgba(0,0,0,.45), 0 10px 30px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #110d11; --raised: #1a151a; --rail: #161216; --sunk: #201a20;
  --line: #2e262d; --line-soft: #241e24;
  --ink: #f4eff2; --body: #cdc4c9; --muted: #958a90;
  --accent: #e59bbd; --accent-soft: #2c1822;
  --red: #ff7b72;    --red-soft: #2c1615;
  --amber: #e3a444;  --amber-soft: #2a2114;
  --green: #4ec994;  --green-soft: #10261c;
  --blue: #7ea3f5;   --blue-soft: #151d2e;
  --violet: #a493f0; --violet-soft: #1d1930;
  --slate: #9aa4b1;  --slate-soft: #1c2129;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --shadow-up: 0 2px 6px rgba(0,0,0,.45), 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--body);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }
a { color: var(--accent); }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* ---- the brand bar: always dark ----------------------------------------- */
.brandbar {
  grid-area: brand; display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 16px 0 12px;
  background: var(--brand-bg); color: var(--brand-fg);
  position: sticky; top: 0; z-index: 60;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brandmark { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brandmark img { width: 32px; height: 32px; display: block; flex: none; }
.brandname { font-family: "Archivo", system-ui, sans-serif; font-weight: 700; font-size: 16px; letter-spacing: -.01em; color: #fff; white-space: nowrap; }
.brandname b { color: var(--gold); font-weight: 700; }
.brandthin { font-weight: 500; opacity: .75; margin-left: 4px; }
.brandright { display: flex; align-items: center; gap: 14px; margin-left: auto; min-width: 0; }
.brandright .clock { font-size: 12px; color: rgba(255,255,255,.55); white-space: nowrap; }
.brandright .who { display: flex; align-items: center; gap: 9px; }
.brandright .av {
  width: 30px; height: 30px; border-radius: 999px; flex: none; display: grid; place-items: center;
  background: rgba(255,255,255,.14); color: #fff; font-size: 12px; font-weight: 600;
}
.brandright .av.has-photo { background: none; overflow: hidden; }
.brandright .av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brandright .nm { color: #fff; font-size: 13px; font-weight: 600; line-height: 1.2; }
.brandright .sub { color: rgba(255,255,255,.5); font-size: 11.5px; line-height: 1.3; }
.brandright button.out {
  font: inherit; font-size: 12.5px; color: rgba(255,255,255,.7); background: none;
  border: 1px solid rgba(255,255,255,.18); border-radius: var(--r-sm); padding: 5px 10px; cursor: pointer;
}
.brandright button.out:hover { color: #fff; background: rgba(255,255,255,.08); }

.burger {
  width: 34px; height: 34px; flex: none; border: 0; border-radius: var(--r-sm);
  background: none; cursor: pointer; display: none; align-content: center; gap: 4px; padding: 0 8px;
}
.burger span { display: block; height: 2px; background: rgba(255,255,255,.85); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.app.menu-open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.app.menu-open .burger span:nth-child(2) { opacity: 0; }
.app.menu-open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- layout -------------------------------------------------------------- */
.app { display: grid; grid-template-areas: "brand" "shell"; grid-template-rows: auto 1fr; min-height: 100%; }
.shell { grid-area: shell; display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 0; }
.rail {
  background: var(--rail); border-right: 1px solid var(--line);
  padding: 14px 12px 18px; position: sticky; top: 56px; height: calc(100vh - 56px);
  display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
}
.navgroup { font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 6px; }
.navgroup:first-child { padding-top: 4px; }
a.nav {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--body); text-decoration: none; font-size: 14px; font-weight: 450;
  transition: background-color .16s ease, color .16s ease;
}
a.nav svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; opacity: .75; }
a.nav:hover { background: var(--line-soft); color: var(--ink); }
a.nav.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
a.nav.on svg { opacity: 1; }
a.nav .tag {
  margin-left: auto; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--muted); background: var(--sunk); border-radius: 999px; padding: 1px 7px;
}
a.nav .tag.hot { background: var(--red); color: #fff; }
.railfoot { margin-top: auto; padding: 16px 10px 0; font-size: 11.5px; color: var(--muted); }

.main { min-width: 0; padding-bottom: 72px; }
.topbar {
  position: sticky; top: 56px; z-index: 20;
  background: color-mix(in srgb, var(--ground) 90%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: 18px 0 14px;
}
.head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 18px; max-width: var(--measure); margin-inline: auto; padding-inline: var(--gutter); }
.head .grow { flex: 1 1 320px; min-width: 0; }
h1 { font-family: "Archivo", system-ui, sans-serif; font-size: 22px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); margin: 0 0 2px; }
.blurb { font-size: 13.5px; color: var(--muted); margin: 0; max-width: 78ch; }
.headright { margin-left: auto; text-align: right; font-size: 12.5px; color: var(--muted); }
.body { max-width: var(--measure); margin-inline: auto; padding: 20px var(--gutter) 0; }
.body.enter { animation: rise .36s cubic-bezier(.16,.68,.3,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
h2 { font-family: "Archivo", system-ui, sans-serif; font-size: 15px; font-weight: 600; color: var(--ink); margin: 28px 0 12px; }
h2:first-child { margin-top: 4px; }

/* ---- tabs --------------------------------------------------------------- */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; margin: 0 0 18px; padding: 4px; background: var(--sunk); border: 1px solid var(--line); border-radius: 999px; }
button.tab { font: inherit; font-size: 13px; font-weight: 500; padding: 6px 14px; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; }
button.tab:hover { color: var(--ink); }
button.tab.on { background: var(--raised); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

/* ---- summary cards ------------------------------------------------------ */
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0 0 18px; }
.cell { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; box-shadow: var(--shadow); min-width: 0; }
.cell .tile { width: 32px; height: 32px; border-radius: 10px; margin-bottom: 10px; display: grid; place-items: center; background: var(--slate-soft); color: var(--slate); }
.cell .tile svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.cell.t-accent .tile { background: var(--accent-soft); color: var(--accent); }
.cell.t-red .tile { background: var(--red-soft); color: var(--red); }
.cell.t-green .tile { background: var(--green-soft); color: var(--green); }
.cell.t-amber .tile { background: var(--amber-soft); color: var(--amber); }
.cell.t-blue .tile { background: var(--blue-soft); color: var(--blue); }
.cell dt { font-size: 12px; font-weight: 500; color: var(--muted); }
.cell dd { margin: 2px 0 0; font-family: "Archivo", system-ui, sans-serif; font-weight: 600; font-size: 22px; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.25; overflow-wrap: anywhere; }
.cell dd.alarm { color: var(--red); }
.cell small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.cell dl { margin: 0; }

.panel { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; margin: 0 0 14px; min-width: 0; }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel-h b { font-family: "Archivo", system-ui, sans-serif; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.panel-h span { font-size: 12px; color: var(--muted); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.line:first-child { border-top: 0; }
.line .t { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.line .v { font-variant-numeric: tabular-nums; white-space: nowrap; }
.line .s { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }

/* ---- chips -------------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 999px; background: currentColor; }
.p-ok { background: var(--green-soft); color: var(--green); }
.p-bad { background: var(--red-soft); color: var(--red); }
.p-warn { background: var(--amber-soft); color: var(--amber); }
.p-new { background: var(--violet-soft); color: var(--violet); }
.p-info { background: var(--blue-soft); color: var(--blue); }
.p-none { background: var(--slate-soft); color: var(--muted); }
.p-accent { background: var(--accent-soft); color: var(--accent); }

/* ---- tables ------------------------------------------------------------- */
.scroll { overflow-x: auto; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: var(--sunk); }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t .k { color: var(--ink); font-weight: 550; }
table.t .s { color: var(--muted); font-size: 12.5px; }

/* ---- controls ----------------------------------------------------------- */
button.act {
  font: inherit; font-size: 13.5px; font-weight: 550; height: 38px; padding: 0 15px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--raised); color: var(--ink); white-space: nowrap;
}
button.act:hover { background: var(--sunk); border-color: var(--muted); }
button.act.go { background: var(--ink); border-color: var(--ink); color: var(--raised); }
button.act.go:hover { background: var(--body); border-color: var(--body); }
button.act.brand { background: var(--accent); border-color: var(--accent); color: #fff; }
button.act.danger { color: var(--red); }
button.act.quiet { border-color: transparent; background: none; color: var(--muted); }
button.act:disabled { opacity: .45; cursor: not-allowed; }
button.act.busy { opacity: .7; cursor: progress; }
.actbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 0 0 18px; }
.said { font-size: 13px; color: var(--muted); }
.said.bad { color: var(--red); }
.said.good { color: var(--green); }
.field { display: flex; flex-direction: column; gap: 5px; margin: 0 0 14px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 550; color: var(--ink); }
.field small { font-size: 12px; color: var(--muted); }
input.in, select.in, textarea.in {
  font: inherit; font-size: 15px; width: 100%; min-height: 42px; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunk); color: var(--ink);
}
textarea.in { min-height: 84px; resize: vertical; line-height: 1.5; }
input.in:focus, select.in:focus, textarea.in:focus { outline: none; border-color: var(--accent); background: var(--raised); }
button:focus-visible, input:focus-visible, a:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.note { font-size: 13.5px; color: var(--body); background: var(--raised); border: 1px solid var(--line); border-left: 3px solid var(--slate); border-radius: var(--r-sm); padding: 12px 15px; margin: 0 0 16px; box-shadow: var(--shadow); }
.note.warn { border-left-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.note.bad { border-left-color: var(--red); background: var(--red-soft); color: var(--red); }
.note.good { border-left-color: var(--green); background: var(--green-soft); color: var(--green); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); font-size: 13.5px; }

/* ---- toast -------------------------------------------------------------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); }
.toast { background: var(--ink); color: var(--raised); border-radius: var(--r-sm); padding: 11px 15px; font-size: 13.5px; box-shadow: var(--shadow-up); animation: rise .25s ease both; }
.toast.bad { background: var(--red); color: #fff; }
.toast.good { background: var(--green); color: #fff; }

/* ---- the sign-in and setup pages ----------------------------------------- */
.gate { min-height: 100%; display: grid; grid-template-rows: auto 1fr; }
.gate-bar { background: var(--brand-bg); height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 16px; }
.gate-bar img { width: 32px; height: 32px; }
.gate-main { display: grid; place-items: start center; padding: 8vh 16px 40px; }
.gate-card { width: 100%; max-width: 400px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-up); padding: 26px 22px 22px; }
.gate-card .mark { display: block; width: 76px; height: 76px; margin: 0 auto 12px; }
.gate-card h1 { text-align: center; font-size: 20px; }
.gate-card .blurb { text-align: center; margin: 0 auto 20px; }
.gate-card button.act { width: 100%; height: 44px; font-size: 15px; }
.gate-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 16px; }
.mark-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mark-light { display: none !important; }
  :root:not([data-theme="light"]) .mark-dark { display: block !important; }
}

/* ---- phone: the rail becomes a drawer ------------------------------------ */
.scrim { display: none; }
@media (max-width: 900px), (max-width: 1100px) and (pointer: coarse) {
  :root { --gutter: 16px; }
  .burger { display: grid; margin-right: -2px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; z-index: 70; inset: 0 auto 0 0; width: min(84vw, 300px); height: 100dvh; top: 0;
    padding: 14px 12px calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-102%); transition: transform .22s ease; overscroll-behavior: contain;
  }
  .app.menu-open .rail { transform: none; box-shadow: 0 0 44px rgba(0,0,0,.5); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(6,4,8,.55); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
  .app.menu-open .scrim { opacity: 1; pointer-events: auto; }
  .brandbar { gap: 10px; padding: 0 12px 0 10px; }
  .brandthin, .brandright .clock, .brandright .sub, .brandright .nm { display: none; }
  .brandname { font-size: 15px; }
  .topbar { padding: 14px 0 12px; }
  h1 { font-size: 20px; }
  .headright { margin-left: 0; text-align: left; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .strip > .cell:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .cell { padding: 11px 12px; }
  .cell dd { font-size: 19px; }
  input.in, select.in, textarea.in { font-size: 16px; }   /* no zoom-on-focus on iPhone */
}
