/* Dermaplus Hub — espresso sidebar, warm paper workspace, gold for the one thing that matters on each screen */
:root {
  --bg: #F5F1EB;
  --panel: #FFFFFF;
  --panel-2: #FBF8F4;
  --ink: #2A211B;
  --muted: #7A6B5F;
  --line: #E7DED3;
  --side: #2E231C;
  --side-ink: #E9DFD2;
  --side-muted: #A8978A;
  --gold: #A9844A;
  --gold-ink: #7E5F2C;
  --gold-soft: #F4EADA;
  --ok: #2F7556; --ok-soft: #E2F0E8;
  --bad: #A8432F; --bad-soft: #F7E3DE;
  --wait: #6F5A2E; --wait-soft: #F6EDDB;
  --off: #8B8178; --off-soft: #EEEAE5;
  --focus: #A9844A;
  --f-display: "Marcellus", "Cormorant Garamond", Georgia, serif;
  --f-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171310; --panel: #211B17; --panel-2: #1C1714; --ink: #EFE7DD; --muted: #A8998B; --line: #3A3029;
    --side: #100D0B; --side-ink: #E9DFD2; --side-muted: #8E7F72;
    --gold: #D1AD6F; --gold-ink: #E2C48E; --gold-soft: #3A2E1E;
    --ok: #7CC7A2; --ok-soft: #1E3328; --bad: #E58F7C; --bad-soft: #3D231D;
    --wait: #E2C48E; --wait-soft: #352B1C; --off: #A39A92; --off-soft: #2B2521; --focus: #D1AD6F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171310; --panel: #211B17; --panel-2: #1C1714; --ink: #EFE7DD; --muted: #A8998B; --line: #3A3029;
  --side: #100D0B; --side-ink: #E9DFD2; --side-muted: #8E7F72;
  --gold: #D1AD6F; --gold-ink: #E2C48E; --gold-soft: #3A2E1E;
  --ok: #7CC7A2; --ok-soft: #1E3328; --bad: #E58F7C; --bad-soft: #3D231D;
  --wait: #E2C48E; --wait-soft: #352B1C; --off: #A39A92; --off-soft: #2B2521; --focus: #D1AD6F;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* Shell */
.dph-app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.dph-side { background: var(--side); color: var(--side-ink); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.dph-brand { font-family: var(--f-display); font-size: 22px; letter-spacing: .02em; padding: 0 10px 18px; }
.dph-brand span { color: inherit; }
.dph-nav { display: flex; flex-direction: column; gap: 2px; }
.dph-nav button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--side-muted); }
.dph-nav button:hover { color: var(--side-ink); background: rgba(255,255,255,.05); }
.dph-nav button[aria-current="page"] { color: var(--side-ink); background: rgba(255,255,255,.08); box-shadow: inset 3px 0 0 var(--gold); }
.dph-nav svg { width: 18px; height: 18px; flex: none; }
.dph-side-foot { margin-top: auto; font-size: 13px; color: var(--side-muted); display: flex; flex-direction: column; gap: 10px; }
.dph-side-foot .who-me { padding: 0 10px; display: flex; flex-direction: column; gap: 2px; }
.dph-side-foot a { color: var(--side-muted); }
.b-mini { display: none; }
.dph-app.collapsed { grid-template-columns: 64px minmax(0, 1fr); }
.dph-app.collapsed .dph-side { padding-inline: 8px; }
.dph-app.collapsed .b-full, .dph-app.collapsed .dph-nav span, .dph-app.collapsed .who-me { display: none; }
.dph-app.collapsed .b-mini { display: block; text-align: center; }
.dph-app.collapsed .dph-brand { padding: 0 0 18px; }
.dph-app.collapsed .dph-nav button { justify-content: center; padding: 10px 0; }
.dph-demo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dph-demo .btn { color: inherit; padding: 2px 4px; }
.btn.fs-mobile { display: none; }

