/* BookEasy – shared styles */
:root {
  --brand: #4f46e5;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #15171c;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: color-mix(in srgb, var(--brand) 9%, white);
  --danger: #dc2626;
  --ok: #059669;
  --warn: #d97706;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
pre.code { background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 8px; overflow: auto; white-space: pre-wrap; max-height: 320px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.text-danger { color: var(--danger); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* Cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card.narrow { max-width: 760px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.empty { text-align: center; padding: 40px 20px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.two-col.wide-right { grid-template-columns: 300px 1fr; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.span2 { grid-column: span 2; }
@media (max-width: 860px) { .two-col, .two-col.wide-right { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }

/* Forms */
.form label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: 14px; }
.form label small { font-weight: 400; display: block; margin-top: 3px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=search], input:not([type]), select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px; font: inherit; font-weight: 400; color: var(--text);
  background: #fff; border: 1px solid #d1d5db; border-radius: 8px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
textarea { resize: vertical; }
input[type=color] { display: block; margin-top: 5px; width: 64px; height: 38px; padding: 2px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; }
.form label.check, label.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; cursor: pointer; margin-bottom: 12px; }
label.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 2px; margin: 0 0 14px; }
legend { font-weight: 600; font-size: .9rem; padding: 0 6px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; font: inherit; font-weight: 500; font-size: .9rem;
  color: var(--text); background: #fff; border: 1px solid #d1d5db; border-radius: 8px; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover { background: #f9fafb; border-color: #9ca3af; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, black); border-color: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-outline { color: var(--danger); border-color: #fecaca; }
.btn-danger-outline:hover { background: #fef2f2; border-color: var(--danger); }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-sm { padding: 4px 10px; font-size: .8rem; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.actions form { margin: 0; }
form.inline { display: inline; }

/* Alerts & badges */
.alert { padding: 11px 14px; border-radius: 9px; margin-bottom: 14px; border: 1px solid; font-size: .92rem; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.badge-confirmed { background: #d1fae5; color: #065f46; }
.badge-pending, .badge-awaiting_payment { background: #fef3c7; color: #92400e; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-completed { background: #e0e7ff; color: #3730a3; }
.badge-no_show { background: #f3f4f6; color: #374151; }
.error-text { color: var(--danger); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: #f9fafb; }
.card { overflow-x: auto; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); vertical-align: middle; }
dl.details { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin: 0; }
dl.details dt { color: var(--muted); font-size: .88rem; }
dl.details dd { margin: 0; }
@media (max-width: 480px) { dl.details { grid-template-columns: 1fr; gap: 2px; } dl.details dd { margin-bottom: 8px; } }

/* ---------------- Public booking page ---------------- */
.pub-header { background: #fff; border-bottom: 1px solid var(--line); }
.pub-header .wrap { display: flex; align-items: center; height: 64px; }
.pub-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.pub-logo { height: 36px; width: auto; border-radius: 6px; }
.pub-main { padding-top: 28px; padding-bottom: 40px; max-width: 820px; }
.pub-footer { color: var(--muted); font-size: .85rem; padding: 24px 0 40px; text-align: center; }
.hero { margin-bottom: 22px; }
.hero h1 { font-size: 1.9rem; margin-bottom: 6px; }
.hero p { color: var(--muted); margin: 0; max-width: 60ch; }

.step { padding: 0; overflow: visible; }
.step-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; }
.step-head h2 { margin: 0; font-size: 1.05rem; }
.step .num { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem; }
.step.done .num { background: var(--ok); }
.step.done .num::before { content: "✓"; font-size: .9rem; }
.step.done .num { font-size: 0; }
.step-value { color: var(--muted); font-size: .9rem; margin-left: auto; text-align: right; }
.step .change { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 4px; }
.step.done h2 { color: var(--muted); font-weight: 500; }
.step-body { padding: 0 20px 20px; }
@media (max-width: 560px) { .step-head { flex-wrap: wrap; } .step-value { flex-basis: 100%; text-align: left; margin-left: 40px; } }

.service-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.service-card { --svc: var(--brand); text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 16px; background: #fff; border: 1px solid var(--line);
  border-left: 4px solid var(--svc); border-radius: 10px; cursor: pointer; font: inherit; color: inherit; transition: transform .12s, box-shadow .12s, border-color .12s; }
.service-card:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16, 24, 40, .08); }
.service-card.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.svc-name { font-weight: 650; }
.svc-desc { color: var(--muted); font-size: .88rem; }
.svc-meta { font-size: .85rem; font-weight: 500; color: var(--svc); margin-top: auto; padding-top: 6px; }

.staff-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.staff-card { display: flex; align-items: center; gap: 12px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.staff-card:hover { border-color: var(--brand); background: var(--soft); }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--brand); font-weight: 700; }
.staff-txt { display: flex; flex-direction: column; }

.when-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 680px) { .when-grid { grid-template-columns: 1fr; } }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-weight: 650; }
.cal-nav { width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 1.2rem; cursor: pointer; color: var(--text); }
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font-size: .72rem; text-transform: uppercase; color: var(--muted); padding: 4px 0; letter-spacing: .03em; }
.cal-day { aspect-ratio: 1; border: 0; background: transparent; border-radius: 50%; font: inherit; font-size: .92rem; color: #c0c4cc; cursor: default; }
.cal-day.avail { color: var(--brand); background: var(--soft); font-weight: 650; cursor: pointer; }
.cal-day.avail:hover { background: color-mix(in srgb, var(--brand) 18%, white); }
.cal-day.selected { background: var(--brand) !important; color: #fff; }
.cal-loading { color: var(--muted); padding: 30px 0; text-align: center; }
.slots-title { font-weight: 650; margin-bottom: 10px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 340px; overflow-y: auto; padding: 2px; }
.slot { padding: 10px 6px; border: 1px solid color-mix(in srgb, var(--brand) 40%, white); color: var(--brand); background: #fff; border-radius: 8px; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; }
.slot:hover { background: var(--soft); }
.slot.selected { background: var(--brand); color: #fff; border-color: var(--brand); }

.success-hero { text-align: center; margin: 10px 0 24px; }
.success-hero .tick { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: #d1fae5; color: var(--ok); display: grid; place-items: center; font-size: 2rem; font-weight: 700; }
.success-hero p { color: var(--muted); }
.booking-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.booking-head h2 { margin: 0; }
.cancel-box { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.cancel-box summary { cursor: pointer; color: var(--danger); font-weight: 500; margin-bottom: 10px; }

/* ---------------- Auth pages ---------------- */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.auth-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; width: 100%; max-width: 400px; box-shadow: 0 10px 30px rgba(16, 24, 40, .08); }
.auth-box.wide { max-width: 560px; }

/* ---------------- Admin ---------------- */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { background: #111827; color: #d1d5db; display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { font-weight: 800; color: #fff; font-size: 1.15rem; padding: 4px 10px 18px; letter-spacing: -.01em; }
.side-brand::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--brand); margin-right: 8px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar a, .sidebar .linklike { color: #d1d5db; text-decoration: none; padding: 8px 10px; border-radius: 7px; font-size: .9rem; display: block; text-align: left; width: 100%; }
.sidebar a:hover, .sidebar .linklike:hover { background: #1f2937; color: #fff; }
.sidebar a.active { background: var(--brand); color: #fff; }
.side-foot { margin-top: auto; border-top: 1px solid #374151; padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.admin-main { padding: 26px 30px; min-width: 0; }
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .admin-main { padding: 18px 14px; }
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 4px; }
.stat-n { font-size: 2rem; font-weight: 750; color: var(--brand); line-height: 1.1; }
.stat-l { color: var(--muted); font-size: .88rem; }
.copy-row { display: flex; gap: 8px; flex-wrap: wrap; }
.copy-row input { flex: 1; min-width: 220px; margin: 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--brand); border-color: var(--brand); }
.tabs.flat { border: 0; margin: 0; }
.push { margin-left: auto; }
.tabs .btn.push { margin-bottom: 6px; color: #fff; border-bottom: 1px solid var(--brand); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters input, .filters select { width: auto; margin: 0; flex: 1 1 140px; }
.pager { display: flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.pager a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.pager a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.hours { width: 100%; border-collapse: collapse; }
.hours td { padding: 6px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.hours input[type=time] { display: inline-block; width: auto; margin: 0; padding: 6px 7px; }
.hours label.check { margin: 0; }
.list-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.list-nav a { padding: 7px 10px; border-radius: 7px; text-decoration: none; color: var(--text); font-size: .9rem; }
.list-nav a:hover { background: #f3f4f6; }
.list-nav a.active { background: var(--soft); color: var(--brand); font-weight: 600; }
.ph-list { display: flex; flex-wrap: wrap; gap: 5px; }
.ph { font: .75rem ui-monospace, Menlo, monospace; background: #f3f4f6; border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; cursor: pointer; }
.ph:hover { border-color: var(--brand); }
.danger-zone { margin-top: 10px; }
.cal-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-toolbar strong { min-width: 140px; text-align: center; font-size: 1.05rem; }
.cal-toolbar select { margin: 0; }
.mcal { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); min-width: 770px; }
.mcal-wd { padding: 6px; font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f9fafb; }
.mcal-cell { min-height: 104px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.mcal-cell.blank { background: #fafafa; }
.mcal-cell.today { background: var(--soft); }
.mcal-cell.off { background: repeating-linear-gradient(135deg, #fff, #fff 6px, #f6f6f6 6px, #f6f6f6 12px); }
.mcal-d { font-size: .8rem; font-weight: 600; color: var(--muted); }
.chip { --c: var(--brand); display: block; font-size: .74rem; padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--c) 14%, white); border-left: 3px solid var(--c);
  color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-pending { border-left-style: dashed; opacity: .85; }
@media (min-width: 861px) { .admin-shell { background: linear-gradient(to right, #111827 230px, var(--bg) 230px); } }

/* ---------------- Payments ---------------- */
.center { text-align: center; }
.btn-block { display: flex; width: 100%; }
.pay-card { border: 2px solid var(--brand); }
.pay-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pay-head h2 { margin: 0; }
.pay-amount { font-size: 1.6rem; font-weight: 750; }
.rzp-box p { margin: 8px 0 0; }
.or-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 18px 0; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.btn-upi { background: #0f9d58; border-color: #0f9d58; color: #fff; font-weight: 650; }
.btn-upi:hover { background: #0b8043; border-color: #0b8043; }
.upi-logo { background: #fff; color: #0f9d58; font-weight: 800; font-size: .75rem; padding: 2px 6px; border-radius: 4px; letter-spacing: .03em; }
.upi-desktop { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.upi-qr { width: 190px; height: 190px; flex: none; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }
.upi-qr svg { width: 100%; height: 100%; display: block; }
.upi-info { flex: 1; min-width: 200px; }
.upi-info code { font-size: .95rem; background: #f3f4f6; padding: 2px 6px; border-radius: 5px; }
.upi-toggle { color: var(--brand); display: block; margin: 8px auto 0; }
.upi-toggle[hidden] { display: none; }
.upi-ref-form { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
/* Device-specific UPI UI (set by booking.js; without JS both are shown) */
[data-device=desktop] .upi-mobile { display: none; }
[data-device=mobile] .upi-desktop { display: none; }
[data-device=mobile] .upi-box.show-qr .upi-desktop { display: flex; margin-top: 16px; }
.tick-wait { background: #fef3c7 !important; color: var(--warn) !important; }
.pay-note { background: var(--soft); border-radius: 8px; padding: 10px 12px; font-size: .9rem; }
.callout { background: #f9fafb; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 6px 0 12px; line-height: 1.8; }
.callout code { word-break: break-all; }
