/* ═══════════════════════════════════════════════════════════════════════════
   InvoGrow Salon — salon-specific components (loaded after app.css)
   ═══════════════════════════════════════════════════════════════════════════ */
.pill.green { background: var(--green-bg); color: var(--green-ink); }
.pill.red { background: var(--red-bg); color: var(--red-ink); }
.pill.amber { background: var(--amber-bg); color: var(--amber-ink); }
.pill.pink { background: var(--pink-bg); color: var(--pink); }
.pill.gold { background: var(--gold-bg); color: #8a6408; }
.pill.grey { background: var(--surface-3); color: var(--muted); }
.av.pink { background: var(--pink-bg); color: var(--pink); }
.brand-logo.salon { background: var(--grad); }
.doc .dt th { background: #fdf0f6; color: #8a1450; }

/* visit dots ● ● ○ ○ */
.vdots { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; vertical-align: middle; }
.vdots i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--brand) 45%, var(--border)); background: transparent; display: inline-block; }
.vdots i.on { background: linear-gradient(135deg, #22c55e, #16a34a); border-color: #16a34a; box-shadow: 0 2px 6px -2px rgba(22,163,74,.6); }
.vdots b { font-size: 11px; color: var(--muted); }
.hero-card .vdots i { border-color: rgba(255,255,255,.6); } .hero-card .vdots i.on { background: #fff; border-color: #fff; }

/* progress ring (server rendered) */
.pring { position: relative; display: inline-grid; place-items: center; flex: none; }
.pring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.pring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.pring .trk { stroke: var(--surface-3); }
.pring b { position: relative; font-size: 13px; font-weight: 800; }
.hero-card .pring .trk { stroke: rgba(255,255,255,.25); } .hero-card .pring .bar { stroke: #fff !important; }

/* bar chart + donut */
.bc { width: 100%; display: block; overflow: visible; }
.bc .gl { stroke: var(--border); stroke-width: 1; }
.bc .gt { fill: var(--muted); font-size: 10px; font-weight: 700; font-family: var(--font); }
.bc .br { transform-origin: bottom; transform-box: fill-box; animation: grow 1s cubic-bezier(.2,.8,.2,1) both; }
@keyframes grow { from { transform: scaleY(0); } }
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut { width: 132px; height: 132px; flex: none; }
.donut .dc { font-size: 6px; font-weight: 800; fill: var(--text); font-family: var(--font); }
.donut .ds { font-size: 3.2px; font-weight: 700; fill: var(--muted); font-family: var(--font); }
.donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; font-weight: 700; }
.donut-legend div { display: flex; align-items: center; gap: 8px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* treatment package card */
.pkg { border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); padding: 14px 14px 14px 18px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.pkg::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--brand)); }
.pkg .top { display: flex; gap: 12px; align-items: center; }
.pkg .ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; color: #fff; background: var(--c, var(--brand)); flex: none; }
.pkg .nm { font-weight: 800; font-size: 15px; }
.pkg .meta { font-size: 12px; color: var(--muted); font-weight: 600; }
.pkg .bar { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.pkg .bar span { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--grad); transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.pkg .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.pkg .nums div { background: var(--surface-2); border-radius: 12px; padding: 7px 4px; border: 1px solid var(--border); }
.pkg .nums b { display: block; font-size: 17px; font-weight: 800; }
.pkg .nums span { font-size: 10.5px; font-weight: 700; color: var(--muted); }

/* visit timeline */
.vtl { display: flex; flex-direction: column; position: relative; }
.vtl .v { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.vtl .v::before { content: ""; position: absolute; left: 17px; top: 46px; bottom: -10px; width: 2px; background: var(--border); }
.vtl .v:last-child::before { display: none; }
.vtl .n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; background: var(--surface-3); color: var(--muted); border: 2px solid var(--border); position: relative; z-index: 1; }
.vtl .v.done .n { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; border-color: transparent; }
.vtl .v.booked .n { background: var(--grad); color: #fff; border-color: transparent; }
.vtl .v.next .n { border-color: var(--brand); color: var(--brand); animation: pulse 2s infinite; }
.vtl .v.comp .n::after { content: "🎁"; position: absolute; right: -6px; top: -8px; font-size: 12px; }
.vtl .body { flex: 1; min-width: 0; }
.vtl .body b { font-size: 14px; }
.vtl .body .s { font-size: 12px; color: var(--muted); font-weight: 600; }
.vtl .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.photos { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.photos a { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; position: relative; border: 1px solid var(--border); }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 9px; font-weight: 800; text-align: center; padding: 1px; }

/* appointment calendar (day view, staff columns) */
.cal-wrap { overflow: auto; max-height: 74vh; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.cal-grid { display: grid; position: relative; min-width: max-content; }
.cal-grid .hd { position: sticky; top: 0; z-index: 4; background: var(--surface-2); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 8px 6px; font-weight: 800; font-size: 12.5px; text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; }
.cal-grid .hd.corner { left: 0; z-index: 5; }
.cal-grid .times { position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--border); }
.cal-grid .times div { font-size: 10.5px; font-weight: 700; color: var(--muted); text-align: right; padding: 0 6px; transform: translateY(-6px); }
.cal-grid .col { position: relative; border-right: 1px solid var(--border); }
.cal-grid .col .slot { border-bottom: 1px dashed color-mix(in srgb, var(--border) 80%, transparent); cursor: pointer; }
.cal-grid .col .slot.hr { border-bottom: 1px solid var(--border); }
.cal-grid .col .slot:hover { background: var(--grad-soft); }
.cal-grid .col .slot.drop { background: color-mix(in srgb, var(--brand) 18%, transparent); }
.cal-grid .col.off { background: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--muted) 9%, transparent) 6px 12px); }
.appt { position: absolute; left: 3px; right: 3px; border-radius: 10px; padding: 4px 7px; font-size: 11.5px; line-height: 1.25; overflow: hidden; color: #fff; background: var(--c, var(--brand)); box-shadow: 0 6px 14px -8px rgba(0,0,0,.5); cursor: grab; border-left: 4px solid rgba(0,0,0,.2); z-index: 1; }
.appt b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt span { display: block; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt.st-Completed { opacity: .55; } .appt.st-NoShow { opacity: .4; text-decoration: line-through; }
.appt.st-InService { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--amber); }
.appt.st-Requested { background: repeating-linear-gradient(45deg, var(--c), var(--c) 8px, color-mix(in srgb, var(--c) 70%, #fff) 8px 16px); }
.appt.dragging { opacity: .5; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 2; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.appt-card { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c, var(--brand)); align-items: center; }
.appt-card .tm { width: 64px; flex: none; font-weight: 800; font-size: 13px; line-height: 1.2; }
.appt-card .tm span { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }

/* POS */
.pos { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .pos { grid-template-columns: minmax(0, 1.2fr) minmax(390px, 1fr); align-items: start; } .pos .cart { position: sticky; top: 76px; } }
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.cat-tabs::-webkit-scrollbar { display: none; }
.items-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 60vh; overflow-y: auto; padding: 2px; }
@media (min-width: 720px) { .items-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.it { text-align: left; border: 1.5px solid var(--border); background: var(--surface); border-radius: 14px; padding: 10px 11px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: transform .12s, border-color .15s; font: inherit; color: inherit; position: relative; }
.it:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); }
.it:active { transform: scale(.96); }
.it b { font-size: 13px; line-height: 1.25; padding-right: 10px; }
.it .p { font-weight: 800; color: var(--brand); font-size: 14px; }
.it .m { font-size: 11px; color: var(--muted); font-weight: 600; }
.it .tag { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--brand)); }
.it.low .m { color: var(--red-ink); }
.cart .line { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.cart .line:last-child { border-bottom: 0; }
.cart .line .nm { font-weight: 700; font-size: 14px; }
.cart .line .sub { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.cart .line .amt { font-weight: 800; text-align: right; }
.cart .line .ctl { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cart .line .ctl select, .cart .line .ctl input { height: 34px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; padding: 0 8px; min-width: 0; }
.cart .line .ctl select { flex: 1 1 120px; max-width: 190px; }
.cart .line .ctl input { width: 76px; }
.cart .line .ctl .x { margin-left: auto; }
.tot { display: flex; justify-content: space-between; font-size: 13.5px; padding: 4px 0; font-weight: 600; color: var(--text-2); }
.tot.grand { font-size: 22px; font-weight: 800; color: var(--text); padding-top: 10px; border-top: 2px solid var(--border); margin-top: 6px; }
.tot.disc { color: var(--green-ink); }
.pay-rows { display: flex; flex-direction: column; gap: 8px; }
.pay-row { display: flex; gap: 8px; align-items: center; }
.pay-row select { flex: 0 0 104px; height: 44px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; padding: 0 10px; }
.pay-row input { flex: 1; height: 44px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; font-weight: 800; padding: 0 12px; min-width: 0; }
.mode-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mode-chips button { height: 54px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); font: inherit; font-weight: 800; font-size: 12px; color: var(--text-2); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.mode-chips button i { font-size: 18px; }
.mode-chips button.on { border-color: var(--brand); background: var(--grad-soft); color: var(--brand); }
.cust-pick { position: relative; }
.cust-pick .dd { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; }
.cust-pick .dd a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.cust-pick .dd a:hover, .cust-pick .dd a.hl { background: var(--grad-soft); }
.cust-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--grad-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border)); }
.alert-chip { display: inline-flex; gap: 6px; align-items: center; background: var(--red-bg); color: var(--red-ink); border-radius: 10px; padding: 4px 10px; font-size: 12px; font-weight: 700; }

