/* The Cage — Pangolin Photo Safaris camera stock control
   Mobile first. Big tap targets, high contrast, readable in bright light. */

:root {
  --white: #ffffff;
  --border: #e6ddd0;
  --border-strong: #cbb896;

  --ink: #2b2018;
  --ink-soft: #5c4a3a;
  --ink-faint: #8f7d6c;

  --brand: #653600;
  --brand-soft: #4a2700;
  --brand-dim: #f3e6d8;

  --danger: #c0392b;
  --danger-dim: #fbeae7;
  --warn: #b8860b;
  --warn-dim: #fbf3d6;

  --radius: 16px;
  --radius-lg: 22px;
  --tap: 52px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.app {
  max-width: 620px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 96px);
  min-height: 100vh;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  font-weight: 700;
  color: var(--ink);
}

h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }

.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); font-size: 14px; }
/* Same size as .faint, but says something is missing rather than minor. */
.warn-text { color: var(--warn); font-size: 14px; }

/* ----------------------------------------------------------------- boot */

.boot {
  display: grid;
  place-items: center;
  min-height: 60vh;
}

.boot__mark {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid var(--border-strong);
  border-top-color: var(--brand);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ----------------------------------------------------------------- cards */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(43, 32, 24, 0.05);
}

.card + .card { margin-top: 12px; }

.card--warn {
  border-color: var(--warn);
  background: var(--warn-dim);
}

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 20px;
  border-radius: 14px;
  background: transparent;
  border: 2px solid var(--brand);
  color: var(--brand-soft);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--white);
}

.btn--ghost {
  background: transparent;
  border: 2px solid var(--brand);
  color: var(--brand-soft);
}

.btn--block { width: 100%; }

/* --------------------------------------------------------------- inputs */

.field { display: block; margin-bottom: 14px; }

.input,
select.input,
textarea.input {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  outline: none;
}

.input:focus { border-color: var(--brand); }

/* ---------------------------------------------------------------- login */

.login { padding-top: 6vh; }

.login__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
  text-align: center;
}

.login__brand img {
  width: 72px;
  height: 72px;
  border-radius: 20px;
}

.staff-group { margin-bottom: 18px; }

.staff-group__label {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
  margin-bottom: 8px;
}

.staff-list {
  display: grid;
  gap: 8px;
}

.staff-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
}

.staff-pick:active { border-color: var(--brand); }

.staff-pick__name {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--white);
  font-weight: 700;
  font-size: 15px;
}

.avatar--lg { width: 60px; height: 60px; font-size: 22px; }

/* -------------------------------------------------------------- PIN pad */

.pinpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.pinpad button {
  min-height: 62px;
  font-size: 24px;
  font-weight: 600;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--ink);
  cursor: pointer;
}

.pinpad button:active {
  background: var(--brand-dim);
  border-color: var(--brand);
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 22px 0 4px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  transition: all 0.15s ease;
}

.pin-dot--filled {
  background: var(--brand);
  border-color: var(--brand);
  transform: scale(1.1);
}

.shake { animation: shake 0.4s ease; }

@keyframes shake {
  20% { transform: translateX(-9px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ------------------------------------------------------------ profile --- */

.profile-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 0;
  text-align: center;
}

/* ------------------------------------------------------------ schedule --- */

.week-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.week-nav .btn {
  flex: 1;
  min-height: 42px;
  padding: 0 8px;
  font-size: 13.5px;
}

.day-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.day-card--today {
  border-color: var(--brand);
  background: var(--brand-dim);
}

.day-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.day-card__notes {
  margin-top: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--muted { background: var(--ink-faint); }
.badge--warn { background: var(--warn); }

.session-block { margin-top: 20px; }

.session-block__label {
  font-size: 17px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 800;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--border-strong);
}

.activity-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.activity-row--mine {
  border-color: var(--brand);
  background: var(--brand-dim);
}

.activity-row__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}

.vehicle-icon {
  height: 38px;
  width: auto;
  vertical-align: middle;
  margin-right: 6px;
}

.activity-row__guests {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}

.activity-row__detail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.activity-row__code {
  margin-top: 4px;
  margin-bottom: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.chip--mine {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--white);
}

/* --------------------------------------------------------------- admin --- */

.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 13px;
  margin-bottom: 16px;
}

.admin-tab {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.admin-tab--active {
  background: var(--brand);
  color: var(--white);
}

.admin-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.admin-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.admin-row--report {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-row__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-row__main { margin-bottom: 8px; }

.admin-row__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-row__actions .input {
  flex: 1;
  min-width: 100px;
  min-height: 40px;
}

.admin-row__actions .btn {
  min-height: 40px;
  font-size: 13.5px;
}

/* ----------------------------------------------------------- tabbar --- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 6px 8px calc(var(--safe-bottom) + 6px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}

.tabbar__item {
  flex: 1;
  max-width: 130px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 7px 4px;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 12px;
}

.tabbar__item[aria-current='page'] {
  color: var(--ink);
  font-weight: 700;
}

.tabbar__icon {
  font-size: 21px;
  line-height: 1;
  display: inline-block;
  border-radius: 9px;
  padding: 1px 6px;
}

.tabbar__item[aria-current='page'] .tabbar__icon {
  background: var(--brand-dim);
}

/* ---------------------------------------------------------- toasts --- */

.toasts {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-bottom) + 86px);
  z-index: 90;
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
  padding: 0 16px;
}

