:root {
  color-scheme: light;
  --background: #f2f2f7;
  --background-2: #e9e9ef;
  --primary: #76591f;
  --primary-hover: #614918;
  --primary-light: rgba(118, 89, 31, 0.1);
  --primary-mid: rgba(118, 89, 31, 0.2);
  --dark: #1d1d1f;
  --dark-2: #3a3a3c;
  --muted: #66666b;
  --muted-light: #8e8e93;
  --card: #ffffff;
  --card-warm: #f8f8fa;
  --border: #d4d4d9;
  --border-light: #e5e5ea;
  --danger: #b42318;
  --danger-light: #fff1f0;
  --success: #176b42;
  --success-light: #eef8f2;
  --glass: rgba(255, 255, 255, 0.78);
  --glass-solid: #fbfbfd;
  --accent-contrast: #ffffff;
  --focus-ring: rgba(118, 89, 31, 0.24);
  --page-glow: rgba(181, 139, 58, 0.09);
  --shadow-sm: 0 1px 2px rgba(18, 18, 22, 0.05);
  --shadow-md: 0 5px 14px rgba(18, 18, 22, 0.07);
  --shadow-lg: 0 12px 28px rgba(18, 18, 22, 0.1);
  --radius: 12px;
  --radius-sm: 9px;
  --radius-small: 9px;
  --radius-pill: 999px;
}

:root[data-theme="rose"] {
  --background: #f6f1f3;
  --background-2: #eee4e8;
  --primary: #8f3f57;
  --primary-hover: #743247;
  --primary-light: rgba(143, 63, 87, 0.1);
  --primary-mid: rgba(143, 63, 87, 0.2);
  --card-warm: #fcf8fa;
  --border: #dfd0d5;
  --border-light: #eee3e7;
  --focus-ring: rgba(143, 63, 87, 0.24);
  --page-glow: rgba(168, 79, 103, 0.09);
}

:root[data-theme="sage"] {
  --background: #f0f4f1;
  --background-2: #e3ebe6;
  --primary: #3f6655;
  --primary-hover: #315143;
  --primary-light: rgba(63, 102, 85, 0.1);
  --primary-mid: rgba(63, 102, 85, 0.2);
  --card-warm: #f7faf8;
  --border: #ccd9d1;
  --border-light: #e1e9e4;
  --focus-ring: rgba(63, 102, 85, 0.24);
  --page-glow: rgba(85, 116, 101, 0.09);
}

:root[data-theme="lilac"] {
  --background: #f3f1f6;
  --background-2: #e8e4ed;
  --primary: #634f78;
  --primary-hover: #4f3f61;
  --primary-light: rgba(99, 79, 120, 0.1);
  --primary-mid: rgba(99, 79, 120, 0.2);
  --card-warm: #faf8fc;
  --border: #d7d0df;
  --border-light: #e9e4ee;
  --focus-ring: rgba(99, 79, 120, 0.24);
  --page-glow: rgba(117, 98, 141, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -20%, var(--page-glow), transparent 42%),
    linear-gradient(180deg, var(--background) 0%, var(--background-2) 145%);
  color: var(--dark);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.is-loading {
  pointer-events: none;
}

.app-toast-region {
  position: fixed;
  right: 16px;
  bottom: 92px;
  z-index: 50;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.app-toast {
  border: 1px solid rgba(16, 88, 62, 0.22);
  border-radius: var(--radius);
  background: #edf8f2;
  color: #15563d;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-toast--error {
  border-color: rgba(150, 51, 51, 0.24);
  background: #fff2f0;
  color: #8a2d2d;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.inline-action-confirmation {
  display: grid;
  gap: 10px;
  width: min(100%, 360px);
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--primary-mid);
  border-radius: var(--radius-small);
  background: var(--card-warm);
}

.inline-action-confirmation p {
  margin: 0;
  color: var(--dark-2);
  font-size: 0.84rem;
  line-height: 1.45;
}

.inline-action-confirmation__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── App shell ─────────────────────────────────────── */

.app-shell {
  min-height: 100dvh;
  padding: 12px 14px 96px;
}

/* ── Topbar ─────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 10px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 980px;
  margin: 0 auto 16px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  padding: 12px 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  object-fit: contain;
  padding: 4px;
  box-shadow: none;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0;
}

h3 {
  font-weight: 700;
  letter-spacing: 0;
}

/* ── Status pill ───────────────────────────────────── */

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--muted);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
}

.status-pill.is-online {
  color: var(--success);
  border-color: rgba(26, 122, 58, 0.25);
  background: var(--success-light);
}

.status-pill.is-offline {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.25);
  background: var(--danger-light);
}

/* ── Main view ──────────────────────────────────────── */

.main-view {
  max-width: 980px;
  margin: 0 auto;
}

/* ── Connection banner ──────────────────────────────── */

