/* ======================================================================
   Clean SaaS — white background, Inter sans-serif, one blue accent.
   Simple, predictable, easy to scan.
   ====================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg:            #ffffff;
  --surface:       #ffffff;
  --surface-2:     #f7f8fa;
  --surface-3:     #eef0f4;
  --text:          #0f172a;
  --text-2:        #334155;
  --muted:         #64748b;
  --border:        #e5e7eb;
  --border-strong: #cbd5e1;

  --primary:       #0062ff;
  --primary-700:   #0050d4;
  --primary-50:    #e6f0ff;

  --danger:        #dc2626;
  --danger-50:     #fef2f2;
  --success:       #16a34a;

  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     14px;

  --shadow-sm:     0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow:        0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg:     0 8px 24px -10px rgba(15, 23, 42, 0.18), 0 2px 6px -2px rgba(15, 23, 42, 0.08);

  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11";
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ----- Typography ---------------------------------------------------- */

h1, h2, h3, h4 {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  line-height: 1.25;
}
h1 { font-size: 32px; letter-spacing: -0.02em; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }

p { margin: 0 0 12px; color: var(--text-2); }
.muted { color: var(--muted); }
small { color: var(--muted); font-size: 13px; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.88em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-2);
}

/* ----- Topbar -------------------------------------------------------- */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
/* Topbar brand — matches the OtterFlow marketing nav: circular logo
   mark + two-tone wordmark. Colors mirror otterflow-home.css. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1F2937;
  text-decoration: none;
}
.brand__mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0 0 1px #E8E2D2, 0 1px 2px rgba(31, 41, 55, 0.05);
  overflow: hidden;
  flex: 0 0 32px;
}
.brand__mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.brand__wordmark {
  font-family: "Sora", var(--font);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.025em;
  line-height: 1;
}
.brand__wordmark .otter { color: #8B6F47; }
.brand__wordmark .flow  { color: #4FA8C5; }
.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  flex-wrap: wrap;
}
.nav a {
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  position: relative;
  padding: 6px 2px;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); }
.nav a.is-active {
  color: var(--text);
  font-weight: 600;
}
.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
}
.inline-form { display: inline; margin: 0; }
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text-2);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
}
.link-btn:hover { color: var(--text); }

/* Hamburger button (mobile only) */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  align-items: center;
  justify-content: center;
}
.nav-toggle:hover { background: var(--surface-2); }
.nav-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 180ms ease, opacity 140ms ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before {
  content: "";
  position: absolute;
  left: 0;
  top: -6px;
}
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
}
/* X animation when menu is open */
.nav.is-open ~ .nav-toggle .nav-toggle-bars,
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Mobile breakpoint — collapse nav into a dropdown */
@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .topbar { position: relative; }
  .nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 8px 24px 16px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 220ms ease, opacity 160ms ease, padding 220ms ease;
  }
  .nav.is-open {
    max-height: 80vh;
    opacity: 1;
    pointer-events: auto;
  }
  .nav a,
  .nav .link-btn {
    width: 100%;
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    text-align: left;
    font-size: 15px;
  }
  .nav a:hover,
  .nav .link-btn:hover { background: var(--surface-2); }
  .nav a.is-active {
    background: var(--surface-2);
    box-shadow: inset 3px 0 0 var(--primary);
  }
  .nav a.is-active::after { display: none; }
  .nav .inline-form { width: 100%; display: block; }
  .nav .btn-primary {
    margin-top: 8px;
    width: 100%;
    padding: 12px 16px;
  }
}

/* ----- Buttons ------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.btn:hover { background: var(--surface-2); text-decoration: none; border-color: var(--border-strong); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-700);
  border-color: var(--primary-700);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger {
  color: var(--danger);
  border-color: var(--border-strong);
  background: var(--surface);
}
.btn-danger:hover { background: var(--danger-50); border-color: var(--danger); }

/* ----- Cards --------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin: 16px 0;
}

/* ----- Hero ---------------------------------------------------------- */