.dph-main { min-width: 0; padding: 26px 32px 60px; }
.dph-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 20px; }
.dph-head h1 { font-family: var(--f-display); font-weight: 400; font-size: 28px; margin: 0; line-height: 1.15; text-wrap: balance; }
.dph-head .sub { color: var(--muted); font-size: 14px; }
.dph-head .grow { flex: 1; }

.dph-demo { background: var(--gold-soft); color: var(--gold-ink); border-radius: var(--r); padding: 8px 12px; font-size: 13px; margin-bottom: 16px; }

/* Controls */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.btn:hover { border-color: var(--gold); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 500; }
:root[data-theme="dark"] .btn.primary { color: #1A140F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #1A140F; } }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg button { all: unset; cursor: pointer; padding: 6px 11px; font-size: 14px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg svg { width: 16px; height: 16px; display: block; }
.seg button[aria-pressed="true"] { background: var(--gold-soft); color: var(--gold-ink); }
input[type=text], input[type=tel], input[type=search], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 10px; min-height: 38px;
}
textarea { min-height: 70px; resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); min-width: 0; }
label.f > span { letter-spacing: .01em; }

/* Metrics */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 22px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.metric .l { font-size: 13px; color: var(--muted); }
.metric .v { font-size: 28px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; }
.metric.hl .v { color: var(--gold-ink); }