.toast {
  max-width: 420px;
  padding: 12px 18px;
  border-radius: 13px;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(43, 32, 24, 0.18);
  animation: rise 0.2s ease;
}

.toast--error {
  background: var(--danger-dim);
  border-color: var(--danger);
  color: var(--danger);
}

.toast--success {
  background: var(--brand-dim);
  border-color: var(--brand);
  color: var(--ink);
}

@keyframes rise {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ------------------------------------------------------------- misc --- */

.empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--ink-faint);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.spacer { height: 10px; }

.screen { padding-top: 4px; }

/* =================================================== The Cage additions === */

/* --------------------------------------------------------- stock totals */

.stock-hero {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.stock-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--white);
}

.stock-tile--primary {
  background: var(--brand-dim);
  border-color: var(--border-strong);
}

.stock-tile__value {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  color: var(--brand-soft);
  font-variant-numeric: tabular-nums;
}

.stock-tile__label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.stock-tile--alert .stock-tile__value { color: var(--danger); }

/* A single model's shelf line: name on the left, in/out on the right. */
.shelf-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.shelf-row:last-child { border-bottom: 0; }

.shelf-row__main { flex: 1; min-width: 0; }

.shelf-row__name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-row__count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
}

.shelf-row__count small {
  font-weight: 500;
  color: var(--ink-faint);
  font-size: 13px;
}

/* ------------------------------------------------------------- pickers */

.pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  min-height: var(--tap);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 13px;
  text-align: left;
  cursor: pointer;
  margin-bottom: 8px;
}

.pick-row--on {
  border-color: var(--brand);
  background: var(--brand-dim);
}

.pick-row__check {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--white);
}

.pick-row--on .pick-row__check {
  background: var(--brand);
  border-color: var(--brand);
}

.pick-row__main { flex: 1; min-width: 0; }

/* Both are spans so the whole row stays one <button>; without an explicit
   block they run together on a single line. */
.pick-row__tag {
  display: block;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pick-row__sub {
  display: block;
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink-soft);
}

/* Quantity stepper for SD cards and other counted stock. */
.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stepper button {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 2px solid var(--brand);
  background: var(--white);
  color: var(--brand-soft);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.stepper button[disabled] { opacity: 0.3; pointer-events: none; }

.stepper__value {
  min-width: 34px;
  text-align: center;
  font-weight: 700;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

/* A sticky confirm bar so the basket total is always reachable. */
.actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-bottom) + 68px);
  padding: 10px 16px;
  z-index: 5;
  pointer-events: none;
}

.actionbar__inner {
  max-width: 620px;
  margin: 0 auto;
  pointer-events: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 6px 20px rgba(43, 32, 24, 0.14);
}

.actionbar__count {
  flex: 1;
  font-size: 14px;
  color: var(--ink-soft);
  padding-left: 6px;
}

/* --------------------------------------------------------- who has what */

.holder-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.holder-card__since {
  margin-left: auto;
  font-size: 13px;
  color: var(--ink-faint);
  text-align: right;
}

.holder-card__overdue { color: var(--danger); font-weight: 600; }

/* ------------------------------------------------------------- history */

