/* ============================================================
   Kairos App CSS — desktop + mobile SPA (after tokens.css)
   ============================================================ */

/* ---------- Base reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
a { color: inherit; }
ul { padding: 0; margin: 0; list-style: none; }

/* ---------- Sidebar (desktop) ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  grid-template-rows: 60px 1fr;
  grid-template-areas: "sidebar topbar" "sidebar main";
  height: 100vh;
}
.sidebar {
  grid-area: sidebar;
  background: #0F172A;
  color: #CBD5E1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-weight: 700; font-size: 17px; letter-spacing: -0.01em; color: #fff;
}
.sidebar-brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #0EA5E9, #2563EB);
  display: grid; place-items: center; color: white; font-weight: 800; font-size: 14px;
}
.sidebar-section { padding: 16px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #64748B; font-weight: 600; }
.sidebar-nav { flex: 1; padding: 4px 8px; overflow-y: auto; }
.sidebar-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 8px;
  color: #CBD5E1; text-decoration: none;
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 120ms;
  width: 100%; background: none; border: 0; text-align: left;
  position: relative;
}
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-link.is-active { background: rgba(14, 165, 233, 0.15); color: #fff; }
.sidebar-link.is-active::before {
  content:''; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px;
  background: #0EA5E9; border-radius: 0 2px 2px 0;
}
.sidebar-link .badge { margin-left: auto; }
.sidebar-foot {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-foot .info { flex: 1; min-width: 0; }
.sidebar-foot .name { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .role { color: #94A3B8; font-size: 11px; }

/* ---------- Topbar ---------- */
.topbar {
  grid-area: topbar;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
}
.topbar-search {
  flex: 1; max-width: 480px; position: relative;
}
.topbar-search .input {
  padding-left: 38px; background: var(--text-bg); border-color: transparent;
}
.topbar-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-actions .icon-btn { position: relative; }
.topbar-actions .icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; background: #EF4444; border-radius: 50%; border: 2px solid white; }

/* ---------- Main area ---------- */
.main {
  grid-area: main;
  overflow-y: auto;
  background: var(--background);
}
.page { padding: 28px 32px; max-width: 1400px; margin: 0 auto; }
.page-narrow { max-width: 1080px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 6px; }
.page-sub { color: var(--muted); font-size: 14px; margin: 0; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 0; background: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 16px; height: 38px; border-radius: 8px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 120ms;
  font-family: inherit; line-height: 1; white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; border-radius: 7px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--text-bg); color: var(--foreground); }