.hero {
  padding: 80px 0 40px;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
.hero h1 {
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}
.hero .lead {
  color: var(--muted);
  font-size: 18px;
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.55;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ----- Flashes ------------------------------------------------------- */

.flashes {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flash {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 14px;
  color: var(--text-2);
}
.flash-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash-error { background: var(--danger-50); border-color: #fecaca; color: var(--danger); }

/* ----- Footer -------------------------------------------------------- */

.footer {
  margin-top: 80px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

/* ----- Forms --------------------------------------------------------- */

form.stack { display: flex; flex-direction: column; gap: 32px; }
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
label > span {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.01em;
}
/* Help text under inputs gets its own visual band so it doesn't run
   into the next field's bold label. The margin-bottom is on the
   <small> itself which extends the label container, adding distance
   above the next sibling label. */
label > small {
  margin-top: 2px;
  margin-bottom: 6px;
  line-height: 1.45;
  display: block;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="time"],
select, textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
input::placeholder, textarea::placeholder { color: #94a3b8; }
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 98, 255, 0.12);
}

input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  position: relative;
  padding: 0;
  vertical-align: -4px;
}
input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.form-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}

/* ----- Data tables --------------------------------------------------- */

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th, table.data td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.data th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
}
table.data tbody tr:hover { background: var(--surface-2); }

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--surface-2);
}
fieldset legend {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* ----- Breadcrumb --------------------------------------------------- */

.crumbs {
  padding: 20px 0 4px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.crumbs a {
  color: var(--muted);
  text-decoration: none;
}
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs .sep { color: var(--border-strong); }
.crumbs .current { color: var(--text); font-weight: 500; }

/* ----- Page header --------------------------------------------------- */

.page-header {
  padding: 32px 0 20px;
}
.page-header h1 { margin-bottom: 4px; }
.page-header p { color: var(--muted); margin: 0; }

/* ----- Booking page layout ------------------------------------------ */

.booking-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 24px 0;
}
@media (min-width: 900px) {
  .booking-layout { grid-template-columns: 340px 1fr; }
}

.booking-info {
  padding: 28px;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 900px) {
  .booking-info { border-bottom: 0; border-right: 1px solid var(--border); }
}
.booking-info .host {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}
.booking-info h1 {
  font-size: 24px;
  margin-bottom: 16px;
}
.booking-info .duration {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 14px;
}
.booking-info .duration::before {
  content: "⏱";
  font-size: 16px;
}
.booking-info .description {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
}
.offer-address {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.offer-address-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.offer-address-body {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}

.booking-picker { padding: 28px; }
.booking-picker h2 { font-size: 17px; margin-bottom: 16px; }

.picker-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 600px) { .picker-controls { grid-template-columns: 1fr; } }

/* ----- Dashboard booking calendar ---------------------------------- */

.dcal-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 820px) {
  .dcal-layout { grid-template-columns: minmax(320px, 420px) 1fr; }
}
.dcal-side {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
@media (min-width: 820px) {
  .dcal-side {
    border-top: 0;
    border-left: 1px solid var(--border);
    padding-top: 0;
    padding-left: 24px;
    min-height: 280px;
  }
}

/* Pending dot on dashboard calendar */
.cal-day.is-available.has-pending::after {
  background: #f59e0b;          /* amber */
  box-shadow: 0 0 0 3px #fef3c7;
}

/* Day-fragment layout */
.dcal-day-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
}
.dcal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dcal-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.dcal-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.dcal-item-link {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding: 12px 14px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.dcal-item-time {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.dcal-item-body { display: flex; flex-direction: column; gap: 2px; }
.dcal-item-title {
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
}
.dcal-item-sub {
  font-size: 13px;
  color: var(--muted);
}

/* ----- Inline calendar --------------------------------------------- */

.cal {
  user-select: none;
}
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.cal-nav {
  display: flex;
  gap: 6px;
}
.cal-nav-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.cal-nav-btn:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}
.cal-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.cal-weekdays div {
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 0;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day {
  aspect-ratio: 1 / 1;
  border: 0;
  background: transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  position: relative;
  transition: background 140ms ease, color 140ms ease;
  padding: 0;
}
.cal-day.is-blank {
  visibility: hidden;
  pointer-events: none;
}
.cal-day.is-disabled {
  color: #cbd5e1;
  cursor: not-allowed;
  text-decoration: line-through;
  text-decoration-color: #e2e8f0;
  text-decoration-thickness: 1px;
}
.cal-day.is-available {
  color: var(--primary);
  font-weight: 600;
}
.cal-day.is-available::after {
  content: "";
  position: absolute;
  bottom: 18%;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--primary);
}
.cal-day.is-available:hover {
  background: var(--primary-50);
}
.cal-day.is-selected,
.cal-day.is-selected.is-available {
  background: var(--primary);
  color: #fff;
}
.cal-day.is-selected::after { background: #fff; }
.cal-day.is-today:not(.is-selected) {
  outline: 1px solid var(--border-strong);
  outline-offset: -1px;
}

.cal-legend {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.cal-legend .item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cal-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.cal-legend .dot-available { background: var(--primary); }
.cal-legend .dot-unavailable { background: #e2e8f0; }

.cal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 240px;
  color: var(--muted);
  font-size: 14px;
}

/* ----- Calendar + slots split ------------------------------------- */

.booking-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 780px) {
  .booking-split { grid-template-columns: minmax(280px, 360px) 1fr; }
}

.slots-panel {
  border-left: 0;
  padding-left: 0;
}
@media (min-width: 780px) {
  .slots-panel {
    border-left: 1px solid var(--border);
    padding-left: 20px;
  }
}
.slots-panel-head { margin-bottom: 14px; }
.slots-panel-head h3 { margin: 0; font-size: 15px; }

/* ----- Slot grid ---------------------------------------------------- */

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}
.slot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--primary);
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}
.slot-btn:hover {
  background: var(--primary);
  color: #fff;
}
.slot-btn.is-selected {
  background: var(--primary);
  color: #fff;
}