.event-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.event-row__dir {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.event-row--out .event-row__dir { color: var(--danger); }
.event-row--in .event-row__dir { color: #2e7d32; }

.event-row__when {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 12px;
  white-space: nowrap;
}

/* ---------------------------------------------------------- stock take */

.count-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.count-row__main { flex: 1; min-width: 0; }

.count-row__buttons { display: flex; gap: 6px; }

.count-btn {
  min-width: 46px;
  height: 40px;
  border-radius: 11px;
  border: 2px solid var(--border-strong);
  background: var(--white);
  font-size: 17px;
  cursor: pointer;
}

.count-btn--yes-on { background: #2e7d32; border-color: #2e7d32; color: var(--white); }
.count-btn--no-on { background: var(--danger); border-color: var(--danger); color: var(--white); }

.progress {
  height: 8px;
  border-radius: 99px;
  background: var(--brand-dim);
  overflow: hidden;
  margin: 10px 0;
}

.progress__bar { height: 100%; background: var(--brand); transition: width 0.25s ease; }

/* ------------------------------------------------------------ utilities */

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stack > * + * { margin-top: 10px; }

.section-label {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.search-input { margin-bottom: 10px; }

.badge--danger { background: var(--danger-dim); color: var(--danger); }
.badge--ok { background: #e8f5e9; color: #2e7d32; }

/* ------------------------------------------------- grouped model picker */

/* A collapsible model heading: "Canon EOS R6 MKII — 22 available". Keeps the
   take-out list short once there are several bodies and lens types. */
.group-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  min-height: var(--tap);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 13px;
  margin-bottom: 8px;
  text-align: left;
  cursor: pointer;
}

.group-row--open {
  border-color: var(--border-strong);
  background: var(--brand-dim);
  margin-bottom: 0;
}

.group-row__chevron {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-size: 13px;
  transition: transform 0.18s ease;
}

.group-row--open .group-row__chevron {
  transform: rotate(90deg);
  color: var(--brand);
}

.group-row__main { flex: 1; min-width: 0; }

.group-row__name {
  display: block;
  font-weight: 700;
}

.group-row__meta {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
}

/* The units inside an open group, indented so the nesting is obvious. */
.group-items {
  margin: 8px 0 12px 13px;
  padding-left: 12px;
  border-left: 2px solid var(--border-strong);
}

.group-items .pick-row:last-child { margin-bottom: 0; }

/* The "peek inside the bag" chevron, nested inside the bag's pick row. */
.peek {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: -6px -6px -6px 0;
  border-radius: 10px;
  color: var(--ink-faint);
  font-size: 14px;
}

.peek:hover { background: rgba(101, 54, 0, 0.07); }

/* ======================================================= Hotel stock === */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.page-head__text { min-width: 0; flex: 1 1 200px; }
.page-head__text p { margin: 4px 0 0; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn--small { min-height: 40px; padding: 0 14px; font-size: 14px; }

.btn--danger {
  border-color: var(--danger);
  color: var(--danger);
}

.back-link {
  display: inline-block;
  margin: 0 0 8px -4px;
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
}

.text-danger { color: var(--danger) !important; }

/* Home: the four things people come here to do. */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  text-align: left;
  cursor: pointer;
}

.action:active { border-color: var(--brand); background: var(--brand-dim); }
.action__icon { font-size: 26px; line-height: 1; }
.action__label { font-weight: 700; font-size: 15px; }

.stock-tile--button { text-align: left; cursor: pointer; width: 100%; font: inherit; color: inherit; }
.stock-tile__value--sm { font-size: 24px; }
.stock-hero--3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 420px) {
  .stock-hero--3 { grid-template-columns: 1fr 1fr; }
  .stock-hero--3 > :first-child { grid-column: 1 / -1; }
}

.headline-card {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  margin: 14px 0 0;
  font: inherit;
  color: inherit;
}

.headline-card__figure {
  font-size: 36px;
  font-weight: 800;
  color: var(--brand-soft);
  margin: 4px 0;
  line-height: 1.1;
}

.headline-card__figure small { font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.headline-card__more { margin-top: 8px; color: var(--brand); font-weight: 600; font-size: 14px; }

.card--note {
  background: var(--brand-dim);
  border-color: var(--border-strong);
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 12px;
}

/* Month navigation: ‹ August 2026 › */
.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.month-nav__btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--white);
  font-size: 22px;
  color: var(--brand);
  cursor: pointer;
}

.month-nav__btn[disabled] { opacity: 0.3; }
.month-nav__label { flex: 1; text-align: center; font-weight: 700; font-size: 17px; }

.segmented { margin-bottom: 12px; }

/* Lists of records */
.list { display: grid; gap: 8px; }

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  min-height: var(--tap);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 13px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.list-row--static { cursor: default; }
.list-row:not(.list-row--static):active { border-color: var(--brand); }
.list-row__main { flex: 1; min-width: 0; }
.list-row__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.list-row__figure { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.icon-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--ink-faint);
  cursor: pointer;
}

/* Forms */
.field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

.field__hint { display: block; font-size: 12.5px; color: var(--ink-faint); margin-top: 4px; }
.stack > .field { margin-bottom: 0; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row--3 { grid-template-columns: repeat(3, 1fr); }
.form-row > .field { margin-bottom: 0; min-width: 0; }

@media (max-width: 380px) {
  .form-row { grid-template-columns: 1fr; }
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  cursor: pointer;
}

.check input { width: 20px; height: 20px; accent-color: var(--brand); }

.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.toolbar > .input { flex: 1 1 160px; margin-bottom: 0; }
.toolbar > .btn { flex: 0 0 auto; }

.input--qty {
  flex: 0 0 96px;
  width: 96px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip--button { cursor: pointer; min-height: 34px; }

/* Delivery lines */
.line { margin-bottom: 10px; }
.line + .line { margin-top: 0; }
.line__name { font-weight: 700; }
.line__inputs { display: grid; grid-template-columns: 1fr 1.3fr 0.7fr; gap: 8px; margin-top: 10px; }
.line__inputs .field { margin-bottom: 8px; }
.line__total { text-align: right; font-size: 14px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.totals {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--brand-dim);
  display: grid;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.totals:empty { display: none; }

/* Item picker in a bottom sheet */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(43, 32, 24, 0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet {
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(var(--safe-bottom) + 20px);
  animation: rise 0.2s ease;
}

.sheet__head { margin-bottom: 12px; }
.sheet__close { border: 0; background: none; font-size: 20px; color: var(--ink-faint); cursor: pointer; padding: 6px; }
body.has-sheet { overflow: hidden; }

.picker-results { display: grid; }
.picker__footer { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* Count sheet */
.count-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.count-line__main { flex: 1; min-width: 0; }
.count-line__status { flex: 0 0 16px; color: #2e7d32; font-weight: 700; }

/* Month end steps */
.step {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.step--done { border-color: #a5d6a7; }

.step__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.step__number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
}

.step--done .step__number { background: #2e7d32; }
.step__head h2 { flex: 1; font-size: 17px; }

/* Reports */
.hero-figure { text-align: center; padding: 10px 0 16px; }

.hero-figure__value {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.05;
  color: var(--ink);
  margin: 4px 0;
}

.report-section { margin-top: 6px; }

.chart-card { margin: 14px 0 4px; }
.chart-wrap { position: relative; margin-top: 8px; }
.trend { width: 100%; height: auto; display: block; overflow: visible; }
.trend__grid { stroke: var(--border); stroke-width: 1; }
.trend__tick { fill: var(--ink-faint); font-size: 11px; font-family: var(--font); }
.trend__value { fill: var(--ink); font-size: 12px; font-weight: 700; font-family: var(--font); }
.trend__bar { fill: #c9a988; transition: fill 0.15s ease; }
.trend__bar--on { fill: var(--brand); }
.trend__hit { fill: transparent; cursor: pointer; outline: none; }
.trend__hit:hover + *, .trend__hit:focus-visible { stroke: var(--brand); stroke-width: 1; }

.chart-tip {
  position: absolute;
  z-index: 3;
  width: 170px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--white);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 22px rgba(43, 32, 24, 0.16);
  font-size: 13px;
  pointer-events: none;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 1.2fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 6px 0;
  font-size: 14px;
}

.bar-row__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row__track { height: 10px; border-radius: 0 4px 4px 0; background: var(--brand-dim); overflow: hidden; }
.bar-row__fill { height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; }
.bar-row__fill--neg { background: var(--warn); }
.bar-row__value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.bar-row__sub { grid-column: 3; text-align: right; font-size: 12px; color: var(--ink-faint); margin-top: -4px; }

.link-row {
  width: 100%;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid rgba(184, 134, 11, 0.25);
  background: none;
  text-align: left;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  gap: 10px;
}

.link-row span:first-child { text-align: left; }
.link-row span:last-child { text-align: right; white-space: nowrap; }

.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-strong);
}

.data-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td { background: var(--brand-dim); }
.data-table td .faint { font-size: 12.5px; }

.mini-bar { position: relative; min-width: 110px; height: 22px; }
.mini-bar__fill { position: absolute; left: 0; top: 4px; bottom: 4px; background: var(--brand-dim); border-radius: 0 4px 4px 0; }
.mini-bar__text { position: relative; padding-left: 6px; line-height: 22px; font-variant-numeric: tabular-nums; }

/* Admin groups */
.admin-groups { display: grid; gap: 10px; margin-bottom: 16px; }
.admin-group__label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 5px 2px; }
.admin-tabs--wrap { flex-wrap: wrap; margin-bottom: 0; }
.admin-tabs--wrap .admin-tab { flex: 1 0 auto; padding: 0 10px; }
.admin-row--button { display: block; width: 100%; text-align: left; background: var(--white); cursor: pointer; font: inherit; color: inherit; }

.cage-strip { margin-bottom: 14px; }
.input--qty::placeholder { color: #cdbfae; font-weight: 400; }

.sheet .row-between strong, .card .row-between strong { white-space: nowrap; }

/* The hotel logo leads Home and the sign-in screen. */
/*
 * Two shapes of logo: the hotel's is a wide strip (900×218), the Voyager's is
 * stacked and nearly square. Capping the height as well as the width keeps the
 * tall one from taking half a phone screen, and leaves the wide one untouched.
 */
.hotel-logo { display: block; width: auto; max-width: 280px; max-height: 96px; height: auto; margin: 2px 0 6px; }
.login__brand img.hotel-logo--login { width: 100%; max-width: 300px; height: auto; border-radius: 0; }
.login__name { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.15; text-align: center; }

/* Backup status lines */
.backup-line { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; font-size: 14.5px; }
.backup-line__dot { flex: 0 0 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--brand-dim); color: var(--ink-faint); }
.backup-line__dot.is-ok { background: #e8f5e9; color: #2e7d32; }
.backup-line__dot.is-bad { background: var(--danger-dim); color: var(--danger); }

/* ============================================================ Desktop === */

/* The sidebar's logo and footer only exist on a desktop. */
.sidebar-brand,
.sidebar-foot { display: none; }

.desk-only { display: none; }

@media (min-width: 1024px) {
  :root { --sidebar: 236px; }

  body { background: #faf7f2; }

  /* Bottom tab bar becomes a left-hand sidebar. */
  .tabbar {
    top: 0;
    right: auto;
    width: var(--sidebar);
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    padding: 22px 14px 18px;
    border-top: 0;
    border-right: 1px solid var(--border);
    background: var(--white);
    backdrop-filter: none;
  }

  .sidebar-brand { display: block; padding: 0 8px 20px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
  .sidebar-brand img { display: block; width: auto; max-width: 100%; max-height: 116px; height: auto; }
  .sidebar-brand__app { margin-top: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
  /* A property with no logo file yet: its name, set like the logo it replaces. */
  .sidebar-brand__name { font-size: 19px; font-weight: 800; line-height: 1.2; color: var(--ink); }

  .tabbar__item {
    flex: 0 0 auto;
    max-width: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 12px;
    font-size: 15px;
    border-radius: 11px;
  }

  .tabbar__item:hover { background: #f6efe6; color: var(--ink); }
  .tabbar__item[aria-current='page'] { background: var(--brand-dim); }
  .tabbar__item[aria-current='page'] .tabbar__icon { background: transparent; }
  .tabbar__icon { font-size: 19px; padding: 0; }

  .sidebar-foot { display: block; margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--border); }
  .sidebar-foot .back-link { margin: 4px 0 0 -4px; }

  /* Content area beside the sidebar. */
  .app {
    max-width: none;
    margin: 0 0 0 var(--sidebar);
    padding: 32px 44px 60px;
  }

  .app[data-layout='wide'] > * { max-width: 1280px; }
  .app[data-layout='form'] > * { max-width: 880px; }
  .app[data-layout='login'] { margin-left: 0; }
  .app[data-layout='login'] > * { max-width: 460px; margin-left: auto; margin-right: auto; }

  h1 { font-size: 30px; }

  .card { padding: 20px; }
  .desk-only { display: table-cell; }

  /* The sheet opens as a centred dialog rather than rising from the bottom. */
  .sheet-overlay { align-items: center; }
  .sheet { max-width: 640px; border-radius: 20px; max-height: 84vh; padding: 22px 24px; }

  .toasts { bottom: 28px; left: var(--sidebar); }
  .actionbar { bottom: 20px; left: var(--sidebar); }

  /* Home: alerts across the top, then two columns. */
  .home-head { margin-bottom: 20px; }
  .home-head .hotel-logo { display: none; }
  .home-head .page-head__text p { font-size: 15px; }
  .home-head::before { content: 'Home'; font-size: 30px; font-weight: 700; display: block; width: 100%; }

  .home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-areas:
      'alerts alerts'
      'actions last'
      'low month';
    gap: 20px 28px;
    align-items: start;
  }

  .home-grid__alerts { grid-area: alerts; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
  .home-grid__alerts > * { margin: 0 !important; }
  .home-grid__actions { grid-area: actions; margin: 0; }
  .home-grid__last { grid-area: last; }
  .home-grid__last .headline-card { margin: 0; height: 100%; }
  .home-grid__month { grid-area: month; }
  .home-grid__month .section-label { margin-top: 0; }
  .home-grid__low { grid-area: low; }
  .home-grid__low .section-label { margin-top: 0; }

  .action { min-height: 118px; padding: 18px; }
  .action__icon { font-size: 30px; }
  .action__label { font-size: 16px; }

  /* Lists of records, stores, people: two across. */
  .list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .app[data-layout='form'] .list { grid-template-columns: 1fr; }
  .admin-list { grid-template-columns: repeat(2, minmax(0, 1fr)); display: grid; }

  /* Reports */
  .report-top {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.4fr);
    gap: 24px;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
  }

  .report-top .hero-figure { text-align: left; padding: 0; }
  .report-top .stock-hero { margin: 0; }
  .hero-figure__value { font-size: 56px; }

  .report-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 28px;
    align-items: start;
  }

  .chart-card { margin-top: 20px; }
  .chart-tip { width: 210px; }

  .data-table { font-size: 14.5px; }

  /* Admin: the three groups of tabs sit side by side. */
  /* Two rows: the stock tabs and the log above, people and the Cage below —
     the Cage has five tabs and was squashed in a narrow third column. */
  .admin-groups {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    grid-template-areas:
      'stock oversight'
      'people cage';
    align-items: end;
    column-gap: 16px;
  }
  .admin-group--stock { grid-area: stock; }
  .admin-group--oversight { grid-area: oversight; }
  .admin-group--people { grid-area: people; }
  .admin-group--cage { grid-area: cage; }

  /* Delivery lines: the inputs on one row. */
  .line__inputs { grid-template-columns: 1fr 1.3fr 0.6fr; }

  /* The Cage */
  .stock-hero { grid-template-columns: repeat(4, 1fr); }
  .stock-hero--3 { grid-template-columns: repeat(3, 1fr); }
  .home-grid__month .stock-hero { grid-template-columns: repeat(2, 1fr); }
  .cage-strip { max-width: 520px; }
}

@media (min-width: 1440px) {
  .app { padding-left: 64px; padding-right: 64px; }
  .list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------------------------------------------------- reading invoices */

.reader-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  border-color: var(--border-strong);
  background: var(--brand-dim);
}

.reader-card__text { flex: 1 1 240px; }
.reader-card__text p { margin: 4px 0 0; }
.reader-card__buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.reader-card--busy { justify-content: flex-start; }
.reader-card--busy .boot__mark { width: 30px; height: 30px; flex: 0 0 auto; }
.reader-card--busy p { margin: 2px 0 0; }

.invoice-files { margin-bottom: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.invoice-files .chips { margin: 0; }

.checks { margin-bottom: 12px; display: grid; gap: 4px; }

.check-line { display: flex; gap: 8px; align-items: baseline; font-size: 14px; line-height: 1.35; }
.check-line__icon { flex: 0 0 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.check-line--ok .check-line__icon { background: #e8f5e9; color: #2e7d32; }
.check-line--warn .check-line__icon { background: var(--warn-dim); color: var(--warn); }
.check-line--error .check-line__icon { background: var(--danger-dim); color: var(--danger); }
.check-line--error { color: var(--danger); }
.check-line--info .check-line__icon { background: var(--brand-dim); color: var(--ink-faint); }

.line--warn { border-color: var(--warn); }
.line--error { border-color: var(--danger); }
.line__head { align-items: flex-start; }
.line__tools { display: flex; gap: 6px; }
.line__source { margin-top: 6px; font-size: 13px; color: var(--ink-soft); font-style: italic; }
.line__flags { margin-top: 6px; display: grid; gap: 3px; }

/* ------------------------------------------------------------------ Ask */

.tabbar__item--desk { display: none; }
@media (min-width: 1024px) { .tabbar__item--desk { display: flex; } }

.ask-thread { display: grid; gap: 18px; margin-bottom: 14px; }
.ask-empty { padding: 6px 0; }
.ask-chip { text-align: left; min-height: 38px; line-height: 1.3; padding: 7px 12px; }

.ask-turn { display: grid; gap: 8px; }
.ask-question {
  justify-self: end;
  max-width: 85%;
  background: var(--brand);
  color: var(--white);
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  font-weight: 500;
  white-space: pre-wrap;
}
.ask-answer {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px 16px 16px 4px;
  padding: 12px 16px;
}
.ask-working { display: flex; gap: 12px; align-items: flex-start; }
.ask-working .boot { min-height: 0; }
.ask-working .boot__mark { width: 22px; height: 22px; border-width: 2px; }
.ask-steps { display: grid; gap: 2px; }

.ask-compose {
  position: sticky;
  bottom: calc(var(--safe-bottom) + 76px);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px;
  box-shadow: 0 6px 20px rgba(43, 32, 24, 0.12);
}
.ask-input { resize: vertical; min-height: 52px; max-height: 200px; }
.ask-footer { font-size: 12.5px; margin-top: 8px; }
@media (min-width: 1024px) { .ask-compose { bottom: 16px; } }

.md > * + * { margin-top: 8px; }
.md p, .md ul, .md ol { margin: 0; }
.md ul, .md ol { padding-left: 20px; }
.md h3, .md h4 { margin: 12px 0 4px; font-size: 15px; }
.md code { font-size: 13px; background: var(--brand-dim); padding: 1px 5px; border-radius: 5px; }
.md .table-wrap { margin: 8px 0; }

/* ----------------------------------------------------------- curio shop */

.shop-layout { display: grid; gap: 16px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

.shop-item {
  position: relative;
  display: grid;
  gap: 3px;
  align-content: start;
  min-height: 92px;
  padding: 10px 12px;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 13px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.shop-item:active { transform: scale(0.98); }
.shop-item--in { border-color: var(--brand); background: var(--brand-dim); }
.shop-item--noprice { opacity: 0.55; }
.shop-item__name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.shop-item__price { font-weight: 800; color: var(--brand-soft); font-variant-numeric: tabular-nums; }
.shop-item__stock { font-size: 12px; color: var(--ink-faint); }
.shop-item__count {
  position: absolute; top: -6px; right: -6px;
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: var(--brand); color: var(--white); font-size: 13px; font-weight: 800;
  display: grid; place-items: center;
}

.shop-cart h2 { margin-bottom: 8px; }
.shop-lines { display: grid; }
.shop-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.shop-line__main { flex: 1; min-width: 0; }
.shop-line__name { font-weight: 600; }
.shop-line__total { min-width: 84px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.shop-total { margin: 12px 0; padding: 12px 14px; border-radius: var(--radius); background: var(--brand-dim); }
.shop-total__figure { font-size: 22px; }
.shop-details { margin: 8px 0 4px; }
.shop-details summary { cursor: pointer; font-size: 14px; color: var(--brand); font-weight: 600; margin-bottom: 8px; }
.shop-totals { grid-template-columns: repeat(2, 1fr); }
.shop-sale--void { opacity: 0.55; }
.shop-sale--void .list-row__figure { text-decoration: line-through; }
.shop-sale__open { background: none; border: 0; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }

@media (min-width: 1024px) {
  .shop-layout { grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); align-items: start; }
  .shop-cart { position: sticky; top: 24px; }
  .shop-totals { grid-template-columns: repeat(4, 1fr); }
}

/* The tax invoice: an A4 page on screen and on paper. */
.invoice-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.invoice-toolbar__buttons { display: flex; gap: 8px; }

.invoice {
  position: relative;
  background: #fff;
  color: #1f1a15;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 36px 40px;
  max-width: 800px;
  font-size: 14px;
  box-shadow: 0 2px 16px rgba(43, 32, 24, 0.08);
}
.invoice__head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
/* Tax invoices: the stacked logo would be 140mm tall at 230px wide, so cap it. */
.invoice__logo { width: auto; max-width: 230px; max-height: 84px; height: auto; }
.invoice__from { text-align: right; line-height: 1.5; font-size: 13px; }
.invoice__from strong { font-size: 15px; }
.invoice__title { margin: 26px 0 16px; font-size: 26px; letter-spacing: 0.02em; }
.invoice__meta { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; line-height: 1.5; }
.invoice__label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #7a6a5a; font-weight: 700; }
.invoice__facts { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 0; }
.invoice__facts dt { color: #7a6a5a; }
.invoice__facts dd { margin: 0; font-weight: 600; text-align: right; }
.invoice__lines { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.invoice__lines th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #7a6a5a; border-bottom: 2px solid #1f1a15; padding: 6px 4px; }
.invoice__lines td { padding: 8px 4px; border-bottom: 1px solid #e4dccf; }
.invoice__lines .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.invoice__totals { margin-left: auto; width: min(320px, 100%); display: grid; gap: 4px; }
.invoice__row { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.invoice__row--total { border-top: 2px solid #1f1a15; padding-top: 6px; margin-top: 4px; font-weight: 800; font-size: 16px; }
.invoice__note { margin: 18px 0 0; padding: 10px 12px; background: #faf6f0; border-radius: 6px; }
.invoice__foot { margin-top: 30px; padding-top: 12px; border-top: 1px solid #e4dccf; text-align: center; color: #7a6a5a; font-size: 12.5px; }
.invoice__stamp {
  position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg);
  font-size: 110px; font-weight: 900; color: rgba(192, 57, 43, 0.18); letter-spacing: 0.1em; pointer-events: none;
}

@media (max-width: 560px) {
  .invoice { padding: 22px 16px; }
  .invoice__from { text-align: left; }
}

@page { size: A4; margin: 14mm; }

@media print {
  body { background: #fff !important; }
  .tabbar, .toasts, .no-print, .cage-strip { display: none !important; }
  .app { margin: 0 !important; padding: 0 !important; max-width: none !important; }
  .app > * { max-width: none !important; }
  .invoice { border: 0; box-shadow: none; padding: 0; max-width: none; border-radius: 0; }
}

/* Activity log */
.activity-filters { margin-bottom: 12px; }
.activity-summary { margin: 4px 2px 8px; }
.activity-summary__head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.activity-summary__fix { border: 0; cursor: pointer; margin-left: auto; }
.activity-day { padding-top: 4px; padding-bottom: 4px; }
.activity-row { display: grid; grid-template-columns: 3.2rem 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity-row:last-child { border-bottom: 0; }
.activity-row__time { color: var(--ink-faint); font-variant-numeric: tabular-nums; padding-top: 1px; }
.activity-row__main { min-width: 0; }
.activity-row__sentence { line-height: 1.4; overflow-wrap: anywhere; }
.activity-row__who { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.activity-row__badge { margin-left: 6px; vertical-align: 1px; }
.activity-row--warn { box-shadow: inset 3px 0 0 var(--warn); padding-left: 8px; }
.activity-row--danger { box-shadow: inset 3px 0 0 var(--danger); padding-left: 8px; }
.activity-row__tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.activity-row__detail { margin-top: 8px; }
.activity-changes td { vertical-align: top; }
.activity-was { color: var(--danger); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.activity-now { color: #2e7d32; font-weight: 600; }
.activity-items { display: grid; gap: 4px; padding: 8px 10px; background: var(--brand-dim); border-radius: 8px; }
.activity-row__of { font-size: 13px; font-weight: 600; color: var(--danger); margin-top: 2px; }

/* Home: last month against the month before */
.headline-card__benchmark { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 14px; }
.benchmark-change { font-weight: 600; color: var(--ink-soft); }
.benchmark-change.is-down { color: #2e7d32; }
.benchmark-change.is-up { color: var(--danger); }
.check--inline { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* Where is it */
.home-find { margin: 0 0 14px; }
.home-find .search-input { width: 100%; }
.where-controls { margin-bottom: 12px; }
.where-controls__row { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .where-controls__row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.where-row { align-items: flex-start; }
.where-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.where-chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 3px 9px; border-radius: 999px; background: var(--brand-dim); font-size: 13px; color: var(--ink-soft); }
.where-chip strong { color: var(--ink); }
.where-chip.is-here { background: var(--brand); color: #fff; }
.where-chip.is-here strong { color: #fff; }
.where-chip.is-empty { background: transparent; border: 1px dashed var(--border-strong); color: var(--ink-faint); }
.where-total { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 4px; }
.where-total__figure { font-size: 34px; font-weight: 700; line-height: 1.1; }
.where-move { font-variant-numeric: tabular-nums; }
.where-move--in { color: #2e7d32; }
.where-move--out { color: var(--danger); }

/* Reports: every-item filters */
.report-types { margin: 0 0 12px; }
.report-filter-total { flex-wrap: wrap; gap: 6px; }
@media (min-width: 1024px) { .report-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; } }
.data-table th.sortable { padding: 0; }
.sort-button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 6px 8px; cursor: pointer; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; white-space: nowrap; }
.data-table th.num .sort-button { text-align: right; }
.sort-button:hover { color: var(--brand); }
.sort-button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 6px; }
th.is-sorted .sort-button { color: var(--brand); }
.sort-arrow { font-size: 0.8em; }
.reset-after { font-size: 12px; font-weight: 600; color: var(--brand); white-space: nowrap; }
.report-reset-note { margin-bottom: 14px; }

/* Curio shop settings: invoice details beside the Drive copies */
.shop-settings { display: grid; gap: 14px; align-items: start; max-width: 1100px; }
@media (min-width: 1024px) { .shop-settings { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.shop-settings h3 { margin: 0; }
.drive-months { display: grid; gap: 6px; padding: 10px 12px; background: var(--brand-dim); border-radius: 10px; }
.drive-months__links { display: flex; gap: 12px; }
.drive-months a { color: var(--brand); font-weight: 600; }

/* People & access */
.person-row { display: flex; align-items: center; gap: 10px; }
.person-row .admin-row__main { flex: 1; min-width: 0; }
.person-row__edit { color: var(--brand); font-weight: 600; white-space: nowrap; }
.access-grid { display: grid; gap: 8px; }
.access-area { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--white); }
.access-area.is-on { border-color: var(--brand); background: var(--brand-dim); }
.access-area__head { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.access-area__head input { width: 20px; height: 20px; accent-color: var(--brand); }
.access-area__label { font-weight: 600; flex: 1; }
.access-levels { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0 30px; }
.access-area__help { margin: 6px 0 0 30px; font-size: 13px; }
@media (min-width: 1024px) { .people-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ------------------------------------------------- what you can do ------- */

.perm-group { margin-top: 22px; }

.perm-group__title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 8px;
}

.perm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface, #fff);
}

.perm {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 11px 14px;
}

.perm + .perm { border-top: 1px solid var(--line); }

/* The mark carries the answer, so it needs a fixed column and its own colour. */
.perm__mark {
  flex: none;
  width: 18px;
  text-align: center;
  font-weight: 700;
}

.perm__body { display: flex; flex-direction: column; gap: 2px; }
.perm__what { line-height: 1.4; }
.perm__own, .perm__note { font-size: 13px; color: var(--ink-faint); line-height: 1.45; }
.perm__own { color: var(--warn); }

.perm--yes .perm__mark { color: #2e7d32; }
.perm--own .perm__mark { color: var(--warn); }
.perm--no .perm__mark { color: var(--ink-faint); }
.perm--no .perm__what { color: var(--ink-faint); }

/* The four roles, above the area-by-area grid on the People screen. */
.preset-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--tint, #f7f7f5);
}

.preset-row__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-row__help { line-height: 1.45; }

/* Tasks */
.tabbar__icon { position: relative; }
.tabbar__badge { position: absolute; top: -4px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.tabbar__badge.is-overdue { background: var(--danger); }
.task-list { grid-template-columns: 1fr !important; }
.task-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.task-row .list-row__main { flex: 1; min-width: 0; }
.task-row__title { overflow-wrap: anywhere; }
.task-tick { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--white); color: #fff; font-weight: 800; font-size: 16px; cursor: pointer; display: grid; place-items: center; }
.task-tick:hover:not(:disabled) { border-color: var(--brand); }
.task-tick.is-done { background: #2e7d32; border-color: #2e7d32; }
.task-tick:disabled { opacity: 0.4; cursor: default; }
.task-row--overdue { box-shadow: inset 3px 0 0 var(--danger); }
.task-row--done .task-row__title { text-decoration: line-through; color: var(--ink-faint); }
.task-group--overdue { color: var(--danger); }
.task-group--today { color: var(--brand); }
.task-card { text-align: left; margin-bottom: 14px; }
.task-card__line { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 14.5px; }
.task-card__line.is-overdue span:first-child { color: var(--danger); font-weight: 600; }
.task-who { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 12px; background: var(--brand-dim); border-radius: 10px; }

/* Weekly roundup */
.roundup-layout { display: grid; gap: 14px; align-items: start; }
@media (min-width: 1100px) { .roundup-layout { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.roundup-preview { padding: 10px; }
.roundup-week { margin-bottom: 8px; gap: 8px; flex-wrap: wrap; }
.roundup-frame { width: 100%; min-height: 600px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }

/* Tab bar: scrolls sideways on a phone when someone has many areas. */
@media (max-width: 1023px) {
  .tabbar { overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .tabbar::-webkit-scrollbar { display: none; }
  .tabbar__item { flex: 1 0 58px; }
}

/* Maintenance */
.mt-rooms { margin-bottom: 12px; }
.mt-list { grid-template-columns: 1fr !important; }
.mt-row { display: flex; align-items: center; gap: 10px; border-left: 4px solid var(--border); }
.mt-row .list-row__main { flex: 1; min-width: 0; }
.mt-row__title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mt-row--now { border-left-color: var(--danger); }
.mt-row--week { border-left-color: var(--warn); }
.mt-row--whenever { border-left-color: #b5aa9c; }
.mt-row--planned { border-left-color: #3f6f8f; }
.mt-row--new { border-left-color: var(--brand); }
.mt-row.is-late { background: #fdf0ee; }
.mt-row__extra { font-size: 12.5px; }
.mt-chip { flex: 0 0 auto; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--brand-dim); color: var(--brand); white-space: nowrap; }
.mt-chip--now { background: #fbe3df; color: var(--danger); }
.mt-chip--week { background: var(--warn-dim); color: #8a6d1b; }
.mt-chip--whenever { background: #eeeae4; color: var(--ink-soft); }
.mt-chip--planned { background: #e3edf3; color: #3f6f8f; }
.mt-group--now { color: var(--danger); }
.mt-group--planned { color: #3f6f8f; }
.mt-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mt-thumbs img { width: 74px; height: 74px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.mt-thumbs--big img { width: 120px; height: 120px; }
.mt-sheet__title { margin: 0 0 4px; font-size: 20px; }
.mt-triage { margin-top: 10px; }
.mt-steps { flex-wrap: wrap; }
.mt-history { display: grid; gap: 6px; font-size: 14px; }
.mt-history__row { display: grid; grid-template-columns: 9.5rem 1fr; gap: 8px; }
.list-row.is-off { opacity: 0.55; }
