/* Built with the Secure Platform Developer Agent (SPDA v1.1) */
/* Practices by: A2C (2026) */
/* Artifact: application stylesheet - shell, components, motion (ADR 0015, ADR 0037). The colors, radii and
   spacing are in tokens.css (light and dark theme, from docs/diseno/figma). No inline styles are used
   anywhere: the CSP forbids them. The tenant's accent color arrives in /brand.css. */

@font-face {
  font-family: "Inter Variable"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter-latin-ext-wght-normal.woff2?v=34b9c504cab7") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter Variable"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter-latin-wght-normal.woff2?v=3100e775e861") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums; min-height: 100vh;
}
a { color: var(--link); }
h1, h2, h3 { line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 0 0 12px; font-weight: 600; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-ctl); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--r-ctl); }
.skip:focus { top: 12px; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }

/* ---------- application shell: navy side menu, quiet top bar, the page ---------- */
.app { display: flex; min-height: 100vh; background: linear-gradient(90deg, var(--side) 0 var(--side-w), transparent var(--side-w)); }  /* the menu's color to the bottom of a tall page */
.sidebar {
  width: var(--side-w); flex: none; background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side-head { display: flex; align-items: center; gap: 12px; padding: 20px 18px 12px; }
.logo-box {
  width: 40px; height: 40px; border-radius: var(--r-ctl); background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; font-weight: 700; font-size: 1rem; flex: none; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .4);
}
.logo-box img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.side-name { color: var(--side-on); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; font-size: 1.05rem; }
.side-sub { color: var(--side-title); font-size: .8rem; }
/* the company selector (tenants): a box that opens the list of the tenants of the person */
.tenant-pick { margin: 0 14px 6px; position: relative; }
.tenant-pick > summary, .tenant-pick > .tenant-now {
  list-style: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; margin: 0; cursor: pointer;
  border: 1px solid var(--side-line); border-radius: var(--r-ctl); color: var(--side-on); background: transparent;
}
.tenant-pick > .tenant-now { cursor: default; }
.tenant-pick > summary::-webkit-details-marker { display: none; }
.tenant-pick strong { display: block; font-size: .92rem; font-weight: 600; overflow-wrap: anywhere; line-height: 1.25; }
.tenant-pick small { display: block; color: var(--side-title); font-size: .78rem; }
.tenant-pick .chev { margin-left: auto; color: var(--side-title); }
.tenant-pick[open] > summary, .tenant-pick > summary:hover { background: var(--side-hover); }
.tenant-list { margin: 6px 0 0; padding: 6px; border: 1px solid var(--side-line); border-radius: var(--r-ctl); background: var(--side); display: grid; gap: 2px; }
.tenant-list form { margin: 0; }
.tenant-list button, .tenant-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 40px; padding: 6px 10px;
  background: none; border: 0; border-radius: var(--r-ctl); color: var(--side-ink); font: inherit; font-size: .9rem; text-align: left; cursor: pointer; text-decoration: none;
}
.tenant-list button:hover, .tenant-list a:hover { background: var(--side-hover); color: var(--side-on); }
.tenant-list [aria-current="true"] { font-weight: 600; color: var(--side-on); }
.sidebar nav { flex: 1; padding: 6px 14px 12px; }
.nav-title { color: var(--side-title); font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; padding: 14px 8px 6px; margin: 0; }
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-list a, .nav-list .soon {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: var(--r-ctl);
  color: var(--side-ink); text-decoration: none; transition: background-color .18s var(--ease), color .18s var(--ease);
}
.nav-list a:hover { background: var(--side-hover); color: var(--side-on); }
.nav-list a[aria-current="page"] { background: #0A3D62; color: var(--side-on); font-weight: 600; box-shadow: inset 3px 0 0 #82CCDD; }
.nav-list .soon { color: var(--side-title); cursor: default; }
.nav-list .soon em { margin-left: auto; font-style: normal; font-size: .72rem; border: 1px solid var(--side-line); border-radius: var(--r-ctl); padding: 1px 7px; }
.sidebar :focus-visible { outline-color: #fff; }
.pill { margin-left: auto; min-width: 22px; padding: 1px 8px; border-radius: var(--r-ctl); font-size: .75rem; font-weight: 700; text-align: center; color: #fff; background: #B54708; }
.pill.red { background: var(--danger-solid); }
.side-foot { border-top: 1px solid var(--side-line); padding: 12px 18px 16px; font-size: .85rem; position: sticky; bottom: 0; background: var(--side); }
.who { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: var(--r-pill); background: #3C6382; color: #fff; display: grid; place-items: center; font-weight: 600; flex: none; font-size: .85rem; }
.who strong { color: var(--side-on); display: block; font-weight: 600; overflow-wrap: anywhere; }
.who span { color: var(--side-title); font-size: .8rem; }
.side-mark { color: var(--side-title); font-size: .75rem; margin: 10px 0 0; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .bar { display: flex; align-items: center; gap: 12px; padding: 14px 32px; min-height: 76px; max-width: 1344px; margin: 0 auto; }
.crumbs { flex: 1 1 0; min-width: 0; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--ink-2); font-size: .9rem; }
.crumbs li { display: flex; align-items: center; gap: 8px; }
.crumbs li + li::before { content: "\203A"; color: var(--ink-2); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--ink); overflow-wrap: anywhere; }
.search { position: relative; display: flex; align-items: center; margin: 0; }
.search .icon { position: absolute; left: 12px; color: var(--ink-2); pointer-events: none; }
.search input { width: 300px; padding-left: 38px; }
.search-icon { display: none; }
.iconbtn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-ctl);
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none;
  transition: background-color .18s var(--ease), border-color .18s var(--ease);
}
.iconbtn:hover { background: var(--card-2); border-color: var(--field-line); }
.bell-dot { position: absolute; top: 9px; right: 10px; width: 10px; height: 10px; border-radius: var(--r-pill); background: var(--orange); border: 2px solid var(--card); }
.hamburger, .scrim, .menu-close { display: none; }
/* the person's menu (profile, activity, language, theme, sign out) */
.usermenu { position: relative; }
.usermenu > summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: .85rem; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu[open] > .menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(300px, 86vw); padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-lift); display: grid; gap: 10px; }
.menu-panel .me { padding: 2px 4px 8px; border-bottom: 1px solid var(--line); }
.menu-panel .me strong { display: block; overflow-wrap: anywhere; }
.menu-panel .me span { color: var(--ink-2); font-size: .85rem; }
.menu-panel form { margin: 0; }
.menu-panel .menu-link, .menu-panel .menu-out { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--ink); font: inherit; text-decoration: none; cursor: pointer; text-align: left; }
.menu-panel .menu-link:hover, .menu-panel .menu-out:hover { background: var(--accent-soft); }
.menu-panel .group-label { font-size: .75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-2); margin: 2px 4px -4px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; margin: 0; background: var(--card-2); }
.seg button { flex: 1; border: 0; background: transparent; color: var(--ink); padding: 0 8px; min-height: 40px; cursor: pointer; font: inherit; font-size: .85rem; white-space: nowrap; transition: background-color .18s var(--ease); }
.seg button:hover { background: var(--accent-soft); }
.seg button[aria-current="true"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }

