/* Colours, shadows and shapes live in theme.css. This file may only use its tokens. */

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  font: 13.5px/1.45 var(--font);
  color: var(--ink);
  background: var(--page);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { font-family: inherit; }
.btn,
.icon-btn,
.smart-btn,
.pager-btn,
.sel-act,
.view-toggle button,
.nb-tax button {
  border-radius: 0;
}

a,
.link,
.set-link {
  color: var(--gold-ink);
  text-decoration: none;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-align: left;
}
[data-theme="dark"] a,
[data-theme="dark"] .link,
[data-theme="dark"] .set-link {
  color: var(--gold);
}
a:hover,
.link:hover,
.set-link:hover,
a:focus,
.link:focus,
.set-link:focus {
  text-decoration: none;
  color: var(--gold);
  filter: brightness(1.08);
}
[data-theme="dark"] a:hover,
[data-theme="dark"] .link:hover,
[data-theme="dark"] .set-link:hover,
[data-theme="dark"] a:focus,
[data-theme="dark"] .link:focus,
[data-theme="dark"] .set-link:focus {
  color: var(--gold-ink);
  filter: none;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.2rem; font-weight: 600; }
h2 { font-size: 1.05rem; font-weight: 600; }
h3 { font-size: .88rem; font-weight: 600; }

.muted { color: var(--muted); }
.ok { color: var(--ok); }

#app-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
#shell { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--header);
  flex: 0 0 var(--header);
  display: flex;
  align-items: center;
  gap: .25rem;
  padding: 0 .85rem 0 .55rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 40;
  overflow: visible;
}
.brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 0;
  background: none;
  cursor: pointer;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: -.02em;
  padding: 0 .2rem 0 0;
  color: var(--ink);
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--navy);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  border: 1px solid var(--navy);
}
.brand-mark svg { width: 14px; height: 14px; }
.crumb {
  color: var(--muted);
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: .35rem;
  min-width: 0;
}
.app-title {
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  padding: 0 .7rem 0 .35rem;
  font-weight: 700;
  font-size: .92rem;
  white-space: nowrap;
}
.app-title:hover { color: var(--gold-ink); }
[data-theme="dark"] .app-title:hover { color: var(--gold); }
.crumb button {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.crumb button:hover { color: var(--ink); }
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .15rem;
  flex: 0 0 auto;
}
.systray {
  display: flex;
  align-items: center;
  gap: .05rem;
  margin-right: .35rem;
}
.company-switch {
  max-width: 190px;
  height: 30px;
  margin-right: 8px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--fill);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.company-switch:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.systray-btn {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
}
.systray-btn:hover {
  background: var(--fill);
  color: var(--ink);
}
.systray-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.systray-badge {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--danger);
  color: var(--on-accent);
  font-size: .62rem;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.user-pop {
  margin-left: 0;
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.user-btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  max-width: min(280px, 42vw);
  border: 0;
  background: none;
  padding: .25rem .15rem .25rem .35rem;
  border-radius: 0;
  cursor: pointer;
  color: var(--ink);
  text-align: left;
}
.user-btn:hover,
.user-btn:focus,
.user-btn:focus-visible,
.user-btn[aria-expanded="true"] {
  background: none;
  outline: none;
  box-shadow: none;
}
.user-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--avatar-1);
  color: var(--on-accent);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.user-status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 2px var(--bg);
}
.user-btn .who {
  margin-left: 0;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.user-meta,
.user-role { display: none; }
.act-split {
  border: 0;
  border-top: 1px solid var(--line);
  margin: .3rem 0;
}

.app-menus {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 0;
  min-width: 0;
  flex: 1;
  overflow: visible;
}
.app-menus > .menu-btn {
  height: 100%;
  border-radius: 0;
}
.menu {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  height: 100%;
}
.menu-btn {
  display: flex;
  align-items: center;
  gap: .35rem;
  border: 0;
  background: none;
  padding: 0 .7rem;
  cursor: pointer;
  color: var(--muted);
  border-radius: 0;
  font-weight: 550;
  white-space: nowrap;
}
.menu-btn .chev {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.menu-btn:hover { color: var(--ink); background: none; }
.menu.open > .menu-btn,
.menu-btn.on {
  color: var(--ink);
  background: none;
  box-shadow: none;
}
.menu-btn:focus,
.menu-btn:focus-visible { outline: none; background: none; box-shadow: none; }
.menu-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  max-height: min(70vh, 520px);
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-pop);
  padding: .35rem 0 .45rem;
  z-index: 60;
  margin-top: .2rem;
}
.menu-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: .4rem 1rem;
  cursor: pointer;
  color: var(--ink);
}
.menu-list .menu-h ~ button { padding-left: 1.45rem; }
.menu.open > .menu-list { display: block; }
.menu-h {
  padding: .55rem 1rem .2rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--muted);
}
.menu-list button:hover { background: var(--fill); }
.menu-list button.on { font-weight: 650; color: var(--gold-ink); }
[data-theme="dark"] .menu-list button.on { color: var(--gold); }

/* The desktop: a stage that fills the screen under the top bar. Behind it a picture (or the plain page), over it the
   apps, which scroll on their own when the screen is too short for them. */
.desk-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.desk-wall {
  position: absolute;
  inset: 0;
  background-color: var(--page);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.desk-wall::after { content: ""; position: absolute; inset: 0; background: var(--wall-veil); pointer-events: none; }
.desk-stage:not(.has-wall) .desk-wall::after { display: none; }
.desk-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.desk {
  flex: 1;
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.desk-search {
  position: absolute;
  left: 50%;
  top: 1.1rem;
  transform: translateX(-50%) translateY(-6px);
  width: min(420px, calc(100% - 2rem));
  margin: 0;
  padding: .55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 4;
}
.desk-search.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.desk-search:focus {
  outline: none;
  border-color: var(--gold);
}
.desk-grid {
  display: grid;
  grid-template-columns: repeat(6, 132px);
  justify-content: center;
  gap: 2.2rem 1.4rem;
}

.desk-app {
  width: 132px;
  border: 0;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  padding: 0;
}
.desk-app:hover .desk-icon { transform: translateY(-2px); }
.desk-icon {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--icon-hi), var(--icon));
  color: var(--icon-fg);
  display: grid;
  place-items: center;
  transition: transform .12s ease;
  box-shadow: inset 0 1px 0 var(--icon-gloss), var(--icon-shadow);
}
.desk-icon.muted { background: var(--icon-muted); color: var(--bg); box-shadow: none; }
.desk-icon svg {
  width: 40px;
  height: 40px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.desk-app span {
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink);
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* once the desktop has a picture, each name sits on a soft backing so it reads on any of them */
.desk-stage.has-wall .desk-app span {
  padding: .22rem .7rem;
  border-radius: 999px;
  background: var(--wall-label-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* the way in to the Background panel, in the corner like a desktop's own. Bottom left: notes ("saved") and the loading
   pill take the bottom right, and must never sit on top of it */
.desk-style {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .85rem .45rem .65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--wall-label-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
  z-index: 2;
}
.desk-style:hover, .desk-style:focus-visible { border-color: var(--amber); }
.desk-style .menu-ico { width: 16px; height: 16px; }

.workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: calc(100vh - var(--header));
  background: var(--page);
}
.menu-ico {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.menu-ico.filled {
  fill: currentColor;
  stroke: none;
}

.page {
  padding: .5rem 1rem 1.6rem;
  min-width: 0;
  background: var(--page);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.page > .doc-screen { flex: 1; }
.page > .page-head,
.page > .ctrl,
.browse {
  margin: -.5rem -1rem .55rem;
  padding: 0 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.page > .page-head,
.page > .ctrl {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 46px;
}
.ctrl-left {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex: 1 1 0;
  min-width: 0;
}
.ctrl-sub {
  margin: .35rem 0 .75rem;
  font-size: .85rem;
}
/* the way back and the current screen on one line, one size; when the line runs out of room the earlier steps shorten first */
.ctrl-title {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  font-weight: 700;
  font-size: .95rem;
  margin-left: .2rem;
  min-width: 0;
  line-height: 1.15;
  white-space: nowrap;
}
.ctrl-now {
  display: inline-flex;
  align-items: center;
  gap: .15rem;
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 0;
}
.ctrl-now .ctrl-rec { overflow: hidden; text-overflow: ellipsis; min-width: 7rem; }
.ctrl-trail {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  flex: 0 100 auto;
  min-width: 3.2rem;
  overflow: hidden;
  font-size: inherit;
  font-weight: inherit;
  color: var(--gold);
  line-height: inherit;
}
.ctrl-trail .ctrl-list {
  font-size: inherit;
  font-weight: inherit;
  color: var(--gold);
  min-width: 2.6rem;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ctrl-title > .crumb-sep, .ctrl-trail .crumb-sep { flex: 0 0 auto; }
.ctrl-trail .ctrl-list:hover,
[data-theme="dark"] .ctrl-trail .ctrl-list:hover {
  color: var(--gold-ink);
  text-decoration: none;
}
.ctrl-trail .crumb-sep { color: var(--gold); opacity: .65; }
.ctrl-gear {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: .2rem;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
}
.ctrl-gear:hover { color: var(--ink); background: var(--fill); }
.ctrl-list {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.ctrl-list:hover { color: var(--gold-ink); text-decoration: none; }
[data-theme="dark"] .ctrl-list:hover { color: var(--gold); }
.crumb-sep { color: var(--muted); font-weight: 500; margin: 0 .2rem; }
.ctrl-rec { font-weight: 700; }
.pager {
  display: inline-flex;
  align-items: center;
  gap: .1rem;
}
.pager-btn {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 0;
  font-size: 1.15rem;
  line-height: 1;
}
.pager-btn:hover:not(:disabled) { background: var(--fill); color: var(--ink); }
.pager-btn:disabled { opacity: .35; cursor: default; }
.browse.form-browse + .doc-screen { margin-top: 0; }
.form-browse .search-wrap,
.form-browse .sel-bar,
.form-browse .ctrl-mid,
.form-browse .view-toggle { display: none; }
.sel-bar {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: 420px;
}
.sel-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border: 1px solid var(--ok);
  color: var(--ok);
  background: transparent;
  border-radius: 4px;
  padding: .18rem .5rem;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}
.sel-all {
  border: 0;
  background: none;
  color: var(--gold-ink);
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
  font-weight: 650;
  padding: 0 .15rem;
  white-space: nowrap;
}
[data-theme="dark"] .sel-all { color: var(--gold); }
.sel-all b { font-weight: 750; }
.sel-pill button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: .95rem;
  line-height: 1;
  padding: 0 .1rem;
}
.sel-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .05rem;
}
.sel-act {
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding: .28rem .55rem;
  min-height: 32px;
  border-radius: 0;
  cursor: pointer;
}
.sel-act:hover { background: var(--fill); }
.ctrl-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
  flex: 1 1 0;
  min-width: 0;
  margin-left: 0;
}
.ctrl .btn.primary,
.doc-toolbar .btn.primary {
  font-weight: 600;
  padding: .28rem .75rem;
  border-radius: 0;
  min-height: 32px;
  height: 32px;
  box-sizing: border-box;
  line-height: 1;
}
.ctrl .btn:not(.primary) {
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 600;
  padding: .28rem .55rem;
  min-height: 32px;
  height: 32px;
  border-radius: 0;
  box-sizing: border-box;
  line-height: 1;
}
.ctrl .btn:not(.primary):hover { background: var(--fill); }
.doc-toolbar .btn {
  min-height: 32px;
  height: 32px;
  padding: .28rem .75rem;
  box-sizing: border-box;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.page-head p { display: none; }

.shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: .75rem;
  margin: 0 0 1rem;
}
.shortcut {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .55rem;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--radius);
  padding: .85rem .9rem;
  cursor: pointer;
}
.shortcut:hover { border-color: var(--gold); }
.shortcut .desk-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--icon); box-shadow: none; }
.shortcut .desk-icon svg { width: 18px; height: 18px; }
.shortcut span { font-weight: 550; font-size: .82rem; }

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0 0 .85rem;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: .75rem;
  margin-bottom: .85rem;
}
.kpi {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem 1rem;
}
.kpi strong { display: block; font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: .78rem; }

.dash { display: flex; flex-direction: column; gap: .85rem; }
.dash-page { display: flex; flex-direction: column; gap: .85rem; padding-bottom: 1.5rem; }
.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.dash-head h2 {
  margin: 0 0 .2rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.03em;
}
.dash-bc {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.dash-bc button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}
.dash-bc button:hover { color: var(--gold); }
.dash-range, .ui-select.uis-dash-range {
  font-size: .8rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .4rem .7rem;
  background-color: var(--bg);
  width: auto;
  margin: 0;
  cursor: default;
}
select.dash-range { min-width: 14rem; field-sizing: content; padding-right: 1.9rem; cursor: pointer; color: var(--ink); }
.dash-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}
.dash .card { margin: 0; }
.stats,
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}
.dash-kpis-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dash-journals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}
.jcard {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem .85rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: .5rem;
}
.jcard-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
}
.jcard-title {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  color: inherit;
  text-align: left;
}
.jcard-title:hover { color: var(--gold-ink); }
[data-theme="dark"] .jcard-title:hover { color: var(--gold); }
.jcard-h .muted {
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 700;
}
.jcard-rows { display: flex; flex-direction: column; }
.jcard-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  width: 100%;
  border: 0;
  background: none;
  padding: .34rem 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.jcard-row:last-child { border-bottom: 0; }
.jcard-row span { color: var(--muted); font-size: .84rem; }
.jcard-row b { font-variant-numeric: tabular-nums; font-size: .9rem; font-weight: 650; }
.jcard-row:hover span { color: var(--ink); }
.jcard-row.warn,
.jcard-row.warn span,
.jcard-row.warn b { color: var(--danger); }
.spark { width: 100%; height: 46px; display: block; }
.jcard-act {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .2rem;
}
.stat,
.dash-kpi {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .9rem 1rem .8rem;
  min-width: 0;
  text-align: left;
}
button.dash-kpi {
  display: block;
  width: 100%;
  cursor: pointer;
  color: inherit;
}
button.dash-kpi:hover { border-color: var(--gold); }
.stat-label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-value {
  margin-top: .28rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat-value small {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  color: inherit;
}
.stat-ccy,
.dash-kpi-hint {
  display: block;
  margin-top: .28rem;
  font-size: .75rem;
  color: var(--muted);
  line-height: 1.35;
}
.kpi-delta { font-weight: 650; }
.kpi-delta.up { color: var(--ok); }
.kpi-delta.down { color: var(--danger); }
.kpi-delta.muted { color: var(--muted); font-weight: 500; }
.stat.up .stat-value,
.dash-kpi.up .stat-value { color: var(--ok); }
.stat.down .stat-value,
.dash-kpi.down .stat-value { color: var(--danger); }
.dash-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.1fr) minmax(260px, .9fr);
  gap: .85rem;
  align-items: stretch;
}
.dash-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .95fr);
  gap: .85rem;
  align-items: start;
}
/* quick actions: one row of shortcuts under a dashboard's title */
.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.dash-action {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  padding: .5rem .8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.dash-action:hover { border-color: var(--gold); background: var(--fill); }
.dash-action .menu-ico {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke: var(--gold);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dash-action.primary { background: var(--navy); border-color: var(--navy); color: var(--icon-fg); }
.dash-action.primary .menu-ico { stroke: currentColor; stroke-width: 2.2; }
.dash-action.primary:hover { filter: brightness(1.08); }
.dash-action-n {
  min-width: 1.35rem;
  padding: .05rem .4rem;
  border-radius: 99px;
  background: var(--fill);
  color: var(--ink);
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.dash-action-n.warn { background: var(--warn); color: var(--on-gold); }
/* a wide main column beside a narrow side column; each stacks its panels so short ones leave no gaps */
.dash-split {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: .85rem;
  align-items: start;
}
.dash-col { display: flex; flex-direction: column; gap: .85rem; min-width: 0; }
.dash-none { margin: .1rem 0 .2rem; font-size: .84rem; }
.dash-charts.dash-charts-2 { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); }
.dash-charts.dash-charts-2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-charts.dash-charts-2x2.dash-one { grid-template-columns: 1fr; }
/* rows whose panel count depends on the data or the person's rights: every panel shares the row, no orphans */
.dash-charts.dash-charts-fit { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
/* like -fit, but a lone panel keeps a third of the row instead of stretching across it */
.dash-charts.dash-charts-fill { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.dash-kpis.dash-kpis-fit { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.dash-panel .hbar-row { grid-template-columns: minmax(6rem, 34%) minmax(3rem, 1fr) auto; }
.dash-panel .hbar-row > span { overflow-wrap: anywhere; line-height: 1.25; }
.tx-type { font-weight: 650; font-size: .82rem; }
.tx-type.inv { color: var(--gold); }
.tx-type.bill { color: var(--warn); }
.tx-type.pay-in { color: var(--ok); }
.tx-type.pay-out { color: var(--danger); }
.tx-type.je { color: var(--muted); }
.dash-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dash-panel-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .65rem;
}
.dash-panel-h h3 { margin: 0; }
.dash-panel-h .link {
  border: 0;
  background: none;
  padding: 0;
  font-size: .78rem;
  cursor: pointer;
}
.dash-sub {
  margin: .9rem 0 .3rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.dash-age .dash-sub:first-of-type { margin-top: 0; }
.dash-kind { font-size: .72rem; margin-top: .1rem; }
.dash-legend {
  flex-direction: row;
  margin-top: .45rem;
}
.dash-empty {
  padding: 1.1rem .2rem 1.4rem;
  text-align: center;
}
.dash-empty p:first-child { font-weight: 600; margin-bottom: .25rem; }
.dash-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: .75rem;
}
.chart-card h3 { margin-bottom: .65rem; }
.chart { width: 100%; height: 220px; color: var(--ink); display: block; }
.donut { width: 168px; height: 168px; display: block; color: var(--ink); }
.donut-wrap { display: flex; align-items: center; gap: 1.1rem; }
.donut-stack-wrap { flex-direction: column; align-items: flex-start; gap: .9rem; }
.donut-stack {
  position: relative;
  width: 168px;
  height: 168px;
}
.donut-stack .donut { width: 100%; height: 100%; }
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}
.donut-center span { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.donut-center strong { font-size: .82rem; font-variant-numeric: tabular-nums; max-width: 6.5rem; }
.legend { display: flex; flex-direction: column; gap: .4rem; font-size: .8rem; color: var(--muted); }
.legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.swatch { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: .4rem; }
.bar-row {
  display: grid;
  grid-template-columns: 3.8rem minmax(0, 1fr) 5.5rem;
  gap: .5rem;
  align-items: center;
  font-size: .78rem;
  margin: .42rem 0;
}
.bar-track { height: 8px; background: var(--fill); border-radius: 99px; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 99px; }
.bar-row strong { text-align: right; font-variant-numeric: tabular-nums; font-size: .78rem; }
.quick-row { display: flex; flex-wrap: wrap; gap: .45rem; }
table.data tbody tr.row-open { cursor: pointer; }
table.data tbody tr.row-open:hover { background: var(--fill); }
@media (max-width: 1200px) {
  .dash-kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-charts { grid-template-columns: 1fr 1fr; }
  .dash-charts .dash-panel:last-child { grid-column: 1 / -1; }
  .dash-charts.dash-charts-2 .dash-panel:last-child,
  .dash-charts.dash-charts-2x2 .dash-panel:last-child,
  .dash-charts.dash-charts-fit .dash-panel:last-child,
  .dash-charts.dash-charts-fill .dash-panel:last-child { grid-column: auto; }
}
@media (max-width: 1100px) {
  .dash-board {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "trend trend"
      "ytd age"
      "open open";
  }
  .dash-lower, .dash-split { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .stats, .dash-kpis, .dash-journals, .dash-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .stats, .dash-kpis, .dash-journals, .dash-grid, .dash-board, .dash-kpis-6, .dash-charts { grid-template-columns: 1fr; }
  .dash-board { grid-template-areas: "trend" "ytd" "open" "age"; }
  .dash-charts .dash-panel:last-child { grid-column: auto; }
  .dash-charts.dash-charts-2, .dash-charts.dash-charts-2x2, .dash-charts.dash-charts-fit, .dash-charts.dash-charts-fill { grid-template-columns: 1fr; }
  .dash-kpis, .dash-kpis.dash-kpis-6, .dash-kpis.dash-kpis-fit { grid-template-columns: 1fr 1fr; }
  .dash-actions { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .stat-value, .kpi strong { font-size: 1.5rem; }
  .ctrl-right { display: none; }
  .browse > .ctrl {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .browse > .ctrl .ctrl-left,
  .browse > .ctrl .ctrl-mid,
  .browse > .ctrl .ctrl-right { justify-self: stretch; }
  .search-wrap,
  .sel-bar { max-width: none; }
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .65rem;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
}
table.data th, table.data td {
  text-align: left;
  padding: .5rem .45rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data th {
  color: var(--muted);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
table.data th.check,
table.data td.check {
  width: 2rem;
  padding-right: .1rem;
  padding-left: .35rem;
}
table.data .row-check,
table.data .row-check-all {
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
}
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1.5px solid var(--muted);
  border-radius: 0;
  background: transparent;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  box-sizing: border-box;
}
input[type="checkbox"]:checked {
  background: var(--navy);
  border-color: var(--navy);
}
[data-theme="dark"] input[type="checkbox"]:checked {
  background: var(--navy);
  border-color: var(--navy);
}
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid var(--icon-fg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="checkbox"]:disabled {
  opacity: .45;
  cursor: not-allowed;
}
table.data.selectable tbody tr.row-open { cursor: pointer; }
table.data.selectable tbody tr.row-open:hover { background: var(--fill); }
table.data.selectable tbody tr.is-selected { background: var(--gold-soft); }
.kanban-open { cursor: pointer; height: 100%; }

label.field { display: block; font-size: .75rem; color: var(--muted); margin: .15rem 0 .2rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"]:not(.desk-search):not(.ui-search-input), input[type="date"], select, textarea {
  width: 100%;
  padding: .42rem .2rem;
  margin: 0 0 .55rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}
input[type="text"]:hover, input[type="email"]:hover, input[type="password"]:hover, input[type="number"]:hover,
input[type="search"]:not(.desk-search):not(.ui-search-input):hover, input[type="date"]:hover, textarea:hover,
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, input[type="number"]:focus,
input[type="search"]:not(.desk-search):not(.ui-search-input):focus, input[type="date"]:focus, textarea:focus {
  outline: none;
  background: transparent;
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  background-image: var(--chevron);
  background-repeat: no-repeat !important;
  background-position: right .35rem center;
  background-size: 16px 16px;
  padding-right: 1.5rem;
}
select:hover, select:focus {
  outline: none;
  background-color: transparent;
}
input[type="date"] {
  position: relative;
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  color: transparent;
  background: transparent;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border: 1px solid var(--line);
  background: var(--bg);
  padding: .38rem .75rem;
  border-radius: 0;
  cursor: pointer;
  color: var(--ink);
}
.btn:hover { background: var(--fill); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--icon-fg);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--on-accent);
}
.btn.danger:hover { filter: brightness(1.08); }

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 0;
}
.icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn svg.menu-ico.filled {
  fill: currentColor;
  stroke: none;
}

.theme-pop { position: relative; display: flex; align-items: center; }
.theme-pop .act-menu {
  left: auto;
  right: 0;
  top: calc(100% + 6px);
  min-width: 168px;
}
.user-pop .act-menu {
  min-width: 220px;
  padding: .2rem 0;
}
.theme-pop .act-item.on { font-weight: 700; color: var(--gold-ink); }
[data-theme="dark"] .theme-pop .act-item.on { color: var(--gold); }
.act-item.row {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.act-item .act-kbd {
  margin-left: auto;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .02em;
}
.act-item .act-chev {
  margin-left: auto;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1;
}
.act-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex: 0 0 auto;
}

.err {
  color: var(--danger);
  background: var(--danger-bg);
  padding: .55rem .7rem;
  border-radius: 6px;
  margin: 0 0 .75rem;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--page);
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
}
.login-atmosphere,
.login-watermark {
  display: none;
}
.login-wrap .theme-pop {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}
.login {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.75rem 1.55rem 1.45rem;
  box-shadow: var(--shadow);
  color: var(--ink);
}
.login .login-title { color: var(--ink); }
.login .login-sub,
.login .muted,
.login .field,
.login .login-divider { color: var(--muted); }
.login .login-divider::before,
.login .login-divider::after { background: var(--line); }
.login input[type="text"],
.login input[type="email"],
.login input[type="password"] {
  background: var(--page);
  border-color: var(--line);
  color: var(--ink);
  color-scheme: inherit;
}
.login .login-footer a { color: var(--gold-ink); }
.login .brand-mark {
  background: var(--navy);
  color: var(--icon-fg);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1.35rem;
}
.login-brand .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex: none;
}
.login-brand .brand-mark svg {
  width: 18px;
  height: 18px;
}
.login-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--ink);
}
.login-sub {
  margin: .2rem 0 0;
  color: var(--muted);
  font-size: .86rem;
}
.login-welcome {
  margin: 0 0 .35rem;
  font-size: 1.05rem;
  color: var(--ink);
}
.login-lead {
  margin: 0 0 1rem;
  line-height: 1.45;
  color: var(--muted);
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.login-form .field {
  margin-top: .55rem;
  color: var(--muted);
}
.login-form .field:first-of-type {
  margin-top: 0;
}
.login input[type="text"],
.login input[type="email"],
.login input[type="password"] {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .55rem .65rem;
  background: var(--page);
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
}
.login input:focus {
  outline: 2px solid color-mix(in srgb, var(--gold) 45%, transparent);
  outline-offset: 1px;
  border-color: var(--gold);
}
.login-submit {
  width: 100%;
  margin-top: 1rem;
  min-height: 2.35rem;
  font-weight: 600;
}
.login-footer {
  margin: 1rem 0 0;
  text-align: center;
}
.login-footer a {
  color: var(--gold-ink);
  text-decoration: none;
  font-size: .86rem;
}
.login-footer a:hover {
  color: var(--gold);
}
.login-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.05rem 0;
  color: var(--muted);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.login-divider span {
  flex: none;
}
#login-err,
#setup-err {
  margin-top: .85rem;
}
#login-err:empty,
#setup-err:empty {
  display: none;
}

