/* The Barber Room — staff dashboard. Builds on style.css tokens. */

body.admin { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.admin .topbar { gap: 12px; }
.admin .topbar .wordmark { margin-right: 0; }
.admin-tag { font-weight: 650; font-size: .9rem; color: var(--steel); padding: 4px 10px; border-radius: 99px; background: var(--chalk); box-shadow: inset 0 0 0 1px var(--rule); }
.topbar-spacer { flex: 1; }
.admin-link { font-weight: 600; text-decoration: none; display: none; }
.admin-link:hover { text-decoration: underline; }
@media (min-width: 600px) { .admin-link { display: inline; } }

.admin-main { max-width: 1040px; margin: 0 auto; padding: 8px var(--gutter) 0; }
.admin-center { min-height: calc(100svh - var(--topbar) - 40px); display: grid; place-items: center; }
.admin-card { width: min(420px, 100%); background: var(--chalk); border-radius: 24px; padding: 28px 22px; display: grid; gap: 12px; box-shadow: 0 14px 32px -20px rgb(31 34 33 / .35); }
.admin-card .auth { margin-top: 8px; }
.spinner-lg { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--graphite); border-right-color: transparent; animation: spin .8s linear infinite; }
.demo-hint { font-size: .9rem; padding: 10px 12px; border-radius: 12px; background: var(--concrete); }
.demo-hint code { font-weight: 700; font-family: inherit; }
.demo-banner { margin: 8px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--oxblood-wash); color: var(--oxblood-deep); font-size: .92rem; }

/* Header */
.admin-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; padding: 12px 0 18px; }
.admin-head h1 { font-size: clamp(2.6rem, 10vw, 3.6rem); }
.admin-stats { display: flex; gap: 8px; }
.admin-stats div { background: var(--chalk); border-radius: 14px; padding: 8px 14px; min-width: 84px; }
.admin-stats dt { font-size: .8rem; color: var(--steel); font-weight: 600; }
.admin-stats dd { font: 780 1.6rem/1.05 var(--display); font-variant-numeric: tabular-nums; }

/* Day strip */
.admin-days-wrap { margin: 0 calc(var(--gutter) * -1) 14px; }
@media (min-width: 1140px) { .admin-days-wrap { margin-inline: 0; } .admin-days-wrap .days { padding-inline: 2px; } }
.admin-days-wrap .days { padding: 8px var(--gutter) 6px; scroll-padding: 0 var(--gutter); }
.day { position: relative; }
.day .count {
  position: absolute; top: -5px; right: -5px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px;
  background: var(--oxblood); color: var(--chalk); font: 700 .75rem/22px var(--body); text-align: center;
  box-shadow: 0 0 0 2px var(--concrete);
}
.day .closed-dot { position: absolute; bottom: 7px; left: 50%; width: 18px; height: 3px; margin-left: -9px; border-radius: 9px; background: repeating-linear-gradient(90deg, var(--steel) 0 3px, transparent 3px 5px); }
.day.is-past:not([aria-pressed="true"]) { opacity: .6; }
.day-sep { flex: none; width: 1px; background: var(--rule); margin: 8px 4px; }

