/* Vesopa Back Office — dark rail, light canvas, generous whitespace. */

:root {
  --rail: #14121a;
  --rail-text: #a49fae;
  --rail-active: #ffffff;
  --bg: #f5f4f7;
  --card: #ffffff;
  --line: #e6e3ea;
  --text: #17141c;
  --muted: #78717f;

  /* Taken from the Vesopa mark: the magenta/purple "V" on black. */
  --brand: #a4308f;
  --brand-soft: #f4e6f2;
  --blue: #4b8ef5;
  --amber: #f5a524;
  --red: #e5484d;
  --green: #30a46c;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 18, 26, .04), 0 4px 16px rgba(20, 18, 26, .04);
}

* { box-sizing: border-box; }

/* An explicit `display` on an element beats the `hidden` attribute, so the
   login screen stayed on top of the app forever. This puts hidden back in
   charge. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 24px; }
h3 { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.error { color: var(--red); font-size: 13px; min-height: 18px; margin: 10px 0 0; }

/* ---------- Login ----------
   Split screen: the form on the left, the product cover filling the right,
   as in the original back office. */

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 44%) 1fr;
  background: #fff;
}

.login-side {
  display: grid;
  place-items: center;
  padding: 40px;
}

.login-cover {
  background-image: url('/assets/vesopa_authentication.png');
  background-position: center right;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Below a tablet there is no room for the cover; the form takes the screen. */
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-cover { display: none; }
}

.login-card { width: 100%; max-width: 380px; }

.login-card h1 {
  font-size: 25px;
  margin-bottom: 4px;
}
.login-sub { color: var(--muted); margin: 0 0 26px; font-size: 14.5px; }

.login-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-size: 13.5px;
}
.login-row a { color: var(--brand); text-decoration: none; }
.login-row a:hover { text-decoration: underline; }