.page-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.list-search {
  width: min(320px, 100%);
  margin: 0 0 .75rem;
}
.browse { position: relative; margin: -.5rem -1rem .55rem; }
.browse > .ctrl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 420px) minmax(0, 1fr);
  align-items: center;
  gap: .75rem;
  margin: 0;
  min-height: 46px;
}
.browse > .ctrl .ctrl-left {
  flex: 0 1 auto;
  justify-self: start;
}
.browse > .ctrl .ctrl-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  justify-self: center;
}
.browse > .ctrl .ctrl-right {
  flex: 0 1 auto;
  justify-self: end;
  margin-left: 0;
}
.search-wrap {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  max-width: 420px;
  min-width: 0;
}
.search-box {
  flex: none;
  width: 100%;
  max-width: none;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .25rem;
  height: 32px;
  min-height: 32px;
  padding: 0 .4rem 0 .2rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--page);
  box-sizing: border-box;
}
.search-box .search-ico,
.search-box .search-caret {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 0;
  background: none;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.search-box .search-ico:hover,
.search-box .search-caret:hover { color: var(--ink); }
.search-box .search-ico .menu-ico,
.search-box .search-caret .menu-ico { width: 14px; height: 14px; }
.search-facet {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0;
  border: 0;
  background: var(--fill);
  color: var(--ink);
  font: inherit;
  font-size: .78rem;
  font-weight: 650;
  padding: .15rem .4rem;
  white-space: nowrap;
  border-radius: 0;
  line-height: 1.2;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browse > .ctrl .ctrl-left {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex: 0 1 auto;
  min-width: 0;
  justify-self: start;
  max-width: 100%;
}
.search-facet .menu-ico { width: 12px; height: 12px; color: var(--muted); }
.search-box .chips {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .25rem;
  margin: 0;
  max-width: 45%;
  overflow: hidden;
}
.search-box input,
.search-box input[type="search"],
.search-box .ui-search-input {
  flex: 1 1 auto;
  width: 0;
  min-width: 72px;
  height: 32px;
  border: 0 !important;
  background: none !important;
  outline: none;
  color: var(--ink);
  font-family: var(--font);
  font-size: .86rem;
  font-weight: 500;
  line-height: 32px;
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}
.search-box input::-webkit-search-decoration,
.search-box input::-webkit-search-cancel-button,
.search-box input::-webkit-search-results-button,
.search-box input::-webkit-search-results-decoration {
  display: none;
  -webkit-appearance: none;
}
.search-box input:hover,
.search-box input:focus {
  background: none !important;
}
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  border: 0;
  border-radius: 4px;
  background: var(--gold-soft);
  color: var(--gold-ink);
  padding: .12rem .4rem;
  font-size: .78rem;
  cursor: pointer;
}
.chip.group { background: var(--brand-soft); color: var(--brand-ink); }
.browse-count { color: var(--muted); font-size: .8rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.view-toggle {
  display: flex;
  gap: .05rem;
  background: none;
  border: 0;
  overflow: visible;
}
.view-toggle button {
  border: 0;
  background: none;
  padding: .32rem .4rem;
  cursor: pointer;
  color: var(--muted);
  border-radius: 0;
  display: inline-flex;
  align-items: center;
}
.view-toggle button.on {
  background: var(--fill);
  color: var(--ink);
}
[data-theme="dark"] .view-toggle button.on {
  background: var(--fill);
  color: var(--gold);
}
.act-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 1rem;
  z-index: 32;
  min-width: 200px;
  padding: .35rem 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
}
.act-h {
  padding: .35rem .85rem .25rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.act-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: .4rem .85rem;
  cursor: pointer;
  color: var(--ink);
}
.act-item:hover { background: var(--fill); }
.filter-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: min(460px, 100%);
  padding: 1rem 1.1rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
}
.search-wrap .filter-panel {
  left: 0;
  width: max(100%, 420px);
}
.filter-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
}
.filter-cols h4 {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0 0 .45rem;
  font-size: .85rem;
}
.flt-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: .32rem .25rem;
  cursor: pointer;
  color: var(--ink);
  border-radius: 4px;
}
.flt-item:hover { background: var(--fill); }
.flt-item.on { color: var(--gold-ink); font-weight: 600; }
[data-theme="dark"] .flt-item.on { color: var(--gold); }
.flt-query, .flt-saved { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.flt-qgroup { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-bottom: .4rem; }
.flt-or { font-style: normal; color: var(--muted); font-size: .78rem; }
.flt-and { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; margin: .2rem 0; }
.flt-add-or { font-size: .78rem; }
.flt-saved-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .2rem 0; }
.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: .75rem;
  overflow-x: auto;
  padding-bottom: .4rem;
}
.kanban-col {
  background: var(--fill);
  border-radius: 0;
  padding: .65rem;
  min-height: 180px;
}
.kanban-col header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .55rem;
  font-weight: 650;
}
.kanban-col em { color: var(--muted); font-style: normal; font-size: .8rem; }
.kanban-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: .65rem .7rem;
  margin: 0 0 .5rem;
}
.kanban-card p { margin: .25rem 0 0; font-size: .82rem; }
.graph-bars {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  min-height: 210px;
  padding: 1rem .5rem .4rem;
}
.graph-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  min-width: 0;
}
.graph-fill {
  width: 100%;
  max-width: 56px;
  background: var(--navy);
  border-radius: 6px 6px 0 0;
}
[data-theme="dark"] .graph-fill { background: var(--gold); }
.graph-col strong { font-size: .75rem; text-align: center; }
.graph-col span { color: var(--muted); font-size: .72rem; }
.graph-card { padding: .9rem 1rem 1.1rem; }
.chart-kinds {
  display: flex;
  justify-content: flex-end;
  gap: .1rem;
  margin: 0 0 .35rem;
}
.chart-kinds button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: .32rem .4rem;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.chart-kinds button.on {
  background: var(--fill);
  color: var(--ink);
}
[data-theme="dark"] .chart-kinds button.on { color: var(--gold); }
.chart-legend {
  flex-direction: row;
  flex-wrap: wrap;
  gap: .55rem 1.15rem;
  margin-top: .85rem;
}
.chart-legend .swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: .35rem;
  vertical-align: middle;
}
.pie-wrap { display: flex; justify-content: center; padding: .4rem 0 .2rem; }
.pie { width: 220px; height: 220px; }
.graph-hbars { display: flex; flex-direction: column; gap: .55rem; padding: .55rem 0 .15rem; }
.hbar-row {
  display: grid;
  grid-template-columns: minmax(72px, 110px) 1fr auto;
  align-items: center;
  gap: .65rem;
}
.hbar-track { height: 14px; background: var(--fill); border-radius: 99px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 99px; }
.empty-state {
  max-width: 480px;
  margin: 3.2rem auto 2rem;
  text-align: center;
  padding: .5rem 1rem 1.5rem;
}
.empty-ico {
  width: 64px;
  height: 64px;
  margin: 0 auto .95rem;
  border-radius: 16px;
  background: var(--gold-soft);
  color: var(--navy);
  display: grid;
  place-items: center;
}
[data-theme="dark"] .empty-ico { background: var(--fill); color: var(--gold); }
.empty-ico .menu-ico { width: 28px; height: 28px; flex: none; }
.empty-state h3 { margin: 0 0 .35rem; font-size: 1.15rem; }
.empty-state p { margin: 0; color: var(--muted); }
.empty-steps {
  text-align: center;
  list-style-position: inside;
  margin: 1.05rem auto 0;
  padding: 0;
  max-width: 420px;
  color: var(--ink);
}
.empty-steps li { margin: .38rem 0; }
.empty-cta { margin: 1.2rem 0 0; }
.group-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin: 0 0 .65rem;
  font-size: .95rem;
}
.group-head em { color: var(--muted); font-style: normal; font-weight: 500; }
.badge {
  display: inline-block;
  padding: .12rem .45rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 650;
  letter-spacing: .02em;
  background: var(--fill);
  color: var(--muted);
  text-transform: uppercase;
}
.badge.draft, .badge.open, .badge.planned { background: var(--fill); color: var(--ink); }
.badge.posted, .badge.matched, .badge.confirmed { background: var(--gold-soft); color: var(--gold-ink); }
.badge.paid, .badge.reconciled, .badge.running { background: var(--ok-bg); color: var(--ok); }
.badge.partial { background: var(--warn-bg); color: var(--warn); }
.badge.void, .badge.cancelled, .badge.ignored { background: var(--danger-bg); color: var(--danger); }
.badge.overdue { background: var(--danger-bg); color: var(--danger); }
.badge.locked, .badge.closed { background: var(--fill); color: var(--muted); }
.set-link {
  display: inline-block;
  padding: 0 .55rem 0 0;
  font-size: .86rem;
}
.doc-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin: 0 0 1rem;
}
.doc-meta span { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.doc-meta strong { display: block; margin-top: .15rem; font-size: .92rem; }
.doc-meta small { display: block; font-size: .72rem; }
.fx-row { align-items: end; }
.fx-says { margin: .4rem 0 .8rem; font-weight: 600; min-height: 1.2em; }
.totals {
  margin-left: auto;
  width: min(280px, 100%);
}
.totals p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: .2rem 0;
}
.totals .grand { font-weight: 700; border-top: 1px solid var(--line); padding-top: .4rem; margin-top: .4rem; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.num input { text-align: right; }

.doc-screen {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header) - 2.4rem);
  margin: 0;
}
.doc-toolbar {
  display: flex;
  align-items: center;
  gap: .5rem .75rem;
  margin: 0 0 .85rem;
  width: 100%;
  box-sizing: border-box;
  min-height: 32px;
  position: relative;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
}
.doc-toolbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 32px;
  pointer-events: none;
}
.doc-toolbar-center > * { pointer-events: auto; }
.doc-toolbar-center:empty,
.doc-toolbar-center[hidden] {
  display: none;
}
.doc-toolbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  margin-left: auto;
  flex: 0 0 auto;
  min-height: 32px;
}
.smart-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: .35rem;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 0;
  padding: .35rem .7rem;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  line-height: 1.15;
}
.smart-btn span { font-weight: 700; color: var(--gold-ink); }
[data-theme="dark"] .smart-btn span { color: var(--gold); }
.status-bar {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: stretch;
  height: 32px;
  /* a 1px outline round every chevron (a border would be cut off by the chevron shape) */
  filter:
    drop-shadow(0 1px 0 var(--line-strong))
    drop-shadow(0 -1px 0 var(--line-strong))
    drop-shadow(1px 0 0 var(--line-strong))
    drop-shadow(-1px 0 0 var(--line-strong));
}
.status-bar li {
  display: inline-flex;
  margin-right: 2px;
  align-items: center;
  padding: 0 1.15rem 0 1.35rem;
  background: var(--fill);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .02em;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
  height: 32px;
  box-sizing: border-box;
}
.status-bar li:first-child {
  padding-left: .9rem;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
  border-radius: 4px 0 0 4px;
}
.status-bar li.on {
  background: var(--navy);
  color: var(--icon-fg);
  font-weight: 700;
}
[data-theme="dark"] .avatar {
  background: var(--badge-bg);
  color: var(--badge-fg);
}
.status-bar li.done { opacity: .85; }
.doc-split {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 1.35rem;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}
.doc-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.doc-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.15rem 1.25rem 1.35rem;
  flex: 1;
}
.doc-card:has(.doc-ribbon-wrap) {
  padding-right: 6.25rem;
}
.doc-ribbon-wrap {
  position: absolute;
  top: 0;
  right: 0;
  width: 176px;
  height: 176px;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
  border-top-right-radius: 10px;
}
.doc-ribbon {
  position: absolute;
  top: 38px;
  right: -56px;
  width: 248px;
  padding: .55rem 0;
  text-align: center;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  transform: rotate(45deg);
  color: var(--on-accent);
  box-shadow: var(--shadow);
}
.doc-ribbon.paid { background: var(--ok); }
.doc-ribbon.partial { background: var(--warn); color: var(--on-gold); }
.doc-ribbon.unpaid { background: var(--badge-bg); color: var(--badge-fg); }
.doc-ribbon.overdue, .doc-ribbon.void { background: var(--danger); }
.doc-card input[type="text"],
.doc-card input[type="email"],
.doc-card input[type="number"],
.doc-card input[type="date"],
.doc-card select,
.doc-card textarea,
.doc-card input:not([type]) {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: .4rem .2rem;
  margin: 0;
  box-shadow: none;
  outline: none;
}
.doc-card input:focus,
.doc-card select:focus,
.doc-card textarea:focus {
  outline: none;
  background: var(--fill);
}
.doc-card table.data.lines input,
.doc-card table.data.lines select {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: .2rem 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
  border-radius: 0;
}
.doc-card table.data.lines input[type="text"],
.doc-card table.data.lines input.ln-desc {
  -webkit-appearance: none;
  appearance: none;
  background: transparent !important;
}
.doc-card table.data.lines input:hover,
.doc-card table.data.lines input:focus,
.doc-card table.data.lines select:hover,
.doc-card table.data.lines select:focus {
  background: transparent !important;
}
.doc-kicker { color: var(--muted); font-size: .78rem; margin-bottom: .15rem; }
.doc-title { font-size: 1.65rem; font-weight: 700; letter-spacing: -.03em; margin: 0 0 1.1rem; }
.doc-sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 2rem;
  margin-bottom: 1.15rem;
}
.doc-col label.field { margin-top: .55rem; }
.doc-col label.field:first-child { margin-top: 0; }
.doc-col select, .doc-col input { margin-bottom: 0; }
.ro-field {
  min-height: 2rem;
  padding: .4rem .2rem;
}
.partner-addr {
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.4;
  padding: .1rem .2rem .45rem;
  min-height: 0;
}
.partner-addr:empty { display: none; }
.notebook { margin-top: .25rem; }
.nb-tabs {
  display: flex;
  align-items: center;
  gap: .15rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: .65rem;
}
.nb-tab {
  border: 0;
  background: none;
  padding: .55rem .7rem;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.nb-tab.on { color: var(--gold-ink); border-bottom-color: var(--gold); font-weight: 650; }
[data-theme="dark"] .nb-tab.on { color: var(--gold); }
.nb-tax { margin-left: auto; display: flex; border: 1px solid var(--line); border-radius: 0; overflow: hidden; }
.nb-tax button {
  border: 0;
  background: var(--bg);
  padding: .28rem .55rem;
  cursor: pointer;
  color: var(--muted);
}
.nb-tax button.on { background: var(--navy); color: var(--icon-fg); }
.line-actions { display: flex; gap: 1rem; margin: .55rem 0 .2rem; }
.icon-del {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--danger);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-del svg {
  width: 18px;
  height: 18px;
}
.icon-del:hover { color: var(--danger); }
.doc-foot {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-end;
  margin-top: 1.1rem;
}
.doc-foot .muted { max-width: 46%; }
.chatter {
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  min-height: 0;
  height: 100%;
  padding: .1rem 0 1rem 1rem;
}
.chatter-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: .35rem;
  margin: 0 0 .75rem;
  padding: 0 0 .75rem;
  border-bottom: 1px solid var(--line);
}
.chatter-tools .btn.on { background: var(--fill); }
.chatter-compose textarea { margin: 0 0 .45rem; }
.chatter-feed { padding-top: .2rem; }
.chatter-day {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
  font-size: .75rem;
  margin: .65rem 0 .55rem;
}
.chatter-day::before, .chatter-day::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.chatter article {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: .55rem;
  margin: 0 0 .85rem;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--navy);
  color: var(--icon-fg);
  display: grid;
  place-items: center;
  font-size: .72rem;
  font-weight: 700;
}
.chatter-who { display: flex; align-items: baseline; gap: .45rem; font-size: .82rem; }
.chatter-who time { color: var(--muted); font-size: .78rem; }
.chatter article p { margin: .15rem 0 0; font-size: .92rem; white-space: pre-wrap; }
.chatter-track { line-height: 1.45; }
.chatter-track .trk-new { color: var(--gold-ink); font-weight: 650; }
.chatter-track em { color: var(--muted); font-style: italic; font-weight: 400; }
.chatter-empty { margin-top: .35rem; }
.doc-card table.data.lines td:nth-child(1) { width: 16%; }
.doc-card table.data.lines td:nth-child(2) { min-width: 10rem; }
.doc-card table.data.lines td:nth-child(3),
.doc-card table.data.lines td:nth-child(4),
.doc-card table.data.lines td:nth-child(5) { width: 7rem; }
.doc-card table.data.lines td:nth-child(6) { width: 8.5rem; }
.doc-card table.data.lines td:nth-child(7) { width: 7.5rem; }
.doc-card table.data.lines td:nth-child(8) { width: 2.4rem; }
.doc-card table.data.lines th,
.doc-card table.data.lines td {
  vertical-align: middle;
}
.doc-card table.data.lines tbody td {
  height: 2.5rem;
  padding-top: .15rem;
  padding-bottom: .15rem;
}
.doc-card table.data.lines .combo-field {
  min-height: 2rem;
  height: 2rem;
}
.doc-card table.data.lines .combo-input {
  height: 2rem;
  padding: 0 !important;
  line-height: 2rem;
}
.doc-card table.data.lines input.ln-desc,
.doc-card table.data.lines input.ln-qty,
.doc-card table.data.lines input.ln-price {
  height: 2rem;
  min-height: 2rem;
  padding: 0 .15rem !important;
  line-height: 2rem;
  box-sizing: border-box;
  display: block;
}
.doc-card table.data.lines td.num {
  line-height: 2rem;
}
.doc-card table.data.lines .icon-del {
  display: flex;
  margin: 0 auto;
}

.dialog-back {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: var(--overlay);
}
.dialog {
  width: min(420px, 100%);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 1rem 1.1rem 1.05rem;
  box-shadow: var(--shadow-dialog);
}
.dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .45rem;
}
.dialog h3 { font-size: 1.05rem; }
.dialog-x {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}
.dialog p { color: var(--ink); margin: 0 0 .9rem; line-height: 1.45; }
.dialog.confirm { width: min(520px, 100%); padding: 1.05rem 1.2rem 1rem; }
.dialog.confirm h3 { font-size: 1.15rem; font-weight: 700; }
.dialog.confirm #confirm-body p { margin: 0 0 .75rem; }
.dialog.confirm #confirm-body p:last-child { margin-bottom: 0; }
.dialog .dialog-actions {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: .95rem 0 0;
  padding-top: .95rem;
  border-top: 1px solid var(--line);
}
.dialog-actions .btn { min-height: 34px; }
#toasts {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column-reverse;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 280px;
  max-width: min(92vw, 440px);
  padding: .7rem .95rem;
  background: var(--menu-bg);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  box-shadow: var(--shadow-pop);
  font-weight: 600;
}
.toast span { flex: 1; }
.toast-undo {
  border: 0;
  background: none;
  color: var(--gold);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .78rem;
}
.toast-x {
  border: 0;
  background: none;
  color: inherit;
  opacity: .7;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.combo { position: relative; min-width: 0; }
.combo-field {
  display: flex;
  align-items: center;
  gap: .35rem;
  min-height: 2rem;
  cursor: text;
}
.combo-input {
  flex: 1;
  min-width: 0;
  width: auto !important;
  margin: 0 !important;
  padding: .35rem 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.combo-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex: 0 0 auto;
  pointer-events: none;
  transition: transform .15s ease;
}
.combo-caret .menu-ico { width: 14px; height: 14px; }
.combo.open .combo-caret { transform: rotate(180deg); }
.combo.open .combo-field { box-shadow: inset 0 -1px 0 var(--gold); }
.combo-menu {
  position: absolute;
  top: calc(100% + 4px);
  bottom: auto;
  left: 0;
  right: 0;
  min-width: 100%;
  max-height: 240px;
  overflow: auto;
  z-index: 46;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-pop);
  padding: .2rem 0;
}
.combo-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .05rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: .4rem .75rem;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
}
.combo-opt em { font-style: normal; color: var(--muted); font-size: .78rem; }
.combo-opt:hover, .combo-opt.on { background: var(--fill); }
.combo-opt.create { color: var(--gold-ink); font-weight: 650; border-top: 1px solid var(--line); margin-top: .15rem; }
[data-theme="dark"] .combo-opt.create { color: var(--gold); }
.combo-opt.create-edit { color: var(--gold-ink); font-weight: 550; }
[data-theme="dark"] .combo-opt.create-edit { color: var(--gold); }
.combo-empty { padding: .5rem .75rem; color: var(--muted); font-size: .84rem; }
.doc-save-state {
  color: var(--muted);
  font-size: .8rem;
  display: inline-flex;
  align-items: center;
  height: 32px;
  min-width: 0;
  white-space: nowrap;
}
.doc-save-state:empty { display: none; }

.doc-card, .notebook, .nb-panel, table.data.lines, table.data.lines td { overflow: visible; }

.form-dialog {
  width: min(760px, calc(100% - 1.5rem));
  max-height: min(90vh, 840px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: var(--shadow-dialog);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.form-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .95rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.form-dialog h3 { font-size: 1.08rem; }
#form-dialog-body { overflow: auto; }
#form-dialog-body .set-form .combo { position: relative; z-index: 2; }
#form-dialog-body .set-form { overflow: visible; }
.pf { padding: 1.1rem 1.2rem 0; }
.pf-top {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.pf-avatar {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--navy);
  color: var(--icon-fg);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.pf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.5rem;
}
.pf-flags { margin: .35rem 0 .2rem; color: var(--ink); }
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: .65rem;
}
.seg-btn {
  border: 0;
  background: var(--bg);
  padding: .32rem .8rem;
  cursor: pointer;
  color: var(--muted);
}
.seg-btn.on { background: var(--navy); color: var(--icon-fg); }
.form-dialog-foot {
  display: flex;
  gap: .4rem;
  padding: .9rem 0 1.15rem;
}
.mail-send .mail-to {
  display: flex;
  flex-wrap: nowrap;
  gap: .45rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .35rem .4rem .35rem .5rem;
  background: var(--bg);
}
.mail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}
.mail-chip {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  height: 32px;
  background: var(--fill);
  border-radius: 999px;
  padding: 0 .45rem 0 .7rem;
  font-size: .84rem;
}
.mail-chip button {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0 .15rem;
}
#inv-mail-add {
  flex: 1 1 auto;
  width: auto;
  min-width: 10rem;
  height: 32px;
  margin: 0;
  padding: 0 .4rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  line-height: 32px;
}
#inv-mail-add:hover,
#inv-mail-add:focus {
  background: transparent;
}
#inv-mail-add::placeholder { color: var(--muted); opacity: .4; }
#inv-mail-plus {
  flex: 0 0 auto;
  align-self: center;
}
.mail-to-hint { margin: .4rem 0 .85rem; }
#inv-mail-body {
  width: 100%;
  min-height: 8rem;
  resize: vertical;
}

@media (max-width: 980px) {
  .doc-split, .doc-sheet { grid-template-columns: 1fr; }
  .chatter { border-left: 0; padding-left: 0; }
  .doc-foot { flex-direction: column; align-items: stretch; }
  .doc-foot .muted { max-width: none; }
  .doc-toolbar {
    flex-wrap: wrap;
  }
  .doc-toolbar-center {
    position: static;
    left: auto;
    transform: none;
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
  .doc-toolbar-right {
    margin-left: auto;
  }
  .set-shell { grid-template-columns: 1fr; }
  .set-body { grid-template-columns: 1fr; }
  .set-side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; }
  .set-control {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .set-control-left { justify-self: start; }
  .set-control-search {
    max-width: none;
    width: 100%;
    justify-self: stretch;
  }
  .set-control .ui-search {
    max-width: none;
    width: 100%;
    justify-self: stretch;
  }
  .set-control-right { display: none; }
  .set-grid { grid-template-columns: 1fr; }
}

.pos-grid { display: grid; grid-template-columns: 1fr 340px; gap: 1rem; align-items: start; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.products .btn { text-align: left; height: 88px; align-items: flex-start; }

@media (max-width: 920px) {
  .desk-grid { grid-template-columns: repeat(4, 132px); }
}
@media (max-width: 720px) {
  .desk-grid { grid-template-columns: repeat(3, 120px); }
  .desk-app { width: 120px; }
  .desk-icon { width: 72px; height: 72px; border-radius: 19px; }
  .desk-icon svg { width: 34px; height: 34px; }
  .desk { padding: 1.5rem 1rem 5.5rem; }
  .pos-grid { grid-template-columns: 1fr; }
  .user-btn { max-width: 200px; }
  .app-menus { max-width: 100%; }
}
@media (max-width: 480px) {
  .desk-grid { grid-template-columns: repeat(2, 120px); }
}

.graph-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin: 0 0 .45rem;
}
.measure-pop { position: relative; }
.measure-btn {
  display: inline-flex;
  align-items: center;
  gap: .15rem;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  padding: .2rem .35rem;
}
.measure-btn .menu-ico { width: 14px; height: 14px; }
.measure-menu { left: 0; right: auto; top: calc(100% + 4px); min-width: 220px; }
.chart.graph-svg { height: 380px; }
.exec-page { padding-bottom: 2rem; }
.exec-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 36px;
  margin-bottom: .75rem;
  flex-wrap: nowrap;
}
.exec-left,
.exec-right {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 32px;
}
.exec-bar h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 32px;
  white-space: nowrap;
}
.exec-bar .btn {
  height: 32px;
  padding: 0 .8rem;
  line-height: 1;
}
.exec-tool {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 32px;
  padding: 0 .65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  font-size: .8rem;
  line-height: 1;
}
.exec-tool select {
  width: 4.6rem;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: 0;
}
.exec-ccy {
  display: inline-flex;
  align-items: center;
  height: 32px;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1;
  white-space: nowrap;
}
.exec-warn {
  text-align: center;
  background: var(--gold-soft);
  color: var(--ink);
  padding: .55rem 1rem;
  font-size: .82rem;
  margin: 0 0 1rem;
  border-radius: 6px;
}
.exec-sheet { max-width: 560px; margin: 0 auto; }
.exec-table { width: 100%; border-collapse: collapse; }
.exec-table th {
  text-align: right;
  font-weight: 650;
  padding: .45rem .65rem;
  color: var(--muted);
  font-size: .82rem;
}
.exec-table td { padding: .4rem .65rem; font-size: .86rem; }
.exec-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.exec-table tr.sec td {
  background: var(--fill);
  font-weight: 700;
  padding: .5rem .65rem;
}
.exec-table tr.indent td:first-child { padding-left: 1.35rem; color: var(--muted); }

.set-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: -.5rem -1rem -1.6rem;
  min-height: calc(100vh - var(--header) - .5rem);
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.set-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 420px) minmax(0, 1fr);
  align-items: center;
  gap: .75rem;
  min-height: 46px;
  padding: .4rem 1rem .4rem .85rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 5;
  flex: 0 0 auto;
}
.set-control-left {
  display: flex;
  align-items: center;
  gap: .35rem;
  min-width: 0;
  justify-self: start;
}
.set-control-title {
  margin-left: .45rem;
  font-family: var(--font);
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: -.01em;
  color: var(--ink);
  white-space: nowrap;
}
.set-control-right {
  min-width: 0;
}
/* Shared UI kit — search field used anywhere (settings, lists, filters) */
.ui-search {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  width: 100%;
  max-width: 420px;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0 .75rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--page);
  color: var(--muted);
  box-sizing: border-box;
  vertical-align: middle;
}
.ui-search:focus-within {
  border-color: var(--gold);
  color: var(--ink);
}
.ui-search svg,
.ui-search .ui-search-ico {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ui-search input,
.ui-search input[type="search"],
.ui-search .ui-search-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: 32px;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  color: var(--ink);
  font-family: var(--font);
  font-size: .86rem;
  font-weight: 500;
  line-height: 32px;
  box-shadow: none !important;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.ui-search input::-webkit-search-decoration,
.ui-search input::-webkit-search-cancel-button,
.ui-search input::-webkit-search-results-button,
.ui-search input::-webkit-search-results-decoration {
  display: none;
  -webkit-appearance: none;
}
.set-control .ui-search {
  justify-self: center;
  max-width: none;
}
.set-control .btn {
  border-radius: 0;
  font-family: var(--font);
  font-weight: 600;
  font-size: .86rem;
  min-height: 32px;
  height: 32px;
  padding: 0 .9rem;
  line-height: 1;
}
.set-control .btn.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--icon-fg);
}
.set-control .btn.primary:hover { filter: brightness(1.08); }
.set-control .btn:not(.primary) {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
}
.set-control .btn:not(.primary):hover { background: var(--fill); }
.set-body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
}
.set-page .btn,
.set-page .btn.primary,
.set-form .btn,
.set-form .btn.primary {
  font-weight: 600;
  min-height: 30px;
  padding: .28rem .85rem;
}
.set-shell input[type="checkbox"],
.set-form input[type="checkbox"],
.set-page input[type="checkbox"] {
  top: .1rem;
  flex: 0 0 16px;
}
.set-side {
  border-right: 1px solid var(--line);
  background: var(--page);
  padding: .35rem 0 1.5rem;
  overflow: auto;
}
.set-side-nav { display: flex; flex-direction: column; gap: 0; padding: 0; }
.set-side-item {
  border: 0;
  border-left: 3px solid transparent;
  background: none;
  text-align: left;
  padding: .42rem .85rem .42rem .65rem;
  border-radius: 0;
  color: var(--ink);
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
}
.set-side-item:hover { background: var(--fill); }
.set-side-item.on {
  background: var(--gold-soft);
  border-left-color: var(--gold);
  color: var(--ink);
  font-weight: 700;
}
[data-theme="dark"] .set-side-item.on {
  background: var(--fill);
  border-left-color: var(--gold);
  color: var(--ink);
}
.set-app-ico {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  background: var(--icon);
  color: var(--icon-fg);
  display: grid;
  place-items: center;
}
.set-app-ico svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.set-side-item.on .set-app-ico {
  background: var(--navy);
  color: var(--icon-fg);
}
.set-main {
  padding: 0;
  overflow: auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.set-app-head { margin: 0 0 .5rem; }
.set-app-head h2 { margin: 0 0 .2rem; font-size: 1.25rem; }
.set-page {
  width: 100%;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  padding: .85rem 1.35rem 2.5rem;
}
.set-sec {
  border-top: 1px solid var(--line);
  padding: 1.15rem 0 1.25rem;
}
.set-sec:first-of-type { border-top: 0; padding-top: .25rem; }
.set-sec h3 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  font-weight: 650;
}
.set-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem 2.75rem;
}
.set-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.set-hint { margin: .2rem 0 0; font-size: .78rem; }
.set-block:has(> .set-toggle:first-of-type) > h4 { display: none; }
.set-block .muted { margin: 0 0 .4rem; font-size: .82rem; }
.set-invite { display: flex; gap: .35rem; align-items: center; max-width: 28rem; }
.set-invite input {
  margin: 0;
  flex: 1;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: .3rem .15rem;
}
.set-invite input:hover,
.set-invite input:focus { background: transparent; }
.set-swatch { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .84rem; margin: 0 0 .45rem; }
.set-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: inline-block;
}
.set-form { padding: 1.1rem 1.2rem 1.4rem; }
.set-form textarea { min-height: 10rem; width: 100%; }
.set-form input,
.set-field input {
  border-radius: 0;
}
.set-page select,
.set-field select,
.set-form select {
  border-radius: 0;
  background-repeat: no-repeat !important;
  background-position: right .35rem center;
  background-size: 16px 16px;
}
.set-toggle {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  margin: .15rem 0;
  cursor: pointer;
  color: var(--ink);
}
.set-toggle input { margin-top: .15rem; flex: 0 0 16px; }
.set-toggle strong { display: block; font-weight: 600; font-size: .9rem; }
.set-toggle em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: .8rem;
  margin-top: .12rem;
  line-height: 1.35;
}
.set-radios { display: flex; flex-direction: column; gap: .35rem; margin-top: .35rem; }
.set-radio { display: flex; gap: .4rem; align-items: center; cursor: pointer; }
.set-field { margin-top: .35rem; }
.set-field input,
.set-field select { margin-bottom: 0; }
.set-alias {
  display: flex;
  align-items: center;
  gap: .25rem;
  max-width: 22rem;
  border-bottom: 1px solid var(--line);
}
.set-alias span { color: var(--muted); }
.set-alias input { margin: 0; border: 0; flex: 1; border-radius: 0; }