.connection-banner {
  max-width: 980px;
  margin: 0 auto 18px;
  border: 1px solid rgba(180, 35, 24, 0.2);
  border-radius: var(--radius-sm);
  background: var(--danger-light);
  color: var(--danger);
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(180, 35, 24, 0.08);
}

.update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 980px;
  margin: 0 auto 18px;
  border: 1px solid var(--primary-mid);
  border-radius: var(--radius-sm);
  background: var(--card-warm);
  color: var(--dark);
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 520px) {
  .update-banner {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Premium demo refinement: quiet surfaces, sharper hierarchy, and deliberate motion. */
:root {
  --background: #f5f4f1;
  --background-2: #ebe9e4;
  --primary: #6f4f28;
  --primary-hover: #573b1d;
  --card: rgba(255, 255, 255, 0.9);
  --card-warm: #fbfaf8;
  --border: rgba(70, 57, 42, 0.14);
  --border-light: rgba(70, 57, 42, 0.1);
  --dark: #25221e;
  --dark-2: #4d4841;
  --muted: #777169;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-small: 10px;
  --shadow-sm: 0 1px 2px rgba(42, 33, 22, 0.04), 0 8px 24px rgba(42, 33, 22, 0.035);
  --shadow-md: 0 8px 24px rgba(42, 33, 22, 0.07);
}

body {
  background:
    radial-gradient(circle at 12% -10%, rgba(210, 181, 130, 0.18), transparent 33%),
    radial-gradient(circle at 88% 8%, rgba(224, 197, 184, 0.14), transparent 30%),
    linear-gradient(180deg, #f8f7f4 0%, var(--background) 45%, var(--background-2) 125%);
}

.app-shell {
  padding-top: 16px;
}

.topbar {
  max-width: 1040px;
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 1px 0 rgba(255,255,255,0.78) inset, var(--shadow-sm);
}

.brand-logo,
.auth-logo {
  border-color: rgba(111, 79, 40, 0.14);
  background: rgba(255,255,255,0.82);
}

.main-view,
.connection-banner {
  max-width: 1040px;
}

.panel,
.customer-card,
.followup-group,
.record-sale-card,
.history-item,
.session-card {
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

.panel {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

.section-heading {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-light);
}

.section-heading h2 {
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  line-height: 1.16;
}

.eyebrow {
  color: var(--primary);
  letter-spacing: 0.045em;
}

.primary-action {
  min-height: 44px;
  background: linear-gradient(135deg, #76562d, #5d3f21);
  box-shadow: 0 5px 12px rgba(80, 53, 24, 0.16);
}

.primary-action:hover:not(:disabled) {
  background: linear-gradient(135deg, #806035, #5a3c1e);
}

.secondary-action,
.icon-action,
.status-pill {
  background: rgba(255, 255, 255, 0.76);
  border-color: var(--border);
}

.grid .metric-card,
.metric-card {
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: none;
}

.customer-card,
.followup-card,
.history-item {
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.customer-card:hover,
.followup-card:hover,
.history-item:hover {
  background: rgba(255,255,255,0.96);
  border-color: rgba(111, 79, 40, 0.21);
  box-shadow: none;
  transform: translateY(-1px);
}

.bottom-nav {
  border-color: rgba(70, 57, 42, 0.1);
  background: rgba(250, 249, 247, 0.82);
}

.bottom-nav a[aria-current="page"],
.bottom-nav button[aria-current="page"] {
  color: var(--primary);
}

input,
select,
textarea,
.followup-card textarea {
  background: rgba(255,255,255,0.84);
  border-color: var(--border);
}

input:focus,
select:focus,
textarea:focus,
.followup-card textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(111, 79, 40, 0.13);
}

.demo-welcome-open .topbar {
  display: none;
}

.demo-welcome-open .app-shell {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 18px;
}

.demo-welcome {
  position: relative;
  isolation: isolate;
  width: min(100%, 960px);
  min-height: min(720px, calc(100dvh - 36px));
  display: grid;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.76);
  border-radius: 18px;
  background: #f7f2eb;
  box-shadow: 0 16px 50px rgba(63, 45, 25, 0.14);
}

.demo-welcome__visual {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,252,247,0.9) 0%, rgba(255,252,247,0.68) 46%, rgba(255,252,247,0.1) 100%), url("/brand/demo-welcome-premium.png") center / cover no-repeat;
}

.demo-welcome__content {
  width: min(100%, 460px);
  margin: clamp(28px, 8vw, 86px);
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(255,255,255,0.78);
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.72);
  box-shadow: 0 8px 28px rgba(76, 56, 34, 0.08);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.demo-welcome__logo {
  width: 64px;
  height: 64px;
  margin-bottom: 26px;
}

.demo-welcome h2 {
  max-width: 10ch;
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.demo-welcome .muted {
  max-width: 38ch;
  line-height: 1.55;
}

.demo-welcome .form-stack {
  margin-top: 26px;
}

@media (max-width: 640px) {
  .demo-welcome-open .app-shell { padding: 0; }
  .demo-welcome { min-height: 100dvh; border-radius: 0; border: 0; }
  .demo-welcome__visual { background: linear-gradient(180deg, rgba(255,252,247,0.7), rgba(255,252,247,0.92) 62%), url("/brand/demo-welcome-premium.png") center / cover no-repeat; }
  .demo-welcome__content { align-self: end; width: calc(100% - 28px); margin: 14px; padding: 26px 22px; }
  .demo-welcome h2 { max-width: 13ch; font-size: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Android-inspired web PWA layer. This is visual language only, not a native Android build. */
:root {
  --background: #fdf8ff;
  --background-2: #f3edf7;
  --card: #fffbff;
  --card-warm: #f7f2fa;
  --dark: #1d1b20;
  --dark-2: #49454f;
  --muted: #625b66;
  --muted-light: #79747e;
  --primary: #704f69;
  --primary-hover: #5a3e54;
  --primary-light: #f4dce9;
  --primary-mid: rgba(112, 79, 105, 0.2);
  --border: #cac4d0;
  --border-light: #e9e0e9;
  --success: #176b42;
  --success-light: #d9f4e3;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-small: 12px;
  --shadow-sm: 0 1px 2px rgba(29, 27, 32, 0.08);
  --shadow-md: 0 3px 8px rgba(29, 27, 32, 0.12);
}

body {
  background:
    radial-gradient(circle at 92% -15%, rgba(231, 191, 221, 0.58), transparent 34%),
    linear-gradient(180deg, #fdf8ff 0%, #f4eff7 100%);
  color: var(--dark);
  font-family: Roboto, "Segoe UI", system-ui, sans-serif;
}

.app-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 18px 106px;
}

.topbar {
  position: relative;
  top: auto;
  max-width: none;
  margin: 0 0 18px;
  padding: 10px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
  padding: 3px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.brand-lockup { gap: 10px; }
.brand-lockup .eyebrow { display: none; }
h1 { font-size: 1.28rem; font-weight: 700; }
h2 { font-weight: 700; letter-spacing: -0.02em; }
h3 { font-weight: 700; }
.eyebrow { color: var(--primary); font-size: 0.72rem; letter-spacing: 0.04em; }

.status-pill {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: #e6e1e5;
  color: var(--dark-2);
  padding: 0 12px;
  box-shadow: none;
}

.status-pill.is-online { background: #d8f4e1; color: #14532f; border: 0; }

.main-view { max-width: none; }

.screen {
  display: grid;
  gap: 20px;
  min-width: 0;
  animation: screen-enter 200ms ease-out both;
}

@keyframes screen-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.panel {
  border-radius: var(--radius);
  border-color: var(--border-light);
  background: var(--card);
  box-shadow: none;
}

.screen > .section-heading,
.screen .section-heading:first-child {
  padding: 2px 2px 16px;
  border-bottom: 0;
}

.section-heading { gap: 14px; }
.section-heading h2 { margin-bottom: 5px; font-size: clamp(1.65rem, 3vw, 2.15rem); }
.section-heading .muted { max-width: 60ch; line-height: 1.5; }

.primary-action {
  min-height: 42px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: none;
  font-weight: 700;
  padding: 0 20px;
}

.primary-action:hover:not(:disabled) { background: var(--primary-hover); box-shadow: none; }
.primary-action:active:not(:disabled), .secondary-action:active:not(:disabled), .icon-action:active:not(:disabled) { transform: scale(0.97); }

.secondary-action {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  box-shadow: none;
}

.secondary-action:hover:not(:disabled) { background: #f7edf5; box-shadow: none; }

.icon-action {
  min-width: 42px;
  min-height: 42px;
  border-radius: 999px;
  border: 0;
  background: #f0e9f0;
  color: var(--dark);
  box-shadow: none;
}

input, select, textarea, .followup-card textarea,
.form-stack input, .form-stack select, .form-stack textarea, .search-row input, .search-row select {
  min-height: 54px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fffbff;
  color: var(--dark);
  padding: 14px 15px;
  box-shadow: none;
}

textarea, .form-stack textarea, .followup-card textarea { min-height: 100px; }
.form-stack label { color: var(--dark-2); font-weight: 700; }

input:focus, select:focus, textarea:focus, .followup-card textarea:focus,
.form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus, .search-row input:focus, .search-row select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

/* Dashboard: hierarchy without wrapping every element in a white card. */
.dashboard-heading { align-items: end; }
.dashboard-briefing, .dashboard-birthdays {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: var(--radius);
  padding: 18px 20px;
  background: #efe6f0;
  color: var(--dark);
}

.dashboard-birthdays { display: block; background: #e8efff; }
.dashboard-briefing .welcome-copy, .dashboard-birthdays .welcome-copy { display: grid; gap: 3px; }
.dashboard-briefing strong, .dashboard-birthdays strong { font-size: 1rem; }

.dashboard-metrics, .revenue-grid {
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric, .grid .metric-card, .metric-card {
  min-height: 124px;
  display: flex;
  justify-content: flex-end;
  flex-direction: column;
  gap: 7px;
  border: 0;
  border-radius: var(--radius);
  background: #ebe7eb;
  box-shadow: none;
  padding: 18px;
}

.metric strong { font-size: clamp(1.45rem, 3vw, 2.1rem); line-height: 1; }
.metric span { color: var(--dark-2); font-size: 0.86rem; font-weight: 600; }
.metric-link:hover { background: #e4d9e3; box-shadow: none; transform: none; }
.dashboard-metrics .metric:nth-child(1), .revenue-grid .metric:nth-child(3) { background: #734f69; color: #fff; }
.dashboard-metrics .metric:nth-child(1) span, .revenue-grid .metric:nth-child(3) span { color: #f7eefa; }

/* List-oriented screens use rows and tonal grouping instead of a card wall. */
.customer-filter-bar, .search-row {
  padding: 12px;
  border-radius: var(--radius);
  background: #f2edf3;
}

.list-stack { gap: 8px; }
.customer-card, .record-sale-card, .transaction-history-item, .history-row {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: none;
}

.customer-card {
  padding: 16px;
  border-left: 4px solid transparent;
}

.customer-card:hover, .history-row:hover, .transaction-history-item:hover {
  background: #f7f2f8;
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.customer-card:has(.status-chip), .record-sale-card { border-left-color: #caa8c4; }
.customer-thumbnail, .profile-photo { border: 0; background: #e8dfe8; }
.customer-thumbnail-placeholder, .profile-photo-placeholder { color: var(--primary); font-size: 0.72rem; }
.card-meta { line-height: 1.45; }

.tag-row span, .status-chip, .group-title span {
  border: 0;
  border-radius: 999px;
  background: #efe6f0;
  color: var(--primary);
  font-weight: 700;
}

.status-pending { background: #ffddb6; color: #743000; }
.status-complete, .status-suggested { background: #d8f4e1; color: #14532f; }

/* Customer record: a real record header, data strip, then timeline-like history. */
.screen-profile .section-heading { padding-bottom: 4px; }
.profile-heading { align-items: center; }
.profile-photo { width: 76px; height: 76px; border-radius: 24px; }
.profile-grid { gap: 8px; }
.profile-grid .metric { min-height: 88px; padding: 14px; background: #f2edf3; }
.profile-grid .metric strong { font-size: 1rem; line-height: 1.25; }
.profile-grid .metric span { font-size: 0.76rem; }
.history-row, .transaction-history-item { position: relative; padding: 16px 16px 16px 22px; }
.history-row::before, .transaction-history-item::before { content: ""; position: absolute; left: 8px; top: 20px; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }

/* Follow-ups get stronger action and urgency, not another generic card stack. */
.followup-sections { gap: 18px; }
.followup-group { border: 0; border-radius: var(--radius); background: #fffbff; box-shadow: none; padding: 18px; }
.group-title { border-bottom-color: var(--border-light); }
.followup-card { padding: 16px 0; border-radius: 0; }
.followup-card:hover { background: transparent; box-shadow: none; transform: none; }
.followup-card__due { color: #8b2d17; }
.schedule-actions .primary-action { min-width: 100px; }

/* Material-like navigation for a browser PWA. */
.bottom-nav {
  left: 50%;
  right: auto;
  width: min(calc(100vw - 32px), 1120px);
  transform: translateX(-50%);
  min-height: 78px;
  border: 0;
  border-top: 1px solid #e4dce5;
  background: rgba(250, 245, 251, 0.96);
  box-shadow: 0 -4px 14px rgba(29,27,32,0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.bottom-nav a, .bottom-nav button {
  min-height: 76px;
  display: grid;
  place-items: center;
  padding: 8px 4px;
  color: var(--muted-light);
  font-size: 0.75rem;
  font-weight: 700;
  background: transparent;
}

.bottom-nav a > span, .bottom-nav button > span { position: relative; padding: 8px 12px; border-radius: 999px; }
.bottom-nav a[aria-current="page"], .bottom-nav button[aria-current="page"] { color: var(--dark); background: transparent; }
.bottom-nav a[aria-current="page"] > span, .bottom-nav button[aria-current="page"] > span { background: #f1dcea; color: #4a243f; }

.primary-action-sheet { background: rgba(29,27,32,0.28); }
.primary-action-sheet__panel { border-radius: 24px 24px 0 0; border: 0; background: #fffbff; box-shadow: 0 -10px 32px rgba(29,27,32,0.18); }
.sheet-option { border-radius: 12px; }

@media (min-width: 760px) {
  .app-shell { padding: 22px 32px 112px; }
  .dashboard-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .revenue-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .screen-dashboard { grid-template-columns: minmax(0, 1fr); }
  .screen-customers .customer-filter-bar { grid-template-columns: 2fr repeat(3, minmax(0, 1fr)) auto; }
}

@media (max-width: 640px) {
  .app-shell { padding: 10px 14px 94px; }
  .topbar { margin-bottom: 10px; }
  .screen { gap: 16px; }
  .screen > .section-heading { padding: 4px 2px 2px; }
  .section-heading h2 { font-size: 1.7rem; }
  .dashboard-briefing, .dashboard-birthdays { padding: 16px; }
  .metric { min-height: 112px; padding: 15px; }
  .customer-filter-bar { grid-template-columns: 1fr; }
  .bottom-nav a > span, .bottom-nav button > span { padding: 8px 7px; }
  .bottom-nav { left: 0; right: 0; width: 100%; transform: none; }
}

/* ── Panel / Card ───────────────────────────────────── */

.panel {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(18px, 4vw, 26px);
}

.auth-panel {
  max-width: 520px;
  margin: 32px auto 0;
}

.auth-logo {
  display: block;
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  object-fit: contain;
  padding: 6px;
  box-shadow: var(--shadow-sm);
}

/* ── Section heading ────────────────────────────────── */

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-bottom: 14px;
  color: var(--dark-2);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.back-link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
}

/* ── Session card ───────────────────────────────────── */

.session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--card-warm);
  padding: 14px;
  box-shadow: none;
}

.session-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

/* ── Home briefing ──────────────────────────────────── */

.home-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.home-card {
  margin-bottom: 0;
}

.home-card-reminder {
  background: var(--card);
  border-left: 3px solid var(--primary);
}

.home-action-sheet {
  display: grid;
  gap: 8px;
}

.primary-action-sheet {
  position: fixed;
  right: 14px;
  bottom: 86px;
  left: 14px;
  z-index: 20;
  max-width: 980px;
  margin: 0 auto;
}

.install-action-sheet {
  max-width: 640px;
}

.primary-action-sheet__panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  padding: 12px;
}

.primary-action-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 4px;
}

.primary-action-sheet__header strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.sheet-option {
  display: grid;
  gap: 2px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 10px 12px;
  box-shadow: none;
}

.sheet-option strong {
  color: var(--dark);
  font-size: 0.92rem;
  font-weight: 700;
}

.sheet-option span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.install-step-list {
  display: grid;
  gap: 8px;
}

.home-actions {
  margin-top: 10px;
}

/* ── Quick actions ──────────────────────────────────── */

.birthday-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.birthday-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 10px 12px;
  box-shadow: none;
}

.birthday-item strong {
  color: var(--dark);
  font-size: 0.95rem;
  font-weight: 700;
}

.birthday-item span,
.birthday-item small {
  color: var(--muted);
}

.birthday-item span {
  font-size: 0.88rem;
}

.birthday-item small {
  font-size: 0.78rem;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 18px;
}

.quick-action {
  min-height: 52px;
  text-align: center;
}

/* ── Grid / Metrics ─────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.metric {
  min-height: 98px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  border-top: 2px solid var(--primary);
  padding: 16px;
  background: var(--card-warm);
  box-shadow: none;
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.metric:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.metric-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.metric-link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.metric strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--dark);
}

.revenue-grid .metric strong {
  font-size: 1.3rem;
}

.revenue-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

/* ── Export actions ─────────────────────────────────── */

.export-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

/* ── Utility ────────────────────────────────────────── */

.muted {
  color: var(--muted);
}

.small-note {
  margin: 12px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

/* ── Buttons ────────────────────────────────────────── */

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--accent-contrast);
  padding: 0 20px;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  box-shadow: none;
  transition: transform 120ms ease, background 120ms ease;
}

.primary-action:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--primary-hover);
}

.primary-action:active:not(:disabled) {
  transform: scale(0.98);
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--dark-2);
  padding: 0 14px;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: none;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.secondary-action:hover:not(:disabled) {
  background: var(--card-warm);
  transform: translateY(-1px);
}

.secondary-action:active:not(:disabled) {
  transform: scale(0.98);
}

.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--dark-2);
  box-shadow: none;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, color 120ms ease;
}

.icon-action svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.icon-action:hover {
  background: var(--card-warm);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.icon-action:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.install-action {
  gap: 8px;
  white-space: nowrap;
}

.install-action svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: 0 0 auto;
}

.full-width {
  width: 100%;
}

/* ── Forms ──────────────────────────────────────────── */

.form-stack {
  display: grid;
  gap: 16px;
}

.form-stack label {
  display: grid;
  gap: 6px;
  color: var(--dark);
  font-size: 0.88rem;
  font-weight: 700;
}

.field-help {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.month-day-field {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.month-day-field legend {
  padding: 0;
  color: var(--dark);
  font-size: 0.88rem;
  font-weight: 700;
}

.month-day-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.month-day-grid label {
  display: grid;
  gap: 6px;
  color: var(--dark);
  font-size: 0.88rem;
  font-weight: 700;
}

.form-stack input,
.form-stack select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--dark);
  padding: 0 14px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.form-stack textarea,
.search-row input,
.search-row select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--dark);
  padding: 0 14px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.form-stack textarea {
  min-height: 104px;
  padding: 12px 14px;
  resize: vertical;
}

.form-stack input:focus,
.form-stack select:focus,
.form-stack textarea:focus,
.search-row input:focus,
.search-row select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-weight: 700;
  font-size: 0.88rem;
}

.form-success {
  color: var(--success);
  font-weight: 700;
}

/* ── Settings ───────────────────────────────────────── */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.settings-grid .inline-form {
  margin: 0;
}

.settings-appearance-panel {
  grid-column: 1 / -1;
}

.theme-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.theme-choice-grid legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--dark);
  font-size: 0.88rem;
  font-weight: 700;
}

.theme-choice {
  position: relative;
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px !important;
  min-height: 68px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 10px 12px;
  cursor: pointer;
}

.theme-choice input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
}

.theme-choice:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.theme-choice:has(input:disabled) {
  cursor: default;
  opacity: 0.68;
}

.theme-choice:has(input:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.theme-choice__swatch {
  width: 22px;
  height: 22px;
  border: 4px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: var(--theme-swatch);
  box-shadow: 0 0 0 1px var(--border);
}

.theme-choice strong,
.theme-choice small {
  display: block;
}

.theme-choice strong {
  color: var(--dark);
  font-size: 0.88rem;
}

.theme-choice small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.35;
}

.settings-export-panel {
  align-self: start;
}

/* ── Activity log ───────────────────────────────────── */

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-row {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--card-warm);
  padding: 14px 16px;
  box-shadow: none;
  transition: box-shadow 150ms ease;
}

.activity-row:hover {
  background: var(--card);
}

.activity-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.activity-action {
  margin: 8px 0 4px;
  color: var(--dark);
  font-weight: 700;
  font-size: 0.92rem;
}

.activity-details {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

/* ── Search row ─────────────────────────────────────── */

.search-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(140px, 180px)) auto;
  gap: 10px;
  margin: 16px 0;
}

/* ── Customer cards ─────────────────────────────────── */

.list-stack {
  display: grid;
  gap: 10px;
}

.customer-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 14px 16px;
  box-shadow: none;
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.customer-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.customer-card,
.followup-card,
.activity-row,
.transaction-history-item {
  content-visibility: auto;
  contain-intrinsic-size: auto 120px;
}

.customer-card-main,
.record-sale-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.customer-card h3 {
  margin-bottom: 5px;
  font-size: 0.97rem;
}

.card-actions,
.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.card-actions {
  justify-content: flex-end;
}

/* ── Tags ───────────────────────────────────────────── */

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.tag-row span {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card-warm);
  color: var(--muted);
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.card-meta {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

/* ── Compact action ─────────────────────────────────── */

.compact-action {
  min-height: 38px;
  margin-top: 0;
  padding: 0 12px;
  font-size: 0.84rem;
}

/* ── Check grid ─────────────────────────────────────── */

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-warm);
  padding: 14px;
}

.check-grid legend {
  padding: 0 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.88rem;
}

.check-grid input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

.check-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-pill {
  position: relative;
}

.check-pill-grid input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.check-pill span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--dark-2);
  padding: 0 13px;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.check-pill input:checked + span {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.check-pill input:focus-visible + span {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ── Warning / archive boxes ────────────────────────── */

.warning-box {
  margin-top: 16px;
  border: 1px solid rgba(180, 35, 24, 0.2);
  border-radius: var(--radius-sm);
  background: var(--danger-light);
  color: var(--dark);
  padding: 14px 16px;
}

.inline-form {
  margin: 16px 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--card-warm);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.inline-form h3 {
  margin-bottom: 4px;
}

.archive-note {
  margin: 12px 0 0;
  border: 1px solid var(--primary-mid);
  border-radius: var(--radius-sm);
  background: #fffbf0;
  color: var(--dark-2);
  padding: 12px 14px;
  font-size: 0.87rem;
  font-weight: 600;
}

/* ── Profile ────────────────────────────────────────── */

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.profile-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-photo-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.profile-photo-form label {
  display: grid;
  gap: 6px;
  color: var(--dark);
  font-size: 0.88rem;
  font-weight: 700;
}

.profile-photo {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-warm);
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.customer-thumbnail {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-warm);
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.customer-thumbnail-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  background: var(--primary-light);
  border: 1px solid var(--primary-mid);
}

.profile-photo-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  background: var(--primary-light);
  border: 1px solid var(--primary-mid);
}

.compact-metric {
  min-height: 84px;
}

.compact-metric strong {
  margin-top: 8px;
  font-size: 1rem;
}

.profile-tags {
  margin-bottom: 18px;
}

/* ── Transaction history ────────────────────────────── */

.history-row {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--card-warm);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 150ms ease;
}

.history-row:hover {
  box-shadow: var(--shadow-md);
}

.transaction-history-item {
  display: grid;
  gap: 8px;
}

.history-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.section-heading-tight {
  margin-top: 20px;
  align-items: center;
}

.section-heading-tight h3 {
  margin-bottom: 0;
}

/* ── Media ──────────────────────────────────────────── */

.media-fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--card-warm);
}

.media-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
}

.media-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 160px));
  gap: 10px;
  margin-top: 10px;
}