.btn-secondary:hover:not(:disabled) { background: #E2E8F0; }
.btn-outline { background: transparent; color: var(--foreground); box-shadow: inset 0 0 0 1px var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--text-bg); }
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover:not(:disabled) { background: var(--text-bg); }
.btn-danger { background: #EF4444; color: white; }
.btn-danger:hover:not(:disabled) { background: #DC2626; }
.btn-success { background: var(--success); color: white; }

.icon-btn {
  appearance: none; border: 0; background: transparent;
  width: 36px; height: 36px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--foreground); cursor: pointer; transition: background 120ms;
}
.icon-btn:hover { background: var(--text-bg); }
.icon-btn-ghost { color: var(--foreground); }
.icon-btn-primary { color: var(--primary); }
.icon-btn-danger { color: #EF4444; }
.icon-btn-soft { background: var(--text-bg); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--foreground); }
.field-hint { font-size: 12px; color: var(--muted); }
.field-error { font-size: 12px; color: #EF4444; }
.input {
  appearance: none; border: 1px solid var(--border);
  height: 40px; padding: 0 12px; border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--foreground);
  background: var(--card); width: 100%;
  transition: border-color 120ms, box-shadow 120ms;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.textarea { padding: 10px 12px; height: auto; min-height: 90px; resize: vertical; line-height: 1.5; }
.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}

.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.form-row-full { grid-column: 1 / -1; }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { display: none; }
.toggle-track { width: 38px; height: 22px; border-radius: 11px; background: #CBD5E1; padding: 2px; transition: background 160ms; }
.toggle-thumb { width: 18px; height: 18px; background: white; border-radius: 50%; transition: transform 160ms; box-shadow: 0 1px 2px rgba(0,0,0,0.2); display: block; }
.toggle input:checked ~ .toggle-track { background: var(--primary); }
.toggle input:checked ~ .toggle-track .toggle-thumb { transform: translateX(16px); }
.toggle-label { font-size: 14px; font-weight: 500; }

.checkbox { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.radio { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.radio input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

/* ---------- Cards & layout primitives ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h4 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .sub { color: var(--muted); font-size: 12px; }

/* ---------- Stat tiles ---------- */
.stat-tile { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; }
.stat-head { display: flex; align-items: center; justify-content: space-between; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-icon { color: var(--primary); width: 32px; height: 32px; border-radius: 8px; background: var(--primary-soft); display: grid; place-items: center; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.stat-delta-up { color: var(--success); }
.stat-delta-down { color: #EF4444; }
.stat-delta-flat { color: var(--muted); }

/* ---------- Avatar ---------- */
.avatar {
  display: inline-grid; place-items: center;
  border-radius: 50%; color: white; font-weight: 600;
  font-family: var(--font-display);
  flex: none;
}

/* ---------- Badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600; line-height: 1;
}
.badge-soft { background: color-mix(in oklab, var(--bd, var(--primary)) 15%, transparent); color: var(--bd, var(--primary)); }
.badge-solid { background: var(--bd, var(--primary)); color: white; }
.badge-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--bd, var(--border)); color: var(--bd, var(--foreground)); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
  border: 0; background: none; padding: 10px 14px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; transition: all 120ms;
  font-family: inherit;
}
.tab:hover { color: var(--foreground); }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-count {
  background: var(--text-bg); color: var(--muted); font-size: 11px; padding: 2px 6px; border-radius: 10px; font-weight: 600;
}
.tab.is-active .tab-count { background: var(--primary-soft); color: var(--primary); }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 12px 16px; vertical-align: middle; }
.tbl thead th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; background: var(--text-bg); border-bottom: 1px solid var(--border); }
.tbl thead th:first-child { border-top-left-radius: 12px; }
.tbl thead th:last-child { border-top-right-radius: 12px; }
.tbl tbody tr { border-bottom: 1px solid var(--border); transition: background 120ms; }
.tbl tbody tr:hover { background: var(--text-bg); cursor: default; }
.tbl tbody tr:last-child { border-bottom: 0; }
.tbl-clickable tbody tr:hover { background: color-mix(in oklab, var(--primary) 4%, transparent); cursor: pointer; }
.tbl .row-name { display: flex; align-items: center; gap: 10px; }
.tbl .row-name .nm { font-weight: 600; }
.tbl .row-name .sub { font-size: 12px; color: var(--muted); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5);
  display: grid; place-items: center; z-index: 50; padding: 24px;
  animation: fadeIn 180ms ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--card); border-radius: 16px;
  width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 64px -12px rgba(0,0,0,0.25); overflow: hidden;
  animation: slideUp 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 1080px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--text-bg); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon { width: 64px; height: 64px; border-radius: 16px; background: var(--text-bg); color: var(--muted); display: grid; place-items: center; margin: 0 auto 16px; }
.empty-state h4 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.empty-state p { margin: 0 0 20px; color: var(--muted); font-size: 14px; max-width: 320px; margin-left: auto; margin-right: auto; }

/* ---------- Spinner ---------- */
.spinner { display: inline-block; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 720ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 10px; background: white; box-shadow: var(--shadow-md); border: 1px solid var(--border); min-width: 280px; max-width: 380px; animation: slideIn 220ms ease; }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid #EF4444; }
.toast-info { border-left: 3px solid var(--primary); }
.toast-title { font-size: 14px; font-weight: 600; }
.toast-body { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- Calendar (week + day grid) ---------- */
.calendar-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.calendar-nav { display: flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.cal-grid {
  display: grid; grid-template-columns: 60px repeat(var(--days, 7), 1fr);
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.cal-header-cell { padding: 12px 8px; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--text-bg); }
.cal-header-cell .num { font-size: 22px; color: var(--foreground); font-weight: 700; line-height: 1; margin-top: 2px; }
.cal-header-cell.is-today { color: var(--primary); }
.cal-header-cell.is-today .num { color: var(--primary); }
.cal-time-cell { padding: 6px 8px; font-size: 11px; color: var(--muted); text-align: right; height: 60px; border-bottom: 1px solid var(--border); position: relative; top: -7px; }
.cal-day-cell { border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); height: 60px; position: relative; }
.cal-day-cell:hover { background: color-mix(in oklab, var(--primary) 3%, transparent); cursor: pointer; }
.cal-event {
  position: absolute; left: 4px; right: 4px;
  padding: 6px 8px; border-radius: 6px;
  font-size: 12px; line-height: 1.2;
  cursor: pointer; overflow: hidden;
  border-left: 3px solid var(--ec, #0EA5E9);
  background: color-mix(in oklab, var(--ec, #0EA5E9) 12%, white);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: transform 120ms;
}
.cal-event:hover { transform: scale(1.02); z-index: 2; box-shadow: var(--shadow-md); }
.cal-event .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event .meta { color: var(--muted); font-size: 11px; }
.cal-event-status-pending { opacity: 0.85; border-left-style: dashed; }
.cal-event-status-done { opacity: 0.55; }
.cal-event-status-no_show { background: color-mix(in oklab, #EF4444 8%, white); border-left-color: #EF4444; }
.cal-event-status-canceled { text-decoration: line-through; opacity: 0.4; }

.now-line { position: absolute; left: 0; right: 0; height: 2px; background: #EF4444; z-index: 3; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; background: #EF4444; border-radius: 50%; }

/* ---------- KPI / sparklines ---------- */
.spark { width: 100%; height: 50px; }
.kpi-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
.chart-card { padding: 20px; }
.chart-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }

/* ---------- Auth screens ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside { background: linear-gradient(135deg, #0EA5E9 0%, #2563EB 50%, #1E1B4B 100%); color: white; padding: 60px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside-brand { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.auth-aside-content { max-width: 520px; }
.auth-aside-headline { font-size: 36px; font-weight: 700; line-height: 1.15; letter-spacing: -0.025em; margin-bottom: 20px; font-family: var(--font-display); }
.auth-aside-quote { padding: 24px; background: rgba(255,255,255,0.1); border-radius: 16px; backdrop-filter: blur(12px); }
.auth-form-side { display: grid; place-items: center; padding: 60px 40px; }
.auth-form { width: 100%; max-width: 380px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
@media (max-width: 900px) { .auth-page { grid-template-columns: 1fr } .auth-aside { display: none } }

/* ---------- Onboarding wizard ---------- */
.wizard { min-height: 100vh; background: var(--background); display: flex; flex-direction: column; }
.wizard-top { padding: 16px 32px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--border); background: var(--card); }
.wizard-progress { flex: 1; max-width: 600px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin: 0 auto; }
.wizard-progress > div { height: 100%; background: var(--primary); transition: width 240ms; border-radius: 2px; }
.wizard-body { flex: 1; padding: 48px 24px; overflow-y: auto; }
.wizard-card { max-width: 560px; margin: 0 auto; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 40px; box-shadow: var(--shadow-md); }
.wizard-step-eyebrow { font-size: 12px; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.wizard-step-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.wizard-step-sub { color: var(--muted); margin-bottom: 28px; font-size: 15px; }
.wizard-foot { padding: 16px 32px; border-top: 1px solid var(--border); background: var(--card); display: flex; justify-content: space-between; align-items: center; }

.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.choice-tile {
  padding: 18px; border: 2px solid var(--border); border-radius: 12px;
  cursor: pointer; transition: all 120ms; text-align: left; background: var(--card);
}
.choice-tile:hover { border-color: var(--primary-soft-strong); background: var(--primary-soft); }
.choice-tile.is-selected { border-color: var(--primary); background: var(--primary-soft); }
.choice-tile-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 10px; }
.choice-tile-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.choice-tile-sub { color: var(--muted); font-size: 13px; }

/* ---------- Booking flow (public) ---------- */
.booking { min-height: 100vh; background: linear-gradient(180deg, #F8FAFC, #F1F5F9); display: flex; flex-direction: column; }
.booking-top { background: white; border-bottom: 1px solid var(--border); padding: 16px 24px; display: flex; align-items: center; gap: 16px; }
.booking-progress { display: flex; align-items: center; gap: 6px; margin: 0 auto; }
.booking-step-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--text-bg); color: var(--muted); font-size: 12px; font-weight: 700; }
.booking-step-dot.is-active { background: var(--primary); color: white; box-shadow: 0 0 0 4px var(--primary-soft); }
.booking-step-dot.is-done { background: var(--success); color: white; }
.booking-step-line { width: 24px; height: 2px; background: var(--border); }
.booking-step-line.is-done { background: var(--success); }
.booking-body { flex: 1; padding: 32px 20px; max-width: 720px; margin: 0 auto; width: 100%; }
.booking-step-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.booking-step-sub { color: var(--muted); margin-bottom: 24px; }

/* Time grid */
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.time-pill { padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px; background: white; cursor: pointer; font-size: 14px; font-weight: 600; text-align: center; transition: all 120ms; font-family: inherit; }
.time-pill:hover { border-color: var(--primary); background: var(--primary-soft); }
.time-pill.is-selected { border-color: var(--primary); background: var(--primary); color: white; }
.time-pill:disabled { color: var(--muted); cursor: not-allowed; opacity: 0.4; }

/* Day pills (booking) */
.day-pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; }
.day-pill { flex: none; min-width: 64px; padding: 10px 8px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; background: white; text-align: center; transition: all 120ms; font-family: inherit; }
.day-pill:hover { border-color: var(--primary); }
.day-pill.is-selected { background: var(--primary); color: white; border-color: var(--primary); }
.day-pill .dow { font-size: 11px; text-transform: uppercase; opacity: 0.7; }
.day-pill .num { font-size: 18px; font-weight: 700; line-height: 1.2; }

/* Service tile (booking) */
.service-list { display: flex; flex-direction: column; gap: 10px; }
.service-tile { padding: 16px 18px; border: 1.5px solid var(--border); border-radius: 12px; background: white; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: all 120ms; }
.service-tile:hover { border-color: var(--primary); }
.service-tile.is-selected { border-color: var(--primary); background: var(--primary-soft); }
.service-tile-info { flex: 1; }
.service-tile-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.service-tile-meta { display: flex; gap: 8px; color: var(--muted); font-size: 13px; }
.service-tile-price { font-weight: 700; font-size: 16px; color: var(--foreground); }

.pro-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.pro-tile { padding: 16px; border: 1.5px solid var(--border); border-radius: 12px; background: white; cursor: pointer; text-align: center; transition: all 120ms; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pro-tile:hover { border-color: var(--primary); }
.pro-tile.is-selected { border-color: var(--primary); background: var(--primary-soft); }
.pro-tile .name { font-weight: 600; font-size: 14px; }
.pro-tile .role { color: var(--muted); font-size: 12px; }

/* ---------- Misc utilities ---------- */
.hstack { display: flex; align-items: center; gap: 12px; }
.vstack { display: flex; flex-direction: column; gap: 12px; }
.hstack-tight { display: flex; align-items: center; gap: 6px; }
.vstack-tight { display: flex; flex-direction: column; gap: 6px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.muted { color: var(--muted); }
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: 13px; }

/* ---------- Mobile app ---------- */
.mobile-shell { width: 390px; height: 844px; background: white; border-radius: 44px; box-shadow: 0 30px 80px -20px rgba(0,0,0,0.4), 0 0 0 11px #1F2937; margin: 24px auto; overflow: hidden; position: relative; display: flex; flex-direction: column; }
.mobile-status { height: 44px; padding: 16px 22px 0; display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; }
.mobile-content { flex: 1; overflow-y: auto; padding-bottom: 96px; }
.mobile-tabbar { position: absolute; bottom: 0; left: 0; right: 0; height: 84px; background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: 22px; }
.mobile-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); cursor: pointer; background: none; border: 0; font-family: inherit; font-size: 10px; font-weight: 600; }
.mobile-tab.is-active { color: var(--primary); }
.mobile-screen { padding: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 72px 1fr; }
  .sidebar-link span:not(.badge) { display: none; }
  .sidebar-brand { padding: 18px; justify-content: center; }
  .sidebar-brand span { display: none; }
  .sidebar-section { display: none; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; grid-template-areas: "topbar" "main"; }
  .sidebar { display: none; }
  .page { padding: 20px 16px; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
.m-screen { display: flex; flex-direction: column; min-height: 100%; background: var(--bg); padding-bottom: 90px; }
.m-head { background: white; padding: 50px 16px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.m-head-row { display: flex; align-items: center; gap: 10px; }
.m-tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: 78px; background: white; border-top: 1px solid var(--border); display: flex; padding: 6px 0 18px; z-index: 10; }
.m-tab { flex: 1; background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px; color: var(--muted); cursor: pointer; }
.m-tab.is-active { color: var(--primary); }
.m-tab span { font-size: 10px; font-weight: 600; }
.m-tab-fab { width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(135deg, var(--primary), #2563EB); color: white; border: none; box-shadow: 0 8px 16px -4px rgba(14,165,233,0.5); margin-top: -8px; align-self: center; cursor: pointer; }

/* Sidebar-item aliases (matches Sidebar component class names) */
.sidebar-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 9px 12px; border-radius: 8px;
  color: #CBD5E1; font-size: 14px; font-weight: 500;
  cursor: pointer; background: none; border: none;
  text-align: left; position: relative; transition: background 120ms;
}
.sidebar-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-item.is-active { background: rgba(14, 165, 233, 0.15); color: #fff; }
.sidebar-item.is-active::before {
  content:''; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px;
  background: #0EA5E9; border-radius: 0 2px 2px 0;
}
.sidebar-item-label { flex: 1; }
.sidebar-item-badge { background: #EF4444; color: white; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.sidebar-section-label { padding: 16px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #64748B; font-weight: 600; }
.sidebar-section { padding: 4px 8px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar.is-collapsed .sidebar-item-label,
.sidebar.is-collapsed .sidebar-item-badge,
.sidebar.is-collapsed .sidebar-section-label { display: none; }
