/* Coftea Cafe — loyalty card */

:root {
  --ink: #151311;
  --ink-2: #3d3833;
  --muted: #8b837a;
  --line: #e9e4dd;
  --line-strong: #d8d1c8;
  --paper: #ffffff;
  --shell: #faf8f5;
  --gold: #a9862f;
  --gold-line: #e6d3a4;
  --gold-soft: #faf3e2;
  --danger: #b3261e;

  --serif: "Hatton", "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ------------------------------------------------------------- structure */

.wrap {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 22px 18px 56px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
}

.brand-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1;
  letter-spacing: -0.01em;
}

.brand-sub {
  margin: 4px 0 0;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.ghost-link {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  transition: color 0.15s, border-color 0.15s;
}

.ghost-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ------------------------------------------------------------------ card */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 26px 18px 22px;
  box-shadow: 0 30px 70px -50px rgba(21, 19, 17, 0.45);
  transition: opacity 0.2s;
}

.card[aria-busy="true"] {
  opacity: 0.55;
}

@media (min-width: 640px) {
  .card {
    padding: 40px 40px 30px;
  }
}

.card-head {
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

.card-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 6vw, 38px);
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.02em;
}

.card-sub {
  margin: 9px 0 0;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* ----------------------------------------------------------------- slots */

.slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  row-gap: 18px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .slots {
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
    row-gap: 20px;
    margin-top: 42px;
  }
}

