/* HairSchedula Pro — same visual language as prototype/index.html:
   dark salon-mirror ground, champagne accent, Josefin Sans + Jost. */
:root {
  --bg: #121113; --surface: #1b1a1d; --raised: #242226; --line: #36333a; --line-soft: #2a282d;
  --fg: #ece8e4; --muted: #a39d97;
  --accent: #d9b49a; --accent-ink: #1c1512; --accent-soft: rgba(217, 180, 154, .14);
  --good: #63c08e; --warn: #e3b955; --bad: #e2675c;
  --f-display: 'Josefin Sans', 'Gill Sans', 'Trebuchet MS', sans-serif;
  --f-body: 'Jost', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* "hidden" always wins over component styles */
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.45 var(--f-body); -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 300; letter-spacing: .01em; margin: 0; text-wrap: balance; }
h1 { font-size: 2rem; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.eyebrow { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.page { max-width: 1100px; margin: 0 auto; padding: 24px clamp(16px, 3vw, 36px) 48px; }
.wordmark { display: flex; align-items: center; gap: 12px; }
.wordmark svg { width: 44px; height: 44px; color: var(--fg); }
.wordmark b { font-family: var(--f-display); font-weight: 300; font-size: 1.6rem; letter-spacing: .02em; }
.wordmark span { display: block; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 99px; border: 1px solid var(--line);
  background: none; color: var(--fg); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .8rem; color: var(--muted); letter-spacing: .03em; }
.in {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit;
}
.in:focus { border-color: var(--accent); outline: none; }
.check { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .92rem; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.flash { border-radius: 10px; padding: 10px 14px; font-size: .92rem; }
.flash.error { background: rgba(226, 103, 92, .14); color: var(--bad); }
.flash.info { background: var(--accent-soft); color: var(--fg); }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login {
  width: min(420px, 100%); display: flex; flex-direction: column; gap: 18px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 20px; padding: 28px;
}

/* home */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 20px; }
.tile {
  display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line-soft); color: var(--fg); text-decoration: none;
}
a.tile:hover { border-color: var(--accent); }
.tile .big { font-family: var(--f-display); font-size: 1.3rem; }
.tile.soon { opacity: .55; }
.pill { display: inline-flex; align-self: flex-start; font-size: .72rem; border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; color: var(--muted); }

/* install suggestion */
.install {
  display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 14px 16px;
  border-radius: var(--r); background: var(--accent-soft); border: 1px solid rgba(217, 180, 154, .35);
}
.install[hidden] { display: none; }
.install img { border-radius: 12px; flex: none; }
.install .share { width: 1.05em; height: 1.05em; vertical-align: -0.15em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 480px) { .install { align-items: flex-start; } .install img { width: 40px; height: 40px; } }
.install .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.install .grow [hidden] { display: none; }

/* ---------- shared app layout ---------- */
a.wordmark { color: var(--fg); text-decoration: none; }
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash.warn { background: rgba(227, 185, 85, .12); color: var(--warn); margin-top: 14px; }
.lead { max-width: 70ch; margin: 8px 0 22px; }
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 20px; min-width: 0; scroll-margin-top: 16px; }
.panel h2 { font-size: 1.35rem; }
.panel + .panel, .panel + form, form + .panel { margin-top: 16px; }
.split2 > .panel { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.split2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; scroll-margin-top: 16px; }
@media (max-width: 760px) { .split2, .grid2 { grid-template-columns: 1fr; } }
.hint { font-size: .8rem; color: var(--muted); }
.lbl { font-size: .78rem; color: var(--muted); letter-spacing: .03em; }
.num { font-variant-numeric: tabular-nums; }
.affix { position: relative; }
.affix .in { padding-right: 38px; }
.affix .suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; pointer-events: none; }
.total { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--muted); margin-top: 6px; }
.total b { color: var(--fg); font-weight: 500; }
select.in { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn.danger { color: var(--bad); }
.good { color: var(--good); } .bad { color: var(--bad); }

/* ---------- Il tuo salone ---------- */
.summary-panel .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
@media (max-width: 900px) { .summary-panel .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi b { font-family: var(--f-display); font-weight: 400; font-size: 1.7rem; line-height: 1.15; }
.todo { margin: 14px 0 0; padding-left: 20px; color: var(--warn); font-size: .92rem; }
.sechead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rowform { display: grid; gap: 10px 12px; align-items: end; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.rowform .field label { font-size: .74rem; }
.rowform .in { min-height: 42px; }
.rowform.newrow { border-top: 1px dashed var(--line); }
.rowactions { display: flex; gap: 6px; justify-content: flex-end; }
.staffrow { grid-template-columns: 42px minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; }
.staffrow .avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: var(--accent-ink); }
.staffrow .avatar.plus { background: var(--raised); color: var(--muted); font-size: 1.3rem; }
.servicerow { grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1fr) auto; }
.servicerow .desire { grid-column: 1 / 3; min-height: 0; }
.servicerow .figs { grid-column: 3 / 6; display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); align-self: center; }
.servicerow .figs b { color: var(--fg); font-weight: 500; margin-left: 4px; }
.servicerow .figs b.good { color: var(--good); } .servicerow .figs b.bad { color: var(--bad); }
.servicerow .rowactions { grid-column: 6; grid-row: 1; }
.servicerow.newrow .rowactions { grid-row: auto; }
.servicerow { border-left: 3px solid transparent; padding-left: 12px; }
.servicerow.cat-taglio { border-left-color: #9fb7d9; } .servicerow.cat-colore { border-left-color: #d9a07a; }
.servicerow.cat-piega { border-left-color: #b9a3d6; } .servicerow.cat-trattamento { border-left-color: #8fc7b4; }
@media (max-width: 860px) {
  .staffrow { grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1fr); }
  .staffrow .grow2 { grid-column: 2 / 4; }
  .staffrow .field:not(.grow2) { grid-column: span 1; }
  .staffrow .rowactions { grid-column: 1 / -1; }
  .servicerow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .servicerow .grow2 { grid-column: 1 / -1; }
  .servicerow .desire, .servicerow .figs { grid-column: 1 / -1; }
  .servicerow .rowactions { grid-column: 1 / -1; grid-row: auto; }
}

/* ---------- Nuovo incasso ---------- */
.incasso { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 20px; align-items: start; margin-top: 18px; }
@media (max-width: 900px) { .incasso { grid-template-columns: 1fr; } }
.steps { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.step { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.step legend { font-family: var(--f-display); font-size: 1.2rem; padding: 0; margin-bottom: 12px; }
.who-pick { display: flex; gap: 14px; flex-wrap: wrap; }
.who-pick label { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; }
.who-pick input, .badges input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.who-pick .avatar { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; font-weight: 600; color: var(--accent-ink); border: 3px solid transparent; opacity: .7; transition: opacity .15s; }
.who-pick input:checked ~ .avatar { border-color: var(--fg); opacity: 1; }
.who-pick input:checked ~ span:last-child { color: var(--fg); }
.who-pick input:focus-visible ~ .avatar { outline: 2px solid var(--accent); outline-offset: 3px; }
.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge { --c: #9fb7d9; display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px; border-radius: 14px; border: 2px solid var(--c); cursor: pointer; font-weight: 500; user-select: none; }
.badge small { color: var(--muted); font-weight: 400; }
.badge.cat-colore { --c: #d9a07a; } .badge.cat-piega { --c: #b9a3d6; } .badge.cat-trattamento { --c: #8fc7b4; }
.badge:has(input:checked) { background: var(--c); color: #17130f; }
.badge:has(input:checked) small { color: #3a2f27; }
.badge:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .btn { width: 52px; padding: 0; font-size: 1.4rem; flex: none; }
.stepper .affix { width: 130px; }
.stepper .in { text-align: center; font-family: var(--f-display); font-size: 1.35rem; padding-right: 44px; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .knob { width: 58px; height: 34px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.switch .knob::after { content: ""; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: var(--fg); transition: transform .2s; }
.switch input:checked + .knob { background: var(--good); }
.switch input:checked + .knob::after { transform: translateX(24px); }
.switch input:focus-visible + .knob { outline: 2px solid var(--accent); outline-offset: 2px; }
.retail { max-width: 220px; } .retail .in { padding-right: 92px; }
.preview-col { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 12px; }
.ledger { display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; margin-top: 10px; font-size: .95rem; }
.ledger .muted { color: var(--muted); }
.ledger .tot { font-weight: 600; border-top: 1px solid var(--line); padding-top: 9px; margin-top: 3px; }
.ledger .good { color: var(--good); } .ledger .bad { color: var(--bad); }
.tip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin-top: 12px; background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; font-size: .92rem; }
.btn.huge { min-height: 64px; font-size: 1.15rem; letter-spacing: .04em; width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .switch .knob, .switch .knob::after, .who-pick .avatar { transition: none; } }

.done-panel { display: flex; align-items: center; gap: 18px; padding: 16px 20px; border-radius: var(--r); margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line-soft); }
.done-panel p { margin: 4px 0 0; font-size: 1.02rem; }
.done-panel .grow { flex: 1; min-width: 0; }
.done-ring { position: relative; width: 72px; height: 72px; flex: none; }
.done-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.done-ring circle { fill: none; stroke-width: 5; }
.done-ring .track { stroke: var(--line); }
.done-ring .bar { stroke: var(--muted); stroke-linecap: round; }
.state-good .bar { stroke: var(--good); } .state-warn .bar { stroke: var(--warn); } .state-bad .bar { stroke: var(--bad); }
.done-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-weight: 400; font-size: 1.05rem; }

.today-list { margin-top: 24px; }
.sale-row { display: grid; grid-template-columns: 48px 30px minmax(0, 1fr) auto 40px; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.sale-row .t { color: var(--muted); font-size: .88rem; }
.sale-row .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sale-row .amt { text-align: right; display: flex; flex-direction: column; }
.sale-row .amt small { font-size: .78rem; }
.avatar.sm { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 600; color: var(--accent-ink); }

/* ---------- phones: reachable Conferma ---------- */
@media (max-width: 600px) {
  h1 { font-size: 1.7rem; }
  .done-panel { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; padding: 14px; }
  .done-panel form { grid-column: 2; justify-self: start; }
  .done-ring { width: 64px; height: 64px; }
}
@media (max-width: 900px) {
  .incasso { padding-bottom: 84px; }
  .preview-col { position: static; }
  #confirm { position: fixed; left: 16px; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: auto;
             z-index: 20; box-shadow: 0 8px 30px rgba(0, 0, 0, .55); }
}
.done-ring small { position: absolute; left: 0; right: 0; bottom: -18px; text-align: center; font-size: .68rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.done-panel { padding-bottom: 24px; }
.btn.primary:disabled { opacity: 1; background: var(--raised); border-color: var(--line); color: var(--muted); }

/* ---------- Oggi ---------- */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.dash.lower { margin-top: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.dash .panel + .panel, .dash.lower > .panel { margin-top: 0; }
.dash .today-list { margin-top: 0; }
@media (max-width: 860px) { .dash, .dash.lower { grid-template-columns: 1fr; } }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.big-ring { position: relative; width: min(220px, 62vw); aspect-ratio: 1; }
.big-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.big-ring circle { fill: none; stroke-width: 10; }
.big-ring .track { stroke: var(--line); }
.big-ring .bar { stroke: var(--muted); stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.big-ring .ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.big-ring b { font-family: var(--f-display); font-weight: 300; font-size: 2.6rem; line-height: 1; }
.big-ring small { color: var(--muted); font-size: .8rem; max-width: 12ch; }
.state-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); font-size: .85rem; }
.state-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.state-good .state-chip .dot { background: var(--good); } .state-warn .state-chip .dot { background: var(--warn); } .state-bad .state-chip .dot { background: var(--bad); }
.hero-num { font-family: var(--f-display); font-weight: 300; font-size: 2.1rem; line-height: 1.2; }
.fg { color: var(--fg); font-weight: 500; }
.focus { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; font-size: 1.05rem; }
.focus .todo { font-size: .9rem; }
.dash .kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dash .kpis .panel { margin: 0; padding: 16px; }
.kpi .hint { margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .big-ring .bar { transition: none; } }

/* bar chart: HTML bars so text keeps its real size on a phone */
.bchart { position: relative; --axis: 52px; }
.bchart .plot { position: relative; height: 200px; margin-left: var(--axis); margin-top: 22px; }
.bchart .tick { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line-soft); }
.bchart .tick span { position: absolute; right: calc(100% + 8px); top: -.6em; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.bchart .be-line { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--fg); z-index: 2; pointer-events: none; }
.bchart .be-line span { position: absolute; right: 0; bottom: 3px; font-size: .74rem; color: var(--fg); background: var(--surface); padding: 0 4px; border-radius: 4px; }
.bchart .cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; z-index: 1; }
.bchart .col { position: relative; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 6px; }
.bchart .col:hover, .bchart .col.on { background: rgba(236, 232, 228, .05); }
.bchart .bar { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: min(70%, 26px); min-height: 2px;
               background: var(--accent); opacity: .55; border-radius: 4px 4px 0 0; }
.bchart .col.today .bar, .bchart .col.on .bar { opacity: 1; }
.bchart .xlabels { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; margin-left: var(--axis); margin-top: 6px;
                   font-size: .7rem; line-height: 1.2; color: var(--muted); text-align: center; }
.bchart .xlabels .today { color: var(--fg); font-weight: 600; }
.state-good .big-ring .bar { stroke: var(--good); } .state-warn .big-ring .bar { stroke: var(--warn); } .state-bad .big-ring .bar { stroke: var(--bad); }
@media (max-width: 600px) { .bchart .xlabels .wd { display: none; } }
.ctip { position: absolute; left: 0; top: 0; z-index: 5; display: flex; flex-direction: column; gap: 2px; pointer-events: none;
        background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: .82rem;
        box-shadow: 0 8px 24px rgba(0, 0, 0, .45); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ctip b { font-weight: 600; text-transform: capitalize; }
.chart-table { margin-top: 14px; font-size: .88rem; }
.chart-table summary { cursor: pointer; color: var(--muted); min-height: 32px; display: flex; align-items: center; }
.chart-table table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.chart-table th, .chart-table td { text-align: right; padding: 6px 4px; border-top: 1px solid var(--line-soft); }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }
.chart-table th { color: var(--muted); font-weight: 400; font-size: .78rem; }
@media (max-width: 600px) { .bchart { --axis: 44px; } .hero-num { font-size: 1.8rem; } }
.tile-today { flex-direction: row; align-items: center; gap: 16px; }
.tile-today .grow { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile-today .done-ring { width: 64px; height: 64px; }
.tile-today .done-ring b { font-size: .95rem; }

/* ---------- Schede clienti ---------- */
.csplit { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.csplit .list-col { padding: 12px; position: sticky; top: 12px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
.csplit .detail-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.csplit .detail-col > .panel { margin-top: 0; }
.clist { margin-top: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; -webkit-overflow-scrolling: touch; }
.citem { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 10px; min-height: 52px; border-radius: 10px; color: var(--fg); text-decoration: none; }
.citem:hover { background: var(--raised); }
.citem[aria-current="page"] { background: var(--accent-soft); }
.citem .cname { min-width: 0; display: flex; flex-direction: column; }
.citem .cname > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.citem .cname b { font-weight: 600; }
.avatar.cl { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--raised); color: var(--fg); font-size: .85rem; font-weight: 600; letter-spacing: .03em; }
.avatar.cl.lg { width: 56px; height: 56px; font-size: 1.15rem; background: var(--accent-soft); color: var(--accent); }
.cempty { padding: 12px 10px; } .cempty p { margin: 0 0 10px; }
.cmore { padding: 8px 10px; margin: 0; }
.chead { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.cfields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cfields .field label { display: flex; justify-content: space-between; gap: 8px; }
.cfields .field label a { text-decoration: none; }
.sexpick { border: 0; padding: 0; margin: 0; min-width: 0; }
.sexpick legend { padding: 0; margin-bottom: 6px; }
.chips { display: flex; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: grid; place-items: center; min-width: 56px; min-height: 48px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; font-weight: 500; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.formactions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.cform .flash { margin-bottom: 16px; }
.cform .flash a { color: inherit; font-weight: 600; }
.cardtypes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cardtype { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line); opacity: .7; }
.danger-zone h2 { font-size: 1.1rem; }
.danger-zone p { margin: 6px 0 12px; max-width: 60ch; }
.cplaceholder { text-align: center; padding: 60px 20px; }
.back-link { display: none; margin-bottom: 10px; text-decoration: none; min-height: 32px; align-items: center; }
@media (max-width: 860px) {
  .csplit { grid-template-columns: 1fr; }
  .csplit .list-col { position: static; max-height: none; }
  .csplit.has-sel .list-col, .csplit:not(.has-sel) .cplaceholder { display: none; }
  .back-link { display: inline-flex; }
  .cfields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) { .cfields, .cardtypes { grid-template-columns: 1fr; } }

/* one client at a time (no list beside it) */
.cnav { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.cjump { flex: 0 1 320px; }
.cjump .in { min-height: 42px; }
.cl-name { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; font-weight: 400; }
.chero .chead { margin-bottom: 12px; }
.ccontacts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.contact { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line);
           color: var(--fg); text-decoration: none; }
.contact svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.contact:hover { border-color: var(--accent); }
.cactions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.kindbtn { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 99px; border: 1px solid var(--line);
           color: var(--fg); text-decoration: none; min-height: 52px; }
.kindbtn .disc { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--k); }
.kindbtn .disc svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.kindbtn:hover { border-color: var(--k); background: var(--raised); }
.cact-sep { flex: 1; }
.cedit { margin-top: 16px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.cedit summary { cursor: pointer; color: var(--muted); min-height: 36px; display: flex; align-items: center; }
.cedit[open] summary { margin-bottom: 12px; }
.ctiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.ctile { display: flex; flex-direction: column; border-radius: 14px; border: 1px solid var(--line-soft); overflow: hidden; color: var(--fg);
         text-decoration: none; scroll-margin-top: 16px; background: var(--surface); }
.ctile:hover { border-color: var(--k); }
.ctile:target { outline: 2px solid var(--accent); }
.ctile-media { position: relative; aspect-ratio: 4 / 3; background: var(--paper); display: grid; place-items: center; overflow: hidden; }
.ctile-media > svg { width: 100%; height: 100%; display: block; }
.ctile-media .disc { width: 72px; height: 72px; border-radius: 50%; border: 1.5px solid var(--k); display: grid; place-items: center; color: #2a2626; }
.ctile-media .disc svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.ctile-media .mcount { position: absolute; right: 8px; bottom: 8px; background: rgba(18, 17, 19, .8); color: #fff; font-size: .8rem; padding: 3px 9px; border-radius: 99px; }
.ctile-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; border-top: 3px solid var(--k); }
.list-wide .clist { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2px 12px; overflow: visible; }

/* ---------- Schede (cards) ---------- */
.k-tecnico { --k: #d9a07a; } .k-stilistico { --k: #9fb7d9; } .k-fashion { --k: #b9a3d6; }
.kind-dot { display: inline-block; width: .62em; height: .62em; border-radius: 50%; background: var(--k, var(--muted)); margin-right: .45em; vertical-align: .08em; }
.newcards { display: flex; gap: 8px; flex-wrap: wrap; }
.ccard { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-soft);
         border-left: 3px solid var(--k); color: var(--fg); text-decoration: none; scroll-margin-top: 16px; }
.ccard + .ccard { margin-top: 10px; }
.ccard:hover { border-color: var(--line); border-left-color: var(--k); background: var(--raised); }
.ccard:target { background: var(--accent-soft); }
.ccard-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.kind-badge { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ccard-main { font-size: 1.02rem; font-weight: 500; }
.ccard-formula { color: var(--fg); opacity: .85; }
.ccard-notes { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-actions { display: flex; gap: 8px; }
.cardform { display: flex; flex-direction: column; gap: 16px; }
.cardform .panel + .panel { margin-top: 0; }
.cardtop { display: flex; gap: 14px 28px; flex-wrap: wrap; align-items: flex-start; }
.staffpick { border: 0; padding: 0; margin: 0; min-width: 0; }
.staffpick legend { padding: 0; margin-bottom: 6px; }
.chips.wrap { flex-wrap: wrap; }
.chip span { padding: 0 14px; gap: 8px; display: inline-flex; align-items: center; justify-content: center; }
.sdot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.subhead { margin: 18px 0 10px; }
.zones { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 16px; align-items: center; }
.zone-head { width: 190px; color: var(--muted); }
.zone-head .zl { stroke: var(--k, #d9a07a); }
.zone-head text { fill: var(--fg); stroke: none; font: 12px var(--f-body); }
.cardform textarea.in { resize: vertical; min-height: 96px; line-height: 1.4; }
.soon-panel { opacity: .7; }
.card-delete { margin-top: 28px; display: flex; justify-content: flex-start; }
@media (max-width: 760px) { .grid3 { grid-template-columns: 1fr; } .zones { grid-template-columns: 1fr; } .zone-head { display: none; } }
@media (max-width: 600px) { .pagehead .row-actions { width: 100%; } .pagehead .row-actions .btn { flex: 1; } }

/* ---------- Photos ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photos:empty { display: none; }
.ph { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--raised); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .phsvg { width: 100%; height: 100%; display: block; }
.ph .draw { position: absolute; left: 6px; top: 6px; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
            background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; }
.ph .draw svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.ph .draw:hover { background: var(--accent); color: var(--accent-ink); }
.lightbox .lb-svg { max-width: 92vw; max-height: 86vh; width: 92vw; height: 86vh; }
.ph a { display: block; height: 100%; }
.ph .x { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
         background: rgba(18, 17, 19, .78); color: var(--fg); font-size: .95rem; display: grid; place-items: center; }
.ph .x:hover { background: var(--bad); }
.ph.pending { outline: 2px dashed var(--accent); outline-offset: -2px; }
.ph .tag { position: absolute; left: 6px; bottom: 6px; font-size: .7rem; background: var(--accent); color: var(--accent-ink);
           padding: 2px 8px; border-radius: 99px; }
.uploader { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; margin-top: 12px;
            border: 1.5px dashed var(--line); border-radius: 12px; color: var(--fg); cursor: pointer; font-weight: 500; }
.uploader:hover, .uploader:focus-within { border-color: var(--accent); color: var(--accent); }
.uploader svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.uploader input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
.lightbox::backdrop { background: rgba(0, 0, 0, .86); }
.lightbox img { display: block; max-width: 96vw; max-height: 90vh; border-radius: 8px; }
.lightbox form { position: absolute; top: 8px; right: 8px; }
.lightbox .btn { background: rgba(18, 17, 19, .8); min-height: 44px; width: 44px; padding: 0; }
.ccard-thumbs { display: flex; gap: 6px; margin: 4px 0 2px; }
.ccard-thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--raised); }
.ccard-thumbs .more { width: 56px; height: 56px; border-radius: 8px; background: var(--raised); display: grid; place-items: center; font-size: .85rem; color: var(--muted); }

/* ---------- Drawings on the heads ---------- */
:root { --paper: #f3ede7; }
.heads { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.headbtn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px 10px; border-radius: 14px;
           border: 1px solid var(--line-soft); background: none; color: var(--muted); font: inherit; font-size: .82rem; cursor: pointer; }
.headbtn:hover { border-color: var(--accent); }
.headbtn.has { color: var(--fg); border-color: var(--line); }
.headbtn svg, .ccard-thumbs svg { width: 100%; aspect-ratio: 200 / 240; background: var(--paper); border-radius: 10px; }
.ccard-thumbs svg { width: 47px; height: 56px; border-radius: 8px; }
@media (max-width: 600px) { .heads { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.drawer { width: min(1100px, 100vw); max-width: 100vw; height: min(820px, 100dvh); max-height: 100dvh; padding: 0;
          border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--fg); overflow: hidden; }
.drawer[open] { display: flex; flex-direction: column; }
.drawer::backdrop { background: rgba(0, 0, 0, .7); }
.dtop { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.views { display: flex; gap: 6px; overflow-x: auto; flex: 1; }
.vchip { min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: none; color: var(--muted);
         font: inherit; font-size: .88rem; white-space: nowrap; cursor: pointer; }
.vchip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.dbody { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 260px; }
.dstage { min-height: 0; display: grid; place-items: center; padding: 12px; background: #0d0c0e; }
.dstage svg { height: 100%; max-height: 100%; max-width: 100%; aspect-ratio: 200 / 240; background: var(--paper); border-radius: 14px;
              touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; }
.dstage svg[data-tool="eraser"] { cursor: cell; }
.dtools { display: flex; flex-direction: column; gap: 16px; padding: 14px; overflow-y: auto; border-left: 1px solid var(--line-soft); }
.toolgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dstyle { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dstyle .tool { height: 44px; }
.stamps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stamps .hint { grid-column: 1 / -1; }
.stampbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; }
.stampbtn svg { width: 34px; height: 34px; }
.stampbtn svg text { display: none; }
.stampbtn small { font-size: .7rem; line-height: 1; margin-top: -4px; }
.selbar { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--raised); }
.selbar { flex-wrap: wrap; }
.selbar .small { flex: 1 1 100%; }
.dstage svg[data-tool="select"] { cursor: default; }
.dstage { position: relative; }
.zoombar { position: absolute; right: 18px; bottom: 18px; display: flex; border-radius: 99px; overflow: hidden;
           background: rgba(20, 18, 20, .82); border: 1px solid var(--line); }
.zoombar button { min-width: 48px; height: 44px; border: 0; background: none; color: var(--fg); font: inherit; font-size: 1.15rem; cursor: pointer; }
.zoombar [data-zoom="reset"] { font-size: .8rem; min-width: 58px; color: var(--muted); }
.dmsg { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); margin: 0; padding: 8px 14px; border-radius: 99px;
        background: var(--accent); color: var(--accent-ink); font-size: .9rem; }
.segbtns { display: flex; border: 1px solid var(--line); border-radius: 99px; padding: 3px; gap: 2px; }
.segbtns button { flex: 1; min-height: 40px; border: 0; border-radius: 99px; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.segbtns button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
#d-copyside { align-self: flex-start; }
.hlegend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--muted); }
.hlegend li { display: flex; align-items: center; gap: 6px; }
.hlegend svg { width: 30px; height: 30px; background: var(--paper); border-radius: 6px; }
.stepbar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px;
           border-radius: 99px; background: rgba(20, 18, 20, .88); border: 1px solid var(--line); padding: 3px; }
.stepbar button { min-width: 44px; height: 42px; border: 0; border-radius: 99px; background: none; color: var(--fg); font: inherit; cursor: pointer; }
.stepbar [data-step="play"] { padding: 0 14px; background: var(--accent); color: var(--accent-ink); }
.stepbar span { min-width: 62px; text-align: center; color: var(--muted); font-size: .85rem; }
.drawer.replaying .dtools { opacity: .35; pointer-events: none; }
.drawer.replaying .zoombar, .drawer.readonly .zoombar { bottom: 74px; }
.drawer.readonly .dbody { grid-template-columns: 1fr; }
.dstage .appear { animation: appear .6s ease-out; }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
.modelpick { width: min(720px, 96vw); max-height: 90dvh; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--fg); padding: 18px; }
.modelpick::backdrop { background: rgba(0, 0, 0, .7); }
.modellist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.modelbtn { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: none;
            color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.modelbtn:hover { border-color: var(--accent); }
.modelbtn svg { width: 100%; aspect-ratio: 200 / 240; background: var(--paper); border-radius: 10px; }
.modelbtn small { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.diagram-card { display: flex; gap: 14px; align-items: flex-start; }
.diagram-card svg { width: 72px; flex: none; aspect-ratio: 200 / 240; background: var(--paper); border-radius: 8px; }
.tool { height: 52px; border-radius: 12px; border: 1px solid var(--line); background: none; color: var(--fg); cursor: pointer; display: grid; place-items: center; }
.tool svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tool[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sw { height: 44px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; }
.sw[aria-pressed="true"] { border-color: var(--fg); box-shadow: 0 0 0 2px var(--surface) inset; }
.dtools input[type="range"] { width: 100%; accent-color: var(--accent); }
.dhist { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dhist .tool { width: 52px; }
@media (max-width: 760px), (max-height: 560px) {
  .drawer { border-radius: 0; height: 100dvh; width: 100vw; }
  .dbody { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .dtools { border-left: 0; border-top: 1px solid var(--line-soft); height: min(42dvh, 330px); }
  .swatches { grid-template-columns: repeat(8, 1fr); }
}


/* ---------- Team ---------- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: 3px; gap: 2px; }
.seg a { padding: 8px 14px; border-radius: 99px; color: var(--muted); text-decoration: none; font-size: .9rem; white-space: nowrap; }
.seg a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.team-grid > .panel { margin-top: 0; display: flex; flex-direction: column; gap: 14px; }
.person-head { display: flex; align-items: center; gap: 12px; }
.person-head h2 { font-size: 1.3rem; }
.rank { font-family: var(--f-display); font-size: 1.5rem; color: var(--muted); width: 1.4em; text-align: center; }
.avatar.md { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: var(--accent-ink); flex: none; }
.mrow { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: .93rem; }
.mrow dt { color: var(--muted); } .mrow dd { margin: 0; text-align: right; }
.mrow dd b { font-weight: 600; font-size: 1.05rem; }
.prod-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.prod .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.prod.state-good .dot, .prod.state-good .meter i { background: var(--good); }
.prod.state-warn .dot, .prod.state-warn .meter i { background: var(--warn); }
.prod.state-bad .dot, .prod.state-bad .meter i { background: var(--bad); }
.meter { position: relative; height: 10px; border-radius: 99px; background: var(--raised); }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--muted); }
.meter .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--fg); opacity: .6; }
.person .tip { margin: 0; }

/* ---------- Menu dei desideri ---------- */
.k-taglio { --k: #9fb7d9; } .k-colore { --k: #d9a07a; } .k-piega { --k: #b9a3d6; } .k-trattamento { --k: #8fc7b4; }
.desire-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.desire-grid > .panel { margin-top: 0; display: flex; flex-direction: column; gap: 8px; border-top: 3px solid var(--k, var(--accent)); }
.desire h2 { font-size: 1.3rem; }
.desire p { margin: 0; }
.desire .mrow { margin-top: auto; padding-top: 8px; }
.sim { margin-top: 18px; }
.simform { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.simform .grow { flex: 1; min-width: 200px; }
.simres { font-size: 1.15rem; margin: 16px 0 0; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { text-align: right; padding: 9px 8px; border-top: 1px solid var(--line-soft); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; white-space: normal; }
.tbl th { color: var(--muted); font-weight: 400; font-size: .78rem; border-top: 0; }
.pill.tiny { font-size: .66rem; padding: 0 7px; vertical-align: .1em; }

/* ---------- Extra ---------- */
.extra-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.extra-grid > .panel { margin-top: 0; }
.extra-card { display: flex; flex-direction: column; gap: 8px; color: var(--fg); text-decoration: none; min-height: 140px; }
.extra-card:hover { border-color: var(--accent); }
.extra-card h2 { font-size: 1.3rem; }
.reader { max-width: 70ch; margin-top: 18px; font-size: 1.04rem; line-height: 1.6; }
.reader > :first-child { margin-top: 0; } .reader > :last-child { margin-bottom: 0; }
.reader p, .reader li { color: #d9d4cf; }
.reader li + li { margin-top: 6px; }
.reader h2, .reader h3 { margin: 1.2em 0 .4em; }
.reader strong { color: var(--fg); }
.levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-block: 14px; }
.levels div { border-radius: 8px; padding: 30px 6px 6px; font-size: .75rem; line-height: 1.25; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
@media (max-width: 600px) { .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.reader-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; max-width: 70ch; }

.validfrom { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; align-items: end; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.validfrom .hint { margin: 0 0 4px; }
@media (max-width: 600px) { .validfrom { grid-template-columns: 1fr; } }

/* ---------- Andamento ---------- */
.periodbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.seg.wrap { flex-wrap: wrap; }
.cmpnote { margin: 0 0 14px; }
.tiles-k { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.tiles-k > .panel { margin-top: 0; }
.ktile { display: flex; flex-direction: column; gap: 6px; }
.ktile.big { grid-column: span 2; }
.ktile .kv { font-family: var(--f-display); font-weight: 300; font-size: 1.9rem; line-height: 1.1; }
.ktile.big .kv { font-size: 2.6rem; }
.ktile.state-good .kv { color: var(--good); } .ktile.state-bad .kv { color: var(--bad); }
.delta { margin-top: auto; padding-top: 4px; font-size: .9rem; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted); }
.delta.good { color: var(--good); } .delta.bad { color: var(--bad); }
.delta.none { font-weight: 400; font-size: .8rem; }
.warnline { color: var(--warn); }
.forecast { margin-top: 16px; }
.forecast p { font-size: 1.1rem; margin: 6px 0; }
@media (max-width: 600px) { .ktile.big { grid-column: auto; } .ktile.big .kv { font-size: 2.1rem; } }
.tiles-k + .panel, .forecast + .panel { margin-top: 16px; }
@media (max-width: 600px) {
  .tiles-k { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tiles-k > .panel { padding: 14px; }
  .ktile.big { grid-column: 1 / -1; }
  .ktile .kv { font-size: 1.45rem; }
  .seg.wrap { border-radius: 18px; }
  .seg a { padding: 7px 11px; font-size: .85rem; }
}

/* ---------- Andamento: charts and breakdowns ---------- */
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 0 0 6px; font-size: .85rem; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.l-cur, .l-prev, .l-yoy { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.l-cur { stroke: var(--accent); stroke-width: 2.5; }
.l-prev { stroke: #a39d97; stroke-width: 1.5; stroke-dasharray: 6 4; }
.l-yoy { stroke: #8a847e; stroke-width: 1.5; stroke-dasharray: 1 4; }
.lchart { position: relative; --axis: 56px; }
.lchart .plot { position: relative; height: 240px; margin: 22px 0 0 var(--axis); touch-action: pan-y; cursor: crosshair; }
.lchart .tick { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line-soft); }
.lchart .tick span { position: absolute; right: calc(100% + 8px); top: -.6em; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.lchart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.enddot { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); transform: translate(-50%, -50%); }
.endlabel { position: absolute; transform: translate(-50%, calc(-100% - 10px)); font-size: .8rem; color: var(--fg); background: var(--surface); padding: 0 4px; border-radius: 4px; white-space: nowrap; }
.xhair { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--fg); opacity: .4; pointer-events: none; }
.xticks { position: relative; height: 1.4em; margin-left: var(--axis); margin-top: 6px; font-size: .72rem; color: var(--muted); }
.xticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ctip .k-cur::before, .ctip .k-prev::before, .ctip .k-yoy::before { content: ""; display: inline-block; width: 14px; margin-right: 6px; vertical-align: middle; border-top: 2px solid var(--accent); }
.ctip .k-prev::before { border-top: 2px dashed #a39d97; } .ctip .k-yoy::before { border-top: 2px dotted #8a847e; }
.mchart .col { display: block; }
.mchart .bar { width: min(64%, 30px); }
.mchart .col.partial .bar { opacity: .35; background: repeating-linear-gradient(135deg, var(--accent) 0 4px, transparent 4px 7px); }
.mchart .mark { position: absolute; left: 12%; right: 12%; height: 0; border-top: 2px solid var(--fg); pointer-events: none; }
.mchart .xlabels small { color: var(--muted); font-size: .65rem; }
.sw-bar { display: inline-block; width: 12px; height: 12px; border-radius: 3px 3px 0 0; background: var(--accent); }
.sw-mark { display: inline-block; width: 16px; border-top: 2px solid var(--fg); }
.brow { display: grid; grid-template-columns: minmax(0, 1fr) 6.5em; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); align-items: baseline; }
.brow .bl { font-weight: 500; }
.brow .bv { text-align: right; }
.brow .bt { grid-column: 1; height: 8px; border-radius: 99px; background: var(--raised); position: relative; overflow: hidden; align-self: center; }
.brow .bt i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--accent); }
.brow .delta { grid-column: 2; padding-top: 0; margin: 0; text-align: right; font-size: .82rem; }
@media (max-width: 600px) { .lchart { --axis: 46px; } .lchart .plot { height: 200px; } }
.brow .btop { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.endlabel.right { transform: translate(-100%, calc(-100% - 10px)); }
.lchart .plot { margin-top: 0; }
.lchart { padding-top: 22px; }
.mchart { padding-top: 22px; } .mchart .plot { margin-top: 0; }

/* ---------- Visits and recall ---------- */
.btn .count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px;
              background: var(--accent); color: var(--accent-ink); font-size: .78rem; font-weight: 600; }
.vstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.vstats > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vstats b { font-family: var(--f-display); font-weight: 400; font-size: 1.3rem; }
.vrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.vrow .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vrow .amt { text-align: right; min-width: 70px; }
.rrow { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.rrow:first-child { border-top: 0; }
.rname { display: flex; align-items: center; gap: 12px; color: var(--fg); text-decoration: none; min-width: 0; }
.rname > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.ractions { display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 760px) {
  .vstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vrow { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; } .vrow > :nth-child(3) { display: none; }
  .rrow { grid-template-columns: minmax(0, 1fr) auto; } .rrow .rlast { grid-column: 1; grid-row: 2; padding-left: 50px; }
  .rrow .ractions { grid-row: 1 / 3; grid-column: 2; flex-direction: column; }
}

/* Nuovo incasso: Per chi? */
.step legend .opt { font-family: var(--f-body); font-size: .8rem; margin-left: 6px; }
.cpick { position: relative; max-width: 560px; }
.cchosen { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 6px 6px 16px; border-radius: 12px;
           background: var(--accent-soft); border: 1px solid rgba(217, 180, 154, .4); }
.cchosen .grow { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.csugg { display: flex; flex-direction: column; margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--raised); }
.csug { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 52px; padding: 8px 14px; border: 0;
        border-top: 1px solid var(--line-soft); background: none; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.csug:first-child { border-top: 0; }
.csug:hover, .csug:focus-visible { background: var(--accent-soft); }
.csug.new { color: var(--accent); font-weight: 500; }

/* ---------- Agenda ---------- */
.cap::first-letter { text-transform: uppercase; }
.subh { font-family: var(--f-display); font-weight: 400; font-size: 1.1rem; margin: 18px 0 8px; }
.headactions { display: flex; gap: 8px; flex-wrap: wrap; }
.daybar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.weekstrip { display: grid; grid-template-columns: repeat(7, minmax(52px, 1fr)); gap: 4px; flex: 1 1 420px; }
.wday { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 2px; border-radius: 12px; border: 1px solid var(--line-soft);
  color: var(--fg); text-decoration: none; background: var(--surface); line-height: 1.2; }
.wday .wd { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.wday b { font-family: var(--f-display); font-weight: 400; font-size: 1.25rem; }
.wday .wn { font-size: .72rem; color: var(--accent); min-height: 1.1em; }
.wday.closed { opacity: .5; } .wday.closed .wn { color: var(--muted); }
.wday.today b { color: var(--accent); }
.wday[aria-current="date"] { border-color: var(--accent); background: var(--accent-soft); }
.daybar .jump { display: flex; gap: 6px; }
.daybar .jump .in { width: 130px; min-height: 38px; padding: 6px 10px; }

.agrid { --ppm: 1.6px; --tcol: 52px; overflow-x: auto; margin: 0 calc(-1 * clamp(0px, 1vw, 8px)); padding-bottom: 6px; }
.arow { display: grid; grid-template-columns: var(--tcol) repeat(var(--n), minmax(150px, 1fr)); min-width: calc(var(--tcol) + var(--n) * 150px); }
.ahead { padding-bottom: 6px; }
.ahname { display: flex; align-items: center; gap: 8px; font-weight: 500; padding: 0 6px; white-space: nowrap; overflow: hidden; }
.atimes, .acol { position: relative; height: calc(var(--span) * var(--ppm)); }
.atimes span { position: absolute; top: calc(var(--t) * var(--ppm)); right: 8px; transform: translateY(-50%); font-size: .74rem; color: var(--muted); }
.atimes span:first-child { transform: none; }
.acol { border-left: 1px solid var(--line-soft); cursor: copy;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(rgba(54, 51, 58, .45) 1px, transparent 1px);
  background-size: 100% calc(60 * var(--ppm)), 100% calc(30 * var(--ppm)); }
.ashade { position: absolute; left: 0; right: 0; top: calc(var(--t) * var(--ppm)); height: calc(var(--h) * var(--ppm));
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 6px, transparent 6px 12px), rgba(0, 0, 0, .28); pointer-events: none; }
.appt { position: absolute; z-index: 2; top: calc(var(--t) * var(--ppm) + 1px); height: calc(var(--h) * var(--ppm) - 2px);
  left: calc(var(--l) * 100% / var(--k) + 3px); width: calc(100% / var(--k) - 6px);
  display: flex; flex-direction: column; gap: 1px; padding: 4px 7px; overflow: hidden; border-radius: 8px;
  background: var(--raised); background: color-mix(in srgb, var(--c) 24%, var(--surface)); border-left: 4px solid var(--c);
  color: var(--fg); text-decoration: none; font-size: .8rem; line-height: 1.25; cursor: pointer; }
.appt:hover { outline: 1px solid var(--c); }
.appt:target { outline: 2px solid var(--accent); }
.appt .at { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.appt .an { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .as { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.appt .as.note { font-style: italic; }
.appt.short { padding-top: 2px; padding-bottom: 2px; }
.appt.short .as { display: none; }
.appt.tiny { flex-direction: row; align-items: center; gap: 6px; padding-top: 0; padding-bottom: 0; }
.appt.tiny .at > span { display: none; }
.appt .due { color: var(--warn); }
.appt .ok { color: var(--good); } .appt .ns { color: var(--bad); } .appt .rm { color: var(--muted); }
.appt.done { background: var(--surface); }
.appt.noshow { background: repeating-linear-gradient(135deg, rgba(226, 103, 92, .12) 0 6px, transparent 6px 12px), var(--surface); }
.appt.noshow .an { text-decoration: line-through; }
.appt.blocked { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 6px, transparent 6px 12px), var(--raised); border-left-color: var(--muted); }
.anow { position: absolute; z-index: 3; left: -1px; right: 0; top: calc(var(--t) * var(--ppm)); border-top: 2px solid var(--bad); pointer-events: none; }
.anow::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.crow { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-soft); color: var(--fg); text-decoration: none; }
@media (max-width: 600px) {
  .agrid { --ppm: 1.4px; --tcol: 44px; }
  .arow { grid-template-columns: var(--tcol) repeat(var(--n), minmax(124px, 1fr)); min-width: calc(var(--tcol) + var(--n) * 124px); }
  .weekstrip { grid-template-columns: repeat(7, minmax(0, 1fr)); flex-basis: 100%; order: -1; }
  .wday b { font-size: 1.05rem; }
  .daybar .jump { margin-left: auto; }
  .daybar .jump .in { width: 112px; }
  .headactions .btn { min-height: 40px; padding: 0 14px; font-size: .92rem; }
}

/* the appointment page */
.apptcard { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; border-left: 4px solid var(--c); margin: 14px 0 0; }
.apptcard .big { font-family: var(--f-display); font-size: 1.5rem; margin: 6px 0 2px; }
.apptcard .big a { color: var(--fg); }
.apptcard .grow { flex: 1 1 260px; min-width: 0; }
.cardactions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cardactions form { display: contents; }
.apptform { margin-top: 18px; }
.whenrow { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 140px); gap: 12px; }
.cnew-phone { margin-top: 10px; max-width: 320px; }
.nextappt { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.nextappt a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--fg); text-decoration: none; }
.nextappt .eyebrow { flex-basis: 100%; }
.remrow { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 6px 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.remrow:first-child { border-top: 0; }
.remrow .rt { font-family: var(--f-display); font-weight: 400; font-size: 1.15rem; }
.remrow .rwho { display: flex; flex-direction: column; min-width: 0; }
.remrow .rwho a { color: var(--fg); text-decoration: none; }
.remrow .dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; vertical-align: 1px; }
.remrow .ractions { display: flex; gap: 6px; }
.remrow .ractions form { display: contents; }
.remrow.sent .rt, .remrow.sent .rwho { opacity: .65; }
@media (max-width: 600px) {
  .remrow { grid-template-columns: 48px minmax(0, 1fr); }
  .remrow .rlast, .remrow .ractions { grid-column: 2; }
}

/* Il tuo salone: opening hours */
.hours { display: flex; flex-direction: column; gap: 6px; }
.hrow { display: grid; grid-template-columns: 150px repeat(4, minmax(0, 110px)); gap: 8px; align-items: center; }
.hrow.head span { font-size: .74rem; color: var(--muted); }
.hrow .in { min-height: 40px; padding: 6px 10px; }
.hrow:has(input[type=checkbox]:not(:checked)) select { opacity: .35; }
.wdtable { border-collapse: collapse; }
.wdtable th, .wdtable td { padding: 6px 8px; border-top: 1px solid var(--line-soft); text-align: center; }
.wdtable thead th { font-size: .74rem; color: var(--muted); font-weight: 400; border-top: 0; }
.wdtable tbody th { text-align: left; font-weight: 500; white-space: nowrap; }
.wdtable tbody th .avatar { display: inline-grid; vertical-align: middle; margin-right: 6px; }
.wdtable input { width: 22px; height: 22px; accent-color: var(--accent); }
@media (max-width: 600px) {
  .hrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hrow.head { display: none; }
  .hrow .check { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .wdtable th, .wdtable td { padding: 6px 3px; }
  .wdtable tbody th .avatar { display: none; }
}

/* ---------- App shell, as in the prototype: icon rail on the left, tab bar on phones ---------- */
svg.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.rail { position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; width: 84px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 0 calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-right: 1px solid var(--line-soft); overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail .logo { width: 44px; height: 44px; margin-bottom: 10px; color: var(--fg); flex: none; }
.rail .logo svg { width: 100%; height: 100%; }
.rail .sep { width: 36px; height: 1px; background: var(--line); margin: 8px 0; flex: none; }
.navbtn { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 72px; padding: 8px 2px; border-radius: 12px; flex: none;
  color: var(--muted); font: inherit; font-size: .68rem; letter-spacing: .02em; text-decoration: none; background: none; border: 0; cursor: pointer; }
.navbtn:hover { color: var(--fg); background: var(--raised); }
.navbtn[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.railfoot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.who-initial { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--fg); font-size: .8rem; font-weight: 600; }
.tabbar { display: none; }
body:has(.rail) { padding-left: 84px; }
@media (max-width: 760px) {
  .rail { display: none; }
  body:has(.rail) { padding-left: 0; padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  .tabbar { display: flex; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; justify-content: space-around;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line-soft); }
  .tabbar .navbtn { width: auto; flex: 1; min-width: 0; padding: 6px 0; }
  #confirm { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
.page { padding-top: max(24px, env(safe-area-inset-top, 0px)); }

/* the "Altro" page on phones */
.menulist { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 18px 0; }
.menulist a { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line-soft); color: var(--fg); text-decoration: none; }
.menulist .sep { grid-column: 1 / -1; height: 1px; background: var(--line-soft); margin: 4px 0; }
.menufoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Home: the prototype's hero ---------- */
.homehero { position: relative; border-radius: 22px; overflow: hidden; background: #0b0a0b; min-height: 400px; display: flex; flex-direction: column;
  justify-content: space-between; padding: 26px clamp(18px, 3vw, 34px); }
.homehero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.homehero > *:not(canvas) { position: relative; }
.herotop { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.homehero .wordmark svg { width: 46px; height: 46px; }
.homehero .wordmark b { font-size: 1.7rem; }
.salonchip { font-size: .78rem; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; background: rgba(11, 10, 11, .6); }
.band { position: relative; margin-block: 26px 10px; --disc: clamp(84px, 11vw, 112px); }
.band::before { content: ""; position: absolute; left: -40px; right: 30%; top: calc(var(--disc) * .225); height: calc(var(--disc) * .55);
  background: linear-gradient(90deg, rgba(150, 148, 150, .55), rgba(150, 148, 150, .08)); }
.rounds { position: relative; display: flex; gap: clamp(14px, 3vw, 34px); flex-wrap: wrap; }
.round { display: flex; flex-direction: column; align-items: center; gap: 10px; width: calc(var(--disc) + 14px); text-align: center;
  color: var(--fg); text-decoration: none; font-size: .9rem; font-weight: 300; letter-spacing: .04em; line-height: 1.2; }
.round .disc { width: var(--disc); height: var(--disc); border-radius: 50%; background: #0d0c0d; border: 2px solid #e8e4e0; display: grid; place-items: center;
  box-shadow: 0 0 0 5px #0d0c0d, 0 0 0 6px rgba(232, 228, 224, .35); transition: transform .2s; }
.round:hover .disc { transform: translateY(-3px); }
.round .disc svg { width: 44%; height: 44%; stroke-width: 1.2; }
.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.archive { display: flex; align-items: center; gap: 14px; color: var(--fg); text-decoration: none; }
.archive b { font-weight: 500; }
.archive .disc { width: 70px; height: 70px; border-radius: 50%; border: 2px solid #e8e4e0; display: grid; place-items: center; background: #0d0c0d; flex: none; }
.archive .disc svg { width: 32px; height: 32px; stroke-width: 1.3; }
.homegrid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 16px; margin-top: 16px; }
.homegrid > .panel { margin-top: 0; }
.home .install { margin-top: 16px; }
.tile .count { font-family: var(--f-body); font-size: .8rem; vertical-align: 3px; }
.tile-today .done-ring.big { width: 96px; height: 96px; }
.tile-today .done-ring.big b { font-size: 1.25rem; }
.tile-today .done-ring.big small { bottom: 22px; font-size: .6rem; }
.tile-today .done-ring.big b { align-content: start; padding-top: 30px; }
@media (max-width: 900px) { .homegrid { grid-template-columns: 1fr 1fr; } .homegrid .tile-today { grid-column: 1 / -1; } }
@media (max-width: 600px) {
  .homegrid { grid-template-columns: 1fr; }
  .homehero { min-height: 0; gap: 18px; padding: 20px 16px; }
  .homehero .wordmark b { font-size: 1.4rem; }
  .band { --disc: 66px; margin-block: 8px 0; }
  .rounds { gap: 8px; justify-content: space-between; flex-wrap: nowrap; }
  .round { font-size: .76rem; width: auto; flex: 1; min-width: 0; }
}

/* choosing the client for a new card */
.typehead { display: flex; align-items: center; gap: 16px; }
.typehead .disc { width: 64px; height: 64px; border-radius: 50%; border: 2px solid #e8e4e0; display: grid; place-items: center; flex: none; }
.typehead .disc svg { width: 30px; height: 30px; stroke-width: 1.2; }
.pickform { max-width: 640px; display: flex; flex-direction: column; gap: 12px; }
.pickform .btn { align-self: flex-start; }

/* ---------- Admin, setup guide, logins ---------- */
.adminbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: -8px 0 18px;
  padding: 8px 8px 8px 14px; border-radius: 12px; background: rgba(227, 185, 85, .1); border: 1px solid rgba(227, 185, 85, .35); color: var(--warn); font-size: .9rem; }
.adminbar span { flex: 1 1 220px; } .adminbar b { color: var(--fg); font-weight: 500; }
.adminbar svg.i { width: 18px; height: 18px; vertical-align: -4px; margin-right: 4px; }
.newsalon { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.newsalon .grow { flex: 1 1 260px; }
.salonrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.salonrow:first-child { border-top: 0; padding-top: 0; }
.salonrow .grow { flex: 1 1 320px; min-width: 0; }
.salonrow form { display: contents; }
.st { font-weight: 500; } .st-setup { color: var(--warn); } .st-invited { color: var(--accent); } .st-active { color: var(--good); }
.stepper { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; padding: 0; margin: 18px 0 20px; }
.stepper a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; color: var(--muted); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line-soft); min-height: 48px; }
.stepper .n { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); font-size: .82rem; }
.stepper .t { font-size: .86rem; line-height: 1.2; }
.stepper .done .n { background: var(--good); border-color: var(--good); color: #10251a; }
.stepper .cur a { border-color: var(--accent); color: var(--fg); background: var(--accent-soft); }
@media (max-width: 760px) { .stepper { grid-template-columns: repeat(6, 1fr); } .stepper .t { display: none; } .stepper a { justify-content: center; padding: 8px 0; } }
.stephead { margin-bottom: 14px; } .stephead h2 { font-size: 1.4rem; }
.stepnav { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.typical { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-color: rgba(217, 180, 154, .4); }
.setupbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; color: var(--fg); text-decoration: none;
  border-color: rgba(217, 180, 154, .45); background: var(--accent-soft); }
.setupbar .grow { flex: 1 1 260px; }
.loginrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.loginrow .grow { flex: 1 1 240px; min-width: 0; }
.loginrow.off { opacity: .55; }
.loginrow form { display: inline; }
.loginnew { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, .8fr) auto; }
@media (max-width: 760px) { .loginnew { grid-template-columns: 1fr 1fr; } .loginnew .field:nth-child(3) { grid-column: 1 / -1; } .loginnew .rowactions { grid-column: 1 / -1; } }
.linkcard { border-color: rgba(217, 180, 154, .5); margin-bottom: 16px; }
.linkrow { display: flex; gap: 8px; } .linkrow .in { flex: 1; font-size: .85rem; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
code { font-size: .88em; background: var(--raised); padding: 1px 6px; border-radius: 6px; }

/* ---------- Packages: shaded modules, subscription ---------- */
.navbtn.locked, .menulist a.locked, .tile.locked, .archive.locked, .btn.locked { opacity: .5; }
.navbtn.locked { position: relative; }
.navbtn.locked::after, .menulist a.locked::after, .tile.locked .big::after, .btn.locked::after {
  content: ""; display: inline-block; width: 11px; height: 11px; vertical-align: -1px; margin-left: 5px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Crect x='5' y='10.5' width='14' height='10' rx='2'/%3E%3Cpath d='M8 10.5V7.5a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Crect x='5' y='10.5' width='14' height='10' rx='2'/%3E%3Cpath d='M8 10.5V7.5a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat; }
.navbtn.locked::after { position: absolute; top: 6px; right: 14px; margin: 0; }
.locked-page { max-width: 720px; }
.lockdisc { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); margin-bottom: 12px; color: var(--accent); }
.lockdisc svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.planchips { display: flex; gap: 8px; flex-wrap: wrap; }
.planchip { border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; }
.locked-cell { display: flex; flex-direction: column; gap: 2px; color: var(--fg); text-decoration: none; opacity: .6; }
.billbar { display: block; margin: -8px 0 16px; padding: 10px 14px; border-radius: 12px; font-size: .92rem; text-decoration: none;
  background: var(--accent-soft); border: 1px solid rgba(217, 180, 154, .4); color: var(--fg); }
.billbar.ro { background: rgba(226, 103, 92, .12); border-color: rgba(226, 103, 92, .45); }
.billbar .more { color: var(--accent); margin-left: 6px; white-space: nowrap; }
.substate b, .substate { font-weight: 500; } .substate.warn { color: var(--warn); } .substate.ro { color: var(--bad); }
.plancols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.plancol { border: 1px solid var(--line-soft); border-radius: var(--r); padding: 16px; }
.plancol.mine { border-color: var(--accent); background: var(--accent-soft); }
.plancol h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.3rem; margin-top: 4px; }
.incl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: .88rem; }
.incl li::before { content: "✓"; color: var(--good); margin-right: 8px; }
.incl li.no { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(163, 157, 151, .5); }
.incl li.no::before { content: "–"; color: var(--muted); }
/* admin */
.salonname { color: var(--fg); font-weight: 600; text-decoration: none; }
.salonname:hover { color: var(--accent); }
.duelist { border-color: rgba(227, 185, 85, .35); }
.duerow { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line-soft); color: var(--fg); text-decoration: none; }
.duerow:first-of-type { border-top: 0; }
.inlineform { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inlineform .in { flex: 1 1 200px; width: auto; }
.paybox { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.periodpick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.periodpick label { cursor: pointer; }
.periodpick input { position: absolute; opacity: 0; }
.periodpick span { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); min-height: 64px; }
.periodpick small { color: var(--muted); font-size: .76rem; }
.periodpick input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.periodpick input:focus-visible + span { outline: 2px solid var(--accent); }
.payrow { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto 40px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.payrow:first-of-type { border-top: 0; }
.dangerzone summary { cursor: pointer; color: var(--bad); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .grid3, .periodpick { grid-template-columns: 1fr; } }
.planform { display: flex; flex-direction: column; gap: 12px; }
.planform.off { opacity: .6; }
.planform-head { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.planform-head .grow { flex: 1 1 200px; }
.modpick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; }
.modpick legend { margin-bottom: 8px; }

/* ---------- Extra written in the app ---------- */
.promo-grid, .homepromos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.homepromos { margin-top: 16px; }
.homepromos > .panel, .promo-grid > .panel { margin-top: 0; }
.promo-card { display: flex; gap: 14px; align-items: flex-start; color: var(--fg); text-decoration: none; border-color: rgba(217, 180, 154, .35); }
.promo-card:hover { border-color: var(--accent); }
.promo-card img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; flex: none; }
.promo-card .grow { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.promo-card h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.2rem; margin: 0; }
.kind-badge.promo { color: var(--accent); border-color: rgba(217, 180, 154, .5); }
.until { color: var(--warn); }
.filerow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.filerow:first-child { border-top: 0; }
.filerow .grow { flex: 1 1 240px; color: var(--fg); text-decoration: none; min-width: 0; }
.fileext { flex: none; width: 76px; text-align: center; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 4px; }
.extra-img { display: block; max-width: 100%; border-radius: 12px; margin: 0 0 16px; }
.extraform { display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.extraform .panel + .panel { margin-top: 0; }
.kindpick { border: 1px solid var(--line); margin: 0; }
.kindpick legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.kindpick label { cursor: pointer; }
.kindpick input { position: absolute; opacity: 0; }
.kindpick span { display: block; padding: 8px 14px; border-radius: 99px; color: var(--muted); font-size: .9rem; }
.kindpick input:checked + span { background: var(--accent-soft); color: var(--accent); }
.kindpick input:focus-visible + span { outline: 2px solid var(--accent); }
textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; line-height: 1.5; }
.mini-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; vertical-align: middle; }
.check.inline { display: inline-flex; font-size: .8rem; }
.check.inline input { width: 16px; height: 16px; }


/* ---------- A card, as in the old HairSchedula: pictures large on the left, details on the right ---------- */
.cardview { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; align-items: start; }
.cv-info { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cv-info > .panel { margin-top: 0; }
.cv-media { position: sticky; top: 12px; max-height: calc(100dvh - 24px); overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
            padding: 2px 4px 12px 2px; -webkit-overflow-scrolling: touch; }
.cv-kind { display: flex; flex-direction: column; align-items: center; gap: 8px; font-family: var(--f-display); font-size: 1.2rem; letter-spacing: .04em; }
.cv-kind .disc { width: 92px; height: 92px; border-radius: 50%; border: 2px solid #e8e4e0; display: grid; place-items: center; background: #0d0c0d;
                 box-shadow: 0 0 0 4px color-mix(in srgb, var(--k) 35%, transparent); }
.cv-kind .disc svg { width: 44px; height: 44px; fill: none; stroke: #e8e4e0; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.cv-tools { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.cv-tools .btn { gap: 8px; min-height: 48px; }
.cv-tools .btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.cv-tools .uploader { margin: 0; border-style: solid; position: relative; }
.cv-strip { display: flex; flex-direction: column; gap: 14px; }
.gallery { display: flex; flex-direction: column; gap: 14px; }
.gallery:empty { display: none; }
.gallery .ph { aspect-ratio: auto; background: #0d0c0d; border-radius: 12px; }
.gallery .ph a { height: auto; }
.gallery .ph .phsvg, .gallery .ph img { width: 100%; height: auto; max-height: 70dvh; display: block; object-fit: contain; }
.gallery-heads .gtile { position: relative; padding: 0; border: 0; border-radius: 12px; background: var(--paper); cursor: pointer; display: block; width: 100%; }
.gallery-heads .gtile:not(.has) { display: none; }
.gallery-heads .gtile svg { width: 100%; aspect-ratio: 4 / 3; display: block; border-radius: 12px; background: var(--paper); }
.gallery-heads .gtile span { position: absolute; left: 10px; bottom: 8px; font-size: .75rem; color: #6f6662; letter-spacing: .04em; }
.gallery-heads .gtile:hover { outline: 2px solid var(--accent); }
.cv-empty { text-align: center; padding: 30px 12px; border: 1px dashed var(--line); border-radius: 12px; margin: 0; }
.cv-media:has(.ph, .gtile.has) .cv-empty { display: none; }
.cv-media #photo-hint { margin: 0; text-align: center; }
.cv-client { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 16px;
             padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.cv-name { font-size: 1.35rem; color: var(--fg); text-decoration: none; }
.cv-name:hover { color: var(--accent); }
#disegni .heads .headbtn svg { aspect-ratio: 1; border-radius: 50%; }
#disegni .heads .headbtn { border-radius: 50%; padding: 0; border: 0; background: none; }
#disegni .heads .headbtn span { margin-top: 2px; }
@media (max-width: 900px) {
  .cardview { grid-template-columns: 1fr; }
  .cv-media { position: static; max-height: none; overflow: visible; padding: 0; }
  .cv-kind { flex-direction: row; justify-content: center; }
  .cv-kind .disc { width: 56px; height: 56px; } .cv-kind .disc svg { width: 28px; height: 28px; }
  .cv-strip { flex-direction: row; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .cv-strip .gallery { display: contents; }
  .cv-strip .ph, .cv-strip .gtile.has { flex: 0 0 82%; scroll-snap-align: start; }
  .cv-strip .ph .phsvg, .cv-strip .ph img { max-height: 46dvh; }
}
@media (max-width: 900px) { .cv-kind { display: none; } }
@media (max-width: 600px) {
  .cnav .cjump { flex: 1 1 100%; }
  .cactions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .kindbtn { flex-direction: column; padding: 10px 4px; border-radius: 14px; gap: 6px; font-size: .85rem; text-align: center; }
  .cact-sep { display: none; }
  .cactions .btn { grid-column: span 3; justify-content: center; }
  .cactions .btn + .btn { grid-column: span 3; }
}

/* ---------- Admin: subscriptions overview ---------- */
.subtiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.subtiles .panel { margin: 0; display: flex; flex-direction: column; gap: 4px; color: var(--fg); text-decoration: none; }
.subtiles b { font-size: 1.6rem; font-weight: 500; }
.subtiles .hot { border-color: var(--warn); }
.subtiles .hot b { color: var(--warn); }
.subfilter { margin: 18px 0 4px; }
.tl { overflow-x: auto; }
.tl-head, .tl-row { display: grid; grid-template-columns: minmax(130px, 200px) minmax(420px, 1fr); gap: 12px; align-items: center; }
.tl-months { display: grid; grid-template-columns: repeat(7, 1fr); font-size: .78rem; color: var(--muted); border-bottom: 1px solid var(--line-soft); padding-bottom: 6px; }
.tl-months span { border-left: 1px solid var(--line-soft); padding-left: 6px; text-transform: capitalize; }
.tl-row { min-height: 34px; }
.tl-name { color: var(--fg); text-decoration: none; font-size: .9rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tl-name:hover { color: var(--accent); }
.tl-track { position: relative; height: 18px; border-radius: 4px; background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 7 - 1px), var(--line-soft) calc(100% / 7 - 1px) calc(100% / 7)); }
.tl-seg { position: absolute; top: 3px; height: 12px; border-radius: 3px; display: inline-block; }
.tl-seg.paid { background: var(--accent); }
.tl-seg.grace { background: var(--warn); opacity: .75; }
.tl-seg.gift { background: repeating-linear-gradient(135deg, #8fc7b4 0 4px, transparent 4px 7px); border: 1px solid #8fc7b4; }
.tl-today { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--fg); border-radius: 1px; }
.tl-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend .tl-seg { position: static; width: 22px; }
.tl-today-key { display: inline-block; width: 2px; height: 14px; background: var(--fg); }
.sublist { padding: 6px 0; }
.subrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 20px; align-items: center; padding: 14px 20px;
          border-top: 1px solid var(--line-soft); }
.subrow .sub-facts { grid-column: 1 / -1; }
.subrow:first-child { border-top: 0; }
.subrow.due { background: color-mix(in srgb, var(--warn) 7%, transparent); }
.sub-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; min-width: 0; }
.sub-main .salonname { font-size: 1.05rem; }
.sub-facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px 14px; margin: 0; font-size: .86rem; }
.sub-facts dt { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sub-facts dd { margin: 2px 0 0; }
.sub-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.sub-actions form { margin: 0; }
@media (max-width: 1100px) { .sub-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .subtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subrow { grid-template-columns: 1fr; padding: 14px 16px; }
  .sub-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sub-actions { justify-content: flex-start; }
}
.subfilter { max-width: 100%; overflow-x: auto; }
