@charset "utf-8";
/* ECDC -- Base
 *
 * Fonts, elements and the shared components every page uses. Colours come
 * from tokens.css only: nothing here names a colour of its own.
 */

/* ---------- Fonts ---------- */
@font-face { font-family: "Roboto"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/roboto-regular.ttf") format("truetype"); }
@font-face { font-family: "Roboto"; font-weight: 400; font-style: italic; font-display: swap; src: url("/fonts/roboto-italic.ttf") format("truetype"); }
@font-face { font-family: "Roboto"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/roboto-medium.ttf") format("truetype"); }
@font-face { font-family: "Roboto"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/roboto-bold.ttf") format("truetype"); }
@font-face { font-family: "Material Symbols Rounded"; font-weight: 100 700; font-style: normal; font-display: block; src: url("/fonts/MaterialSymbolsRounded.woff2") format("woff2"); }

/* ---------- Elements ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* hidden always wins over a component's display */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--background);
  color: var(--paragraph);
  font: 400 15px/1.5 var(--font-body);
}

h1, h2, h3, h4 { color: var(--headline); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.3rem;  font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 500; }
h4 { font-size: .8rem;   font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--paragraph-muted); }

p { margin: 0 0 1em; }
a { color: var(--ctrl-face); }
small, .muted { color: var(--paragraph-muted); }
code, .code { font-family: var(--font-code); font-size: .9em; }

:focus-visible { outline: 2px solid var(--ctrl-border-focus); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Icons (Material Symbols Rounded, by ligature) ---------- */
.icon {
  font-family: "Material Symbols Rounded";
  font-weight: 400;
  font-style: normal;
  font-size: 1.25em;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  display: inline-block;
  vertical-align: -.2em;
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* ---------- App bar ---------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--appbar-h);
  padding: 0 1.25rem 0 calc((var(--rail-w) - 30px) / 2);
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border);
}
.appbar__brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; letter-spacing: .06em; text-decoration: none; color: var(--headline); }
.appbar__icon { display: block; width: 30px; height: 30px; }
.appbar__gap { flex: 1; }
.appbar__lang { color: var(--paragraph-muted); text-decoration: none; font-size: .9rem; }
.appbar__lang:hover { color: var(--headline); }

/* ---------- Side menu ----------
 * Wide screens: a rail of icons, always there; hovering it (or tabbing into
 * it) slides it out over the page with the names. The page never moves.
 * Small screens: hidden; the logo opens it (menu.js, <html class="menu-open">). */
:root { --appbar-h: 3.25rem; --rail-w: 3.5rem; --nav-w: 15rem; }