.slot {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.slot .num {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.slot .cup,
.slot .lock,
.slot .check {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.slot .cup {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
  opacity: 0.85;
}

.slot .lock {
  width: 16px;
  height: 16px;
  stroke-width: 1.7;
}

.slot .check {
  width: 24px;
  height: 24px;
  stroke-width: 2.4;
}

@media (hover: hover) {
  .slot:hover {
    transform: translateY(-2px);
    border-color: var(--ink);
    box-shadow: 0 12px 24px -18px rgba(21, 19, 17, 0.6);
  }
}

.slot:active {
  transform: translateY(0) scale(0.985);
}

.slot.done {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 14px 30px -22px rgba(21, 19, 17, 0.9);
}

.slot.done .num {
  opacity: 0.62;
}

.slot.locked {
  background: var(--shell);
  border-style: dashed;
  border-color: var(--line-strong);
  color: #c5bdb4;
}

.slot.locked:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--line-strong);
  color: #a99f95;
}

.slot.pop {
  animation: pop 0.42s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
  0% {
    transform: scale(0.86);
  }
  55% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

.tag {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 7.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid;
}

.tag-gold {
  background: var(--gold-soft);
  color: #7d5f16;
  border-color: var(--gold-line);
}

.tag-ink {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* --------------------------------------------------------------- rewards */

.rewards {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.reward {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--gold-line);
  background: var(--gold-soft);
  border-radius: 16px;
  padding: 12px 14px;
}

.reward.is-drink {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.reward-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}

.reward-sub {
  margin: 3px 0 0;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  opacity: 0.72;
}

.reward .btn {
  flex: 0 0 auto;
}

.reward.is-drink .btn {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}

/* ------------------------------------------------------------------ foot */

.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.progress {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}

.progress strong {
  color: var(--ink);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

.fine {
  margin: 18px 2px 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}

.fine .link {
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  border-bottom: 1px solid var(--line-strong);
  cursor: pointer;
}

.fine .link:hover {
  border-color: var(--ink);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 14px 22px;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  opacity: 0.85;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 10px 14px;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.btn-outline {
  background: transparent;
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: #fff;
  opacity: 1;
}

.btn-quiet {
  display: inline-block;
  background: none;
  border: 0;
  padding: 9px;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}

.btn-quiet:hover {
  color: var(--ink);
}

/* -------------------------------------------------------------- dialogs */

dialog {
  border: 0;
  padding: 0;
  border-radius: 26px;
  width: calc(100% - 32px);
  max-width: 392px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.55);
}

dialog::backdrop {
  background: rgba(21, 19, 17, 0.58);
  backdrop-filter: blur(3px);
}

.dlg-body {
  padding: 30px 24px 20px;
  text-align: center;
}

.dlg-kicker {
  margin: 0 0 8px;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.dlg-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.dlg-sub {
  margin: 10px auto 0;
  max-width: 290px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.code-input {
  width: 100%;
  margin: 20px 0 0;
  padding: 14px 8px 14px 18px;
  text-align: center;
  font-family: var(--mono);
  font-size: 26px;
  letter-spacing: 0.32em;
  color: var(--ink);
  background: var(--shell);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.code-input:focus {
  background: #fff;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(21, 19, 17, 0.08);
}

.code-input::placeholder {
  color: #c9c1b8;
  letter-spacing: 0.24em;
}

.dlg-actions {
  margin-top: 18px;
  display: grid;
  gap: 6px;
}

.err {
  margin: 12px 0 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: #fdf0ef;
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.5;
  font-weight: 600;
}

.field {
  display: grid;
  gap: 6px;
  text-align: left;
  margin-top: 18px;
}

.label {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.input {
  width: 100%;
  padding: 11px 12px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(21, 19, 17, 0.07);
}

/* --------------------------------------------------------------- tutorial */

.how-body {
  min-height: 122px;
  display: grid;
  align-content: center;
  gap: 10px;
  margin: 18px 0 0;
}

.how-body h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
}

.how-body p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.how-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.dots {
  display: flex;
  gap: 5px;
}

.dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-strong);
}

.dots i.on {
  background: var(--ink);
}

/* ----------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 90;
  max-width: min(90vw, 380px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

.admin-wrap {
  max-width: 1120px;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  letter-spacing: -0.01em;
}

.hint {
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}

.gate {
  max-width: 420px;
  margin: 40px auto;
}

.gate .btn {
  margin-top: 14px;
  width: 100%;
}

.grid-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 760px) {
  .grid-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

.stat {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  min-width: 0;
}

#stats .stat {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  font-family: var(--sans);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

#stats .stat:hover {
  border-color: var(--ink);
  box-shadow: 0 16px 32px -26px rgba(21, 19, 17, 0.55);
  transform: translateY(-1px);
}

#stats .stat:active {
  transform: translateY(0);
}

#stats .stat-body {
  flex: 1 1 auto;
}

.stat-go {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--muted);
  opacity: 0.45;
  transition: opacity 0.15s, transform 0.15s;
}

#stats .stat:hover .stat-go {
  opacity: 1;
  transform: translateX(2px);
}

.stat-go svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel.flash {
  animation: panel-flash 1.1s ease;
}

@keyframes panel-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(21, 19, 17, 0);
  }
  30% {
    box-shadow: 0 0 0 3px rgba(21, 19, 17, 0.12);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(21, 19, 17, 0);
  }
}

.stat-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--shell);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.stat-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.stat-body span,
.stat > span:not(.stat-icon) {
  font-size: 8.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.stat b {
  display: block;
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  line-height: 1;
}

.stat-body b {
  margin-top: 1px;
}

.stat-tag {
  display: block;
  margin-top: 4px;
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------------------------------------- rangepick */

.rangepick {
  position: relative;
}

.rangebtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.rangebtn:hover {
  border-color: var(--ink);
}

.rangebtn[aria-expanded="true"] {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(21, 19, 17, 0.07);
}

.rangebtn .ico,
.rangebtn .chev {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.rangebtn .ico {
  opacity: 0.7;
}

.rangebtn .chev {
  width: 13px;
  height: 13px;
  opacity: 0.55;
  transition: transform 0.15s;
}

.rangebtn[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.rangepop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: flex;
  gap: 14px;
  width: 600px;
  max-width: calc(100vw - 24px);
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 34px 70px -34px rgba(21, 19, 17, 0.5), 0 8px 20px -14px rgba(21, 19, 17, 0.3);
}

.quicklist {
  display: grid;
  align-content: start;
  gap: 2px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
  width: 128px;
  flex: 0 0 auto;
}

.quicklist button {
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.quicklist button:hover {
  background: var(--shell);
  color: var(--ink);
}

.calpane {
  display: grid;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.calhead {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calnav {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.calnav:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.calmonths {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(2, 194px);
  justify-content: center;
  gap: 24px;
}

.calmonth {
  min-width: 0;
}

.calmonth-name {
  margin-bottom: 8px;
  text-align: center;
}

.calmonth-name b {
  display: block;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.calmonth-name span {
  display: block;
  margin-top: 2px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.calgrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  justify-items: center;
}

.caldow {
  width: 26px;
  padding: 2px 0 4px;
  text-align: center;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.calday {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.calday:hover {
  background: var(--shell);
  color: var(--ink);
}

.calday.today {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.calday.inrange {
  background: var(--shell);
  border-radius: 4px;
  color: var(--ink);
}

.calday.start,
.calday.end {
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  border-radius: 50%;
}

.calday.start:hover,
.calday.end:hover {
  background: var(--ink);
  color: #fff;
}

.calfoot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

#cal-hint {
  font-size: 10.5px;
  color: var(--muted);
}

.calfoot-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

@media (max-width: 720px) {
  .rangepop {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    flex-direction: column;
    gap: 10px;
    width: min(92vw, 380px);
    padding: 12px;
  }

  .quicklist {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    width: auto;
    padding: 0 0 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .quicklist button {
    padding: 6px 9px;
  }

  .calmonths {
    grid-template-columns: 1fr;
    min-width: 0;
    max-width: 284px;
    margin: 0 auto;
  }

  .calmonth + .calmonth {
    display: none;
  }
}

.pick {
  width: 30px;
  padding-right: 0;
}

.pick input {
  accent-color: var(--ink);
  width: 14px;
  height: 14px;
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:hover td {
  background: #fbf9f6;
}

.split {
  display: grid;
  gap: 18px;
  margin-top: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
}

.subhead {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 14px;
}

.card-detail {
  border-top: 1px solid var(--line);
  margin-top: 20px;
}

.slot-strip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-top: 14px;
}

@media (min-width: 720px) {
  .slot-strip {
    grid-template-columns: repeat(16, 1fr);
  }
}

.slot {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 9.5px;
  color: var(--muted);
}

.slot.filled {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 700;
}

.slot.milestone {
  border-color: var(--ink);
  color: var(--ink);
}

.slot.filled.milestone {
  color: #fff;
}

.mini.danger {
  background: #fff;
  border-color: var(--danger);
  color: var(--danger);
}

.mini.danger:hover {
  background: var(--danger);
  color: #fff;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.row .field {
  margin-top: 0;
  flex: 1 1 130px;
}

.row .btn {
  flex: 0 0 auto;
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-2);
  cursor: pointer;
  padding-bottom: 11px;
}

.checkline input {
  accent-color: var(--ink);
  width: 14px;
  height: 14px;
}

/* Quantity picker used by batch printing */

.qtypick {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.qtypick:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(21, 19, 17, 0.07);
}

.qtystep {
  width: 32px;
  height: 100%;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.13s, color 0.13s;
}

.qtystep:first-child {
  border-radius: 999px 0 0 999px;
}

.qtystep:hover:not(:disabled) {
  background: var(--shell);
  color: var(--ink);
}

.qtystep:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.qtyinput {
  width: 40px;
  border: 0;
  background: none;
  padding: 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.qtyinput::-webkit-outer-spin-button,
.qtyinput::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qtychev {
  width: 32px;
  height: 100%;
  display: grid;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 999px 999px 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.13s, color 0.13s;
}

.qtychev:hover {
  background: var(--shell);
  color: var(--ink);
}

.qtychev svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s;
}

.qtychev[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.qtypop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 45;
  width: 156px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 50px -24px rgba(21, 19, 17, 0.45), 0 6px 16px -10px rgba(21, 19, 17, 0.3);
}

.qtypop-title {
  margin: 2px 4px 6px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.qtylist {
  display: grid;
  gap: 1px;
  max-height: 224px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.qtyitem {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.qtyitem:hover {
  background: var(--shell);
  color: var(--ink);
}

.qtyitem.on {
  background: var(--ink);
  color: #fff;
}

.table-wrap {
  overflow: auto;
  max-height: 440px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 9px 12px;
  background: var(--shell);
  border-bottom: 1px solid var(--line);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: 0;
}

td.right {
  text-align: right;
}

.mono {
  font-family: var(--mono);
  letter-spacing: 0.05em;
}

.badge {
  display: inline-block;
  padding: 2.5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-unused {
  background: #eef6ee;
  color: #2f6b3a;
}

.badge-used {
  background: var(--shell);
  color: var(--muted);
}

.badge-expired {
  background: #fdf0ef;
  color: var(--danger);
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mini {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.mini:hover {
  border-color: var(--ink);
}

.mini.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.empty {
  padding: 26px 14px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.note {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--muted);
}

/* ----------------------------------------------------------------- print */

#print-root {
  display: none;
}

.pos-slip {
  box-sizing: border-box;
  width: 100%;
  padding: 2.4mm 2.5mm 2.8mm;
  text-align: center;
  font-family: var(--sans);
  color: #000;
  border-bottom: 1px dashed #000;
}

.pos-brand {
  font-family: var(--serif);
  font-size: 9pt;
  font-weight: 600;
  line-height: 1.1;
}

.pos-caption {
  margin-top: 0.3mm;
  font-size: 5pt;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.pos-rule {
  margin: 1.2mm 0 1mm;
  border-top: 1px dashed #000;
}

.pos-label {
  font-size: 5pt;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.pos-code {
  margin: 0.3mm 0 0.5mm;
  font-family: var(--mono);
  font-size: 17pt;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

.pos-note {
  font-size: 5.5pt;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.pos-meta {
  margin-top: 0.5mm;
  font-size: 4.6pt;
  line-height: 1.25;
  color: #444;
}

@media print {
  body {
    background: #fff;
  }

  .app-shell,
  .toast {
    display: none !important;
  }

  #print-root {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .pos-slip {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .pos-slip:last-child {
    border-bottom: 0;
    padding-bottom: 1mm;
  }
}
