/* KL Esthetics — admin */
body.admin { background: var(--soft); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(400px, 100%); background: var(--white); border-radius: var(--radius); padding: 40px 32px; box-shadow: var(--shadow); text-align: center; }
.login-card img { width: 200px; margin: 0 auto 28px; }
.login-card form { text-align: left; }

.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--black); color: #cfc8bf; padding: 26px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side .logo { padding: 0 10px 26px; border-bottom: 1px solid #2c2925; margin-bottom: 16px; }
.side .logo img { width: 160px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav button {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; border: 0; background: none; color: inherit;
  font: 500 13px/1 var(--sans); letter-spacing: .04em; cursor: pointer; text-align: left;
}
.side nav button svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; flex: none; }
.side nav button:hover { background: #1f1c19; color: #fff; }
.side nav button.active { background: #26221e; color: var(--gold-light); box-shadow: inset 2px 0 0 var(--gold); }
.side nav .count { margin-left: auto; background: var(--gold); color: var(--black); border-radius: 999px; font-size: 10px; padding: 3px 7px; font-weight: 600; }
.side .bottom { margin-top: auto; display: grid; gap: 4px; padding-top: 16px; border-top: 1px solid #2c2925; }
.side .bottom a, .side .bottom button { color: #a39b91; font: 500 12px var(--sans); text-decoration: none; background: none; border: 0; text-align: left; padding: 8px 12px; cursor: pointer; }
.side .bottom a:hover, .side .bottom button:hover { color: #fff; }

.main { padding: 32px clamp(16px, 3vw, 40px) 80px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.topbar h1 { font-size: 2.3rem; margin: 0; }
.topbar .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mobile-top { display: none; }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 80; transform: translateX(-100%); transition: transform .25s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .4); }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 60; }
  .mobile-top img { height: 34px; }
  .main { padding-top: 20px; }
  .topbar h1 { font-size: 1.9rem; }
}

.box { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.box h2 { font-size: 1.5rem; margin-bottom: 4px; }
.box > p.muted { font-size: 13.5px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat span { font: 600 10.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stat strong { display: block; font: 500 2.3rem/1.1 var(--serif); color: var(--black); margin-top: 8px; }
.stat.gold strong { color: var(--gold); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters input, .filters select { width: auto; padding: 9px 12px; font-size: 14px; }
.filters input[type='search'] { flex: 1 1 200px; }

/* appointment list */
.appt-day { margin-bottom: 22px; }
.appt-day h3 { font: 600 11px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; display: flex; gap: 10px; align-items: center; }
.appt-day h3 .today-tag { background: var(--gold); color: var(--white); padding: 4px 8px; border-radius: 999px; letter-spacing: .1em; }
.appt {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 16px; align-items: center; background: var(--white); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px; margin-bottom: 8px; cursor: pointer; width: 100%; text-align: left; font: inherit; color: inherit;
}
.appt:hover { border-color: var(--gold); }
.appt .t { font: 500 1.2rem/1.1 var(--serif); color: var(--black); }
.appt .t small { display: block; font: 400 12px var(--sans); color: var(--muted); margin-top: 3px; }
.appt .who strong { display: block; font-weight: 600; color: var(--black); }
.appt .who span { font-size: 13px; color: var(--muted); }
.appt.cancelled, .appt.no-show { opacity: .55; }
.appt.cancelled .who strong { text-decoration: line-through; }
@media (max-width: 600px) { .appt { grid-template-columns: 72px 1fr; } .appt .badge { grid-column: 2; justify-self: start; } }

.badge { display: inline-block; padding: 5px 10px; border-radius: 999px; font: 600 10px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.badge.pending { background: #fbf1dc; color: var(--warn); }
.badge.confirmed { background: var(--gold-soft); color: var(--brown); }
.badge.completed { background: #e8f0ea; color: var(--ok); }
.badge.cancelled, .badge.no-show { background: #f1eeea; color: var(--muted); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font: 600 10.5px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: var(--soft); }
table.data input, table.data select, table.data textarea { padding: 8px 10px; font-size: 14px; }
table.data textarea { min-height: 40px; }

/* services editor */
.svc-edit { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; display: grid; grid-template-columns: 1.2fr 2fr 110px 110px; gap: 12px; align-items: end; background: var(--white); }
.svc-edit .desc { grid-column: 1 / -1; }
.svc-edit .row-actions { grid-column: 1 / -1; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.svc-edit .row-actions .spacer { flex: 1; }
.svc-edit.inactive { opacity: .6; }
.svc-edit label { margin-bottom: 6px; }
.svc-edit .field { margin: 0; }
@media (max-width: 760px) { .svc-edit { grid-template-columns: 1fr 1fr; } .svc-edit .name { grid-column: 1 / -1; } }

/* hours editor */
.hours-row { display: grid; grid-template-columns: 130px 110px 1fr; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hours-row:last-child { border: 0; }
.hours-row .times { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hours-row .times input { width: 150px; }
.hours-row.closed .times { opacity: .35; pointer-events: none; }
@media (max-width: 600px) { .hours-row { grid-template-columns: 1fr auto; } .hours-row .times { grid-column: 1 / -1; } }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; margin: 0; font: 500 13px var(--sans); text-transform: none; letter-spacing: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 38px; height: 22px; border-radius: 999px; background: #d6d0c8; position: relative; transition: background .2s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + i { background: var(--brown); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--gold-soft); }

.ov-row { display: grid; grid-template-columns: 160px 120px 1fr 1fr 1.4fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ov-row input { padding: 8px 10px; font-size: 14px; }
@media (max-width: 800px) { .ov-row { grid-template-columns: 1fr 1fr; } }

/* photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.photo { background: var(--white); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.photo img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.photo .p-body { padding: 10px; display: grid; gap: 8px; }
.photo .p-body input { padding: 8px 10px; font-size: 13px; }
.photo .p-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.photo .p-actions button { font-size: 11px; }
.photo .tags { display: flex; gap: 6px; flex-wrap: wrap; min-height: 20px; }
.dropzone { border: 1.5px dashed var(--gold); border-radius: 12px; padding: 28px; text-align: center; background: var(--white); margin-bottom: 20px; cursor: pointer; }
.dropzone.drag { background: var(--gold-soft); }

/* modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(17, 17, 17, .45); }
.modal-card { background: var(--white); border-radius: var(--radius); width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 28px; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-size: 1.8rem; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 14px; margin-bottom: 20px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--black); word-break: break-word; }
.status-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.status-bar button { border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 8px 14px; cursor: pointer; font: 600 10.5px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.status-bar button.on { background: var(--black); color: var(--white); border-color: var(--black); }
.modal .sep { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--black); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; z-index: 200; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast.error { background: var(--bad); }
.save-bar { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.inline-help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* photo slots */
.slot-img { aspect-ratio: 4/3; background: var(--soft); }
.slot-img { overflow: hidden; }
.photo .slot-img > img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; }
.slot-empty { height: 100%; display: grid; place-items: center; align-content: center; gap: 8px; border-bottom: 1px dashed var(--gold-light); }
.photo .slot-empty img { width: 52px; height: 52px; aspect-ratio: 1; opacity: .2; filter: grayscale(1); }
.slot-empty span { font: 600 10px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.slot-title { font: 600 13px/1.3 var(--sans); color: var(--black); }
.photo .p-body { padding: 14px; }
