/* =========================================================
   Admin / staff area
   ========================================================= */
body.adm { background: var(--paper-2); padding-bottom: 3rem; }
.muted { color: var(--muted); }
.adm-top { background: var(--ink); color: var(--cream); position: sticky; top: 0; z-index: 40; }
.adm-top > .wrap:first-child { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.adm-brand img { height: 42px; width: auto; }
.adm-user { display: flex; align-items: center; gap: .7rem; }
.adm-user .who { display: flex; flex-direction: column; line-height: 1.15; text-align: right; }
.adm-user .who b { font-size: .92rem; }
.adm-user .who small { font-size: .72rem; color: #bdb4a0; text-transform: uppercase; letter-spacing: .08em; }
.adm-tabs { display: flex; gap: .3rem; overflow-x: auto; padding-bottom: .6rem; scrollbar-width: none; }
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tabs button {
  flex: none; display: inline-flex; align-items: center; gap: .45rem; border: 0; border-radius: 999px;
  padding: .5rem 1rem; background: #222; color: #cfc6b0; font-weight: 600; font-size: .92rem;
}
.adm-tabs button[aria-selected="true"] { background: var(--red); color: #fff; }
.adm-main { padding: 1.4rem 0 3rem; display: grid; gap: 1.1rem; }
.mini { padding: .35rem .8rem; min-height: 0; font-size: .85rem; }

.panel { background: #fff; border: 2px solid var(--ink); border-radius: var(--radius); padding: 1.2rem; }
.panel h2 { font-family: var(--f-display); font-weight: 400; margin: 0 0 .3rem; font-size: 1.4rem; display: flex; gap: .55rem; align-items: center; }
.panel h2 .ic { color: var(--red); }
.panel > p.lead-s { margin: 0 0 1rem; color: var(--muted); }
.panel-head { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.row { display: flex; flex-wrap: wrap; gap: .7rem; align-items: end; }
.row .field { flex: 1; min-width: 150px; }
.field select, .field textarea {
  width: 100%; font: inherit; font-size: 1.02rem; padding: .75rem .9rem; border-radius: 12px; border: 2px solid var(--line); background: #fff;
}
.field textarea { min-height: 70px; resize: vertical; }
.note { background: #fff8e0; border: 1.5px solid #f1c94a; border-radius: 12px; padding: .8rem 1rem; }
.note.blue { background: #eef3ff; border-color: #b9c8f5; }
.badge { display: inline-flex; gap: .3rem; align-items: center; border-radius: 999px; padding: .15rem .65rem; font-weight: 600; font-size: .78rem; }
.badge.ok { background: #e8f7ee; color: var(--ok); }
.badge.off { background: #f3eee2; color: var(--muted); }
.badge.red { background: #fdecec; color: var(--red-dark); }
.badge.blue { background: #e9eefc; color: var(--blue-dark); }
.badge.ink { background: var(--ink); color: var(--cream); }

/* login */
.login-box { max-width: 420px; margin: 2rem auto; text-align: center; }
.login-box form { display: grid; gap: .7rem; text-align: left; margin-top: 1rem; }
.or { display: flex; align-items: center; gap: .7rem; color: var(--muted); font-size: .85rem; margin: 1rem 0 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.g-btn { width: 100%; background: #fff; border: 2px solid var(--ink); }
.g-btn svg { width: 20px; height: 20px; }

/* day calendar */
.day-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.day-bar .day-nav { display: flex; align-items: center; gap: .4rem; }
.day-bar .day-nav button { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; display: grid; place-items: center; }
.day-bar input[type=date] { font: inherit; padding: .55rem .7rem; border: 2px solid var(--ink); border-radius: 12px; background: #fff; font-weight: 600; }
.day-title { font-family: var(--f-display); font-size: 1.3rem; margin: .8rem 0 .2rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-btn { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: .4rem .9rem; font-weight: 600; }
.chip-btn[aria-pressed="true"] { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.day-stats { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 1rem; }
.stat { background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: .45rem .8rem; font-size: .88rem; }
.stat b { font-size: 1.1rem; margin-right: .2rem; }
.slots { display: grid; gap: .4rem; }
.slot {
  display: grid; grid-template-columns: 68px 1fr auto; gap: .7rem; align-items: center;
  border: 1.5px solid var(--line); border-radius: 12px; padding: .55rem .7rem; background: #fff;
}
.slot .t { font-family: var(--f-label); font-size: 1.15rem; font-weight: 600; }
.slot .info { min-width: 0; }
.slot .info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .info small { color: var(--muted); }
.slot .acts { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.slot.free .info { color: #9b9481; font-style: italic; }
.slot.booked { border-color: var(--blue); background: #f3f6ff; border-left: 6px solid var(--blue); }
.slot.booked.phone { border-left-color: #7c3aed; }
.slot.cont { border-color: #cdd8f6; background: #f8faff; border-left: 6px solid #cdd8f6; }
.slot.block { background: repeating-linear-gradient(-45deg, #fff4f4 0 8px, #fff 8px 16px); border-color: #f3b3b3; border-left: 6px solid var(--red); }
.slot.break { background: #f6f3ea; border-style: dashed; }
.slot.past { opacity: .55; }
.slot.status-noshow .info b, .slot.status-cancelled .info b { text-decoration: line-through; }
.closed-banner { text-align: center; padding: 1.5rem; border: 2px dashed var(--line); border-radius: 14px; background: var(--paper); }
.closed-banner .ic { width: 34px; height: 34px; color: var(--red); }

/* bookings table */
.scroll-x { overflow-x: auto; }
.bk-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.bk-table th { text-align: left; font-family: var(--f-label); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; color: var(--muted); padding: .5rem; border-bottom: 2px solid var(--ink); }
.bk-table td { padding: .55rem .5rem; border-bottom: 1px solid #efe6d0; vertical-align: top; }
.bk-table .day-row td { background: var(--ink); color: var(--cream); font-family: var(--f-label); letter-spacing: .05em; text-transform: uppercase; }
.bk-table tr.cancelled td, .bk-table tr.noshow td { opacity: .5; }
.bk-table tr.cancelled td:nth-child(2), .bk-table tr.noshow td:nth-child(2) { text-decoration: line-through; }
.ref-pill { font-family: var(--f-label); background: var(--paper-2); border: 1px solid var(--line); padding: .1rem .45rem; border-radius: 6px; font-weight: 600; white-space: nowrap; }
.acts-cell { display: flex; gap: .3rem; flex-wrap: wrap; }

/* staff cards */
.staff-grid { display: grid; gap: .9rem; }
@media (min-width: 820px) { .staff-grid { grid-template-columns: 1fr 1fr; } }
.staff-box { border: 2px solid var(--ink); border-radius: 16px; padding: 1rem; background: #fff; display: grid; gap: .7rem; }
.staff-box.inactive { border-style: dashed; opacity: .75; }
.staff-top { display: flex; gap: .8rem; align-items: center; }
.staff-top .avatar { width: 54px; height: 54px; font-size: 1.4rem; }
.staff-top b { font-size: 1.15rem; display: block; }
.staff-top small { color: var(--muted); }
.hours-mini { display: grid; grid-template-columns: auto 1fr; gap: .1rem .8rem; font-size: .85rem; margin: 0; }
.hours-mini dt { font-weight: 600; }
.hours-mini dd { margin: 0; color: #3b372f; }
.staff-acts { display: flex; flex-wrap: wrap; gap: .4rem; }

/* hours editor */
.sched { width: 100%; border-collapse: collapse; }
.sched td { padding: .45rem .25rem; border-bottom: 1px dashed var(--line); vertical-align: middle; }
.sched input[type=time] { font: inherit; padding: .3rem .35rem; border: 1.5px solid var(--line); border-radius: 8px; max-width: 118px; }
.sched input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--red); }
.sched .daycell label { display: flex; gap: .45rem; align-items: center; font-weight: 600; }
.sched .brk { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; font-size: .85rem; color: var(--muted); }
.sched tr.off td:not(.daycell) { opacity: .35; }
@media (max-width: 640px) {
  .sched tr { display: grid; grid-template-columns: 1fr 1fr; padding: .4rem 0; border-bottom: 1px dashed var(--line); }
  .sched td { border: 0; padding: .2rem; }
  .sched td.daycell, .sched td.brkcell { grid-column: 1 / -1; }
}

/* temp password card */
.cred-card { background: var(--ink); color: var(--cream); border-radius: 16px; padding: 1.1rem; display: grid; gap: .6rem; }
.cred-card .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; opacity: .7; }
.cred-card .val { font-family: var(--f-label); font-size: 1.35rem; letter-spacing: .05em; word-break: break-all; }
.cred-card .pw { font-size: 1.8rem; color: #fff; background: #222; border-radius: 10px; padding: .3rem .7rem; display: inline-block; }

/* modal */
dialog.adm-modal { border: 0; padding: 0; border-radius: 18px; width: min(560px, 94vw); max-height: 92vh; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
dialog.adm-modal::backdrop { background: rgba(10,10,10,.6); }
.modal-inner { display: flex; flex-direction: column; max-height: 92vh; }
.modal-inner header { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.1rem; background: var(--ink); color: var(--cream); }
.modal-inner header h3 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 1.25rem; }
.modal-inner header .icon-btn { color: var(--cream); }
.modal-inner header .icon-btn:hover { background: #333; }
#modalBody { padding: 1.1rem; overflow-y: auto; display: grid; gap: .8rem; }
.modal-acts { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: .4rem; }
.err { color: var(--red); font-weight: 600; font-size: .85rem; }

/* ---------- small screens ---------- */
.adm-main > * { min-width: 0; }
.adm-user .btn { white-space: nowrap; }
.adm-user .who b { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) {
  .panel { padding: 1rem .85rem; }
  .slot { grid-template-columns: 62px 1fr; row-gap: .45rem; }
  .slot .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .slot.free .acts, .slot.block .acts { grid-column: auto; justify-content: flex-end; }
  .slot.free { grid-template-columns: 62px auto 1fr; }
  .slot.block { grid-template-columns: 62px 1fr auto; }
  .slot .acts .btn { white-space: nowrap; }
  .slot.free .acts .btn { padding: .35rem .6rem; }
  .slot.block .info small { display: none; }
  /* bookings table becomes cards */
  .bk-table thead { display: none; }
  .bk-table, .bk-table tbody { display: block; }
  .bk-table tr { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .7rem; padding: .7rem .2rem; border-bottom: 1px solid #efe6d0; }
  .bk-table td { padding: 0; border: 0; }
  .bk-table tr.day-row { display: block; padding: 0; margin-top: .6rem; }
  .bk-table tr.day-row td { display: block; padding: .45rem .7rem; border-radius: 8px; }
  .bk-table td:nth-child(1) { grid-row: span 2; }
  .bk-table td:nth-child(3)::before { content: '👥 '; }
  .bk-table td:nth-child(3) { grid-column: 3; grid-row: 1; text-align: right; }
  .bk-table td:nth-child(4) { grid-column: 2; font-size: .85rem; color: var(--muted); }
  .bk-table td:nth-child(5) { grid-column: 2; }
  .bk-table td:nth-child(5) br, .bk-table td:nth-child(5) small { display: none; }
  .bk-table td:nth-child(6) { grid-column: 3; grid-row: 2; text-align: right; }
  .bk-table td:nth-child(7) { grid-column: 1 / -1; }
  .bk-table td:nth-child(7) .btn { width: 100%; }
}

/* ---------- day view: 3 boxes (10 min each) per half hour ---------- */
.slot3 { display: grid; grid-template-columns: 62px 84px 1fr; gap: .6rem; align-items: start; padding: .5rem .55rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.slot3.past { opacity: .55; }
.slot3 .t { font-family: var(--f-label); font-size: 1.1rem; font-weight: 600; padding-top: .3rem; }
.tri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; height: 34px; }
.tri i { border-radius: 5px; border: 1px solid #e6dcc3; background: #fff; }
.tri i.online { background: var(--blue); border-color: var(--blue); }
.tri i.phone { background: #7c3aed; border-color: #7c3aed; }
.tri i.block { background: repeating-linear-gradient(-45deg, var(--red) 0 4px, #f6b7b9 4px 8px); border-color: var(--red); }
.tri i.break { background: #efe9da; }
.tri i.out { background: repeating-linear-gradient(-45deg, #f1ede2 0 3px, #fff 3px 6px); border-style: dashed; }
.tri i.free { background: #fff; }
.evs { display: grid; gap: .35rem; min-width: 0; }
.ev { font-size: .9rem; }
.ev small { display: block; color: var(--muted); }
.ev.bk { border-left: 4px solid var(--blue); padding: .1rem 0 .1rem .55rem; display: grid; gap: .15rem; justify-items: start; }
.ev.bk.phone { border-left-color: #7c3aed; }
.ev.bk.status-cancelled b, .ev.bk.status-noshow b { text-decoration: line-through; }
.ev-top { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ev.cont { color: var(--muted); font-size: .82rem; }
.ev.wk { color: var(--red-dark); display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.free-txt { font-style: italic; font-size: .88rem; padding-top: .35rem; }
.row-acts { display: flex; gap: .35rem; flex-wrap: wrap; }
.stat.key { display: inline-flex; gap: .3rem; align-items: center; font-size: .78rem; }
.stat.key i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid #e6dcc3; display: inline-block; margin-left: .3rem; }
.stat.key i.online { background: var(--blue); } .stat.key i.phone { background: #7c3aed; }
.stat.key i.block { background: repeating-linear-gradient(-45deg, var(--red) 0 3px, #f6b7b9 3px 6px); } .stat.key i.free { background: #fff; }
@media (max-width: 600px) { .slot3 { grid-template-columns: 54px 66px 1fr; gap: .45rem; } .tri { height: 30px; } }
/* treatment chips in the add-booking window */
.svc-pick { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.svc-chip { border: 1.5px solid #cdd8f6; background: #f1f6ff; border-radius: 999px; padding: .3rem .7rem; font-size: .85rem; font-weight: 600; }
.svc-chip.extra { border-color: #f3d9a8; background: #fff6e8; }
.svc-chip small { font-weight: 500; color: var(--muted); }
.svc-chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.svc-chip[aria-pressed="true"] small { color: #ffe1e1; }
/* treatments editor */
.treat-list { display: grid; gap: .5rem; }
.treat-row { display: grid; grid-template-columns: 1.6fr 1fr .8fr auto auto; gap: .6rem; align-items: end; padding: .6rem .7rem; border: 1.5px solid #cdd8f6; border-radius: 12px; background: #f8faff; }
.treat-row.extra { border-color: #f3d9a8; background: #fffaf1; }
.treat-row .field select, .treat-row .field input { padding: .45rem .6rem; }
.treat-name b { display: block; } .treat-name small { color: var(--muted); }
.treat-on { display: flex; gap: .35rem; align-items: center; font-size: .88rem; font-weight: 600; padding-bottom: .55rem; }
.treat-on input { width: 18px; height: 18px; accent-color: var(--red); }
.boxes { display: flex; gap: 2px; flex-wrap: wrap; max-width: 90px; padding-bottom: .6rem; }
.boxes i { width: 12px; height: 16px; border-radius: 3px; background: var(--blue); }
@media (max-width: 700px) { .treat-row { grid-template-columns: 1fr 1fr; } .treat-name { grid-column: 1 / -1; } }