/* running bill (ticket) */
.tk-line { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.tk-line.mine { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); background: color-mix(in srgb, var(--pink-bg) 35%, var(--surface)); }
.tk-line .who { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.tk-line .lock { color: var(--muted); font-size: 12px; font-weight: 700; display: inline-flex; gap: 4px; align-items: center; }
.tk-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.qty button { width: 30px; height: 30px; border: 0; background: var(--surface-2); font-weight: 800; cursor: pointer; color: var(--text); }
.qty span { min-width: 30px; text-align: center; font-weight: 800; font-size: 13px; }

/* staff app */
.staff-hero { position: relative; overflow: hidden; border-radius: 24px; padding: 18px; color: #fff; background: linear-gradient(135deg, #1e2a63 0%, #3b2f8c 55%, #d6246e 125%); box-shadow: 0 18px 40px -18px rgba(30,42,99,.7); }
.staff-hero::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -80px; top: -100px; background: rgba(255,255,255,.08); }
.staff-hero > * { position: relative; z-index: 1; }
.staff-hero .inc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.staff-hero .inc div { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 9px 10px; }
.staff-hero .inc b { display: block; font-size: 17px; font-weight: 800; }
.staff-hero .inc span { font-size: 11px; opacity: .85; font-weight: 700; }
.punch { width: 100%; height: 56px; border-radius: 18px; border: 0; font: inherit; font-weight: 800; font-size: 16px; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; }
.punch.in { background: linear-gradient(135deg, #16a34a, #22c55e); box-shadow: 0 10px 22px -10px rgba(22,163,74,.8); }
.punch.out { background: linear-gradient(135deg, #f97316, #ef4444); }
body.app-staff { --brand: #4c3bb0; --grad: linear-gradient(135deg, #3b2f8c 0%, #6d28d9 55%, #d6246e 100%); --grad-soft: linear-gradient(135deg, rgba(59,47,140,.10), rgba(214,36,110,.10)); }
:root[data-theme="dark"] body.app-staff { --brand: #a78bfa; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body.app-staff { --brand: #a78bfa; } }

/* invoices: A5 / thermal */
.doc.size-a5 { max-width: 560px; padding: 22px 24px; font-size: 12px; }
.doc.size-thermal { max-width: 330px; padding: 14px 12px; font-size: 11.5px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.doc.size-thermal .dh { flex-direction: column; text-align: center; border-bottom: 1px dashed #111; }
.doc.size-thermal .dh img.lg { width: 48px; height: 48px; }
.doc.size-thermal .dh h1 { font-size: 16px; }
.doc.size-thermal table.dt th, .doc.size-thermal table.dt td { border: 0; border-bottom: 1px dashed #bbb; padding: 3px 2px; background: none; }
.doc.size-thermal .dtitle span { background: none; color: #111; border: 1px solid #111; }
.doc.size-thermal .hide-thermal { display: none !important; }
.inv-head { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin: 10px 0; }
.doc.size-thermal .inv-head { grid-template-columns: 1fr; }
.inv-tot { margin-left: auto; width: min(320px, 100%); }
.inv-tot div { display: flex; justify-content: space-between; padding: 3px 0; }
.inv-tot .g { font-size: 16px; font-weight: 800; border-top: 2px solid #111; margin-top: 4px; padding-top: 6px; }
.qr-pay { display: flex; gap: 10px; align-items: center; border: 1.5px dashed #d6246e; border-radius: 10px; padding: 8px; }
.qr-pay img { width: 92px; height: 92px; }
@media print {
  body.print-thermal .doc { width: 72mm; max-width: 72mm; }
  body.print-a5 .doc { max-width: none; }
}

/* misc */
.salon-type { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.salon-type label { display: flex; align-items: center; gap: 9px; padding: 11px 10px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 700; font-size: 12.5px; }
.salon-type label i { font-size: 19px; color: var(--brand); }
.salon-type input { display: none; }
.salon-type label:has(input:checked) { border-color: var(--brand); background: var(--grad-soft); }
@media (min-width: 720px) { .salon-type { grid-template-columns: repeat(4, 1fr); } }
.svc-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.svc-row:last-child { border-bottom: 0; }
.svc-row .dot { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: none; font-size: 16px; }
.big-num { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.inc-split { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.inc-split > div { border-radius: 16px; padding: 12px; background: var(--surface); border: 1px solid var(--border); }
.inc-split .k { font-size: 11.5px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.inc-split .v { font-size: 19px; font-weight: 800; margin-top: 2px; }
.inc-split .tot { background: var(--grad); color: #fff; border: 0; display: block; }
.inc-split .tot .k { color: rgba(255,255,255,.85); }
@media (max-width: 720px) { .inc-split { grid-template-columns: 1fr 1fr; } }
.mem-card { border-radius: 20px; padding: 16px; color: #fff; position: relative; overflow: hidden; background: linear-gradient(135deg, var(--c, #b8860b), color-mix(in srgb, var(--c, #b8860b) 50%, #000)); }
.mem-card::after { content: "✦"; position: absolute; right: 14px; top: 6px; font-size: 40px; opacity: .25; }
.coupon { display: flex; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.coupon .l { background: var(--grad); color: #fff; padding: 14px 10px; display: grid; place-items: center; text-align: center; min-width: 96px; font-weight: 800; position: relative; }
.coupon .l::after { content: ""; position: absolute; right: -8px; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); transform: translateY(-50%); }
.coupon .r { padding: 12px 14px; flex: 1; min-width: 0; }
.coupon code { font-weight: 800; letter-spacing: .08em; background: var(--surface-3); padding: 2px 8px; border-radius: 6px; }
.reminder { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.reminder.sent { opacity: .6; }
.branch-sw { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-weight: 800; font-size: 12.5px; cursor: pointer; max-width: 170px; }
.branch-sw span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--surface-2); }
.thumb { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: none; }