.check-row { display: flex; align-items: flex-start; gap: .5rem; margin: .55rem 0; cursor: pointer; }
.check-row input { margin-top: .2rem; flex: 0 0 auto; }
.bad { color: var(--danger); }
.good { color: var(--ok); }
.je-lines input { margin: 0; }
.je-lines td { vertical-align: middle; }
.je-totals { display: flex; gap: 1.5rem; justify-content: flex-end; padding: .5rem .25rem; font-size: .92rem; }
.badge.validated { background: var(--ok-bg); color: var(--ok); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn { padding: .25rem .6rem; font-size: .8rem; }
.set-form > input:not([type="checkbox"]):not([type="radio"]),
.set-form > select { width: 100%; }
.set-form .row > div { min-width: 0; }
.set-form .row input:not([type="checkbox"]):not([type="radio"]),
.set-form .row select { width: 100%; }
.pd-disc p { margin: .55rem 0; }

/* ---- reports ---- */
.report-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; padding: .6rem 1rem; border-bottom: 1px solid var(--line); }
.report-bar label { color: var(--muted); font-size: .8rem; }
.report-bar select, .report-bar input[type="date"] { margin: 0; width: auto; min-width: 8rem; }
.report-bar .ui-select { margin: 0; vertical-align: middle; }
.report-bar .ui-select-btn { min-width: 8rem; margin: 0; }
.rep-narrow { max-width: 820px; margin-left: auto; margin-right: auto; }
.report-bar .check-row.inline { display: inline-flex; margin: 0; align-items: center; }
.report-bar-end { margin-left: auto; display: inline-flex; gap: .4rem; }