.check { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.check input { width: auto; margin: 0; }

.login-foot {
  margin-top: 24px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}
.login-foot a { color: var(--brand); font-weight: 600; text-decoration: none; }
.logo { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.logo span { color: var(--brand); }

label {
  display: block;
  margin-top: 18px;
  font-size: 13px;
  font-weight: 550;
  color: var(--muted);
}
input, select {
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 15px;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 145, 132, .12);
}

.btn {
  border: 0;
  border-radius: 9px;
  padding: 10px 18px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  background: var(--line);
  color: var(--text);
}
.btn.primary { background: var(--brand); color: #fff; }
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.block { width: 100%; margin-top: 24px; padding: 12px; }
.btn:hover { filter: brightness(1.06); }
.btn.small { padding: 6px 12px; font-size: 13px; }

/* ---------- Shell ---------- */

#app { display: flex; min-height: 100vh; }

.rail {
  width: 236px;
  flex: none;
  background: var(--rail);
  color: var(--rail-text);
  display: flex;
  flex-direction: column;
  padding: 22px 0;
}
.rail .logo { padding: 0 22px 22px; color: #fff; font-size: 20px; }

.rail nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.nav-group {
  padding: 18px 10px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #5f596b;
}
.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--rail-text);
  font-size: 14.5px;
  cursor: pointer;
}
.nav:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav.active { background: var(--brand); color: #fff; font-weight: 600; }

.rail-foot {
  margin-top: auto;
  padding: 18px 22px 0;
  border-top: 1px solid rgba(255, 255, 255, .07);
  display: flex;
  align-items: center;
  gap: 8px;
}
.link {
  border: 0;
  background: none;
  color: var(--rail-text);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  text-decoration: underline;
  margin-left: auto;
}

/* The operator must be able to tell at a glance whether the figures in front
   of them are live or stale. */
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.online { background: #35d07f; box-shadow: 0 0 0 3px rgba(53, 208, 127, .18); }
.dot.offline { background: #6b6478; }

main { flex: 1; padding: 30px 36px 60px; overflow: auto; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

/* ---------- Cards & stats ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 550; }
.stat .value { font-size: 27px; font-weight: 700; letter-spacing: -.02em; }
.stat .accent { height: 3px; width: 34px; border-radius: 3px; background: var(--brand); }
.stat.blue .accent { background: var(--blue); }
.stat.amber .accent { background: var(--amber); }
.stat.red .accent { background: var(--red); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.panel { padding: 20px; }
.panel h3 { margin-bottom: 14px; }

/* ---------- Tables ---------- */

table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 650;
  background: #fbfafc;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfafc; }
td.right, th.right { text-align: right; }
.card > table { border-radius: var(--radius); overflow: hidden; }

/* A row that just arrived over the socket. */
@keyframes flash { from { background: #fff4d6; } to { background: transparent; } }
tr.new { animation: flash 1.6s ease-out; }

/* ---------- Bars (a chart without a chart library) ---------- */

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 76px; align-items: center; gap: 12px; }
.bar-track { height: 9px; background: #eeecf1; border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; background: var(--brand); }
.bar-row .amount { text-align: right; font-variant-numeric: tabular-nums; font-size: 13.5px; }

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge.active { background: #e3f6ec; color: var(--green); }
.badge.paused { background: #fdeceb; color: var(--red); }
.badge.archived { background: #eeecf1; color: var(--muted); }
.badge.due { background: #fff3e0; color: #b06d00; }
.badge.paid { background: #e3f6ec; color: var(--green); }
.badge.overdue { background: #fdeceb; color: var(--red); }

/* ---------- Modal ---------- */

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 26, .45);
  display: grid;
  place-items: center;
  z-index: 50;
}
.modal {
  width: 440px;
  max-height: 86vh;
  overflow: auto;
  background: var(--card);
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .3);
}
.modal h3 { margin-bottom: 6px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.empty { padding: 40px; text-align: center; color: var(--muted); }

.thumb {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  object-fit: cover;
  vertical-align: -8px;
  margin-right: 6px;
}
.emoji { font-size: 20px; vertical-align: -3px; margin-right: 4px; }

.img-field { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.img-preview {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
  border: 1px solid rgba(0, 0, 0, .12);
}

/* ---------- Brand ---------- */

.brand-logo { height: 30px; display: block; }
.login-card .brand-logo { height: 42px; margin: 0 auto 6px; }

/* ---------- Floor designer ---------- */

.designer {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 20px;
  align-items: start;
}

/* The canvas is a grid so tables land on whole units — a free-pixel drag looks
   tidy to whoever drew it and ragged to everyone else. */
#canvas {
  position: relative;
  height: 620px;
  background-color: #fbfafc;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 40px 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.tbl {
  position: absolute;
  display: grid;
  place-items: center;
  background: #fff;
  border: 2px solid var(--brand);
  color: var(--text);
  border-radius: 8px;
  cursor: grab;
  user-select: none;
  box-shadow: var(--shadow);
  transition: box-shadow .12s;
}
.tbl:hover { box-shadow: 0 4px 14px rgba(164, 48, 143, .22); }
.tbl.dragging { cursor: grabbing; opacity: .85; z-index: 10; }
.tbl.circle { border-radius: 50%; }
.tbl.selected { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(245, 165, 36, .25); }
.tbl .num { font-weight: 700; font-size: 17px; }
.tbl .seats { font-size: 11px; color: var(--muted); }

.room-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.room-tab {
  padding: 7px 14px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13.5px;
}
.room-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.inspector { padding: 18px; }
.inspector h3 { margin-bottom: 12px; }
.inspector label { margin-top: 12px; }
.hint {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--brand-soft);
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 14px;
}
.unsaved { color: var(--amber); font-weight: 600; }

/* ---------- Fixed, collapsible sidebar ---------- */

/* The rail stays put while the page scrolls, and scrolls internally when the
   nav is taller than the viewport, so long menus never push the sign-out
   button off-screen. */
.rail {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow: hidden;
}
.rail nav {
  flex: 1;
  overflow-y: auto;
  /* A thin scrollbar that does not draw attention on the dark rail. */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
}
.rail nav::-webkit-scrollbar { width: 6px; }
.rail nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .18);
  border-radius: 3px;
}

/* A nav group heading is now a button that folds its section away. The caret
   rotates to show state; a collapsed group hides every .nav until the next
   heading. */
.nav-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  background: none;
  cursor: pointer;
  user-select: none;
}
.nav-group .caret {
  transition: transform .15s ease;
  font-size: 9px;
  opacity: .7;
}
.nav-group.collapsed .caret { transform: rotate(-90deg); }
.nav.hidden-by-group { display: none; }

/* ---------- Drag-to-reorder rows ---------- */

.drag-col { width: 34px; }
.drag-cell { width: 34px; text-align: center; color: var(--muted); }
.drag-handle {
  cursor: grab;
  user-select: none;
  letter-spacing: -2px;
  font-size: 15px;
  line-height: 1;
  opacity: .55;
}
.drag-handle:hover { opacity: 1; }
tr.dragging { opacity: .5; background: var(--brand-soft); }
tr[draggable="true"] { cursor: grabbing; }
.nowrap { white-space: nowrap; }

/* ---------- Checkbox field in the modal ---------- */

.check-field { display: inline-flex; align-items: center; }
.check-field input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* ---------- Receipt / detail viewer ---------- */

.receipt-view {
  font-variant-numeric: tabular-nums;
  max-width: 340px;
  margin: 0 auto;
}
.receipt-view h3 { text-align: center; margin-bottom: 4px; }
.receipt-view .r-sub { text-align: center; color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.receipt-view table { margin: 8px 0; }
.receipt-view td, .receipt-view th { padding: 5px 4px; border: 0; font-size: 13px; }
.receipt-view .r-tot td { border-top: 1px dashed var(--line); font-weight: 700; padding-top: 8px; }
.receipt-view .r-line-tot { text-align: right; }
.linkish { cursor: pointer; color: var(--brand); text-decoration: underline; }

/* ---------- Image cropper ---------- */

.cropper { text-align: center; }
.crop-stage {
  position: relative;
  margin: 14px auto;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
  touch-action: none;
}
#crop-canvas { display: block; cursor: grab; }
#crop-canvas:active { cursor: grabbing; }
/* A subtle frame + darkened surround so the framed square reads as the crop. */
.crop-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .5) inset;
  border-radius: 10px;
}
.crop-zoom {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 320px;
  margin: 6px auto 4px;
  font-size: 13px;
  color: var(--muted);
}
.crop-zoom input[type="range"] { flex: 1; accent-color: var(--brand); }

tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--brand-soft); }

/* When printing a receipt, hide everything except the receipt node so the
   browser's "Save as PDF" produces a clean slip, not the whole back office. */
@media print {
  body.printing-receipt #app,
  body.printing-receipt #login { display: none !important; }
  body.printing-receipt #modal-root .modal-back {
    position: static;
    background: none;
    display: block;
  }
  body.printing-receipt #modal-root .modal {
    box-shadow: none;
    max-width: none;
    padding: 0;
  }
  body.printing-receipt .modal-actions { display: none !important; }
}

/* A print area for the report tables (Till Report / Bill Report export). */
.report-print-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
@media print {
  body.printing-report .rail,
  body.printing-report .page-head .btn,
  body.printing-report #modal-root { display: none !important; }
  body.printing-report main { padding: 0; }
  body.printing-report .view[hidden] { display: none; }
}

/* ---- Receipt designer ---------------------------------------------------- */

.rd-head-actions { display: flex; gap: 8px; }

/* Editor beside a paper preview. The preview sticks so it stays visible while
   the long form is scrolled — the whole point is watching edits land. */
.rd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.rd-editor { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rd-card h3 { margin: 0 0 12px; font-size: 15px; }
.rd-card label { display: block; margin-bottom: 10px; font-size: 13px; }
.rd-card label.check { display: flex; align-items: center; gap: 8px; }
.rd-card input[type="text"], .rd-card input:not([type]),
.rd-card select, .rd-card textarea {
  width: 100%; margin-top: 4px;
}
.rd-card textarea { resize: vertical; font: inherit; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.rd-logo-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
.rd-logo-preview {
  width: 120px; height: 90px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line, #d4d7dd); border-radius: 8px;
  background: var(--surface-2, #f7f8fa); overflow: hidden;
}
.rd-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rd-logo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.btn.danger-ghost { color: #b3261e; }

.rd-preview-pane { position: sticky; top: 16px; }
.rd-preview-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.rd-paper-wrap {
  background: var(--surface-2, #eef0f4);
  border-radius: 12px; padding: 18px;
  max-height: calc(100vh - 160px); overflow: auto;
}

/* The paper itself. Width is set in millimetres so the preview is a true
   representation of an 80mm or 58mm roll rather than an approximation. */
.rd-paper {
  width: 72mm; margin: 0 auto; padding: 5mm 4mm;
  background: #fff; color: #000;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 10px; line-height: 1.35;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
}
.rd-paper.narrow { width: 51mm; font-size: 9px; }

.rp-logo { text-align: center; margin-bottom: 6px; }
.rp-logo img { max-height: 46px; max-width: 70%; object-fit: contain; }
.rp-name { text-align: center; font-weight: 700; font-size: 13px; letter-spacing: 0.5px; }
.rd-paper.narrow .rp-name { font-size: 11px; }
.rp-centre { text-align: center; }
.rp-note { color: #444; font-size: 0.9em; }
.rp-row { display: flex; justify-content: space-between; gap: 8px; }
.rp-row > span:first-child { flex: 1; min-width: 0; word-break: break-word; }
.rp-sub { color: #444; font-size: 0.9em; padding-left: 10px; }
.rp-italic { font-style: italic; }
.rp-rule { border-top: 1px dashed #999; margin: 5px 0; }
.rp-rule.heavy { border-top: 2px solid #000; }
.rp-total {
  display: flex; justify-content: space-between;
  font-weight: 700; font-size: 1.25em;
  background: #eee; padding: 3px 4px; margin: 4px 0;
}
.rp-footer { text-align: center; font-weight: 700; margin-top: 4px; }

/* Stand-ins: the real barcode and QR are generated by the till's PDF builder,
   and drawing them here would only duplicate that logic. */
.rp-barcode {
  height: 30px; margin: 8px auto 4px; width: 70%;
  background: repeating-linear-gradient(
    90deg, #000 0 2px, #fff 2px 4px, #000 4px 5px, #fff 5px 8px);
}
.rp-qr {
  width: 46px; height: 46px; margin: 6px auto;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #000; font-size: 9px; letter-spacing: 1px;
}

@media (max-width: 1100px) {
  .rd-layout { grid-template-columns: 1fr; }
  .rd-preview-pane { position: static; }
  .grid2 { grid-template-columns: 1fr; }
}

/* ---- Charts -------------------------------------------------------------- */

.chart-box { width: 100%; overflow: hidden; }
.chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--line, #e3e6ea); stroke-width: 1; }
.chart-axis { font-size: 11px; fill: var(--muted, #7a828c); }
.chart-empty { padding: 22px 4px; }

.donut-wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.donut { flex: none; }
.donut-total { font-size: 20px; font-weight: 700; fill: var(--ink, #16181d); }
.donut-caption { font-size: 10px; fill: var(--muted, #7a828c); letter-spacing: 1px; }

.chart-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 160px; }
.chart-legend li {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; font-size: 13px;
}
.chart-legend .swatch {
  width: 11px; height: 11px; border-radius: 3px; flex: none;
}
.chart-legend .legend-label { flex: 1; }
.chart-legend .legend-value { font-weight: 600; }

.ranked { display: flex; flex-direction: column; gap: 8px; }
.ranked-row {
  display: grid;
  grid-template-columns: 20px minmax(80px, 1.4fr) 2fr auto;
  align-items: center; gap: 10px; font-size: 13px;
}
.ranked-rank { color: var(--muted, #7a828c); font-size: 11px; text-align: right; }
.ranked-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranked-track {
  height: 8px; border-radius: 4px;
  background: var(--surface-2, #eef0f4); overflow: hidden;
}
.ranked-fill { display: block; height: 100%; border-radius: 4px; }
.ranked-value { font-weight: 600; white-space: nowrap; }
.ranked-meta {
  grid-column: 2 / -1; font-size: 11px; color: var(--muted, #7a828c);
  margin-top: -4px;
}

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

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.stat-card {
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 16px; border-left: 3px solid var(--line, #d9dce1);
}
.stat-card.primary { border-left-color: #b5179e; }
.stat-card.blue    { border-left-color: #4361ee; }
.stat-card.amber   { border-left-color: #f77f00; }
.stat-card.green   { border-left-color: #06d6a0; }
.stat-card.red     { border-left-color: #ef476f; }
.stat-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--muted, #7a828c);
}
.stat-value { font-size: 22px; font-weight: 700; }
.stat-hint { font-size: 11px; color: var(--muted, #7a828c); }
.stat-delta { font-size: 12px; font-weight: 600; }
.stat-delta.up { color: #06a77d; }
.stat-delta.down { color: #d1495b; }

/* ---- Dashboard toolbar --------------------------------------------------- */

.dash-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.seg {
  display: inline-flex; border: 1px solid var(--line, #d9dce1);
  border-radius: 8px; overflow: hidden;
}
.seg-btn {
  border: 0; background: transparent; padding: 7px 14px;
  font: inherit; font-size: 13px; cursor: pointer;
  border-right: 1px solid var(--line, #d9dce1);
}
.seg-btn:last-child { border-right: 0; }
.seg-btn.active { background: #b5179e; color: #fff; }

.panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
}

.mini-list { display: flex; flex-direction: column; gap: 9px; }
.mini-list > div {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line, #eef0f4);
}
.mini-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-list .warn b { color: #d1495b; }

/* ---- Commerce tables ----------------------------------------------------- */

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 11px;
  font-size: 11px; background: var(--surface-2, #eef0f4);
  color: var(--muted, #7a828c); text-transform: capitalize;
}
.pill.on { background: #e4f7ef; color: #06784f; }

.promo-badge {
  display: inline-block; padding: 3px 9px; border-radius: 5px;
  font-size: 11px; font-weight: 700; color: #fff;
}

td code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; background: var(--surface-2, #f2f4f7);
  padding: 2px 6px; border-radius: 4px;
}
.pos { color: #06784f; }
.neg { color: #d1495b; }

/* ---- Loyalty tiers ------------------------------------------------------- */

.tier-row {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 9px 0; border-bottom: 1px solid var(--line, #eef0f4);
}
.tier-row .tier-name { flex: 1; min-width: 110px; }
.tier-field {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; margin: 0; color: var(--muted, #7a828c);
}
.tier-field input { width: 68px; }
.tier-row input[type="color"] {
  width: 34px; height: 30px; padding: 2px; border-radius: 6px;
}

/* ---- Tender preview ------------------------------------------------------ */

.till-preview {
  background: #12141a; color: #fff; border-radius: 10px; padding: 16px;
}
.till-preview .muted { color: #9aa3af; }
.till-row {
  display: flex; justify-content: space-between;
  font-size: 17px; padding-bottom: 10px;
  border-bottom: 1px solid #2a2f3a;
}
.till-keys { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.till-key {
  padding: 7px 11px; border-radius: 7px; font-size: 12px;
  background: #232734; border: 1px solid #313747;
}
.till-key.cash { background: #16351f; border-color: #1f5130; }

/* ---- Wide modal ---------------------------------------------------------- */

.modal.wide { max-width: 760px; width: 92vw; }
.panel-body { max-height: 62vh; overflow: auto; }
table.plain { width: 100%; border-collapse: collapse; font-size: 13px; }
table.plain th, table.plain td {
  text-align: left; padding: 7px 9px;
  border-bottom: 1px solid var(--line, #eef0f4);
}
table.plain th { color: var(--muted, #7a828c); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px; }

.colour-field { display: flex; gap: 8px; align-items: center; }
.colour-field input[type="color"] {
  width: 40px; height: 34px; padding: 2px; border-radius: 6px; flex: none;
}
.colour-field input[type="text"] { flex: 1; font-family: ui-monospace, monospace; }
