/* Appointment Engine design system (2026-09-15).
   One family, DM Sans, at light weights; near-black ink, quiet grays, a
   single blue accent, hairline borders, pill buttons. Used by every page
   under /appointments and by the homeowner funnel templates. Bump the ?v=
   on every <link> in the same commit as any edit here (netlify.toml caches
   /css/* for a year). */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ink: #0b0f19;
  --ink-2: #364152;
  --muted: #6b7280;
  --faint: #9aa3b2;
  --line: #e6e8ec;
  --line-2: #f0f2f5;
  --bg: #ffffff;
  --bg-2: #f6f8fa;
  --bg-3: #eef1f5;
  --accent: #1a73e8;
  --accent-2: #155fc2;
  --accent-bg: #eaf2ff;
  --accent-line: #cfe0fb;
  --ok: #15803d; --ok-bg: #ecfdf3; --ok-line: #bbf0cf;
  --warn: #a16207; --warn-bg: #fff8e6; --warn-line: #fde9b4;
  --bad: #dc2626; --bad-bg: #fef2f2; --bad-line: #fecaca;
  --info: #1d4ed8; --info-bg: #eef4ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 30px -18px rgba(16, 24, 40, .18);
  --shadow-lg: 0 24px 60px -24px rgba(16, 24, 40, .22);
  --ease: cubic-bezier(.23, 1, .32, 1);
  /* aliases for the shared shell class names */
  --text: var(--ink); --text-secondary: var(--ink-2); --text-muted: var(--muted);
  --border: var(--line); --border-light: var(--line-2); --border-dark: #d5d9e0;
  --bg-surface: var(--bg-2); --bg-card: var(--bg);
  --accent-light: var(--accent-bg); --accent-lighter: var(--accent-line); --accent-hover: var(--accent-2); --accent-glow: rgba(26, 115, 232, .14);
  --red: var(--bad); --red-light: var(--bad-bg); --yellow: var(--warn); --yellow-light: var(--warn-bg); --blue: var(--info); --blue-light: var(--info-bg);
  --radius-lg: 18px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; color: var(--ink); }
strong, b { font-weight: 500; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-weight: 400; }
img, svg { display: block; max-width: 100%; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.eyebrow { display: inline-block; font-size: 11.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

/* ─── nav ─── */
.site-nav, .appt-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.appt-nav .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.appt-nav .logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 500 !important; font-size: 15px !important; letter-spacing: -0.01em !important; }
.appt-nav .logo span { color: var(--ink); }
.appt-nav .logo .product { font-weight: 300; color: var(--muted); font-size: 14px; margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--line); }
.appt-nav .logo img { height: 44px !important; width: auto !important; border-radius: 0 !important; margin: 0 !important; }
.nav-right { display: flex; align-items: center; gap: 22px; }
.nav-link { color: var(--ink-2); font-size: 14px; font-weight: 400; text-decoration: none; }
.nav-link:hover { color: var(--ink); text-decoration: none; }
.nav-link.active { color: var(--accent); }
.nav-user-name { font-size: 13.5px; color: var(--muted); font-weight: 300; }
.nav-divider { width: 1px; height: 18px; background: var(--line); }
.nav-btn { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 14px; font-weight: 400; cursor: pointer; text-decoration: none; transition: border-color .15s, background .15s, transform 100ms var(--ease); }
.nav-btn:hover { border-color: var(--border-dark); background: var(--bg-2); text-decoration: none; }
.nav-btn:active { transform: scale(.97); }
.nav-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.nav-btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

/* ─── buttons ─── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 22px; border-radius: 999px; font-size: 14px; font-weight: 500; letter-spacing: 0; cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: background .15s, border-color .15s, color .15s, transform 100ms var(--ease), box-shadow .15s; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px -8px rgba(26, 115, 232, .55); }
.btn-primary:hover { background: var(--accent-2); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--border-dark); background: var(--bg-2); }
.btn-danger { background: #fff; color: var(--bad); border-color: var(--bad-line); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 50px; padding: 0 28px; font-size: 15px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ─── layout ─── */
.dash-layout { display: flex; min-height: calc(100vh - 64px); background: var(--bg-2); }
.dash-sidebar { width: 224px; flex-shrink: 0; border-right: 1px solid var(--line); padding: 22px 14px; background: #fff; }
.dash-sidebar-nav { list-style: none; }
.dash-sidebar-nav li { margin-bottom: 2px; }
.dash-sidebar-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 400; color: var(--ink-2); cursor: pointer; text-decoration: none; border: none; background: none; width: 100%; text-align: left; transition: background .15s, color .15s; }
.dash-sidebar-link:hover { background: var(--bg-2); color: var(--ink); text-decoration: none; }
.dash-sidebar-link.active { background: var(--accent-bg); color: var(--accent); font-weight: 500; }
.dash-main { flex: 1; padding: 30px 36px 60px; min-width: 0; }
.page-title { font-size: 24px; font-weight: 500; letter-spacing: -0.025em; margin-bottom: 22px; }