.ui-select {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
}
.ui-select.ui-select-block { display: block; width: 100%; }
.ui-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.ui-select-btn {
  display: inline-flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  margin: 0 0 .55rem;
  padding: .42rem 1.5rem .42rem .2rem;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right .35rem center;
  background-size: 16px 16px;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ui-select-btn:hover,
.ui-select-btn:focus,
.ui-select-btn:focus-visible {
  outline: none;
  background-color: transparent;
}
.ui-select-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  bottom: auto;
  left: 0;
  min-width: max(100%, 14rem);
  max-width: min(90vw, 28rem);
  max-height: min(50vh, 320px);
  overflow: auto;
  z-index: 90;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-pop);
  padding: .25rem 0;
}
.ui-select.open .ui-select-menu { display: block; }
/* When placed in the viewport (placeMenuBelow), keep the same look */
.ui-select-menu[style*="fixed"],
.combo-menu[style*="fixed"] {
  right: auto;
}
.ui-select-btn.is-placeholder,
.ui-select-opt.is-placeholder {
  color: var(--muted);
  opacity: .45;
  font-weight: 400;
}
.ui-select-opt {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: .4rem .85rem;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ui-select-opt:hover { background: var(--fill); }
.ui-select-opt.on {
  font-weight: 650;
  color: var(--gold-ink);
}
[data-theme="dark"] .ui-select-opt.on { color: var(--gold); }
.report-doc {
  padding: .75rem 1.25rem 2.5rem;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.report-head { text-align: center; margin-bottom: .35rem; }
.report-head h2 { margin: .4rem 0 0; font-size: 1.35rem; }
.report-head p { margin: .15rem 0 1rem; }
.rep-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1rem;
  margin: 0 0 1.15rem;
}
.rep-charts .rep-chart { margin: 0; }
.rep-chart { margin: 0 0 1.2rem; padding: .9rem 1rem; }
.rep-chart h3 { margin: 0 0 .55rem; font-size: .95rem; }
.rep-chart .chart { width: 100%; height: auto; max-height: 280px; }
@media (max-width: 900px) {
  .rep-charts { grid-template-columns: 1fr; }
}
.rep-note { margin-top: .8rem; font-size: .82rem; }
.rep-sub { margin: 1.4rem 0 .3rem; font-size: 1rem; }
.gl-acc { margin: 1.2rem 0; }
.gl-acc h3 { margin: 0 0 .3rem; font-size: 1rem; }
table.rep td, table.rep th { white-space: nowrap; }
table.rep td:first-child { white-space: normal; }
table.rep tr.sec td { font-weight: 700; text-transform: uppercase; font-size: .72rem; letter-spacing: .05em; color: var(--muted); padding-top: 1rem; border-bottom: 1px solid var(--line); }
table.rep tr.sub td { font-weight: 600; }
table.rep tr.line td:first-child { padding-left: 1.1rem; }
table.rep tr.tot td { font-weight: 600; border-top: 1px solid var(--line); }
table.rep tr.grand td { font-weight: 700; border-top: 2px solid var(--ink); background: var(--fill); }
table.rep tr.hidden { display: none; }
table.rep tr.doc td { background: transparent; color: var(--muted); font-size: .86rem; }
table.rep tr.doc td:first-child { padding-left: 2rem; }
table.rep .caret { width: 1.2rem; text-align: center; }
.rep-bar { display: block; width: 8rem; height: .55rem; background: var(--fill); border-radius: 4px; overflow: hidden; }
.rep-bar i { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.report-bar input[type="search"] { margin: 0; width: 10rem; }
.report-bar .link { font-size: .84rem; }
.age-bar { display: flex; height: .55rem; border-radius: 4px; overflow: hidden; margin: .2rem 0 1rem; background: var(--fill); }
.age-seg.s0 { background: var(--chart-1); } .age-seg.s1 { background: var(--chart-2); } .age-seg.s2 { background: var(--chart-4); }
.age-seg.s3 { background: var(--chart-5); } .age-seg.s4 { background: var(--chart-6); }
@media print {
  .topbar, .ctrl, .report-bar, .doc-toolbar, #dialog, #confirm { display: none !important; }
  body, .report-doc { background: var(--print-bg) !important; }
  .report-doc, .report-doc * { color: var(--print-ink) !important; background: transparent !important; border-color: var(--print-line) !important; }
  table.rep tr.grand td { background: var(--print-fill) !important; }
  .report-doc { padding: 0; }
  a.link, button.link { text-decoration: none; }
}

/* ---- user access editor ---- */
.access-table td { vertical-align: middle; padding: .35rem .4rem; }
.access-table .app-name { font-weight: 600; width: 9rem; }
.access-table select { margin: 0; min-width: 11rem; }
.access-table .level-note { font-size: .8rem; }
.access-table.dim { opacity: .45; pointer-events: none; }
.pw-reset { margin: .8rem 0 .2rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.pw-reset input { margin: 0; width: 15rem; }
.user-form .row input { width: 100%; }

/* ---- user access editor ---- */
.access-table td { vertical-align: middle; padding: .35rem .4rem; }
.access-table .app-name { font-weight: 600; width: 9rem; }
.access-table select { margin: 0; min-width: 11rem; }
.access-table .level-note { font-size: .8rem; }
.access-table.dim { opacity: .45; pointer-events: none; }
.pw-reset { margin: .8rem 0 .2rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.pw-reset input { margin: 0; width: 15rem; }
.user-form .row input { width: 100%; }
.quick-row { display: flex; gap: .5rem; margin: 0 0 1rem; }

/* ---- read-only mode: the screens stay, the ways to change things go ---- */
.read-only #acc-new,
.read-only .ln-del, .read-only .icon-del, .read-only .row-actions,
.read-only #inv-post, .read-only #inv-confirm, .read-only #inv-void, .read-only #inv-reset, .read-only #inv-cn, .read-only #inv-send, .read-only #inv-regpay,
.read-only #pay-void, .read-only #pay-alloc, .read-only #je-rev, .read-only #bank-auto, .read-only #bank-validate, .read-only #bank-reopen,
.read-only [data-match], .read-only [data-book], .read-only [data-ignore], .read-only [data-unmatch],
.read-only #rv-post, .read-only #lock-edit, .read-only [data-close], .read-only [data-reopen], .read-only [data-lock], .read-only [data-unlock],
.read-only .sel-act:not([data-act="export"]), .read-only #act-menu .act-item[data-need="sel"]:not([data-act="export"]), .read-only .set-toolbar { display: none !important; }
/* assets and loans: booking, selling, stopping and the rest of what changes them */
.read-only .as-write { display: none !important; }
[data-deny~="post"] #inv-post, [data-deny~="post"] #inv-confirm, [data-deny~="post"] #inv-void, [data-deny~="post"] #inv-reset, [data-deny~="post"] #inv-cn { display: none !important; }
[data-deny~="pay"] #inv-regpay, [data-deny~="pay"] #pay-void, [data-deny~="pay"] #pay-alloc { display: none !important; }

/* ---- roles ---- */
.perm-groups { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: .3rem .8rem; }
.perm-group { margin: .5rem 0 .8rem; }
.perm-group header { display: flex; gap: .8rem; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: .2rem; margin-bottom: .2rem; }
.perm-group header .link { font-size: .78rem; }
.perm-group header strong { flex: 1; }
.check-row.perm { margin: .25rem 0; }
.rf-find { margin: 0 0 .5rem; width: 100%; }
.owner-note { background: var(--fill); border-radius: 8px; padding: .55rem .8rem; margin: 0 0 .8rem; }
.access-table.dim, #uf-extras.dim { opacity: .45; pointer-events: none; }

.login input:not([type="checkbox"]) { width: 100%; box-sizing: border-box; }

/* ---- dates: a native date box that displays "May 14, 1:25 PM" ---- */
.dt-wrap { position: relative; display: block; margin: 0 0 .55rem; }
.dt-wrap .dt-native { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; z-index: 1; }
.dt-wrap .dt-show { display: block; padding: .42rem .2rem; border-radius: 4px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.9rem; }
.dt-wrap:hover .dt-show, .dt-wrap:focus-within .dt-show { background: transparent; }
.dt-wrap .dt-show.empty { color: var(--muted); }
.dt-wrap.disabled { opacity: .55; }
.dt-wrap.disabled .dt-native { cursor: not-allowed; }
.report-bar .dt-wrap { display: inline-block; margin: 0; min-width: 8.5rem; }
.report-bar .dt-wrap .dt-show { border: 0; padding: .35rem .55rem; }
td .dt-wrap { margin: 0; }
time { white-space: nowrap; }

/* ------------------------------------------------------------------ contacts */
.smart-btn.warn { border-color: var(--warn); }
.smart-btn.warn span { color: var(--danger); }
.contact-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: .6rem; }
.contact-head .pf-avatar { flex: 0 0 auto; width: 72px; height: 72px; font-size: 1.3rem; }
.contact-head .contact-name { flex: 1 1 auto; min-width: 0; }
.contact-head .contact-name input.title-input { width: 100%; font-size: 1.5rem; font-weight: 600; padding: .2rem .3rem; }
.contact-flags { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; align-items: center; margin-top: .35rem; }
.contact-flags label { display: inline-flex; gap: .3rem; align-items: center; margin: 0; }
.tag-input { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; min-height: 32px; }
.tag-input input { flex: 1 1 8rem; min-width: 8rem; border: 0; background: transparent; padding: .2rem .3rem; margin: 0; }
.tag-input input:hover, .tag-input input:focus { background: transparent; }
.bank-grid { display: grid; grid-template-columns: 1.3fr 1.3fr 1.3fr 1fr 6rem 2rem; gap: .35rem; align-items: center; }
.bank-grid input, .bank-grid select { margin: 0; }
.bank-grid .bank-head { color: var(--muted); font-size: .78rem; }
.dupe-group { margin-bottom: 1rem; }
.dupe-group td.pick { width: 2.2rem; }
.contact-kanban { display: flex; gap: .7rem; align-items: center; }
.contact-kanban .pf-avatar { width: 40px; height: 40px; border-radius: 10px; font-size: .85rem; flex: 0 0 auto; }
.import-preview { max-height: 14rem; overflow: auto; }

/* import wizard (import.js): one shape for every list — the steps, one step's content, the buttons under a rule */
.form-dialog:has(.imp) { width: min(60rem, calc(100% - 1.5rem)); }
/* the steps and the buttons stay where they are; what is between them scrolls when it is long (27 fields to match) */
.form-dialog:has(.imp) #form-dialog-body { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.imp { display: flex; flex-direction: column; gap: 1rem; padding: 1.1rem 1.4rem 1rem; min-height: 0; flex: 1 1 auto; }
.imp > * { flex: none; }
.imp > .imp-body { flex: 1 1 auto; overflow: auto; min-height: 0; }
.imp p { margin: 0; line-height: 1.5; }
.imp .form-dialog-foot { margin-top: .2rem; }
.imp-steps { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; margin: 0; padding: 0 0 .95rem; list-style: none; border-bottom: 1px solid var(--line); counter-reset: imp-step; }
.imp-steps li { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .9rem; counter-increment: imp-step; }
.imp-steps li::before { content: counter(imp-step); display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border: 1px solid var(--line-strong); border-radius: 50%; font-size: .78rem; font-weight: 600; }
.imp-steps li.on { color: var(--ink); font-weight: 600; }
.imp-steps li.on::before { background: var(--navy); border-color: var(--navy); color: var(--on-accent); }
.imp-steps li.done::before { content: "✓"; background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.imp-body { display: flex; flex-direction: column; gap: 1rem; min-width: 0; padding-right: .15rem; }
.imp-body > * { flex: none; }
.imp-lead { color: var(--ink); }
.imp-sub { color: var(--muted); font-size: .88rem; }
.imp-h { margin: 0 0 .4rem; font-size: .8rem; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.imp-drop { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.9rem 1rem; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--page); color: var(--muted); text-align: center; cursor: pointer; }
.imp-drop strong { color: var(--ink); font-size: 1rem; }
.imp-drop:hover, .imp-drop:focus-visible, .imp-drop.over { border-color: var(--focus); background: var(--gold-soft); outline: none; }
.imp-tools { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.imp-ref { border: 1px solid var(--line); border-radius: var(--radius); }
.imp-ref summary { padding: .6rem .9rem; cursor: pointer; font-weight: 600; }
.imp-ref[open] summary { border-bottom: 1px solid var(--line); }
.imp-scroll { max-height: 18rem; overflow: auto; }
.imp-file { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: baseline; justify-content: space-between; padding: .55rem .8rem; background: var(--page); border: 1px solid var(--line); border-radius: var(--radius); }
.imp-map { border: 1px solid var(--line); border-radius: var(--radius); }
.imp-map-row { display: grid; grid-template-columns: minmax(11rem, 1.2fr) minmax(12rem, 1fr) minmax(9rem, 1fr); gap: .8rem; align-items: center; padding: .55rem .9rem; border-bottom: 1px solid var(--line); }
.imp-map-row:last-child { border-bottom: 0; }
.imp-map-row.head { background: var(--page); font-size: .76rem; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.imp-map-row.need { background: var(--danger-bg); }
.imp-map select { margin: 0; width: 100%; }
.imp-field { display: flex; flex-direction: column; gap: .1rem; min-width: 0; font-size: .92rem; }
.imp-field small { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.imp-name { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .5rem; }
.imp-req { padding: .02rem .45rem; border: 1px solid var(--danger); border-radius: 999px; color: var(--danger); font-size: .7rem; font-weight: 600; }
.imp-sample { display: flex; flex-direction: column; min-width: 0; font-size: .85rem; color: var(--muted); }
.imp-sample span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-map-row.on .imp-sample { color: var(--ink); }
.imp-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.imp-chip { padding: .1rem .65rem; border: 1px solid var(--line); border-radius: 999px; background: var(--fill); font-size: .83rem; }
.imp-opts { display: flex; flex-direction: column; gap: .25rem; }
.imp-opt { display: flex; gap: .5rem; align-items: center; font-size: .92rem; }
.imp-preview { display: flex; flex-direction: column; gap: .7rem; overflow-x: auto; }
.imp-sum { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.imp-pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; background: var(--fill); border: 1px solid var(--line); font-size: .85rem; }
.imp-pill.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.imp-pill.bad { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.imp-bar { height: .55rem; border-radius: 999px; background: var(--fill); border: 1px solid var(--line); overflow: hidden; }
.imp-bar > div { height: 100%; width: 0; background: var(--ok); transition: width .15s linear; }
.imp-fails { margin: 0; padding-left: 1.2rem; max-height: 10rem; overflow: auto; font-size: .88rem; }
@media (max-width: 720px) { .imp-map-row { grid-template-columns: minmax(0, 1fr); gap: .35rem; } .imp-map-row.head { display: none; } }
table.data tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.prio-star { border: 0; background: none; cursor: pointer; font-size: 1.05rem; line-height: 1; padding: 0 .2rem; color: var(--muted); }
.prio-star:hover { color: var(--warn); }
.prio-star.on { color: var(--warn); }
.late-text { color: var(--danger); }
table.data td.star-col, table.data th.star-col { width: 2rem; padding-left: 0; padding-right: 0; }
.cfg-tree .indent { color: var(--muted); }
.pe-attrs { display: grid; gap: .3rem; margin-bottom: .5rem; }
.pe-attr { margin: 0; }
.pe-attr label { display: inline-flex; gap: .25rem; align-items: center; margin-right: .6rem; }
.good { color: var(--success, var(--vs-success)); }
.ct-qty { width: 7rem; text-align: right; margin: 0; }
textarea.pk-lot { min-width: 12rem; }

/* ------------------------------------------------------------------ CRM */
.prio-stars { display: inline-flex; gap: 0; white-space: nowrap; }
.prio-stars .prio-star { font-size: 1rem; padding: 0 .05rem; }
.crm-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.crm-tools input[type=search], .crm-tools select { margin: 0; min-width: 12rem; }
.chip-btn { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: .2rem .7rem; cursor: pointer; font: inherit; font-size: .85rem; }
.chip-btn.on { background: var(--gold-soft); color: var(--gold-ink); border-color: var(--gold); }
.crm-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .6rem; align-items: start; }
.crm-col { background: var(--fill); border-radius: 0; padding: .6rem; min-height: 200px; border: 2px solid transparent; }
.crm-col.over, .crm-drop.over { border-color: var(--gold); }
.crm-col header { display: flex; align-items: center; gap: .4rem; font-weight: 650; }
.crm-col header span { flex: 1; }
.crm-col header em { color: var(--muted); font-style: normal; font-size: .8rem; }
.crm-col-sum { margin: .1rem 0 .5rem; font-size: .8rem; }
.crm-card { background: var(--bg); border: 1px solid var(--line); border-radius: 0; padding: .55rem .65rem; margin-bottom: .5rem; cursor: pointer; }
.crm-card.dragging { opacity: .45; }
.crm-card.rotting { border-left: 3px solid var(--warn); }
.crm-card p { margin: .2rem 0 0; font-size: .82rem; }
.crm-card-top { display: flex; justify-content: space-between; gap: .4rem; align-items: flex-start; }
.crm-rev { font-weight: 600; }
.crm-card-foot { display: flex; align-items: center; gap: .4rem; margin-top: .4rem; }
.crm-card-foot .pf-avatar.sm { width: 22px; height: 22px; border-radius: 50%; font-size: .62rem; margin-left: auto; }
.crm-act { color: var(--muted); }
.crm-act.late { color: var(--danger); }
.crm-empty { font-size: .82rem; }
.crm-drops { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: .6rem; }
.crm-drop { border: 2px dashed var(--line); border-radius: 8px; padding: .8rem; text-align: center; color: var(--muted); }
.crm-drop.won { color: var(--success, var(--vs-success)); }
.crm-drop.lost { color: var(--danger); }
.crm-title { display: flex; align-items: center; gap: .6rem; }
.crm-title .title-input { flex: 1; font-size: 1.4rem; font-weight: 600; }
.crm-title .prio-stars .prio-star { font-size: 1.3rem; }
.crm-steps li .link { color: inherit; text-decoration: none; }
.crm-steps li.on .link { font-weight: 700; }
.crm-plan { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .6rem; }

/* ------------------------------------------------------------------ point of sale */
.pt-bar { display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.pt-spacer { flex: 1; }
.pt-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: .9rem; align-items: start; }
.pt-search { display: flex; gap: .5rem; margin-bottom: .5rem; }
.pt-search input { flex: 1; margin: 0; font-size: 1rem; }
.pt-search select { margin: 0; width: 6rem; }
.pt-cats { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.pt-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.pt-tile { position: relative; display: flex; flex-direction: column; gap: .15rem; text-align: left; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px; padding: .6rem .65rem; cursor: pointer; font: inherit; min-height: 86px; }
.pt-tile:hover { border-color: var(--gold); }
.pt-tile strong { font-size: .92rem; }
.pt-price { margin-top: auto; font-weight: 600; }
.pt-stock { position: absolute; top: .4rem; right: .5rem; font-size: .72rem; color: var(--muted); }
.pt-stock.out { color: var(--danger); }
.pt-right { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: .7rem; position: sticky; top: .5rem; }
.pt-lines { max-height: 46vh; overflow: auto; margin: .5rem 0; }
.pt-line { border-bottom: 1px solid var(--line); padding: .45rem 0; }
.pt-line-top { display: flex; justify-content: space-between; gap: .5rem; }
.pt-line-ctl { display: flex; align-items: center; gap: .3rem; margin-top: .25rem; }
.pt-line-ctl .btn { padding: .1rem .5rem; min-width: 2rem; }
.pt-qty { width: 4.2rem; margin: 0; text-align: center; }
.pt-disc { display: inline-flex; align-items: center; gap: .1rem; margin-left: auto; }
.pt-disc input { width: 3.4rem; margin: 0; }
.pt-lot, .pt-alt { font-size: .78rem; }
.pt-empty { text-align: center; padding: 2rem 0; }
.pt-total { display: flex; justify-content: space-between; font-size: 1.4rem; padding: .4rem 0; }
.pt-actions { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: .4rem; margin-top: .5rem; }
.pt-pay { font-size: 1.05rem; padding: .7rem; }
.pt-cash { display: flex; align-items: center; gap: .6rem; margin: .3rem 0; }
.pt-cash input { margin: 0; width: 9rem; }
.pay-due { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.6rem; margin-bottom: .2rem; }
.pay-methods { display: flex; gap: .4rem; margin: .7rem 0; }
.pay-rem { display: flex; justify-content: space-between; font-size: 1.2rem; padding: .5rem 0; }
.pay-rem .pay-chg { font-size: .85rem; align-self: center; color: var(--muted); } .pay-rem .pay-chg select { margin-left: .3rem; }
.pay-alt small { font-size: .78rem; }
.pay-loy { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: .4rem 0; padding: .5rem .75rem; border: 1px solid var(--vs-amber); border-radius: 6px; background: color-mix(in srgb, var(--vs-amber) 10%, transparent); }
.pay-loy[hidden] { display: none; }
.pay-layby { margin: .4rem 0; } .pay-layby input[type=date] { max-width: 11rem; }
.receipt { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; border: 1px dashed var(--line); border-radius: 6px; padding: .7rem; max-width: 22rem; margin: 0 auto .8rem; }
.receipt h3, .receipt p.c { text-align: center; margin: .2rem 0; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 2px 0; vertical-align: top; }
.receipt td.r { text-align: right; }
.receipt tr.t td { border-top: 1px dashed var(--line); font-weight: 700; }
@media (max-width: 900px) { .pt-grid { grid-template-columns: 1fr; } .pt-right { position: static; } }

/* an error or a confirmation raised from inside a form dialog must sit above it */
#dialog.dialog-back, #confirm.dialog-back { z-index: 95; }

/* HR */
.hr-note { border: 1px solid var(--warn); border-left-width: 4px; background: var(--warn-bg); border-radius: var(--radius); padding: .7rem .9rem; margin: .8rem 0; }
.hr-note.ok { border-color: var(--ok); background: var(--ok-bg); }
.hr-card { display: flex; gap: .8rem; align-items: center; }
.hr-avatar { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; flex: none; }
.hr-sub { margin: 1rem 0 .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.hr-totals { display: flex; flex-wrap: wrap; gap: .8rem; margin: .8rem 0; }
.hr-total { flex: 1 1 22rem; }
.hr-total h4 { margin: 0 0 .5rem; }
.hr-total-grid { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; }
.hr-total-grid strong { text-align: right; font-variant-numeric: tabular-nums; }
.hr-bands input, .hr-rates .pm-val { width: 8rem; }

/* Document layout dialog */
.form-dialog.wide { width: min(1240px, 96vw); max-width: none; }
.lay-dialog { display: grid; grid-template-columns: minmax(300px, 440px) 1fr; gap: 1.2rem; align-items: stretch; flex: 1 1 auto; min-height: 0; padding: 1rem 1.2rem 0; }
.lay-form { overflow: auto; min-height: 0; padding: 0 .8rem 0 0; }
.lay-preview { overflow: auto; min-height: 0; }
.lay-frame-wrap { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--fill); }
.lay-frame-wrap iframe { width: 794px; height: 1123px; border: 0; transform-origin: top left; background: var(--print-bg); }
@media (max-width: 900px) { .lay-dialog { grid-template-columns: 1fr; overflow: auto; } .lay-form, .lay-preview { overflow: visible; } }

/* POS menu: preparation display, till extras */
.kd-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; align-items: start; margin-top: .8rem; }
.kd-col { background: var(--fill); border-radius: var(--radius); padding: .7rem; min-height: 12rem; }
.kd-col h3 { margin: 0 0 .6rem; font-size: .95rem; }
.kd-card { background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: .6rem .7rem; margin-bottom: .6rem; }
.kd-card.late { border-left-color: var(--danger); }
.kd-top { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; } .kd-age { margin-left: auto; color: var(--muted); font-size: .8rem; }
.kd-line { margin-top: .3rem; } .kd-note { margin-top: .2rem; color: var(--warn); font-size: .85rem; }
.kd-act { display: flex; gap: .4rem; margin-top: .5rem; }
.pt-serve { display: flex; gap: .4rem; margin-bottom: .5rem; } .pt-serve select { flex: 1; }
.pt-note { color: var(--warn); font-size: .8rem; }
.pt-combo { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .4rem; }
.chip-btn.busy { border-color: var(--warn); }

/* The till as a full-screen terminal (pos_kiosk.js) */
body.kiosk #login-view, body.kiosk #app-view { display: none !important; }
#kiosk { position: fixed; inset: 0; background: var(--page); color: var(--ink); overflow: auto; z-index: 20; font-size: 15px; }
.kx-center { min-height: 100%; display: grid; place-items: center; padding: 1.5rem; }
.kx-card { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 1.6rem; width: min(360px, 100%); text-align: center; box-shadow: var(--shadow-pop); }
.kx-card.kx-wide { width: min(760px, 100%); text-align: left; }
.kx-card h1 { margin: .2rem 0; font-size: 1.5rem; }
.kx-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; } .kx-time { font-size: 1.6rem; color: var(--muted); }
.kx-ops { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin: 1rem 0; }
.kx-op { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1rem .6rem; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--ink); }
.kx-op:hover { border-color: var(--brand); background: var(--brand-soft); } .hr-avatar.big { width: 4rem; height: 4rem; font-size: 1.3rem; margin: 0 auto; }
.kx-scan { margin-top: .8rem; }
.kx-dots { display: flex; gap: .6rem; justify-content: center; margin: 1rem 0; } .kx-dots i { width: .9rem; height: .9rem; border-radius: 50%; border: 2px solid var(--line-strong); } .kx-dots i.on { background: var(--brand); border-color: var(--brand); }
.kx-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .5rem 0; }
.kx-key { padding: 1rem .5rem; font-size: 1.2rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; color: var(--ink); }
.kx-key:hover { background: var(--fill); } .kx-key.on { background: var(--brand-soft); border-color: var(--brand); }
.kx-key.good { background: var(--ok-bg); } .kx-key.warn { background: var(--warn-bg); } .kx-key.bad { background: var(--danger-bg); } .kx-key.pale { background: var(--fill); }
.kx-enter { width: 100%; margin-top: .5rem; padding: .9rem; font-size: 1.05rem; }
.kx-cash { display: grid; grid-template-columns: 1fr 10rem auto; gap: .8rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.kx-actions { display: flex; justify-content: flex-end; margin-top: 1rem; } .kx-big { padding: .9rem 2rem; font-size: 1.1rem; }
.kx { display: flex; flex-direction: column; min-height: 100%; height: 100%; }
.kx-top { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; background: var(--bg); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.kx-tabs { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.kx-tab { padding: .55rem 1rem; background: var(--bg); border: 0; border-right: 1px solid var(--line); cursor: pointer; color: var(--ink); font-size: 1rem; } .kx-tab:last-child { border-right: 0; }
.kx-tab.on { background: var(--brand-soft); font-weight: 600; } .kx-plus { border: 1px solid var(--line); border-radius: 6px; } .kx-orders { display: flex; gap: .3rem; overflow-x: auto; }
.kx-orders .kx-tab { border: 1px solid var(--line); border-radius: 6px; } .kx-cnt { display: inline-block; background: var(--brand); color: var(--on-accent); border-radius: 999px; padding: 0 .4rem; font-size: .75rem; }
.kx-spacer { flex: 1; } .kx-top input[type="search"] { width: 16rem; } .kx-avatar, .kx-menu { background: none; border: 0; cursor: pointer; color: var(--ink); font-size: 1.4rem; }
.kx-body { flex: 1; display: grid; grid-template-columns: minmax(340px, 30%) 1fr; min-height: 0; }
.kx-left { display: flex; flex-direction: column; background: var(--bg); border-right: 1px solid var(--line); padding: .5rem; min-height: 0; }
.kx-lines { flex: 1; overflow: auto; } .kx-empty { text-align: center; margin-top: 2rem; }
.kx-line { display: grid; grid-template-columns: 2.2rem 1fr auto; gap: .5rem; padding: .5rem .4rem; border-bottom: 1px solid var(--line); cursor: pointer; } .kx-line.sel { background: var(--brand-soft); }
.kx-lq { font-weight: 700; } .kx-lt { font-variant-numeric: tabular-nums; font-weight: 600; }
.kx-totals { padding: .5rem .4rem; border-top: 1px solid var(--line); } .kx-totals > div { display: flex; justify-content: space-between; color: var(--muted); } .kx-total { font-size: 1.4rem; color: var(--ink) !important; }
.kx-row { display: flex; gap: .4rem; margin: .4rem 0; } .kx-btn { flex: 1; padding: .8rem; background: var(--fill); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; color: var(--ink); font-size: 1rem; } .kx-btn.on { background: var(--brand); color: var(--on-accent); } .kx-btn.kx-icon { flex: 0 0 3rem; }
.kx-numpad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.kx-numpad .kx-key { border: 0; border-radius: 0; padding: 1.05rem 0; }
.kx-pay { width: 100%; padding: 1.1rem; margin-top: .5rem; background: var(--brand); color: var(--on-accent); border: 0; border-radius: 6px; font-size: 1.15rem; cursor: pointer; } .kx-pay:disabled { opacity: .45; cursor: not-allowed; }
.kx-right { display: flex; flex-direction: column; padding: .6rem; min-height: 0; overflow: auto; }
.kx-cats { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .7rem; } .kx-cat { padding: 1.1rem 1.4rem; min-width: 8rem; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; color: var(--ink); font-size: 1rem; } .kx-cat.on { outline: 2px solid var(--brand); }
.kx-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.kx-tile { position: relative; display: flex; flex-direction: column; text-align: left; background: var(--bg); border: 1px solid var(--line); border-bottom: 5px solid var(--brand); border-radius: 6px; cursor: pointer; padding: 0; overflow: hidden; color: var(--ink); }
.kx-tile img, .kx-init { width: 100%; height: 110px; object-fit: cover; display: grid; place-items: center; background: var(--fill); font-size: 2rem; font-weight: 700; color: var(--muted); }
.kx-name { padding: .4rem .5rem 0; font-size: .92rem; line-height: 1.2; } .kx-price { padding: 0 .5rem .5rem; color: var(--muted); font-size: .8rem; }
.kx-stock { position: absolute; top: .3rem; right: .3rem; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 0 .35rem; font-size: .75rem; } .kx-stock.out { background: var(--danger-bg); }
.kx-incart { position: absolute; right: .4rem; bottom: .5rem; background: var(--ink); color: var(--bg); border-radius: 4px; padding: 0 .45rem; font-weight: 700; }
.kx-list { max-height: 45vh; overflow: auto; margin: .5rem 0; } .kx-li { display: flex; justify-content: space-between; width: 100%; padding: .7rem; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; color: var(--ink); text-align: left; }
.kx-menu-list { display: grid; gap: .5rem; } .kx-menu-list .btn { padding: .8rem; text-align: left; }
.kx-methods { display: flex; flex-direction: column; gap: .5rem; } .kx-method { display: flex; align-items: center; gap: .8rem; padding: 1.1rem; background: var(--fill); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; color: var(--ink); font-size: 1.05rem; text-align: left; } .kx-mi { font-size: 1.4rem; }
.kx-paybody .kx-left { min-height: 0; } .kx-two { gap: .4rem; } .kx-two .kx-btn { flex: 1; } .kx-two .kx-pay { flex: 1.4; margin-top: 0; } .kx-back { background: var(--fill); }
.kx-due { align-items: center; } .kx-bigamt { font-size: 6rem; font-weight: 700; margin-top: 4rem; line-height: 1; } .kx-bigamt small { font-size: .55em; color: var(--muted); font-weight: 400; } .kx-sym { font-size: .5em; color: var(--muted); margin-right: .3rem; }
.kx-ccys { display: flex; gap: .4rem; justify-content: center; margin-top: 1rem; font-size: 1rem; } .kx-remain { font-size: 1.3rem; margin: 1rem 0; color: var(--muted); }
.kx-paylines { width: min(640px, 100%); } .kx-payline { display: flex; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 6px; margin-bottom: .5rem; cursor: pointer; background: var(--bg); } .kx-payline.sel { background: var(--brand-soft); border-color: var(--brand); } .kx-payline > :first-child { flex: 1; font-size: 1.15rem; } .kx-pa { font-size: 1.3rem; font-variant-numeric: tabular-nums; } .kx-payline .link { color: var(--danger); font-size: 1.3rem; }
.kx-done { align-items: center; text-align: center; justify-content: center; padding: 2rem; } .kx-tick { width: 8rem; height: 8rem; border-radius: 50%; background: var(--ok); color: var(--on-accent); display: grid; place-items: center; font-size: 4.5rem; }
.kx-huge { font-size: 9rem; margin-top: 1.5rem; } .kx-change { font-size: 1.6rem; color: var(--muted); } .kx-donebtns { display: flex; gap: .8rem; margin-top: 2rem; width: min(900px, 100%); } .kx-donebtns > * { flex: 1; padding: 1.2rem; margin: 0; font-size: 1.1rem; }
.kx-printchoice { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; } .kx-printchoice .kx-btn { padding: 1.6rem; font-size: 1.05rem; }
.kx-orders-page { padding: 1rem; } .kx-filters { display: flex; gap: .5rem; margin-bottom: .8rem; }
@media (max-width: 900px) { .kx-body { grid-template-columns: 1fr; } .kx-bigamt { font-size: 3.5rem; margin-top: 1rem; } .kx-huge { font-size: 4.5rem; } }

/* Touch-friendly desk till: a wider cart, larger targets, and a payment dialog fit for a finger */
.pt-grid { grid-template-columns: minmax(0, 1.5fr) minmax(460px, 1fr); gap: 1rem; }
.pt-bar .btn { min-height: 3rem; padding: .5rem 1.1rem; font-size: 1rem; }
.pt-search input { height: 3.2rem; font-size: 1.1rem; } .pt-search select { height: 3.2rem; width: 7rem; font-size: 1.05rem; }
.pt-cats { gap: .5rem; } .pt-cats .chip-btn { min-height: 2.8rem; padding: .5rem 1.1rem; font-size: 1rem; }
.pt-tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; }
.pt-tile { min-height: 118px; padding: .9rem; gap: .25rem; } .pt-tile strong { font-size: 1.05rem; } .pt-price { font-size: 1.05rem; } .pt-stock { font-size: .8rem; }
.pt-right { padding: 1rem; } .pt-lines { max-height: 52vh; }
.pt-line { padding: .8rem 0; } .pt-line-top { font-size: 1.1rem; } .pt-line-top strong { font-size: 1.1rem; }
.pt-line-ctl { gap: .5rem; margin-top: .5rem; flex-wrap: wrap; }
.pt-line-ctl .btn { min-width: 3.2rem; min-height: 3rem; font-size: 1.3rem; padding: 0 .6rem; }
.pt-qty { width: 5.5rem; height: 3rem; font-size: 1.2rem; } .pt-disc { font-size: 1rem; gap: .3rem; } .pt-disc input { width: 4.6rem; height: 3rem; font-size: 1.1rem; }
.pt-line-ctl .link { min-height: 3rem; padding: 0 .9rem; font-size: 1.05rem; } .pt-line-ctl .link[data-rm] { font-size: 1.7rem; }
.pt-total { font-size: 2rem; padding: .6rem 0; }
.pt-actions { gap: .6rem; margin-top: .8rem; } .pt-actions .btn { min-height: 3.6rem; font-size: 1.1rem; } .pt-pay { min-height: 3.8rem; font-size: 1.3rem; }
.pt-serve select, .pt-serve .btn { min-height: 3rem; font-size: 1rem; } .pt-cust .combo-input { height: 3rem; font-size: 1.05rem; }
.form-dialog.pay-wide { width: min(980px, 96vw); max-width: none; }
.pay-wide .pay-due { font-size: 2.8rem; margin-bottom: .4rem; } .pay-wide .pay-alt { font-size: 1.1rem; }
.pay-wide .pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; margin: 1rem 0; }
.pay-wide .pay-methods .chip-btn { min-height: 4rem; font-size: 1.2rem; border-radius: 10px; justify-content: center; }
.pay-wide .pf-grid { grid-template-columns: 1fr 1fr; gap: 1rem; } .pay-wide .pf-grid select, .pay-wide .pf-grid input { height: 3.6rem; font-size: 1.5rem; padding: 0 1rem; }
.pay-quick { display: flex; flex-wrap: wrap; gap: .6rem; margin: .7rem 0; } .pay-quick .btn { flex: 1 1 5rem; min-height: 3.4rem; font-size: 1.15rem; }
.pay-wide #pd-add { width: 100%; min-height: 3.6rem; font-size: 1.15rem; margin: .4rem 0; }
.pay-wide .pay-rem { font-size: 1.8rem; padding: .8rem 0; }
.pay-wide table.data td, .pay-wide table.data th { padding: .8rem .6rem; font-size: 1.1rem; } .pay-wide table.data .link { font-size: 1.8rem; padding: 0 .8rem; }
.pay-wide .form-dialog-foot { display: flex; gap: .8rem; margin-top: 1rem; } .pay-wide .form-dialog-foot .btn { flex: 1; min-height: 3.8rem; font-size: 1.2rem; }
.pay-wide #pd-go { flex: 2; }
@media (max-width: 1100px) { .pt-grid { grid-template-columns: 1fr; } }

/* Points of sale as cards on the POS dashboard, and their settings page */
.pos-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; margin: 0 0 1.2rem; }
.pos-card { display: flex; flex-direction: column; gap: .8rem; padding: 1.1rem 1.2rem; }
.pos-card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.pos-card-h h3 { margin: 0; font-size: 1.15rem; } .pos-card-h p { margin: .15rem 0 0; font-size: .82rem; }
.pos-card-sess { min-height: 3.2rem; display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
.pos-card-sess p { margin: 0; }
.pos-card-f { display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; margin-top: auto; }
.pos-card-f .pos-go { min-height: 2.8rem; padding: .4rem 1.2rem; font-size: 1rem; }
.pos-last { font-size: .8rem; text-align: left; }
.pos-empty { text-align: center; padding: 2rem; margin-bottom: 1.2rem; }
.pcfg-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.pcfg-pick { display: flex; flex-direction: column; gap: .4rem; min-width: 18rem; }
.pcfg-acts { display: flex; flex-wrap: wrap; gap: .5rem; }
.pcfg textarea { width: 100%; }

/* Connection indicator, register menu, closing report, customer display */
.pos-net { border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--ink); padding: .3rem .9rem; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.pos-net::before { content: ""; display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .45rem; background: var(--vs-success); }
.pos-net.off::before { background: var(--vs-error); } .pos-net.wait::before { background: var(--vs-warning); }
.pos-pop { position: fixed; z-index: 96; min-width: 240px; background: var(--menu-bg); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-pop); padding: .4rem; display: flex; flex-direction: column; }
.pos-pop-pill { padding: .3rem .3rem .5rem; } .pos-pop-pill .pos-net { width: 100%; border-radius: 8px; padding: .65rem; font-size: 1rem; text-align: center; }
.pos-pop-i { text-align: left; background: none; border: 0; color: var(--ink); padding: .8rem 1rem; font-size: 1.02rem; border-radius: 6px; cursor: pointer; }
.pos-pop-i:hover:not(:disabled) { background: var(--fill); } .pos-pop-i:disabled { opacity: .45; cursor: default; }
.cl { min-width: min(560px, 92vw); }
.cl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .6rem; }
.cl-block { margin: 0 0 1rem; } .cl-h { display: flex; justify-content: space-between; font-size: 1.15rem; padding: .3rem 0; }
.cl-row { display: flex; justify-content: space-between; padding: .25rem 0 .25rem .8rem; margin-left: .3rem; border-left: 2px solid var(--line); color: var(--muted); }
.cl-count { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .4rem; }
.cl-foot { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; } .cl-foot .btn { min-height: 2.8rem; }
.pos-preview { max-height: 55vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .8rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.pos-preview table { width: 100%; border-collapse: collapse; } .pos-preview td { padding: 2px 0; vertical-align: top; } .pos-preview .r { text-align: right; } .pos-preview .t td { border-top: 1px dashed var(--line-strong); font-weight: 700; padding-top: .5rem; }
.pos-preview h3, .pos-preview p.c { text-align: center; }
.pos-seg { display: flex; gap: 1.4rem; margin: .4rem 0 .8rem; } .pos-seg label { font-size: 1.05rem; }
.pos-quick { display: flex; gap: .5rem; margin-top: .6rem; }
.pt-group, .kx-group { grid-column: 1 / -1; margin: .7rem 0 .1rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pt-img { width: 100%; height: 64px; object-fit: contain; margin-bottom: .2rem; }
.pt.large .pt-tile { min-height: 150px; } .pt.large .pt-tile strong { font-size: 1.25rem; } .pt.large .pt-price { font-size: 1.25rem; } .pt.large .pt-actions .btn { min-height: 4.4rem; font-size: 1.3rem; }
.kx.large .kx-tile { min-height: 170px; } .kx.large .kx-name { font-size: 1.2rem; } .kx.large .kx-key { min-height: 4.6rem; font-size: 1.6rem; } .kx.large .kx-btn { min-height: 4rem; font-size: 1.15rem; }
.cd { min-height: 100vh; display: flex; flex-direction: column; padding: 2rem 3rem; background: var(--page); color: var(--ink); }
.cd header { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.6rem; padding-bottom: 1rem; border-bottom: 2px solid var(--line-strong); } .cd header span { color: var(--muted); font-size: 1.2rem; }
.cd-lines { flex: 1; overflow: auto; padding: 1rem 0; } .cd-line { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 0; font-size: 1.7rem; border-bottom: 1px solid var(--line); }
.cd-name small { display: block; font-size: 1.05rem; color: var(--muted); }
.cd footer { border-top: 2px solid var(--line-strong); padding-top: 1rem; } .cd-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 2.4rem; } .cd-total strong { font-size: 4.2rem; }
.cd-tax { display: flex; justify-content: space-between; font-size: 1.3rem; color: var(--muted); }
.cd-idle, .cd-thanks { align-items: center; justify-content: center; text-align: center; } .cd-idle h1, .cd-thanks h1 { font-size: 4.5rem; margin: 0; } .cd-idle p, .cd-thanks p { font-size: 1.8rem; color: var(--muted); }
.cd-clock { font-size: 3rem; margin-top: 2rem; color: var(--muted); } .cd-big { margin-top: 1.4rem; font-size: 2rem; } .cd-big strong { display: block; font-size: 4.6rem; }

/* Placeholders and figures that are still empty sit back — global for every app */
::placeholder,
::-webkit-input-placeholder,
::-moz-placeholder,
:-ms-input-placeholder {
  color: var(--muted) !important;
  opacity: .4 !important;
}
input::placeholder,
textarea::placeholder,
.combo-input::placeholder,
.ui-search-input::placeholder,
.desk-search::placeholder {
  color: var(--muted) !important;
  opacity: .4 !important;
}
input.is-zero { color: color-mix(in srgb, var(--ink) 42%, transparent); }
input.is-zero:focus { color: var(--ink); }
/* Filters are square, not pills */
.chip-btn { border-radius: 2px; }
.kx-cat { border-radius: 2px; }
/* The desk register uses the whole height of the screen: products scroll on the left, the ticket sits full height on the right with its buttons at the bottom */
.pt { display: flex; flex-direction: column; height: calc(100vh - var(--header) - 2.2rem); min-height: 520px; }
.pt-grid { flex: 1; min-height: 0; align-items: stretch; }
.pt-left { display: flex; flex-direction: column; min-height: 0; }
.pt-tiles { flex: 1; min-height: 0; overflow: auto; align-content: start; }
.pt-right { position: static; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.pt-lines { flex: 1; max-height: none; min-height: 0; overflow: auto; }
.pt-actions { margin-top: auto; }
@media (max-width: 1100px) { .pt { height: auto; } .pt-tiles { max-height: 60vh; } }

/* Compact cart lines on the desk register: name and total on one row, the controls on a single row under it */
.pt-line { padding: .35rem 0; }
.pt-line-top, .pt-line-top strong { font-size: 1rem; }
.pt-line-ctl { flex-wrap: nowrap; gap: .35rem; margin-top: .25rem; }
.pt-line-ctl .btn { min-width: 2.4rem; min-height: 2.4rem; font-size: 1.15rem; padding: 0 .4rem; }
.pt-line-ctl .pt-qty { width: 3.4rem; flex: 0 0 auto; height: 2.4rem; font-size: 1.05rem; padding: 0 .2rem; }
.pt-line-ctl .pt-disc { font-size: .9rem; gap: .15rem; margin-left: auto; flex: 0 0 auto; }
.pt-line-ctl .pt-disc input { width: 3.2rem; height: 2.4rem; font-size: 1rem; padding: 0 .25rem; }
.pt-line-ctl .link { min-height: 2.4rem; padding: 0 .5rem; font-size: .95rem; }
.pt-line-ctl .link[data-rm] { font-size: 1.4rem; }
.pt-line-ctl > .muted { white-space: nowrap; font-size: .9rem; }
.pt-lot, .pt-note { font-size: .8rem; margin: .1rem 0 0; }

/* Products: the card grid, and the product form */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .6rem; }
.card-grid .kanban-card { padding: 0; }
.card-grid .kanban-open { padding: .7rem .8rem; height: 100%; }
.pcard { display: flex; justify-content: space-between; gap: .8rem; min-height: 78px; }
.pcard-txt { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.pcard-txt strong { font-size: 1rem; overflow-wrap: anywhere; } .pcard-price { font-weight: 600; } .pcard-txt .muted { font-size: .82rem; }
.pcard-stock { font-size: .82rem; } .pcard-stock.out { color: var(--vs-error); }
.pcard-img { width: 72px; height: 72px; flex: 0 0 72px; object-fit: contain; border-radius: 4px; background: var(--fill); }
.pcard-init { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); }
.smart-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .8rem; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; text-align: left; min-height: 2.6rem; }
.smart-btn:hover:not(:disabled) { background: var(--fill); } .smart-btn strong { font-size: 1.05rem; }
.smart-btn span { display: flex; flex-direction: column; font-size: .8rem; line-height: 1.15; } .smart-btn em { font-style: normal; color: var(--muted); }
.pform-top { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.pform-name { flex: 1; min-width: 0; }
.pform-title { font-size: 1.7rem; font-weight: 650; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; background: transparent; width: 100%; padding: .2rem 0; }
.pform-title:focus { border-bottom-color: var(--brand); outline: none; }
.pform-flags { display: flex; flex-wrap: wrap; gap: 1.2rem; margin: .7rem 0 1rem; }
.pf-check { display: inline-flex; align-items: center; gap: .4rem; }
.pform-pic { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.pform-picbtn { width: 108px; height: 108px; padding: 0; border: 1px dashed var(--line-strong); background: var(--bg); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.pform-picbtn img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pf-radios { display: flex; gap: 1.2rem; flex-wrap: wrap; margin: .2rem 0 .6rem; } .pf-radios label { display: inline-flex; gap: .35rem; align-items: center; }
.pf-inline { display: grid; grid-template-columns: 1fr 8rem; gap: .5rem; align-items: start; }
.pf-hint { margin: .1rem 0 .4rem; font-size: .8rem; } .pf-h { margin: 1.2rem 0 .4rem; font-size: 1rem; }
.pform textarea { width: 100%; }
.doc-toolbar-center { display: flex; gap: .4rem; flex-wrap: wrap; }

/* The empty ticket sits in the middle of the cart */
.pt-empty, .kx-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; text-align: center; color: var(--muted); min-height: 100%; padding: 2rem 1rem; }
.pt-lines:has(> .pt-empty) { display: flex; } .pt-lines > .pt-empty { flex: 1; }
.kx-lines:has(> .kx-empty) { display: flex; } .kx-lines > .kx-empty { flex: 1; }
.pt-empty svg, .kx-empty svg { width: 4rem; height: 4rem; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: .55; margin-bottom: .4rem; }
.pt-empty circle, .kx-empty circle { fill: currentColor; stroke: none; }
.pt-empty strong, .kx-empty strong { font-size: 1.15rem; font-weight: 600; color: var(--ink); opacity: .75; }
.pt-empty span, .kx-empty span { font-size: .95rem; }
/* A register that is running takes the whole screen; the way out is its Exit button */
body.till-full .topbar, body.till-full .verify-banner { display: none; }
body.till-full #app-view { padding: 0; }
body.till-full #shell { padding: .7rem .8rem; }
body.till-full .pt { height: calc(100vh - 1.4rem); }

/* Scrolling: the top bar stays put, the page body scrolls on its own, and a sidebar scrolls on its own */
html, body { height: 100%; overflow: hidden; }
#app-view { height: 100vh; min-height: 0; overflow: hidden; }
#shell { overflow-y: auto; overflow-x: hidden; }
.page:has(> .set-shell) { padding: 0; overflow: hidden; min-height: 0; }
.page > .set-shell { margin: 0; flex: 1; min-height: 0; height: auto; overflow: hidden; }
.set-body { overflow: hidden; }
.set-side, .set-main { min-height: 0; overflow-y: auto; }
.set-main { overflow-x: hidden; }
.chatter { align-self: start; position: sticky; top: 0; max-height: calc(100vh - var(--header) - 4.5rem); overflow-y: auto; }
#login-view { max-height: 100vh; overflow-y: auto; }
.pos-sess { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.pos-sess-acts { display: flex; flex-basis: 100%; justify-content: flex-start; gap: .4rem; }
.pos-sess-acts .btn { min-height: 2.4rem; padding: .3rem .9rem; }
.pos-shop { margin: 0 0 1.4rem; } .pos-shop-h { margin: 0 0 .6rem; font-size: 1.05rem; } .pos-shop-h em { font-style: normal; color: var(--muted); font-size: .82rem; margin-left: .4rem; }

/* Empty messages are centred, wherever they sit */
.empty-state, .dash-empty, .chatter-empty, .pos-empty { text-align: center; }
.dash-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 6rem; padding: 1rem; }
.dash-empty p { margin: .15rem 0; }
.chatter-empty { padding: 1.5rem 0; }
.dash-charts + .dash-charts, .dash-charts + .dash-lower, .dash-kpis + .dash-charts { margin-top: .85rem; }

/* Physical Inventory: the counted figure sits level with the rest of its line, right-aligned like the other numbers */
.pi-table td { vertical-align: middle; }
.pi-table .pi-counted { width: 7rem; height: 2rem; margin: 0; padding: 0 .5rem; text-align: right; display: inline-block; vertical-align: middle; }
.pi-table .pi-newlot, .pi-table .pi-newwh, .pi-table .uis-pi-newwh { margin: 0; height: 2rem; width: 100%; }
.pi-table .combo { margin: 0; }
.pi-table td.num { text-align: right; }
.pi-table .pi-acts { display: table-cell; white-space: nowrap; }
.pi-table .pi-acts .pi-act { display: inline-flex; align-items: center; gap: .4rem; margin-right: 1.3rem; }
.pi-table .pi-acts .pi-act:last-child { margin-right: 0; }
.pi-act svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pi-act:disabled { opacity: .4; cursor: default; }

/* The way back, on screens whose title bar does not carry it */
.crumb-strip { display: flex; align-items: center; flex-wrap: wrap; gap: .1rem; padding: .1rem 0 .55rem; font-size: .8rem; font-weight: 600; }
.crumb-strip .ctrl-trail { display: inline-flex; align-items: center; gap: .1rem; }
.crumb-strip .ctrl-list { border: 0; background: none; color: var(--gold); font: inherit; cursor: pointer; padding: 0 .15rem; }
.crumb-strip .ctrl-list:hover { color: var(--gold-ink); }
.crumb-strip .crumb-sep { color: var(--gold); opacity: .65; padding: 0 .15rem; }
.crumb-strip .crumb-now { color: var(--muted); }
/* The buttons of every till card sit in its foot, so they line up across the cards */
.pos-cards { align-items: stretch; }
.pos-card { height: 100%; }
.pos-card-f { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: .6rem; min-height: 2.8rem; margin-top: auto; }
.pos-card-f .pos-go { min-height: 2.8rem; padding: .4rem 1.2rem; font-size: 1rem; white-space: nowrap; }
.pos-card-f .pos-last { grid-column: 3; justify-self: end; text-align: right; margin-left: 0; }
.pos-card-f > .pos-go:only-of-type ~ .pos-last { grid-column: 2 / 4; }

/* The buttons come first, the last-closed line under them */
.pos-card-f { display: flex; flex-direction: column; align-items: stretch; gap: .55rem; margin-top: auto; }
.pos-card-btns { display: flex; align-items: center; gap: .6rem; min-height: 2.8rem; }
.pos-card-f .pos-last { grid-column: auto; justify-self: auto; text-align: left; margin: 0; }

/* The user page, laid out like Odoo's */
.uavatar { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--fill); color: var(--muted); font-weight: 700; flex: none; }
.uavatar-big { width: 96px; height: 96px; font-size: 2rem; border-radius: 10px; }
.ucard { display: flex; gap: .8rem; align-items: center; } .ucard p { margin: .1rem 0 0; }
.uf-top { display: flex; gap: 1.2rem; align-items: flex-start; margin-bottom: 1.2rem; }
.uf-id { flex: 1; min-width: 0; }
.uf-line { display: flex; align-items: center; gap: .6rem; margin-top: .55rem; max-width: 26rem; }
.uf-line input { border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: transparent; margin: 0; padding: .15rem 0; }
.uf-line input:hover, .uf-line input:focus { border-bottom-color: var(--line-strong); outline: none; }
.uf-ico { display: inline-flex; color: var(--muted); } .uf-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.uf-h, .uf-sec h4 { margin: 1.4rem 0 .5rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line); font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink); }
.uf-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 3rem; align-items: start; }
.uf-sec { margin-bottom: .6rem; }
.uf-row { display: grid; grid-template-columns: 9rem minmax(0, 1fr); align-items: center; gap: .3rem 1rem; padding: .3rem 0; min-height: 2.2rem; }
.uf-row .level-note { grid-column: 2; font-size: .78rem; margin-top: -.25rem; }
.uf-row .level-note:empty { display: none; }
.uf-lbl { font-weight: 600; }
.uf-radios { display: flex; gap: 1.4rem; } .uf-radios label { display: inline-flex; gap: .4rem; align-items: center; }
.uf-chip { display: inline-flex; width: fit-content; padding: .1rem .6rem; border-radius: 999px; background: var(--fill); font-size: .85rem; }
.uf-row .ui-select { width: 100%; }
.uf-row .ui-select-btn { width: 100%; margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background-color: transparent; background-image: var(--chevron); background-repeat: no-repeat; background-position: right .2rem center; background-size: 16px 16px; padding: .3rem 1.6rem .3rem 0; text-align: left; min-height: 2rem; }
.uf-row .ui-select-btn:hover, .uf-row .ui-select-btn:focus { border-bottom-color: var(--line-strong); }
.uform .dim { opacity: .45; pointer-events: none; }
@media (max-width: 1000px) { .uf-cols { grid-template-columns: 1fr; } }

/* The company page, laid out like Odoo's */
.co-top { display: flex; gap: 1.2rem; align-items: flex-start; margin-bottom: 1.2rem; }
.co-logo { width: 96px; height: 96px; flex: none; padding: 0; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.co-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.co-logo svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.co-name { flex: 1; min-width: 0; } .co-name .field { display: block; margin: 0 0 .1rem; }
.coform .uf-row { align-items: start; }
.coform .uf-row input:not([type="checkbox"]), .coform .combo { margin: 0; }
.coform .uf-row input:not([type="checkbox"]) { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: .3rem 0; width: 100%; }
.coform .uf-row input:hover, .coform .uf-row input:focus { border-bottom-color: var(--line-strong); outline: none; }
.co-addr { display: grid; gap: .3rem; }
.co-cols { display: grid; grid-template-columns: 1.4fr 1fr .7fr; gap: .8rem; }
.co-color { display: inline-flex; align-items: center; gap: .6rem; } .co-color input { width: 7.5rem !important; }
.co-swatch { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); display: inline-block; }
.co-dots { display: flex; flex-wrap: wrap; gap: .55rem; }
.co-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; position: relative; }
.co-dot.none { background: transparent; border-color: var(--line-strong); }
.co-dot.on { outline: 2px solid var(--ink); outline-offset: 2px; }
.co-dot.on::after { content: ""; position: absolute; left: 8px; top: 4px; width: 6px; height: 12px; border: solid var(--print-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.co-dot.none.on::after { border-color: var(--ink); }
.co-dot:disabled { cursor: default; opacity: .6; }
.brand-mark, .login .brand-mark { background: var(--company-color, var(--navy)); border-color: var(--company-color, var(--navy)); color: var(--company-on, var(--on-accent)); }

/* Toasts and the loading note both live in the bottom-right corner, stacked: the loading note at the bottom, toasts above it */
#toasts { left: auto; right: 1.25rem; bottom: 1.25rem; transform: none; align-items: flex-end; }
.toast, .loading-pill { max-width: min(92vw, 440px); }
.loading-pill { pointer-events: none; display: inline-flex; align-items: center; gap: .6rem; padding: .55rem .9rem; background: var(--menu-bg); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop); font-weight: 600; font-size: .9rem; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--gold); display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* the register's Pay button lives in that corner: notes ride above it */
body.till-full #toasts { bottom: 7rem; }
@media (max-width: 600px) { #toasts { left: .75rem; right: .75rem; align-items: stretch; } }

/* an input with a small action button at its right end (payment amount, wallet reference) */
.inp-btn { position: relative; display: block; }
.inp-btn > input { width: 100%; padding-right: 4.6rem; }
.inp-btn > .inp-go { position: absolute; top: 50%; right: .4rem; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-width: 2.4rem; height: calc(100% - .8rem); padding: 0 .7rem; background: var(--fill); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; font: inherit; font-size: .85rem; }
.inp-btn > .inp-go:hover { border-color: var(--gold); color: var(--gold); }
.inp-btn > input:disabled + .inp-go { opacity: .5; pointer-events: none; }

/* the till lock: a screen over everything, and the question that comes before leaving */
.pt-lock { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: var(--bg); overflow: auto; }
.pt-lock.pt-lock-ask { background: var(--overlay, color-mix(in srgb, var(--bg) 78%, transparent)); backdrop-filter: blur(3px); }
.pt-lock-card { width: min(380px, 100%); display: grid; gap: .55rem; justify-items: center; text-align: center; padding: 1.6rem 1.4rem; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.pt-lock-card h2 { margin: 0; font-size: 1.35rem; }
.pt-lock-card p { margin: 0; }
.pt-lock-ico { color: var(--gold); }
.pt-lock-dots { display: flex; gap: .7rem; justify-content: center; min-height: 1.2rem; margin: .4rem 0 .1rem; }
.pt-lock-dots i { width: .85rem; height: .85rem; border-radius: 50%; border: 2px solid var(--line-strong); }
.pt-lock-dots i.on { background: var(--gold); border-color: var(--gold); }
.pt-lock-input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.pt-lock-err { min-height: 1.2rem; color: var(--danger); font-size: .85rem; }
.pt-lock-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; width: 100%; margin-top: .3rem; }
.pt-lock-key { height: 3.2rem; font: inherit; font-size: 1.25rem; background: var(--fill); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; }
.pt-lock-key:hover { border-color: var(--gold); }
.pt-lock-key.go { font-size: .95rem; background: var(--gold); color: var(--on-gold, var(--bg)); border-color: var(--gold); }
.pt-lock-btns { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; margin-top: .5rem; }
.pt-lock-card.shake { animation: pt-shake .35s; }
@keyframes pt-shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }

/* Employees app: the directory cards and the employee record */
.emp-card { display: flex; gap: .9rem; align-items: center; }
.emp-photo { width: 64px; height: 64px; border-radius: 8px; background: var(--fill); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.3rem; flex: none; }
.emp-card-t { min-width: 0; } .emp-card-t p { margin: .1rem 0; }
.emp-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 15rem; }
.emp-side { flex: 1; min-width: 0; }
.emp-contract { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); }
.emp-contract p { margin: .2rem 0 0; }
.uf-note { margin: .1rem 0 .6rem; }
@media (max-width: 900px) { .uf-top { flex-wrap: wrap; } .emp-side { flex-basis: 100%; } }
.ct-form .uf-row { grid-template-columns: 13rem minmax(0, 1fr); }