.sidenav {
  position: fixed;
  top: var(--appbar-h);
  bottom: 0;
  left: 0;
  z-index: 9;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .6rem .5rem;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--panel-bg);
  border-right: 1px solid var(--border);
  transition: width .16s ease, box-shadow .16s ease;
}
/* The icon's box, above the menu: always the rail's width, never slides out */
.sidebrand {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 11;
  display: none;
  place-items: center;
  width: var(--rail-w);
  height: var(--appbar-h);
  background: var(--panel-bg);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.sidenav__group { display: flex; flex-direction: column; gap: .15rem; }
.sidenav__group--admin { margin-top: auto; padding-top: .5rem; border-top: 1px solid var(--border); }
.sidenav__item {
  display: flex;
  align-items: center;
  gap: .9rem;
  height: 2.5rem;
  padding: 0 .65rem;
  border-radius: var(--radius);
  color: var(--paragraph-muted);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.sidenav__item .icon { flex: none; font-size: 1.35rem; }
.sidenav__item:hover { background: color-mix(in srgb, var(--ctrl-face) 8%, transparent); color: var(--headline); }
.sidenav__item.is-current { background: color-mix(in srgb, var(--ctrl-face) 14%, transparent); color: var(--ctrl-face); }
.sidenav__label { opacity: 0; transition: opacity .12s ease; }
.sidenav__shade { display: none; }

/* Sections with sub-items: when the menu is out, a section opens only while
 * the mouse is over it or it has keyboard focus (on a phone, with a tap:
 * menu.js; the section you are in starts open). The rail shows only icons. */
.sidenav__sec { display: flex; flex-direction: column; }
.sidenav__chev { margin-left: auto; font-size: 1.1rem !important; opacity: 0; transition: transform .16s ease, opacity .12s ease; }
.sidenav__subs { display: none; flex-direction: column; gap: .1rem; margin: .1rem 0 .3rem 2.1rem; border-left: 2px solid var(--border); }
.sidenav__sub { display: block; padding: .4rem .7rem; border-radius: 0 var(--radius) var(--radius) 0; margin-left: -2px; border-left: 2px solid transparent; color: var(--paragraph-muted); font-size: .9rem; text-decoration: none; white-space: nowrap; }
.sidenav__sub:hover { background: color-mix(in srgb, var(--ctrl-face) 8%, transparent); color: var(--headline); }
.sidenav__sub.is-current { border-left-color: var(--ctrl-face); background: color-mix(in srgb, var(--ctrl-face) 10%, transparent); color: var(--ctrl-face); font-weight: 500; }

@media (min-width: 800px) {
  body { padding-left: var(--rail-w); }
  .sidebrand { display: grid; }
  .appbar { padding-left: 1.25rem; }
  .appbar__brand { display: none; }
  .sidenav:hover, .sidenav:focus-within { width: var(--nav-w); box-shadow: var(--shadow); transition-delay: .12s; }
  .sidenav:hover .sidenav__label, .sidenav:focus-within .sidenav__label { opacity: 1; transition-delay: .12s; }
  .sidenav:hover .sidenav__chev, .sidenav:focus-within .sidenav__chev { opacity: 1; }
  .sidenav:is(:hover, :focus-within) .sidenav__sec--subs:is(:hover, :focus-within) .sidenav__subs { display: flex; }
  .sidenav:is(:hover, :focus-within) .sidenav__sec--subs:is(:hover, :focus-within) .sidenav__chev { transform: rotate(180deg); }
}

@media (max-width: 799.98px) {
  .sidenav { width: var(--nav-w); transform: translateX(-100%); visibility: hidden; transition: transform .16s ease, visibility .16s; box-shadow: var(--shadow); }
  .sidenav__label, .sidenav__chev { opacity: 1; }
  .sidenav__sec--subs.is-open .sidenav__subs { display: flex; }
  .sidenav__sec--subs.is-open .sidenav__chev { transform: rotate(180deg); }
  .menu-open .sidenav { transform: none; visibility: visible; }
  .menu-open .sidenav__shade { display: block; position: fixed; inset: var(--appbar-h) 0 0 0; z-index: 8; background: var(--scrim); }
}

/* The theme button: Auto, Light, Dark (saved with the person) */
.appbar__theme { display: inline-flex; }
.appbar__theme .icon, .appbar__theme.button .icon { font-size: 1.3rem; }

/* The person acting now -- or that nobody is */
.userchip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem .25rem .25rem .5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.userchip__avatar {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--ctrl-face);
  color: var(--ctrl-face-text);
  font-size: .75rem;
  font-weight: 700;
}
.userchip__name { font-weight: 500; color: var(--headline); }
.userchip--viewing { color: var(--paragraph-muted); padding-right: .75rem; background: transparent; font: inherit; cursor: pointer; }
.userchip--viewing:hover { border-color: var(--ctrl-border-hover); color: var(--paragraph); }
.userchip__me { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; }
.table .userchip__avatar { width: 1.6rem; height: 1.6rem; margin-right: .4rem; vertical-align: middle; }

/* ---------- Page ---------- */
.page { max-width: 76rem; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.page--wide { max-width: none; }     /* a page that needs the whole screen (an order, the shopping screen) */

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -1.25rem -1.25rem 1.25rem;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.panel__header h2, .panel__header h3 { margin: 0; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 2.5rem;
  padding: .5rem 1rem;
  border: 1px solid var(--ctrl-face);
  border-radius: var(--radius);
  background: var(--ctrl-face);
  color: var(--ctrl-face-text);
  font: 500 .95rem/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
}
.button:hover { background: var(--ctrl-face-hover); border-color: var(--ctrl-face-hover); }
.button[disabled], .button[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

.button--secondary { background: transparent; color: var(--ctrl-text); border-color: var(--ctrl-border); }
.button--secondary:hover { background: transparent; border-color: var(--ctrl-border-hover); }

.button--quiet { background: transparent; color: var(--ctrl-face); border-color: transparent; }
.button--quiet:hover { background: var(--info-bg); border-color: transparent; }

.button--danger { background: var(--destructive); border-color: var(--destructive); color: var(--destructive-text); }
.button--danger:hover { background: var(--destructive); border-color: var(--destructive); filter: brightness(.92); }

.button--small { min-height: 2rem; padding: .3rem .7rem; font-size: .85rem; }
.button--icon { width: 2.5rem; padding: 0; }

.buttons { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.field__label { font-weight: 500; font-size: .9rem; color: var(--headline); }
.field__optional { font-weight: 400; color: var(--paragraph-muted); }

.field__input {
  width: 100%;
  min-height: 2.5rem;
  padding: .5rem .7rem;
  border: 1px solid var(--ctrl-border);
  border-radius: var(--radius);
  background: var(--input);
  color: var(--ctrl-text);
  font: 400 .95rem/1.4 var(--font-body);
}
.field__input:hover { border-color: var(--ctrl-border-hover); }
.field__input:focus { outline: none; border-color: var(--ctrl-border-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ctrl-border-focus) 25%, transparent); }
textarea.field__input { min-height: 6rem; resize: vertical; }
select.field__input option, select.field__input optgroup { background: var(--input); color: var(--ctrl-text); }   /* the open list, legible in both themes */

.field__help { font-size: .85rem; color: var(--paragraph-muted); }

/* Characters left (app.js, data-counter): bottom left, warning past 80%, danger when full */
.counter { display: block; margin-top: .3rem; font-size: .8rem; color: var(--paragraph-muted); text-align: left; font-variant-numeric: tabular-nums; }
.counter--warn { color: var(--warn); font-weight: 500; }
.counter--full { color: var(--debit); font-weight: 700; }

/* A field something depends on, while empty */
.field__needed {
  display: flex;
  gap: .4rem;
  align-items: flex-start;
  padding: .4rem .6rem;
  border-radius: var(--radius);
  background: var(--warn-bg);
  color: var(--warn);
  font-size: .85rem;
}

.field--error .field__input { border-color: var(--debit); }
.field__error { display: flex; gap: .4rem; font-size: .85rem; color: var(--debit); }

.check { display: inline-flex; align-items: center; gap: .5rem; margin-right: 1.25rem; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--ctrl-face); margin: 0; }

.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 1rem; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .15rem .55rem;
  border-radius: var(--radius-pill);
  font-size: .78rem;
  font-weight: 500;
  white-space: nowrap;
  background: var(--border);
  color: var(--paragraph);
}
.badge--pending   { background: var(--warn-bg);   color: var(--warn); }
.badge--confirmed { background: var(--credit-bg); color: var(--credit); }
.badge--rejected  { background: var(--debit-bg);  color: var(--debit); }
.badge--info      { background: var(--info-bg);   color: var(--info); }

/* ---------- Alerts ---------- */
.alert {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .8rem 1rem;
  border-radius: var(--radius);
  border-left: 4px solid currentColor;
  margin-bottom: .75rem;
}
.alert p { margin: 0; color: var(--paragraph); }
.alert strong { display: block; color: var(--headline); }
.alert--info    { background: var(--info-bg);   color: var(--info); }
.alert--success { background: var(--credit-bg); color: var(--credit); }
.alert--warning { background: var(--warn-bg);   color: var(--warn); }
.alert--danger  { background: var(--debit-bg);  color: var(--debit); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-bg); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left;
  font-size: .75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--paragraph-muted);
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: .7rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--ctrl-face) 5%, transparent); }
.table__num, .table th.table__num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table__code { font-family: var(--font-code); font-size: .88rem; }
.table__main { font-weight: 500; color: var(--headline); }
.amount--credit { color: var(--credit); }
.amount--debit  { color: var(--debit); }