.slots-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}
.slots-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}
.slots-empty strong { color: var(--text); display: block; font-size: 16px; margin-bottom: 4px; }

/* ----- Dashboard stat cards ---------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.stat {
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat .label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}
.stat .value {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}
.stat-sub {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-top: 6px;
}
a.stat-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
a.stat-link:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  text-decoration: none;
}
.stat-highlight {
  background: #fffbeb;
  border-color: #fde68a;
}
.stat-highlight .label { color: #92400e; }
.stat-highlight .value { color: #78350f; }
.stat-highlight .stat-sub { color: #92400e; font-weight: 600; }
a.stat-link.stat-highlight:hover { border-color: #fbbf24; }

.danger-zone {
  border-color: #fecaca;
  background: #fffaf9;
  margin-top: 24px;
}
.danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid #fecaca;
}
.danger-row:first-of-type { border-top: 0; padding-top: 0; }
.danger-row:last-of-type { padding-bottom: 0; }
.danger-row-text strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}
.danger-row-text p {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
  max-width: 520px;
}
@media (max-width: 600px) {
  .danger-row { flex-direction: column; align-items: flex-start; }
}

/* ----- Analytics ---------------------------------------------------- */

.analytics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.analytics-card .label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.analytics-card .value {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}
.analytics-card .value.analytics-small {
  font-size: 22px;
}
.analytics-card .sub {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.chart-wrap { width: 100%; }
.chart {
  width: 100%;
  height: 220px;
  display: block;
}
.chart-bar {
  fill: var(--primary);
  opacity: 0.85;
  transition: opacity 140ms ease, fill 140ms ease;
}
.chart-bar:hover {
  opacity: 1;
}
.chart-bar.is-peak {
  fill: var(--primary-700);
  opacity: 1;
}
.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

/* ----- Offer list (public tenant page) ----------------------------- */

.offer-cards {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.offer-cards li { margin: 0; }
.offer-cards a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.offer-cards a:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
  text-decoration: none;
}
.offer-cards .title { font-weight: 600; font-size: 16px; }
.offer-cards .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.offer-cards .arrow { color: var(--primary); font-weight: 600; font-size: 14px; white-space: nowrap; }

/* ----- Tenant header (public) -------------------------------------- */

.tenant-header {
  padding: 40px 0 20px;
  text-align: center;
}
.tenant-header .avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 16px;
}
.tenant-header h1 {
  font-size: 28px;
  margin-bottom: 4px;
}
.tenant-header .handle {
  color: var(--muted);
  font-size: 14px;
}