/* Projects app */
.prj-pill { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .75rem; line-height: 1.5; background: var(--fill); color: var(--muted); white-space: nowrap; }
.prj-pill.ok { background: var(--ok-bg); color: var(--ok); } .prj-pill.warn { background: var(--warn-bg); color: var(--warn); } .prj-pill.bad { background: var(--danger-bg); color: var(--danger); }
.prj-bar { display: inline-block; width: 6rem; height: .5rem; border-radius: 999px; background: var(--fill); vertical-align: middle; overflow: hidden; }
.prj-bar i { display: block; height: 100%; background: var(--ok); }
.prj-h { margin: 1.2rem 0 .5rem; font-size: .95rem; color: var(--muted); font-weight: 600; }
.prj-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .7rem; }
.prj-kpi { text-align: left; cursor: pointer; }
.prj-alerts { margin: .4rem 0 0; padding-left: 1.1rem; }
.prj-filters { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; margin: .4rem 0 1rem; }
.prj-filters select, .prj-filters input[type="search"], .prj-filters input[type="date"] { min-width: 9rem; }
.prj-filters label { display: inline-flex; align-items: center; gap: .3rem; }
.prj-views { margin-left: auto; display: inline-flex; gap: .25rem; } .prj-views .btn.active { border-color: var(--gold); color: var(--gold-ink); }
.prj-filter-note { margin-bottom: .6rem; }
.prj-hint { margin: 0 0 .8rem; }
.prj-dash-main { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr); }
.prj-dash-charts { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.prj-dash-charts:has(> :nth-child(2):last-child) { grid-template-columns: 1fr 1fr; }
.prj-folio { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.prj-folio-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(7rem, .7fr) minmax(5.5rem, .55fr);
  gap: .55rem .75rem;
  align-items: center;
  padding: .55rem .15rem;
  border-bottom: 1px solid var(--line);
}
.prj-folio-row:last-child { border-bottom: 0; }
.prj-folio-name { font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prj-folio-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .35rem; min-width: 0; }
.prj-folio-prog { display: inline-flex; align-items: center; gap: .4rem; }
.prj-folio-prog em { font-style: normal; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.prj-folio-due { font-size: .8rem; text-align: right; white-space: nowrap; }
.prj-comm-strip { margin-top: .15rem; }
.prj-comm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: .55rem;
}
.prj-comm-cell {
  display: flex; flex-direction: column; gap: .15rem; align-items: flex-start;
  border: 0; border-left: 3px solid var(--line); background: transparent;
  padding: .35rem .55rem; cursor: pointer; color: var(--ink); font: inherit; text-align: left;
}
.prj-comm-cell:hover { border-left-color: var(--gold); }
.prj-comm-cell.warn { border-left-color: var(--warn); }
.prj-comm-cell span { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.prj-comm-cell strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; font-weight: 650; }
.prj-qa { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.prj-jump {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: .55rem;
}
.prj-jump-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .12rem;
  margin: 0;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 4.4rem;
}
.prj-jump-btn:hover { border-color: var(--gold); background: var(--fill); }
.prj-jump-btn strong {
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.prj-jump-btn .prj-jump-label { font-size: .84rem; font-weight: 600; }
.prj-jump-btn em { font-style: normal; font-size: .72rem; color: var(--muted); }
.prj-jump-btn.warn { border-color: var(--warn); }
.prj-jump-btn.warn strong { color: var(--danger); }
.prj-commercial-snap {
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .9rem;
  margin-top: 1rem; padding: .65rem .85rem;
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: transparent; font-size: .9rem;
}
.prj-commercial-snap .muted { font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; }
.prj-commercial-snap .prj-snap-links { margin-left: auto; display: inline-flex; gap: .75rem; }
@media (max-width: 1100px) {
  .prj-dash-main { grid-template-columns: 1fr 1fr; }
  .prj-folio-row { grid-template-columns: 1fr 1fr; }
  .prj-folio-prog, .prj-folio-due { grid-column: 1 / -1; }
  .prj-folio-due { text-align: left; }
  .prj-qa { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .prj-dash-main { grid-template-columns: 1fr; }
  .prj-folio-row { grid-template-columns: 1fr; }
  .prj-jump { grid-template-columns: 1fr 1fr; }
}
.prj-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.prj-head-r { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; justify-content: flex-end; }
.prj-progress { display: inline-flex; align-items: center; gap: .4rem; }
.prj-steps li { cursor: pointer; }
.prj-banner { margin: .5rem 0; padding: .55rem .8rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--fill); }
.prj-banner.ok { border-color: var(--ok); background: var(--ok-bg); } .prj-banner.warn { border-color: var(--warn); background: var(--warn-bg); } .prj-banner.bad { border-color: var(--danger); background: var(--danger-bg); }
.prj-panel { padding-top: 1rem; }
.prj-sec { margin: 0 0 1.4rem; }
.prj-sec-h { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .4rem; }
.prj-sec-h > span { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.prj-inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .25rem 0; }
.prj-inline input:not([type="checkbox"]) { flex: 1; min-width: 8rem; }
.prj-figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .6rem; margin: .4rem 0 1rem; }
.prj-figures > div { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .7rem; }
.prj-figures span { display: block; color: var(--muted); font-size: .78rem; } .prj-figures strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.prj-fig-link { cursor: pointer; } .prj-fig-link:hover { border-color: var(--gold); }
.prj-trace { margin: 0; padding-left: 1.1rem; line-height: 1.7; }
.prj-impact { margin: .3rem 0 0; padding-left: 1.1rem; }
.prj-fs { border: 1px solid var(--line); border-radius: var(--radius); margin: 0; padding: .6rem .8rem; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .6rem; }
.prj-card { border: 1px solid var(--line); border-radius: 0; padding: .6rem .7rem; background: var(--bg); margin-bottom: .5rem; cursor: pointer; }
.prj-card.late { border-color: var(--danger); } .prj-card p { margin: .2rem 0; }
.prj-card-top { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.prj-card-foot { display: flex; justify-content: space-between; gap: .5rem; }
.prj-card select { width: 100%; margin-top: .3rem; }
.prj-card.dragging { opacity: .45; }
.prj-card-amt { margin: .25rem 0 0; font-weight: 650; font-variant-numeric: tabular-nums; font-size: .86rem; }
.kanban-card .prj-card { border: 0; background: transparent; margin: 0; padding: 0; }
.prj-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(15rem, 1fr); gap: .8rem; overflow-x: auto; padding-bottom: .5rem; }
.prj-col { background: var(--fill); border-radius: 0; padding: .6rem; min-height: 8rem; } .prj-col h4 { margin: 0 0 .5rem; } .prj-col.over { outline: 2px dashed var(--gold); }
.prj-pboard {
  display: flex;
  gap: .7rem;
  overflow-x: auto;
  overflow-y: hidden;
  height: calc(100dvh - 11.25rem);
  max-height: calc(100dvh - 11.25rem);
  align-items: stretch;
  padding-bottom: .15rem;
}
.prj-pcol {
  --prj-stage: var(--brand);
  flex: 1 1 260px;
  min-width: 240px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: var(--fill);
  border-radius: 0;
  padding: .55rem .55rem .45rem;
  border: 2px solid transparent;
  border-top: 3px solid var(--prj-stage);
  box-sizing: border-box;
}
.prj-pcol.over { border-color: var(--gold); border-top-color: var(--gold); }
.prj-pcol-head {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-weight: 650;
  flex-shrink: 0;
}
.prj-pcol-title {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex: 1;
  min-width: 0;
}
.prj-pcol-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prj-pcol-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 .4rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-style: normal;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  box-sizing: border-box;
}
.prj-pcol-amt { display: none; color: var(--muted); font-weight: 500; font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prj-fold {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.prj-fold-ico { width: 1.05rem; height: 1.05rem; display: block; }
.prj-fold:hover { background: var(--bg); color: var(--ink); }
.prj-pcol-sum {
  margin: .15rem 0 .45rem;
  font-size: .8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.prj-pcol-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: .1rem;
}
.prj-pcol-empty { margin: .4rem 0; font-size: .82rem; }
.prj-pcol.folded {
  flex: 0 0 2.75rem;
  min-width: 2.75rem;
  max-width: 2.75rem;
  padding: .35rem .2rem .45rem;
  align-items: center;
  justify-content: flex-start;
}
.prj-pcol.folded .prj-pcol-head {
  flex: 1;
  min-height: 0;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
}
.prj-pcol.folded .prj-fold {
  writing-mode: horizontal-tb;
  transform: none;
  flex-shrink: 0;
}
.prj-pcol.folded .prj-pcol-title {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.prj-pcol.folded .prj-pcol-name {
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}
.prj-pcol.folded .prj-pcol-amt { display: inline; }
.prj-pcol.folded .prj-pcol-sum { display: none; }
.prj-pcol.folded .prj-pcol-body { display: none; }
.prj-cal-head { display: flex; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.prj-dow, .prj-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.prj-dow span { padding: .3rem .4rem; color: var(--muted); font-size: .78rem; }
.prj-days { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.prj-day { min-height: 6.2rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .25rem; display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.prj-day.other { background: var(--fill); } .prj-day.today { outline: 2px solid var(--gold); outline-offset: -2px; }
.prj-dn { font-size: .75rem; color: var(--muted); }
.prj-chip { text-align: left; border: 0; border-radius: 4px; padding: .1rem .35rem; background: var(--brand-soft); color: var(--ink); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.prj-chip.late { background: var(--danger-bg); color: var(--danger); }
.prj-gantt { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.prj-gantt svg { display: block; font-size: 12px; fill: var(--ink); }
.prj-gantt .g-week { fill: var(--muted); font-size: 11px; } .prj-gantt .g-grid { stroke: var(--line); }
.prj-gantt .g-phase { font-weight: 700; } .prj-gantt .g-phase-bar { fill: var(--navy); }
.prj-gantt .g-task { fill: var(--brand-soft); stroke: var(--brand); } .prj-gantt .g-task.late { fill: var(--danger-bg); stroke: var(--danger); } .prj-gantt .g-done { fill: var(--ok); opacity: .55; }
.prj-gantt .g-ms { fill: var(--gold); } .prj-gantt .g-ms.done { fill: var(--ok); } .prj-gantt .g-ms.late { fill: var(--danger); } .prj-gantt .g-ms-l { fill: var(--muted); }
.prj-gantt .g-dep { fill: none; stroke: var(--muted); stroke-width: 1.2; } .prj-gantt .g-today { stroke: var(--danger); stroke-dasharray: 4 3; }
.prj-form .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.prj-form .pf-grid > .pf-full { grid-column: 1 / -1; }
@media (max-width: 720px) { .prj-form .pf-grid { grid-template-columns: 1fr; } .prj-views { margin-left: 0; } .prj-day { min-height: 4rem; } }
.prj-steps-row { overflow-x: auto; margin: .2rem 0 .6rem; } .prj-steps-row .prj-steps { min-width: max-content; }
.prj-smarts { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.prj-filters[hidden], #pd-more-body[hidden] { display: none; }
.prj-more-toggle { margin: 1rem 0 .4rem; }
.prj-more-charts { margin-top: .8rem; }
.dash-head-actions .btn.active { border-color: var(--gold); color: var(--gold-ink); }
.prj-push { margin-left: auto; }

/* Enterprise CRM */
.crm-timeline { list-style: none; margin: 0; padding: 0; }
.crm-timeline li { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .6rem; align-items: start; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.crm-timeline li p { margin: .1rem 0; }
.crm-tl-icon { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--fill); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; color: var(--muted); }
.prj-lines input:not([type="checkbox"]):not([type="radio"]),
.prj-lines select { width: 100%; min-width: 5rem; }
.prj-lines label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
  margin: .15rem .65rem .15rem 0;
  vertical-align: middle;
}
.prj-lines input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
.pf-wide { grid-column: 1 / -1; }
.hbar-row[data-bar]:hover { background: var(--fill); }
.prj-figures em { display: block; font-style: normal; font-size: .72rem; }
.card.crm-search {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: .2rem .7rem;
  min-height: 0;
  margin-bottom: .85rem;
}
.card.crm-search > input[type="search"] {
  width: 100%;
  height: 32px;
  min-height: 32px;
  margin: 0 !important;
  padding: 0 .15rem !important;
  line-height: 32px;
  box-sizing: border-box;
  vertical-align: middle;
}
.card.crm-search > #cs-out:empty { display: none; margin: 0; }
.card.crm-search > #cs-out:not(:empty) { margin-top: .45rem; padding-bottom: .25rem; }
#cs-out { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin-top: .4rem; }
.crm-hit-group { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; min-width: 12rem; }
.crm-quick { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 1rem; }
.crm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .7rem; }
.crm-visit { cursor: default; }
.crm-funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; }
.crm-funnel-step {
  display: flex; flex-direction: column; align-items: flex-start; gap: .15rem;
  margin: 0; padding: .55rem .65rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink);
  font: inherit; text-align: left; cursor: pointer; min-width: 0;
}
.crm-funnel-step:hover { border-color: var(--gold); }
.crm-funnel-step span { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.crm-funnel-step strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.dash-panel .gauge-row { justify-content: space-around; margin-top: .9rem; }
.crm-quiet { margin: .35rem 0; font-size: .9rem; }
.crm-donut, .donut-card { align-items: flex-start; gap: 1.2rem; flex-wrap: wrap; }
.crm-stage-legend, .donut-legend { display: flex; flex-direction: column; gap: .35rem; min-width: 11rem; flex: 1; }
.crm-leg, .donut-leg {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .4rem .55rem;
  margin: 0;
  padding: .35rem .45rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.crm-leg:hover, button.donut-leg:hover { background: var(--fill); }
.crm-leg .swatch, .donut-leg .swatch { width: .7rem; height: .7rem; }
.crm-leg b, .donut-leg b { font-variant-numeric: tabular-nums; font-weight: 650; }
.crm-leg em, .donut-leg em { font-style: normal; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.crm-folio-amt { font-variant-numeric: tabular-nums; font-size: .9rem; }
.crm-act-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .1rem; }
.crm-act-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: .55rem;
  align-items: center;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
}
.crm-act-row:last-child { border-bottom: 0; }
.crm-act-row.late { background: linear-gradient(90deg, color-mix(in srgb, var(--danger) 12%, transparent), transparent 55%); margin: 0 -.4rem; padding-left: .4rem; padding-right: .4rem; }
.crm-act-ico {
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--fill); color: var(--muted); font-size: .85rem;
}
.crm-act-main { min-width: 0; }
.crm-act-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-act-main p { margin: .1rem 0 0; }
.crm-act-due { font-size: .8rem; white-space: nowrap; }
.stat-value .stat-frac { font-size: .72em; opacity: .72; font-weight: 600; }
.dash-page > .prj-jump { margin: .85rem 0; }
.prj-lines em { display: block; font-style: normal; font-size: .72rem; }
@media (max-width: 1100px) {
}
@media (max-width: 720px) {
  .crm-quick .btn { flex: 1 1 45%; }
      .crm-act-row { grid-template-columns: 2rem minmax(0, 1fr); }
  .crm-act-due { grid-column: 2; }
}

/* org chart and the setup lists around employees */
.org-chart { margin-top: .6rem; }
.org-node { border-left: 2px solid var(--line); margin: .5rem 0 .5rem .4rem; padding-left: .9rem; }
.org-node > summary { cursor: pointer; padding: .3rem 0; list-style: none; }
.org-node > summary::-webkit-details-marker { display: none; }
.org-node > summary::before { content: '▾'; display: inline-block; width: 1rem; color: var(--muted); }
.org-node:not([open]) > summary::before { content: '▸'; }
.org-people { display: flex; flex-wrap: wrap; gap: .5rem; margin: .3rem 0 .6rem; }
.org-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .6rem .3rem .3rem; border: 1px solid var(--line); border-radius: 999px; background: var(--fill); color: var(--ink); cursor: pointer; font: inherit; text-align: left; }
.org-chip:hover { border-color: var(--gold); }
.org-chip .emp-photo { width: 30px; height: 30px; border-radius: 50%; font-size: .75rem; }
.org-chip strong { display: block; font-size: .85rem; line-height: 1.1; }
.org-chip em { display: block; font-style: normal; font-size: .72rem; color: var(--muted); }
.org-tree, .org-tree ul { list-style: none; margin: 0; padding-left: 1.4rem; border-left: 2px solid var(--line); }
.org-tree { border-left: 0; padding-left: 0; }
.org-tree li { margin: .4rem 0; }
.seg { display: inline-flex; gap: .3rem; }

/* leave engine: policy/holiday tables, calendar holiday marker, and the highlighted row a leave-type dialog links to */
.pf-mini-table { width: 100%; border-collapse: collapse; margin: .5rem 0; font-size: .85rem; }
.pf-mini-table.wide { font-size: .82rem; }
.pf-mini-table th, .pf-mini-table td { border-bottom: 1px solid var(--line); padding: .35rem .5rem; text-align: left; }
.pf-mini-table th { color: var(--muted); font-weight: 600; }
.pf-mini-table tr.hl { background: var(--brand-soft); }
.hr-cal-holiday { font-size: .68rem; color: var(--danger); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prj-day.hr-holiday { background: var(--danger-bg); }

/* work schedules: the weekly grid on the schedule card and its editor */
.ws-card { margin-bottom: .8rem; }
.ws-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: .5rem; margin-top: .5rem; }
.ws-day { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; text-align: center; display: flex; flex-direction: column; gap: .15rem; }
.ws-day.off { opacity: .55; }
.ws-day strong { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.ws-day span { font-size: .85rem; }
.ws-edit-grid-head { display: grid; grid-template-columns: 1.4fr 1fr 1fr .8fr; gap: .5rem; font-size: .75rem; color: var(--muted); margin: .6rem 0 .2rem; padding-left: .1rem; }
.ws-edit-day { display: grid; grid-template-columns: 1.4fr 1fr 1fr .8fr; gap: .5rem; align-items: center; margin-bottom: .3rem; }

/* Discuss */
.disc-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 0;
  min-height: calc(100vh - 7.5rem);
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}
.disc-list {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--bg);
  min-height: 0;
}
.disc-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--line);
}
.disc-list-head h3 { margin: 0; font-size: 1rem; }
.disc-list-body { overflow: auto; flex: 1; }
.disc-list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: .1rem .5rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: .7rem 1rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.disc-list-item.static { cursor: default; }
.disc-list-item strong { grid-column: 1; font-size: .92rem; }
.disc-list-item span, .disc-list-item time { grid-column: 1; font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.disc-list-item .disc-badge { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.disc-list-item:hover, .disc-list-item.on { background: var(--fill); }
.disc-list-item.unread strong { font-weight: 700; }
.disc-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-accent);
  font-size: .72rem;
  font-style: normal;
  font-weight: 650;
}
.disc-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.disc-chat { display: flex; flex-direction: column; height: 100%; min-height: calc(100vh - 7.5rem); }
.disc-chat-head { padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); }
.disc-chat-head h3 { margin: 0; font-size: 1.05rem; }
.disc-chat-head p { margin: .2rem 0 0; }
.disc-feed { flex: 1; overflow: auto; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .85rem; }
.disc-feed-empty { margin: auto; }
.disc-msg { max-width: 42rem; }
.disc-msg-who { display: flex; align-items: baseline; gap: .55rem; flex-wrap: wrap; font-size: .82rem; }
.disc-msg-who time { color: var(--muted); font-size: .76rem; }
.disc-msg p { margin: .2rem 0 0; white-space: pre-wrap; line-height: 1.45; }
.disc-compose { padding: .75rem 1.1rem 1rem; border-top: 1px solid var(--line); background: var(--bg); }
.disc-compose textarea { width: 100%; resize: vertical; min-height: 2.6rem; margin: 0 0 .5rem; }
.disc-compose-actions { display: flex; justify-content: flex-end; gap: .4rem; }
.disc-empty { padding: 2.5rem 1.5rem; text-align: center; max-width: 28rem; margin: 2rem auto; }
.disc-empty h3 { margin: 0 0 .4rem; }
.disc-dash {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}
.page > .disc-dash {
  flex: 1;
  min-height: calc(100vh - 14rem);
}
.disc-dash .card {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.disc-dash .disc-recent,
.disc-dash .disc-unread,
.disc-dash .disc-empty {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.disc-dash .disc-empty { margin: auto; }
.disc-sec-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; }
.disc-sec-head h3 { margin: 0; font-size: 1rem; }
.disc-recent { display: flex; flex-direction: column; }
.disc-flat { padding: 0; overflow: hidden; }
.disc-flat .disc-list-item:last-child { border-bottom: 0; }
.disc-thread { display: flex; flex-direction: column; gap: .75rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .35rem; }
@media (max-width: 900px) {
  .disc-shell { grid-template-columns: 1fr; min-height: auto; }
  .disc-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .disc-dash { grid-template-columns: 1fr; }
}

/* Projects dashboard (PM layout) */
.prj-dash .prj-dash-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.prj-dash-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
  margin: .85rem 0;
}
.prj-dash-card { margin: 0; }
.prj-subhead {
  margin: 0 0 .65rem;
  font-size: .78rem;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.prj-work-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.prj-work-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .45rem 0;
  border-bottom: 1px solid var(--line);
}
.prj-work-list li:last-child { border-bottom: 0; }
.prj-view-all { margin-top: .75rem; font-size: .85rem; }
.prj-status-donut { align-items: center; min-height: 10rem; }
.prj-status-legend { gap: .55rem; }
.prj-status-legend span,
.prj-status-leg { display: flex; align-items: center; gap: .15rem; }
.prj-status-leg {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.prj-status-leg:hover b { color: var(--gold-ink, var(--brand)); }
.prj-fin-cell {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.prj-fin-cell:hover strong { color: var(--gold-ink, var(--brand)); }
.prj-active-table { display: flex; flex-direction: column; gap: 0; }
.prj-active-head, .prj-active-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(5rem, .75fr) minmax(7rem, .9fr) minmax(4.5rem, .7fr) minmax(4.5rem, .6fr);
  gap: .75rem;
  align-items: center;
  padding: .55rem 0;
}
.prj-active-head {
  font-size: .72rem;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--line);
  padding-bottom: .45rem;
}
.prj-active-row { border-bottom: 1px solid var(--line); }
.prj-active-row:last-child { border-bottom: 0; }
.prj-active-prog { display: inline-flex; align-items: center; gap: .45rem; }
.prj-active-prog em { font-style: normal; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.prj-stat-list { list-style: none; margin: 0; padding: 0; }
.prj-stat-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.prj-stat-list li:last-child { border-bottom: 0; }
.prj-stat-list b { font-variant-numeric: tabular-nums; font-weight: 650; }
.prj-fin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
  margin-bottom: .9rem;
}
.prj-fin-grid span {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .25rem;
}
.prj-fin-grid strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; font-weight: 650; }
.prj-fin-bar-row { display: flex; align-items: center; gap: .75rem; }
.prj-fin-bar {
  flex: 1;
  height: .7rem;
  background: var(--fill);
  border: 1px solid var(--line);
  overflow: hidden;
}
.prj-fin-bar i { display: block; height: 100%; background: var(--ink); }
.prj-fin-bar-row em { font-style: normal; font-size: .8rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .prj-dash .prj-dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prj-dash-row { grid-template-columns: 1fr; }
  .prj-fin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prj-active-head, .prj-active-row { grid-template-columns: minmax(0, 1fr) 4.5rem; }
  .prj-active-head span:nth-child(2),
  .prj-active-head span:nth-child(3),
  .prj-active-head span:nth-child(4),
  .prj-active-row > :nth-child(2),
  .prj-active-row > :nth-child(3),
  .prj-active-row > :nth-child(4) { display: none; }
}