/* ---------- Data table (App\Components\DataTable) ----------
 * The list look of the old site: sortable headings, each row its own card,
 * the balance in a red / green box. Only the row's "…" button opens it;
 * a click on the row itself does nothing. */
.dt { display: flex; flex-direction: column; gap: .55rem; }
.dt__head, .dt__row { display: grid; align-items: center; gap: 1rem; padding: 0 1rem; }
.dt--cols-1 > * { grid-template-columns: repeat(1, minmax(0, 1fr)) 2.5rem; }
.dt--cols-2 > * { grid-template-columns: repeat(2, minmax(0, 1fr)) 2.5rem; }
.dt--cols-3 > * { grid-template-columns: repeat(3, minmax(0, 1fr)) 2.5rem; }
.dt--cols-4 > * { grid-template-columns: repeat(4, minmax(0, 1fr)) 2.5rem; }
.dt--cols-5 > * { grid-template-columns: repeat(5, minmax(0, 1fr)) 2.5rem; }
.dt--cols-6 > * { grid-template-columns: repeat(6, minmax(0, 1fr)) 2.5rem; }
.dt--cols-7 > * { grid-template-columns: repeat(7, minmax(0, 1fr)) 2.5rem; }
.dt--cols-8 > * { grid-template-columns: repeat(8, minmax(0, 1fr)) 2.5rem; }
.dt--cols-9 > * { grid-template-columns: repeat(9, minmax(0, 1fr)) 2.5rem; }
.dt--cols-10 > * { grid-template-columns: repeat(10, minmax(0, 1fr)) 2.5rem; }
.dt__head { font-size: .8rem; font-weight: 700; color: var(--headline); padding-bottom: .2rem; }
.dt__th { display: flex; }
.dt__sort { flex: 1; display: inline-flex; align-items: center; justify-content: space-between; gap: .3rem; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: inherit; cursor: pointer; }
.dt__sort .icon { font-size: 1rem; color: var(--paragraph-muted); }
[aria-sort="ascending"] > .dt__sort .icon, [aria-sort="descending"] > .dt__sort .icon { color: var(--ctrl-face); }
.dt__row {
  min-height: 3.4rem;
  background: var(--panel-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--paragraph);
  text-decoration: none;
  font-size: .9rem;
  transition: background-color .2s, color .2s;
}
/* Hover: the control colour, its text white (the "…" and small text follow) */
.dt__row:hover { background: var(--ctrl-face); color: var(--ctrl-face-text); }
.dt__row:hover .dt__more, .dt__row:hover .dt__go, .dt__row:hover .muted, .dt__row:hover small { color: var(--ctrl-face-text); }
.dt__row:hover .balance, .dt__row:hover .po__exp { background: var(--panel-bg); }   /* boxes stay legible on the blue */
.dt__cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt__num { text-align: center; justify-content: center; }
.dt__more { text-align: right; color: var(--headline); }
.dt__empty { padding: 2rem 1rem; text-align: center; color: var(--paragraph-muted); background: var(--panel-bg); border-radius: var(--radius); }

