/* ===========================================================================
   Cadence — design system
   Ink & paper, accent indigo électrique, display serif Fraunces.
   =========================================================================== */

:root {
  --ink: #12131F;
  --ink-2: #3D3F52;
  --ink-3: #6E7085;
  --paper: #F6F5F1;
  --card: #FFFFFF;
  --line: #E4E2DB;
  --line-2: #D4D2C9;
  --accent: #4F46E5;
  --accent-hover: #4338CA;
  --accent-soft: #EEEDFC;
  --accent-ink: #2E2A8F;
  --green: #0E9F6E;
  --green-soft: #E3F5EE;
  --red: #DC2626;
  --red-soft: #FDECEC;
  --amber: #B45309;
  --amber-soft: #FDF3E3;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(18,19,31,.04), 0 8px 24px -12px rgba(18,19,31,.12);
  --shadow-lg: 0 2px 4px rgba(18,19,31,.05), 0 24px 48px -16px rgba(18,19,31,.18);
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}
#app { min-height: 100vh; display: flex; flex-direction: column; }

h1, h2, h3, .display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
::selection { background: var(--accent); color: #fff; }

/* --- boot --- */
.boot-spinner { min-height: 100vh; display: grid; place-items: center; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: all .15s ease; text-decoration: none !important; line-height: 1.2;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink-3); background: #fff; }
.btn-soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn-soft:hover { background: #E3E1FA; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #FBDCDC; }
.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn .spinner { width: 14px; height: 14px; border-width: 2px; border-color: rgba(255,255,255,.35); border-top-color: #fff; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent;
  color: var(--ink-3); cursor: pointer; transition: all .12s;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent-ink); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }
.icon-btn svg { width: 16px; height: 16px; }

/* --- forms --- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); outline: none; transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { resize: vertical; min-height: 80px; }
.input-group { display: flex; align-items: stretch; }
.input-group .prefix {
  display: flex; align-items: center; padding: 0 12px; background: var(--paper);
  border: 1px solid var(--line-2); border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--ink-3); font-size: 13px; white-space: nowrap;
}
.input-group .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.field .error-text { font-size: 12px; color: var(--red); margin-top: 5px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--accent); }

/* --- cards / layout --- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* --- badges --- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-gray { background: var(--paper); color: var(--ink-3); border: 1px solid var(--line); }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* --- toasts --- */
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease; display: flex; align-items: center; gap: 8px; max-width: 90vw;
}
.toast.error { background: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* --- modal --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(18,19,31,.45); z-index: 500;
  display: grid; place-items: center; padding: 20px; animation: fadeIn .15s ease;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto; padding: 26px;
  animation: modalIn .18s ease;
}
.modal h3 { font-size: 20px; margin-bottom: 6px; }
.modal .modal-sub { color: var(--ink-3); font-size: 14px; margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: scale(.97) translateY(6px); } }

/* ===========================================================================
   Landing
   =========================================================================== */
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
}
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--ink); text-decoration: none !important; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 17px; font-family: var(--font-display);
}
.topnav nav { display: flex; align-items: center; gap: 10px; }

.hero { text-align: center; padding: 84px 0 60px; position: relative; }
.hero::before {
  content: ''; position: absolute; inset: -120px -40vw 0;
  background:
    radial-gradient(600px 320px at 30% 0%, rgba(79,70,229,.10), transparent 70%),
    radial-gradient(500px 300px at 75% 10%, rgba(14,159,110,.07), transparent 70%);
  pointer-events: none;
}
.hero h1 { font-size: clamp(38px, 6vw, 64px); max-width: 760px; margin: 0 auto 20px; position: relative; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p { font-size: 18px; color: var(--ink-2); max-width: 560px; margin: 0 auto 32px; position: relative; }
.hero-cta { display: flex; gap: 12px; justify-content: center; position: relative; }
.hero-note { margin-top: 14px; font-size: 13px; color: var(--ink-3); position: relative; }

.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px; padding: 40px 0 80px;
}
.feature { padding: 26px; }
.feature .f-icon {
  width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft);
  color: var(--accent-ink); display: grid; place-items: center; margin-bottom: 15px;
}
.feature .f-icon svg { width: 20px; height: 20px; }
.feature h3 { font-size: 18px; margin-bottom: 7px; }
.feature p { font-size: 14px; color: var(--ink-3); }