/* Next up */
.next-up { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px; border-radius: 18px; background: var(--graphite); color: var(--chalk); width: 100%; text-align: left; }
.next-up:hover { background: #000; }
.next-up .when { font: 800 2rem/1 var(--display); font-variant-numeric: tabular-nums; }
.next-up .what { flex: 1; min-width: 0; }
.next-up .what strong, .next-up .what span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-up .what span { color: #C9CCC6; font-size: .92rem; }
.next-up .label { font-size: .78rem; font-weight: 700; color: #C9CCC6; }

/* Tools */
.admin-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.seg-auto { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; }
.seg-auto button { padding: 0 12px; font-size: .95rem; }
.admin-tools .seg button { min-height: 38px; }
.btn-sm { min-height: 42px; padding: 0 16px; font-size: .95rem; }

/* Timeline */
.timeline { display: grid; gap: 6px; grid-auto-rows: minmax(52px, auto); align-items: stretch; }
.tl-head { position: sticky; top: var(--topbar); z-index: 5; background: rgb(228 229 225 / .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font: 760 1.25rem/1 var(--display); padding: 10px 2px 8px; display: flex; align-items: center; gap: 8px; min-height: 0; }
.tl-head .opt-face { width: 28px; height: 28px; font-size: 1rem; }
.tl-time { font-variant-numeric: tabular-nums; font-size: .85rem; font-weight: 650; color: var(--steel); padding-top: 6px; text-align: right; padding-right: 2px; }
.tl-time.is-now { color: var(--oxblood); }
.tl-time.is-now::after { content: ""; display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--oxblood); margin: 4px 0 0 auto; }
.tl-cell { border-radius: 12px; min-width: 0; text-align: left; padding: 8px 10px; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.tl-free { box-shadow: inset 0 0 0 1px var(--rule); color: var(--steel); font-size: .85rem; font-weight: 600; transition: background .15s, box-shadow .15s; }
.tl-free:hover:not(:disabled) { background: var(--chalk); box-shadow: inset 0 0 0 1.5px var(--graphite); color: var(--graphite); }
.tl-free .plus { opacity: 0; }
.tl-free:hover:not(:disabled) .plus, .tl-free:focus-visible .plus { opacity: 1; }
@media (hover: none) { .tl-free .plus { opacity: .55; } }
.tl-free:disabled { box-shadow: none; background: repeating-linear-gradient(0deg, transparent 0 51px, var(--rule) 51px 52px); opacity: .45; cursor: default; }
.tl-booking { background: var(--white); box-shadow: inset 4px 0 0 var(--graphite), inset 0 0 0 1px var(--rule); padding-left: 14px; }
.tl-booking:hover { box-shadow: inset 4px 0 0 var(--oxblood), inset 0 0 0 1.5px var(--graphite); }
.tl-booking strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-booking span { font-size: .85rem; color: var(--steel); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-booking.is-past { opacity: .62; }
.tl-block {
  background: repeating-linear-gradient(135deg, #D9DBD6 0 8px, #E4E5E1 8px 16px);
  box-shadow: inset 0 0 0 1px var(--rule); color: var(--graphite);
}
.tl-block:hover:not(:disabled) { box-shadow: inset 0 0 0 1.5px var(--graphite); }
.tl-block strong { font-size: .9rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-block span { font-size: .8rem; color: var(--steel); }
.tl-closed { padding: 28px 18px; text-align: center; border-radius: 18px; background: var(--chalk); }

/* Sheet contents */
.detail-name { font: 800 2.2rem/1 var(--display); margin-bottom: 6px; overflow-wrap: anywhere; }
.detail-mail { display: inline-flex; align-items: center; gap: 6px; color: var(--oxblood); font-weight: 650; text-decoration: none; overflow-wrap: anywhere; margin-bottom: 18px; }
.detail-mail:hover { text-decoration: underline; }
.form-grid { display: grid; gap: 14px; }
.field select {
  width: 100%; min-height: 52px; padding: 0 14px; border-radius: var(--r-field); background: var(--white);
  border: 1px solid var(--rule); font: inherit; font-size: 1rem; color: var(--graphite); appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--graphite) 50%), linear-gradient(135deg, var(--graphite) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.field select:focus { outline: none; border-color: var(--graphite); box-shadow: 0 0 0 3px rgb(31 34 33 / .12); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 36px; padding: 0 12px; border-radius: 99px; background: var(--concrete); font-size: .9rem; font-weight: 600; }
.chip:hover { background: #D8DAD5; }
.danger-zone { margin-top: 18px; display: grid; gap: 10px; }
.confirm-box { padding: 14px; border-radius: 14px; background: var(--oxblood-wash); color: var(--oxblood-deep); display: grid; gap: 12px; }
.confirm-box .row { display: flex; gap: 8px; }
.confirm-box .row .btn { flex: 1; }

.cancelled-list { margin-top: 18px; }
.cancelled-list summary { cursor: pointer; font-weight: 650; color: var(--steel); min-height: 44px; display: flex; align-items: center; }
.cancelled-list ul { display: grid; gap: 6px; }
.cancelled-list li { display: flex; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--chalk); color: var(--steel); font-size: .92rem; }
.cancelled-list li strong { color: var(--graphite); font-variant-numeric: tabular-nums; }
.admin-foot { margin-top: 22px; max-width: 60ch; }

.show-past { display: block; margin: -4px 0 6px 50px; font-size: .95rem; }

@media (max-width: 400px) { .admin-tag { display: none; } }