/* The row's "…" button, the only way into the row */
.dt__go { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 6px; color: var(--headline); text-decoration: none; }
.dt__go:hover, .dt__go:focus-visible { background: var(--info-bg); color: var(--ctrl-face); }

/* Rows with a tick */
.dt__tick { width: 1rem; height: 1rem; margin: 0 .6rem 0 0; vertical-align: middle; accent-color: var(--ctrl-face); }
.dt__first { display: inline-flex; align-items: center; gap: .2rem; }
.dt__toggle { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; margin-left: -.3rem; border: 0; border-radius: 4px; background: transparent; color: var(--paragraph-muted); cursor: pointer; }
.dt__toggle:hover { background: var(--info-bg); color: var(--ctrl-face); }
.dt__toggle .icon { font-size: 1.1rem; }
.dt__row:has(.dt__tick:checked) { box-shadow: inset 4px 0 0 var(--ctrl-face), var(--shadow); }

/* Stock status: the old outlined box (fn_item_status) */
.stock { display: inline-block; min-width: 5.5rem; padding: .1rem .5rem; border: 1px solid currentColor; border-radius: 4px; text-align: center; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.stock--out  { color: var(--debit);  background: var(--debit-bg); }
.stock--back { color: var(--warn);   background: var(--warn-bg); }
.stock--low  { color: var(--warn);   background: var(--warn-bg); }
.stock--in   { color: var(--credit); background: var(--credit-bg); }

/* A color swatch (an SVG circle) with its name and the vendor's code */
.swatch { display: inline-flex; align-items: center; gap: .35rem; }
.swatch__dot { flex: none; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .35)); }
.swatch small { font-family: var(--font-code); font-size: .7rem; color: var(--paragraph-muted); }