/* Today list */
.today { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row { display: grid; grid-template-columns: 64px minmax(0,1fr) auto; gap: 14px; padding: 13px 16px; align-items: center; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row.now { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--gold); }
.row.past-cancel { opacity: .6; }
.row .t { font-variant-numeric: tabular-nums; font-weight: 500; font-size: 16px; }
.row .t small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.row .who { min-width: 0; }
.row .who b { font-weight: 500; cursor: pointer; }
.row .who b:hover { color: var(--gold-ink); }
.row .who .meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.row .act { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.msgs { display: inline-flex; gap: 4px; }
.msgs i { font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.msgs i.on { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.pill { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 99px; white-space: nowrap; font-weight: 500; }
.pill.booked { background: var(--wait-soft); color: var(--wait); }
.pill.arrived { background: var(--ok-soft); color: var(--ok); }
.pill.no_show { background: var(--bad-soft); color: var(--bad); }
.pill.cancelled { background: var(--off-soft); color: var(--off); }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 4px; }

.side-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.side-card h3 { margin: 0; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.mini { display: flex; flex-direction: column; }
.mini div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.mini div:first-child { border-top: 0; }

/* Calendar */
.cal-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
.cal { display: grid; min-width: 760px; }
.cal-h { display: contents; }
.cal-h > div { padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 13px; text-align: center; position: sticky; top: 0; background: var(--panel); z-index: 2; }
.cal-h > div b { display: block; font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cal-h > div.is-today b { color: var(--gold-ink); }
.cal-times { position: relative; border-right: 1px solid var(--line); }
.cal-times span { position: absolute; right: 6px; font-size: 11px; color: var(--muted); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.cal-day { position: relative; border-right: 1px solid var(--line); cursor: copy;
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% 60px; }
.cal-day:last-child { border-right: 0; }
.cal-day.is-today { background-color: var(--panel-2); }
.ev { position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 3px 6px; font-size: 12px; line-height: 1.3; overflow: hidden; cursor: pointer;
  background: var(--gold-soft); color: var(--gold-ink); border-left: 3px solid var(--gold); }
.ev b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.ev.arrived { background: var(--ok-soft); border-left-color: var(--ok); color: var(--ok); }
.ev.no_show { background: var(--bad-soft); border-left-color: var(--bad); color: var(--bad); }
.ev.cancelled { background: var(--off-soft); border-left-color: var(--off); color: var(--off); text-decoration: line-through; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 1; pointer-events: none; }

/* Clients */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 360px; }
table.t { width: 100%; border-collapse: collapse; background: var(--panel); }
.tbl { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
table.t th { text-align: left; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 14px; border-top: 1px solid var(--line); font-size: 14px; }
table.t tr:first-child td { border-top: 0; }
table.t tbody tr { cursor: pointer; }
table.t tbody tr:hover td { background: var(--panel-2); }
table.t td.r, table.t th.r { text-align: right; font-variant-numeric: tabular-nums; }

.profile { display: grid; grid-template-columns: 320px minmax(0,1fr); gap: 22px; align-items: start; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); display: grid; place-items: center; font-family: var(--f-display); font-size: 22px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.hist { display: flex; flex-direction: column; }
.hist .h { display: grid; grid-template-columns: 110px minmax(0,1fr) auto auto; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); align-items: center; font-size: 14px; cursor: pointer; }
.hist .h:first-child { border-top: 0; }
.hist .h:hover { background: var(--panel-2); }

/* Reports */
.bars { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.bar { display: grid; grid-template-columns: 140px minmax(0,1fr) 110px; gap: 10px; align-items: center; font-size: 14px; }
.bar .track { height: 10px; background: var(--off-soft); border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--gold); border-radius: 99px; }
.bar .val { text-align: right; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 22px; }
.sec-t { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; margin: 0 0 8px; }

/* Modal */
.ov { position: fixed; inset: 0; background: rgba(20,14,10,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 560px; border: 1px solid var(--line); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-h h2 { font-family: var(--f-display); font-weight: 400; font-size: 22px; margin: 0; }
.modal-b { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal-f .grow { flex: 1; }
.fr { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.fr3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.picker { position: relative; }
.picker-list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; max-height: 230px; overflow-y: auto; z-index: 5; }
.picker-list button { all: unset; display: block; width: 100%; box-sizing: border-box; padding: 8px 12px; cursor: pointer; font-size: 14px; }
.picker-list button:hover, .picker-list button:focus-visible { background: var(--gold-soft); }
.picker-list small { color: var(--muted); margin-left: 6px; }
.chosen { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--gold-soft); color: var(--gold-ink); border-radius: 8px; padding: 9px 12px; font-size: 14px; }
.warn { background: var(--wait-soft); color: var(--wait); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.note { font-size: 13px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 60; }

/* Sign-in screen (WordPress page + demo) */
.lg { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(169,132,74,.22), transparent 70%), var(--side); color: var(--side-ink); }
.lg-card { width: 100%; max-width: 400px; display: grid; gap: 22px; }
.lg-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--side-ink); }
#lg-mark svg { width: 52px; height: 56px; display: block; }
#lg-word svg { width: 150px; height: 16px; display: block; color: var(--side-ink); }
.lg-brand .b-row { align-items: center !important; gap: 0; }
.lg-brand .b1, .lg-brand .b2 { font-family: var(--f-display); font-size: 30px; letter-spacing: .02em; color: var(--side-ink); }
.lg-brand .bx { color: var(--gold); margin: 0 8px; }
.lg-brand .b-row { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: center; }
.lg-panel { background: var(--panel); color: var(--ink); border-radius: 16px; padding: 26px; display: grid; gap: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.lg-panel h1 { margin: 0; font-family: var(--f-display); font-weight: 500; font-size: 26px; text-wrap: balance; }
.lg-panel .lg-sub { margin: -8px 0 0; color: var(--muted); font-size: 14px; }
.lg-field { display: grid; gap: 6px; }
.lg-field label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lg-field input[type=text], .lg-field input[type=password], .lg-field input[type=email] { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px; font: inherit; font-size: 16px; background: var(--panel-2); color: var(--ink); }
.lg-field input:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.lg-pw { position: relative; }
.lg-pw input { padding-right: 70px !important; }
.lg-pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--gold-ink); font: inherit; font-size: 13px; padding: 8px; cursor: pointer; }
.lg-rem { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.lg-btn { border: 0; border-radius: 10px; background: var(--gold); color: #fff; font: inherit; font-weight: 600; font-size: 16px; padding: 13px; cursor: pointer; }
.lg-btn:hover { filter: brightness(1.06); }
.lg-btn.alt { background: transparent; color: var(--gold-ink); border: 1px solid var(--line); font-weight: 500; font-size: 14px; padding: 10px; }
.lg-err { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.lg-foot { text-align: center; font-size: 13px; color: var(--side-muted); }
.lg-foot a { color: var(--side-ink); }
.lg-demo { display: grid; gap: 8px; border-top: 1px dashed var(--line); padding-top: 14px; }
.lg-demo b { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.lg-demo .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lg-demo .lg-btn { width: 100%; }
.who-me .out { color: var(--gold); }

/* Narrow screens: bottom tab bar, single columns */
@media (max-width: 1100px) {
  .today { grid-template-columns: minmax(0,1fr); }
  .profile { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 860px) {
  .dph-app, .dph-app.collapsed { grid-template-columns: minmax(0,1fr); }
  .dph-app.collapsed .dph-nav span { display: inline; }
  .dph-main { position: relative; }
  .btn.fs-mobile { display: inline-flex; position: absolute; top: 12px; right: max(16px, env(safe-area-inset-right, 0px)); padding: 6px; }
  .dph-side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-right, 0px)); z-index: 20; }
  .dph-brand, .dph-side-foot { display: none; }
  .dph-nav { flex-direction: row; justify-content: space-around; width: 100%; }
  .dph-nav button { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 8px; }
  .dph-nav button[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--gold); }
  .dph-main { padding: 18px max(16px, env(safe-area-inset-right, 0px)) 96px max(16px, env(safe-area-inset-left, 0px)); }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid2 { grid-template-columns: minmax(0,1fr); }
  .row { grid-template-columns: 54px minmax(0,1fr); }
  .row .act { grid-column: 1 / -1; justify-content: flex-start; }
  .hist .h { grid-template-columns: 90px minmax(0,1fr) auto; }
  .hist .h .hide-s { display: none; }
  .bar { grid-template-columns: 100px minmax(0,1fr) 90px; }
  .fr3 { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .col-hide { display: none; }
}
@media (max-width: 420px) {
  .fr { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .modal { animation: pop .16s ease-out; }
  @keyframes pop { from { transform: translateY(8px); opacity: .6; } to { transform: none; opacity: 1; } }
}

/* Birthdays */
.bd-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; align-items: start; }
.wa { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.wa-b { background: var(--ok-soft); color: var(--ink); border-radius: 10px 10px 10px 2px; padding: 10px 12px; font-size: 14px; max-width: 360px; line-height: 1.45; }
.wa-b b { font-weight: 600; }

/* Payments and till */
.pm { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 99px; white-space: nowrap; border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.pm.cash { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pm.card { background: var(--gold-soft); color: var(--gold-ink); border-color: transparent; }
.paym { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.paym button { all: unset; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-weight: 500; background: var(--panel); }
.paym button svg { width: 22px; height: 22px; }
.paym button:hover { border-color: var(--gold); }
.paym button[aria-pressed="true"] { border: 2px solid var(--gold); padding: 13px; background: var(--gold-soft); color: var(--gold-ink); }
.paym button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.due { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 12px; }
.due b { font-size: 26px; font-weight: 500; }
.close-done { border-radius: 8px; padding: 10px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.close-done.ok { background: var(--ok-soft); color: var(--ok); }
.close-done.bad { background: var(--bad-soft); color: var(--bad); }
.close-done.wait { background: var(--wait-soft); color: var(--wait); }
.dif { font-weight: 500; }
.dif.ok { color: var(--ok); } .dif.bad { color: var(--bad); } .dif.wait { color: var(--wait); }
button[aria-disabled="true"] { opacity: .55; cursor: default; }

@media (max-width: 1100px) { .bd-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .dph-nav button { padding: 6px 2px; font-size: 10.5px; min-width: 0; flex: 1; text-align: center; }
}
.dph-brand { font-size: 19px; white-space: nowrap; }
.dph-brand .b-mini > span { color: var(--gold); padding: 0 1px; }
table.t td.r, .kv dd, .metric .v { white-space: nowrap; }

/* Stacked name: MedHub / × / Dermaplus */
.dph-brand { white-space: normal; padding: 4px 10px 22px; }
.dph-brand .b-full { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.05; }
.dph-brand .b1, .dph-brand .b2 { font-size: 23px; letter-spacing: .03em; color: var(--side-ink); }
.dph-brand .bx { color: var(--gold); font-size: 16px; line-height: 1; padding: 5px 0 4px; font-family: var(--f-body); font-weight: 400; }
.dph-brand .b-mini .bx { display: inline; padding: 0 1px; font-size: 14px; }
.m-brand { display: none; }
@media (max-width: 860px) {
  .m-brand { display: block; text-align: center; font-family: var(--f-display); font-size: 18px; letter-spacing: .03em; color: var(--ink); margin: -4px 0 14px; }
  .m-brand .bx { color: var(--gold); font-family: var(--f-body); font-size: 14px; padding: 0 4px; }
}

/* Search on Sot */
.sq-wrap { position: relative; width: 230px; }
.sq-wrap input { min-height: 36px; }
.sq-res { position: absolute; right: 0; top: calc(100% + 6px); width: min(440px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; z-index: 30; max-height: 420px; overflow-y: auto; box-shadow: 0 12px 32px rgba(40, 28, 18, .14); }
.sq-row { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.sq-row:first-child { border-top: 0; }
.sq-row:hover, .sq-row:focus-visible { background: var(--panel-2); }
.sq-row.is-today { background: var(--gold-soft); }
.sq-row.sq-none { grid-template-columns: minmax(0, 1fr) auto; cursor: default; }
.sq-when { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.sq-when .num { color: var(--ink); font-weight: 500; font-size: 14px; }
.sq-today { color: var(--gold-ink); font-weight: 500; }
.sq-who { display: flex; flex-direction: column; min-width: 0; }
.sq-who b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-who span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-empty { padding: 14px; color: var(--muted); font-size: 14px; }
.row.flash { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 40% { background: var(--gold-soft); } 100% { background: transparent; } }
@media (max-width: 860px) {
  .sq-wrap { flex: 1 1 100%; width: 100%; order: 5; }
  .sq-res { left: 0; right: 0; width: auto; }
  .sq-row { grid-template-columns: 82px minmax(0, 1fr) auto; padding: 10px 12px; }
}
@media (max-width: 860px) { .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); } }

/* Clock at the top of every screen */
.dph-now { flex: 1 1 auto; display: flex; justify-content: center; align-items: center; min-width: 70px; color: var(--band-muted, var(--muted)); }
.dph-now.solo { order: 99; justify-content: flex-end; }
.dph-now .clk { font-family: var(--f-display); font-size: 34px; font-weight: 500; line-height: 1; color: var(--band-ink, var(--ink)); letter-spacing: .03em; }
.dph-now .clk i { font-style: normal; animation: dph-blink 2s steps(1) infinite; }
@keyframes dph-blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dph-now .clk i { animation: none; } }

/* Two-part view switch */
.look-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; margin: 0 2px 6px; border-radius: 10px; background: rgba(127, 120, 112, .14); }
.look-seg button { all: unset; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 4px; border-radius: 8px; font-size: 13px; color: var(--side-muted); }
.look-seg button svg { width: 15px; height: 15px; }
.look-seg button:hover { color: var(--side-ink); }
.look-seg button[aria-pressed="true"] { background: var(--side-ink); color: var(--side); font-weight: 500; }
.look-seg button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.dph-app.collapsed .look-seg { grid-template-columns: 1fr; }
.dph-app.collapsed .look-seg span { display: none; }

@media (max-width: 860px) {
  .look-seg { display: none; }
  .dph-now { min-width: 0; }
  .dph-now .clk { font-size: 26px; }
}

/* Client card: allergy alerts and status */
.alg { background: var(--bad-soft); color: var(--bad); border-radius: 99px; padding: 1px 9px; font-weight: 600; }
.nocard { background: var(--off-soft); color: var(--off); border-radius: 99px; padding: 1px 9px; }
.alg-box { display: flex; flex-direction: column; gap: 2px; background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: 9px 12px; font-size: 14px; }
.alg-box b { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }

/* Staff shift dot */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--off); margin-right: 4px; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

/* Design switch (classic / new), shown under the page on small screens */
.skin-foot { display: none; }
.skin-foot svg { width: 16px; height: 16px; }
@media (max-width: 860px) { .skin-foot { display: flex; justify-content: center; margin-top: 28px; } }

/* ---------- Month view ---------- */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.month .mh { padding: 10px 10px 8px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--panel-2); }
.mcell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: pointer; transition: background .12s; }
.mcell:nth-child(7n + 7) { border-right: 0; }
.mcell:hover { background: var(--panel-2); }
.mcell.we { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.mcell.out { background: var(--panel-2); }
.mcell.out .md b { color: var(--off); font-weight: 500; }
.md { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 0 2px 2px; }
.md b { font-size: 14px; font-weight: 600; width: 28px; height: 28px; line-height: 28px; text-align: center; border-radius: 50%; }
.mcell.is-today .md b { background: var(--ink); color: var(--panel); }
.md .mc { font-size: 11.5px; color: var(--muted); }
.mev { font-size: 12px; line-height: 1.3; padding: 3px 6px; border-radius: 6px; background: var(--off-soft); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--off); cursor: grab; display: block; font-weight: 500; }
.mev i { font-style: normal; font-weight: 700; margin-right: 2px; }
.mev.arrived, .mev.no_show, .mev.cancelled { cursor: pointer; }
.mev.arrived::after { content: " ✓"; }
.mev.no_show { background: var(--bad-soft); color: var(--bad); border-left-color: var(--bad); }
.mev.cancelled { background: transparent; color: var(--off); text-decoration: line-through; border-left-color: transparent; }
.mmore { all: unset; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--gold-ink); padding: 1px 6px; }
.mmore:hover { text-decoration: underline; }
.mmore:focus-visible { outline: 2px solid var(--focus); border-radius: 4px; }
.mdots { display: flex; flex-wrap: wrap; gap: 3px; padding: 2px; }
.mdots i { width: 7px; height: 7px; border-radius: 50%; padding: 0; background: var(--off); }

/* ---------- Drag to reschedule ---------- */
.ev.booked { cursor: grab; touch-action: pan-y; }
.mev.booked { touch-action: pan-y; }
.dph-dragging, .dph-dragging * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }
.drag-src { opacity: .35; }
.drag-ghost { z-index: 1000; pointer-events: none; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); transform: rotate(-1deg); opacity: .96; }
.drag-ghost .drag-t { position: absolute; right: 4px; top: 3px; font-style: normal; font-size: 11.5px; font-weight: 700; background: var(--ink); color: var(--panel); padding: 1px 6px; border-radius: 99px; }
.cal-day.drop-on { background-color: var(--gold-soft) !important; }
.mcell.drop-on { background: var(--gold-soft); box-shadow: inset 0 0 0 2px var(--gold); }
.movebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; background: var(--ink); color: var(--panel); border-radius: var(--r); padding: 12px 16px; margin: 0 0 14px; }
.movebar > div:first-child { min-width: 0; font-size: 14.5px; }
.movebar small { display: block; font-size: 12.5px; opacity: .75; margin-top: 2px; }
.movebar .mv-act { display: flex; gap: 8px; }
.movebar .btn { background: transparent; color: var(--panel); border-color: rgba(255, 255, 255, .35); }
.movebar .btn.primary { background: var(--panel); color: var(--ink); border-color: var(--panel); }
@media (max-width: 700px) {
  .month .mh { padding: 8px 2px; text-align: center; font-size: 12px; }
  .mcell { padding: 4px 2px; align-items: center; }
  .md { justify-content: center; }
  .md .mc { display: none; }
  .md b { font-size: 13px; width: 26px; height: 26px; line-height: 26px; }
}