/* ---- sign in / create account / reset password ---- */
.login.wide { width: min(520px, 100%); }
.login .login-link {
  background: none; border: 0; padding: 0; font: inherit; font-size: .86rem; cursor: pointer;
  color: var(--gold-ink); text-decoration: none;
}
.login .login-link:hover { color: var(--gold); text-decoration: underline; }
.login .login-link:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.field-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: .55rem; }
.field-row .field { margin: .15rem 0 .2rem; }
.login-alt {
  margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line);
  display: flex; gap: .4rem; justify-content: center; font-size: .88rem;
}
.login-alt .login-link { font-weight: 600; }
.login .login-form .field-row + .pw-wrap { margin-top: 0; }
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { width: 100%; padding-right: 3.6rem; }
.pw-toggle {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; font: inherit; font-size: .75rem; font-weight: 600;
  color: var(--muted); padding: .25rem .45rem; border-radius: 3px;
}
.pw-toggle:hover { color: var(--ink); background: var(--fill); }
.pw-meter { display: flex; gap: 4px; margin: .35rem 0 0; }
.pw-meter i { flex: 1; height: 3px; border-radius: 2px; background: var(--line); }
.pw-meter[data-level="1"] i.on { background: #d9534f; }
.pw-meter[data-level="2"] i.on { background: #e0a030; }
.pw-meter[data-level="3"] i.on, .pw-meter[data-level="4"] i.on { background: #4caf7a; }

.wiz-steps { list-style: none; display: flex; gap: .35rem; margin: 0 0 1.2rem; padding: 0; }
.wiz-steps li {
  flex: 1; display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--muted);
  padding-bottom: .55rem; border-bottom: 2px solid var(--line);
}
.wiz-steps li span {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: .7rem; font-weight: 700; background: var(--fill); color: var(--muted); flex: none;
}
.wiz-steps li.on { color: var(--ink); border-color: var(--gold); font-weight: 600; }
.wiz-steps li.on span { background: var(--gold); color: var(--icon-fg, #fff); }
.wiz-steps li.done { color: var(--ink); border-color: var(--gold-ink); }
.wiz-steps li.done span { background: var(--gold-soft); color: var(--gold-ink); }
.wiz-steps li.done span::before { content: '\2713'; }
.wiz-steps li.done span { font-size: 0; }
.wiz-steps li.done span::before { font-size: .72rem; }

.mod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .4rem; }
@media (max-width: 480px) { .mod-grid { grid-template-columns: 1fr; } }
.mod-card {
  position: relative; display: flex; gap: .6rem; align-items: flex-start; padding: .65rem .7rem;
  border: 1px solid var(--line); border-radius: 4px; cursor: pointer; background: var(--page);
}
.mod-card:hover { border-color: var(--muted); }
.mod-card input { position: absolute; opacity: 0; pointer-events: none; }
.mod-card:focus-within { outline: 2px solid color-mix(in srgb, var(--gold) 45%, transparent); outline-offset: 1px; }
.mod-card.on { border-color: var(--gold); background: var(--gold-soft); }
.mod-ico { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; flex: none; background: var(--fill); color: var(--gold-ink); }
.mod-ico .menu-ico { width: 16px; height: 16px; }
.mod-card.on .mod-ico { background: var(--gold); color: var(--icon-fg, #fff); }
.mod-text { display: flex; flex-direction: column; min-width: 0; padding-right: 1rem; }
.mod-text strong { font-size: .86rem; color: var(--ink); }
.mod-text small { font-size: .74rem; color: var(--muted); line-height: 1.3; margin-top: .1rem; }
.mod-tick {
  position: absolute; top: .5rem; right: .5rem; width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg);
}
.mod-card.on .mod-tick { background: var(--gold); border-color: var(--gold); box-shadow: inset 0 0 0 3px var(--gold-soft); }

.wiz-actions { display: flex; gap: .6rem; margin-top: 1rem; }
.wiz-actions .btn { min-height: 2.35rem; }
.wiz-actions .btn.primary { flex: 1; font-weight: 600; }
.wiz-links { display: flex; justify-content: space-between; margin-top: .9rem; }
.code-input { text-align: center; font-size: 1.5rem; letter-spacing: .5em; padding-left: .5em; font-variant-numeric: tabular-nums; }
.wiz-done { text-align: center; padding: .4rem 0 .2rem; }
.wiz-check {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto .9rem; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold-ink);
}
.wiz-check svg { width: 26px; height: 26px; }
.wiz-done .login-lead { margin-bottom: .2rem; }

/* ---- sign-up requests dialog ---- */
.sr-toggle { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem; border: 1px solid var(--line); border-radius: 4px; background: var(--page); cursor: pointer; }
.sr-toggle input { margin-top: .2rem; }
.sr-toggle span { display: flex; flex-direction: column; gap: .15rem; }
.sr-h { margin: 1.2rem 0 .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sr-row { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; padding: .8rem 0; border-top: 1px solid var(--line); }
.sr-row.sr-done { align-items: center; opacity: .85; }
.sr-who { min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.sr-apps { display: flex; flex-wrap: wrap; gap: .3rem; margin: .2rem 0; }
.sr-note { margin: 0; font-style: italic; color: var(--muted); }
.sr-when { font-size: .78rem; }
.sr-actions, .sr-buttons { display: flex; gap: .5rem; flex: none; flex-wrap: wrap; }
.sr-pick { display: flex; flex-direction: column; gap: .5rem; min-width: 15rem; flex: 1; max-width: 22rem; }
.sr-level { display: flex; flex-direction: column; gap: .15rem; font-size: .8rem; color: var(--muted); }
.sr-level select, .sr-level input { width: 100%; }
@media (max-width: 640px) { .sr-row { flex-direction: column; } .sr-pick { max-width: none; width: 100%; } }

#signup-review { white-space: nowrap; }
.sr { padding: .35rem 1rem 1rem; }

/* ---- Apps app and first-run onboarding ---- */
.apps-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin: 1rem 0; }
.apps-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.apps-chips .chip { font: inherit; font-size: .85rem; padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); cursor: pointer; }
.apps-chips .chip.on { background: var(--gold); border-color: var(--gold); color: var(--icon-fg, #fff); }
.apps-bar input[type="search"] { width: min(280px, 100%); }
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; }
.app-card { border: 1px solid var(--line); border-radius: 6px; background: var(--bg); padding: 1rem; display: flex; flex-direction: column; gap: .55rem; }
.app-card.is-on { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.app-card-top { display: flex; align-items: center; gap: .7rem; }
.app-card-ico { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-ink); flex: none; }
.app-card-ico .menu-ico { width: 22px; height: 22px; }
.app-card-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.app-card-title .muted { font-size: .78rem; }
.app-card-blurb { margin: 0; font-size: .88rem; color: var(--ink); line-height: 1.4; }
.app-card-needs { margin: 0; font-size: .78rem; }
.app-card-actions { display: flex; gap: .5rem; margin-top: auto; padding-top: .35rem; }

.onb { position: fixed; inset: 0; z-index: 200; background: var(--page); overflow-y: auto; }
.onb-inner { width: min(860px, 100% - 2rem); margin: 0 auto; padding: 1.5rem 0 3rem; }
.onb-head { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 2.2rem; }
.onb-head .wiz-steps { flex: 1; max-width: 360px; margin: 0; }
.onb-head .login-link { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--muted); font: inherit; font-size: .85rem; }
.onb-head .login-link:hover { color: var(--ink); text-decoration: underline; }
.onb h1 { margin: 0 0 .5rem; font-size: 1.9rem; letter-spacing: -.02em; }
.onb-lead { margin: 0 0 1.6rem; color: var(--muted); max-width: 40rem; line-height: 1.5; }
.onb-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .8rem; }
.onb-preset {
  text-align: left; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 1rem 1.1rem; cursor: pointer; display: flex; flex-direction: column; gap: .35rem;
}
.onb-preset:hover { border-color: var(--gold); background: var(--gold-soft); }
.onb-preset strong { font-size: 1rem; }
.onb-preset span { color: var(--muted); font-size: .86rem; line-height: 1.4; }
.onb-preset small { color: var(--gold-ink); font-size: .76rem; margin-top: .2rem; }
.onb-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .7rem; }
.onb-needs { color: var(--gold-ink) !important; margin-top: .15rem; }
.onb-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; padding: 1rem 0; background: var(--page); border-top: 1px solid var(--line); }
.onb-foot .btn.primary { min-width: 9rem; }

/* ---- the AfrERP logo (sprite in /app/brand): ledger lines take the text colour, the sun stays amber ---- */
.logo { display: block; flex: none; color: inherit; }
.logo-mark { width: 30px; height: 28px; }
.logo-inline { height: 30px; width: auto; aspect-ratio: 4.167; }
.logo-stacked { width: 180px; height: auto; aspect-ratio: 1.418; }
.login .logo { color: var(--ink); }
.login-brand.is-stack { flex-direction: column; align-items: flex-start; gap: .6rem; }
.login-brand.is-stack .logo-inline { height: 34px; }
.login-brand .logo-mark { width: 44px; height: 41px; }
.topbar .brand .logo-mark { width: 26px; height: 24px; }
.onb-head .logo-inline { height: 30px; }

/* ---- amber: where you are, what is selected, and the brand (blue stays for actions and links) ---- */
.menu.open > .menu-btn,
.menu-btn.on { box-shadow: inset 0 -2px 0 var(--amber); }
.nb-tab.on { border-bottom-color: var(--amber); }
.set-side-item.on,
[data-theme="dark"] .set-side-item.on { border-left-color: var(--amber); }
.spinner { border-top-color: var(--amber); }
.prj-day.today { outline-color: var(--amber); }
.desk-app:hover .desk-icon,
.desk-app:focus-visible .desk-icon { box-shadow: inset 0 1px 0 var(--icon-gloss), 0 0 0 2px var(--amber), var(--icon-shadow); }
.logo { --logo-sun: var(--amber); }

.wiz-steps li.on { border-color: var(--amber); }
.wiz-steps li.on span { background: var(--amber); color: var(--on-amber); }
.wiz-steps li.done { border-color: var(--amber-ink); }
.wiz-steps li.done span { background: var(--amber-soft); color: var(--amber-ink); }
.mod-card.on { border-color: var(--amber); background: var(--amber-soft); }
.mod-card.on .mod-ico { background: var(--amber); color: var(--on-amber); }
.mod-card.on .mod-tick { background: var(--amber); border-color: var(--amber); box-shadow: inset 0 0 0 3px var(--amber-soft); }
.mod-card:focus-within { outline-color: color-mix(in srgb, var(--amber) 55%, transparent); }
.apps-chips .chip.on { background: var(--amber); border-color: var(--amber); color: var(--on-amber); }
.app-card.is-on { border-color: color-mix(in srgb, var(--amber) 60%, var(--line)); }
.app-card.is-on .app-card-ico { background: var(--amber-soft); color: var(--amber-ink); }
.onb-preset:hover { border-color: var(--amber); background: var(--amber-soft); }
.onb-preset small,
.onb-needs { color: var(--amber-ink) !important; }

/* ---- document layout dialog: every control is a visible, matching field ---- */
.lay-sec { margin: 0 0 1.25rem; }
.lay-sec > h4 { margin: 0 0 .55rem; font-size: .72rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.lay-form .pf-grid { gap: 0 1rem; }
.lay-form .pf-grid > div { min-width: 0; margin-bottom: .75rem; }
.lay-form label.field { margin: 0 0 .3rem; }
.lay-form input[type="text"], .lay-form textarea, .lay-form .ui-select-btn {
  width: 100%; margin: 0; padding: .5rem .65rem; font-size: .9rem; line-height: 1.35;
  border: 1px solid var(--line-strong); border-radius: 4px; background-color: var(--bg); color: var(--ink);
}
.lay-form .ui-select { display: block; width: 100%; }
.lay-form .ui-select-btn { padding-right: 2rem; background-position: right .6rem center; }
.lay-form input[type="text"]:hover, .lay-form textarea:hover, .lay-form .ui-select-btn:hover { border-color: var(--muted); background-color: var(--bg); }
.lay-form input[type="text"]:focus, .lay-form textarea:focus, .lay-form .ui-select-btn:focus-visible, .lay-form .ui-select.open .ui-select-btn {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); background-color: var(--bg);
}
.lay-form textarea { resize: vertical; min-height: 4rem; margin-bottom: .75rem; }
.lay-form input[type="text"]::placeholder, .lay-form textarea::placeholder { color: var(--muted); opacity: .6; }
.lay-form > .lay-sec > input[type="text"] { margin-bottom: .75rem; }

.lay-presets { display: flex; flex-wrap: wrap; gap: .4rem; }
.lay-preset { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); border-radius: 999px; padding: .28rem .7rem .28rem .5rem; cursor: pointer; font: inherit; font-size: .8rem; }
.lay-preset:hover { border-color: var(--muted); }
.lay-preset i { display: inline-block; width: .85rem; height: .85rem; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .35); }
.lay-preset i + i { margin-left: -.5rem; }

.lay-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .55rem; }
.lay-opt { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .4rem .3rem .45rem; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg); color: var(--ink); cursor: pointer; font: inherit; font-size: .78rem; }
.lay-opt svg { width: 100%; max-width: 64px; height: auto; display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25)); }
.lay-opt:hover { border-color: var(--muted); }
.lay-opt.on { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); background: var(--amber-soft); font-weight: 650; }

.lay-logo { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.lay-logo-box { width: 4.6rem; height: 2.6rem; border: 1px dashed var(--line-strong); border-radius: 4px; display: grid; place-items: center; background: #fff; overflow: hidden; flex: none; }
.lay-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lay-logo-box em { font-style: normal; font-size: .7rem; color: #6b7280; }
.lay-upload { cursor: pointer; }
.lay-hint { margin: .35rem 0 .85rem; font-size: .76rem; color: var(--muted); }

.lay-color { display: flex; align-items: center; gap: .5rem; }
.lay-color input[type="color"] {
  -webkit-appearance: none; appearance: none; width: 2.4rem; height: 2.4rem; padding: 3px; margin: 0; flex: none;
  border: 1px solid var(--line-strong); border-radius: 4px; background: var(--bg); cursor: pointer;
}
.lay-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.lay-color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 2px; }
.lay-color input[type="color"]::-moz-color-swatch { border: 0; border-radius: 2px; }
.lay-hash { position: relative; flex: 1; min-width: 0; }
.lay-hash b { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 500; }
.lay-form .lay-hash input[type="text"] { padding-left: 1.5rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: lowercase; }
.lay-swatches { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.lay-sw { width: 1.15rem; height: 1.15rem; border-radius: 50%; border: 0; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .4); }
.lay-sw:hover { transform: scale(1.12); }
.lay-sw.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--amber); }

.lay-check { display: flex; gap: .65rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--bg); cursor: pointer; }
.lay-check:hover { border-color: var(--muted); }
.lay-check input { margin-top: .15rem; }
.lay-check span { display: flex; flex-direction: column; gap: .1rem; }
.lay-check strong { font-weight: 600; font-size: .9rem; }
.lay-check small { color: var(--muted); font-size: .78rem; }

/* the layout dialog keeps its own two scrolling panes, and Save stays in view */
.form-dialog.wide:has(.lay-dialog) { height: min(90vh, 860px); }
.form-dialog.wide:has(.lay-dialog) #form-dialog-body { display: flex; flex-direction: column; overflow: hidden; min-height: 0; flex: 1 1 auto; }
.form-dialog.wide:has(.lay-dialog) .lay-dialog + .form-dialog-foot { flex: none; padding: .8rem 1.2rem; border-top: 1px solid var(--line); background: var(--bg); }

/* ---- sample data block in General Settings ---- */
.demo-apps { display: flex; flex-wrap: wrap; gap: .35rem; margin: .7rem 0; }
.demo-app { font-size: .78rem; padding: .18rem .6rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.demo-app.on { border-color: var(--amber); background: var(--amber-soft); color: var(--ink); }
.demo-app.off { opacity: .45; text-decoration: line-through; }
.demo-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: .3rem 0 .6rem; }
.demo-note { font-size: .78rem; margin: 0; }
.onb-demo { margin-top: 1.1rem; max-width: 34rem; }

/* ---- sign-in: staff or employee portal ---- */
.login-mode { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; margin: 0 0 1rem; }
.login-mode button { border: 0; background: var(--bg); color: var(--muted); font: inherit; font-size: .84rem; padding: .5rem .4rem; cursor: pointer; }
.login-mode button + button { border-left: 1px solid var(--line-strong); }
.login-mode button:hover { color: var(--ink); }
.login-mode button.on { background: var(--amber-soft); color: var(--ink); font-weight: 650; box-shadow: inset 0 -2px 0 var(--amber); }

.verify-banner { display: flex; gap: .8rem; align-items: center; justify-content: center; flex-wrap: wrap; padding: .5rem 1rem; font-size: .86rem; background: var(--amber-soft); border-bottom: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line)); color: var(--ink); }

.ak-make { display: flex; gap: .5rem; margin: 1rem 0; }
.ak-make input { flex: 1; }
.ak-new { margin: .8rem 0; }
.ak-key { display: flex; gap: .6rem; align-items: center; margin-top: .4rem; }
.ak-key code { flex: 1; word-break: break-all; font-size: .82rem; padding: .35rem .5rem; background: var(--fill); border-radius: 4px; }

.verify-draft { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .55rem .9rem; margin: 0 0 .8rem; font-size: .86rem; background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line)); border-radius: 4px; }
.verify-draft span { flex: 1; min-width: 12rem; }

/* form-style pages sit in a centred column instead of stretching edge to edge */
.page-narrow { width: 100%; max-width: 1040px; margin-left: auto; margin-right: auto; box-sizing: border-box; }

/* a donut beside its legend; the legend takes whatever width is left */
.donut-card { display: flex; align-items: center; }
.donut-card .donut-stack { flex: 0 0 auto; width: 140px; height: 140px; }
.donut-card .donut-leg span { overflow-wrap: anywhere; }
.donut-card .donut-center strong { font-size: .72rem; max-width: 5.6rem; line-height: 1.2; }
.donut-card .donut-legend { max-width: 24rem; }
span.donut-leg { cursor: default; }
span.donut-leg:hover { background: none; }

/* ring gauges: a rate as a circle, the words kept to a label */
.gauge-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.gauge {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  width: 7.2rem; margin: 0; padding: .4rem .3rem .5rem;
  border: 0; border-radius: 10px; background: none; color: var(--ink);
  font: inherit; cursor: pointer;
}
.gauge:hover { background: var(--fill); }
.gauge svg { width: 76px; height: 76px; display: block; }
.gauge strong { position: absolute; top: calc(.4rem + 38px); left: 50%; transform: translate(-50%, -50%); font-size: .88rem; font-variant-numeric: tabular-nums; }
.gauge span { font-size: .74rem; color: var(--muted); text-align: center; line-height: 1.2; }

/* ---- till: promotions from the pricing engine */
.pt-promo { display: block; font-size: .72rem; color: var(--amber-ink); }
.pt-tile .pt-promo { margin-top: .1rem; }

/* ---- traceability: a lot up to where it came from and down to where it went */
.trace-search { display: flex; gap: .5rem; margin: 1rem 0; }
.trace-search input { flex: 1; }
.trace-tree { list-style: none; margin: .25rem 0 .25rem .6rem; padding-left: .9rem; border-left: 2px solid var(--line); }
.trace-tree > li { margin: .45rem 0; }
.trace-node { display: flex; flex-direction: column; gap: .1rem; }
.trace-via { font-size: .72rem; color: var(--muted); }
.trace-sold { font-size: .78rem; color: var(--ok); }
.trace-card { margin: 1rem 0; padding: 1rem; }
.trace-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.trace-cols h5 { margin: 0 0 .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
@media (max-width: 760px) { .trace-cols { grid-template-columns: 1fr; } }

/* ---- filter bars: every control on one centre line, each field a visible length, the dropdown arrow at its right end ---- */
:is(.prj-filters, .report-bar, .kx-filters) { align-items: center; }
:is(.prj-filters, .report-bar, .kx-filters) label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
:is(.prj-filters, .report-bar, .kx-filters) :is(.ui-select, .dt-wrap) { margin: 0; vertical-align: middle; }
:is(.prj-filters, .report-bar, .kx-filters) :is(.ui-select-btn, .dt-wrap .dt-show, input[type="search"], input[type="text"]) {
  box-sizing: border-box;
  min-height: 2.1rem;
  margin: 0;
  padding: .32rem .6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--bg);
  line-height: 1.35;
}
:is(.prj-filters, .report-bar, .kx-filters) .ui-select { width: 11rem; min-width: 0; flex: 0 0 auto; }
:is(.prj-filters, .report-bar, .kx-filters) .ui-select-btn { display: flex; width: 100%; min-width: 0; padding-right: 2rem; background-position: right .55rem center; }
:is(.prj-filters, .report-bar, .kx-filters) input[type="text"]:not(.dt-show), :is(.prj-filters, .report-bar, .kx-filters) input:not([type]) { width: 11rem; }
:is(.prj-filters, .report-bar, .kx-filters) .dt-wrap { display: inline-block; width: 9.5rem; }
:is(.prj-filters, .report-bar, .kx-filters) :is(.ui-select-btn, .dt-wrap .dt-show, input):hover { border-color: var(--line-strong); }
:is(.prj-filters, .report-bar, .kx-filters) > .btn { margin: 0; }

/* Farming */
.farm-hint { font-size: .8rem; margin: .2rem 0 0; }
.farm-title-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; align-items: center; }
.farm-title-row .title-input { font-size: 1.4rem; font-weight: 600; width: 100%; }
.farm-rows input, .farm-rows select { width: 100%; }

/* ---- stage bars: the current stage in our blue, stages passed a lighter blue, every chevron outlined ---- */
.status-bar {
  filter:
    drop-shadow(0 1px 0 var(--stage-line))
    drop-shadow(0 -1px 0 var(--stage-line))
    drop-shadow(1px 0 0 var(--stage-line))
    drop-shadow(-1px 0 0 var(--stage-line));
  --stage-line: color-mix(in srgb, var(--navy) 45%, var(--line-strong));
}
.status-bar li { background: var(--fill); color: var(--muted); }
.status-bar li.done { opacity: 1; background: color-mix(in srgb, var(--navy) 18%, var(--bg)); color: color-mix(in srgb, var(--navy) 70%, var(--ink)); }
.status-bar li.on { background: var(--navy); color: var(--icon-fg); }
.status-bar li[data-stage]:not(.on):hover, .status-bar li[data-step]:not(.on):hover { background: color-mix(in srgb, var(--navy) 28%, var(--bg)); color: var(--ink); }

/* ---- record tabs: one line, each tab its own width, the row scrolls sideways when it runs out of room ---- */
.nb-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.nb-tab { flex: 0 0 auto; white-space: nowrap; font: inherit; font-size: .9rem; line-height: 1.3; }
.nb-tab.on { font-weight: 650; }

/* ---- the dashboard filter panels: an even grid, the words on the left, every field the same length ---- */
.card.prj-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .6rem 1.2rem; align-items: center; padding: .8rem 1rem; }
.card.prj-filters[hidden] { display: none; }
.card.prj-filters > label { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); align-items: center; gap: .5rem; margin: 0; color: var(--muted); font-size: .86rem; }
.card.prj-filters > label :is(.ui-select, .dt-wrap, input) { width: 100%; min-width: 0; }
.card.prj-filters > .prj-filter-acts { display: flex; gap: .5rem; align-items: center; }
.card.prj-filters > .prj-filter-acts .btn { margin: 0; }
:is(.prj-filters, .report-bar, .kx-filters) input:not([type]) {
  box-sizing: border-box; min-height: 2.1rem; margin: 0; padding: .32rem .6rem;
  border: 1px solid var(--line); border-radius: 6px; background-color: var(--bg); color: var(--ink); line-height: 1.35;
}

/* ---- payroll on the HR dashboard: warnings, pay runs, employer cost, headcount ---- */
.hr-pay-dash { margin-top: 1.2rem; }
.hr-pd-title { margin: 0 0 .6rem; }
.hr-pd-grid { align-items: stretch; }
.hr-pd-panel { display: flex; flex-direction: column; min-height: 17rem; }
.hr-pd-warn, .hr-pd-runs { list-style: none; margin: 0; padding: 0; }
.hr-pd-warn li + li, .hr-pd-runs li + li { border-top: 1px solid var(--line); }
.hr-pd-w { display: grid; grid-template-columns: 3rem 1fr; align-items: center; gap: .6rem; width: 100%; padding: .6rem .2rem; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.hr-pd-w strong { text-align: right; font-variant-numeric: tabular-nums; }
.hr-pd-w:hover { background: var(--fill); }
.hr-pd-w.bad span { color: var(--danger); }
.hr-pd-w.warn span { color: var(--amber-ink, var(--warn)); }
.hr-pd-w.info span { color: var(--ok); }
.hr-pd-run { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; padding: .65rem .2rem; border: 0; background: none; color: var(--ink); font: inherit; text-align: right; cursor: pointer; }
.hr-pd-run:hover { background: var(--fill); }
.hr-pd-run-t { display: flex; flex-direction: column; gap: .15rem; }
.hr-pd-run-t .muted { font-size: .82rem; }
.hr-pd-toggle { display: inline-flex; align-items: center; gap: .45rem; font-size: .84rem; color: var(--muted); }
.hr-pd-toggle span.on { color: var(--ink); }
.hr-pd-switch { position: relative; width: 2.4rem; height: 1.3rem; padding: 0; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--fill); cursor: pointer; }
.hr-pd-switch i { position: absolute; top: 50%; left: .2rem; width: .8rem; height: .8rem; border-radius: 50%; background: var(--muted); transform: translateY(-50%); transition: left .15s; }
.hr-pd-switch.on { border-color: var(--navy); }
.hr-pd-switch.on i { left: calc(100% - 1rem); background: var(--navy); }
.hr-pd-big { margin: .2rem 0 .4rem; font-size: 1.05rem; font-weight: 650; }
.hr-pd-big .muted { font-size: .82rem; font-weight: 400; }
.hr-pd-chart { margin-top: auto; }
.hr-pd-ccy { margin: 0 0 .4rem; }
.hr-pd-panel > .hr-pd-ccy { align-self: flex-start; display: inline-flex; width: auto; }

/* ---- dashboards: every panel in a row is as tall as the tallest one, in every app ---- */
.dash-lower, .dash-split { align-items: stretch; }
.dash-col > * { flex: 1 1 auto; }
.dash-col > .dash-charts { display: grid; align-content: stretch; grid-auto-rows: 1fr; }
.dash-charts, .dash-grid { align-items: stretch; }
.dash-charts > .card, .dash-charts > .dash-panel, .dash-lower > .card, .dash-split > .card { height: 100%; box-sizing: border-box; }
.dash-col > .card, .dash-charts > .card, .dash-lower > .card, .dash-split > .card, .dash-grid > .card { margin-top: 0; margin-bottom: 0; }

/* ---- an empty list says what to do next instead of opening on a blank box ---- */
.ui-empty-choice { display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; padding: .75rem .85rem; max-width: 26rem; white-space: normal; }
.ui-empty-choice p { margin: 0; font-size: .86rem; line-height: 1.45; color: var(--muted); }
.ui-empty-choice p strong { color: var(--ink); }
.ui-empty-choice .btn { margin: 0; }
.ui-select.ui-select-none .ui-select-btn { color: var(--muted); font-style: italic; }

