/* Modern finish (v64): spacing, radii, depth, focus, tiles, tabs, tables, steps. */
body { font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: var(--font-heading); }

/* Muted text: one accessible grey instead of many hardcoded ones */
.hint, .footnote, .sumNote, .assignee, .age, .sectionLabel, .loading, .notfound,
.slugRow span, .stat .label, .tabBtn, .subTab, .editRow label, .photoCell .cap { color: var(--text-muted); }
.age.old { color: var(--red); }
.eyebrow { color: #6B5100; }

/* Fields */
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea {
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink);
  font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select { min-height: 44px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: none; border-color: var(--teal); box-shadow: var(--focus);
}
input[type=checkbox], input[type=radio] { accent-color: var(--teal); width: 18px; height: 18px; }
input[type=color] { width: 72px; height: 44px; padding: 4px; border-radius: var(--radius-sm); cursor: pointer; }
input[type=file] { padding: 14px; border: 2px dashed #CFC9B8; border-radius: 12px; background: #FBFAF6; font-size: 13px; color: var(--text-muted); cursor: pointer; }
input[type=file]::file-selector-button { margin-right: 12px; border: 0; border-radius: 8px; padding: 8px 14px; background: var(--ink); color: #fff; font: 600 13px var(--font-body); cursor: pointer; }

/* Buttons */
button { font-family: var(--font-body); border-radius: var(--radius-sm); transition: opacity .15s, background .15s, box-shadow .15s; }
#loginBox button, button#submitBtn { box-shadow: 0 2px 8px rgba(27,42,74,.2); }
.logoutBtn, .smallBtn { min-height: 40px; border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
.logoutBtn:hover, .smallBtn:hover { background: var(--surface-2); opacity: 1; }

/* Cards and surfaces */
.card, .summary, .price, .tempBox, .banner, .refundInfo, .suggest, .doneHint { border-radius: var(--radius-md); }
.card, .summary { box-shadow: var(--shadow-card); border-color: var(--line); }
.price { border-style: solid; background: #fff; }
.addon { border-radius: var(--radius-md); background: #fff; transition: border-color .15s, box-shadow .15s; }
.addon:has(input:checked) { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }

/* Pills */
.pill { padding: 3px 10px; }

/* ---------- Staff dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px 18px; display: flex; flex-direction: column-reverse; gap: 4px; box-shadow: var(--shadow-card); }
.stat > div:first-child { font-family: var(--font-heading); font-weight: 700; font-size: 30px !important; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .label { font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.stat.clickable { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.stat.clickable:hover { transform: translateY(-1px); box-shadow: var(--shadow-pop); }
.stat.clickable:hover .label { text-decoration: none; }
#statOverdueBox.hot { background: #FBEDEA; border-color: #F0CFC8; }
#statOverdueBox.hot .label { color: #8A3329; font-weight: 600; }
#statPendingBox { background: #FBF3DC; border-color: #EBD79B; }
#statPendingBox .label { color: #6B5100; font-weight: 600; }

.tabs { gap: 2px; }
.tabBtn { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 12px 14px; font-weight: 500; }
.tabBtn:hover { color: var(--ink); }
.tabBtn.active { background: none; border-bottom-color: var(--ink); color: var(--ink); font-weight: 600; }
.subTab.active { border-bottom-color: var(--ink); }

.toolbar { gap: 10px; align-items: center; }
.toolbar input { border-radius: 12px; }

table { border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-card); }
th, td { padding: 13px 16px; border-bottom: 1px solid #EEEBE1; }
th { background: var(--surface-2); color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
tbody tr:last-child td { border-bottom: 0; }
tr:hover { background: #FBFAF6; }
tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--red); }
td:first-child { font-variant-numeric: tabular-nums; }
tr.emptyRow:hover { background: none; cursor: default; }
td.emptyState { text-align: center; padding: 56px 16px; color: var(--text-muted); }
td.emptyState b { display: block; font-family: var(--font-heading); font-size: 17px; color: var(--ink); margin-bottom: 6px; }

#loginBox { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-pop); max-width: 340px; }

/* Phones: ticket table becomes stacked cards */
@media (max-width: 640px) {
  #dash > div[style*="justify-content:space-between"] { flex-wrap: wrap; gap: 10px; }
  .tabs { flex-wrap: nowrap !important; overflow-x: auto; max-width: 100%; }
  .tabBtn { white-space: nowrap; }
  #ticketsView > table, #ticketsView > table tbody { display: block; }
  #ticketsView > table { border: 0; box-shadow: none; background: none; }
  #ticketsView > table thead { display: none; }
  #rows tr[id^="ticketrow-"] { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "a b" "c c" "d e"; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: 10px; padding: 8px 4px; box-shadow: var(--shadow-card); }
  #rows tr[id^="ticketrow-"] td { border: 0; padding: 4px 14px; }
  #rows tr[id^="ticketrow-"] td:nth-child(1) { grid-area: a; }
  #rows tr[id^="ticketrow-"] td:nth-child(5) { grid-area: b; justify-self: end; }
  #rows tr[id^="ticketrow-"] td:nth-child(2) { grid-area: c; font-weight: 600; }
  #rows tr[id^="ticketrow-"] td:nth-child(3) { grid-area: d; color: var(--text-muted); font-size: 13px; }
  #rows tr[id^="ticketrow-"] td:nth-child(4) { grid-area: e; justify-self: end; }
  #rows tr.overdue td:first-child { box-shadow: none; }
  #rows tr.overdue { border-left: 3px solid var(--red); }
  #rows > tr:not([id^="ticketrow-"]) { display: block; }
  #rows > tr:not([id^="ticketrow-"]) > td { display: block; }
}

/* ---------- Customer report form ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chips button { width: auto; margin: 0; min-height: 44px; padding: 0 16px; border-radius: 22px; background: #fff; color: var(--ink); border: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.chips button[aria-pressed="false"]:hover:not(:disabled) { background: var(--surface-2); opacity: 1; }
.chips button[aria-pressed="true"]:hover:not(:disabled) { background: var(--ink); opacity: .92; }
.chips button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.smsBox { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; }
.ref { border-radius: var(--radius-sm); }
.confirm h2 { font-size: 26px; }

/* ---------- Signup steps ---------- */
.stepper { list-style: none; margin: 0 0 20px; padding: 0; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 8px; }
.stepper .n { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #D8D3C6; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.stepper li.active { color: var(--ink); font-weight: 600; }
.stepper li.active .n { background: var(--ink); border-color: var(--ink); color: #fff; }
.stepper li.done .n { background: var(--teal); border-color: var(--teal); color: #fff; }
.stepper .bar { width: 28px; height: 2px; background: #D8D3C6; }
.step { display: none; }
.step.active { display: block; }
.stepNav { display: flex; gap: 10px; margin-top: 8px; }
.stepNav button { margin-top: 0; }
.stepNav .secondary { width: auto; min-width: 96px; background: #fff; color: var(--ink); border: 1px solid var(--line); }
.stepNav .secondary:hover:not(:disabled) { background: var(--surface-2); opacity: 1; }
.slugRow { background: #fff; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- v65 ---------- */
[hidden] { display: none !important; }

/* Ticket slide-over */
.slideOver { font-size: 14px; position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); box-sizing: border-box; background: #fff; border-left: 1px solid var(--line); box-shadow: var(--shadow-pop); padding: 24px; overflow-y: auto; z-index: 50; }
.panelOverlay { position: fixed; inset: 0; background: rgba(27,42,74,.35); z-index: 40; }
.panelHead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.panelId { font: 600 12px ui-monospace, monospace; color: var(--text-muted); letter-spacing: .04em; }
.slideOver h2 { margin: 4px 0 0; font-size: 22px; color: var(--ink); }
.panelSub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.panelClose { width: 44px; height: 44px; flex: none; padding: 0; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }
.panelClose:hover { background: var(--surface-2); }
.panelPills { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.slideOver .grid2 { grid-template-columns: 1fr; }
tr.selected td { background: #F3F7F6; }
tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--teal); }
@media (min-width: 1280px) {
  .panelOverlay { display: none !important; }
  body.panelOpen .wrap { margin: 0 520px 0 auto; }
}

/* Customer form: machine card + refund toggle */
.machineCard { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--shadow-card); }
.mcIcon { width: 48px; height: 48px; flex: none; border-radius: 12px; background: #DCEAE8; color: #245858; display: flex; align-items: center; justify-content: center; }
.mcText { flex: 1; min-width: 0; }
.mcLabel { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.mcName { font: 700 17px var(--font-heading); color: var(--ink); overflow-wrap: anywhere; }
.machineCard button { width: auto; margin: 0; background: none; color: var(--teal); padding: 10px 6px; font-size: 13px; font-weight: 600; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button { width: auto; min-width: 64px; margin: 0; min-height: 44px; padding: 0 14px; background: none; color: var(--text-muted); border-radius: 8px; font-size: 14px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(27,42,74,.15); }
.seg button:hover:not(:disabled) { opacity: 1; }

/* Signup: swatches, drop zone, live preview */
input[type=file].dragover { border-color: var(--teal); background: #F3F7F6; }
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.swatches button { width: 44px; height: 44px; margin: 0; padding: 0; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #D8D3C6; cursor: pointer; }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.preview { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 18px 22px; margin-top: 18px; box-shadow: var(--shadow-card); }
.preview h2 { font-size: 13px; margin: 0 0 12px; font-family: var(--font-body); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.pvFrame { background: var(--paper); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; max-width: 320px; margin: 0 auto; }
.pvBrand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pvLogo { width: 28px; height: 28px; border-radius: 8px; object-fit: contain; background: #fff; }
.pvBadge { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: #fff; font: 700 12px var(--font-heading); display: flex; align-items: center; justify-content: center; }
.pvName { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #6B5100; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pvTitle { font: 700 17px var(--font-heading); color: var(--ink); }
.pvField { height: 34px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.pvBtn { height: 40px; border-radius: 10px; background: var(--ink); color: #fff; font: 600 13px var(--font-body); display: flex; align-items: center; justify-content: center; }

/* ---------- v66: machine stickers dialog ---------- */
.modalWrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modalScrim { position: absolute; inset: 0; background: rgba(27,42,74,.45); }
.modalCard { position: relative; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 24px; box-sizing: border-box; font-size: 14px; }
.modalCard h2 { margin: 0 0 14px; font-size: 20px; }
.modalCard label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--ink); }
.modalCard select, .modalCard input, .modalCard textarea { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 14px; }
.modalCard textarea { padding: 10px 12px; }
.modalActions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.primaryBtn { background: var(--ink); color: #fff; border: 0; border-radius: var(--radius-sm); padding: 10px 18px; min-height: 40px; font-size: 14px; font-weight: 600; cursor: pointer; }
.primaryBtn:hover:not(:disabled) { opacity: .9; }
.primaryBtn:disabled { opacity: .7; }

/* ---------- v67: operating hours ---------- */
.hoursGrid { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.hoursRow { display: grid; grid-template-columns: 130px 120px 24px 120px 1fr; align-items: center; gap: 8px; }
.hoursRow input[type="time"] { min-width: 0; }
.hoursDay { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; cursor: pointer; }
.hoursDay input { width: auto; }
.hoursTo { text-align: center; color: var(--muted, #6b6b6b); font-size: 13px; }
.hoursClosed { grid-column: 2 / -1; color: var(--muted, #6b6b6b); font-size: 13px; }
.hoursRow [hidden] { display: none !important; }
@media (max-width: 560px) { .hoursRow { grid-template-columns: 1fr 1fr 20px 1fr; } .hoursDay { grid-column: 1 / -1; } .hoursClosed { grid-column: 1 / -1; } }
.hoursNote { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line, #e3e0d6); border-left: 4px solid var(--ink); border-radius: var(--radius-sm, 6px); background: #fff; font-size: 14px; line-height: 1.5; }
.hoursNote strong { font-weight: 600; }
.hoursNote.closed { background: #FFF8E8; border-left-color: #C98A00; }
