:root {
  --wine: #6b1f3a;
  --wine-dark: #4a1528;
  --gold: #c89b3c;
  --bg: #f7f4f2;
  --card: #ffffff;
  --ink: #2a2226;
  --muted: #6b6065;        /* darkened for WCAG AA (~4.6:1 on --bg) */
  --line: #e7e0dd;
  --green: #2e8b57;
  --red: #c0392b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--link); text-decoration: none; }

/* Nav */
.navbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--wine); color: #fff; padding: .6rem 1rem;
  position: sticky; top: 0; z-index: 50;
}
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; display: inline-flex;
  align-items: center; gap: .5rem; }
.brand-logo { height: 30px; width: auto; vertical-align: middle; border-radius: 5px;
  background: #fff; padding: 3px 6px; }  /* white chip so transparent/dark logos read on the wine nav */
.nav-links { display: flex; align-items: center; gap: .25rem; margin-left: auto; flex-wrap: wrap; }
.nav-links a { color: #f3e6ea; padding: .4rem .7rem; border-radius: 8px; font-size: .95rem; }
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,.18); color: #fff; }
.nav-user { color: var(--gold); font-weight: 600; margin-left: .5rem; }
.nav-links a.logout { color: #f3c6cf; }
/* Register: always visible (sits outside .nav-links so the hamburger never hides it),
   bold + inverted pill so cashiers can hit it on any device without thinking. */
.nav-register { background: #fff; color: var(--wine); font-weight: 800; font-size: 1rem;
  padding: .45rem .95rem; border-radius: 8px; text-decoration: none;
  box-shadow: 0 1px 0 rgba(0,0,0,.08); white-space: nowrap; margin-left: .3rem; }
.nav-register:hover { background: #faf6f7; color: var(--wine-dark); }
.nav-register.active { box-shadow: 0 0 0 2px var(--gold); }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; margin-left: auto; cursor: pointer; }
.user-menu { position: relative; margin-left: .5rem; }
.user-trigger { background: none; border: none; cursor: pointer; font: inherit;
  color: var(--gold); font-weight: 600; padding: .4rem .7rem; border-radius: 8px; }
.user-trigger:hover, .user-trigger.active { background: rgba(255,255,255,.18); }
.user-trigger .caret { font-size: .8em; opacity: .8; }
.user-dropdown { position: absolute; right: 0; top: 100%; min-width: 190px; margin-top: .3rem;
  background: var(--wine-dark); border: 1px solid rgba(255,255,255,.15); border-radius: 10px;
  padding: .35rem; display: none; flex-direction: column; z-index: 60;
  box-shadow: 0 14px 30px -12px rgba(0,0,0,.5); }
.user-dropdown.open { display: flex; }
.user-dropdown a { color: #f3e6ea; padding: .5rem .7rem; border-radius: 8px; font-size: .95rem; }
.user-dropdown a:hover, .user-dropdown a.active { background: rgba(255,255,255,.18); color: #fff; }
.user-dropdown a.sa { color: var(--gold); }
.user-dropdown a.logout { color: #f3c6cf; }
.menu-divider { height: 1px; background: rgba(255,255,255,.15); margin: .3rem 0; }
.loc-switch { margin-left: .5rem; }
.loc-switch select { background: var(--wine-dark); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px; padding: .35rem .5rem; font-size: .9rem; }
.loc-label { color: #f3e6ea; margin-left: .5rem; font-size: .9rem; }

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 1.25rem; }
.full { max-width: 1400px; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.25rem 0 .6rem; }

/* Cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem; }
.grid { display: grid; gap: 1rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); }
/* Instructional helper text — a readable brand-tinted brown (meets AA on --bg). */
.hint { color: #7a6630; font-size: .85rem; }
.right { text-align: right; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--link); color: #fff; border: none; border-radius: 10px;
  padding: .6rem 1rem; font-size: 1rem; cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--link-dark); }
.btn-lg { padding: .9rem 1.4rem; font-size: 1.1rem; width: 100%; }
.btn-ghost { background: #fff; color: var(--wine); border: 1px solid var(--line); }
.btn-ghost:hover { background: #faf6f7; }
.btn-gold { background: var(--gold); color: #3a2c10; }
.btn-danger { background: var(--red); }
.btn-sm { padding: .35rem .6rem; font-size: .85rem; border-radius: 8px; }

/* Forms */
label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin: .6rem 0 .2rem; }
input, select, textarea { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line);
  border-radius: 10px; font-size: 1rem; font-family: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
textarea { min-height: 80px; }
.field-inline { display: flex; gap: .5rem; align-items: flex-end; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }

/* Product images & color dot */
.product-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #faf6f7; }
.product-thumb.placeholder { font-size: 1.1rem; }
.product-photo { width: 120px; height: 120px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); }
.color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  margin-right: .4rem; vertical-align: middle; }
.note-preview { display: inline-block; max-width: 340px; color: var(--muted);
  font-size: .8rem; font-style: italic; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; vertical-align: bottom; cursor: help; }

/* Inventory group section headers */
.group-header td { background: var(--wine); color: #fff; font-weight: 700;
  font-size: .95rem; letter-spacing: .02em; padding: .5rem .7rem;
  border-radius: 6px; }
.group-header td .muted { color: #f3d9e1; font-weight: 500; }

/* Clickable table rows */
tr.clickable-row { cursor: pointer; }
tr.clickable-row:hover td { background: #faf6f7; }

/* Sortable headers & pager */
.sort-link { color: var(--muted); display: inline-flex; align-items: center; gap: .2rem; }
.sort-link:hover { color: var(--wine); }
.sort-link.active { color: var(--wine); }
.sort-arrow { font-size: .7rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem;
  margin-top: 1rem; }

/* CSS bar chart for reports */
.barchart { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .35rem; }
.bar-row { display: grid; grid-template-columns: 180px 1fr 90px; align-items: center; gap: .6rem; }
.bar-label { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: var(--bg); border-radius: 6px; height: 18px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--wine); border-radius: 6px; min-width: 2px; }
.bar-val { text-align: right; font-size: .85rem; font-weight: 600; }
@media (max-width: 640px) { .bar-row { grid-template-columns: 110px 1fr 70px; } }

/* Badges */
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .75rem;
  font-weight: 600; background: #efe9e6; color: var(--muted); }
.badge.green { background: #e3f3ea; color: var(--green); }
.badge.red { background: #fbe6e3; color: var(--red); }
.badge.gold { background: #f7eed6; color: #8a6d1f; }

/* Flash */
.flash-container { position: fixed; top: 70px; right: 1rem; z-index: 100; display: flex; flex-direction: column; gap: .5rem; max-width: 340px; }
.flash { background: #fff; border-left: 4px solid var(--muted); padding: .7rem 1rem; border-radius: 8px;
  box-shadow: var(--shadow); display: flex; justify-content: space-between; gap: 1rem; }
.flash button { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--muted); }
.flash-success { border-left-color: var(--green); }
.flash-error { border-left-color: var(--red); }

/* ---- Register (POS) two-pane layout ---- */
.pos { display: grid; grid-template-columns: 1fr 380px; gap: 1rem; align-items: start; }
/* Register group tabs */
.reg-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem;
  border-bottom: 1px solid var(--line); padding-bottom: .6rem; }
.reg-tab { background: #fff; border: 1px solid var(--line); color: var(--ink);
  padding: .5rem .9rem; border-radius: 999px; cursor: pointer; font-size: .95rem;
  font-weight: 600; }
.reg-tab:hover { border-color: var(--gold); }
.reg-tab.active { background: var(--wine); color: #fff; border-color: var(--wine); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.product-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem; text-align: left; cursor: pointer; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .3rem; min-height: 96px; }
.product-tile:hover { border-color: var(--gold); }
.product-tile .name { font-weight: 600; font-size: .95rem; }
.product-tile .price { color: var(--wine); font-weight: 700; }
.product-tile .meta { font-size: .75rem; color: var(--muted); }
.product-tile.oos { opacity: .55; }

/* Product color picker (edit form) */
.color-picker { display: flex; flex-wrap: wrap; gap: .5rem; }
.color-picker .swatch { position: relative; width: 34px; height: 34px; border-radius: 8px;
  cursor: pointer; border: 2px solid var(--line); display: inline-flex;
  align-items: center; justify-content: center; margin: 0; }
.color-picker .swatch.none { background: #fff;
  background-image: linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%),
    linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%);
  background-size: 12px 12px; background-position: 0 0, 6px 6px; }
.color-picker .swatch input { position: absolute; opacity: 0; width: 0; height: 0; }
.color-picker .swatch .tick { color: #fff; font-weight: 800; opacity: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.color-picker .swatch.none .tick { color: var(--ink); text-shadow: none; }
.color-picker .swatch:has(input:checked) { border-color: var(--ink); transform: scale(1.08); }
.color-picker .swatch:has(input:checked) .tick { opacity: 1; }
.cart { position: sticky; top: 80px; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: .3rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.cart-line .line-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; }
.cart-line .line-remove { background: var(--wine); color: #fff; border: none;
  width: 22px; height: 22px; border-radius: 50%; font-size: 1rem; line-height: 1;
  cursor: pointer; font-weight: 700; flex: 0 0 auto; align-self: center; padding: 0; }
.cart-line .line-remove:hover { background: var(--wine-dark); }
.cart-line .qty { display: flex; gap: .3rem; align-items: center; }
.cart-line input[type=number] { width: 56px; padding: .3rem; }
/* Tip preset buttons */
.tip-presets { display: flex; flex-wrap: wrap; gap: .35rem; }
.tip-btn { flex: 1 1 auto; min-width: 52px; background: #fff; border: 1px solid var(--line);
  color: var(--ink); padding: .5rem .4rem; border-radius: 10px; cursor: pointer;
  font-weight: 600; font-size: .95rem; }
.tip-btn:hover { border-color: var(--gold); }
.tip-btn.active { background: var(--wine); color: #fff; border-color: var(--wine); }

.totals div { display: flex; justify-content: space-between; padding: .2rem 0; }
.totals .grand { font-size: 1.3rem; font-weight: 800; border-top: 2px solid var(--ink); margin-top: .4rem; padding-top: .5rem; }

/* Login PIN pad */
.login-wrap { max-width: 420px; margin: 8vh auto; position: relative; z-index: 1;
  background: rgba(255,255,255,.86); backdrop-filter: blur(3px); }
.login-logo { max-height: 90px; max-width: 240px; width: auto; object-fit: contain; }
/* Page background layer: a fixed, full-page image behind all content, shown on
   the winery-selected pages. "watermark" = faint, centered, contained; "cover" =
   full-bleed photo with a page-color scrim for legibility. Sits above the body
   canvas (z-index 0); main content is lifted above it (z-index 1). The navbar
   (z-index 50) and flash-container (z-index 100) already sit above it. */
.page-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-repeat: no-repeat; background-position: center; }
.page-bg-watermark { background-size: min(92vw, 900px); }
.page-bg-cover { background-size: cover; }
.page-bg-scrim { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: var(--bg); }
main { position: relative; z-index: 1; }
/* On-background text colors. Body text on the page background reads in ink (the
   gold accent failed WCAG AA on the light canvas); headings keep the brand title
   color, which is a dark brand shade and stays readable. */
main { color: var(--ink); }
main h1, main h2, main h3 { color: var(--title); }
.card, .card h1, .card h2, .card h3 { color: var(--ink); }
td { color: var(--ink); }   /* table data stays readable even in a bare (non-card) table */
/* On-background secondary text — field labels and muted captions that sit directly
   on the page background (e.g. report From/To/Location, the date-range line) read in
   the darkened muted grey, same as inside a card. */
main label, main .muted { color: var(--muted); }
.card label, .card .muted { color: var(--muted); }
td.muted, th.muted { color: var(--muted); }  /* muted cells inside any table stay grey, never accent */
/* Top-of-page intro paragraphs (a .hint right after the page title or title row) read
   at body size; the small inline .hint captions under controls stay compact. */
h1 + .hint, .row.spread + .hint { font-size: 1rem; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: 1rem; }
.pinpad button { padding: 1.1rem; font-size: 1.4rem; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; }
.pinpad button:active { background: var(--bg); }
.pin-display { font-size: 2rem; letter-spacing: .5rem; text-align: center; min-height: 2.4rem; }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .head { text-align: center; font-size: .75rem; color: var(--muted); font-weight: 700; padding: .3rem; }
.cal-cell { background: var(--card); border: 1px solid var(--line); border-radius: 8px; min-height: 84px;
  padding: .4rem; font-size: .8rem; display: block; color: var(--ink); cursor: pointer; }
.cal-cell:hover { border-color: var(--gold); background: #fffdf7; }
.cal-cell.dim { opacity: .4; }
.cal-cell.today { border-color: var(--gold); border-width: 2px; }
.cal-cell .dnum { font-weight: 700; }
.cal-cell .count { display: inline-block; margin-top: .3rem; }
.schedule-item { border-left: 4px solid var(--wine); padding: .6rem .8rem; margin-bottom: .6rem;
  background: var(--card); border-radius: 8px; box-shadow: var(--shadow); }
.schedule-item.tour { border-left-color: var(--gold); }
.time-col { font-weight: 700; color: var(--wine); }

/* Employee schedule weekly grid */
.sched-grid { min-width: 820px; }
.sched-grid th, .sched-grid td { border: 1px solid var(--line); vertical-align: top;
  padding: .4rem; text-align: left; }
.sched-grid th { text-align: center; }
.sched-grid th.today, .sched-grid td.today { background: #fbf6e9; }
.sched-grid td.emp { font-weight: 600; white-space: nowrap; background: #faf6f7; }
.shift-chip { display: block; background: var(--wine); color: #fff; border-radius: 6px;
  padding: .25rem .4rem; font-size: .8rem; margin-bottom: .3rem; line-height: 1.3; }
.shift-chip:hover { background: var(--wine-dark); color: #fff; }
.shift-chip .role { display: block; font-size: .7rem; opacity: .85; }
.shift-add { display: inline-block; color: var(--muted); border: 1px dashed var(--line);
  border-radius: 6px; padding: 0 .5rem; font-weight: 700; }
.shift-add:hover { color: var(--wine); border-color: var(--gold); }

/* Tasting sheet builder */
.sheet-builder { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .5rem; max-height: 70vh; overflow-y: auto; }
.palette-card { display: flex; flex-direction: column; gap: .15rem; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .6rem;
  cursor: pointer; font-size: .85rem; }
.palette-card:hover { border-color: var(--gold); }
.palette-card .pc-name { font-weight: 600; }
.palette-card .pc-thumb { width: 100%; height: 70px; object-fit: contain; }
.palette-card .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.board { min-height: 200px; border: 2px dashed var(--line); border-radius: 12px;
  padding: .6rem; display: flex; flex-direction: column; gap: .5rem; background: var(--card); }
.board-card { display: flex; align-items: center; gap: .6rem; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; cursor: grab; }
.board-card.dragging { opacity: .4; }
.board-card .num { background: var(--wine); color: #fff; width: 26px; height: 26px;
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; flex: 0 0 auto; }
.board-card .bc-name { flex: 1; font-weight: 600; }
.board-card .bc-actions { display: flex; gap: .2rem; }
.board-card .bc-actions button { border: 1px solid var(--line); background: #fff;
  border-radius: 6px; width: 28px; height: 28px; cursor: pointer; }
.board-empty { text-align: center; padding: 1.5rem; }
@media (max-width: 760px) { .sheet-builder { grid-template-columns: 1fr; } }

/* Printable tasting sheet */
.tasting-print { max-width: 1000px; margin: 0 auto; }
.ts-header { text-align: center; margin-bottom: 1.2rem; }
.ts-header h1 { margin: .3rem 0; }
.ts-logo { max-height: 64px; }
.ts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.ts-card { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; position: relative;
  border-top: 4px solid var(--wine); }
.ts-num { position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  background: var(--wine); color: #fff; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; }
.ts-photo { display: block; width: 100%; height: 150px; object-fit: contain;
  margin-top: .8rem; }
.ts-photo.placeholder { display: flex; align-items: center; justify-content: center;
  font-size: 3rem; background: #faf6f7; border-radius: 8px; }
.ts-name { font-weight: 700; font-size: 1.05rem; margin-top: .5rem; }
.ts-meta { color: var(--muted); font-size: .85rem; margin: .2rem 0 .5rem; }
.ts-notes { font-size: .9rem; line-height: 1.4; }

/* Receipt */
.receipt { max-width: 420px; margin: 0 auto; }
.receipt .line { display: flex; justify-content: space-between; padding: .2rem 0; }

/* Register product search box */
.reg-search { max-width: 360px; margin: 0 0 .9rem; }
.reg-search-empty { margin: 0 0 .9rem; }

/* Comp ("on the house") controls + state */
.comp-box { margin-top: .3rem; }
.comp-box > summary { display: inline-block; list-style: none; cursor: pointer; }
.comp-box > summary::-webkit-details-marker { display: none; }
.comp-form { display: flex; flex-direction: column; gap: .35rem; margin-top: .4rem; max-width: 260px; }
.cart-line.comped { opacity: .9; }

/* Customer type-to-search picker (register) */
.cust-picker { position: relative; }
.cust-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; margin-top: .25rem; }
.cust-opt { display: block; width: 100%; text-align: left; background: none; border: none;
  border-bottom: 1px solid var(--line); padding: .55rem .7rem; cursor: pointer;
  font-size: .95rem; color: var(--ink); }
.cust-opt:last-child { border-bottom: none; }
.cust-opt:hover, .cust-opt:focus { background: #faf6f7; }

/* Keep the register two-pane until a tablet goes portrait (~1024px); below that
   the cart stacks under the products, so a sticky bar surfaces the running total
   + a one-tap path to checkout instead of making the cashier scroll past every
   product to find the Charge button. */
@media (max-width: 1024px) {
  .pos { grid-template-columns: 1fr; }
  .cart { position: static; }
}
.cart-bar { display: none; }
@media (max-width: 1024px) {
  .cart-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: var(--wine); color: #fff; padding: .85rem 1.1rem; font-weight: 700;
    box-shadow: 0 -6px 20px -8px rgba(0,0,0,.45); text-decoration: none;
  }
  .cart-bar:hover { background: var(--wine-dark); }
  .cart-bar-cta { white-space: nowrap; }
  body:has(.cart-bar) .help-fab { bottom: 5.2rem; }   /* lift help above the bar */
  body:has(.cart-bar) main { padding-bottom: 6.5rem; } /* room so content isn't hidden */
}

@media (max-width: 880px) {
  .pos { grid-template-columns: 1fr; }
  .cart { position: static; }
  .nav-toggle { display: block; }
  .nav-links { display: none; width: 100%; flex-direction: column; align-items: stretch; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .6rem; }
  .nav-user { margin: .3rem 0; }
  .user-menu { width: 100%; margin-left: 0; }
  .user-trigger { width: 100%; text-align: left; }
  .user-trigger .caret { display: none; }
  .user-dropdown { position: static; display: flex; min-width: 0; margin: 0; padding: 0 0 0 .5rem;
    background: transparent; border: none; box-shadow: none; }
}
@media print {
  .navbar, .flash-container, .no-print { display: none !important; }

  /* Schedule grid: print in landscape, legible regardless of background
     printing (chips become dark-on-white so white text never disappears). */
  @page { size: landscape; margin: 1cm; }
  .card { box-shadow: none; border-color: #999; }
  .sched-grid { min-width: 0; font-size: 10px; width: 100%; }
  .sched-grid th, .sched-grid td { border-color: #999; }
  .sched-grid th.today, .sched-grid td.today, .sched-grid td.emp { background: #fff !important; }
  .shift-add { display: none !important; }
  .shift-chip { background: #fff !important; color: #000 !important;
    border: 1px solid #666; }
  .shift-chip .role { opacity: 1; }

  /* Tasting sheet: keep number badges legible without background printing. */
  .ts-card { break-inside: avoid; border-color: #666; }
  .ts-num { background: #fff !important; color: #000 !important; border: 2px solid #000; }
  .ts-card { border-top-color: #000; }
}

/* ---- Public booking hero (customer-facing branded header) ---- */
.public-hero {
  position: relative; overflow: hidden; text-align: center;
  /* Dark scrim over the brand color so white text stays legible even when the
     imported primary is very light (e.g. a white-dominant site). */
  background: linear-gradient(rgba(0,0,0,.30), rgba(0,0,0,.46)), var(--wine);
  color: #fff;
  padding: 2.2rem 1rem; border-radius: 14px; margin-bottom: 1.5rem;
}
.public-hero-inner { position: relative; z-index: 1; }
.public-hero-logo {
  max-height: 64px; max-width: 220px; object-fit: contain;
  background: #fff; padding: 6px 10px; border-radius: 10px; margin-bottom: .6rem;
}
.public-hero-name { margin: 0; color: #fff; font-size: clamp(1.6rem, 4vw, 2.4rem); }
.public-hero-tagline { margin: .35rem 0 0; opacity: .9; }

/* ---------- context-sensitive help ---------- */
.help-fab{position:fixed; right:1.1rem; bottom:1.1rem; z-index:60; width:48px; height:48px;
  border-radius:50%; border:none; cursor:pointer; background:var(--wine); color:#fff;
  font-size:1.5rem; font-weight:700; line-height:1; box-shadow:0 10px 24px -10px rgba(0,0,0,.5);
  transition:transform .15s ease, box-shadow .15s ease}
.help-fab:hover{transform:translateY(-2px); box-shadow:0 14px 28px -10px rgba(0,0,0,.6)}
.help-fab:focus-visible{outline:3px solid var(--gold); outline-offset:3px}
.help-backdrop{position:fixed; inset:0; z-index:60; background:rgba(0,0,0,.28);
  opacity:0; visibility:hidden; transition:opacity .2s ease}
.help-backdrop.open{opacity:1; visibility:visible}
.help-panel{position:fixed; top:0; right:0; z-index:61; height:100%; width:min(380px,92vw);
  background:#fff; border-left:1px solid var(--line); box-shadow:-18px 0 40px -24px rgba(0,0,0,.45);
  padding:1.3rem 1.4rem; overflow-y:auto; transform:translateX(100%);
  visibility:hidden; transition:transform .22s ease, visibility .22s ease}
.help-panel.open{transform:translateX(0); visibility:visible}
.help-panel-head{display:flex; align-items:center; justify-content:space-between; gap:1rem}
.help-panel-head h2{margin:0; font-size:1.25rem}
.help-close{background:none; border:none; font-size:1.5rem; line-height:1; cursor:pointer;
  color:var(--muted); padding:.1rem .4rem}
.help-close:hover{color:var(--ink)}
.help-intro{color:var(--muted); margin:.5rem 0 .9rem}
.help-items{margin:0 0 1.1rem; padding-left:1.1rem; display:flex; flex-direction:column; gap:.5rem}
.help-items li{line-height:1.45}
.help-foot{font-size:.88rem}
@media print{ .help-fab, .help-backdrop, .help-panel{display:none !important} }
@media (prefers-reduced-motion: reduce){
  .help-panel, .help-backdrop, .help-fab{transition:none}
}

/* --- DTC shipping labels (Avery 5160: 3 cols x 10 rows, US Letter) --- */
.label-sheet { display: grid; grid-template-columns: repeat(3, 2.625in); gap: 0 0.125in; }
.label-cell {
  width: 2.625in; height: 1in; box-sizing: border-box; padding: 0.12in 0.18in;
  overflow: hidden; page-break-inside: avoid; font-size: 8.5pt; line-height: 1.15;
}
.label-return { font-size: 6pt; color: #555; margin-bottom: 1px; }
.label-sig { font-size: 6.5pt; font-weight: 700; color: #000; }
.label-to { margin-top: 1px; }

/* Admin hub section headings */
.admin-section { margin: 1.7rem 0 .6rem; font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* Dashboard KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1rem 0 1.5rem; }
@media (max-width: 720px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }
.card.kpi { text-align: left; }
.kpi-title { color: var(--muted); font-size: .8rem; font-weight: 600; }
.kpi-num { font-size: 1.6rem; font-weight: 700; color: var(--ink); margin: .15rem 0; }
.kpi-delta { font-size: .8rem; font-weight: 600; }
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--red); }

/* On-premise tabs panel */
.tabs-panel { margin: .2rem 0 .6rem; }
.tabs-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.tab-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: .3rem .7rem; font-size: .85rem; cursor: pointer; color: var(--ink); }
.tab-chip.active { background: var(--wine); color: #fff; border-color: var(--wine); }
.tab-chip.active .muted { color: #f3d9e1; }
.tab-chip.new { border-style: dashed; color: var(--wine); }
.tabs-new { display: flex; gap: .4rem; margin-top: .4rem; }
.tabs-new input { flex: 1; padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 8px; }
.tabs-actions { margin-top: .4rem; }
.tabs-actions select { padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 8px; }

/* Tab close (✕) — inset in the chip's top-right corner */
.tab-chip-wrap { position: relative; display: inline-block; }
.tab-chip-wrap .tab-chip-main { padding-right: 1.6rem; }   /* room for the ✕ */
.tab-close-form { position: absolute; top: 0; right: 0; bottom: 0; margin: 0;
  display: flex; align-items: center; }
.tab-close { display: inline-grid; place-items: center; width: 18px; height: 18px;
  margin-right: .3rem; padding: 0; border: 0; border-radius: 50%; background: transparent;
  color: var(--muted); line-height: 0; cursor: pointer; }
.tab-close:hover { color: #fff; background: var(--red); }
/* keep the ✕ legible on the active (wine) chip */
.tab-chip-wrap:has(.tab-chip-main.active) .tab-close { color: #f3d9e1; }
.tab-chip-wrap:has(.tab-chip-main.active) .tab-close:hover { color: #fff; }

/* "Needs attention" indicator — nav badge + dashboard panel */
.attn-badge {
  display: inline-block;
  min-width: 1.25rem;
  padding: 0 .35rem;
  margin-left: .15rem;
  border-radius: 999px;
  background: #c0392b;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
  vertical-align: middle;
}
.attn-link { font-weight: 600; }
.attn-rows { display: flex; flex-direction: column; gap: .4rem; }
.attn-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .7rem;
  border: 1px solid var(--line);
  border-left: 3px solid #c0392b;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}
.attn-row:hover { background: var(--bg); }
.attn-row-soft { border-left-color: #b9770e; }
.attn-row-count {
  min-width: 1.6rem;
  padding: 0 .4rem;
  border-radius: 6px;
  background: var(--bg);
  font-weight: 700;
  text-align: center;
}

/* UX audit fixes */
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
/* Out-of-stock product tiles that can't be sold (block policy) read as disabled. */
.product-tile:disabled { cursor: not-allowed; }

/* Tag filter chips (CRM) — friendlier than a native multi-select */
.tag-filter { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.tag-chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line);
  background: #fff; border-radius: 999px; padding: .3rem .7rem; font-size: .85rem;
  font-weight: 600; cursor: pointer; color: var(--ink); }
.tag-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.tag-chip:hover { border-color: var(--gold); }
.tag-chip:has(input:checked) { background: var(--wine); color: #fff; border-color: var(--wine); }
/* Labeled register line-item controls (Qty / Disc %) */
.qty-field { display: inline-flex; flex-direction: column; gap: 1px; font-size: .62rem;
  font-weight: 600; letter-spacing: .03em; color: var(--muted); text-transform: uppercase; }
.qty-field input { width: 64px; }
/* Checkout order summary (read-only line items above the totals) */
.co-items { margin: .2rem 0 .9rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.co-items .line { display: flex; justify-content: space-between; gap: 1rem; padding: .15rem 0;
  font-size: .9rem; color: var(--muted); }
/* Keep the floating help button (fixed bottom-right) from covering content or
   the primary action button at the bottom of the page (all viewport sizes). */
main { padding-bottom: 5.5rem; }

/* ---- Accessibility & touch polish ---- */
/* Visible keyboard focus on interactive controls (offset so it shows even on
   wine/gold-filled active states). */
.btn:focus-visible, .btn-ghost:focus-visible, .reg-tab:focus-visible,
.tip-btn:focus-visible, .tab-chip:focus-visible, .product-tile:focus-visible,
.pinpad button:focus-visible, .nav-register:focus-visible, .user-trigger:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px;
}
/* Comfortable touch targets on touch devices. */
@media (pointer: coarse) {
  .btn-sm { min-height: 40px; }
  .cart-line .line-remove { width: 32px; height: 32px; }
  .tab-close { width: 26px; height: 26px; }
  .reg-tab, .tip-btn, .tab-chip { min-height: 40px; }
}
/* Flash toasts: on phones, dock to the bottom so they never overlap the wrapped
   navbar/hamburger at the top. */
@media (max-width: 640px) {
  .flash-container { top: auto; bottom: .75rem; left: .5rem; right: .5rem; max-width: none; }
}

/* Email composer: insert/format toolbar + the typography settings grid. */
.email-toolbar { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center;
  margin: .2rem 0 .35rem; }
.email-toolbar .btn-sm { padding: .25rem .5rem; }
.email-toolbar-sep { width: 1px; align-self: stretch; background: var(--line, #e7e0dd);
  margin: 0 .25rem; }
.email-style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .8rem; }
.email-style-grid label { display: flex; flex-direction: column; font-size: .85rem; gap: .15rem; }
.email-style-grid input[type=color] { width: 100%; height: 34px; padding: 2px; }
@media (max-width: 560px) { .email-style-grid { grid-template-columns: 1fr; } }
