/* Admin dashboard — builds on /css/style.css tokens */
.admin { background: var(--cream); min-height: 100vh; }
.btn--sm { padding: 9px 16px; font-size: 12px; }
.danger { color: var(--danger); background: #f8e8ec; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, var(--plum-900), var(--mauve-700)); }
.login__card { width: min(400px, 100%); background: #fff; border-radius: 22px; padding: 36px 30px; box-shadow: var(--shadow-lg); display: grid; gap: 14px; text-align: center; justify-items: center; }
.login__card h1 { font-size: 26px; margin: 0; }
.login__card .script { margin: 0; }
.login__card label { width: 100%; text-align: left; display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--plum-800); }
.login__card input { font: 15px var(--font-body); padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--cream); }

.topbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 24px; padding: 10px 24px; }
.topbar .brand__name { font-size: 24px; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; border-radius: 999px; font: 600 13px var(--font-body); color: var(--muted); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tabs button[aria-selected="true"] { background: var(--lilac-100); color: var(--plum-800); }
.badge { background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }

.panel-wrap { width: min(1240px, 100% - 32px); margin: 28px auto 60px; }
.panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.panel__head h2 { font-size: 28px; margin-bottom: 4px; }
.panel__head p { margin: 0; max-width: 640px; font-size: 14px; }
.subhead { margin: 36px 0 14px; font-size: 20px; }
.card-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 22px; }
.card-box h3 { font-size: 18px; }

