/* CRM for Medilife — single stylesheet, no framework.
   One palette, defined once. Per-page colour overrides are how drift starts,
   so there are none: every green on every screen is --accent.
   2026-08-04 owner ruling: the CRM adopts the Xenicon dashboard's design
   language (tokens, pills, cards, tables). Styling only — structure and
   behavior are Medilife's own and no logic crosses projects. */
:root {
  --bg: #f8fbf7;
  --surface: #ffffff;
  --surface2: #f7f9f6;
  --border: rgba(24, 33, 22, .08);
  --border-strong: rgba(24, 33, 22, .16);
  --text: #182116;
  --text2: #666666;
  --text3: #6f7a6c;
  --accent: #2E7D32;
  --accent-dark: #1b5e20;
  --accent-tint: rgba(67, 201, 75, .10);
  --green: #2E7D32;
  --red: #c62828;
  --red-bg: #fff0f0;
  --blue: #1565C0;
  --blue-bg: #eef7ff;
  --amber: #b45309;
  --amber-bg: #fff7e8;
  --green-bg: #e8f5e9;
  --radius: 18px;
  --shadow: 0 6px 18px rgba(24, 33, 22, .04);
  --shadow-lg: 0 20px 40px rgba(34, 48, 33, .06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: linear-gradient(180deg, #f8fbf7 0%, #f5f7f4 100%); color: var(--text); min-height: 100vh;
  font: 14px/1.6 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.3rem; font-weight: 700; letter-spacing: -.3px; margin: 0 0 .9rem; }
h2 {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text3); margin: 0 0 .8rem;
  display: flex; justify-content: space-between; align-items: baseline;
}
.h-sub { font-size: .82rem; font-weight: 400; color: var(--text3); margin-left: .5rem; text-transform: none; letter-spacing: 0; }
h1 .h-sub { font-size: .82rem; }
.more { font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.muted { color: var(--text3); font-size: .88em; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
b { font-variant-numeric: tabular-nums; }

/* top shell */
.topbar {
  display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
  background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--border);
  padding: .65rem 1.4rem;
}
.brand {
  font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
  color: var(--accent);
}
.brand::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-right: 8px; vertical-align: 1px;
}
.brand em { font-style: normal; color: var(--text3); font-weight: 400; letter-spacing: .5px; }
.departments { display: flex; gap: .4rem; flex-wrap: wrap; flex: 1; }
.pill {
  color: var(--text2); padding: .32rem .85rem; border-radius: 999px; font-size: 12px;
  font-weight: 600; border: 1px solid var(--border); background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow); transition: all .15s;
}
.pill:hover { color: var(--text); text-decoration: none; }
.pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.user { display: flex; align-items: center; gap: .7rem; font-size: 12px; color: var(--text2); }
.linklike {
  background: none; border: none; color: var(--red); cursor: pointer;
  font-size: 12px; font-weight: 600; padding: 0; font-family: inherit;
}
.linklike:hover { text-decoration: underline; }
/* A name that opens its profile panel but has no page of its own to link
   to: it must read and behave exactly like the names beside it. */
.linkish {
  background: none; border: none; padding: 0; font: inherit;
  color: var(--accent); cursor: pointer; text-align: left;
}
.linkish:hover { text-decoration: underline; }

/* tabs */
.tabs {
  display: flex; gap: 4px; background: rgba(24, 33, 22, .06);
  box-shadow: inset 0 1px 2px rgba(24, 33, 22, .05);
  padding: 4px; margin: 12px auto 0; width: fit-content; max-width: min(100%, 1280px);
  border-radius: 999px; overflow-x: auto;
}
.tabs a {
  padding: 9px 14px; color: var(--text2); white-space: nowrap; font-size: 12px;
  font-weight: 700; border-radius: 999px; transition: all .15s;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: #1f2d1d; background: #fff; box-shadow: 0 2px 8px rgba(24, 33, 22, .08); }

main { padding: 1.2rem 1.4rem; max-width: 1280px; margin: 0 auto; }

/* cards */
.card {
  background: rgba(255, 255, 255, .94); border: 1px solid rgba(24, 33, 22, .05); border-radius: var(--radius);
  padding: 1rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow-lg);
}
.grid2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 880px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* KPIs — dashboard style: micro-label above a big tabular number */
.kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .9rem; margin-bottom: 1.1rem;
}
.kpi {
  background: linear-gradient(180deg, rgba(248, 250, 247, .95), rgba(255, 255, 255, .98));
  border: 1px solid rgba(24, 33, 22, .06); border-radius: var(--radius);
  padding: 14px 15px;
}
.kpi-label {
  font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .9px;
  font-weight: 800; margin-bottom: .45rem;
}
.kpi-num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-num.green { color: var(--green); }
.kpi-num.blue { color: var(--blue); }
.kpi-num.red { color: var(--red); }
.kpi.alert { border-color: #ffc2c2; background: #fffafa; }
.kpi.alert .kpi-num { color: var(--red); }

/* tables */
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
td, th { padding: .5rem .6rem; vertical-align: top; }
table.list thead th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text3); font-weight: 800; background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
table.list thead th.right { text-align: right; }
table.list thead th .sort-link { color: inherit; text-decoration: none; }
table.list thead th .sort-link:hover { color: var(--text); text-decoration: underline; }
table.list thead th[aria-sort] .sort-link { color: var(--text); }
table.list tbody tr { border-bottom: 1px solid rgba(24, 33, 22, .06); }
table.list tbody tr:last-child { border-bottom: none; }
table.list tbody tr:hover td, .card table tr:hover td { background: #f9fbf8; }
/* Small print under a figure — the dates behind an on-order quantity, the
   detail behind an edited invoice. It belongs on its own line under the
   value it explains, never run on the end of it. */
table.list td .more { display: block; color: var(--text3); font-weight: 400; }
/* The small print that is asking for something to be done — a shipment to
   chase, a shortfall a delivery will not cover — reads as a warning, not as
   an aside. Stated at table depth so it beats the muted small-print rule
   above rather than losing to it. */
.late, table.list td .more.late, .m-item__meta .late { color: var(--red); }
tfoot td { border-top: 2px solid var(--border-strong); }
tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--red); }
tr.overdue { background: var(--red-bg); }
li.done, tr.done { opacity: .55; }