.media-thumb {
  margin: 0;
}

.media-thumb-placeholder {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--card-warm);
  font-size: 0.83rem;
  font-weight: 700;
}

.media-thumb-expired img {
  display: none;
}

.media-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  object-fit: cover;
}

.media-thumb figcaption {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.after-photo-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.after-photo-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

/* ── Follow-ups ─────────────────────────────────────── */

.followup-sections {
  display: grid;
  gap: 14px;
}

.followup-group {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-md);
  padding: 20px;
  overflow: hidden;
}

.group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 14px;
}

.group-title h3 {
  margin-bottom: 0;
  font-size: 1rem;
  font-weight: 700;
}

.group-title span {
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  background: var(--primary-light);
  border: 1px solid var(--primary-mid);
  color: var(--primary);
  padding: 4px 12px;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
}

.schedule-list {
  display: grid;
}

.followup-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px 8px;
  transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.followup-card:last-child {
  border-bottom: 0;
}

.followup-card:hover {
  background: #fffbf2;
  box-shadow: 0 6px 18px rgba(80, 58, 22, 0.06);
}

.schedule-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.followup-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.followup-card__title {
  min-width: 0;
}

.followup-card__title h4 {
  margin: 0 0 4px;
  color: var(--dark);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.followup-card__reason {
  margin: 0;
  color: var(--dark-2);
  font-size: 0.88rem;
  font-weight: 600;
}

.followup-card__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.followup-card__due {
  margin: 0;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
}

.followup-note-panel {
  display: grid;
  gap: 10px;
}

.followup-note-label {
  margin: 0;
  color: var(--dark-2);
  font-size: 0.8rem;
  font-weight: 700;
}

.followup-note-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.note-pill {
  min-height: 36px;
  border: 1px solid var(--primary-mid);
  border-radius: var(--radius-pill);
  background: var(--primary-light);
  color: var(--primary);
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.note-pill:hover {
  transform: translateY(-1px);
  background: var(--primary-light);
  border-color: var(--primary);
}

.note-pill-muted {
  background: transparent;
  color: var(--dark-2);
  border-color: var(--border);
}

.followup-note-wrap {
  display: grid;
  gap: 6px;
}

.is-hidden {
  display: none !important;
}

.schedule-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.schedule-actions .primary-action {
  min-width: 92px;
}

/* ── Status chips ───────────────────────────────────── */

.status-chip {
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
}

.status-pending {
  background: #fff4e0;
  color: #8a4800;
  border: 1px solid rgba(180, 100, 0, 0.18);
}

.status-suggested {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(26, 122, 58, 0.2);
}

.status-complete {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(26, 122, 58, 0.2);
}

.status-muted {
  background: #f2f0ec;
  color: var(--muted);
  border: 1px solid var(--border);
}

.followup-card textarea {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--dark);
  padding: 10px 14px;
  resize: vertical;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.followup-card textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-mid);
}