main { flex: 1; width: 100%; max-width: 1344px; margin: 0 auto; padding: 28px 32px; display: flex; flex-direction: column; gap: var(--sp); }
main > * { margin: 0; min-width: 0; }
.footer { border-top: 1px solid var(--line); color: var(--ink-2); font-size: .85rem; padding: 14px 32px; }
.footer .inner { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; max-width: 1280px; margin: 0 auto; }
.watermark { letter-spacing: .03em; }
.watermark a { color: inherit; }

/* the title of the page, its one-line promise and its main actions */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 600; margin: 0; overflow-wrap: anywhere; letter-spacing: -.01em; }
.page-head p { margin: 6px 0 0; color: var(--ink-2); }
.page-head p:empty { display: none; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.page-actions:empty { display: none; }

/* ---------- cards and components ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--sp); box-shadow: var(--shadow); }
.card.accent-top { background: var(--info-bg); border-color: var(--info-line); color: var(--info-ink); }
.card h2:last-child { margin-bottom: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head p { margin: 4px 0 0; color: var(--ink-2); font-size: .9rem; }
.grid { display: grid; gap: var(--sp); grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.kpis { display: grid; gap: var(--sp); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px var(--sp); box-shadow: var(--shadow); }
.kpi .label { color: var(--ink-2); font-size: .9rem; margin: 0; }
.kpi .value { font-size: 32px; font-weight: 600; line-height: 1.1; margin: 8px 0 6px; letter-spacing: -.01em; }
.kpi .meta { color: var(--ink-2); font-size: .85rem; margin: 0; }
a.kpi { display: block; color: inherit; text-decoration: none; }
a.kpi:hover { border-color: var(--field-line); }
.big-number { font-size: 2rem; margin: 0; font-weight: 600; }
.lead { color: var(--ink-2); margin: 0 0 20px; }
.hint { color: var(--ink-2); font-size: .88rem; margin: 4px 0 0; }
.section-gap { margin-top: 24px; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice ul.todo { list-style: none; padding: 0; display: grid; gap: 6px; }
.notice ul.todo li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; }
.next { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.next h2 { margin-bottom: 4px; }
.next .when { font-size: 1.8rem; font-weight: 600; margin: 0; }
.steps { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.steps li { padding: 5px 14px; border-radius: var(--r-ctl); font-size: .85rem; background: var(--card-2); border: 1px solid var(--line); color: var(--ink-3); }
.steps li[aria-current="step"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.steps li.done { background: var(--accent-soft); border-color: var(--accent-soft); }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding-top: 10px; }
.bars figure { margin: 0; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bars svg { width: 100%; max-width: 54px; height: 140px; }
.bars .bar-rect { fill: var(--accent); transform-origin: bottom; }
.bars figcaption { font-size: .78rem; color: var(--ink-2); }
.cal { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cal li { display: flex; align-items: center; gap: 14px; }
.cal .day { width: 52px; border: 1px solid var(--line); border-radius: var(--r-ctl); text-align: center; padding: 4px 0; background: var(--card-2); }
.cal .day b { display: block; font-size: 1.2rem; line-height: 1.1; }
.cal .day span { font-size: .72rem; text-transform: uppercase; color: var(--ink-2); }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.feed li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed .dot { width: 10px; height: 10px; border-radius: var(--r-pill); background: var(--link); margin-top: 7px; flex: none; }
.feed small { color: var(--ink-2); display: block; }
/* the shortcuts of the home page: one task each */
.quick { display: grid; gap: var(--sp); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.quick a { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.quick a:hover { border-color: var(--field-line); }
.quick strong { display: block; font-weight: 600; }
.quick small { display: block; color: var(--ink-2); font-size: .82rem; }
.quick .icon { color: var(--link); width: 24px; height: 24px; }
.quick .go { margin-left: auto; color: var(--ink-2); }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.todo-list li { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.todo-list li:last-child { border-bottom: 0; }
.todo-list .tone { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--orange); flex: none; }
.todo-list .tone.red { background: var(--red); }
.todo-list .what { display: flex; gap: 10px; align-items: baseline; flex: 1 1 260px; min-width: 0; }

/* ---------- forms and buttons ---------- */
.field { margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 9px 14px; border: 1px solid var(--field-line); border-radius: var(--r-ctl); background: var(--field-bg); color: var(--ink); font: inherit; transition: border-color .18s var(--ease), box-shadow .18s var(--ease); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
input::placeholder { color: var(--ink-2); opacity: 1; }
input[type="checkbox"] { width: 20px; min-height: 20px; vertical-align: middle; margin-right: 6px; accent-color: var(--accent); }
input[type="file"] { padding: 8px; }
.has-error input, .has-error select { border-color: var(--red); }
.error { color: var(--red); margin: 6px 0 0; font-size: .9rem; }
.pw { position: relative; }
.pw input { padding-right: 52px; }
.pw .eye { position: absolute; right: 2px; top: 0; width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: var(--ink-2); cursor: pointer; border-radius: var(--r-ctl); }
.pw .eye:hover { color: var(--ink); }
.pw .eye .off { display: none; }
.pw .eye[aria-pressed="true"] .on { display: none; }
.pw .eye[aria-pressed="true"] .off { display: block; }
button.primary, .button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px;
  background: var(--accent); color: var(--on-accent); border: 1px solid transparent; border-radius: var(--r-ctl); font: inherit; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: background-color .18s var(--ease), transform .18s var(--ease);
}
button.primary:hover, .button:hover, .btn:hover { background: var(--accent-strong); }
.btn.dark { background: var(--side); color: #fff; border-color: var(--side-line); }
.btn.dark:hover { background: var(--side-hover); }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--card-2); border-color: var(--field-line); }
button.link { background: none; border: 0; color: var(--link); cursor: pointer; font: inherit; padding: 10px 0; min-height: 44px; text-decoration: underline; }
form.inline { margin: 0; display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* a list with its "+ New": the option is added for everyone and the change goes to the audit trail */
.with-new { display: flex; gap: 8px; align-items: stretch; }
.with-new select { flex: 1 1 auto; min-width: 0; }
.with-new .btn { flex: none; white-space: nowrap; }

/* ---------- the toolbar over a table and the footer of a table ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0; }
.toolbar .search { flex: 1 1 280px; }
.toolbar .search input { width: 100%; }
.toolbar select { width: auto; min-width: 180px; }
.toolbar .grow { margin-left: auto; }
.table-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; color: var(--ink-2); font-size: .85rem; padding-top: 14px; }
.table-foot .pager { display: flex; gap: 8px; align-items: center; }

.btn.sm, summary.btn.sm { white-space: nowrap; }
.btn.sm, button.btn.sm, summary.btn.sm { min-height: 36px; padding: 6px 14px; font-size: .88rem; display: inline-flex; width: auto; }
summary.btn.sm { margin: 0; list-style: none; cursor: pointer; }
summary.btn.sm::-webkit-details-marker { display: none; }
/* a row action opens its form in a panel under the button instead of widening the table */
details.row-action { margin: 0; position: relative; display: inline-block; text-align: left; white-space: normal; }
details.row-action[open] > .row-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; width: min(340px, 78vw); padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-ctl); box-shadow: var(--shadow-lift); }
.stackcol { display: flex; flex-direction: column; gap: var(--sp); }
.stackcol > * { margin: 0; min-width: 0; }
.anchors { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.anchors a { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 14px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); text-decoration: none; font-size: .9rem; }
.anchors a:hover { background: var(--accent-soft); }
.card[id] { scroll-margin-top: 92px; }
form + .alert, form + table { margin-top: 18px; }
td.num, th.num { text-align: right; }
tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
code { background: var(--card-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: var(--r-ctl); word-break: break-all; }
.qr { background: #fff; padding: 8px; display: inline-block; border-radius: var(--r-ctl); }
ul.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
ul.codes code { font-size: 1.1rem; padding: 6px 10px; display: block; text-align: center; }
details { margin-top: 18px; }
summary { cursor: pointer; color: var(--link); min-height: 44px; display: flex; align-items: center; }

/* ---------- the side panel: edit without leaving the page (the page stays under it) ---------- */
.drawer-scrim { position: fixed; inset: 0; z-index: 70; background: var(--scrim); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80; width: min(480px, 100vw); background: var(--card); color: var(--ink);
  border-left: 1px solid var(--line); box-shadow: var(--shadow-lift); display: flex; flex-direction: column;
}
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px var(--sp) 14px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.25rem; }
.drawer-head p { margin: 4px 0 0; color: var(--ink-2); font-size: .9rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--sp); }
.drawer-body form > .actions { margin-top: 8px; }

/* "+ New" in place: the fields of a new catalog entry open under its list, inside the same panel */
.new-in-place { margin-bottom: 16px; }
.new-in-place > .field { margin-bottom: 8px; }
.new-box { margin: 0; }
.new-box > summary { display: inline-flex; width: auto; }
.new-box[open] > summary { margin-bottom: 12px; }
.new-fields { padding: 14px; border: 1px dashed var(--field-line); border-radius: var(--r-ctl); background: var(--card-2); }
.new-fields .field:last-of-type { margin-bottom: 12px; }

/* ---------- sign-in and other pages without the shell ---------- */
.bare-top { background: var(--card); border-bottom: 1px solid var(--line); }
.bare-top .bar { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.bare-top .brand { font-weight: 700; color: var(--link); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.bare-top .who-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bare-main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 32px; width: 100%; }
.narrow { max-width: 520px; margin: 40px auto; }
.narrow.narrow-sm { max-width: 440px; }
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-art { background: var(--side); color: var(--side-ink); padding: 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
.auth-art .logo-box { width: 52px; height: 52px; }
.auth-art .brandline { display: flex; align-items: center; gap: 14px; color: #fff; font-size: 1.25rem; font-weight: 700; }
.float-card { background: rgba(255, 255, 255, .06); border: 1px solid var(--side-line); border-radius: var(--r-card); padding: 22px; max-width: 420px; }
.float-card h2 { color: #fff; }
.float-card ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.float-card li { display: flex; gap: 10px; align-items: flex-start; }
.float-card .icon { color: #82CCDD; margin-top: 2px; }
.auth-art .mark { font-size: .8rem; color: var(--side-title); margin: 0; }
.auth-form { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; background: var(--bg); gap: 24px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { font-size: 1.7rem; margin: 0 0 6px; }
.auth-box .lead { margin-bottom: 22px; }
.auth-box .btn-full { width: 100%; }
.auth-top { display: flex; justify-content: flex-end; width: 100%; max-width: 400px; }
.hint-line { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); font-size: .88rem; margin-top: 18px; }
.auth-simple { max-width: 520px; margin: 0 auto; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; margin: 0; background: var(--card); }
.lang button { border: 0; background: transparent; color: var(--ink); padding: 0 12px; min-height: 44px; cursor: pointer; font: inherit; font-size: .9rem; transition: background-color .18s var(--ease); }
.lang button[aria-current="true"] { background: var(--accent); color: var(--on-accent); }

/* ---------- motion (everything below is off with prefers-reduced-motion) ---------- */
.htmx-indicator { display: none; color: var(--ink-2); }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }
.skeleton { display: none; }
.htmx-request .skeleton { display: block; height: 14px; border-radius: var(--r-ctl); background: var(--line); margin: 10px 0; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  @keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  @keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(194, 65, 12, .45); } 50% { box-shadow: 0 0 0 6px rgba(194, 65, 12, 0); } }
  @keyframes shimmer { from { opacity: .45; } to { opacity: 1; } }
  @keyframes slide-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
  .rise > * { animation: rise .5s var(--ease) both; }
  .rise > *:nth-child(2) { animation-delay: 50ms; } .rise > *:nth-child(3) { animation-delay: 100ms; }
  .rise > *:nth-child(4) { animation-delay: 150ms; } .rise > *:nth-child(5) { animation-delay: 200ms; }
  .rise > *:nth-child(6) { animation-delay: 250ms; } .rise > *:nth-child(7) { animation-delay: 300ms; }
  .rise > *:nth-child(n+8) { animation-delay: 350ms; }
  .kpis > * { animation: rise .5s var(--ease) both; }
  .kpis > *:nth-child(2) { animation-delay: 50ms; } .kpis > *:nth-child(3) { animation-delay: 100ms; } .kpis > *:nth-child(4) { animation-delay: 150ms; }
  .bars .bar-rect { animation: grow .7s var(--ease) both; }
  .bell-dot { animation: pulse 2s ease-in-out infinite; }
  .htmx-request .skeleton { animation: shimmer .9s ease-in-out infinite alternate; }
  .drawer { animation: slide-in .24s var(--ease) both; }
  .sidebar { transition: transform .32s var(--ease); }
  .scrim { transition: opacity .32s var(--ease); }
}

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search input { width: 200px; }
}
@media (max-width: 900px) {
  .topbar .search { display: none; }
  .search-icon { display: inline-grid; }
}
@media (max-width: 767px) {
  .hamburger { display: inline-grid; }
  body.menu-open { overflow: hidden; }
  .app { background: none; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; width: 304px; max-width: 86vw; transform: translateX(-100%); visibility: hidden; }
  .menu-open .sidebar { transform: none; visibility: visible; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: var(--scrim); opacity: 0; pointer-events: none; }
  .menu-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-close { display: inline-grid; position: sticky; top: 10px; align-self: flex-end; margin: 10px 10px -54px 0; z-index: 2; background: transparent; border-color: var(--side-line); color: #fff; }
  .topbar .bar { padding: 10px 14px; min-height: 64px; gap: 8px; }
  .crumbs li:not(:last-child) { display: none; }
  .crumbs li + li::before { content: none; }
  .topbar .search { display: none; }
  .search-icon { display: inline-grid; }
  main { padding: 18px 14px; gap: 16px; }
  .page-head h1 { font-size: 24px; }
  .footer { padding: 12px 14px; }
  .kpis { gap: 12px; } .kpi { padding: 14px; } .kpi .value { font-size: 26px; }
  .grid { grid-template-columns: 1fr; }
  .toolbar select { width: 100%; }
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth-art { padding: 24px 20px; gap: 18px; }
  .auth-art .float-card { display: none; }
  .auth-form { padding: 28px 18px 36px; }
}
@media (min-width: 768px) {
  .menu-close, .scrim { display: none !important; }
}
/* the table stacks by the width of ITS card (a 768 px screen with the menu open has a ~430 px card) */
@container (max-width: 699px) {
  details.row-action { display: block; width: 100%; }
  details.row-action[open] > .row-panel { position: static; width: 100%; box-shadow: none; margin-top: 8px; }
}



@media print {
  .sidebar, .no-print, .lang, .scrim, .skip, .bare-top, .topbar .search, .topbar .iconbtn, .usermenu, .drawer, .drawer-scrim, .page-actions { display: none !important; }
  .app { display: block; }
  .topbar { position: static; border: 0; background: transparent; }
  .topbar .bar { padding: 0 0 12px; min-height: 0; }
  body, :root { background: #fff !important; color: #000 !important; color-scheme: light; }
  .card, .kpi { border: 0; padding: 0; box-shadow: none; background: transparent; color: #000; }
  th { background: transparent; color: #000; }
  a, .badge, code, .hint, p, li, td, h1, h2 { color: #000 !important; }
  .footer { border-top: 1px solid #999; color: #444; padding: 12px 0; }
  main { padding: 0; }
}

/* Everything that moves is off when the system asks for less motion (WCAG 2.3.3). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.tenant-line { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }

/* ---- the employee portal: its own header and pages (ADR 0052), distinct from the operators' side ---- */
.portal-top { background: var(--card); border-bottom: 1px solid var(--line); border-top: 4px solid var(--accent); }
.portal-top .bar { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; }
.portal-top .brand { font-weight: 700; color: var(--link); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.portal-top .brand small { display: block; font-weight: 400; color: var(--ink-2); font-size: .8rem; }
.portal-nav { display: flex; flex-wrap: wrap; gap: 4px 6px; flex: 1 1 auto; }
.portal-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--r-ctl); color: var(--ink); text-decoration: none; min-height: 44px; }
.portal-nav a:hover { background: var(--accent-soft); }
.portal-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.portal-top .who-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.portal-main { max-width: 960px; }
.portal-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.portal-list .card { margin: 0; padding: 0; }
.portal-list .card a { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 20px; color: var(--ink); text-decoration: none; min-height: 64px; }
.portal-list .card a:hover { background: var(--accent-soft); border-radius: var(--r-card); }
.portal-list .period { font-weight: 600; }
.portal-list .net { font-size: 1.25rem; font-weight: 700; }
.portal-list .net small { font-size: .8rem; font-weight: 400; color: var(--ink-2); margin-right: 6px; }
.portal-login-box { max-width: 520px; margin: 0 auto; padding: 24px 16px 48px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
dl.facts dt { color: var(--ink-2); }
dl.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 480px) { dl.facts { grid-template-columns: 1fr; gap: 0; } dl.facts dd { margin-bottom: 10px; } }

/* ---- payslip views: tabs and the receipt (screen, phone and letter-size print) ---- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 16px; border: 1px solid transparent; border-bottom: 0; border-radius: var(--r-ctl) var(--r-ctl) 0 0; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; color: var(--ink-2); }
.tabs a:hover { color: var(--ink); background: var(--card-2); }
.tabs a[aria-current="page"] { background: var(--card); color: var(--ink); font-weight: 600; border-color: var(--line); box-shadow: inset 0 3px 0 var(--accent); }
.receipt { max-width: 860px; }
.receipt-legend { margin: 0 0 12px; padding: 8px 12px; border: 2px dashed var(--orange); font-weight: 600; text-align: center; }
.receipt-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; justify-content: space-between; }
.receipt-brand { font-size: 1.25rem; font-weight: 700; margin: 0; }
.receipt-period p { margin: 0 0 4px; }
.receipt-data { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 16px; margin: 0; }
.receipt-data dt { color: var(--ink-2); font-size: .85rem; }
.receipt-data dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }
.receipt section { margin-top: 20px; }
.version-note { margin: 0 0 14px; padding: 10px 16px; }
.version-note summary { cursor: pointer; }
.receipt section > h2 { margin-bottom: 8px; }
.receipt-net { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 8px; padding: 14px 16px; border: 2px solid var(--accent); border-radius: var(--r-card); font-size: 1.1rem; }
.receipt-net strong { font-size: 1.7rem; }
@media print {
  @page { size: letter; margin: 14mm; }
  .tabs { display: none !important; }
  .receipt { max-width: none; font-size: 11pt; }
  .receipt-net { border: 2px solid #000; }
  .receipt table { page-break-inside: avoid; }
  /* the printed receipt is always a plain table, whatever the width of the sheet */
  .receipt table.stack thead { position: static; width: auto; height: auto; clip: auto; overflow: visible; }
  .receipt table.stack { display: table; }
  .receipt-legend { border-color: #000; }
}

/* ---------- the employee table: column picker, saved views, sortable headers (U1b) ---------- */
fieldset.checks { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; }
fieldset.checks legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
label.check { display: flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; }
label.check input { width: 18px; min-height: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.view-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.view-row:first-of-type { margin-top: 12px; }
.view-row > a { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.view-row form { margin: 0; }
th a.sort { color: inherit; text-decoration: none; }
th a.sort:hover { color: var(--ink); text-decoration: underline; }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.tabs a .icon { margin-left: 6px; }
/* the column picker sits in the toolbar (not in a card): open, it takes its own line under the filters
   instead of floating over the page */
.toolbar details.row-action { margin-top: 0; }
.toolbar details.row-action[open] { flex: 1 1 100%; }
.toolbar details.row-action[open] > .row-panel { position: static; width: 100%; box-shadow: none; margin-top: 8px; }
fieldset.checks { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
fieldset.checks legend { grid-column: 1 / -1; }
table.stack td code { white-space: nowrap; }
/* a table with many columns scrolls inside its card (never the page); on a phone it is cards anyway */
.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
table.stack th.wide, table.stack td.wide { min-width: 13rem; overflow-wrap: break-word; }

/* Rules (slice L1a): pasted tables and the comparison of two versions */
textarea.mono, pre.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }
pre.mono { overflow-x: auto; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card-2); color: var(--ink); }
.diff .change { padding: 8px 0; border-bottom: 1px solid var(--line); }
.diff del, .diff ins { text-decoration: none; padding: 1px 6px; border-radius: 4px; color: var(--ink); }
.diff del { background: var(--red-bg); }
.diff ins { background: var(--ok-bg); font-weight: 600; }
.diff li { margin: 4px 0; }
.decisions details.row-action { display: block; width: 100%; margin-top: 8px; }
.decisions details.row-action[open] > .row-panel { position: static; width: 100%; box-shadow: none; margin-top: 8px; }
.stack td .badge, .kv td .badge { white-space: normal; max-width: 100%; }
.stack td code, .kv td code, .card p code { overflow-wrap: anywhere; word-break: break-word; }
.rules table.stack td { overflow-wrap: break-word; }
.rules table.stack td code { white-space: normal; }
.alert a.btn:not(.ghost) { color: var(--on-accent); font-weight: inherit; }

/* ---- the printable access sheets of the employees (E1a): one sheet per person ---- */
.access-sheet { max-width: 720px; }
.access-body { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.access-body ol { margin: 0; padding-left: 20px; flex: 1 1 260px; }
.access-qr { image-rendering: pixelated; background: #fff; border: 1px solid var(--border, #d0d5dd); border-radius: 6px; }
.access-link code { word-break: break-all; font-size: 0.95rem; }
@media print {
  .access-sheet { break-inside: avoid; page-break-inside: avoid; page-break-after: always; border: 1px dashed #000; padding: 12mm; max-width: none; }
  .access-sheet:last-of-type { page-break-after: auto; }
  .access-qr { border: 0; }
}

/* ---- the page of formulas (read only) ---- */
.toc { columns: 2 220px; list-style: none; padding: 0; margin: 0; }
.formulas-group .formula { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 18px; scroll-margin-top: 80px; }
.formulas-group .formula:first-of-type { border-top: 0; margin-top: 0; }
.formula h3 { margin: 0 0 6px; font-size: 1.05rem; }
.formula-text { font-size: 1.05rem; margin: 6px 0; overflow-wrap: anywhere; }
.formula-text code, .example code { background: var(--card-2); padding: 3px 8px; border-radius: var(--r-ctl); overflow-wrap: anywhere; }
.example { margin-top: 8px; }
.formula-link { font-size: .8rem; margin-left: 6px; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
.badge.bad { background: var(--red-bg); color: var(--red); border-color: var(--red-line); }
@media print { .formulas-group .formula { break-inside: avoid; } }
.formula code { overflow-wrap: anywhere; }
#g-company table.stack td code { white-space: normal; }  /* the long formula of a concept wraps inside its cell */
.formula .varname { font-family: ui-monospace, monospace; overflow-wrap: anywhere; }

/* the formula tester: where a formula fails (the text and a mark under it) */
.probe-pointer { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; margin: 8px 0 0; padding: 8px 10px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-ctl); white-space: pre; overflow-x: auto; max-width: 100%; }

/* Acceptance-test environment legend (issue #395): fixed at the bottom so it never covers a title or a
   button; the page leaves room for it and the menu stops above it. Dark on yellow: contrast 13:1. */
.test-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 300; height: 40px; display: flex; align-items: center; justify-content: center; padding: 0 12px; background: #FFD60A; color: #1A1A1A; font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-align: center; border-top: 2px solid #1A1A1A; }
body:has(.test-banner) { padding-bottom: 40px; }
body:has(.test-banner) .sidebar { height: calc(100vh - 40px); }
@media (max-width: 767px) { body:has(.test-banner) .sidebar { bottom: 40px; height: auto; } }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