/* badges & tags — soft dashboard palette */
.badge {
  display: inline-block; font-size: 11px; font-weight: 600; border-radius: 999px;
  padding: .12rem .55rem; margin-right: .3rem; vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.badge.tS { background: var(--accent-tint); color: var(--accent-dark); }
.badge.tP { background: var(--blue-bg); color: var(--blue); }
.badge.tR { background: var(--red-bg); color: var(--red); }
.badge.tV { background: var(--surface2); color: var(--text2); }
.badge.knote { background: var(--surface2); color: var(--text2); }
.badge.kfollowup { background: var(--blue-bg); color: var(--blue); }
.badge.kcollection { background: var(--amber-bg); color: var(--amber); }
.tag-overdue, .tag-inactive {
  display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .5px; color: var(--red); background: var(--red-bg);
  border-radius: 999px; padding: .12rem .5rem; margin-left: .35rem;
}

/* forms & filters */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .9rem; }
input[type="search"], input[type="text"], input[type="password"], input[type="date"],
input[type="number"], select, textarea {
  font: inherit; font-size: 13px; padding: .45rem .8rem; border: 1px solid var(--border);
  border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--text); max-width: 100%;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
textarea { border-radius: 14px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(46, 125, 50, .12); }
input[type="search"] { min-width: 240px; flex: 1; }
textarea { width: 100%; resize: vertical; }
.check { font-size: 12px; color: var(--text2); display: flex; gap: .35rem; align-items: center; }
.btn {
  font: inherit; font-size: 12px; font-weight: 600; padding: .45rem 1rem; border-radius: 999px;
  cursor: pointer; border: 1px solid var(--border); background: rgba(255, 255, 255, .92);
  color: var(--text2); box-shadow: var(--shadow); transition: all .15s;
}
.btn:hover { border-color: var(--border-strong); color: var(--text); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 10px 20px rgba(46, 125, 50, .18); }
.btn.primary:hover { background: var(--accent-dark); border-color: transparent; color: #fff; }
.btn.small { font-size: 11px; padding: .2rem .6rem; }
.btn.wide { width: 100%; }
form.inline { display: inline; }

/* note form + timeline */
.note-form { margin-bottom: .9rem; display: flex; flex-direction: column; gap: .45rem; align-items: flex-start; }
.note-row { display: flex; gap: .45rem; flex-wrap: wrap; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: .55rem 0; border-bottom: 1px solid rgba(24, 33, 22, .06); }
.timeline li:last-child { border-bottom: none; }
.timeline li.overdue { background: var(--red-bg); border-radius: 10px; padding-left: .5rem; }

/* detail header */
.detail-head { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between; margin-bottom: .8rem; }
.detail-head p { margin: .15rem 0; }
.stat-box {
  background: linear-gradient(180deg, rgba(248, 250, 247, .95), rgba(255, 255, 255, .98));
  border: 1px solid rgba(24, 33, 22, .06); border-radius: var(--radius);
  padding: .8rem 1.1rem; min-width: 240px; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.stat-box b { font-size: 17px; color: var(--green); }

/* misc */
.flash { padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: .9rem; font-size: 13px; border: 1px solid var(--border); background: rgba(255, 255, 255, .92); }
.flash.success { background: var(--green-bg); border-color: transparent; color: #1b5e20; }
.flash.error { background: var(--red-bg); border-color: #ffc2c2; color: var(--red); }
.flash.warn, .flash.warning { background: var(--amber-bg); border-color: #f0d9ac; color: var(--amber); }
.subnav { display: flex; gap: .9rem; margin: 0 0 .8rem; font-size: 12px; font-weight: 600; }
.subnav a { color: var(--text2); padding-bottom: .15rem; }
.subnav a.active { color: var(--accent-dark); border-bottom: 2px solid var(--accent); }
.pagination { display: flex; gap: 1rem; align-items: center; justify-content: center; font-size: 12px; color: var(--text3); }
.syncline { font-size: 11px; color: var(--text3); text-align: right; }
.syncline.stale { color: var(--red); font-weight: 600; }

/* login */
.login-wrap { display: flex; justify-content: center; padding-top: 10vh; }
.login-card { width: 330px; border-radius: 24px; box-shadow: var(--shadow-lg); }
.login-card .brand { display: block; margin-bottom: 1.2rem; }
.login-card label { display: block; margin-bottom: .75rem; font-size: 12px; color: var(--text2); font-weight: 600; }
.login-card input { width: 100%; margin-top: .25rem; }

/* 6-month trend */
.trend { display: flex; flex-direction: column; gap: .35rem; }
.trend-row { display: flex; align-items: center; gap: .6rem; }
.trend-label { width: 52px; font-size: 11px; color: var(--text3); text-align: right; }
.trend-track { flex: 1; background: var(--surface2); border-radius: 999px; height: 13px; }
.trend-bar { background: var(--accent); border-radius: 999px; height: 13px; min-width: 2px; transition: width .3s; }
.trend-value { width: 90px; font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }

/* nav search + user links */
.navsearch input[type="search"] { min-width: 150px; font-size: 12px; padding: .3rem .7rem; }
.userlink { font-size: 12px; font-weight: 600; color: var(--text2); }
.userlink:hover { color: var(--accent-dark); }
/* Phones: ONE header row — brand on the left, the account links beside it
   on the same line (owner phone review, 2026-08-20; the links used to wrap
   onto a second row under the brand). The .user box dissolves into the
   topbar (display: contents) so its children lay out as topbar items: the
   chip's auto margin pushes the link cluster right, and the customer
   search — still the most-used control on the move — keeps its own
   full-width row below on the screens that carry it. Type and padding
   shrink so brand + chip + Password + Sign out fit a 375px phone; the
   topbar still wraps as a safety net rather than ever scrolling sideways. */
@media (max-width: 620px) {
  .topbar { padding: .55rem .8rem; gap: .45rem .55rem; }
  .brand { white-space: nowrap; }
  .user { display: contents; }
  .userchip { margin-left: auto; }
  .userchip, .userlink, .linklike { font-size: 11px; white-space: nowrap; }
  .navsearch { order: 10; width: 100%; }
  .navsearch input[type="search"] { width: 100%; min-width: 0; }
}

/* phones: NOTHING slides sideways — owner ruling 2026-08-04. Tables
   rebuild into stacked cards: the row's name becomes the card title and
   every figure sits on its own labelled line. Desktops keep the table.
   Hand-built .m-list cards replace this generic transform wherever a
   screen provides them; this is the safety net, not the destination. */
@media (max-width: 768px) {
  main { padding: .9rem .8rem; }
  .card { padding: .85rem .8rem; }
  table.list, table.list tbody, table.list tfoot { display: block; width: 100%; }
  table.list thead { display: none; }
  table.list tbody tr, table.list tfoot tr {
    display: block; padding: .6rem .1rem;
    border-bottom: 1px solid rgba(24, 33, 22, .08);
  }
  table.list td {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: .9rem; padding: .14rem 0; text-align: right;
  }
  table.list td:empty { display: none; }
  table.list td[data-label]::before {
    content: attr(data-label); color: var(--text3); font-size: 10px;
    font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
    flex: none; text-align: left;
  }
  table.list td.rowhead {
    display: block; text-align: left; font-weight: 600; padding-bottom: .3rem;
  }
  tr.overdue td:first-child { box-shadow: none; }
  tr.overdue { border-radius: 10px; padding-left: .5rem; }
  tfoot td { border-top: none; }
  table.list tfoot tr { border-top: 2px solid var(--border-strong); border-bottom: none; }
  td, th { padding: .45rem .5rem; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters input:not([type="checkbox"]), .filters select, .filters .btn { width: 100%; }
  input[type="search"] { min-width: 0; }
  .detail-head { flex-direction: column; }
  .stat-box { min-width: 0; width: 100%; }
  .btn { padding: .55rem 1rem; }
  .note-row { flex-direction: column; align-items: stretch; }
  .note-row input, .note-row select, .note-row .btn { width: 100%; }
}

/* mobile data cards — the phone-native presentation of business lists.
   A screen wraps its desktop table and its .m-list in .has-m-list; the
   viewport picks exactly one. Nothing ever slides sideways on a phone. */
.m-list { display: none; }
/* The sort selector mirrors the clickable table headers, so it appears
   exactly when the cards replace the table and its headers vanish. */
.m-only { display: none; }
@media (max-width: 1100px) { label.m-only { display: block; } form.m-only { display: flex; } }
/* Below 1100px a multi-column table no longer fits honestly, so the
   cards take over — flowing two-up while width allows, one-up on
   phones. At full desktop width the classic tables stay. */
@media (max-width: 1100px) {
  .has-m-list .tbl-wrap, .has-m-list .table-scroll,
  .has-m-list table { display: none; }
  .m-list {
    display: grid; gap: .55rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  }
  .m-item {
    display: grid; gap: .35rem; padding: .8rem .85rem;
    border: 1px solid rgba(24, 33, 22, .07); border-radius: 14px;
    background: linear-gradient(180deg, rgba(248, 250, 247, .95), rgba(255, 255, 255, .98));
  }
  .m-item__top { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; }
  .m-item__name { font-weight: 650; font-size: 13.5px; min-width: 0; overflow-wrap: anywhere; }
  .m-item__name a { color: inherit; }
  .m-item__name .more { display: block; font-weight: 400; font-size: 11px; color: var(--text3); }
  .m-item__hero { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .m-item__hero .green { color: var(--green); }
  .m-item__meta { display: flex; flex-wrap: wrap; gap: .2rem .9rem; color: var(--text3); font-size: 11.5px; }
  .m-item__meta b { color: var(--text2); font-weight: 650; font-variant-numeric: tabular-nums; }
  .m-bar { height: 6px; border-radius: 999px; background: var(--surface2); overflow: hidden; }
  .m-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; min-width: 2px; }
  /* share bar as a native progress element — no value-driven inline styles */
  .m-progress {
    width: 100%; height: 6px; border: none; border-radius: 999px;
    background: var(--surface2); overflow: hidden;
    -webkit-appearance: none; appearance: none;
  }
  .m-progress::-webkit-progress-bar { background: var(--surface2); border-radius: 999px; }
  .m-progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
  .m-progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
  .m-item--sub { margin-left: .8rem; border-left: 3px solid var(--accent-tint); background: var(--surface2); }
  .m-item--alert { border-color: #ffd6d6; background: #fffafa; }
  .m-item--alert .m-item__hero { color: var(--red); }
  .m-item__actions { display: flex; gap: .5rem; flex-wrap: wrap; padding-top: .15rem; }
}

/* empty states — a quiet card that says what to do next, never a bare void */
.empty {
  text-align: center; padding: 2.2rem 1rem; color: var(--text3);
  font-size: 13px; line-height: 1.7;
}
.empty b { display: block; font-size: 14px; color: var(--text2); margin-bottom: .15rem; }

/* in-place hints — the approved subtle disclosure pattern; no popups */
.hint { color: var(--text3); font-size: 11.5px; line-height: 1.55; margin: .35rem 0 0; }
details.hint-more { margin-top: .4rem; }
details.hint-more summary {
  cursor: pointer; list-style: none; color: var(--accent-dark);
  font-size: 11.5px; font-weight: 650; width: fit-content;
}
details.hint-more summary::-webkit-details-marker { display: none; }
details.hint-more summary::after { content: " ▾"; font-size: 9px; }
details.hint-more[open] summary::after { content: " ▴"; }
details.hint-more p { margin: .3rem 0 0; color: var(--text3); font-size: 11.5px; line-height: 1.55; }

/* global sales dashboard (legacy shared hooks; the Sales pages load their own
   copied stylesheet after this one) */
.sales-head { display: flex; gap: 1rem; align-items: end; justify-content: space-between; flex-wrap: wrap; margin-bottom: .65rem; }
.sales-head .pagetitle { margin-bottom: .1rem; }
.sales-eyebrow { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
.sales-filters { display: flex; gap: .55rem; align-items: end; flex-wrap: wrap; }
.sales-filters label { display: grid; gap: .2rem; color: var(--text3); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.sales-filters input[type="date"] { border-radius: 999px; background: rgba(255,255,255,.92); }
.quick-ranges { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; font-size: 12px; }
.sales-range-bar { gap: .25rem; padding: .25rem; width: fit-content; max-width: 100%; overflow-x: auto; border-radius: 999px; background: rgba(24, 33, 22, .06); }
.sales-range-bar a { padding: .5rem .8rem; border-radius: 999px; color: var(--text2); white-space: nowrap; }
.sales-range-bar a:hover { color: var(--text); background: rgba(255, 255, 255, .72); text-decoration: none; }
.sales-view-switch { display: flex; gap: .2rem; padding: .25rem; width: fit-content; max-width: 100%; overflow-x: auto; border-radius: 999px; background: rgba(24, 33, 22, .06); margin-bottom: .8rem; }
.sales-view-switch a { padding: .5rem .8rem; border-radius: 999px; color: var(--text2); font-size: 12px; font-weight: 700; white-space: nowrap; }
.sales-view-switch a:hover { color: var(--text); text-decoration: none; }
.sales-view-switch a.active { color: #1f2d1d; background: #fff; box-shadow: 0 2px 8px rgba(24, 33, 22, .08); }
.division-switch { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.division-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: .8rem; margin-bottom: .55rem; }
.division-group { min-width: 0; display: grid; gap: .4rem; align-content: start; }
.division-children { display: grid; gap: .4rem; padding-left: .55rem; border-left: 2px solid var(--accent-tint); }
.division-card { display: flex; flex-direction: column; gap: .18rem; padding: .9rem 1rem; border: 1px solid rgba(24, 33, 22, .06); border-radius: var(--radius); background: linear-gradient(180deg, rgba(248, 250, 247, .95), rgba(255, 255, 255, .98)); color: var(--text2); }
.division-card:hover { border-color: var(--accent); text-decoration: none; }
.division-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); }
.division-card.subset { background: var(--surface2); }
.division-card strong { color: var(--text); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.division-card span { font-size: 11px; }
.division-name { color: var(--accent-dark); font-size: 12px !important; font-weight: 800; text-transform: uppercase; letter-spacing: .55px; }
.division-parent { color: var(--text3); font-size: 10px !important; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.division-note { color: var(--text3); font-size: 11px; margin: 0 0 1rem; }
.sales-grid .card { min-width: 0; }
.sales-span-2 { grid-column: 1 / -1; }
.table-scroll { overflow-x: auto; }
.sales-trend-label { width: 68px; }
.sales-section-head { display: flex; align-items: start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.sales-section-head h2 { margin: 0 0 .2rem; }
.sales-section-head p, .table-note { margin: 0; color: var(--text3); font-size: 11px; line-height: 1.5; }
.table-note { margin-top: .7rem; }
.sales-search { display: flex; gap: .4rem; flex: 1; min-width: min(100%, 320px); justify-content: end; }
.sales-search input[type="search"] { max-width: 360px; }
.sales-summary-hero { display: flex; gap: 2rem; justify-content: space-between; align-items: end; }
.sales-summary-hero p { color: var(--text2); margin: .4rem 0 0; }
.sales-summary-value { color: var(--text); font-size: clamp(32px, 6vw, 52px); font-weight: 700; letter-spacing: -1.5px; line-height: 1; font-variant-numeric: tabular-nums; }
.sales-summary-compare { display: grid; gap: .25rem; text-align: right; }
.sales-summary-compare strong, .invoice-total { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sales-summary-compare span { font-size: 13px; font-weight: 700; }
.green { color: var(--green); }
.red { color: var(--red); }
.invoice-meta { display: flex; gap: .6rem 1.2rem; flex-wrap: wrap; padding: .65rem 0; margin-bottom: .5rem; color: var(--text2); font-size: 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.invoice-focus { border-color: var(--accent); }
.invoice-results a { color: var(--accent-dark); }
.invoice-modal-backdrop {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(17,24,16,.42); backdrop-filter: blur(2px);
}
.invoice-modal-backdrop[hidden] { display: none; }
.invoice-modal {
  width: min(760px, 100%); max-height: calc(100vh - 40px); overflow-y: auto;
  background: #fff; border: 1px solid rgba(24, 33, 22, .05); border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .22); animation: invoice-modal-in .2s ease;
}
.invoice-modal__header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  position: sticky; top: 0; z-index: 1; padding: .9rem 1.1rem;
  background: rgba(255,255,255,.96); border-bottom: 1px solid #eef1ec;
}
.invoice-modal__eyebrow { color: var(--accent-dark); font-size: 10px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
.invoice-modal__close { border: 0; background: transparent; color: var(--text2); font-size: 26px; line-height: 1; cursor: pointer; padding: .1rem .35rem; border-radius: 12px; }
.invoice-modal__close:hover { background: #f3f5f2; color: var(--text); }
.invoice-modal__content { padding: 1rem 1.1rem 1.1rem; }
.invoice-modal__content .invoice-focus { margin: 0; box-shadow: none; }
.invoice-modal__loading, .invoice-modal__error { padding: 2.5rem 1rem; text-align: center; color: var(--text2); }
body.invoice-modal-open { overflow: hidden; }
@keyframes invoice-modal-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 620px) {
  .sales-filters { width: 100%; }
  .sales-filters label { flex: 1; }
  .sales-filters input { width: 100%; }
  .sales-filters .btn { width: 100%; }
  .division-grid { grid-template-columns: 1fr 1fr; }
  .trend-value { width: 82px; }
  .sales-view-switch { width: 100%; border-radius: 12px; }
  .sales-search { width: 100%; justify-content: stretch; }
  .sales-search input[type="search"] { min-width: 0; width: 100%; }
  .sales-summary-hero { align-items: start; flex-direction: column; gap: 1rem; }
  .sales-summary-compare { text-align: left; }
  .invoice-modal-backdrop { align-items: end; padding: 0; }
  .invoice-modal { max-height: 90vh; border-radius: 22px 22px 0 0; }
  .tabs { width: 100%; border-radius: 12px; flex-wrap: wrap; overflow-x: visible; }
  .sales-view-switch, .sales-range-bar { flex-wrap: wrap; overflow-x: visible; border-radius: 12px; }
}
@media (max-width: 420px) { .division-grid { grid-template-columns: 1fr; } }


/* ---- freshness strip -------------------------------------------------- */
/* Every figure in the product hangs off this. It states the age of the data
   from Marg's own returned watermark, and says so plainly when that is old. */
.freshness {
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
  padding: .45rem .9rem; font-size: 12.5px; line-height: 1.4;
  border-bottom: 1px solid var(--border); background: var(--surface2);
  color: var(--text2);
}
.freshness__dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint);
}
.freshness__text b { color: var(--text); font-weight: 650; }
.freshness__note { font-weight: 650; }
.freshness--red { background: var(--red-bg); color: var(--red); }
.freshness--red .freshness__dot { background: var(--red); box-shadow: 0 0 0 3px rgba(198,40,40,.12); }
.freshness--red .freshness__text b { color: var(--red); }
.freshness--not_connected { background: var(--blue-bg); color: var(--blue); }
.freshness--not_connected .freshness__dot { background: var(--blue); box-shadow: 0 0 0 3px rgba(21,101,192,.12); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  background: var(--surface); padding: .5rem .8rem; border: 1px solid var(--border);
}
.skip:focus { left: .5rem; top: .5rem; }
.userchip em { font-style: normal; color: var(--text3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.freshness__link { font-weight: 650; text-decoration: underline; }
.freshness--red .freshness__link { color: var(--red); }
.pagetitle { font-size: 20px; margin: 1rem 0 .8rem; letter-spacing: -.01em; }
.verdict__line { font-size: 16px; font-weight: 700; margin: 0 0 .35rem; }
.verdict__sub { margin: 0; color: var(--text2); font-size: 13.5px; line-height: 1.55; }
.verdict--red .verdict__line { color: var(--red); }
.verdict--not_connected .verdict__line { color: var(--blue); }
.cardtitle { font-size: 14px; margin: 0 0 .5rem; }
.tag { display: inline-block; padding: .12rem .55rem; border-radius: 999px;
  font-size: 11px; font-weight: 650; background: var(--surface2); color: var(--text2); }
.tag--ok { background: var(--accent-tint); color: var(--accent-dark); }
.tag--bad { background: var(--red-bg); color: var(--red); }

/* division doors — the post-login chooser. Three cards, one decision. */
.division-doors { max-width: 860px; margin: 8vh auto 0; padding: 0 1rem; }
.division-doors__head { text-align: center; margin-bottom: 1.6rem; }
.division-doors__head h1 { margin-bottom: .2rem; }
.division-doors__grid {
  display: grid; gap: .9rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}
.division-door {
  display: grid; justify-items: center; gap: .45rem; width: 100%;
  padding: 1.6rem 1rem 1.4rem; cursor: pointer;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); font: inherit; text-align: center;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.division-door:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.division-door.is-current { border-color: var(--accent); }
.division-door__mark {
  display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: 16px; background: var(--accent-tint); color: var(--accent-dark);
  font-size: 22px; font-weight: 800;
}
.division-door__label { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.division-door__hint { font-size: 12px; color: var(--text3); }

/* ---- Smart search dropdown --------------------------------------------- */
/* Look copied from the AI Order Entry project's party search menu
   (globals.css .party-resolution__*), owner instruction 2026-08-07; only the
   color variables are mapped to this stylesheet's palette. */
.smart-search { position: relative; }
.navsearch.smart-search { position: relative; }
.smart-search__menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 170;
  width: min(34rem, calc(100vw - 32px)); display: grid; gap: 8px;
  padding: 10px; border: 1px solid rgba(217, 222, 206, 0.95);
  border-radius: 16px; background: #fff;
  box-shadow: 0 18px 42px rgba(31, 38, 28, 0.14);
}
.navsearch .smart-search__menu { left: auto; right: 0; }
.smart-search__menu[hidden] { display: none; }
.party-resolution__results { max-height: 300px; overflow: auto; display: grid; }
.party-resolution__result {
  display: grid; gap: 3px; padding: 9px 8px; border: 0;
  border-bottom: 1px solid rgba(229, 233, 220, 0.78); background: transparent;
  color: inherit; text-align: left; cursor: pointer; font: inherit;
}
.party-resolution__result:hover { background: #f6f7f2; }
.party-resolution__result-name { font-size: 13px; font-weight: 800; }
.party-resolution__result-meta,
.party-resolution__reason,
.party-resolution__empty { color: var(--text3); font-size: 11px; font-weight: 700; }
.party-resolution__empty { padding: 10px 8px; }

/* ---- Order fold (one row per sales order, click to open items) ---------- */
.order-fold { border-bottom: 1px solid rgba(229, 233, 220, 0.78); }
.order-fold:last-of-type { border-bottom: 0; }
.order-fold > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem;
  padding: .6rem .35rem; cursor: pointer; list-style: none;
}
.order-fold > summary::-webkit-details-marker { display: none; }
.order-fold > summary::before {
  content: "\25B8"; color: var(--text3); font-size: .8em;
  transition: transform .15s ease;
}
.order-fold[open] > summary::before { transform: rotate(90deg); }
.order-fold > summary:hover { background: #f6f7f2; }
.order-fold__id { min-width: 8.5rem; }
.order-fold__meta { color: var(--text3); font-size: .85em; }
.order-fold__state { margin-left: auto; }
.order-fold__body { padding: 0 .35rem .8rem 1.35rem; }
.order-fold__table td, .order-fold__table th { white-space: normal; }
@media (max-width: 640px) {
  .order-fold__body { padding-left: .35rem; overflow-x: hidden; }
  .order-fold__state { margin-left: 0; flex-basis: 100%; }
}
.party-resolution__result.is-highlighted { background: #eef2e8; }


/* Customer profile panel — the design language of the Xenicon dashboard's
   customer modal (2026-08-04 styling ruling, extended by the owner on
   2026-08-08: "this has been built in the xenicon dashboard - take it from
   there"). Its shape and proportions; Medilife's own palette and data. */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000; display: none;
  background: rgba(24, 33, 22, .45);
  align-items: flex-start; justify-content: center;
  padding: 2.5rem 1.25rem; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid rgba(24, 33, 22, .05);
  border-radius: 24px; width: 100%; max-width: 900px; padding: 1.8rem;
  position: relative; box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem; width: 36px; height: 36px;
  border: none; border-radius: 50%; cursor: pointer; font-size: 1.1rem;
  background: rgba(24, 33, 22, .06); color: var(--text2);
  transition: background .2s;
}
.modal-close:hover { background: rgba(24, 33, 22, .12); color: var(--text); }
.modal h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.4px; margin: 0 0 .15rem; }
.modal .modal-meta { font-size: .82rem; color: var(--text2); margin-bottom: 1rem; }
.modal .modal-meta span + span::before { content: "·"; margin: 0 .5rem; opacity: .5; }
.profile-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem; margin-bottom: 1.1rem;
}
.profile-figure {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 14px; padding: .7rem .8rem;
}
.profile-figure b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.profile-figure span { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text3); }
.profile-block { margin-bottom: 1.1rem; }
.profile-block h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text3); margin: 0 0 .45rem; }
/* Twelve months of trade, as tall as the tallest. No axis: the point is the
   shape, and the exact figures are one row below. */
.profile-bars { display: flex; align-items: flex-end; gap: .3rem; height: 96px; }
/* Capped so a customer with three months of trade gets three bars, not three
   banners; uncapped flex makes a short history look like a bar chart of one. */
/* The column is the full track and must be full height: the green fill inside
   it is sized as a PERCENTAGE, and a percentage resolves against its parent —
   a content-height column makes every month render as the same flat line. */
.profile-bars div { flex: 1 1 0; max-width: 64px; height: 100%; background: var(--accent-tint); border-radius: 5px 5px 0 0; position: relative; }
.profile-bars div i { position: absolute; inset: auto 0 0 0; background: var(--accent); border-radius: 5px 5px 0 0; display: block; }
.profile-months { display: flex; gap: .3rem; margin-top: .3rem; }
.profile-months span { flex: 1 1 0; max-width: 64px; text-align: center; font-size: .6rem; color: var(--text3); overflow: hidden; }
.modal .list td, .modal .list th { padding: .45rem .5rem; }
.modal-error { color: var(--red); }
@media (max-width: 700px) {
  .modal-overlay { padding: 0; }
  .modal { border-radius: 18px 18px 0 0; padding: 1.2rem 1rem; min-height: 100%; }
  /* Long names run under the close button otherwise. */
  .modal h2 { padding-right: 2.6rem; }
  .profile-bars { height: 72px; }
  /* Phones never scroll sideways (owner ruling): the month strip drops to
     first and last rather than becoming a horizontal rail. */
  .profile-months span:not(:first-child):not(:last-child) { visibility: hidden; }
  /* An invoice is one line, not three stacked cells: number and amount on
     the first row, its date underneath in small type. */
  .modal .list tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .6rem; padding: .4rem 0; }
  .modal .list td { padding: 0; border: none; }
  .modal .list td:first-child { font-weight: 600; }
  .modal .list td:nth-child(2) { order: 3; flex-basis: 100%; font-size: .72rem; color: var(--text3); }
  .modal .list td:last-child { margin-left: auto; font-variant-numeric: tabular-nums; }
}

/* ---- Page head: title left, its offer in the right-hand corner --------- */
.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem;
}
.page-head h1 { margin: 0; }
.page-head__aside { font-size: 12px; font-weight: 600; color: var(--text2); }
.page-head__aside:hover { color: var(--accent-dark); }
/* Owner, 2026-08-08: the working screens sat hard against the left edge.
   Their content is centred on the page, matching the tab strip above it. */
.filters--centred { justify-content: center; align-items: center; }
/* Width, never flex-basis: these inputs are pill-shaped and a flex basis on
   a wrapped row let the browser stretch one into a giant lozenge. */
.filters--centred input[type="search"] { flex: 0 1 auto; width: min(100%, 46rem); }
@media (max-width: 640px) {
  .page-head { flex-direction: column; align-items: flex-start; gap: .25rem; }
}

/* Stock: the heading row carries the Sort control (owner phone review,
   2026-08-20) so the goods list starts higher. The head row lives inside
   the live filter form, full width; the search sits below it. Like the
   old .m-only, the sort appears only under 1100px, where the cards
   replace the click-to-sort table headers — but inline beside its label
   and left-aligned by the heading, not centred under the search. */
.stock-filters .page-head { width: 100%; margin-bottom: 0; }
.stock-head { justify-content: flex-start; }
.stock-head .page-head__aside { margin-left: auto; }
.stock-sort { display: none; }
@media (max-width: 1100px) {
  label.stock-sort {
    display: inline-flex; align-items: center; gap: .45rem;
    font-size: 12px; font-weight: 600; color: var(--text2);
  }
  .stock-sort select { width: auto; font-size: 12px; padding: .3rem .7rem; }
}
@media (max-width: 640px) {
  /* Phones keep the head a ROW (overriding the stacked .page-head above):
     heading and sort share the line; the near-expiry offer wraps under.
     The heading drops a step so both genuinely fit a 375px phone. */
  .stock-head { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; }
  .stock-head h1 { font-size: 1.15rem; }
  .stock-head .page-head__aside { flex-basis: 100%; margin-left: 0; }
  /* The generic phone .filters rule stretches selects full width; inline
     beside its label, the sort keeps its natural size. */
  .stock-filters .stock-sort select { width: auto; }
}

/* Owner, 2026-08-20 (phone review, round two): "the blocks need a complete
   rebuild." The stock phone blocks drop the rounded-card chrome for a flat
   divided list — hairline rules, tight rows, price-list density — so a
   phone shows about twice the products at a glance. Each row is the bold
   name and ONE small figures line naming every number in plain words:
   Stock leads in bold with its unit (owner, 2026-08-21: one net figure —
   "Stock" = On Hand minus Committed — replacing the two it was derived
   from), zeros sit muted grey so stock that exists stands out. Scoped to
   the stock list only; every other screen keeps the shared .m-item card. */
@media (max-width: 1100px) {
  .m-list--stock { display: block; }
  .m-list--stock .m-item {
    padding: .45rem .1rem; gap: .1rem;
    border: none; border-bottom: 1px solid rgba(24, 33, 22, .08);
    border-radius: 0; background: none;
  }
  .m-list--stock .m-item:last-child { border-bottom: none; }
  .m-list--stock .m-item__name { font-size: 13px; }
  .stock-figs { gap: .1rem .7rem; }
  .stock-figs .stock-net { color: var(--text); font-weight: 650; }
  .stock-figs .stock-net b { color: var(--text); }
  /* Declared after the net-figure rules on purpose: an out-of-stock Stock
     mutes like any other zero, so the eye lands only on real numbers. */
  .stock-figs .is-zero { color: var(--text3); font-weight: 400; }
  .stock-figs .is-zero b { color: var(--text3); font-weight: 500; }
  /* And after the zero rules: oversold (owner, 2026-08-21) prints its true
     negative in red — below zero is a promise already broken, never muted
     and never clamped to a merely-empty 0. */
  .stock-figs .is-neg, .stock-figs .is-neg b { color: var(--red); }
}

/* ---------------------------------------------------------------------------
   Order status, single customer (supply_customer_detail)

   Owner, 2026-08-20: "the boxes problem is insane - its everywhere. You want
   a personalised rebuild/refactor/repair for every screen. Go one by one."
   Screen one of that series. The four KPI tiles are desktop-only now; a
   phone gets ONE labelled summary line in the stock-list style, zeros muted,
   the short figure red. Each order row leads with the exact order date AND
   the exact wait in days — the same-day owner correction: "no 9 days late
   or 9 weeks late. specificity is important. don't make things more vague.
   '11 Aug Overdue by 9 days' — Something like this is better" — instead of
   a big bold internal number, an age chip, and the date saying the age a
   second time. The order number sits in small print at the row's end.
--------------------------------------------------------------------------- */
.supply-line { display: none; }
.ofold-when { white-space: nowrap; font-size: 13px; color: var(--text2); }
.ofold-when b { font-weight: 650; }
.ofold-when .wait-ok { color: var(--green); }
.ofold-when .wait-warn { color: var(--amber); }
.ofold-when .wait-late { color: var(--red); }
.ofold-figs { color: var(--text2); font-size: 11.5px; min-width: 0; overflow-wrap: anywhere; }
.ofold-figs b { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text); }
.ofold-figs .ok { color: var(--green); font-weight: 650; }
.ofold-figs .none { color: var(--text3); }
.ofold-vcn { color: var(--text3); font-size: 10.5px; }
@media (max-width: 1100px) {
  .kpis--wide { display: none; }
  .supply-line { display: block; margin: -.2rem 0 .9rem; font-size: 13px; color: var(--text2); }
  /* Each figure wraps as one piece — a number must never strand on the line
     above its own label. */
  .supply-line span { white-space: nowrap; }
  .supply-line b { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text); }
  .supply-line .ok { color: var(--green); font-weight: 650; }
  .supply-line .late, .supply-line .late b { color: var(--red); }
  .supply-line .is-zero, .supply-line .is-zero b { color: var(--text3); font-weight: 400; }
}
@media (max-width: 640px) {
  /* Phone row: date + wait on the first line, the figures on their own
     full-width second line so nothing wraps mid-figure at 375px. */
  .ofold-figs { flex-basis: 100%; }
}

/* ---------------------------------------------------------------------------
   Hospitality pipeline

   The board is stage columns on a wide screen and a single vertical list on a
   phone. It is never side-scrolling columns on a phone: the owner's standing
   rule is that nothing slides sideways there, and a kanban board is the exact
   shape that rule exists to prevent.

   The shared .m-item card styling lives inside a max-width:1100px block, so
   the two places that show cards on a WIDE screen — the board columns, and a
   single-stage view at any width — restate it here rather than duplicating
   the markup in a second, desktop-only card partial.
--------------------------------------------------------------------------- */
.hb-board { display: none; }
.hb-list { display: grid; gap: .55rem; }

@media (min-width: 1101px) {
  .hb-board {
    display: grid; gap: .8rem; align-items: start;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .hb-phone { display: none; }
  .hb-col { display: grid; gap: .55rem; align-content: start; min-width: 0; }
  .hb-col__head {
    margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .02em;
    text-transform: uppercase; color: var(--text3);
  }
  .hb-col__head .muted { font-weight: 400; }
  .hb-col__empty { font-size: 11.5px; margin: 0; }

  .hb-board .m-item, .hb-list--always .m-item {
    display: grid; gap: .35rem; padding: .8rem .85rem;
    border: 1px solid rgba(24, 33, 22, .07); border-radius: 14px;
    background: linear-gradient(180deg, rgba(248, 250, 247, .95), rgba(255, 255, 255, .98));
  }
  .hb-board .m-item__top, .hb-list--always .m-item__top {
    display: flex; justify-content: space-between; gap: .8rem; align-items: baseline;
  }
  .hb-board .m-item__name, .hb-list--always .m-item__name {
    font-weight: 650; font-size: 13.5px; min-width: 0; overflow-wrap: anywhere;
  }
  .hb-board .m-item__name .more, .hb-list--always .m-item__name .more {
    display: block; font-weight: 400; font-size: 11px; color: var(--text3);
  }
  .hb-board .m-item__hero, .hb-list--always .m-item__hero {
    font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .hb-board .m-item__meta, .hb-list--always .m-item__meta {
    display: flex; flex-wrap: wrap; gap: .2rem .9rem;
    color: var(--text3); font-size: 11.5px;
  }
  .hb-board .m-item__meta b, .hb-list--always .m-item__meta b {
    color: var(--text2); font-weight: 650; font-variant-numeric: tabular-nums;
  }
  .hb-board .m-item__actions, .hb-list--always .m-item__actions {
    display: flex; gap: .5rem; flex-wrap: wrap; padding-top: .15rem;
  }
  .hb-board .m-item--alert, .hb-list--always .m-item--alert {
    border-color: #ffd6d6; background: #fffafa;
  }
  .hb-board .m-item--alert .m-item__hero,
  .hb-list--always .m-item--alert .m-item__hero { color: var(--red); }
}

/* Pipeline card states.

   The shared alert style tints a card #fffafa against a #f8faf7 page — a
   difference of about one percent, which the owner could not see at all
   (2026-08-11: "the colors are too faded - can't see the red at all"). The
   states below are legible at arm's length on a phone in daylight, which is
   where this screen is actually read.

   Colour is rationed: a card gets at most one state, and a card with nothing
   wrong gets none. Red means act today. Amber means it is drifting. */
.hb-card { border-left: 3px solid transparent; }
.hb-card--late {
  border-left-color: var(--red);
  border-color: #f3b0b0; border-left-color: var(--red);
  background: linear-gradient(180deg, #fff2f2, #fffafa);
}
.hb-card--warm {
  border-color: #f0d29a; border-left-color: var(--amber);
  background: linear-gradient(180deg, #fff8ec, #fffdf8);
}

/* The state itself, as a badge rather than tinted body text. */
.hb-flag {
  font-weight: 700; font-size: 11.5px; white-space: nowrap;
  padding: .12rem .45rem; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.hb-flag--late { color: #fff; background: var(--red); }
.hb-flag--warm { color: #fff; background: var(--amber); }
.hb-late { color: var(--red); font-weight: 650; }

/* Priority stays quiet: it is the salesman's own hunch, not a fact, and it
   must never out-shout a hotel that has been waiting three weeks. */
.hb-stars { color: #c9a227; font-size: 13px; white-space: nowrap; }

/* Won, but not one rupee ever invoiced — the finding the board exists for. */
.hb-never { color: var(--red); font-weight: 650; }

/* Next-order rows: the section heads, and the fold-out for saying when. */
.hb-section {
  margin: 1.1rem 0 .4rem; font-size: 12px; font-weight: 700;
  letter-spacing: .02em; text-transform: uppercase; color: var(--text3);
}
.hb-said { color: var(--text2); font-weight: 650; }
.hb-set { display: inline-block; }
.hb-set summary { cursor: pointer; list-style: none; }
.hb-set summary::-webkit-details-marker { display: none; }
.hb-setform {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end;
  margin-top: .5rem; padding: .6rem; border-radius: 10px;
  background: var(--surface2);
}
.hb-setform label {
  display: grid; gap: .2rem; font-size: 11.5px; color: var(--text3);
}
.hb-setform input { min-width: 12rem; }

/* A fifth column appears when deals are claimed as won without an invoice. */
@media (min-width: 1101px) {
  .hb-board--five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* The customer's own page. */
.hb-profile {
  display: grid; gap: .8rem; align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.hb-panel { padding: .9rem 1rem; }
.hb-big { font-size: 20px; font-weight: 700; margin: .1rem 0 .2rem; }
.hb-person {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  padding: .3rem 0; font-size: 13px;
}
.hb-noteform { display: grid; gap: .5rem; margin-bottom: .9rem; }
.hb-noteform textarea { width: 100%; }
.hb-inline {
  display: flex; gap: .4rem; align-items: center;
  font-size: 12px; color: var(--text3);
}
.hb-note { padding: .6rem 0; border-top: 1px solid rgba(24, 33, 22, .07); }
.hb-note--important { border-left: 3px solid var(--red); padding-left: .6rem; }
.hb-note__meta {
  display: flex; gap: .5rem; align-items: center;
  font-size: 11.5px; color: var(--text3); margin-bottom: .2rem;
}
.hb-note__text { font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }

/* The stage bar. Buttons, not decoration: each one moves the hotel. */
.hb-stagebar {
  display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .6rem;
}
.hb-stage {
  border: 1px solid rgba(24, 33, 22, .12); background: var(--surface);
  border-radius: 999px; padding: .32rem .8rem; font-size: 12.5px;
  font-weight: 650; color: var(--text2); cursor: pointer;
}
.hb-stage:hover { border-color: var(--accent); color: var(--accent-dark); }
.hb-stage--now {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
/* Barred rather than hidden: the rule should be visible before it refuses. */
.hb-stage--barred {
  opacity: .45; cursor: not-allowed; text-decoration: line-through;
}
.hb-cold { margin-bottom: .8rem; }
/* What was quoted, entered alongside the stage it belongs to. */
.hb-quote {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: 11.5px; color: var(--text3); margin-left: .3rem;
}
.hb-quote input { width: 7rem; }

/* Adding a hotel sits on the board itself: a lead met this morning has to
   reach the book before the day ends, and a menu is one step too many. */
.hb-add { margin: 0 0 .8rem; }
.hb-setform--wide label { min-width: 13rem; }

/* A hotel nobody can ring. Stated, never coloured as urgency — it does not
   get worse with time, it just makes the card unworkable. */
.hb-nonumber { color: var(--text3); font-style: italic; }

/* Correcting a note, and the wordings it had before. */
.hb-note__edit { margin-top: .35rem; }
.hb-note__editbox { min-width: min(100%, 28rem); }
.hb-note__editbox textarea { width: 100%; }
.hb-note__was {
  margin: .35rem 0 0 .6rem; padding-left: .6rem;
  border-left: 2px solid rgba(24, 33, 22, .12);
  font-size: 12.5px; color: var(--text3);
}

/* Greetings. The buttons open WhatsApp or the phone; nothing sends itself. */
.hb-greet {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  margin-top: .4rem;
}
.hb-greet form { display: inline; }
/* A change reads quieter than a person's own words. */
.hb-note--change .hb-note__text { color: var(--text3); font-size: 12.5px; }