.site-footer { border-top: 1px solid var(--line); padding: 26px 0; margin-top: auto; }
.site-footer .container { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-3); }

/* ===========================================================================
   Auth
   =========================================================================== */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px 20px; }
.auth-card { width: 100%; max-width: 400px; padding: 34px; }
.auth-card .logo { justify-content: center; display: flex; margin-bottom: 22px; }
.auth-card h2 { font-size: 24px; text-align: center; margin-bottom: 6px; }
.auth-card .auth-sub { text-align: center; color: var(--ink-3); font-size: 14px; margin-bottom: 24px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--ink-3); }

/* ===========================================================================
   App shell (dashboard)
   =========================================================================== */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; background: var(--ink); color: #fff;
  display: flex; flex-direction: column; padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { color: #fff; padding: 0 10px 20px; }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  color: rgba(255,255,255,.72); font-size: 14px; font-weight: 500; text-decoration: none !important;
  transition: all .12s;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.active { color: #fff; background: rgba(255,255,255,.12); }
.sidebar-foot { padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 6px 2px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent);
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.sidebar-user .u-name { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.2; }
.sidebar-user .u-link { font-size: 11.5px; color: rgba(255,255,255,.55); }

.main { flex: 1; min-width: 0; padding: 34px 40px 60px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; }
.page-head .page-sub { color: var(--ink-3); font-size: 14px; margin-top: 5px; }

/* --- event type cards --- */
.et-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.et-card { padding: 20px; position: relative; border-top: 4px solid var(--accent); transition: box-shadow .15s, transform .15s; }
.et-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.et-card .et-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.et-card h3 { font-size: 17px; font-family: var(--font-body); font-weight: 650; }
.et-card .et-meta { color: var(--ink-3); font-size: 13px; display: flex; gap: 12px; margin: 8px 0 14px; flex-wrap: wrap; }
.et-card .et-meta span { display: inline-flex; align-items: center; gap: 5px; }
.et-card .et-meta svg { width: 13px; height: 13px; }
.et-card .et-actions { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 13px; }
.et-card.inactive { opacity: .6; }

.switch { position: relative; width: 36px; height: 21px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .15s; }
.switch .track::after {
  content: ''; position: absolute; top: 2.5px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(14px); }

/* --- empty state --- */
.empty {
  text-align: center; padding: 60px 30px; border: 1.5px dashed var(--line-2);
  border-radius: var(--radius); color: var(--ink-3);
}
.empty .e-icon { font-size: 34px; margin-bottom: 12px; }
.empty h3 { font-size: 19px; color: var(--ink); margin-bottom: 6px; }
.empty p { font-size: 14px; max-width: 380px; margin: 0 auto 18px; }

/* --- bookings list --- */
.seg {
  display: inline-flex; background: #ECEBE5; border-radius: 999px; padding: 3px; gap: 2px;
}
.seg button {
  border: none; background: transparent; padding: 7px 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-3); cursor: pointer; transition: all .12s;
}
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.bk-day { margin-bottom: 26px; }
.bk-day-label { font-size: 13px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.bk-item {
  display: flex; align-items: center; gap: 18px; padding: 16px 20px; margin-bottom: 10px;
}
.bk-time { min-width: 120px; }
.bk-time .t-range { font-weight: 650; font-size: 14.5px; }
.bk-time .t-dur { font-size: 12.5px; color: var(--ink-3); }
.bk-info { flex: 1; min-width: 0; }
.bk-info .b-name { font-weight: 650; font-size: 15px; }
.bk-info .b-event { font-size: 13.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.bk-actions { display: flex; gap: 8px; align-items: center; }

/* --- availability editor --- */
.avail-grid { display: flex; flex-direction: column; }
.avail-row {
  display: flex; align-items: flex-start; gap: 18px; padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.avail-row:last-child { border-bottom: none; }
.avail-day { width: 110px; padding-top: 8px; display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; }
.avail-intervals { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.interval-row { display: flex; align-items: center; gap: 8px; }
.interval-row .input { width: 90px; text-align: center; padding: 7px 6px; }
.interval-row .sep { color: var(--ink-3); }
.avail-off { color: var(--ink-3); font-size: 14px; padding-top: 8px; }
.override-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; margin-bottom: 8px; }

/* ===========================================================================
   Public booking pages
   =========================================================================== */
.pub-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 44px 18px 60px; }
.pub-profile { text-align: center; margin-bottom: 30px; }
.pub-profile .avatar { width: 66px; height: 66px; font-size: 23px; margin: 0 auto 14px; }
.pub-profile h1 { font-size: 30px; margin-bottom: 6px; }
.pub-profile p { color: var(--ink-2); max-width: 460px; font-size: 15px; }
.pub-list { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 13px; }
.pub-et {
  display: flex; align-items: center; gap: 16px; padding: 19px 22px; cursor: pointer;
  transition: box-shadow .15s, transform .15s; border-left: 5px solid var(--accent);
  text-decoration: none !important; color: var(--ink);
}
.pub-et:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.pub-et .pe-info { flex: 1; }
.pub-et h3 { font-size: 17px; font-family: var(--font-body); font-weight: 650; margin-bottom: 2px; }
.pub-et .pe-meta { font-size: 13.5px; color: var(--ink-3); }
.pub-et .pe-arrow { color: var(--ink-3); }
.pub-foot { margin-top: 34px; font-size: 13px; color: var(--ink-3); }
.pub-foot a { color: var(--ink-3); font-weight: 600; }

/* --- booking widget --- */
.booking-card { width: 100%; max-width: 940px; display: flex; overflow: hidden; min-height: 480px; }
.booking-side {
  width: 300px; flex-shrink: 0; padding: 28px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.booking-side .bs-host { color: var(--ink-3); font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.booking-side h2 { font-size: 23px; margin-bottom: 10px; }
.booking-side .bs-meta { display: flex; flex-direction: column; gap: 9px; margin-top: 6px; color: var(--ink-2); font-size: 14px; }
.booking-side .bs-meta > div { display: flex; align-items: center; gap: 9px; }
.booking-side .bs-meta svg { width: 16px; height: 16px; color: var(--ink-3); flex-shrink: 0; }
.booking-side .bs-desc { margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.booking-side .bs-selected {
  margin-top: 16px; padding: 13px 15px; background: var(--accent-soft); border-radius: var(--radius-sm);
  color: var(--accent-ink); font-size: 14px; font-weight: 600; line-height: 1.4;
}
.booking-main { flex: 1; padding: 28px; min-width: 0; }
.booking-main h3 { font-size: 17px; font-family: var(--font-body); font-weight: 650; margin-bottom: 16px; }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head .cal-title { font-weight: 650; font-size: 15px; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .dow { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; padding: 6px 0; }
.cal-day {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%;
  font-size: 14px; font-weight: 500; color: var(--ink-3); border: none; background: transparent;
  position: relative;
}
.cal-day.avail {
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; cursor: pointer;
  transition: all .12s;
}
.cal-day.avail:hover { background: var(--accent); color: #fff; }
.cal-day.selected { background: var(--accent) !important; color: #fff !important; }
.cal-day.today::after {
  content: ''; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%;
  background: currentColor;
}

/* slots */
.slots-col { display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow-y: auto; padding-right: 4px; }
.slot-btn {
  padding: 11px; border: 1.5px solid var(--accent); background: #fff; color: var(--accent);
  border-radius: var(--radius-sm); font-weight: 650; font-size: 14px; cursor: pointer; transition: all .12s;
  text-align: center;
}
.slot-btn:hover { background: var(--accent-soft); }
.slot-confirm { display: flex; gap: 6px; }
.slot-confirm .slot-time { flex: 1; padding: 11px; background: var(--ink-2); color: #fff; border-radius: var(--radius-sm); text-align: center; font-weight: 650; font-size: 14px; border: none; }
.slot-confirm .slot-go {
  flex: 1; padding: 11px; background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); font-weight: 650; font-size: 14px; cursor: pointer;
}
.slot-confirm .slot-go:hover { background: var(--accent-hover); }

.booking-cols { display: flex; gap: 26px; }
.booking-cols .col-cal { flex: 1.4; min-width: 0; }
.booking-cols .col-slots { flex: 1; min-width: 150px; }
.col-slots .slots-day-label { font-size: 13.5px; font-weight: 650; margin-bottom: 12px; text-transform: capitalize; }

.tz-select {
  margin-top: 18px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3);
}
.tz-select svg { width: 14px; height: 14px; flex-shrink: 0; }
.tz-select select {
  border: none; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600;
  cursor: pointer; outline: none; max-width: 240px;
}

/* confirmation */
.confirm-wrap { width: 100%; max-width: 480px; text-align: center; padding: 40px 34px; }
.confirm-icon {
  width: 56px; height: 56px; border-radius: 50%; background: var(--green-soft); color: var(--green);
  display: grid; place-items: center; margin: 0 auto 18px;
}
.confirm-icon svg { width: 26px; height: 26px; }
.confirm-wrap h2 { font-size: 24px; margin-bottom: 8px; }
.confirm-wrap .c-sub { color: var(--ink-3); font-size: 14px; margin-bottom: 24px; }
.confirm-detail { text-align: left; padding: 18px 20px; background: var(--paper); border-radius: var(--radius-sm); margin-bottom: 22px; }
.confirm-detail > div { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; font-size: 14px; color: var(--ink-2); }
.confirm-detail svg { width: 16px; height: 16px; color: var(--ink-3); flex-shrink: 0; margin-top: 2px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* --- skeleton --- */
.skel { background: linear-gradient(90deg, #ECEBE5 25%, #F3F2ED 50%, #ECEBE5 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* --- settings --- */
.settings-section { padding: 24px; margin-bottom: 20px; }
.settings-section h3 { font-size: 17px; font-family: var(--font-body); font-weight: 650; margin-bottom: 4px; }
.settings-section .s-sub { color: var(--ink-3); font-size: 13.5px; margin-bottom: 18px; }
.apikey-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin-bottom: 8px; }
.apikey-item code { font-size: 13px; color: var(--ink-2); }
.key-reveal {
  background: var(--ink); color: #B9F5D8; font-family: ui-monospace, monospace; font-size: 13px;
  padding: 14px 16px; border-radius: var(--radius-sm); word-break: break-all; margin: 12px 0;
}

.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 2.5px solid transparent; transition: transform .1s; }
.swatch:hover { transform: scale(1.12); }
.swatch.selected { border-color: var(--ink); }

/* --- tabs (editor) --- */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.question-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 8px; }
.question-item .q-label { flex: 1; font-size: 14px; font-weight: 550; }

.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13.5px; font-weight: 600; margin-bottom: 14px; text-decoration: none !important; }
.back-link:hover { color: var(--ink); }

/* ===========================================================================
   Branding, snippets & embed
   =========================================================================== */
.pub-logo { max-height: 64px; max-width: 220px; object-fit: contain; margin: 0 auto 14px; display: block; }
.pub-company { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.bs-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; }
.logo-preview { display: flex; align-items: center; gap: 12px; }
.logo-preview img { max-height: 46px; max-width: 150px; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--line); padding: 4px 8px; }

.color-free {
  width: 30px; height: 30px; padding: 0; border: 2.5px dashed var(--line-2); border-radius: 50%;
  cursor: pointer; background: transparent;
}
.color-free::-webkit-color-swatch-wrapper { padding: 2px; }
.color-free::-webkit-color-swatch { border: none; border-radius: 50%; }

.snippet-block { margin-bottom: 20px; }
.snippet-code {
  margin-top: 9px; background: var(--ink); color: #D8DCF0; font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px; line-height: 1.6; padding: 14px 16px; border-radius: var(--radius-sm);
  overflow-x: auto; white-space: pre;
}

body.embed .pub-wrap { padding: 22px 14px 30px; min-height: 100vh; }
body.embed .pub-foot { margin-top: 18px; }

/* ===========================================================================
   Statistiques
   =========================================================================== */
.stat-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat-kpi { padding: 20px 22px; }
.stat-kpi .k-value { font-family: var(--font-display); font-size: 32px; font-weight: 600; line-height: 1.1; }
.stat-kpi .k-label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-top: 4px; }
.stat-kpi .k-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.stat-chart { display: flex; align-items: flex-end; gap: 2px; height: 110px; padding-top: 6px; }
.stat-chart .sc-col { flex: 1; display: flex; flex-direction: column-reverse; gap: 1px; height: 100%; min-width: 3px; }
.stat-chart .sc-bar { width: 100%; border-radius: 2px 2px 0 0; }
.stat-chart .sc-views { background: var(--accent-soft); }
.stat-chart .sc-bookings { background: var(--accent); }
.stat-chart .sc-col:hover .sc-views { background: #D9D6F6; }

.stat-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.stat-row .sr-label { width: 220px; display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; flex-shrink: 0; }
.stat-row .sr-hint { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.stat-row .sr-bar { flex: 1; height: 10px; background: var(--paper); border-radius: 999px; overflow: hidden; }
.stat-row .sr-fill { height: 100%; border-radius: 999px; min-width: 3px; }
.stat-row .sr-nums { width: 110px; text-align: right; font-size: 13px; color: var(--ink-2); font-weight: 600; flex-shrink: 0; }
.stat-row .sr-book { color: var(--green); font-weight: 600; font-size: 12px; }

.stat-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stat-host { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.stat-host:last-child { border-bottom: none; }

@media (max-width: 760px) {
  .stat-2col { grid-template-columns: 1fr; }
  .stat-row .sr-label { width: 140px; }
}

/* ===========================================================================
   Chat de prise de rendez-vous
   =========================================================================== */
.chat-wrap {
  height: 100vh; display: flex; flex-direction: column; background: var(--paper);
  max-width: 560px; margin: 0 auto; width: 100%;
}
.chat-head {
  display: flex; align-items: center; gap: 11px; padding: 14px 18px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.chat-logo { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; }
.chat-title { font-weight: 700; font-size: 14.5px; line-height: 1.2; }
.chat-sub { font-size: 12px; color: var(--ink-3); }
.chat-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); margin-left: auto; }

.chat-list { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg {
  max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word; animation: msgIn .18s ease;
}
.chat-msg.assistant { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; align-self: flex-start; }
.chat-msg.user { background: var(--accent); color: #fff; border-bottom-right-radius: 5px; align-self: flex-end; }
.chat-msg.typing { color: var(--ink-3); letter-spacing: 2px; animation: pulse 1.2s infinite; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes pulse { 50% { opacity: .45; } }

.chat-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 6px 16px 10px; }
.chat-chip {
  padding: 7px 13px; border-radius: 999px; border: 1.5px solid var(--accent);
  background: #fff; color: var(--accent-ink); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .12s;
}
.chat-chip:hover { background: var(--accent); color: #fff; }

.chat-booking {
  align-self: flex-start; display: flex; gap: 11px; align-items: flex-start;
  background: var(--green-soft); border: 1px solid #BFE8D6; border-radius: 14px;
  padding: 12px 15px; font-size: 13.5px; color: var(--ink-2); max-width: 88%;
}
.chat-booking .cb-check { width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.chat-booking .cb-check svg { width: 14px; height: 14px; }

.chat-bar {
  display: flex; gap: 9px; padding: 12px 14px; background: var(--card); border-top: 1px solid var(--line);
}
.chat-input {
  flex: 1; border: 1px solid var(--line-2); border-radius: 999px; padding: 11px 17px;
  font-size: 14px; outline: none; background: var(--paper);
}
.chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-send {
  width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--accent); color: #fff;
  cursor: pointer; display: grid; place-items: center; transition: background .12s;
}
.chat-send:hover { background: var(--accent-hover); }
.chat-send svg { width: 18px; height: 18px; }
.chat-foot { text-align: center; font-size: 11px; color: var(--ink-3); padding: 6px 0 9px; background: var(--card); }
.chat-empty { display: grid; place-items: center; height: 100vh; color: var(--ink-3); }

/* --- responsive --- */
@media (max-width: 900px) {
  .booking-card { flex-direction: column; }
  .booking-side { width: 100%; border-right: none; border-bottom: 1px solid var(--line); }
  .booking-cols { flex-direction: column; }
  .main { padding: 24px 18px 50px; }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: 10px 14px; overflow-x: auto; }
  .sidebar .logo { padding: 0 12px 0 0; }
  .sidebar nav { flex-direction: row; }
  .nav-item span { display: none; }
  .sidebar-foot { border: none; padding: 0 0 0 8px; margin-left: auto; }
  .sidebar-user .u-name, .sidebar-user .u-link { display: none; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .bk-item { flex-wrap: wrap; }
}
