/* bb-people admin page, web-app look from bb-design (recipe admin v12 with the payables changes, 8 Nov 2026):
   white frame, Bb mark top left, ⌘K search, 64px icon menu that opens on hover, second column for views,
   Sheets-style grid tables, drill-down pages with bordered panels. Style guide: /Users/keethai/Code/bb-design/style-guide.md §4, §6. */
:root {
  --bg: #ffffff; --ink: #111111; --black: #000000; --muted: #4a4a4a;
  --line: #d9d9d6; --faint: #b5b5b1; --tint: #f2f1ec; --ground: #f0f0ef;
  --blue: #afcdd7; --blue-deep: #4986a0; --alert: #b3261e;
  --r-card: 8px; --r-ctl: 6px; --r-box: 4px;
  --font: "FT Regola Neue", "Pretendard", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mast: 58px; --rail: 64px; --open: 288px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
a { color: inherit; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
:focus-visible { outline: 2px solid var(--blue-deep); outline-offset: 2px; }
.look :focus-visible, .look:focus-visible { outline-color: var(--black); }
.muted { color: var(--muted); }
.lbl { font-size: 13px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.fade { animation: fade .2s ease both; }
.loading { color: var(--muted); animation: fade .3s ease .25s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fade, .loading { animation: none; } }

/* ---------------------------------------------------------------- frame */
.mast { position: fixed; inset: 0 0 auto 0; height: var(--mast); z-index: 20; display: flex; align-items: center; gap: 20px;
  padding: 0 20px 0 calc(var(--rail) + 20px); background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { position: absolute; left: 0; top: 0; width: var(--rail); height: var(--mast); display: flex; align-items: center; justify-content: center;
  background: var(--bg); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); z-index: 32; overflow: hidden;
  transition: width .15s ease .12s; }
.brand .mark { height: 22px; width: auto; display: block; }
.brand .logo { display: none; width: 170px; flex: 0 0 auto; }
body.nav-open .brand { width: var(--open); justify-content: flex-start; padding-left: 24px; transition-delay: .15s; }
body.nav-open .brand .mark { display: none; }
body.nav-open .brand .logo { display: block; }
.kbar { position: relative; display: flex; align-items: center; gap: 10px; width: 420px; max-width: 100%; height: 40px; padding: 0 12px;
  background: var(--ground); border-radius: var(--r-ctl); color: var(--muted); font-size: 15px; }
.kbar input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; font-size: 15px; color: var(--ink); }
.kbar input::placeholder { color: var(--muted); }
.kbar:focus-within { background: var(--bg); outline: 2px solid var(--blue-deep); }
.kbar kbd { font: 500 11px/1 var(--font); color: var(--muted); background: var(--bg); border-radius: var(--r-box); padding: 4px 6px; }
.kbar:focus-within kbd { display: none; }
.kres { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 6px; z-index: 40; color: var(--ink); }
.kres button { display: flex; width: 100%; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: var(--r-ctl); font-size: 15px; }
.kres button .muted { font-size: 13px; margin-left: auto; white-space: nowrap; }
.kres button:hover, .kres button[aria-selected="true"] { background: var(--ground); }
.kres p { margin: 8px 10px; font-size: 14px; color: var(--muted); }
.app-name { margin-left: auto; font-size: 13px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.menubtn { display: none; }

.side { position: fixed; top: var(--mast); bottom: 0; left: 0; width: var(--rail); z-index: 30; display: flex; flex-direction: column;
  padding: 12px 10px; background: var(--bg); border-right: 1px solid var(--line); overflow: hidden;
  transition: width .15s ease .12s; }
.side:hover, .side:focus-within { width: var(--open); transition-delay: .15s; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { position: relative; display: flex; align-items: center; gap: 12px; height: 38px; border-radius: var(--r-ctl); color: var(--muted); white-space: nowrap; }
.nav button .i { margin-left: 13px; }
.nav button .nl { font-size: 14px; opacity: 0; transition: opacity .1s; }
.nav button:hover { background: var(--ground); color: var(--ink); }
.nav button[aria-current="page"] { background: var(--ground); color: var(--ink); font-weight: 500; }
.nav button[aria-current="page"] .i { color: var(--blue-deep); }
.ngrp { height: 1px; background: var(--line); margin: 10px 8px; }
.ngrp span { display: none; }
.badge { position: absolute; top: 2px; left: 24px; min-width: 16px; height: 15px; padding: 0 4px; border-radius: var(--r-box);
  font-size: 10.5px; line-height: 15px; font-weight: 600; text-align: center; background: var(--black); color: var(--bg); }
.badge.look { background: var(--blue); color: var(--black); }
.who { margin-top: auto; padding: 12px 6px 4px; border-top: 1px solid var(--line); white-space: nowrap; opacity: 0; transition: opacity .1s; }
.who .em { font-size: 14px; overflow: hidden; text-overflow: ellipsis; margin: 4px 0 8px; }
.side:hover .nl, .side:focus-within .nl, .side:hover .who, .side:focus-within .who { opacity: 1; }
.side:hover .ngrp, .side:focus-within .ngrp { height: auto; background: none; margin: 14px 0 4px; }
.side:hover .ngrp span, .side:focus-within .ngrp span { display: block; padding: 0 10px; font-size: 13px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.side:hover .badge, .side:focus-within .badge { position: static; margin: 0 12px 0 auto; }
@media (prefers-reduced-motion: reduce) { .brand, .side { transition: none; } }

.app { padding: var(--mast) 0 0 var(--rail); min-height: 100vh; }
.main { padding: 36px 48px 64px; max-width: 1480px; }

/* page with a second column (People: views and outlets) */
.cols { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - var(--mast)); }
.cols > .main { padding-left: 36px; }
.sub2 { border-right: 1px solid var(--line); padding: 28px 12px; }
.sub2 h2 { font-size: 20px; font-weight: 500; margin: 0; padding: 0 10px 10px; }
.sub2 button { display: flex; width: 100%; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: var(--r-ctl); font-size: 15px; }
.sub2 button:hover { background: var(--ground); }
.sub2 button[aria-current="true"] { background: var(--ground); font-weight: 600; }
.sub2 button .c { font-size: 13px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.sub2 button .nm { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub2 .g { padding: 16px 10px 6px; }

/* page head */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding-bottom: 20px; }
.head .acts { display: flex; gap: 8px; align-items: center; }
h1 { font-size: 26px; font-weight: 500; letter-spacing: -.01em; line-height: 1.1; margin: 6px 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sub { font-size: 14px; color: var(--muted); margin: 0; }
.backl { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.backl svg { width: 16px; height: 16px; }
.backl:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.state { font-size: 14px; margin: 8px 0 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 16px; height: 42px; padding: 0 18px; border-radius: var(--r-ctl);
  background: var(--black); color: var(--bg); font-size: 13px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.btn.sec { background: var(--line); color: var(--black); }
.btn.sec:hover { background: #cfcfcc; }
.btn:disabled { background: var(--faint); color: var(--bg); cursor: default; }
.btn.sm { height: 34px; padding: 0 12px; }
.qbtn { font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.qbtn:hover { color: var(--ink); }
@media (pointer: coarse) { .btn { height: 48px; } }

/* overview tiles */
.tiles { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.tiles button { flex: 1 1 0; min-width: 220px; max-width: 340px; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--r-card); text-align: left; }
.tiles button.look { background: var(--blue); border-color: var(--blue); }
.tiles button:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.tiles b { font-size: 32px; font-weight: 400; line-height: 1.2; }
.tiles .tm { font-size: 14px; color: var(--muted); }
.tiles .look .tm { color: var(--ink); }

/* panels */
.card { border: 1px solid var(--line); border-radius: var(--r-card); padding: 0 24px 24px; margin-top: 32px; background: var(--bg); }
.card > h2 { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 -24px 20px; padding: 16px 24px;
  border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.card > h2 .aside { font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
.card.flush { padding-bottom: 0; }
.ed { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; }
.ed > div > .card:first-child { margin-top: 24px; }
.rail .card { padding: 0 20px 20px; }
.rail .card > h2 { margin: 0 -20px 14px; padding: 14px 20px; font-size: 13px; }
.edhead { margin: -36px -48px 0; padding: 14px 48px 20px; border-bottom: 1px solid var(--line); }

.facts { margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.rows > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rows > div:first-child { padding-top: 0; }
.rows > div:last-child { border-bottom: 0; }
.rows .t { font-size: 15px; }
.rows .h { font-size: 14px; color: var(--muted); }
.note { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

/* fields: grey wells */
.f { display: block; margin-bottom: 16px; min-width: 0; }
.f > span { display: block; margin-bottom: 4px; }
.f input, .f select, .rows select, .search {
  width: 100%; height: 40px; padding: 8px 10px; border: 0; border-radius: var(--r-ctl); background: var(--ground); font-size: 16px; }
.f input[readonly] { color: var(--muted); }
.f input:focus, .f select:focus, .rows select:focus, .search:focus { background: var(--bg); outline: 2px solid var(--blue-deep); outline-offset: 0; }
.rows select { width: 190px; flex: 0 0 auto; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 24px; }
.search { width: 260px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { height: 36px; padding: 0 14px; border-radius: var(--r-ctl); background: var(--ground); font-size: 14px; }
.opt[aria-pressed="true"] { background: var(--black); color: var(--bg); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--black); border-radius: var(--r-box); }
.check input:disabled + span { color: var(--faint); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 24px; }
.checks > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checks .lead { font-size: 14px; color: var(--muted); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* tags and swatches */
.tag { display: inline-block; padding: 2px 8px; border-radius: var(--r-ctl); background: var(--line); color: var(--black);
  font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; line-height: 19px; white-space: nowrap; }
.tag.look { background: var(--blue); }
.tag.quiet { background: var(--ground); color: var(--muted); }
.tag.prob { background: var(--bg); color: var(--alert); box-shadow: inset 0 0 0 1px var(--alert); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.sw { display: inline-block; width: 12px; height: 12px; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(17,17,17,.10); }
.sw.none { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }

/* notes */
.hl { background: var(--blue); color: var(--black); padding: 14px 18px; border-radius: var(--r-card); margin: 0 0 20px; font-size: 15px; }
.hl.inline { margin: 12px 0 0; }
.problem { border: 1px solid var(--alert); color: var(--alert); padding: 12px 16px; border-radius: var(--r-card); margin: 0 0 20px; }
.empty { display: flex; align-items: center; gap: 12px; padding: 24px 0; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--black); color: var(--bg);
  padding: 12px 18px; border-radius: var(--r-ctl); font-size: 15px; display: none; }
.toast.on { display: block; animation: fade .2s ease both; }

/* sign-in and no-access pages */
.solo { max-width: 440px; margin: 0 auto; padding: 120px 24px; }
.solo .logo { width: 200px; display: block; margin-bottom: 48px; }
.solo h1 { margin-bottom: 12px; }
.solo p { margin: 0 0 24px; color: var(--muted); }

/* ---------------------------------------------------------------- tables like Sheets */
.tblwrap { position: relative; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--r-ctl); table-layout: fixed; min-width: 1000px; }
.tbl th { position: relative; text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); background: var(--ground);
  padding: 9px 36px 9px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); white-space: nowrap; }
.tbl th:first-child { border-top-left-radius: var(--r-ctl); }
.tbl th:last-child { border-top-right-radius: var(--r-ctl); border-right: 0; }
.tbl th .thl { display: block; overflow: hidden; text-overflow: ellipsis; }
.tbl td { font-size: 15px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line);
  vertical-align: top; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--bg); }
.tbl td:last-child { border-right: 0; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:last-child td:first-child { border-bottom-left-radius: var(--r-ctl); }
.tbl tr:last-child td:last-child { border-bottom-right-radius: var(--r-ctl); }
.tbl tbody tr[data-go] { cursor: pointer; }
.tbl tbody tr[data-go]:hover td { background: #fafaf7; }
.tbl td.nm { color: var(--ink); font-weight: 500; }
.tbl td.wrap { white-space: normal; }
.tbl tr.off td { color: var(--faint); }
.tbl tr.off td.nm { color: var(--muted); }
.tbl .cell { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.tbl .cell > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.fbtn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: var(--r-ctl);
  display: grid; place-items: center; color: var(--muted); }
.fbtn svg { width: 14px; height: 14px; stroke-width: 1.4; }
.fbtn:hover, .fbtn[aria-expanded="true"] { background: var(--line); color: var(--ink); }
th.on .fbtn { background: var(--ink); color: var(--bg); }
th.on .thl { color: var(--ink); }
.fmenu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; width: 260px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 8px; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--ink); white-space: normal; }
th:last-child .fmenu, th:nth-last-child(2) .fmenu { left: auto; right: 0; }
.fm-row { display: block; width: 100%; padding: 8px 10px; border-radius: var(--r-ctl); }
.fm-row:hover { background: var(--ground); }
.fm-row[aria-pressed="true"] { background: var(--ground); font-weight: 500; }
.fm-h { font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 12px 10px 6px; border-top: 1px solid var(--line); margin-top: 6px; }
.fm-q { width: 100%; border: 0; border-radius: var(--r-ctl); background: var(--ground); padding: 8px 10px; font-size: 14px; }
.fm-q:focus { outline: 2px solid var(--blue-deep); outline-offset: 0; background: var(--bg); }
.fm-all { display: flex; gap: 14px; padding: 8px 10px 4px; font-size: 13px; }
.fm-all button { color: var(--blue-deep); }
.fm-all button:hover { text-decoration: underline; text-underline-offset: 2px; }
.fm-list { max-height: 240px; overflow: auto; margin-top: 2px; }
.fm-list label { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-ctl); cursor: pointer; }
.fm-list label:hover { background: var(--ground); }
.fm-list input { width: 16px; height: 16px; margin: 0; accent-color: var(--black); }
.fm-list .v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-list .c { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fm-list p { margin: 8px 10px; font-size: 13px; color: var(--muted); }
.fchips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.fchip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: var(--r-ctl); background: var(--ground); font-size: 14px; }
.fchip:hover { background: var(--line); }
.tools { display: flex; justify-content: flex-end; gap: 12px; margin: 0 0 8px; }

/* ---------------------------------------------------------------- narrower windows */
/* Wide tables scroll inside their frame and keep the first column; the padding leaves room for filter menus */
.tblwrap { overflow-x: auto; padding-bottom: 300px; margin-bottom: -300px; pointer-events: none; }
.tblwrap > * { pointer-events: auto; }
.tbl td:first-child, .tbl th:first-child { position: sticky; left: 0; z-index: 2; }
.tbl th:first-child { z-index: 5; }
.tbl th.open { z-index: 6; }
@media (max-width: 1100px) {
  .main { padding: 28px 32px 48px; }
  .edhead { margin: -28px -32px 0; padding: 12px 32px 18px; }
  .ed { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ed .rail .card:first-child { margin-top: 32px; }
}

/* phone: logotype top left, Menu opens the sections; laptop first */
@media (max-width: 860px) {
  .mast { padding: 0 16px; gap: 12px; }
  .brand { position: static; width: auto; height: auto; border: 0; background: none; }
  .brand .mark { display: none; }
  .brand .logo { display: block; width: 130px; }
  .kbar { display: none; }
  .menubtn { display: inline-flex; margin-left: auto; font-size: 13px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; height: 40px; align-items: center; }
  .app-name { display: none; }
  .side { width: 100%; transform: translateX(-100%); transition: transform .15s ease; }
  .side:hover, .side:focus-within { width: 100%; }
  body.menu-open .side { transform: none; }
  .side .nav button .nl, .side .who { opacity: 1; }
  .side .ngrp { height: auto; background: none; margin: 14px 0 4px; }
  .side .ngrp span { display: block; padding: 0 10px; font-size: 13px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .side .badge { position: static; margin: 0 12px 0 auto; }
  .app { padding-left: 0; }
  .main, .cols > .main { padding: 18px 16px 48px; }
  .edhead { margin: -18px -16px 0; padding: 10px 16px 16px; }
  .cols { display: block; min-height: 0; }
  .sub2 { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
  .sub2 h2, .sub2 .g, .sub2 .outl { display: none; }
  .sub2 button { width: auto; flex: 0 0 auto; height: 36px; align-items: center; background: var(--ground); }
  .sub2 button[aria-current="true"] { background: var(--black); color: var(--bg); }
  .sub2 button[aria-current="true"] .c { color: var(--bg); }
  .tiles button { max-width: none; }
  .search { width: 100%; }
  .head .acts { width: 100%; }
  .rows select { width: 150px; }
  .card { padding: 0 16px 16px; }
  .card > h2 { margin: 0 -16px 16px; padding: 14px 16px; }
  .solo { padding: 64px 16px; }
}

/* bare pages (sign-in, no access) and the yes-or-no dialog */
body.bare .app { padding: 0; }
.modal-bg { position: fixed; inset: 0; z-index: 70; background: rgba(17,17,17,.30); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--bg); border-radius: var(--r-card); padding: 28px 32px; max-width: 440px; width: 100%; }
.modal p { margin: 0 0 20px; font-size: 16px; }
.modal .actions { justify-content: flex-end; margin: 0; }