/* ----- Auth ---------------------------------------------------------- */

.auth-shell {
  max-width: 420px;
  margin: 64px auto;
}
.auth-shell .card { padding: 32px; }
.auth-shell h1 { font-size: 24px; margin-bottom: 4px; }
.auth-shell .sub { color: var(--muted); margin-bottom: 24px; }
.auth-shell .alt {
  text-align: center;
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
}

/* ----- Utility ------------------------------------------------------ */

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
}
.pill-success { background: #ecfdf5; color: #065f46; }
.pill-muted { background: var(--surface-2); color: var(--muted); }
.pill-pending { background: #fef3c7; color: #92400e; }
.pill-error { background: #fee2e2; color: #991b1b; }

/* Compact button variant for inline row actions */
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Highlight pending-approval rows in the bookings table */
.row-pending {
  background: #fffbeb;
}
.row-pending:hover { background: #fef3c7; }
.row-pending td { border-bottom-color: #fde68a; }

/* Inline search box in the tenant top nav. */
.nav-search {
  display: inline-flex;
  margin-left: 4px;
}
.nav-search input[type="search"] {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface, #fff);
  font-size: 13px;
  width: 130px;
  transition: border-color 140ms ease, width 140ms ease;
}
.nav-search input[type="search"]:focus {
  outline: none;
  border-color: #3b82f6;
  width: 200px;
}

/* Offer form toggles — big touch targets, clear description */
.offer-toggles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.offer-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.offer-toggle:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.offer-toggle input[type="checkbox"] {
  margin: 3px 0 0;
  flex: 0 0 auto;
}
.offer-toggle-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.offer-toggle-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.offer-toggle-sub {
  font-size: 13px;
  color: var(--muted);
}

/* Weekly availability editor */
.wk-grid {
  border-top: 1px solid var(--border);
}
.wk-day {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.wk-day-name {
  font-weight: 600;
  color: var(--text);
  padding-top: 10px;
}
.wk-day-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.wk-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.wk-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wk-time {
  min-width: 128px;
  padding: 8px 10px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
select.wk-time {
  /* Native select needs room for the chevron + longest label. */
  padding-right: 28px;
}
.wk-sep {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.wk-remove {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  font-family: inherit;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.wk-remove:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-50);
}
.wk-empty {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  padding: 6px 0;
}
.wk-add {
  background: transparent;
  border: 0;
  color: var(--primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
}
.wk-add:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .wk-day { grid-template-columns: 1fr; gap: 8px; }
  .wk-day-name { padding-top: 0; }
}

/* Date override form */
.override-form { display: flex; flex-direction: column; gap: 16px; }

.override-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}
.override-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
  flex: 0 0 auto;
  margin: 0;
}
.override-field > span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}
.override-field input[type="date"],
.override-field select {
  height: 38px;
  padding: 7px 10px;
  font-size: 14px;
  min-width: 160px;
}
.override-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  height: 38px;               /* baseline with inputs */
  padding: 0 4px;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.override-check input[type="checkbox"] { margin: 0; vertical-align: middle; }
.override-check > span { color: var(--text); font-weight: 500; }

.override-help {
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
}
.override-help strong { color: var(--text); font-weight: 600; }

@media (max-width: 640px) {
  .override-row { gap: 10px; }
  .override-field { min-width: 140px; flex: 1 1 calc(50% - 10px); }
  .override-check { height: auto; padding: 8px 0; width: 100%; }
}

/* Clickable URL chip on the offers list — keeps the <code> look but
   communicates "this opens in a new tab" via cursor + a small arrow. */
.offer-url-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  background: none;
  vertical-align: middle;
}
.offer-url-link code {
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.offer-url-link:hover code {
  background: var(--primary-50);
  color: var(--primary);
  border-color: #c7dafc;
}
.offer-url-arrow {
  font-size: 12px;
  color: var(--muted);
  transition: color 140ms ease, transform 140ms ease;
}
.offer-url-link:hover .offer-url-arrow {
  color: var(--primary);
  transform: translate(1px, -1px);
}

/* Copy-link button — inline compact variant that matches the primary
   button system (.btn / .btn-ghost). Sits next to <code> blocks and
   inherits the same border-strong, radius-sm, surface-2 hover language. */
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  margin-left: 10px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  vertical-align: 1px;
}
.btn-copy:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
  text-decoration: none;
}
.btn-copy:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.btn-copy:active { background: var(--surface-3); }
.btn-copy .btn-copy-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-copy.is-copied {
  background: #ecfdf5;
  color: var(--success);
  border-color: #a7f3d0;
}
.btn-copy.is-copy-failed {
  background: var(--danger-50);
  color: var(--danger);
  border-color: #fecaca;
}

/* Location / embedded map */
.location-block { margin-top: 20px; text-align: left; }
.location-block .location-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.location-block .location-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 10px;
}
.location-map {
  width: 100%;
  height: 280px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: block;
}
/* Compact variant — fits inside the narrow offer-info aside */
.location-block-compact { margin-top: 18px; }
.location-map-compact { height: 180px; }
.location-open-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
}