.admin label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--plum-800); }
.admin input:not([type=checkbox]), .admin select, .admin textarea { font: 14px var(--font-body); padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--cream); color: var(--ink); width: 100%; }
.admin input:focus, .admin select:focus, .admin textarea:focus { outline: 2px solid var(--mauve-400); background: #fff; }
.admin label.chk { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.span2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 18px; }
.saved { color: var(--green); font-size: 13px; font-weight: 600; }

/* lists */
.list { display: grid; gap: 10px; }
.empty { padding: 26px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 14px; }
.appt { display: grid; grid-template-columns: 130px 1fr auto; gap: 18px; align-items: center; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--mauve-400); border-radius: 14px; padding: 14px 18px; box-shadow: var(--shadow); }
.appt--pending { border-left-color: #d9a441; }
.appt--confirmed { border-left-color: var(--green); }
.appt--done { border-left-color: var(--mauve-400); }
.appt--cancelled { border-left-color: #c9c2cc; opacity: .7; }
.appt__when strong { display: block; font-family: var(--font-head); font-size: 18px; color: var(--plum-800); }
.appt__when span { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.appt__who strong { color: var(--plum-800); }
.appt__who div { font-size: 13px; color: var(--muted); }
.appt__who a { text-decoration: none; font-weight: 600; }
.appt__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.chip--pending { background: #fbf1df; color: #8a6418; }
.chip--confirmed { background: #eaf3ee; color: #2f5a44; }
.chip--done { background: var(--lilac-100); color: var(--mauve-700); }
.chip--cancelled { background: #f1eef2; color: #8d8492; }
.list--compact .ov { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--cream); border-radius: 10px; font-size: 14px; }

/* week */
.weeknav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.weeknav h2 { font-size: 22px; margin: 0; min-width: 240px; text-align: center; }
.status-legend { display: flex; gap: 18px; font-size: 13px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.status-legend span { display: flex; align-items: center; gap: 6px; }
.st { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.st--pending { background: #d9a441; } .st--confirmed { background: var(--green); } .st--done { background: var(--mauve-400); } .st--cancelled { background: #c9c2cc; }
.week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.wday { background: #fff; border: 1px solid var(--line); border-radius: 14px; min-height: 340px; display: flex; flex-direction: column; }
.wday.is-today { border-color: var(--mauve); box-shadow: 0 0 0 2px var(--lilac-200); }
.wday--closed { background: #f7f5f8; }
.wday__head { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.wday__head strong { display: block; color: var(--plum-800); text-transform: capitalize; font-size: 14px; }
.wday__head span { font-size: 12px; color: var(--muted); }
.wday__body { padding: 8px; display: grid; gap: 6px; align-content: start; flex: 1; }
.wday__foot { padding: 8px; border-top: 1px solid var(--line); }
.wday__foot button { width: 100%; border: 0; background: var(--lilac-100); color: var(--mauve-700); border-radius: 8px; padding: 7px; font: 600 12px var(--font-body); cursor: pointer; }
.wappt { text-align: left; border: 0; border-left: 4px solid; border-radius: 8px; padding: 7px 9px; background: var(--cream); cursor: pointer; font: 12px/1.35 var(--font-body); color: var(--ink); }
.wappt b { display: block; font-size: 13px; }
.wappt--pending { border-color: #d9a441; background: #fdf6e8; }
.wappt--confirmed { border-color: var(--green); background: #eef6f1; }
.wappt--done { border-color: var(--mauve-400); background: var(--lilac-100); }
.wappt--cancelled { border-color: #c9c2cc; background: #f6f4f7; color: #9a93a0; text-decoration: line-through; }
.wblock { font-size: 11px; color: #8d8492; background: repeating-linear-gradient(45deg, #f3f0f4, #f3f0f4 6px, #fff 6px, #fff 12px); border-radius: 8px; padding: 5px 8px; }

/* hours editor */
.hours-edit { width: 100%; border-collapse: collapse; }
.hours-edit th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; }
.hours-edit td { padding: 6px 8px; border-top: 1px solid var(--line); }
.hours-edit td:first-child { font-weight: 600; color: var(--plum-800); width: 130px; }
.hours-edit input[type=time] { max-width: 130px; }
.hours-edit tr.is-closed input[type=time] { opacity: .35; }
.override-add { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.override-add label:not(.chk) { width: 150px; }

/* services editor */
.svc-edit-list { display: grid; gap: 12px; }
.svc-edit { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; grid-template-columns: 1.4fr 1.4fr 1fr 1fr auto; gap: 12px; align-items: end; box-shadow: var(--shadow); }
.svc-edit .desc { grid-column: 1 / -1; }
.svc-edit__tools { display: flex; gap: 8px; align-items: center; }
.icon-btn { border: 1px solid var(--line); background: #fff; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; color: var(--plum-800); }

/* gallery */
.upload { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; }
.upload .form__error { grid-column: 1 / -1; }
.admin-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.admin-gallery figure { margin: 0; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.admin-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.admin-gallery figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px; }

/* modal */
.modal { border: 0; padding: 0; border-radius: 20px; width: min(680px, calc(100% - 24px)); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(36, 27, 45, .5); }
.modal__box { display: flex; flex-direction: column; max-height: 90vh; }
.modal__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal__head h3 { margin: 0; font-size: 20px; }
.modal__x { border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal__body { padding: 20px 22px; overflow-y: auto; }
.modal__foot { display: flex; gap: 10px; align-items: center; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--cream); }
.spacer { flex: 1; }
.day-hours { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.day-hours label:not(.chk) { width: 120px; }
.admin-slots .slot--blocked { background: repeating-linear-gradient(45deg, #f3f0f4, #f3f0f4 6px, #fff 6px, #fff 12px); border-color: #c9c2cc; color: #8d8492; }
.admin-slots .slot--booked { background: #f6e3e7; border-color: #ecc8d0; color: #a1475b; cursor: not-allowed; }
.admin-slots .slot--past { opacity: .45; }
.lg--blocked { background: repeating-linear-gradient(45deg, #e6e1e8, #e6e1e8 3px, #fff 3px, #fff 6px); border: 1px solid #c9c2cc; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--plum-800); color: #fff; padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 100; font-size: 14px; }
.toast.is-error { background: var(--danger); }

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .tabs { order: 3; flex-basis: 100%; }
  .appt { grid-template-columns: 1fr; gap: 10px; }
  .appt__actions { justify-content: flex-start; }
  .grid3, .upload { grid-template-columns: 1fr; }
  .svc-edit { grid-template-columns: 1fr 1fr; }
  .svc-edit > label:first-child { grid-column: 1 / -1; }
  .week { grid-template-columns: repeat(7, 160px); }
}
@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; }
  .hours-edit, .hours-edit tbody, .hours-edit tr, .hours-edit td { display: block; }
  .hours-edit thead { display: none; }
  .hours-edit tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
  .hours-edit td { border: 0; padding: 2px 0; }
  .hours-edit td:first-child { grid-column: 1 / -1; width: auto; }
}