/* ---- "+ New …" in dropdowns, and the popup that makes the record without leaving the form ---- */
.ui-empty-acts { display: flex; flex-wrap: wrap; gap: .5rem; }
.ui-select-foot { border-top: 1px solid var(--line); margin-top: .2rem; padding: .2rem 0 0; }
.ui-select-foot .ui-empty-new, .combo-menu .ui-select-foot .ui-empty-new { display: block; width: 100%; padding: .5rem .75rem; border: 0; background: none; color: var(--navy); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.ui-select-foot .ui-empty-new:hover { background: var(--fill); }
.qc-back { z-index: 85; }
body.qc-open #form-dialog { z-index: 90; }
.qc-dialog { width: min(1100px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 48px); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.qc-head { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.qc-head h3 { margin: 0; font-size: 1.05rem; }
.qc-head .qc-where { font-size: .82rem; }
.qc-head .dialog-x { margin-left: auto; }
.qc-body { overflow: auto; padding: .6rem 1rem 1rem; }
.qc-body .doc-split { grid-template-columns: 1fr; }
.qc-body .doc-side, .qc-body .chatter, .qc-body .doc-chatter { display: none; }
.qc-body > .browse.form-browse { display: none; }   /* the popup has its own title; the record pager and New belong to the full page */
.qc-back.qc-under { visibility: hidden; }   /* the module's own create popup is showing: only that one is seen */

/* ---- fiscalisation (Chess FDMS): devices, receipts and the fiscal strip on documents ---- */
.fiscal-pill { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--fill); color: var(--ink); }
.fiscal-pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.fiscal-pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.fiscal-pill.bad { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.fiscal-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: .85rem; margin-bottom: .85rem; }
.fiscal-cards .card { margin: 0; }
.fiscal-kv { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.fiscal-kv span { color: var(--muted); } .fiscal-kv strong { font-weight: 600; text-align: right; }
.fiscal-sig { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .4rem 0 .6rem; font-size: .88rem; }
.fiscal-sig > span:first-child { color: var(--muted); }
.fiscal-tills { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
.fiscal-who-card { border: 1px solid var(--line); border-radius: 8px; padding: .7rem .9rem; margin: .7rem 0; background: var(--fill); }
.fiscal-who-card h3 { margin: .2rem 0; }
.fiscal-strip { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .45rem .75rem; margin: 0 0 .7rem; border: 1px solid var(--line); border-radius: 8px; font-size: .88rem; }
.fiscal-strip.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.fiscal-strip.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.fiscal-strip.bad { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.fiscal-strip-k { font-weight: 700; letter-spacing: .04em; font-size: .78rem; color: var(--muted); }
.fiscal-strip-code { font-family: ui-monospace, Menlo, monospace; font-weight: 600; letter-spacing: .05em; }
.fiscal-verify-ui { display: flex; gap: 1rem; align-items: center; margin-bottom: .8rem; }
.fiscal-qr-ui svg { width: 120px; height: 120px; display: block; background: var(--print-bg, var(--bg)); padding: 6px; border-radius: 6px; }
.fiscal-code-ui { font-size: 1.15rem; font-weight: 700; letter-spacing: .08em; margin: .1rem 0; }
.fiscal-url { word-break: break-all; font-size: .78rem; }
.hr-note.warn { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.hr-note.bad { border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }
.receipt .fiscal { border-top: 1px dashed var(--line-strong); margin-top: .5rem; padding-top: .5rem; }
.receipt .fiscal .qr svg { width: 130px; height: 130px; display: block; margin: .3rem auto; background: var(--print-bg); padding: 4px; }

/* ---- Hotel: front desk, room board, calendar (rooms across nights), new booking, rates calendar */
.ht-prop { display: inline-flex; align-items: center; gap: .4rem; font-size: .86rem; color: var(--muted); margin-right: .4rem; }
.ht-prop select { min-width: 10rem; }
.ht-start { max-width: 40rem; }
.ht-desk { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; margin-bottom: 1rem; align-items: stretch; }
.ht-desk > .card { margin: 0; }
.ht-list { list-style: none; margin: 0; padding: 0; }
.ht-li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.ht-li:last-child { border-bottom: 0; }
.ht-li > div { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.ht-li .muted { font-size: .82rem; }
.ht-owing { color: var(--danger); font-weight: 600; font-size: .86rem; }
.ht-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .6rem; }
.ht-tile { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
  text-align: left; font: inherit; color: var(--ink); cursor: default; min-height: 6.2rem; }
button.ht-tile[data-nav] { cursor: pointer; }
.ht-tile.occupied { background: var(--brand-soft); border-color: var(--brand); }
.ht-tile.arriving { background: var(--ok-bg); border-color: var(--ok); }
.ht-tile.departing { background: var(--warn-bg); border-color: var(--warn); }
.ht-tile.ooo { background: var(--danger-bg); border-color: var(--danger); }
.ht-tile-no { font-weight: 700; font-size: 1.05rem; }
.ht-tile-type { font-size: .78rem; color: var(--muted); }
.ht-tile-who { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ht-hk { margin-top: auto; font-size: .72rem; padding: .05rem .45rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.ht-hk.dirty { color: var(--danger); border-color: var(--danger); }
.ht-hk.cleaning { color: var(--warn); border-color: var(--warn); }
.ht-hk.clean, .ht-hk.inspected { color: var(--ok); border-color: var(--ok); }
.ht-hk-board .ht-tile { min-height: 7.6rem; }
.ht-hk-btns { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: auto; }
.ht-hk-btns .chip-btn { font-size: .72rem; padding: .1rem .45rem; }

.ht-cal-nav { display: inline-flex; gap: .3rem; align-items: center; margin-right: .4rem; }
.ht-cal { --ht-label: 9rem; --ht-cell: 2.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); overflow-x: auto; }
.ht-cal-row { display: grid; grid-auto-rows: 2.1rem; min-width: calc(var(--ht-label) + 7 * var(--ht-cell)); border-bottom: 1px solid var(--line); }
.ht-cal-row:last-child { border-bottom: 0; }
.ht-cal-label { grid-column: 1; display: flex; align-items: center; gap: .35rem; padding: 0 .6rem; font-size: .86rem; position: sticky; left: 0; background: var(--bg); z-index: 2; border-right: 1px solid var(--line); }
.ht-cal-head { position: sticky; top: 0; z-index: 3; background: var(--bg); grid-auto-rows: 2.6rem; }
.ht-cal-day { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .72rem; color: var(--muted); border-left: 1px solid var(--line); line-height: 1.1; }
.ht-cal-day strong { color: var(--ink); font-size: .86rem; }
.ht-cal-day.wknd { background: var(--fill); }
.ht-cal-day.today { box-shadow: inset 0 -3px 0 var(--amber); }
.ht-cal-cell.today { background: color-mix(in srgb, var(--amber) 10%, transparent); }
.ht-cal-type { background: var(--fill); }
.ht-cal-type .ht-cal-label { background: var(--fill); }
.ht-cal-free { display: flex; align-items: center; justify-content: center; font-size: .78rem; color: var(--ok); border-left: 1px solid var(--line); font-weight: 600; }
.ht-cal-free.full { color: var(--danger); }
.ht-cal-cell { border-left: 1px solid var(--line); cursor: pointer; }
.ht-cal-cell:hover { background: var(--brand-soft); }
.ht-bar { margin: .25rem 1px; border-radius: 4px; padding: 0 .45rem; font: inherit; font-size: .78rem; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 1px solid var(--brand); background: var(--brand-soft); color: var(--ink); cursor: pointer; z-index: 1; display: flex; align-items: center; gap: .3rem; }
.ht-bar.tentative { border-style: dashed; border-color: var(--warn); background: var(--warn-bg); }
.ht-bar.checked_in { border-color: var(--ok); background: var(--ok-bg); }
.ht-bar.checked_out { border-color: var(--line-strong); background: var(--fill); color: var(--muted); }
.ht-bar.block { border-color: var(--line-strong); background: repeating-linear-gradient(135deg, var(--fill) 0 6px, var(--bg) 6px 12px); color: var(--muted); cursor: default; }
.ht-bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-style: dotted; }
.ht-bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right-style: dotted; }
.ht-due { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--danger); flex: none; }
.ht-hk-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--ok); flex: none; }
.ht-hk-dot.dirty { background: var(--danger); }
.ht-hk-dot.cleaning { background: var(--warn); }
.ht-legend { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .6rem; }
.ht-legend .ht-bar { cursor: default; display: inline-flex; margin: 0; height: 1.4rem; }

.ht-new .ht-search { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem; align-items: end; }
.ht-search-go { display: flex; align-items: end; }
.ht-offer { border: 1px solid var(--line); border-radius: var(--radius); margin: .8rem 0; overflow: hidden; }
.ht-offer-head { display: flex; flex-wrap: wrap; gap: .6rem; align-items: baseline; padding: .55rem .8rem; background: var(--fill); border-bottom: 1px solid var(--line); }
.ht-rate { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .55rem .8rem; border-bottom: 1px solid var(--line); }
.ht-rate:last-child { border-bottom: 0; }
.ht-rate-total { display: flex; align-items: center; gap: .6rem; font-weight: 700; white-space: nowrap; }
.ht-nights { font-size: .78rem; margin-top: .15rem; }
.ht-total { text-align: right; font-weight: 700; font-size: 1.05rem; }
.ht-guest { margin: .2rem 0 .8rem; font-size: 1.4rem; }
.ht-money h3 { margin-top: 0; }
.ht-checks { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }

.ht-ari-wrap { overflow-x: auto; padding: 0; }
.ht-ari { min-width: 60rem; }
.ht-ari td:first-child, .ht-ari th:first-child { position: sticky; left: 0; background: var(--bg); z-index: 1; white-space: nowrap; }
.ht-ari-av td { background: var(--fill); font-weight: 600; color: var(--ok); }
.ht-ari-av td.full { color: var(--danger); }
.ht-ari-av td:first-child { background: var(--fill); color: var(--ink); }
.ht-ari-cell { cursor: pointer; }
.ht-ari-cell:hover { background: var(--brand-soft); }
.ht-ari-cell.over { font-weight: 700; }
.ht-ari-cell.stop { color: var(--danger); background: var(--danger-bg); }
.ht-ari-cell sup, .ht-ari-cell sub { font-size: .65rem; color: var(--muted); margin-left: 1px; }
@media (max-width: 700px) { .ht-rate { flex-direction: column; align-items: flex-start; } .ht-cal { --ht-label: 6rem; } }
.ht-code { background: var(--fill); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem; font-size: .82rem; white-space: pre-wrap; word-break: break-all; }

/* ---- Restaurant: the day's service */
.rs-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; margin-bottom: 1rem; align-items: stretch; }
.rs-board > .card { margin: 0; }
.rs-meal-head { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.rs-meal-head h3 { margin: 0; }
.rs-note { font-size: .82rem; color: var(--warn); }
.rs-acts { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.pay-room { margin: .4rem 0 .8rem; padding: .6rem .7rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.pay-room select { min-width: 14rem; }
.rs-who { display: block; }
/* ---- Hotel reports */
.dash-charts.ht-charts { margin-bottom: 1rem; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); }
.ht-share { display: inline-block; width: 4.5rem; height: .45rem; border-radius: 999px; background: var(--line); vertical-align: middle; overflow: hidden; margin-right: .3rem; }
.ht-share i { display: block; height: 100%; background: var(--accent); }
.ht-days > summary { cursor: pointer; list-style: none; }
.ht-days > summary h3 { display: inline; }
.ht-days > summary::before { content: '▸ '; color: var(--muted); }
.ht-days[open] > summary::before { content: '▾ '; }

/* ---- An empty card: its message centred in the card, whatever the card's height */
.card:has(> .card-empty) { display: flex; flex-direction: column; }
.card-empty { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .3rem; padding: 1.6rem 1rem; min-height: 9rem; color: var(--muted); }
.card-empty-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--muted); margin-bottom: .35rem; }
.card-empty-ico .menu-ico { width: 22px; height: 22px; }
.card-empty strong { color: var(--ink); font-size: .95rem; }
.card-empty p { margin: 0; font-size: .84rem; max-width: 26rem; }
.card-empty-cta { margin-top: .6rem; }

/* ---- Hotel front desk */
.fd-today { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.fd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: .75rem 0 1rem; }
.fd-stat { display: flex; flex-direction: column; gap: .2rem; text-align: left; padding: .85rem 1rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font: inherit; min-width: 0; }
button.fd-stat { cursor: pointer; }
button.fd-stat:hover { border-color: var(--line-strong); background: var(--fill); }
.fd-stat-l { font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.fd-stat strong { font-size: 1.65rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fd-stat strong small { font-size: 1rem; font-weight: 600; color: var(--muted); margin-left: .1rem; }
.fd-stat-s { font-size: .8rem; color: var(--muted); }
.fd-stat .warn-t { color: var(--warn); font-weight: 600; }
.fd-stat .bad-t { color: var(--danger); font-weight: 600; }



.fd-bar { display: block; height: 5px; border-radius: 999px; background: var(--fill); overflow: hidden; margin-top: .35rem; }
.fd-bar i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }

.fd-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; margin-bottom: 1rem; align-items: stretch; }
.fd-cols > .card, .fd-rooms { margin: 0; }
.fd-col { display: flex; flex-direction: column; min-height: 15rem; }
.fd-col-h { display: flex; align-items: center; gap: .5rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); margin-bottom: .2rem; }
.fd-col-h h3 { margin: 0; font-size: .95rem; }
.fd-col-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: var(--fill); color: var(--muted); }
.fd-col-ico .menu-ico { width: 16px; height: 16px; }
.fd-count { margin-left: auto; min-width: 1.6rem; padding: .05rem .5rem; border-radius: 999px; background: var(--fill); color: var(--muted); font-size: .78rem; font-weight: 700; text-align: center; }
.fd-list { list-style: none; margin: 0; padding: 0; }
.fd-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.fd-row:last-child { border-bottom: 0; }
.fd-room { min-width: 2.9rem; height: 2.4rem; padding: 0 .45rem; display: grid; place-items: center; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; }
.fd-room.none { background: var(--fill); color: var(--muted); }
.fd-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.fd-name { all: unset; cursor: pointer; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-name:hover { color: var(--link, var(--brand)); text-decoration: underline; }
.fd-name:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
.fd-meta { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-flags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .15rem; }
.fd-chip { font-size: .72rem; font-weight: 600; padding: .08rem .45rem; border-radius: 999px; background: var(--fill); color: var(--muted); }
.fd-chip.owe { background: var(--danger-bg); color: var(--danger); }
.fd-chip.warn { background: var(--warn-bg); color: var(--warn); }
.fd-chip.bad { background: var(--danger-bg); color: var(--danger); }
.fd-act { display: flex; gap: .35rem; align-items: center; }
.fd-act .btn.small { min-width: 5.6rem; justify-content: center; }
.fd-until { font-size: .8rem; color: var(--muted); white-space: nowrap; }

.fd-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin: .7rem 0 .9rem; }
.fd-fchip { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .65rem; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); font: inherit; font-size: .8rem; cursor: pointer; }
.fd-fchip b { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.fd-fchip:hover { background: var(--fill); }
.fd-fchip.on { border-color: var(--amber); background: var(--amber-soft); }
.fd-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--line-strong); display: inline-block; }
.fd-type + .fd-type { margin-top: 1.1rem; }
.fd-type-h { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .55rem; font-size: .88rem; }
.fd-type-h .muted { font-size: .8rem; }
.fd-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .6rem; }
.fd-tile { position: relative; display: flex; flex-direction: column; gap: .3rem; text-align: left; padding: .65rem .75rem .65rem .95rem; min-height: 6.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); font: inherit; cursor: default; overflow: hidden; }
.fd-tile::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--line-strong); }
.fd-tile[data-nav] { cursor: pointer; }
.fd-tile[data-nav]:hover { border-color: var(--line-strong); background: var(--fill); }
.fd-tile-top { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.fd-tile-no { font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.fd-tile-who { font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: .35rem; align-items: baseline; min-width: 0; }
.fd-tile-who .muted { font-weight: 500; }
.fd-tile-who em { font-style: normal; font-size: .68rem; font-weight: 700; padding: 0 .3rem; border-radius: 4px; background: var(--fill); color: var(--muted); flex: none; }
.fd-tile-foot { margin-top: auto; font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-hk { display: inline-flex; align-items: center; gap: .3rem; font-size: .7rem; color: var(--muted); }
.fd-hk i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--ok); }
.fd-hk.dirty i { background: var(--danger); }
.fd-hk.dirty { color: var(--danger); }
.fd-hk.cleaning i { background: var(--warn); }
.fd-hk.inspected i { background: var(--info); }
/* each state its colour: the bar on the tile, the dot on the filter */
.fd-tile.occupied::before, .fd-dot.occupied { background: var(--brand); }
.fd-tile.arriving::before, .fd-dot.arriving { background: var(--ok); }
.fd-tile.departing::before, .fd-dot.departing { background: var(--warn); }
.fd-tile.overdue::before, .fd-dot.overdue { background: var(--danger); }
.fd-tile.free::before, .fd-dot.free { background: var(--line-strong); }
.fd-tile.ooo::before, .fd-dot.ooo { background: repeating-linear-gradient(45deg, var(--muted) 0 3px, transparent 3px 6px); }
.fd-tile.occupied { background: color-mix(in srgb, var(--brand) 7%, var(--bg)); }
.fd-tile.overdue { background: color-mix(in srgb, var(--danger) 7%, var(--bg)); }
.fd-tile.ooo { opacity: .75; }
.fd-tile.overdue .fd-tile-foot { color: var(--danger); font-weight: 600; }
.fd-tile.arriving .fd-tile-foot { color: var(--ok); font-weight: 600; }
.fd-tile.departing .fd-tile-foot { color: var(--warn); font-weight: 600; }
@media (max-width: 640px) {
  .fd-row { grid-template-columns: auto minmax(0, 1fr); }
  .fd-act { grid-column: 2; }
  .fd-today { display: none; }
}

/* ---- Restaurant: today's service (shares the front desk's rows, stats and empty cards) */
.rs-context { margin: .5rem 0 0; color: var(--muted); font-size: .85rem; }
.rs-board { grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }
.rs-meal { min-height: 13rem; }
.rs-sum { font-size: .8rem; color: var(--muted); }
.rs-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.rs-line:last-child { border-bottom: 0; }
.rs-line.served .fd-room { background: var(--ok-bg); color: var(--ok); }
.rs-line.no_show .fd-room { background: var(--fill); color: var(--muted); text-decoration: line-through; }
.rs-guest { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-note { font-size: .78rem; color: var(--warn); font-weight: 600; }
.rs-acts { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: .35rem; flex-wrap: nowrap; }
.rs-acts .btn.small { min-width: 5.4rem; height: 30px; justify-content: center; white-space: nowrap; }
.rs-undo { font-size: .8rem; }
.rs-daynav { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); height: 32px; overflow: hidden; }
.rs-daynav input[type=date] { border: 0; background: none; color: var(--ink); font: inherit; font-size: .85rem; padding: 0 .4rem; height: 100%; }
.rs-step { all: unset; cursor: pointer; width: 30px; height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 1.1rem; }
.rs-step:hover { background: var(--fill); color: var(--ink); }
.rs-step:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
#rs-tables { margin-top: 1rem; min-height: 11rem; }
@media (max-width: 640px) {
  .rs-line { grid-template-columns: auto minmax(0, 1fr); }
  .rs-acts { grid-column: 2; justify-content: flex-start; }
}

/* a split page head keeps its tools on small screens: they wrap to a line of their own */
@media (max-width: 640px) {
  .page > .ctrl.ctrl-split { flex-wrap: wrap; row-gap: .35rem; padding-bottom: .45rem; }
  .ctrl-split .ctrl-right { display: flex; flex: 1 1 100%; justify-content: flex-start; flex-wrap: wrap; gap: .4rem; }
}
.pay-meals { display: flex; flex-direction: column; gap: .3rem; margin: .55rem 0 .2rem; }
.pay-meals:empty { display: none; }
.pay-meal { display: flex; align-items: center; gap: .45rem; font-size: .88rem; }
/* hotel guests' meals on the kitchen screen */
.kd-hotel { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); background: var(--bg); padding: .75rem 1rem; margin-bottom: 1rem; }
.kd-hotel-h { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; margin-bottom: .6rem; }
.kd-hotel-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .5rem; }
.kd-guest { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); }
.kd-guest .muted { font-size: .84rem; }
/* the last day close, under the front desk's head */
.fd-closed { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; margin: .55rem 0 0; font-size: .82rem; color: var(--muted); }
.fd-closed strong { color: var(--ink); }
.fd-closed-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--ok); }
.fd-closed .bad-t { color: var(--danger); }
.dc section + section { margin-top: 1rem; }
.dc h4 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .4rem; font-size: .9rem; }
.dc h4 .fd-count { margin-left: 0; }
.dc-list { margin: 0 0 .5rem; padding-left: 1.1rem; font-size: .88rem; }
.dc-list li { margin: .2rem 0; }
.kd-hotel-list { grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); }
.kd-guest-main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.kd-guest-main .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-hint { margin: .1rem 0 .3rem 1.6rem; font-size: .8rem; }

/* every summary card carries its colour along the top; the progress bar follows it */
/* summary cards: no coloured edge; the tone colours only the progress bar */
.fd-stat { --fd-accent: var(--brand); }
.fd-stat.tone-brand { --fd-accent: var(--brand); }
.fd-stat.tone-ok { --fd-accent: var(--ok); }
.fd-stat.tone-warn { --fd-accent: var(--warn); }
.fd-stat.tone-bad { --fd-accent: var(--danger); }
.fd-stat.tone-info { --fd-accent: var(--info); }
.fd-stat.tone-violet { --fd-accent: var(--chart-7); }
.fd-bar i { background: var(--fd-accent, var(--brand)); }
.fd-stats .fd-stat:not([class*="tone-"]) { --fd-accent: var(--brand); }

