/* Booking system: builds on /css/styles.css */
.narrow { max-width: calc(640px + 2 * var(--gutter)); }
.muted { color: var(--muted); }
.empty { color: var(--muted); border: 2px dashed var(--line); padding: 28px; text-align: center; margin-top: 24px; }
.back { color: var(--muted); text-decoration: none; font-size: 15px; }
.back:hover { color: var(--white); }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 860px) { .grid.two { grid-template-columns: 1fr; } }
.page-hero h1 { overflow-wrap: anywhere; }

/* Flash messages */
.flash { margin: 24px 0 0; padding: 14px 18px; border-left: 4px solid #2e7d32; background: rgba(46,125,50,.08); overflow-wrap: anywhere; }
.flash.err { border-color: #c62828; background: rgba(198,40,40,.07); }
.flash p { margin: 0; }

/* Step indicator */
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 0; margin: 36px 0 0; }
.steps li { display: flex; align-items: center; gap: 10px; font: 400 18px/1 var(--display); letter-spacing: .14em; color: var(--muted); }
.steps li span { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; font-size: 15px; padding-top: 2px; }
.steps li.done span { background: var(--white); color: var(--black); border-color: var(--white); }
.steps li.now { color: var(--white); }
.steps li.now span { background: var(--crimson); border-color: var(--crimson); color: #fff; }

/* Member + service cards */
.cards.members, .cards.services { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.cards.members .card, .cards.services .card { display: flex; flex-direction: column; gap: 6px; }
.cards .card .btn { margin-top: auto; align-self: flex-start; cursor: pointer; color: var(--white); }
/* Keep every card's button on the same line: the bottom group (length, picker, button) sits at the card's foot */
.cards.members .card .btn, .cards.services .card .btn { margin-top: auto; align-self: stretch; justify-content: center; }
.cards.members .card .tags { margin-bottom: 24px; }
.cards.services .card .soon { margin-top: auto; padding-top: 18px; }
.cards.services .card .soon ~ .btn { margin-top: 0; }
.cards.services .field { margin: 14px 0 22px; flex: 0 0 auto; }
.cards.services .card .soon + .btn { margin-top: 22px; }
.avatar { width: 84px; height: 84px; display: grid; place-items: center; border: 2px solid var(--white); background: var(--black); font: 400 40px/1 var(--display); letter-spacing: .04em; padding-top: 4px; margin-bottom: 10px; }
.avatar.sm { width: 52px; height: 52px; font-size: 24px; margin: 0; }
.card .role { color: var(--crimson); font: 400 18px/1 var(--display); letter-spacing: .18em; margin: 0 0 6px; }
.card h3 { margin-top: 4px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 14px 0 0; }
.tags li { border: 1px solid var(--line); padding: 5px 9px 3px; font: 400 14px/1 var(--display); letter-spacing: .12em; color: var(--muted); }
.price { font: 400 72px/1 var(--display); margin: 6px 0 16px; color: var(--white) !important; white-space: nowrap; }
.price span { font-size: 26px; color: var(--muted); letter-spacing: .08em; }

/* Form controls not covered by the site styles */
.field select, .picker select, .picker input, .field input[type="time"], .field input[type="date"], .field input[type="number"], .field input[type="month"] {
  font: 400 17px/1.2 var(--body); color: var(--white); background: var(--black);
  border: 2px solid var(--line); padding: 13px 14px; border-radius: 0; width: 100%;
}
.field select:focus, .picker select:focus, .picker input:focus { outline: none; border-color: var(--crimson); }
.field.check { justify-content: flex-end; }
.field.check label { display: flex; align-items: center; gap: 10px; font: 400 15px/1.3 var(--body); letter-spacing: 0; color: var(--white); padding-bottom: 14px; }
.field.check input, .hours input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--crimson); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack .btn { align-self: flex-start; cursor: pointer; color: var(--white); }
.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin: 18px 0; }
.row .field { flex: 1 1 180px; }
.row .field.wide { flex-basis: 100%; }
.row > .btn { cursor: pointer; color: var(--white); }
.btn.sm { font-size: 17px; padding: 10px 16px 8px; cursor: pointer; color: var(--white); background: transparent; }
.btn.primary.sm { background: var(--crimson); color: #fff; }
button.btn { cursor: pointer; color: var(--white); background: transparent; }
button.btn.primary { background: var(--crimson); color: #fff; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; }
.linklike.danger { color: #c62828; font-size: 14px; }
nav .linklike { font: 400 19px/1 var(--display); letter-spacing: .12em; color: var(--muted); text-decoration: none; }
nav .linklike:hover { color: var(--white); }
nav form { margin: 0; }

/* Scheduler */
.scheduler { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); margin-top: 32px; align-items: start; }
@media (max-width: 860px) { .scheduler { grid-template-columns: 1fr; } }
.calendar { border: 2px solid var(--line); background: var(--black); padding: clamp(14px, 3vw, 24px); }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cal-head h3 { font: 400 30px/1 var(--display); letter-spacing: .06em; margin: 0; }
.cal-head a, .cal-head span { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); text-decoration: none; font-size: 20px; }
.cal-head span { border: 0; }
.cal-head a:hover { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .dow { font: 400 14px/1 var(--display); letter-spacing: .12em; color: var(--muted); text-align: center; padding: 6px 0; }
.day { aspect-ratio: 1; display: grid; place-items: center; font-weight: 500; color: color-mix(in srgb, var(--white) 30%, transparent); text-decoration: none; font-size: 15px; }
.day.open { color: var(--white); background: var(--charcoal-2); border: 1px solid var(--line); }
.day.open:hover { border-color: var(--crimson); }
.day.sel { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.times h3 { font: 400 30px/1 var(--display); letter-spacing: .06em; margin: 0 0 16px; }
.slot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.slot { text-align: center; text-decoration: none; padding: 13px 8px 11px; border: 2px solid var(--line); font: 400 19px/1 var(--display); letter-spacing: .1em; }
.slot:hover, .slot:focus-visible { background: var(--crimson); border-color: var(--crimson); color: #fff; }

/* Summary list */
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 24px 0; }
.summary dt { font: 400 16px/1.6 var(--display); letter-spacing: .18em; color: var(--muted); }
.summary dd { margin: 0; overflow-wrap: anywhere; }
.summary a { color: var(--white); }

/* Admin */
.admin-page h2 { font-size: clamp(40px, 6vw, 68px); }
.panel { border: 2px solid var(--line); background: var(--black); padding: clamp(18px, 3vw, 28px); margin-top: 24px; }
.panel h3 { font: 400 26px/1.1 var(--display); letter-spacing: .05em; margin: 0 0 8px; }
.panel .btns { margin-top: 18px; align-items: center; }
.notes { white-space: normal; color: var(--muted); overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 2px; background: var(--line); border: 2px solid var(--line); margin: 28px 0; }
.stats div { background: var(--charcoal); padding: 20px; }
.stats strong { display: block; font: 400 40px/1 var(--display); letter-spacing: .03em; }
.stats span { color: var(--muted); font-size: 14px; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin: 8px 0 18px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tabs a { font: 400 18px/1 var(--display); letter-spacing: .14em; text-decoration: none; padding: 10px 14px 8px; border: 1px solid var(--line); color: var(--muted); }
.tabs a[aria-current] { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; }
.picker label { font: 400 16px/1 var(--display); letter-spacing: .2em; color: var(--muted); }
.picker select, .picker input { width: auto; padding: 9px 12px; }
.table-wrap { overflow-x: auto; border: 2px solid var(--line); margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font: 400 15px/1 var(--display); letter-spacing: .18em; color: var(--muted); background: var(--black); white-space: nowrap; }
tbody tr:hover { background: var(--charcoal-2); }
td a { color: var(--white); }
.panel table th, .panel table td { padding-inline: 0 14px; }
.hours { margin: 16px 0 22px; width: auto; }
.hours th, .hours td { border: 0; padding: 6px 10px 6px 0; vertical-align: middle; }
.hours th label { display: flex; align-items: center; gap: 10px; font: 400 15px/1 var(--body); }
.hours input[type="time"] { font: 400 16px/1 var(--body); color: var(--white); background: var(--black); border: 2px solid var(--line); padding: 8px; }
.list { list-style: none; padding: 0; margin: 18px 0 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list form { margin: 0; }
.member-head { display: flex; gap: 16px; align-items: center; }
.member-head h3 { margin: 0; }
.member-head p { margin: 4px 0 0; font-size: 14px; }
.member-head a { color: var(--white); }
.service-form .btns { margin-top: 0; }

.badge { display: inline-block; font: 400 14px/1 var(--display); letter-spacing: .14em; padding: 5px 8px 3px; border: 1px solid currentColor; white-space: nowrap; vertical-align: middle; }
.s-pending { color: #b26a00; }
.s-confirmed { color: #2e7d32; }
.s-completed { color: #1565c0; }
.s-declined, .s-cancelled { color: var(--muted); }

/* Mobile: compact admin nav */
@media (max-width: 760px) {
  body.admin header.top { position: static; }
  body.admin nav ul { gap: 10px 16px; }
  body.admin nav a, body.admin nav .linklike { font-size: 17px; }
}

/* Light theme: cards and panels get a soft lift */
.panel, .calendar, .table-wrap, .cards.members .card, .cards.services .card { box-shadow: 0 24px 48px -30px rgba(27,23,21,.3); }

/* Gold trim */
.panel, .calendar { border-top: 2px solid var(--gold); }
.summary dt { color: var(--muted); }
.stats { border-color: rgba(201,162,39,.4); }
.day.sel { box-shadow: inset 0 0 0 1px #f6e39b; }
.avatar { border-color: var(--gold); }

/* Package bullet points, matching the rate card on the home page */
.cards.services .perks { list-style: none; margin: 4px 0 10px; padding: 0; color: var(--muted); font-size: 16px; }
.cards.services .perks li { padding-left: 20px; position: relative; margin-bottom: 8px; }
.cards.services .perks li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--crimson); box-shadow: 0 0 8px var(--crimson); }

/* ============ Final step: "Your details" + "Request sent" ============ */
/* Tighter section rhythm for the last step */
section.details { padding-block: clamp(48px, 7vw, 96px); }
section.details h2 { margin-bottom: 18px; }

/* The fix: .field is flex: 1 1 220px site-wide, which in a column stack made every field ~220px tall */
.stack .field { flex: none; gap: 6px; }
.details-form { gap: 14px; }
.details-form .field textarea { min-height: 120px; }

/* Summary as a ticket stub */
.summary.ticket {
  position: relative; gap: 0; margin: 20px 0 18px; padding: 6px 22px 0;
  background: var(--black); border: 2px solid var(--line); border-top: 3px solid var(--gold);
  box-shadow: 0 24px 48px -30px rgba(27,23,21,.35);
  animation: ticket-in .7s var(--ease) both;
}
/* punched notches on either side, just above the total */
.summary.ticket::before, .summary.ticket::after {
  content: ""; position: absolute; bottom: 52px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--charcoal); border: 2px solid var(--line);
}
.summary.ticket::before { left: -11px; clip-path: inset(0 0 0 50%); }
.summary.ticket::after { right: -11px; clip-path: inset(0 50% 0 0); }
.summary.ticket dt, .summary.ticket dd {
  padding: 11px 0 9px; border-bottom: 1px dashed var(--line); line-height: 1.35;
  animation: row-in .5s var(--ease) both;
}
.summary.ticket dt { font-size: 15px; padding-right: 20px; }
.summary.ticket dd { font-weight: 500; text-align: right; }
.summary.ticket .total { border-bottom: 0; border-top: 2px dashed var(--line); padding: 14px 0 16px; }
.summary.ticket dd.total { font: 400 30px/1 var(--display); letter-spacing: .04em; color: var(--crimson); }
.summary.ticket dt.total { align-self: center; }
.summary.ticket :nth-of-type(1) { animation-delay: .15s; }
.summary.ticket :nth-of-type(2) { animation-delay: .23s; }
.summary.ticket :nth-of-type(3) { animation-delay: .31s; }
.summary.ticket :nth-of-type(4) { animation-delay: .39s; }
.summary.ticket :nth-of-type(5) { animation-delay: .47s; }
.summary.ticket :nth-of-type(6) { animation-delay: .55s; }
.summary.ticket dd.total { animation: row-in .5s var(--ease) .6s both, total-pop .6s var(--ease) 1.1s; }
.details .fine { margin-top: 12px; font-size: 14px; line-height: 1.5; }
.details .back { display: inline-block; transition: transform .25s var(--ease), color .2s; }
.details .back:hover { transform: translateX(-4px); }

/* Form fields rise in one after another */
.details-form > * { animation: row-in .55s var(--ease) both; }
.details-form > :nth-child(n+7) { animation-delay: .2s; }
.details-form > :nth-child(n+8) { animation-delay: .28s; }
.details-form > :nth-child(n+9) { animation-delay: .36s; }
.details-form > :nth-child(n+10) { animation-delay: .44s; }
.details-form > :nth-child(n+11) { animation-delay: .52s; }
.details-form > :nth-child(n+13) { animation-delay: .6s; }
.details-form > :nth-child(n+14) { animation-delay: .68s; }
.details-form > :nth-child(n+15) { animation-delay: .76s; }

/* Focus: a crimson-to-gold bar sweeps under the active field, label lights up */
.details-form .field { position: relative; }
.details-form .field::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--crimson), var(--gold));
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease);
}
.details-form .field:focus-within::after { transform: scaleX(1); }
.details-form .field label { transition: color .2s, letter-spacing .3s var(--ease); }
.details-form .field:focus-within label { color: var(--crimson); letter-spacing: .26em; }
.details-form .field input:focus, .details-form .field textarea:focus { box-shadow: none; }

/* Policy + agree, compact */
.details-form .policy { padding: 16px 20px; margin-top: 4px; }
.details-form .policy h3 { font-size: 22px; margin-bottom: 10px; }
.details-form .policy ul { font-size: 15px; line-height: 1.45; }
.details-form .policy li + li { margin-top: 5px; }
.details-form .agree { font-size: 15px; }

/* Submit: gleam sweep + arrow nudge */
.details-form .submit { overflow: hidden; }
.details-form .submit::after {
  content: ""; position: absolute; inset: 0 auto 0 -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg); animation: gleam 3.2s ease-in-out 1.4s infinite; pointer-events: none;
}
.details-form .submit span { display: inline-block; transition: transform .3s var(--ease); }
.details-form .submit:hover span { transform: translateX(5px); }
.details-form small { margin-top: -4px; }

/* "Request sent": checkmark draws itself in */
.sent-check { display: block; width: 64px; height: 64px; margin: 22px 0 -6px; }
.sent-check circle { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .7s var(--ease) .2s forwards; }
.sent-check path { fill: none; stroke: var(--crimson); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 36; stroke-dashoffset: 36; animation: draw .45s var(--ease) .8s forwards; }
.details .btns { margin-top: 8px; }

@keyframes ticket-in { from { opacity: 0; transform: translateY(18px) rotate(-1deg); } to { opacity: 1; transform: none; } }
@keyframes row-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes total-pop { 40% { transform: scale(1.12); text-shadow: 0 0 18px var(--crimson-glow); } }
@keyframes gleam { 0% { left: -60%; } 45%, 100% { left: 130%; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (max-width: 520px) {
  .summary.ticket { padding-inline: 16px; }
  .summary.ticket dd.total { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .summary.ticket, .summary.ticket dt, .summary.ticket dd, .details-form > *, .details-form .submit::after { animation: none !important; }
  .sent-check circle, .sent-check path { animation: none; stroke-dashoffset: 0; }
}

/* ============ Payments, customer booking page, admin calendar ============ */
.pay-box { border: 2px solid var(--line); border-left: 4px solid var(--gold); background: var(--black); padding: 18px 20px; margin: 18px 0; animation: row-in .5s var(--ease) .5s both; }
.pay-box h3 { font: 400 24px/1 var(--display); letter-spacing: .05em; margin: 0 0 8px; }
.pay-box p { margin: 0 0 12px; font-size: 15px; }
.pay-box .btns { gap: 10px; }
.pay-box .agree { flex-basis: 100%; margin-bottom: 4px; }
.manage h3 { font: 400 24px/1.1 var(--display); letter-spacing: .05em; margin: 22px 0 8px; }
.manage .panel h3 { margin-top: 0; }
.manage .list li { font-size: 15px; }
.manage .policy { margin-top: 22px; }

details.panel > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "+"; font: 400 28px/1 var(--display); color: var(--crimson); transition: transform .3s var(--ease); }
details.panel[open] > summary::after { transform: rotate(45deg); }
details.panel > summary h3 { margin: 0; }
details.panel[open] > summary { margin-bottom: 12px; }
.panel.request { border-left: 4px solid #b26a00; }
.toolbar .tabs a[aria-label] { min-width: 44px; text-align: center; }
.picker label input { width: auto; vertical-align: middle; }

.cal-board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; background: var(--line); border: 2px solid var(--line); border-top: 2px solid var(--gold); }
.cal-board .dow { background: var(--black); font: 400 15px/1 var(--display); letter-spacing: .14em; color: var(--muted); text-align: center; padding: 10px 0 8px; }
.cal-board .cell { background: var(--black); min-height: 110px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-board.week .cell { min-height: 280px; }
.cal-board .cell.out { background: var(--charcoal); opacity: .6; }
.cal-board .cell.today { box-shadow: inset 0 0 0 2px var(--crimson); }
.cal-board .cell.blocked { background: repeating-linear-gradient(135deg, var(--black) 0 8px, var(--charcoal) 8px 16px); }
.cal-board .num { font: 400 18px/1 var(--display); letter-spacing: .06em; color: var(--white); text-decoration: none; align-self: flex-start; }
.cal-board .num:hover { color: var(--crimson); }
.blocked-note { font-size: 12px; }
.ev { display: block; font-size: 12.5px; line-height: 1.3; padding: 4px 6px; border-left: 3px solid currentColor; background: var(--charcoal-2); color: var(--white); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: transform .2s var(--ease), background .2s; }
.ev:hover { transform: translateX(2px); background: var(--charcoal); }
.ev strong { font-weight: 700; }
.ev.s-pending { border-color: #b26a00; }
.ev.s-confirmed { border-color: #2e7d32; }
.ev.s-completed { border-color: #1565c0; }
.ev.s-declined, .ev.s-cancelled { border-color: var(--muted); opacity: .6; text-decoration: line-through; }
.cal-board.week .ev { white-space: normal; }
.day-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.day-list .ev { font-size: 16px; padding: 14px 16px; white-space: normal; }
@media (max-width: 760px) {
  .cal-board.week { grid-template-columns: 1fr; }
  .cal-board.week .dow { display: none; }
  .cal-board.week .cell { min-height: 0; }
  .cal-board.month .cell { min-height: 64px; padding: 3px; }
  .cal-board.month .ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; background: currentColor; }
  .cal-board.month .ev.s-pending { color: #b26a00; } .cal-board.month .ev.s-confirmed { color: #2e7d32; } .cal-board.month .ev.s-completed { color: #1565c0; }
}
@media (prefers-reduced-motion: reduce) { .pay-box { animation: none; } }

/* ============ CRM ============ */
.crm-tabs { margin: 0 0 22px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; padding-bottom: 4px; }
.crm-tabs a { white-space: nowrap; }
.crm h4 { font: 400 18px/1 var(--display); letter-spacing: .14em; color: var(--muted); margin: 18px 0 6px; }
.crm .r { text-align: right; }
.crm .small { font-size: 13px; }
.stats .alert strong { color: var(--crimson); }
.filters { gap: 8px; margin-bottom: 18px; }
.filters input[name="q"] { min-width: min(280px, 100%); flex: 1 1 220px; }
form.inline { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0; }

/* Status badges */
.badge.c-lead { color: #b26a00; } .badge.c-active { color: #2e7d32; } .badge.c-vip { color: var(--gold-deep, #9C7A1E); border-color: var(--gold); background: rgba(201,162,39,.1); } .badge.c-inactive { color: var(--muted); }
.badge.i-draft, .badge.i-void { color: var(--muted); } .badge.i-unpaid { color: #b26a00; } .badge.i-partial { color: #1565c0; } .badge.i-paid { color: #2e7d32; }
.badge.i-overdue { color: #fff; background: var(--crimson); border-color: var(--crimson); }
.badge.p-high { color: var(--crimson); } .badge.p-normal { color: var(--muted); } .badge.p-low { color: var(--muted); opacity: .7; }

/* Directory cards */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; margin-bottom: 28px; }
.client-card { display: grid; grid-template-columns: 52px 1fr; gap: 6px 14px; align-items: center; padding: 16px; border: 2px solid var(--line); background: var(--black);
  text-decoration: none; color: var(--white); transition: border-color .2s, transform .25s var(--ease), box-shadow .25s; animation: row-in .45s var(--ease) both; }
.client-card:hover, .client-card:focus-visible { border-color: var(--crimson); transform: translateY(-2px); box-shadow: 0 18px 36px -24px rgba(211,47,47,.55); }
.client-card .avatar { grid-row: span 2; }
.client-card .who { display: flex; flex-direction: column; min-width: 0; }
.client-card .who strong { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-card .who .muted { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-card .tags-row { display: flex; flex-wrap: wrap; gap: 4px; }
.client-card .nums, .client-card > .muted { grid-column: 1 / -1; }
.client-card .nums { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; }
.owed { color: var(--crimson); font-weight: 600; }
.client-card:nth-child(n+7) { animation-delay: .1s; } .client-card:nth-child(n+13) { animation-delay: .2s; }

/* Profile */
.client-head { display: flex; gap: 18px; align-items: center; margin-bottom: 8px; }
.client-head .avatar { margin: 0; flex: none; }
.client-head h2 { margin-bottom: 8px; font-size: clamp(40px, 7vw, 76px); overflow-wrap: anywhere; }
.client-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 0; font-size: 15px; }
.client-meta a { color: var(--white); }
.jump { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; position: sticky; top: 70px; z-index: 5; }
.jump a { font: 400 15px/1 var(--display); letter-spacing: .14em; padding: 8px 12px 6px; border: 1px solid var(--line); background: var(--black); color: var(--muted); text-decoration: none; }
.jump a:hover { color: #fff; background: var(--crimson); border-color: var(--crimson); }
.crm .panel { scroll-margin-top: 130px; }
.add-box { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.add-box > summary { cursor: pointer; font: 400 17px/1 var(--display); letter-spacing: .14em; color: var(--crimson); list-style: none; }
.add-box > summary::-webkit-details-marker { display: none; }
.add-box[open] > summary { margin-bottom: 8px; }

/* Follow-ups */
.task-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--line); background: var(--charcoal); animation: row-in .4s var(--ease) both; }
.task > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.task p { margin: 4px 0 0; font-size: 15px; color: var(--muted); }
.task .muted { font-size: 14px; }
.task.p-high { border-left-color: var(--crimson); }
.task.p-normal { border-left-color: var(--gold, #C9A227); }
.task.overdue { background: rgba(211,47,47,.07); }
.task.overdue .muted:first-of-type { color: var(--crimson); }
.task.done { opacity: .6; border-left-color: #2e7d32; }
.task.done strong { text-decoration: line-through; }
.task-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; flex: none; }
.task-actions details { text-align: right; }
.task-actions details[open] { display: flex; flex-direction: column; gap: 8px; min-width: 220px; text-align: left; }
.task-actions summary { cursor: pointer; list-style: none; }
.task-actions summary::-webkit-details-marker { display: none; }
.task-list.big .task { padding: 16px 18px; }
@media (max-width: 640px) { .task { flex-direction: column; } .task-actions { align-items: stretch; } .task-actions details[open] { min-width: 0; } }

/* Notes */
.note { border: 1px solid var(--line); border-left: 4px solid var(--muted); padding: 12px 14px; margin-top: 10px; background: var(--charcoal); animation: row-in .4s var(--ease) both; }
.note header { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 14px; }
.note header .muted { margin-left: auto; font-size: 13px; }
.note p { margin: 8px 0 0; white-space: normal; overflow-wrap: anywhere; }
.note details { margin-top: 8px; }
.note details summary { list-style: none; cursor: pointer; font-size: 14px; }
.note.n-consultation { border-left-color: #1565c0; }
.note.n-production { border-left-color: var(--crimson); }
.note.n-preference { border-left-color: var(--gold, #C9A227); }
.note.pinned { box-shadow: inset 0 0 0 1px var(--gold, #C9A227); }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 12px; align-items: start; }
.note-grid .note { margin: 0; }

/* Communication timeline */
.timeline { list-style: none; padding: 0 0 0 18px; margin: 14px 0 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.timeline li::before { content: ""; position: absolute; left: -26px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--black); border: 2px solid var(--crimson); }
.timeline li.ch-email::before { border-color: var(--gold, #C9A227); }
.timeline li.ch-phone::before, .timeline li.ch-text::before { background: var(--crimson); }
.timeline .muted { font-size: 13px; }
.timeline p { margin: 2px 0 0; font-size: 15px; overflow-wrap: anywhere; }
.timeline a { color: var(--white); }

/* Invoice editor */
.items-edit { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.items-edit .ih, .items-edit .ir { display: grid; grid-template-columns: minmax(0, 1fr) 70px 110px; gap: 6px; }
.items-edit .ih span { font: 400 14px/1 var(--display); letter-spacing: .16em; color: var(--muted); }
.items-edit input { font: 400 16px/1.2 var(--body); color: var(--white); background: var(--black); border: 2px solid var(--line); padding: 10px; width: 100%; border-radius: 0; }
.items-edit input:focus { outline: none; border-color: var(--crimson); }
.items-edit input:disabled { opacity: .6; }
@media (max-width: 520px) { .items-edit .ih, .items-edit .ir { grid-template-columns: minmax(0, 1fr) 54px 84px; } }

/* Admin tables scroll sideways on phones instead of squashing */
@media (max-width: 760px) {
  .crm .table-wrap table { min-width: 640px; }
  .client-head { flex-direction: column; align-items: flex-start; }
  .jump { top: 0; position: static; }
}
@media (prefers-reduced-motion: reduce) { .client-card, .task, .note { animation: none; } }

/* ============ CRM growth: pipeline, insights, automations ============ */
.board { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 28px; scroll-snap-type: x proximity; }
.lane { background: var(--charcoal); border: 1px solid var(--line); border-top: 3px solid var(--muted); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; scroll-snap-align: start; }
.lane h3 { font: 400 19px/1.1 var(--display); letter-spacing: .1em; margin: 2px 0 4px; display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.lane h3 .muted { font-size: 15px; }
.lane.l-new { border-top-color: #b26a00; } .lane.l-contacted { border-top-color: #1565c0; } .lane.l-consultation { border-top-color: var(--gold, #C9A227); }
.lane.l-proposal { border-top-color: var(--crimson); } .lane.l-won { border-top-color: #2e7d32; } .lane.l-lost { border-top-color: var(--muted); opacity: .85; }
.empty-lane { text-align: center; margin: 18px 0; }
.deal { background: var(--black); border: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; animation: row-in .4s var(--ease) both; transition: border-color .2s, transform .2s var(--ease); }
.deal:hover { border-color: var(--crimson); transform: translateY(-1px); }
.deal strong { font-size: 15px; }
.deal.stale { box-shadow: inset 3px 0 0 var(--crimson); }
.deal-client { font: 400 16px/1.1 var(--display); letter-spacing: .08em; color: var(--crimson); text-decoration: none; }
.deal-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.deal-actions details { flex-basis: 100%; }
.deal-actions details[open] { display: flex; flex-direction: column; gap: 8px; }
.deal-actions summary { cursor: pointer; list-style: none; font-size: 13px; }
.deal-actions summary::-webkit-details-marker { display: none; }
.deal-actions .btn.sm { font-size: 15px; padding: 8px 12px 6px; }
@media (max-width: 760px) { .board { grid-template-columns: repeat(6, 82vw); } }

.badge.o-new { color: #b26a00; } .badge.o-contacted { color: #1565c0; } .badge.o-consultation { color: var(--gold-deep, #9C7A1E); }
.badge.o-proposal { color: var(--crimson); } .badge.o-won { color: #2e7d32; } .badge.o-lost { color: var(--muted); }
.badge.tag { color: var(--muted); text-transform: lowercase; letter-spacing: .06em; }
.client-tags { margin-top: 8px; }
.client-tags a, .tags a { color: inherit; text-decoration: none; }
.client-tags li:hover, .tags li:has(a:hover) { border-color: var(--crimson); color: var(--white); }

.pipe-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: var(--line); border: 2px solid var(--line); margin: 0 0 18px; text-decoration: none; color: var(--white); }
.pipe-strip span { background: var(--black); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; font: 400 15px/1.1 var(--display); letter-spacing: .12em; color: var(--muted); position: relative; transition: background .2s; }
.pipe-strip span::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: currentColor; opacity: .8; }
.pipe-strip strong { font-size: 32px; color: var(--white); letter-spacing: .02em; }
.pipe-strip em { font-style: normal; font-family: var(--body); font-size: 13px; letter-spacing: 0; }
.pipe-strip:hover span { background: var(--charcoal); }
.pipe-strip .l-new { color: #b26a00; } .pipe-strip .l-contacted { color: #1565c0; } .pipe-strip .l-consultation { color: var(--gold, #C9A227); } .pipe-strip .l-proposal { color: var(--crimson); }
@media (max-width: 640px) { .pipe-strip { grid-template-columns: repeat(2, 1fr); } }

.funnel { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.funnel li { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); overflow: hidden; z-index: 0; }
.funnel .fbar { position: absolute; inset: 0 auto 0 0; width: var(--w); background: rgba(211,47,47,.14); z-index: -1; transform-origin: left; animation: grow .8s var(--ease) both; }
.funnel .f-won .fbar { background: rgba(46,125,50,.18); } .funnel .f-lost .fbar { background: rgba(128,128,128,.15); }
.bar { display: block; height: 4px; margin-top: 6px; width: var(--w); background: linear-gradient(90deg, var(--crimson), var(--gold, #C9A227)); transform-origin: left; animation: grow .8s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.ranked { counter-reset: r; }
.ranked li { counter-increment: r; }
.ranked li > a::before { content: counter(r) ". "; color: var(--crimson); font-weight: 700; }

.auto-rules { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 18px; }
.rule { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--crimson); background: var(--charcoal); cursor: pointer; }
.rule > input { width: 20px; height: 20px; accent-color: var(--crimson); margin-top: 2px; flex: none; }
.rule span { display: flex; flex-direction: column; gap: 4px; }
.rule small { color: var(--muted); font-size: 14px; line-height: 1.5; }
.rule input.mini { width: 64px; display: inline-block; font: 400 15px/1 var(--body); color: var(--white); background: var(--black); border: 2px solid var(--line); padding: 4px 6px; margin: 0 2px; }
@media (prefers-reduced-motion: reduce) { .deal, .funnel .fbar, .bar { animation: none; } }

/* ============ Staff tools: search, quick add, toasts, progress, today, motion ============ */
kbd { font: 500 11px/1 var(--mono); padding: 3px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; color: var(--muted); background: var(--black); }
.nav-search { display: inline-flex; align-items: center; gap: 8px; }
.nav-search kbd { font-size: 10px; }
@media (max-width: 900px) { .nav-search kbd { display: none; } }

/* Search palette */
dialog.palette, dialog.keys { border: 0; padding: 0; background: transparent; max-width: min(640px, calc(100vw - 24px)); width: 100%; margin: 12vh auto auto; color: var(--white); overflow: visible; }
dialog.palette::backdrop, dialog.keys::backdrop { background: rgba(10,10,10,.55); backdrop-filter: blur(3px); }
dialog[open].palette .palette-box, dialog[open].keys form { animation: pop-in .28s var(--ease) both; }
dialog[open]::backdrop { animation: fade-in .25s ease both; }
.palette-box { background: var(--black); border: 2px solid var(--line); border-top: 3px solid var(--crimson); box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); }
.palette-box input { width: 100%; font: 400 20px/1.2 var(--body); padding: 18px 20px 18px 52px; border: 0; border-bottom: 1px solid var(--line); background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23D32F2F' stroke-width='2.4'%3E%3Ccircle cx='8.5' cy='8.5' r='6'/%3E%3Cpath d='m13 13 5 5'/%3E%3C/svg%3E") 20px 50% no-repeat; color: var(--white); outline: none; }
.palette.loading .palette-box input { background-image: linear-gradient(90deg, transparent, rgba(211,47,47,.12), transparent), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23D32F2F' stroke-width='2.4'%3E%3Ccircle cx='8.5' cy='8.5' r='6'/%3E%3Cpath d='m13 13 5 5'/%3E%3C/svg%3E"); background-size: 200% 100%, auto; background-position: 0 0, 20px 50%; background-repeat: no-repeat; animation: shimmer 1s linear infinite; }
.palette-results { list-style: none; margin: 0; padding: 6px; max-height: min(56vh, 460px); overflow-y: auto; }
.palette-results li { animation: row-in .25s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
.palette-results a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; text-decoration: none; color: var(--white); border-left: 3px solid transparent; }
.palette-results [aria-selected="true"] a, .palette-results a:hover { background: var(--charcoal-2); border-left-color: var(--crimson); }
.palette-results .none { padding: 18px; color: var(--muted); text-align: center; animation: none; }
.pt { flex: none; width: 70px; text-align: center; font: 400 13px/1 var(--display); letter-spacing: .14em; padding: 5px 0 3px; border: 1px solid currentColor; color: var(--muted); }
.pt.t-client { color: var(--crimson); } .pt.t-booking { color: #2e7d32; } .pt.t-invoice { color: var(--gold-deep, #9C7A1E); } .pt.t-deal { color: #1565c0; }
.pm { display: flex; flex-direction: column; min-width: 0; }
.pm strong, .pm small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm small { color: var(--muted); font-size: 13px; }
.palette-hint { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Shortcuts dialog */
dialog.keys form { background: var(--black); border: 2px solid var(--line); border-top: 3px solid var(--gold, #C9A227); padding: 22px 24px; }
dialog.keys h3 { font: 400 26px/1 var(--display); letter-spacing: .06em; margin: 0 0 14px; }
dialog.keys dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0 0 18px; align-items: center; }
dialog.keys dd { margin: 0; color: var(--muted); }

/* Quick-add button */
.fab { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 40; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 10px; }
.fab-btn { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--crimson); color: #fff; font: 400 34px/1 var(--display); cursor: pointer; box-shadow: 0 14px 30px -10px rgba(211,47,47,.7), 0 0 0 0 rgba(211,47,47,.5); transition: transform .35s var(--ease), box-shadow .3s; animation: fab-in .6s var(--ease) .4s both, ring 2.8s ease-out 1.2s 2; }
.fab-btn span { display: block; transition: transform .35s var(--ease); padding-top: 3px; }
.fab-btn:hover { transform: scale(1.06); }
.fab.open .fab-btn span { transform: rotate(135deg); }
.fab-menu { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; }
.fab-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--black); border: 1px solid var(--line); border-right: 3px solid var(--crimson); color: var(--white); text-decoration: none; font-size: 15px; white-space: nowrap; box-shadow: 0 12px 24px -16px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .2s, transform .3s var(--ease), background .2s; }
.fab-menu a b { font: 400 14px/1 var(--display); width: 22px; height: 22px; display: grid; place-items: center; background: var(--crimson); color: #fff; padding-top: 2px; }
.fab-menu a:hover { background: var(--charcoal-2); }
.fab.open .fab-menu { pointer-events: auto; }
.fab.open .fab-menu a { opacity: 1; transform: none; }
.fab.open .fab-menu a:nth-last-child(1) { transition-delay: 0ms; } .fab.open .fab-menu a:nth-last-child(2) { transition-delay: 40ms; }
.fab.open .fab-menu a:nth-last-child(3) { transition-delay: 80ms; } .fab.open .fab-menu a:nth-last-child(4) { transition-delay: 120ms; } .fab.open .fab-menu a:nth-last-child(5) { transition-delay: 160ms; }
@media print { .fab, .toasts { display: none; } }

/* Toasts */
.toasts { position: fixed; top: 84px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 10px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 40px 14px 14px; background: var(--black); border: 1px solid var(--line); border-left: 4px solid #2e7d32; box-shadow: 0 20px 40px -18px rgba(0,0,0,.55); pointer-events: auto; overflow: hidden; animation: toast-in .45s var(--ease) both; }
.toast.err { border-left-color: var(--crimson); }
.toast.out { animation: toast-out .35s ease both; }
.toast p { margin: 0; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.toast .ti { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #2e7d32; color: #fff; font-weight: 700; font-size: 14px; animation: pop-in .4s var(--ease) .15s both; }
.toast.err .ti { background: var(--crimson); }
.toast button { position: absolute; top: 8px; right: 8px; border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.toast i { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #2e7d32; transform-origin: left; animation: drain 6s linear both; }
.toast.err i, .toast.hold i { display: none; }

/* Reveal on scroll (set by admin.js only when motion is allowed) */
.reveal-on .stats > div, .reveal-on .admin-page .panel, .reveal-on .client-card, .reveal-on .lane, .reveal-on .note, .reveal-on .task, .reveal-on .deal, .reveal-on .pipe-strip, .reveal-on .today > * { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .6s var(--ease); transition-delay: var(--d, 0ms); animation: none; }
.reveal-on .shown { opacity: 1 !important; transform: none !important; }
.stats > div { transition: background .25s, transform .25s var(--ease); }
.stats > div:hover { background: var(--charcoal-2); }

/* Progress bars */
.progress { position: relative; height: 26px; background: var(--charcoal-2); border: 1px solid var(--line); margin: 10px 0 16px; overflow: hidden; }
.progress span { position: absolute; inset: 0 auto 0 0; width: var(--p); background: linear-gradient(90deg, var(--crimson), #e5574f); transition: width 1.1s var(--ease); }
.progress.full span { background: linear-gradient(90deg, #2e7d32, #43a047); }
.progress span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 2.4s linear infinite; }
.reveal-on .progress:not(.go) span { width: 0; }
.progress em { position: relative; z-index: 1; display: block; font: 600 12.5px/26px var(--body); font-style: normal; padding: 0 10px; color: var(--white); mix-blend-mode: normal; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.card-bar .progress { height: 8px; margin: 4px 0 0; }
.card-bar .progress em { display: none; }
.card-bar { grid-column: 1 / -1; }

/* Today panel */
.today { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; margin: 6px 0 22px; }
@media (max-width: 860px) { .today { grid-template-columns: 1fr; } }
.today .panel { margin: 0; }
.today h3 { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.today h3 .muted { font: 400 14px/1 var(--body); letter-spacing: 0; }
.today-side h3 + .list, .today-side .list + h3 { margin-top: 6px; }
.today-side .list + h3 { margin-top: 22px; }
.next-up { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: rgba(211,47,47,.08); border-left: 3px solid var(--crimson); margin: 0 0 12px; }
.next-up a { color: var(--white); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--crimson); box-shadow: 0 0 0 0 rgba(211,47,47,.6); animation: ring 1.8s ease-out infinite; flex: none; }
.agenda { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.agenda::before { content: ""; position: absolute; left: 62px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.agenda li { display: grid; grid-template-columns: 52px 1fr auto; gap: 22px; align-items: start; padding: 8px 0; position: relative; }
.agenda li::before { content: ""; position: absolute; left: 53px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--black); border: 2px solid #2e7d32; z-index: 1; }
.agenda li.s-pending::before { border-color: #b26a00; }
.agenda li.now::before { background: var(--crimson); border-color: var(--crimson); box-shadow: 0 0 0 0 rgba(211,47,47,.6); animation: ring 1.8s ease-out infinite; }
.agenda li.past { opacity: .5; }
.agenda time { font: 400 22px/1 var(--display); letter-spacing: .04em; text-align: right; padding-top: 4px; }
.agenda time small { font-size: 12px; margin-left: 2px; color: var(--muted); }
.agenda a { color: var(--white); }
.agenda .call { font: 400 14px/1 var(--display); letter-spacing: .14em; padding: 7px 10px 5px; border: 1px solid var(--line); text-decoration: none; align-self: center; }
.agenda .call:hover { background: var(--crimson); border-color: var(--crimson); color: #fff; }

/* Client quick facts */
.facts { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 2px; margin: 18px 0 4px; padding: 0; background: var(--line); border: 1px solid var(--line); }
.facts li { background: var(--black); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.facts span { font: 400 13px/1 var(--display); letter-spacing: .16em; color: var(--muted); }
.facts strong { font-size: 17px; }
.facts a { color: var(--white); }

.booking-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.when-rel { font: 400 18px/1 var(--display); letter-spacing: .1em; color: var(--crimson); padding-top: 2px; }

/* Copy / text buttons */
button.copy { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 6px; vertical-align: middle; border: 1px solid var(--line); background: var(--black); color: var(--muted); cursor: pointer; transition: color .2s, border-color .2s, transform .2s var(--ease); }
button.copy svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; }
button.copy:hover { color: var(--crimson); border-color: var(--crimson); }
button.copy.ok { color: #fff; background: #2e7d32; border-color: #2e7d32; transform: scale(1.1); }
button.copy.ok svg { display: none; }
button.copy.ok::after { content: "✓"; font-size: 13px; }
a.sms { margin-left: 6px; font: 400 13px/1 var(--display); letter-spacing: .12em; padding: 5px 7px 3px; border: 1px solid var(--line); text-decoration: none; vertical-align: middle; color: var(--muted); }
a.sms:hover { color: #fff; background: var(--crimson); border-color: var(--crimson); }

/* Draft autosave + busy submit */
.draft-note { margin: 4px 0 0; font-size: 13px; color: var(--gold-deep, #9C7A1E); animation: row-in .3s var(--ease) both; }
.btn.busy { pointer-events: none; opacity: .8; }
.btn.busy::after { content: ""; width: 14px; height: 14px; margin-left: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

/* Subtle polish */
.admin-page .tabs a { transition: background .2s, color .2s, border-color .2s; }
.admin-page .tabs a:not([aria-current]):hover { border-color: var(--crimson); color: var(--white); }
.admin-page tbody tr { transition: background .15s; }
.admin-page .list li { transition: background .15s, padding .2s var(--ease); }
.admin-page .list li:hover { background: var(--charcoal); padding-left: 6px; padding-right: 6px; }

@keyframes pop-in { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { from { background-position: 200% 0, 20px 50%; } to { background-position: -200% 0, 20px 50%; } }
@keyframes fab-in { from { opacity: 0; transform: scale(.4) rotate(-90deg); } to { opacity: 1; transform: none; } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(211,47,47,.55); } 100% { box-shadow: 0 0 0 16px rgba(211,47,47,0); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); height: 0; padding-top: 0; padding-bottom: 0; margin: 0; } }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .fab-btn, .pulse, .agenda li.now::before, .toast, .toast i, .toast .ti, .progress span::after, .palette-results li, dialog[open] .palette-box, dialog[open].keys form { animation: none !important; }
  .progress span, .fab-menu a, .fab-btn span { transition: none; }
}

/* =====================================================================
   Refined dashboard finish — same palette (crimson · ink · paper · gold),
   quieter surfaces, hairline rules, layered depth, and smoother motion.
   Scoped to staff pages (body.admin) unless noted.
   ===================================================================== */

/* Smooth cross-page fades in browsers that support view transitions (booking app only) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .18s ease both; }
::view-transition-new(root) { animation: vt-in .32s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }

body.admin {
  --ink-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 1px 2px rgba(27,23,21,.05), 0 12px 32px -18px rgba(27,23,21,.28);
  --ink-shadow-hi: 0 1px 0 rgba(255,255,255,.7) inset, 0 2px 4px rgba(27,23,21,.06), 0 26px 50px -24px rgba(27,23,21,.38);
  --hair: rgba(27,23,21,.10);
  background:
    radial-gradient(1200px 420px at 85% -120px, rgba(211,47,47,.07), transparent 70%),
    radial-gradient(900px 380px at -10% 10%, rgba(201,162,39,.07), transparent 70%),
    var(--charcoal);
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}
/* Fine paper grain */
body.admin::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.09 0 0 0 0 0.08 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
body.admin main, body.admin footer { position: relative; z-index: 1; }
body.admin ::selection { background: rgba(211,47,47,.18); }

/* Header: scroll progress hairline and sliding nav indicator */
body.admin header.top { box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 10px 30px -20px rgba(0,0,0,.6); }
body.admin header.top::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; transform-origin: left; transform: scaleX(var(--scroll, 0));
  background: linear-gradient(90deg, var(--crimson), var(--gold, #C9A227)); transition: transform .1s linear; }
body.admin header.top nav ul { position: relative; }
body.admin header.top nav a[aria-current="page"] { color: #fff; }
.nav-ink { position: absolute; bottom: -6px; height: 2px; background: var(--crimson); box-shadow: 0 0 12px rgba(211,47,47,.7); border-radius: 2px;
  transition: left .45s var(--ease), width .45s var(--ease), opacity .3s; pointer-events: none; }
@media (max-width: 760px) { .nav-ink { display: none; } }

/* Headings: tighter rhythm, brush word writes itself in */
body.admin .admin-page { padding-block: clamp(36px, 5vw, 64px) clamp(56px, 7vw, 96px); }
body.admin .admin-page h2 { letter-spacing: .005em; margin-bottom: 14px; animation: rise .7s var(--ease) both; }
body.admin .admin-page h2 .brush { clip-path: inset(-40% 100% -40% -10%); animation: write .9s cubic-bezier(.65,0,.35,1) .25s forwards; }
body.admin .admin-page .eyebrow { animation: rise .6s var(--ease) both; font-size: 15px; letter-spacing: .32em; }
body.admin .admin-page .eyebrow::before { transform-origin: left; animation: draw-x .7s var(--ease) .1s both; }
@keyframes write { to { clip-path: inset(-40% -10% -40% -10%); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Surfaces: hairline borders, layered depth, gold top rule, cursor spotlight */
body.admin .panel, body.admin .client-card, body.admin .lane, body.admin .table-wrap, body.admin .calendar, body.admin .cal-board, body.admin .facts, body.admin .pipe-strip {
  border: 1px solid var(--hair); box-shadow: var(--ink-shadow);
}
body.admin .panel { position: relative; isolation: isolate; border-top: 1px solid var(--hair); padding: clamp(20px, 2.6vw, 30px); transition: box-shadow .35s var(--ease), transform .35s var(--ease); }
body.admin .panel::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px;
  background: linear-gradient(90deg, var(--gold, #C9A227), #f6e39b 40%, var(--gold, #C9A227) 60%, transparent); background-size: 200% 100%; opacity: .9; }
body.admin .panel:hover::before { animation: sheen 2.2s linear infinite; }
@keyframes sheen { from { background-position: 100% 0; } to { background-position: -100% 0; } }
body.admin .panel::after, body.admin .client-card::after, body.admin .stats > div::after, body.admin .deal::after, body.admin .trend::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1; opacity: 0; transition: opacity .35s;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(211,47,47,.07), transparent 60%);
}
body.admin .panel:hover::after, body.admin .client-card:hover::after, body.admin .stats > div:hover::after, body.admin .deal:hover::after, body.admin .trend:hover::after { opacity: 1; }
body.admin .panel h3 { font-size: 24px; letter-spacing: .07em; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
body.admin .panel h3 .muted { font: 400 13px/1 var(--body); letter-spacing: .02em; }
body.admin details.panel:hover { box-shadow: var(--ink-shadow-hi); }

/* Stat tiles: editorial numbers, hairline grid, lift on hover */
body.admin .stats { gap: 0; background: var(--black); border: 1px solid var(--hair); box-shadow: var(--ink-shadow); }
body.admin .stats > div { position: relative; isolation: isolate; overflow: hidden; background: transparent; padding: 22px 22px 20px; border-right: 1px solid var(--hair); display: flex; flex-direction: column; gap: 6px; }
body.admin .stats > div:last-child { border-right: 0; }
body.admin .stats > div::before { content: ""; position: absolute; left: 22px; top: 0; width: 28px; height: 2px; background: var(--crimson); transform-origin: left; transition: width .45s var(--ease); }
body.admin .stats > div:hover::before { width: calc(100% - 44px); }
body.admin .stats strong { font-size: clamp(34px, 3.4vw, 46px); line-height: .95; }
body.admin .stats span { font-size: 13px; letter-spacing: .02em; }
body.admin .stats .alert { background: linear-gradient(180deg, rgba(211,47,47,.06), transparent); }
body.admin .stats .alert::before { width: calc(100% - 44px); animation: alert-pulse 2.4s ease-in-out infinite; }
@keyframes alert-pulse { 50% { opacity: .35; } }
@media (max-width: 640px) { body.admin .stats > div { border-right: 0; border-bottom: 1px solid var(--hair); } }

/* Deltas and trends */
.delta { font: 600 12px/1 var(--body); letter-spacing: .02em; color: var(--muted); }
.delta.up { color: #2e7d32; } .delta.down { color: var(--crimson); }
.trends { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 14px; margin: 0 0 18px; }
.trend { position: relative; isolation: isolate; overflow: hidden; background: var(--black); border: 1px solid var(--hair, var(--line)); box-shadow: var(--ink-shadow); padding: 18px 20px 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: end; }
.trend-label { grid-column: 1 / -1; font: 400 14px/1 var(--display); letter-spacing: .18em; color: var(--muted); }
.trend strong { font: 400 40px/1 var(--display); letter-spacing: .02em; }
.trend .delta { justify-self: end; padding-bottom: 6px; }
.trend svg { grid-column: 1 / -1; width: calc(100% + 40px); margin: 6px -20px 0; height: 60px; display: block; }
.spark-line { fill: none; stroke: var(--crimson); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-line 1.6s cubic-bezier(.65,0,.35,1) .3s forwards; }
.spark-area { opacity: 0; animation: fade-in 1s ease 1.1s forwards; }
.spark-dot { fill: var(--crimson); stroke: var(--black); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; animation: dot-in .5s var(--ease) 1.7s forwards, dot-pulse 2.4s ease-in-out 2.4s infinite; }
.bars rect { fill: rgba(211,47,47,.22); transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); animation: bar-up .7s var(--ease) forwards; animation-delay: calc(.2s + var(--i) * 70ms); }
.bars rect.now { fill: var(--crimson); }
.bars rect:hover { fill: var(--gold, #C9A227); }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
@keyframes dot-in { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: none; } }
@keyframes dot-pulse { 50% { transform: scale(1.35); } }
@keyframes bar-up { to { transform: scaleY(1); } }

/* Today: live clock */
.clock { font: 400 22px/1 var(--display); letter-spacing: .06em; color: var(--crimson); margin-left: auto; order: 3; }
.clock small { font-size: 12px; margin-left: 2px; color: var(--muted); }
.clock .colon { animation: blink-soft 1s steps(1) infinite; }
@keyframes blink-soft { 50% { opacity: .2; } }

/* Tables: sticky header, hairlines, sliding accent on hover */
body.admin .table-wrap { background: var(--black); }
body.admin thead th { position: sticky; top: 0; z-index: 1; background: var(--black); border-bottom: 1px solid var(--white); font-size: 13px; letter-spacing: .2em; }
body.admin tbody td { border-bottom-color: var(--hair); }
body.admin tbody tr { position: relative; }
body.admin tbody tr td:first-child { box-shadow: inset 0 0 0 transparent; transition: box-shadow .3s var(--ease); }
body.admin tbody tr:hover { background: linear-gradient(90deg, rgba(211,47,47,.05), transparent 60%); }
body.admin tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--crimson); }

/* Buttons: tactile press, ripple, refined focus */
body.admin .btn { transition: color .3s, border-color .3s, box-shadow .3s, transform .2s var(--ease); }
body.admin .btn:active { transform: translateY(1px) scale(.985); }
body.admin .btn.primary { box-shadow: 0 8px 22px -12px rgba(211,47,47,.8); }
body.admin :focus-visible { outline: 2px solid var(--gold, #C9A227); outline-offset: 3px; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: rgba(255,255,255,.45); transform: scale(0); animation: ripple .6s ease-out forwards; z-index: 0; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* Inputs: calmer fields with a crimson underline on focus */
body.admin .field input, body.admin .field textarea, body.admin .field select, body.admin .picker input, body.admin .picker select {
  border: 1px solid var(--hair); background: var(--black); box-shadow: 0 1px 0 rgba(27,23,21,.04) inset; transition: border-color .25s, box-shadow .25s, background .25s;
}
body.admin .field input:hover, body.admin .field textarea:hover, body.admin .field select:hover { border-color: rgba(27,23,21,.22); }
body.admin .field input:focus, body.admin .field textarea:focus, body.admin .field select:focus, body.admin .picker input:focus, body.admin .picker select:focus {
  border-color: var(--crimson); box-shadow: 0 0 0 4px rgba(211,47,47,.10), 0 2px 0 var(--crimson); outline: none;
}
body.admin .field label { font-size: 14px; letter-spacing: .22em; transition: color .2s; }
body.admin .field:focus-within label { color: var(--crimson); }

/* Badges become pills with a status dot */
body.admin .badge { border-radius: 999px; padding: 5px 10px 4px 9px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; background: var(--black); border-color: color-mix(in srgb, currentColor 35%, transparent); }
body.admin .badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; margin-top: -1px; }
body.admin .badge.s-pending::before, body.admin .badge.i-overdue::before, body.admin .badge.o-new::before { animation: dot-glow 1.8s ease-in-out infinite; }
body.admin .badge.i-overdue { background: var(--crimson); }
body.admin .badge.i-overdue::before { background: #fff; }
body.admin .badge.tag::before, body.admin .tags .badge::before { display: none; }
@keyframes dot-glow { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent); } }

/* Tabs: segmented control */
body.admin .admin-page .tabs { gap: 0; border: 1px solid var(--hair); background: var(--black); box-shadow: var(--ink-shadow); width: fit-content; max-width: 100%; }
body.admin .admin-page .tabs a { border: 0; border-right: 1px solid var(--hair); position: relative; }
body.admin .admin-page .tabs a:last-child { border-right: 0; }
body.admin .admin-page .tabs a[aria-current] { box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
body.admin .crm-tabs { width: 100% !important; }

/* Lists, cards, notes, deals */
body.admin .list li { border-bottom-color: var(--hair); }
body.admin .client-card { position: relative; isolation: isolate; overflow: hidden; }
body.admin .client-card:hover { box-shadow: var(--ink-shadow-hi), 0 0 0 1px rgba(211,47,47,.35); border-color: transparent; }
body.admin .client-card .avatar { transition: transform .4s var(--ease), background .3s, color .3s; }
body.admin .client-card:hover .avatar { transform: rotate(-4deg) scale(1.05); background: var(--crimson); color: #fff; border-color: var(--crimson); }
body.admin .avatar { box-shadow: 0 6px 16px -10px rgba(27,23,21,.5); }
body.admin .deal { position: relative; isolation: isolate; box-shadow: 0 1px 2px rgba(27,23,21,.05); }
body.admin .deal:hover { box-shadow: var(--ink-shadow-hi); }
body.admin .note { background: var(--black); border-color: var(--hair); box-shadow: 0 1px 2px rgba(27,23,21,.04); transition: transform .3s var(--ease), box-shadow .3s; }
body.admin .note:hover { transform: translateY(-1px); box-shadow: var(--ink-shadow); }
body.admin .task { background: var(--black); border-color: var(--hair); transition: transform .3s var(--ease), box-shadow .3s, opacity .3s; }
body.admin .task:hover { transform: translateX(3px); box-shadow: var(--ink-shadow); }

/* Empty states with a gently floating mark */
body.admin .empty { border: 1px dashed rgba(27,23,21,.18); background: linear-gradient(180deg, var(--black), transparent); padding: 36px 24px 30px; }
body.admin .empty::before { content: ""; display: block; width: 44px; height: 44px; margin: 0 auto 12px; opacity: .8; animation: float 4s ease-in-out infinite;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44' fill='none' stroke='%23D32F2F' stroke-width='1.6'%3E%3Crect x='6' y='10' width='32' height='26' rx='2'/%3E%3Cpath d='M6 17h32M14 6v8M30 6v8'/%3E%3Ccircle cx='22' cy='27' r='3' fill='%23C9A227' stroke='none'/%3E%3C/svg%3E") center / contain no-repeat; }
@keyframes float { 50% { transform: translateY(-5px); } }

/* Calendar polish */
body.admin .cal-board .cell { transition: background .2s; }
body.admin .cal-board .cell:hover { background: #fffaf3; }
body.admin .cal-board .cell.today { box-shadow: inset 0 0 0 2px var(--crimson), inset 0 0 30px rgba(211,47,47,.08); }
body.admin .ev { border-radius: 2px; box-shadow: 0 1px 2px rgba(27,23,21,.06); }

/* Toasts & palette pick up the refined depth */
body.admin .toast, body.admin .palette-box, body.admin dialog.keys form { border-color: var(--hair); box-shadow: 0 30px 70px -24px rgba(27,23,21,.45); }

/* Footer quieter on staff pages */
body.admin footer { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  body.admin .admin-page h2, body.admin .admin-page .eyebrow, body.admin .admin-page .eyebrow::before, .spark-line, .spark-area, .spark-dot, .bars rect,
  body.admin .stats .alert::before, body.admin .badge::before, body.admin .empty::before, .clock .colon, body.admin .panel:hover::before { animation: none !important; }
  body.admin .admin-page h2 .brush { animation: none; clip-path: none; }
  .spark-line { stroke-dashoffset: 0; } .spark-area, .spark-dot { opacity: 1; } .bars rect { transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
time.rel.flip { animation: rise .45s var(--ease); display: inline-block; }
.fab-btn { position: relative; overflow: hidden; }

/* ============ Booking tools (customer), run sheet link, calendar feed, bulk ============ */
.booking-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 14px 0 18px; }
.booking-tools .tool { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 10px; border: 1px solid var(--line); background: var(--black); color: var(--white);
  font: 400 15px/1 var(--display); letter-spacing: .14em; text-decoration: none; cursor: pointer; transition: border-color .2s, transform .25s var(--ease), box-shadow .25s; animation: row-in .45s var(--ease) both; }
.booking-tools .tool:nth-child(2) { animation-delay: .06s; } .booking-tools .tool:nth-child(3) { animation-delay: .12s; } .booking-tools .tool:nth-child(4) { animation-delay: .18s; }
.booking-tools .tool:hover { border-color: var(--crimson); transform: translateY(-2px); box-shadow: 0 12px 24px -16px rgba(211,47,47,.6); }
.booking-tools svg { width: 18px; height: 18px; fill: none; stroke: var(--crimson); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.runsheet-link { float: right; font: 400 14px/1 var(--display); letter-spacing: .14em; color: var(--crimson); text-decoration: none; padding-top: 6px; }
.runsheet-link:hover { text-decoration: underline; }
.feed-url { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.feed-url code { font: 500 12px/1.5 var(--mono); background: var(--charcoal); border: 1px solid var(--line); padding: 6px 8px; overflow-wrap: anywhere; flex: 1 1 260px; }
.bulk [hidden] { display: none !important; }
@media print {
  body.public header.top, body.public footer, .booking-tools, .pay-box, #change, .flash, .toasts { display: none !important; }
  body.public .details { padding: 0; }
  body.public .summary.ticket, body.public .summary.ticket dt, body.public .summary.ticket dd { animation: none !important; opacity: 1 !important; }
}
@media (prefers-reduced-motion: reduce) { .booking-tools .tool { animation: none; } }