.empty-schedule {
  margin: 12px 0 0;
  color: var(--muted);
}

/* ── Preview switcher ───────────────────────────────── */

.preview-switcher {
  margin-bottom: 16px;
}

/* ── Bottom nav ─────────────────────────────────────── */

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(var(--nav-count, 4), minmax(0, 1fr));
  border-top: 1px solid var(--border-light);
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 -1px 8px rgba(18, 18, 22, 0.05);
}

.bottom-nav[hidden] {
  display: none;
}

.bottom-nav a {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  color: var(--muted-light);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.01em;
  transition: color 150ms ease;
}

.bottom-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  color: var(--muted-light);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.01em;
  transition: color 150ms ease;
}

.bottom-nav a > span {
  position: relative;
  z-index: 1;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background 150ms ease, color 150ms ease;
}

.bottom-nav button > span {
  position: relative;
  z-index: 1;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background 150ms ease, color 150ms ease;
}

.bottom-nav a:hover > span,
.bottom-nav button:hover > span {
  color: var(--dark-2);
  background: var(--primary-light);
}

.bottom-nav a[aria-current="page"],
.bottom-nav button[aria-current="page"] {
  color: var(--dark);
  position: relative;
}

.bottom-nav a[aria-current="page"] > span,
.bottom-nav button[aria-current="page"] > span {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}