/* The balance box: red owed, green credit, plain zero */
.balance { display: inline-block; min-width: 4.5rem; padding: .1rem .5rem; border: 1px solid transparent; border-radius: 4px; text-align: center; font-variant-numeric: tabular-nums; }
.balance--debit  { border-color: var(--debit);  color: var(--debit); }
.balance--credit { border-color: var(--credit); color: var(--credit); }

/* A list's top: big title (and its button), search and filters on the right */
.listtop { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.listtop__title { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.listtop__title h1 { margin: 0; font-size: 2.2rem; color: var(--paragraph-muted); }
.listtop__search { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.searchbox { position: relative; width: min(18rem, 100%); }
.searchbox .icon { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: var(--ctrl-face); pointer-events: none; }
.searchbox .field__input { padding-left: 2.2rem; border-color: var(--ctrl-face); }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; padding: .3rem; border-radius: var(--radius); background: var(--panel-bg); }

/* icon | field -- the old filters' and forms' shape */
.ifield {
  display: flex;
  align-items: center;
  min-height: 2.4rem;
  border: 1px solid var(--ctrl-border);
  border-radius: var(--radius);
  background: var(--input);
}
.ifield > .icon { padding: 0 .55rem; color: var(--paragraph-muted); border-right: 1px solid var(--ctrl-border); font-size: 1.15rem; }
.ifield .field__input { border: 0; background: transparent; min-height: 2.3rem; }
.ifield .field__input:focus { box-shadow: none; }
.ifield:focus-within { border-color: var(--ctrl-border-focus); }
.ifield--plain { padding-left: .1rem; }

@media (max-width: 52rem) {
  .dt__head { display: none; }
  .dt__row { grid-template-columns: 1fr 1fr !important; padding: .6rem 1rem; gap: .2rem 1rem; }
  .dt__more { grid-column: 1 / -1; text-align: right; }
}

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .75rem 0; font-size: .9rem; }
.pagination__pages { display: flex; gap: .25rem; }
.pagination__pages > button, .pagination__pages > span {     /* the pages themselves (not the arrow icons inside) */
  display: inline-grid;
  place-items: center;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 .4rem;
  border-radius: var(--radius);
  border: 0;
  background: none;
  color: var(--ctrl-text);
  font: inherit;
  cursor: pointer;
}
.pagination__pages > button:hover { background: var(--info-bg); }
.pagination__pages [aria-current="page"] { background: var(--ctrl-face); color: var(--ctrl-face-text); font-weight: 500; }
.pagination__off { opacity: .35; }

/* ---------- Dialog ---------- */
.dialog {
  width: min(26rem, 100%);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dialog__header { padding: 1.1rem 1.25rem .25rem; }
.dialog__header h2 { margin: 0; }
.dialog__body { padding: .75rem 1.25rem 1rem; }
/* A label over its field (used in dialogs and forms everywhere); fields one under the other get room between them */
.ii__stack { display: flex; flex-direction: column; gap: .25rem; font-size: .72rem; font-weight: 700; color: var(--headline); }
.dialog__body > .ii__stack + .ii__stack,
.dialog__body > .ii__stack + .field__help,
.dialog__body > .ii__stack + .check { margin-top: .9rem; }
.dialog__controls { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.25rem; border-top: 1px solid var(--border); }

/* Who are you? -- people to pick from */
.userpick { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .35rem; }
.userpick__item {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  padding: .5rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--paragraph);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.userpick__item:hover { border-color: var(--ctrl-border-hover); }
.userpick__item[aria-pressed="true"] { border-color: var(--ctrl-face); box-shadow: inset 0 0 0 1px var(--ctrl-face); }
.userpick__method { margin-left: auto; color: var(--paragraph-muted); font-size: .8rem; }

/* PIN entry: one box per digit shown, typed into one real field */
.pin { display: flex; gap: .5rem; justify-content: center; margin: .5rem 0 .25rem; }
.pin__dot {
  width: 2.6rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--ctrl-border);
  border-radius: var(--radius);
  background: var(--input);
  font-size: 1.4rem;
  color: var(--headline);
}
.pin__dot--filled::after { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--headline); }
.pin__dot--current { border-color: var(--ctrl-border-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ctrl-border-focus) 25%, transparent); }