/* ─── cards and stats ─── */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; box-shadow: var(--shadow); }
.card-header { padding: 16px 22px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h2, .card-header h3 { font-size: 15px; font-weight: 500; }
.card-body { padding: 0; }
.card-body.padded { padding: 22px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat-label { font-size: 11.5px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 400; letter-spacing: -0.03em; color: var(--ink); line-height: 1.1; }
.stat-value.green { color: var(--accent); }
.stat-value.small { font-size: 18px; }
.stat-sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; font-weight: 300; }

/* ─── tables ─── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { text-align: left; padding: 10px 18px; background: var(--bg-2); font-weight: 500; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody td { padding: 12px 18px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: middle; font-weight: 300; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
tbody tr.clickable { cursor: pointer; }
.empty-state { text-align: center; padding: 44px 24px; color: var(--muted); font-weight: 300; }
.empty-state p { font-size: 14px; }

/* ─── badges and pills ─── */
.badge, .pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; border: 1px solid transparent; }
.badge-green, .pill.live { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge-blue, .pill.blue { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-line); }
.badge-gray, .pill.gray { background: var(--bg-2); color: var(--muted); border-color: var(--line); }
.badge-yellow, .pill.paused, .pill.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge-red, .pill.off { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }

/* ─── forms ─── */
.form-group { margin-bottom: 16px; }
.form-group label, .label { display: block; font-size: 13px; font-weight: 400; color: var(--ink-2); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea, .input, .filters input, .filters select {
  width: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 13px; font-size: 14px; color: var(--ink); font-weight: 400; transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus, .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input[type=color] { padding: 2px; }
.field-hint, .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; font-weight: 300; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.filters select, .filters input { width: auto; min-width: 160px; }
.filters input[type=search] { min-width: 240px; }
.banner { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn); padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; font-weight: 300; }
.banner.red { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.banner.green { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.banner.blue { background: var(--info-bg); border-color: var(--accent-line); color: var(--info); }
.banner a { color: inherit; font-weight: 500; }
.auth-error { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad-line); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; display: none; }
.auth-note { background: var(--info-bg); border: 1px solid var(--accent-line); color: var(--info); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 18px; font-weight: 300; }

/* ─── auth card ─── */
.auth-screen { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 64px); padding: 24px; background: var(--bg-2); }
.auth-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); padding: 40px; width: 100%; max-width: 440px; border: 1px solid var(--line); }
.auth-logo { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; text-align: center; margin-bottom: 6px; }
.auth-logo span { color: var(--accent); }
.auth-subtitle { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 26px; font-weight: 300; }
.auth-hint { font-size: 13px; color: var(--muted); margin-top: 16px; text-align: center; line-height: 1.6; font-weight: 300; }
.auth-hint a { font-weight: 400; }

/* ─── panel / drawer ─── */
.panel-overlay { position: fixed; inset: 0; background: rgba(11, 15, 25, .32); z-index: 950; display: none; opacity: 0; transition: opacity .2s; }
.panel-overlay.open { display: block; opacity: 1; }
.detail-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 540px; max-width: 100vw; background: #fff; z-index: 960; box-shadow: -8px 0 40px rgba(11, 15, 25, .12); transform: translateX(100%); visibility: hidden; transition: transform 300ms cubic-bezier(.32, .72, 0, 1), visibility 0s linear 300ms; overflow-y: auto; }
.detail-panel.open { transform: none; visibility: visible; transition: transform 300ms cubic-bezier(.32, .72, 0, 1), visibility 0s; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.panel-header h3 { font-size: 17px; font-weight: 500; }
.panel-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted); padding: 2px 8px; border-radius: 8px; line-height: 1; }
.panel-close:hover { background: var(--bg-2); color: var(--ink); }
.panel-body { padding: 24px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; padding-top: 3px; }
.kv dd { color: var(--ink); font-weight: 300; }

/* ─── toast, loading ─── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 12px; font-size: 14px; font-weight: 400; transform: translateY(80px); opacity: 0; transition: transform 220ms var(--ease), opacity 220ms ease; z-index: 999; box-shadow: var(--shadow-lg); }
.toast.show { transform: translateY(0); opacity: 1; }
.loading { padding: 44px 24px; text-align: center; color: var(--muted); font-size: 14px; font-weight: 300; }

/* ─── mobile ─── */
.dash-mobile-tabs { display: none; gap: 6px; overflow-x: auto; padding: 12px 16px 0; background: var(--bg-2); }
.dash-mobile-tabs button { white-space: nowrap; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 400; color: var(--ink-2); cursor: pointer; }
.dash-mobile-tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 768px) {
  .dash-sidebar { display: none; }
  .dash-mobile-tabs { display: flex; }
  .dash-main { padding: 20px 16px 48px; }
  .appt-nav .container { padding: 0 16px; height: 58px; }
  .appt-nav .logo .product { display: none; }
  .container { padding: 0 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .nav-link { display: none; }
  .nav-right { gap: 10px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .auth-card { padding: 28px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .detail-panel { transition: opacity 200ms ease, visibility 0s linear 200ms; transform: none; opacity: 0; }
  .detail-panel.open { opacity: 1; transition: opacity 200ms ease, visibility 0s; }
  .btn:active, .nav-btn:active { transform: none; }
}
