/* styles.css — mirrors the Microsoft Bookings look & feel.
   Accent (header/buttons/selection) is injected at runtime from business.color. */

:root {
  --accent: #3a7bbf;
  --accent-dark: #336ca8;
  --ink: #242424;
  --muted: #6b7280;
  --line: #e6e6e6;
  --bg: #f3f3f3;
  --card: #ffffff;
  --ok: #107c41;
  --danger: #c0392b;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.05);
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---- Header --------------------------------------------------------------*/
.site-header { background: var(--accent); color: #fff; }
.site-header .inner { max-width: 760px; margin: 0 auto; padding: 26px 20px; display: flex; align-items: center; gap: 14px; justify-content: center; position: relative; }
.brand-logo { width: 44px; height: 44px; border-radius: 8px; background: rgba(255,255,255,.2); display: grid; place-items: center; font-weight: 700; overflow: hidden; flex: 0 0 auto; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.site-header h1 { font-size: 26px; margin: 0; font-weight: 600; text-align: center; }
.site-header .header-link { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: #fff; opacity: .9; font-size: 13px; text-decoration: none; }
.site-header .header-link:hover { text-decoration: underline; }
.site-header .header-links { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); display: flex; gap: 16px; }
.site-header .header-links a { color: #fff; opacity: .9; font-size: 13px; text-decoration: none; }
.site-header .header-links a:hover { opacity: 1; text-decoration: underline; }

/* ---- Layout: stacked panels ---------------------------------------------*/
.wrap { max-width: 760px; margin: 0 auto; padding: 14px 12px 70px; display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); overflow: hidden; }
.panel-title { text-align: center; font-size: 17px; font-weight: 600; padding: 16px; border-bottom: 1px solid var(--line); color: #333; }
.panel-body { padding: 8px 0; }
.panel-pad { padding: 18px 20px; }

/* ---- Service / staff list rows ------------------------------------------*/
.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: #f7f9fc; }
.list-row .row-main { flex: 1; min-width: 0; }
.list-row .row-name { font-size: 16px; }
.list-row .row-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.list-row .row-right { font-size: 13px; color: var(--muted); flex: 0 0 auto; }
.list-row .row-right.ok { color: var(--ok); }
.list-row.selected { background: var(--accent); color: #fff; outline: 2px dotted rgba(255,255,255,.85); outline-offset: -5px; }
.list-row.selected .row-sub, .list-row.selected .row-right { color: rgba(255,255,255,.9); }
.list-row.disabled { opacity: .5; cursor: not-allowed; }
.list-row.disabled:hover { background: none; }
.info-btn { width: 30px; height: 30px; border-radius: 50%; border: none; background: #8a8a8a; color: #fff; font-style: italic; font-weight: 700; cursor: pointer; flex: 0 0 auto; font-family: Georgia, serif; }
.info-btn:hover { background: #6f6f6f; }
.list-row.selected .info-btn { background: rgba(255,255,255,.3); }
.row-desc { padding: 0 20px 14px 20px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); margin-top: -2px; }

/* ---- Calendar ------------------------------------------------------------*/
.cal { max-width: 360px; margin: 0 auto; }
.cal-head { display: flex; align-items: center; gap: 14px; padding: 6px 4px 14px; }
.cal-head .arrows { display: flex; gap: 6px; }
.cal-head .month { font-weight: 600; }
.icon-btn { border: none; background: none; cursor: pointer; font-size: 20px; color: var(--ink); line-height: 1; padding: 2px 6px; border-radius: 4px; }
.icon-btn:hover:not(:disabled) { background: #eef2f7; color: var(--accent); }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { text-align: center; font-size: 13px; color: var(--muted); padding: 6px 0; }
.cal-day { aspect-ratio: 1/1; border: none; background: none; cursor: pointer; font-size: 15px; color: var(--ink); border-radius: 50%; display: grid; place-items: center; width: 40px; height: 40px; margin: 0 auto; }
.cal-day:hover:not(:disabled):not(.empty) { background: #eef2f7; }
.cal-day.empty { cursor: default; }
.cal-day:disabled { color: #c7c7c7; cursor: not-allowed; }
.cal-day.selected { background: var(--accent); color: #fff; font-weight: 600; }
.cal-day.available { font-weight: 600; }

/* ---- Time slots ----------------------------------------------------------*/
.slots-title { text-align: center; font-weight: 600; padding: 10px 0 2px; }
.slots { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 14px 20px; }
.slot { border: 1px solid var(--accent); background: #fff; color: var(--accent); border-radius: 4px; padding: 9px 22px; cursor: pointer; font-size: 15px; font-weight: 600; }
.slot:hover { background: #eef4fb; }
.slot.selected { background: var(--accent); color: #fff; }
.slots-empty { text-align: center; color: var(--muted); padding: 16px; }
.tz-note { text-align: center; color: var(--muted); font-size: 13px; padding: 12px 20px 18px; border-top: 1px solid var(--line); }
.tz-note .i { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--muted); border-radius: 50%; font-style: italic; font-family: Georgia, serif; margin-right: 6px; font-size: 12px; }

/* ---- Forms (underline style for standard fields) -------------------------*/
.uline-field { padding: 14px 20px 4px; }
.uline-field input { width: 100%; border: none; border-bottom: 1px solid #c8c8c8; padding: 8px 2px; font: inherit; background: transparent; color: var(--ink); }
.uline-field input::placeholder { color: #8a8a8a; }
.uline-field input:focus { outline: none; border-bottom: 2px solid var(--accent); }
.uline-field.invalid input { border-bottom-color: var(--danger); }
.uline-field .err { color: var(--danger); font-size: 12px; min-height: 14px; display: none; }
.uline-field.invalid .err { display: block; }
.uline-field .hint { color: var(--muted); font-size: 12px; padding-top: 3px; }
.uline-field input[type=number] { -moz-appearance: textfield; }

.boxed-field { padding: 8px 20px 14px; }
.boxed-field label { display: block; font-size: 15px; margin-bottom: 8px; }
.boxed-field input, .boxed-field textarea { width: 100%; border: 1px solid #c8c8c8; border-radius: 2px; padding: 10px; font: inherit; }
.boxed-field input:focus, .boxed-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.boxed-field textarea { min-height: 80px; resize: vertical; }

/* ---- Book button ---------------------------------------------------------*/
.book-bar { padding: 16px 20px 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: 12px 22px; border-radius: 3px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.full { width: 100%; }
.btn.secondary { background: #fff; color: var(--ink); border-color: #c8c8c8; }
.btn.secondary:hover { background: #f5f5f5; border-color: var(--accent); color: var(--accent); }
.btn.danger { background: #fff; color: var(--danger); border-color: #e6b8b3; }
.btn.danger:hover { background: #fdf3f2; }

/* ---- Confirmation --------------------------------------------------------*/
.confirm { text-align: center; padding: 30px 20px 36px; }
.confirm .tick { width: 64px; height: 64px; border-radius: 50%; background: #e7f4ec; color: var(--ok); display: grid; place-items: center; font-size: 34px; margin: 0 auto 14px; }
.confirm h2 { margin: 0 0 6px; }
.confirm .ref b { letter-spacing: .04em; }
.summary { text-align: left; max-width: 460px; margin: 18px auto 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; }
.confirm .actions { display: flex; gap: 10px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }

/* ---- Admin ---------------------------------------------------------------*/
.tabs { display: flex; gap: 2px; flex-wrap: wrap; padding: 0 12px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); }
.tab { border: none; background: none; padding: 14px 16px; cursor: pointer; font: inherit; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.data tr:hover td { background: #fafcfe; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.confirmed { background: #e7f4ec; color: var(--ok); }
.badge.cancelled { background: #fdeceb; color: var(--danger); }
.badge.booked { background: #eef4fb; color: var(--accent); }
.sched-free { color: var(--ok); font-weight: 600; }
.sched-leave { color: var(--danger); font-weight: 600; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-link { font-size: 13px; color: var(--accent); cursor: pointer; background: none; border: none; padding: 0; font: inherit; }
.pill-link.danger { color: var(--danger); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.admin-form { display: grid; gap: 14px; max-width: 560px; }
.admin-form label { display: block; font-size: 14px; font-weight: 600; }
.admin-form input, .admin-form select, .admin-form textarea { width: 100%; padding: 9px 11px; border: 1px solid #c8c8c8; border-radius: 4px; font: inherit; margin-top: 5px; }
.admin-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hours-grid { display: grid; grid-template-columns: 90px 1fr 1fr 90px; gap: 8px 14px; align-items: center; max-width: 520px; }
.hours-grid input[type=time] { padding: 7px; border: 1px solid #c8c8c8; border-radius: 4px; }
.note { background: #fff8e6; border: 1px solid #f3e2b3; color: #7a5d00; padding: 12px 14px; border-radius: 6px; font-size: 13px; }

/* ---- Toast ---------------------------------------------------------------*/
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 6px; font-size: 14px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

@media (max-width: 600px) { .admin-form .two, .hours-grid { grid-template-columns: 1fr; } .hours-grid { gap: 6px; } }