/* Confirmation card */
.confirm-check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ecfdf5;
  color: var(--success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
}

.meta-list {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 16px;
  font-size: 14px;
  margin: 0;
  padding: 0;
}
.meta-list dt { color: var(--muted); font-weight: 500; }
.meta-list dd { margin: 0; color: var(--text); }

/* ----- Responsive ---------------------------------------------------- */

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  h1 { font-size: 26px; }
  .hero { padding: 56px 0 32px; }
  .booking-info, .booking-picker { padding: 22px; }
  .card { padding: 18px; }
  .page-header { padding: 24px 0 14px; }

  /* Reusable 2-column form grid that stacks on mobile. The offer form
     uses grid-template-columns: 1fr 1fr inline; this catches it via
     attribute selector so we don't have to update every template. */
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* iOS zooms on focus when input font-size < 16. Bump on mobile only. */
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="date"], input[type="time"],
  select, textarea {
    font-size: 16px;
  }
  /* Compact form selects (availability time pickers) keep their look
     but pick up the 16px size from the rule above. */
  .wk-time { min-width: 0; width: 100%; }

  /* ---- Data tables stack as cards on phones ----
     Squeezing 4-5 columns into a 360px viewport produces unreadable
     text wrapping. Convert each row to a stacked block instead so
     every value gets its own line. Column headers are hidden because
     status pills, times, offer titles, and client info are already
     self-evident on their own. Action buttons (right-aligned on
     desktop) become a left-aligned row at the bottom of each card. */
  table.data { display: block; min-width: 0; border: 0; }
  table.data thead { display: none; }
  table.data tbody { display: block; }
  table.data tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 14px;
    margin: 0 0 10px;
  }
  table.data tr:last-child { margin-bottom: 0; }
  table.data tr:hover { background: var(--surface); }
  table.data td {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
    line-height: 1.45;
  }
  table.data td + td { margin-top: 4px; }
  /* Right-aligned action cells become a left-aligned button row. */
  table.data td[style*="text-align: right"],
  table.data td[style*="text-align:right"] {
    text-align: left !important;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  table.data td[style*="text-align: right"] > div,
  table.data td[style*="text-align:right"] > div {
    justify-content: flex-start !important;
  }
  /* Pending row highlight still applies. */
  table.data tr.row-pending {
    background: #fffbeb;
    border-color: #fde68a;
  }
}