/* rooms: picture cards across the whole width, or a list */
.fd-rooms-bar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin: .7rem 0 .9rem; }
.fd-rooms-bar .fd-filter { margin: 0; }
.fd-views { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.fd-view { all: unset; cursor: pointer; width: 32px; height: 28px; display: grid; place-items: center; color: var(--muted); }
.fd-view + .fd-view { border-left: 1px solid var(--line); }
.fd-view .menu-ico { width: 15px; height: 15px; }
.fd-view:hover { background: var(--fill); color: var(--ink); }
.fd-view.on { background: var(--amber-soft); color: var(--ink); }
.fd-view:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.fd-board { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .75rem; }
.fd-tile { flex-direction: row; align-items: stretch; justify-content: space-between; gap: .8rem; min-height: 6.6rem; padding: .7rem .75rem .7rem 1rem; }
.fd-tile-txt { display: flex; flex-direction: column; gap: .22rem; min-width: 0; flex: 1 1 auto; }
.fd-tile-type { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-tile-pic { width: 76px; height: 76px; flex: 0 0 76px; align-self: center; border-radius: 6px; object-fit: cover; background: var(--fill); }
.fd-pic-init { display: grid; place-items: center; font-weight: 700; color: var(--muted); font-size: 1rem; letter-spacing: .02em; }
.fd-tile-top { gap: .5rem; }
.fd-rtable { width: 100%; }
.fd-rtable tbody tr[data-nav] { cursor: pointer; }
.fd-rtable td { vertical-align: middle; }
.fd-rcell { display: inline-flex; align-items: center; gap: .6rem; }
.fd-row-pic { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 5px; object-fit: cover; background: var(--fill); font-size: .7rem; }
.fd-state { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .84rem; }
.fd-state.overdue, .fd-rrow.overdue .fd-when { color: var(--danger); }
.fd-state.arriving { color: var(--ok); }
.fd-state.departing { color: var(--warn); }
.fd-rrow.overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.fd-rrow.occupied td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.fd-rrow.arriving td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.fd-rrow.departing td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.fd-rooms-list { overflow-x: auto; }
@media (max-width: 640px) { .fd-board { grid-template-columns: 1fr; } }
.ht-photo { margin-top: .6rem; }
.ht-photo-row { display: flex; gap: .8rem; align-items: center; }
.ht-photo-prev { width: 76px; height: 76px; flex: 0 0 76px; border-radius: 6px; background: var(--fill); display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.ht-photo-prev img { width: 100%; height: 100%; object-fit: cover; }
.ht-photo-prev .menu-ico { width: 26px; height: 26px; }
.ht-photo-acts { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; font-size: .82rem; }
.ht-pcard-img { object-fit: cover; }

/* ---- Housekeeping (supervisor) */
.hk-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600; padding: .08rem .5rem; border-radius: 999px; background: var(--fill); color: var(--muted); white-space: nowrap; }
.hk-chip i, .hk-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted); display: inline-block; }
.hk-chip.dirty { background: var(--danger-bg); color: var(--danger); } .hk-chip.dirty i, .hk-dot.dirty { background: var(--danger); }
.hk-chip.cleaning { background: var(--warn-bg); color: var(--warn); } .hk-chip.cleaning i, .hk-dot.cleaning { background: var(--warn); }
.hk-chip.clean { background: var(--ok-bg); color: var(--ok); } .hk-chip.clean i, .hk-dot.clean { background: var(--ok); }
.hk-chip.inspected { background: var(--brand-soft); color: var(--brand); } .hk-chip.inspected i, .hk-dot.inspected { background: var(--brand); }
.hk-card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); overflow: hidden; }
.hk-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--line-strong); }
.hk-card.dirty::before { background: var(--danger); } .hk-card.cleaning::before { background: var(--warn); } .hk-card.clean::before { background: var(--ok); } .hk-card.inspected::before { background: var(--brand); }
.hk-card.priority { box-shadow: 0 0 0 1px var(--warn) inset; }
.hk-open { all: unset; cursor: pointer; display: flex; justify-content: space-between; gap: .8rem; padding: .75rem .75rem .6rem 1rem; }
.hk-open:hover { background: var(--fill); }
.hk-open:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.hk-occ { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hk-occ b { color: var(--warn); }
.hk-who { display: flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 600; min-width: 0; }
.hk-avatar { width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: .62rem; font-weight: 700; display: grid; place-items: center; flex: none; }
.hk-acts { display: flex; justify-content: flex-end; gap: .35rem; padding: 0 .75rem .65rem 1rem; }
.hk-tools { display: flex; align-items: center; gap: .5rem; }
.hk-tools select { height: 30px; }
.hk-row[data-hkopen] { cursor: pointer; }
.hk-seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; flex-wrap: wrap; }
.hk-segb { all: unset; cursor: pointer; padding: .35rem .7rem; font-size: .84rem; }
.hk-segb + .hk-segb { border-left: 1px solid var(--line); }
.hk-segb.on { background: var(--amber-soft); font-weight: 600; }
.hk-h-title { margin: 1rem 0 .4rem; font-size: .9rem; }
.hk-hist { list-style: none; margin: 0; padding: 0; max-height: 22rem; overflow: auto; }
.hk-h { display: grid; grid-template-columns: auto 1fr; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.hk-h-dot { width: .6rem; height: .6rem; border-radius: 50%; margin-top: .35rem; background: var(--muted); }
.hk-h-dot.dirty { background: var(--danger); } .hk-h-dot.cleaning { background: var(--warn); } .hk-h-dot.clean { background: var(--ok); } .hk-h-dot.inspected { background: var(--brand); }
.hk-h-body { display: flex; flex-direction: column; gap: .15rem; font-size: .86rem; }
.hk-h-photo { margin-top: .35rem; width: 160px; height: 120px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.hg-tools { display: flex; gap: .8rem; margin: .6rem 0 .4rem; }
.hg-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .4rem; max-height: 22rem; overflow: auto; }
.hg-room { display: flex; align-items: center; gap: .45rem; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: var(--radius); font-size: .86rem; cursor: pointer; }
.hg-room.priority { border-color: var(--warn); }
.hg-room .muted { margin-left: auto; font-size: .75rem; }

/* ---- My rooms (employee portal): big targets for a phone */
.mr-list { list-style: none; margin: 0; padding: 0; }
.mr-room { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.mr-room:last-child { border-bottom: 0; }
.mr-room.priority .mr-no { box-shadow: 0 0 0 2px var(--warn); }
.mr-no { min-width: 3.2rem; height: 3.2rem; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 1.15rem; background: var(--fill); }
.mr-room.dirty .mr-no { background: var(--danger-bg); color: var(--danger); }
.mr-room.cleaning .mr-no { background: var(--warn-bg); color: var(--warn); }
.mr-room.clean .mr-no, .mr-room.inspected .mr-no { background: var(--ok-bg); color: var(--ok); }
.mr-main { display: flex; flex-direction: column; gap: .25rem; align-items: flex-start; min-width: 0; }
.mr-note { font-size: .8rem; color: var(--warn); }
.mr-acts { display: flex; gap: .4rem; align-items: center; }
.mr-acts .btn { min-height: 40px; }
.mr-done { cursor: pointer; display: inline-flex; align-items: center; }
.mr-preview { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 8px; background: var(--fill); margin-bottom: .6rem; }
@media (max-width: 640px) { .mr-room { grid-template-columns: auto minmax(0, 1fr); } .mr-acts { grid-column: 1 / -1; } .mr-acts .btn { flex: 1; justify-content: center; } }

/* ---- Hotel reports: one aligned period control, export menu, tabs */
.ht-period { display: inline-flex; align-items: stretch; height: 32px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.ht-period select, .ht-period input[type=date] { border: 0; background: none; color: var(--ink); font: inherit; font-size: .85rem; height: 100%; padding: 0 .5rem; margin: 0; box-sizing: border-box; }
.ht-period select { border-right: 1px solid var(--line); padding-right: 1.6rem; min-width: 8.5rem; }
.ht-period-sep { display: grid; place-items: center; color: var(--muted); padding: 0 .1rem; }
.ht-export { position: relative; }
.ht-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 13rem; display: flex; flex-direction: column; padding: .3rem; background: var(--vs-widget-background, var(--bg)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.ht-menu[hidden] { display: none; }
.ht-menu button { all: unset; cursor: pointer; padding: .45rem .6rem; border-radius: 4px; font-size: .86rem; color: var(--ink); }
.ht-menu button:hover, .ht-menu button:focus-visible { background: var(--fill); }
.ht-tabs { display: flex; gap: .2rem; flex-wrap: wrap; margin: .8rem 0 1rem; border-bottom: 1px solid var(--line); }
.ht-tab { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .8rem; font-size: .86rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ht-tab .menu-ico { width: 15px; height: 15px; }
.ht-tab:hover { color: var(--ink); }
.ht-tab.on { color: var(--ink); border-bottom-color: var(--amber); }
.ht-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ht-rep-body > .card, .ht-rep-two > .card { margin: 0 0 1rem; }
.ht-rep-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1rem; }
.ht-rep-two > .card { margin: 0; }
.ht-rep-two { margin-bottom: 1rem; }
.ht-mini { list-style: none; margin: 0; padding: 0; }
.ht-mini li { display: grid; grid-template-columns: minmax(0, 1fr) 6rem auto; gap: .7rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.ht-mini li:last-child { border-bottom: 0; }
.ht-mini li .ht-share { width: 100%; }
.ht-mini b { font-variant-numeric: tabular-nums; text-align: right; min-width: 4.5rem; }
.ht-rep-note { margin: 0 0 .6rem; font-size: .82rem; }
@media (max-width: 640px) { .ht-period { flex-wrap: wrap; height: auto; } .ht-tabs { overflow-x: auto; flex-wrap: nowrap; } }
/* fiscal device: how it fiscalises */
.fdv-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.fdv-kind { display: flex; gap: .55rem; align-items: flex-start; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.fdv-kind:has(input:checked) { border-color: var(--amber); background: var(--amber-soft); }
.fdv-kind span { display: flex; flex-direction: column; gap: .2rem; }
.fdv-kind em { font-style: normal; font-size: .8rem; color: var(--muted); }

/* cards: the colour of a state runs along the bottom, every card in a row is the same height, the buttons line up */
.fd-tile::before, .hk-card::before { inset: auto 0 0 0; width: auto; height: 4px; }
.fd-tile { padding: .75rem .75rem calc(.75rem + 4px); height: 100%; box-sizing: border-box; }
.fd-board { align-items: stretch; }
.hk-card { height: 100%; box-sizing: border-box; padding-bottom: 4px; }
.hk-open { flex: 1 1 auto; padding: .75rem .75rem .6rem; align-items: flex-start; }
.hk-open .fd-tile-pic { align-self: flex-start; }
.fd-tile .fd-tile-pic { align-self: flex-start; }
.hk-acts { margin-top: auto; padding: .1rem .75rem .7rem; justify-content: flex-start; }
.hk-acts .btn { min-width: 8.5rem; justify-content: center; }
.fd-rrow td:first-child { box-shadow: none !important; }
.hk-card.priority { box-shadow: 0 0 0 1px var(--warn) inset; }
/* the house card everywhere */
.pcard-txt p { margin: 0; font-size: .82rem; }
.pcard-init.tinted { color: var(--on-accent); border-radius: 6px; }
.card-grid { align-items: stretch; }
.card-grid .kanban-card { margin: 0; height: 100%; box-sizing: border-box; }
/* promotion page: the e-mail preview */
.pd-preview { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; background: var(--bg); max-width: 44rem; }
.pd-preview h3 { margin: .3rem 0 .6rem; }
.pd-mail { line-height: 1.55; }
#pd-body { width: 100%; box-sizing: border-box; min-height: 12rem; }
.pcard-txt .badge { align-self: flex-start; }
/* the promotion page: fields full width, the hint clear of the first label */
.doc-screen .doc-card > .muted, .doc-screen .doc-card > .hr-note { margin-bottom: .9rem; }
#pd-name, #pd-subject, #pd-code, #pd-months, #pd-countries, #pd-source { width: 100%; box-sizing: border-box; }

/* documents on smaller screens: nothing runs off the right edge.
   The toolbar wraps (the stage bar goes to a line of its own, still on the right) and the stages narrow a little;
   the chatter keeps a usable width and its buttons share it, wrapping rather than being cut off. */
.doc-toolbar { flex-wrap: wrap; }
.doc-toolbar-right { flex: 0 1 auto; min-width: 0; max-width: 100%; flex-wrap: wrap; justify-content: flex-end; }
.status-bar { flex-wrap: nowrap; max-width: 100%; }
@media (max-width: 1500px) {
  .status-bar li { padding: 0 .8rem 0 1.05rem; font-size: .74rem; }
  .status-bar li:first-child { padding-left: .7rem; }
}
.doc-split { grid-template-columns: minmax(0, 3fr) minmax(17rem, 1fr); }
.chatter { overflow-x: hidden; box-sizing: border-box; min-width: 0; }
.chatter-tools > .btn { flex: 1 1 6.5rem; justify-content: center; min-width: 0; white-space: nowrap; }
@media (max-width: 980px) { .doc-split { grid-template-columns: 1fr; } }

/* Invoice and bill lines, laid out like Odoo's: fixed columns that share the width, the account each line books
   to, and a few blank rows under the lines (click one to add a line). */
.doc-card table.data.lines.inv-lines { table-layout: fixed; width: 100%; }
.doc-card table.data.lines.inv-lines td,
.doc-card table.data.lines.inv-lines th { width: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.doc-card table.data.lines.inv-lines td:has(.combo) { overflow: visible; }
.inv-lines col.c-prod { width: 15%; }
.inv-lines col.c-label { width: 17%; }
.inv-lines col.c-acc { width: 17%; }
.inv-lines col.c-an { width: 10%; }
.inv-lines col.c-am { width: 13%; }
.inv-lines col.c-qty { width: 7%; }
.inv-lines col.c-uom { width: 8%; }
.inv-lines col.c-price { width: 8%; }
.inv-lines col.c-tax { width: 10%; }
.inv-lines col.c-amt { width: 9%; }
.inv-lines col.c-del { width: 2.4rem; }
.inv-lines .ln-acc-fixed { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* a line whose analytic cost is shared: its split in one button, opened to change it */
.inv-lines .an-split { display: block; width: 100%; padding: .3rem .45rem; border: 1px solid var(--line); border-radius: 6px; background: var(--fill); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.inv-lines .an-split span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-lines .an-split:hover { border-color: var(--gold); }
.ln-unit-fixed { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.combo-opt.action { color: var(--gold-ink); font-weight: 550; border-top: 1px solid var(--line); margin-top: .15rem; }
[data-theme="dark"] .combo-opt.action { color: var(--gold); }
.an-split-form .an-split-rows { width: 100%; }
.an-split-form .an-split-rows td { overflow: visible; }
.an-split-form .as-pct { width: 6rem; text-align: right; }
.an-split-total { margin: .6rem 0 0; font-weight: 600; }
.an-split-total.ok { color: var(--ok); }
.an-split-total.warn { color: var(--warn); }
.doc-card table.data.lines tr.ln-filler td { height: 2.5rem; cursor: pointer; border-bottom: 1px solid var(--line); }
.doc-card table.data.lines tr.ln-filler:hover td { background: var(--fill); }
.doc-card table.data.pk-lines.pk-lines.pk-lines { table-layout: fixed; width: 100%; }
.doc-card table.data.pk-lines.pk-lines.pk-lines td, .doc-card table.data.pk-lines.pk-lines.pk-lines th { width: auto; }
.doc-card table.data.pk-lines.pk-lines.pk-lines td:nth-child(1) { width: 38%; }
.doc-card table.data.pk-lines.pk-lines.pk-lines td:last-child { width: 2.4rem; }
@media (max-width: 980px) {
  .doc-card table.data.lines.inv-lines { table-layout: auto; min-width: 52rem; }
  .doc-card .nb-panel:has(> table.inv-lines) { overflow-x: auto; }
}

/* Product category page: costing method and valuation as described choices, Odoo's two-column sections. */
.doc-title-input { font: inherit; letter-spacing: inherit; color: inherit; border: 0; border-bottom: 1px solid transparent; background: transparent; width: 100%; padding: 0; }
.doc-title-input:focus { border-bottom-color: var(--line); outline: none; }
.pc-sections { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.6rem; margin-top: 1.2rem; }
.pc-h { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding-bottom: .4rem; border-bottom: 1px solid var(--line); margin: 0 0 .7rem; }
.pc-sections section > .pc-h ~ .pc-h { margin-top: 1.4rem; }
.pc-choices { display: grid; gap: .45rem; margin-bottom: .8rem; }
.pc-choice { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.pc-choice:has(input:checked) { border-color: var(--accent); background: var(--fill); }
.pc-choice input { margin-top: .2rem; flex: 0 0 auto; width: auto; }
.pc-choice span { display: grid; gap: .1rem; }
.pc-choice small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.pc-note { margin: -.2rem 0 .8rem; font-size: .84rem; }
@media (max-width: 980px) { .pc-sections { grid-template-columns: 1fr; } }
/* the history of a record opened in a dialog, at the dialog's foot */
.dlg-history { margin-top: 1.2rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.dlg-history .chatter { position: static; max-height: 18rem; overflow-y: auto; padding: 0; border: 0; background: transparent; }

/* A create/edit form shown as a page (Odoo's record view), not a pop-up: under the app menu, breadcrumb and
   buttons on top, the form as a sheet, its history beside it. Wizards and questions stay dialogs. */
#form-dialog.as-page { position: fixed; inset: var(--sheet-top, 3.5rem) 0 0 0; display: block; background: var(--page); overflow: auto; z-index: 40; padding: 0; }
body.qc-open #form-dialog.as-page { z-index: 40; }
#form-dialog.as-page .form-dialog { width: auto; max-width: none; max-height: none; height: auto; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 0 1rem 2rem; animation: none; transform: none; }
#form-dialog.as-page .form-dialog > header { display: none; }
#form-dialog.as-page #form-dialog-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1.4rem; overflow: visible; max-height: none; padding: 0; }
#form-dialog.as-page #form-dialog-body:has(> .dlg-history) { grid-template-columns: minmax(0, 3fr) minmax(17rem, 1fr); }
#form-dialog.as-page .sheet-bar { grid-column: 1 / -1; display: flex; flex-direction: column; gap: .7rem; padding: .8rem 0 .9rem; margin-bottom: .9rem; border-bottom: 1px solid var(--line); }
#form-dialog.as-page .sheet-crumbs { display: flex; align-items: baseline; gap: .45rem; font-size: 1.02rem; }
#form-dialog.as-page .sheet-crumbs .link { font-weight: 600; }
#form-dialog.as-page .sheet-crumbs span { color: var(--muted); }
#form-dialog.as-page .sheet-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
#form-dialog.as-page .sheet-actions .btn { width: auto; flex: 0 0 auto; }
#form-dialog.as-page .sheet-card { grid-column: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 1.4rem 1.7rem 1.8rem; min-width: 0; }
#form-dialog.as-page .sheet-card > .doc-title { margin-bottom: 1rem; }
#form-dialog.as-page .sheet-card > .pf,
#form-dialog.as-page .sheet-card > .set-form,
#form-dialog.as-page .sheet-card > form { max-width: 62rem; }
#form-dialog.as-page .dlg-history { grid-column: 2; grid-row: 2 / span 40; margin: 0; padding: 0; border: 0; }
#form-dialog.as-page .dlg-history .chatter { max-height: none; position: sticky; top: 0; }
@media (max-width: 980px) {
  #form-dialog.as-page #form-dialog-body:has(> .dlg-history) { grid-template-columns: minmax(0, 1fr); }
  #form-dialog.as-page .dlg-history { grid-column: 1; grid-row: auto; margin-top: 1rem; }
  #form-dialog.as-page .sheet-card { padding: 1rem; }
}
#form-dialog.as-page .form-dialog,
#form-dialog.as-page .form-dialog.wide,
#form-dialog.as-page .form-dialog.narrow { width: 100% !important; max-width: none !important; min-width: 0 !important; }
#form-dialog.as-page .sheet-card textarea,
#form-dialog.as-page .sheet-card input[type="text"],
#form-dialog.as-page .sheet-card input:not([type]) { width: 100%; box-sizing: border-box; }

/* Line tables in every document, like Odoo's: plain headers, edge to edge in the card, Add a line as a row in the
   table, blank rows underneath. (odooLineTables() in app.js marks them and moves the add links in.) */
.doc-card .nb-panel > table.data,
.doc-card .nb-panel > .table-wrap > table.data { width: calc(100% + 2.5rem); max-width: none; margin-left: -1.25rem; margin-right: -1.25rem; }
.doc-card .nb-panel > table.data th:first-child, .doc-card .nb-panel > table.data td:first-child { padding-left: 1.25rem; }
.doc-card .nb-panel > table.data th:last-child, .doc-card .nb-panel > table.data td:last-child { padding-right: 1.25rem; }
.doc-card table.data.odoo-lines thead th,
.doc-card .nb-panel > table.data thead th { text-transform: none; letter-spacing: 0; font-size: .9rem; font-weight: 600; color: var(--ink); background: transparent; border-bottom: 1px solid var(--line); padding-top: .6rem; padding-bottom: .6rem; }
.doc-card table.data.odoo-lines tbody td { border-bottom: 1px solid var(--line); }
.doc-card table.data.odoo-lines tr.ln-add-row td { padding-top: .6rem; padding-bottom: .6rem; height: auto; }
.doc-card table.data.odoo-lines tr.ln-add-row .link { margin-right: 1.2rem; font-weight: 500; }
.doc-card table.data.odoo-lines tr.ln-add-row:hover td { background: transparent; }
.doc-card table.data.odoo-lines tr.ln-filler td { height: 2.5rem; border-bottom: 1px solid var(--line); }
.doc-card table.data.odoo-lines tr.ln-filler:nth-of-type(even) td { background: color-mix(in srgb, var(--fill) 45%, transparent); }
.doc-card table.data.odoo-lines tr.ln-filler[title]:hover td { background: var(--fill); cursor: pointer; }
.sheet-card table.data.odoo-lines thead th { text-transform: none; letter-spacing: 0; font-size: .9rem; }

/* Operations (receipts, deliveries, internal transfers): Product, Demand, Unit side by side as in Odoo; the rest of
   the width stays free, the delete button sits at the far right. */
.doc-card table.data.pk-lines.pk-lines.pk-lines { table-layout: auto; width: calc(100% + 2.5rem); }
.doc-card table.data.pk-lines.pk-lines.pk-lines th, .doc-card table.data.pk-lines.pk-lines.pk-lines td { width: 1%; white-space: nowrap; padding-right: 1.4rem; }
.doc-card table.data.pk-lines.pk-lines.pk-lines th:first-child, .doc-card table.data.pk-lines.pk-lines.pk-lines td:first-child { width: 32%; min-width: 16rem; white-space: normal; }
.doc-card table.data.pk-lines.pk-lines.pk-lines th:last-child, .doc-card table.data.pk-lines.pk-lines.pk-lines td:last-child { width: auto; text-align: right; }
.doc-card table.data.pk-lines.pk-lines.pk-lines tr.ln-add-row td, .doc-card table.data.pk-lines.pk-lines.pk-lines tr.ln-filler td { width: auto; text-align: left; }
.doc-card table.data.pk-lines.pk-lines.pk-lines .pk-qty, .doc-card table.data.pk-lines.pk-lines.pk-lines .pk-done { width: 6rem; text-align: right; }
.doc-card table.data.pk-lines.pk-lines.pk-lines .pk-cost { width: 7rem; text-align: right; }
.doc-card table.data.pk-lines.pk-lines.pk-lines input.pk-lotname, .doc-card table.data.pk-lines.pk-lines.pk-lines input.pk-lot { width: 11rem; }
.doc-card table.data.pk-lines.pk-lines.pk-lines textarea { width: 13rem; }
.doc-card table.data.pk-lines.pk-lines.pk-lines.pk-view th:last-child, .doc-card table.data.pk-lines.pk-lines.pk-lines.pk-view td:last-child { text-align: left; }

/* Files on a record: a paperclip with the history buttons, the files as chips above the history. */
.chatter-tools .chatter-attach { flex: 0 0 auto !important; min-width: 2.4rem; padding-left: .55rem; padding-right: .55rem; }
.chatter-tools .chatter-attach .menu-ico { width: 1.1rem; height: 1.1rem; }
.chatter-files { display: grid; gap: .35rem; margin: .7rem 0 .2rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.chatter-files-h { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .82rem; }
.chatter-files-h .menu-ico { width: .95rem; height: .95rem; }
.chatter-file-chip { display: flex; align-items: center; gap: .55rem; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--fill); min-width: 0; }
.chatter-file-chip .link { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.chatter-file-chip .muted { font-size: .78rem; flex: none; }
.chatter-file-chip .icon-del { flex: none; }
/* smart buttons sit in the toolbar's flow (between actions and status), never over the action buttons */
.doc-toolbar { flex-wrap: wrap; }
.doc-toolbar-center { position: static; transform: none; left: auto; flex: 0 1 auto; margin: 0 auto; }

/* Questions and wizards (Create a backorder?, Remove this file?): a compact dialog, the text with room to breathe,
   the answers in a footer under a rule, the main one first. No history: they are steps, not records. */
#form-dialog:not(.as-page) .form-dialog.is-question { width: min(560px, calc(100% - 1.5rem)); }
#form-dialog:not(.as-page) #form-dialog-body .form-dialog-foot { gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: 1.1rem; padding: .9rem 0 .2rem; border-top: 1px solid var(--line); }
#form-dialog:not(.as-page) #form-dialog-body .form-dialog-foot .btn { min-height: 2.25rem; padding-left: 1rem; padding-right: 1rem; }
#form-dialog:not(.as-page) .form-dialog.is-question #form-dialog-body > .pf > p:first-child { margin: .2rem 0 0; line-height: 1.55; }

/* ---- Desktop background panel (wallpaper.js): beside the desktop, not over it, so the picture is seen while it is chosen */
.wall-panel {
  position: fixed;
  right: 1rem;
  top: calc(var(--header) + 1rem);
  bottom: 5.25rem;   /* clear of the notes that appear bottom right, so a refusal never hides Save and Cancel */
  width: min(380px, calc(100vw - 2rem));
  z-index: 70;
  display: flex;
  flex-direction: column;
  background: var(--menu-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-dialog);
}
.wall-panel[hidden] { display: none; }
.wall-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.wall-head h3 { margin: 0; font-size: .98rem; }
.wall-x { all: unset; box-sizing: border-box; cursor: pointer; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.wall-x:hover, .wall-x:focus-visible { background: var(--fill); color: var(--ink); }
.wall-x .menu-ico { width: 16px; height: 16px; }
.wall-body { flex: 1; overflow-y: auto; padding: .9rem 1rem; display: flex; flex-direction: column; gap: 1.1rem; }
.wall-h { margin: 0 0 .55rem; font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.wall-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem .6rem; }
.wall-item { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.wall-item > span { font-size: .78rem; color: var(--ink); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wall-sw {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
  background-color: var(--page);
  background-size: cover;
  background-position: center;
  color: var(--muted);
}
.wall-sw:hover { border-color: var(--line-strong); }
.wall-sw:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wall-sw[aria-pressed="true"] { outline: 2px solid var(--amber); outline-offset: 2px; border-color: transparent; }
.wall-sw .menu-ico { width: 20px; height: 20px; }
.wall-tick { position: absolute; right: 5px; top: 5px; width: 18px; height: 18px; border-radius: 50%; background: var(--amber); color: var(--on-amber); display: none; place-items: center; }
.wall-sw[aria-pressed="true"] .wall-tick { display: grid; }
.wall-tick .menu-ico { width: 12px; height: 12px; stroke-width: 3; }
.wall-upload { border-style: dashed; }
.wall-colour { background: var(--wall-spectrum); color: var(--on-amber); }
.wall-colour input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.wall-note { margin: 0; font-size: .8rem; color: var(--muted); }
.wall-foot { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; align-items: center; padding: .75rem 1rem; border-top: 1px solid var(--line); }
.wall-msg { flex: 1 0 100%; margin: 0 0 .1rem; font-size: .82rem; color: var(--danger); }
.wall-msg[hidden] { display: none; }
@media (max-width: 720px) {
  .wall-panel { left: .5rem; right: .5rem; top: auto; bottom: 5.25rem; width: auto; max-height: calc(100vh - 7rem); }
}

/* ------------------------------------------------------------------ Messages popup (top bar) */
.systray-btn.on { background: var(--fill); color: var(--ink); }
.msgpop {
  position: fixed;
  top: calc(var(--header) + 6px);
  right: 12px;
  z-index: 45;
  width: 392px;
  max-width: calc(100vw - 16px);
  height: min(560px, calc(100vh - var(--header) - 24px));
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.msgpop-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 46px;
  padding: .4rem .9rem;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.msgpop-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.msgpop-title strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgpop-title .muted { font-size: .74rem; }
.msgpop-back {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: -.35rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.msgpop-back:hover { background: var(--fill); color: var(--ink); }
.msgpop-back svg { width: 18px; height: 18px; }
.msgpop .link { font-size: .82rem; }
.msgpop-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.msgpop-note { margin: 0; padding: 1.2rem 1rem; font-size: .85rem; }
.msgpop-empty { padding: 2.4rem 1.4rem; text-align: center; }
.msgpop-empty p { margin: .35rem 0 0; font-size: .84rem; }
.msgpop-list { display: flex; flex-direction: column; }
.msgpop-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  padding: .6rem .9rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.msgpop-row:hover, .msgpop-row:focus-visible { background: var(--fill); outline: none; }
.msgpop-av {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold-ink);
}
.msgpop-av svg { width: 18px; height: 18px; }
.msgpop-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.msgpop-line { display: flex; align-items: baseline; gap: .5rem; }
.msgpop-line strong { flex: 1; min-width: 0; font-size: .88rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgpop-line time { flex: 0 0 auto; font-size: .72rem; color: var(--muted); }
.msgpop-text { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgpop-text.full { white-space: pre-wrap; overflow: visible; }
.msgpop-row.unread .msgpop-line strong { font-weight: 700; }
.msgpop-row.unread .msgpop-text { color: var(--ink); }
.msgpop-dot {
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--on-accent);
  font-style: normal;
  font-size: .68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.msgpop-feed { display: flex; flex-direction: column; gap: .7rem; padding: .8rem .9rem; }
.msgpop-msg { max-width: 88%; align-self: flex-start; padding: .45rem .7rem; border-radius: 10px; background: var(--fill); }
.msgpop-msg.mine { align-self: flex-end; background: var(--gold-soft); }
.msgpop-msg header { display: flex; align-items: baseline; gap: .5rem; font-size: .76rem; }
.msgpop-msg header time { color: var(--muted); font-size: .7rem; }
.msgpop-msg p { margin: .15rem 0 0; font-size: .86rem; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.msgpop-replies { display: block; margin-top: .2rem; font-size: .72rem; }
.msgpop-compose {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  padding: .6rem .8rem;
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
}
.msgpop-compose[hidden] { display: none; }
.msgpop-compose textarea {
  flex: 1;
  min-height: 40px;
  max-height: 110px;
  resize: none;
  padding: .45rem .6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: .86rem;
}
.msgpop-compose textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; }
.msgpop-foot {
  display: flex;
  justify-content: center;
  padding: .55rem .9rem;
  border-top: 1px solid var(--line);
  background: var(--fill);
  flex: 0 0 auto;
}
@media (max-width: 720px) {
  .msgpop { left: 8px; right: 8px; width: auto; max-width: none; top: calc(var(--header) + 4px); height: min(620px, calc(100vh - var(--header) - 16px)); }
}

/* Activities window (and the Discuss Activities page) */
.msgpop-sec h4 {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  padding: .45rem .9rem .3rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--fill);
}
.msgpop-sec h4 span { font-weight: 600; letter-spacing: 0; }
.msgpop-row.act { padding: 0; gap: 0; cursor: default; }
.msgpop-row.act:hover { background: none; }
.msgpop-act-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem 0 .6rem .9rem;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.msgpop-act-open:hover, .msgpop-act-open:focus-visible { background: var(--fill); outline: none; }
.msgpop-row.act .msgpop-line strong { font-weight: 500; }
.msgpop-row.act.late .msgpop-av { background: color-mix(in srgb, var(--danger) 16%, var(--bg)); color: var(--danger); }
.msgpop-row.act .late-text { color: var(--danger); font-weight: 600; }
.msgpop-done {
  flex: 0 0 auto;
  align-self: stretch;
  width: 46px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.msgpop-done svg { width: 18px; height: 18px; }
.msgpop-done:hover, .msgpop-done:focus-visible { background: var(--fill); color: var(--ok); outline: none; }
.msgpop-done:disabled { opacity: .4; cursor: default; }
.msgpop-page { padding: 0; overflow: hidden; }
.msgpop-page .msgpop-row.act { max-width: none; }

/* ---- Import a bank or wallet statement (statement_import.js) ---- */
.stm { display: flex; flex-direction: column; gap: .8rem; min-width: min(46rem, 88vw); padding: 1.1rem 1.2rem 1.4rem; }
.stm-file { margin: 0; }
.stm-note { margin: 0; padding: .5rem .8rem; border-radius: var(--radius); background: var(--warn-bg); color: var(--ink); border: 1px solid var(--line); }
.stm-note.bad { background: var(--danger-bg); color: var(--danger); }
.stm-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .6rem; }
.stm-sum:empty { display: none; }
.stm-tile { display: flex; flex-direction: column; gap: .15rem; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--page); }
.stm-tile span { font-size: .78rem; }
.stm-tile b { font-size: 1.02rem; }
.stm-opts { align-items: end; }
.stm-opts select { width: 100%; }
.stm-cols > summary, .stm-skip > summary { cursor: pointer; font-weight: 600; padding: .3rem 0; }
.stm-map-row { grid-template-columns: minmax(12rem, 1.4fr) minmax(10rem, 1fr); }
.stm-sample { max-height: 15rem; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.stm-sample table { margin: 0; }
.stm-types .stm-ask td { background: var(--warn-bg); }
.stm-skip ul { margin: .3rem 0 0; padding-left: 1.2rem; max-height: 9rem; overflow: auto; }
@media (max-width: 640px) { .stm { min-width: 0; } .stm-map-row { grid-template-columns: 1fr; } }

/* Payment reminders */
.rm-bad { color: var(--danger); }
.rm-send { display: flex; flex-direction: column; gap: .7rem; min-width: min(40rem, 88vw); padding: 1.1rem 1.2rem 1.4rem; }
.rm-send p { margin: 0; }
.rm-send textarea, .rm-policy textarea { width: 100%; }
.rm-policy .row select { width: 100%; }

/* Approvals */
.ap-dlg { display: flex; flex-direction: column; gap: .7rem; min-width: min(34rem, 88vw); padding: 1.1rem 1.2rem 1.4rem; }
.ap-dlg p { margin: 0; }
.ap-dlg textarea { width: 100%; }
.ap-acts { white-space: nowrap; }
.ap-rules input[type="number"] { width: 8rem; text-align: right; }
.ap-bar select { min-width: 16rem; }

/* payment terms with instalments: the editor's lines, the example, and the schedule on an invoice and the statement */
.tm-lines input[type="number"] { width: 6.5rem; text-align: right; margin: 0; }
.tm-lines select { margin: 0; min-width: 7rem; }
.tm-lines td { vertical-align: middle; }
.tm-example { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; margin: .4rem 0 .8rem; }
.tm-eg { margin-top: .4rem; }
.term-sched { list-style: none; margin: .25rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.term-sched li { font-variant-numeric: tabular-nums; }
.doc-sched { margin-top: .35rem; }
.statement-due tr.due-late td:nth-child(3) { color: var(--danger); font-weight: 600; }

/* exchange rates: the rate a draft will be booked at, and the list of booked documents far from the rate on file */
.fx-hint { font-size: .85em; margin: .25rem 0 .5rem; }
.fx-hint.warn { color: var(--warn); }
.fx-check td { vertical-align: top; }

/* asset models: the note under the model picker on an asset, and the model form */
.as-model-note { margin: .15rem 0 .5rem; font-size: .85em; }
.am-pct { display: flex; align-items: center; gap: .4rem; }
.am-pct input { width: 8rem; }
#am-name { font-size: 1.5rem; margin-bottom: .6rem; }

/* Approval banner at the top of a document waiting for a second person */
.ap-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .9rem; margin: 0 0 .8rem; padding: .6rem .85rem; border-radius: 4px; border-left: 3px solid var(--vs-warning); background: color-mix(in srgb, var(--vs-warning) 14%, var(--vs-editor-background)); }
.ap-banner.ok { border-left-color: var(--vs-success); background: color-mix(in srgb, var(--vs-success) 14%, var(--vs-editor-background)); }
.ap-banner.bad { border-left-color: var(--vs-error); background: color-mix(in srgb, var(--vs-error) 14%, var(--vs-editor-background)); }
.ap-banner-acts { display: flex; gap: .4rem; }

/* Supplier payment batches */
.pb-missing { color: var(--vs-error); font-size: .85em; }
.pb-warn { margin: .6rem 0 0; padding: .45rem .7rem; border-left: 3px solid var(--vs-warning); background: color-mix(in srgb, var(--vs-warning) 14%, var(--vs-editor-background)); }
.pb-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; }
.pb-table .pb-amt { width: 8rem; text-align: right; }
.pb-table tr.pb-paid td { opacity: .8; }
.pb-empty { padding: 1rem .5rem; }
.pb-picker { min-width: min(46rem, 90vw); }
.pb-filter { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; }
.pb-filter .field { margin: 0; }
.pb-list { max-height: 22rem; overflow: auto; }

/* working without a connection (offline.js): the cloud on the top bar, and the window that lists what waits */
.systray-btn.ofl-off { color: var(--vs-amber-ink); }
.systray-btn.ofl-bad { color: var(--danger); }
.ofl-tray table { width: 100%; }
.ofl-tray .ofl-refused { color: var(--danger); font-weight: 600; }

/* the language of the screens (i18n.js): the picker on the sign-in screen and the list in the Language window */
.login-wrap .theme-pop { gap: .5rem; }
.lang-select { height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--fill); color: var(--ink); font: inherit; font-size: 12.5px; cursor: pointer; }
.lang-select:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.lang-list { display: grid; gap: .35rem; margin: .5rem 0; }
.lang-opt { display: flex; align-items: center; gap: .55rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.lang-opt:hover { background: var(--fill); }
.lang-opt input { margin: 0; }
.lang-opt .badge { margin-left: auto; }