@media (prefers-reduced-transparency: reduce) {
  .topbar,
  .bottom-nav,
  .primary-action-sheet__panel {
    background: var(--glass-solid);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ── Responsive ─────────────────────────────────────── */

@media (min-width: 760px) {
  .app-shell {
    padding: 28px 28px 104px;
  }

  h1 {
    font-size: 1.9rem;
  }

  .topbar {
    padding: 14px 20px;
  }
}

@media (max-width: 520px) {
  .theme-choice-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .profile-heading,
  .profile-photo-form,
  .session-card,
  .customer-card,
  .customer-card-main,
  .record-sale-main,
  .card-actions,
  .followup-card,
  .schedule-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .schedule-main {
    width: 100%;
  }

  .followup-card {
    grid-template-columns: 1fr;
  }

  .followup-card__top {
    flex-direction: column;
  }

  .schedule-actions {
    width: 100%;
  }

  .schedule-actions .secondary-action,
  .schedule-actions .primary-action {
    width: 100%;
    justify-content: center;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .dashboard-actions {
    width: 100%;
    align-items: stretch;
  }

  .dashboard-actions .secondary-action,
  .dashboard-actions .icon-action {
    width: 100%;
  }

  .customer-thumbnail {
    width: 64px;
    height: 64px;
  }
}

/* Final navigation geometry: the desktop rail is centred; small screens can swipe it. */
.status-pill {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-height: 36px;
  padding: 0 14px !important;
  line-height: 1;
  white-space: nowrap;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 0;
  width: min(1080px, calc(100vw - 32px));
  min-height: 76px;
  transform: translateX(-50%);
  display: flex !important;
  align-items: stretch;
  justify-content: center;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.bottom-nav::-webkit-scrollbar { display: none; }

.bottom-nav a,
.bottom-nav button {
  flex: 0 0 148px;
  min-width: 148px;
  scroll-snap-align: center;
}

@media (max-width: 720px) {
  .bottom-nav {
    left: 0;
    right: 0;
    width: 100%;
    transform: none;
    justify-content: flex-start;
    padding: 0 8px;
  }

  .bottom-nav a,
  .bottom-nav button {
    flex-basis: 116px;
    min-width: 116px;
  }
}

/* Long-form welcome copy remains calm and readable on the entry screen. */
.demo-welcome h2 {
  max-width: 19ch;
  font-size: clamp(1.85rem, 3.6vw, 2.7rem);
  line-height: 1.1;
}

.demo-welcome__story {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  color: var(--dark-2);
  font-size: 0.93rem;
  line-height: 1.58;
}

.demo-welcome__story p { margin: 0; }
.demo-welcome .form-stack { margin-top: 24px; }

@media (max-width: 640px) {
  .demo-welcome h2 { max-width: none; font-size: 1.85rem; }
  .demo-welcome__story { gap: 10px; font-size: 0.88rem; line-height: 1.5; }
}

/* Login-only composition: centred reading surface on every viewport. */
.demo-welcome-open .app-shell {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.demo-welcome {
  width: min(1120px, 100%);
  min-height: min(760px, calc(100dvh - 48px));
  display: grid;
  place-items: center;
  padding: 40px;
  background: #f8f2eb;
}

.demo-welcome__visual {
  background:
    linear-gradient(135deg, rgba(255, 252, 247, 0.5), rgba(255, 252, 247, 0.2)),
    url("/brand/demo-welcome-premium.png") center / cover no-repeat;
}

.demo-welcome__content {
  width: min(100%, 580px);
  margin: 0;
  padding: 36px 38px;
  background: rgba(255, 253, 249, 0.9);
}

.demo-welcome h2 {
  max-width: 16ch;
  margin-bottom: 16px;
  font-size: clamp(2rem, 3.3vw, 3rem);
  line-height: 1.08;
}

.demo-welcome__story {
  max-width: 56ch;
  font-size: 0.9rem;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .demo-welcome-open .app-shell { padding: 0; }
  .demo-welcome { min-height: 100dvh; padding: 72px 16px 24px; border-radius: 0; }
  .demo-welcome__content { width: 100%; padding: 26px 22px; }
  .demo-welcome h2 { max-width: 17ch; font-size: 2rem; }
}