/* Native <dialog> */
dialog.dialog { padding: 0; color: var(--paragraph); max-height: calc(100vh - 2rem); overflow: auto; }
dialog.dialog::backdrop { background: var(--scrim); }
.dialog--wide { width: min(30rem, calc(100% - 2rem)); }

/* Who are you? -- a person's row, and their proof inside it */
.userpick__row { border-radius: var(--radius); border: 1px solid transparent; }
.userpick__row--open { border-color: var(--ctrl-face); }
.userpick__row--open .userpick__item { border-color: transparent; box-shadow: none; }
.userpick__who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.userpick__name { font-weight: 500; color: var(--headline); }
.userpick__sub { font-size: .8rem; color: var(--paragraph-muted); }
.userpick__method { display: inline-flex; align-items: center; gap: .25rem; }
.userpick__proof { padding: .25rem .9rem .9rem; }
.who__proof .field__label { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .6rem; }
.who__actions { display: flex; justify-content: flex-end; margin-top: .5rem; }
.who__switch { margin: .5rem 0 0; font-size: .85rem; color: var(--paragraph-muted); display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; }
.who__search { margin-bottom: .75rem; }
.pin__input { font-family: var(--font-code); font-size: 1.4rem; letter-spacing: .5em; text-align: center; }

/* Person colours (users.color_hard; App\Classes\Person::COLORS) */
.avatar--84adea { background: #84adea; color: #10233f; }
.avatar--ffab40 { background: #ffab40; color: #3d2400; }
.avatar--ffaebd { background: #ffaebd; color: #4a1420; }
.avatar--7fd4c1 { background: #7fd4c1; color: #0d3a30; }
.avatar--b39ddb { background: #b39ddb; color: #2a1846; }
.avatar--f4d35e { background: #f4d35e; color: #3d3100; }
.avatar--a5d6a7 { background: #a5d6a7; color: #133a15; }
.avatar--ef9a9a { background: #ef9a9a; color: #4a1010; }
.avatar--90caf9 { background: #90caf9; color: #0c2c4a; }
.avatar--ffcc80 { background: #ffcc80; color: #422800; }
.avatar--ce93d8 { background: #ce93d8; color: #3a1040; }
.avatar--bcaaa4 { background: #bcaaa4; color: #2e211c; }

/* ---------- The old forms' shape (.ce): section titles, icon | field,
 * two per row, Cancel red, OK green ---------- */
.ce__title { font-size: 1.6rem; color: var(--paragraph-muted); margin-bottom: 1rem; }
.ce { max-width: 32rem; }
.ce h3 { font-size: .95rem; font-weight: 700; color: var(--headline); margin: 1.2rem 0 .5rem; }
.ce h3:first-child { margin-top: 0; }
.ce__row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: .7rem; }
.ce__row > .ifield:only-child { grid-column: 1; }
.ce__buttons { display: flex; gap: 1.5rem; margin-top: 1.5rem; }
.ce__cancel { background: #ee8b88; border-color: #ee8b88; color: #fff; }
.ce__cancel:hover { background: var(--debit); border-color: var(--debit); }
.ce__ok { background: #3ec46d; border-color: #3ec46d; color: #fff; }
.ce__ok:hover { background: #2fa95a; border-color: #2fa95a; }

.ce__row--wide { grid-template-columns: 1fr; }
.ce__row--wide textarea { min-height: 8rem; }
@media (max-width: 52rem) { .ce__row { grid-template-columns: 1fr; } }

/* ---------- Comment threads (App\Components\CommentThread) ----------
 * The old site's comments.css: avatar, bubble with name and text, the age
 * and full date under it; replies one column in, joined by a line. */
.comments { display: grid; grid-template-columns: 3rem 3rem 1fr; }
.comment { position: relative; display: grid; grid-template-columns: 3rem 1fr; margin-bottom: 10px; }
.comment--main { grid-column: 1 / 4; }
.comment--sub { grid-column: 2 / 4; }
.comment__avatar {
  display: flex; justify-content: center; align-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: .75rem; font-weight: 700;     /* as the bar's avatar: two initials */
}
.comment__avatar--none { background: var(--border); color: var(--paragraph-muted); }
.comment__avatar--none .icon { font-size: 1.1rem; }
/* The lines, as the old site drew them (from .comment, which is relative) */
.comment--main:not(:first-child) > .comment__avatar::before { content: ""; position: absolute; left: 15px; top: -10px; height: 8px; border-left: 2px solid var(--ctrl-face); }
.comment--main:not(:last-child) > .comment__avatar::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; border-left: 2px solid var(--ctrl-face); }
.comment--sub > .comment__avatar { width: 26px; height: 26px; font-size: .65rem; margin-top: 3px; }
.comment--sub > .comment__avatar::before { content: ""; position: absolute; left: -33px; top: -10px; width: 29px; height: 27px; border-left: 2px solid var(--ctrl-face); border-bottom: 2px solid var(--ctrl-face); border-end-start-radius: 15px; }
.comment--sub:not(:last-child) > .comment__avatar::after { content: ""; position: absolute; left: -33px; top: 0; bottom: -9px; border-left: 2px solid var(--ctrl-face); }
.comment__bubble { display: grid; gap: 5px; margin-bottom: 5px; padding: 15px; border-radius: 8px; background: var(--comment-bg); color: var(--paragraph); }
.comment__bubble p { margin: 0; font-size: 14px; line-height: 1.15; overflow-wrap: anywhere; }
.comment__name { font-size: 16px; line-height: 16px; font-weight: 700; color: var(--headline); }
.comment__details { display: flex; align-items: center; gap: 15px; margin-left: 10px; color: var(--paragraph-muted); font-size: 14px; }
.comment__reply { border: 0; background: transparent; padding: 4px 8px; margin-left: -8px; border-radius: 6px; color: var(--paragraph-muted); font: inherit; font-weight: 700; cursor: pointer; }
.comment__reply:hover { background: var(--info-bg); color: var(--ctrl-face); }
.comment__full { flex: 1; text-align: right; font-size: 10px; white-space: nowrap; }
.comment__details { flex-wrap: nowrap; }

/* "Write a comment ..." -- avatar, the box, send */
.comment-form { display: grid; grid-template-columns: 3rem 1fr auto; align-items: start; gap: 0 .4rem; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 6px; }
.comment-form--reply { grid-column: 2 / 4; border-top: 0; padding-top: 0; margin: 0 0 10px; grid-template-columns: 2.4rem 1fr auto; }
.comment-form--reply .comment__avatar { width: 26px; height: 26px; font-size: .65rem; }
.comment-form textarea { width: 100%; min-height: 32px; padding: 6px 2px; border: 0; background: transparent; color: var(--paragraph); font: inherit; resize: none; overflow: hidden; }
.comment-form textarea:focus { outline: none; }
.comment-form__field { border-bottom: 1px solid var(--ctrl-border); }
.comment-form__field:focus-within { border-bottom-color: var(--ctrl-border-focus); }
.comment-form__field .counter { display: none; margin: .2rem 0 .3rem; }
.comment-form__field:focus-within .counter, .comment-form__field textarea:not(:placeholder-shown) + .counter { display: block; }
.comment-form__send { width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: transparent; color: var(--ctrl-face); cursor: pointer; }
.comment-form__send:hover { background: var(--info-bg); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--paragraph-muted); }
.empty .icon { font-size: 2.5rem; display: block; margin: 0 auto .5rem; color: var(--border); }
.empty strong { display: block; color: var(--headline); font-size: 1.05rem; margin-bottom: .25rem; }

/* ---------- Page layouts ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar h1 { margin: 0; }
.toolbar__filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.toolbar__filters .field__input { width: auto; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; align-items: start; }
fieldset.field { border: 0; padding: 0; margin: 0 0 1rem; }
.table__nowrap { white-space: nowrap; }
.table__link { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.table__link:hover { text-decoration: underline; }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inline-form .field__input { width: auto; min-width: 12rem; }
.inline-form .check { margin-right: 0; }

/* One centered column of panels (settings pages) */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.me { max-width: 40rem; margin: 0 auto; }

/* My sign-in, People */
.me__who { display: flex; align-items: center; gap: .6rem; }
.me__methods { list-style: none; margin: 0 0 1rem; padding: 0; }
.me__methods li { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.me__methods li:last-child { border-bottom: 0; }
.me__methods li > .icon { color: var(--paragraph-muted); }
.me__methods li > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.me__methods small { color: var(--paragraph-muted); }
.me__methods form { margin: 0; }
.me__steps { padding-left: 1.25rem; }
.me__steps li { margin-bottom: .5rem; }
.me__qr { margin: .75rem 0; }
.me__qr .qr { display: block; width: 11rem; height: auto; border-radius: var(--radius); }
.me__secret { word-break: break-all; }
.onetime { align-items: center; }
.onetime p { flex: 1; }
.onetime__pin { font-family: var(--font-code); font-size: 2rem; font-weight: 700; letter-spacing: .3em; color: var(--headline); }
.swatchpick { display: flex; flex-wrap: wrap; gap: .4rem; }
.swatchpick__item { cursor: pointer; }
.swatchpick__item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatchpick__item .userchip__avatar { width: 2.2rem; height: 2.2rem; outline: 2px solid transparent; outline-offset: 2px; }
.swatchpick__item input:checked + .userchip__avatar { outline-color: var(--ctrl-face); }
.swatchpick__item input:focus-visible + .userchip__avatar { outline-color: var(--ctrl-border-focus); }
.audit__detail { display: block; color: var(--paragraph-muted); font-family: var(--font-code); font-size: .78rem; word-break: break-word; }

/* ---------- Narrow screens ---------- */
@media (max-width: 40rem) {
  .appbar { gap: .75rem; padding-right: .75rem; }
  .userchip--viewing { padding: .35rem; }
  .userchip--viewing .userchip__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .page { padding: 1rem .75rem 3rem; }
}

/* ---------- Purchases' shared bits: expected dates, tabs in a dialog, a code cell ---------- */
.po__exp { display: inline-block; padding: .05rem .45rem; border-radius: var(--radius-pill); border: 1px dashed var(--ctrl-border); color: var(--paragraph-muted); font-size: .76rem; font-weight: 700; white-space: nowrap; }
.po__exp--late { border: 0; background: var(--warn-bg); color: var(--warn); }
.po__exp--slow { border-color: var(--warn); color: var(--warn); }
.po__exp--done { border: 0; color: var(--credit); }
.po__tabs { display: flex; gap: .3rem; margin-bottom: .8rem; border-bottom: 1px solid var(--border); }
.po__tabs span { padding: .4rem .9rem; font-size: .85rem; font-weight: 700; color: var(--paragraph-muted); border-bottom: 2px solid transparent; }
.po__tabs .po__tab--on { color: var(--ctrl-face); border-bottom-color: var(--ctrl-face); }
.po__src { font-family: var(--font-code); font-size: .7rem; color: var(--paragraph-muted); }
.po__prices span small { display: block; }
.dt__code { font-family: var(--font-code); font-size: .82rem; letter-spacing: .02em; }
button.dt__go { border: 0; background: transparent; font: inherit; cursor: pointer; }
.dt__row--off { opacity: .55; }
.po__tabs a { padding: .4rem .9rem; font-size: .85rem; font-weight: 700; color: var(--paragraph-muted); border-bottom: 2px solid transparent; text-decoration: none; }
.po__tabs a.po__tab--on { color: var(--ctrl-face); border-bottom-color: var(--ctrl-face); }
.po__chan { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; }
.po__chan .icon { font-size: 1.05rem; color: var(--paragraph-muted); }
.po__chan--sea .icon { color: var(--info); }
