:root {
  color-scheme: light;

  /* canvas — warm cream (cabin honey/cream/forest) */
  --bg: #fbf8f1;
  --bg-grad: #fbf8f1;
  --surface: #fffdf8;
  --card: #fffdf8;
  --surface-2: #f3ece0;
  --surface-3: #ece2d2;

  /* ink + text */
  --ink: #1b1916;
  --ink-2: #3a352e;
  --muted: #8a8275;
  --muted-2: #6e675b;

  /* hairlines */
  --line: #e9e0cf;
  --line-2: #ddd1ba;

  /* dark action (FOREST) */
  --accent: #27332a;
  --accent-hover: #1a221c;

  /* signature honey */
  --gold: #c7953a;
  --gold-2: #a87d28;
  --gold-soft: #f7eccb;
  --gold-line: #e7d3a6;

  /* status — soft luxe tints, warmed */
  --leaf: #5d9a6c;
  --leaf-soft: #e7f0e6;
  --leaf-line: #d3e6d6;
  --amber: #b8862f;
  --amber-soft: #f7edd3;
  --amber-line: #ebd8a6;
  --rose: #b06a4a;
  --rose-2: #9a543b;
  --rose-soft: #f6e7df;
  --rose-line: #efd4c8;
  --blue: #5b7fb0;
  --blue-soft: #e7edf6;

  /* sidebar — deep forest (names kept; values are green) */
  --navy: #20322a;
  --navy-2: #16241d;
  --navy-item: #2a3d33;
  --navy-line: #34473b;
  --navy-text: #c6c7ce;
  --navy-muted: #8a8d97;

  /* depth (warm, soft, never harsh) */
  --shadow-soft: 0 2px 6px rgba(40, 30, 10, 0.04), 0 18px 38px -24px rgba(40, 30, 10, 0.24);
  --shadow-lift: 0 4px 10px rgba(40, 30, 10, 0.06), 0 28px 56px -28px rgba(40, 30, 10, 0.32);
  --shadow-gold: 0 14px 28px -12px rgba(199, 149, 58, 0.55);

  --radius-lg: 24px;
  --radius: 20px;
  --radius-sm: 13px;
  --sidebar: 268px;

  font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

/* display headings — Cormorant Garamond (cabin design system) */
#viewTitle,
.brand-title,
.greet-title,
.hero-head,
.agent-greeting,
.metric-value,
.panel h1,
.panel h2,
.onboarding-card h2,
.modal-head h1,
.modal-head h2 {
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg-grad) fixed;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.004em;
}

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

/* ===== login gate ===== */
.auth-locked .app-shell {
  display: none;
}

.login-gate {
  display: none;
}

.auth-locked .login-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--bg-grad) fixed;
}

.login-card {
  display: grid;
  gap: 12px;
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lift);
}

.login-brand {
  padding: 0;
  margin-bottom: 8px;
}

.field-label {
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 700;
}

.login-card input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
}

.login-card input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: transparent;
  background: #fff;
  box-shadow: none;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--rose-2);
  font-size: 0.82rem;
}

.login-button {
  width: 100%;
  justify-content: center;
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

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

button {
  cursor: pointer;
  color: inherit;
}

/* ===== shell ===== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  min-height: 0;
  margin: 14px 0 14px 14px;
  padding: 20px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  box-shadow: 0 20px 44px -28px rgba(20, 16, 8, 0.6);
  color: var(--navy-text);
  overflow: hidden auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 4px 6px 6px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  color: var(--gold-2);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 1.15rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.brand-title {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 3px;
}

.nav-list {
  display: grid;
  gap: 2px;
}

.nav-item,
.ghost-button,
.primary-button,
.secondary-button,
.small-button,
.chip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.nav-item {
  position: relative;
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  padding: 10px 13px;
  border-radius: 13px;
  background: transparent;
  color: var(--navy-text);
  font-weight: 500;
  font-size: 0.88rem;
}

.nav-item i[data-lucide] {
  color: var(--navy-muted);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item:hover i[data-lucide] {
  color: #fff;
}

.nav-item.active {
  background: var(--gold);
  color: #1b1b1d;
  font-weight: 700;
  box-shadow: 0 12px 22px -12px rgba(199, 149, 58, 0.55);
}

.nav-item.active i[data-lucide] {
  color: #1b1b1d;
}

.sidebar-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: auto;
}

.ghost-button {
  flex-direction: column;
  gap: 5px;
  min-height: 56px;
  padding: 9px 6px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--navy-text);
  border-color: var(--navy-line);
  font-size: 0.72rem;
  font-weight: 600;
}

.ghost-button i[data-lucide] {
  color: var(--navy-muted);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.ghost-button:hover i[data-lucide] {
  color: #fff;
}

.ghost-button.danger:hover {
  color: #ffd9d2;
  border-color: rgba(207, 124, 112, 0.6);
}

.ghost-button.danger:hover i[data-lucide] {
  color: var(--rose);
}

.search-status {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--gold-line);
  border-radius: 13px;
  background: var(--gold-soft);
  color: var(--ink-2);
  font-size: 0.84rem;
}

.search-status strong {
  color: var(--ink);
}

.search-status.danger {
  border-color: var(--rose-line);
  background: var(--rose-soft);
  color: var(--rose-2);
}

/* ===== modal ===== */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(27, 28, 31, 0.34);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(20, 20, 25, 0.28);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-copy {
  margin-bottom: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.icon-only {
  min-width: 38px;
  padding-inline: 9px;
}

.danger-action {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
  box-shadow: none;
}

.danger-action:hover {
  background: var(--rose-2);
}

/* ===== onboarding ===== */
.onboarding-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.onboarding-scrim {
  position: absolute;
  inset: 0;
  background: rgba(27, 28, 31, 0.2);
  pointer-events: auto;
}

.onboarding-target {
  z-index: 45;
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  color: #1b1b1d !important;
  box-shadow: 0 0 0 4px rgba(199, 149, 58, 0.3) !important;
}

.onboarding-target i[data-lucide] {
  color: #1b1b1d !important;
}

.onboarding-card {
  position: absolute;
  top: 92px;
  left: calc(var(--sidebar) + 24px);
  width: min(360px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
  pointer-events: auto;
}

.onboarding-kicker {
  margin-bottom: 6px;
  color: var(--gold-2);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.onboarding-progress {
  height: 5px;
  border-radius: 999px;
  background: var(--gold-soft);
  overflow: hidden;
  margin-bottom: 14px;
}

.onboarding-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--gold);
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.onboarding-card h2 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.onboarding-card p {
  margin-bottom: 14px;
  color: var(--ink-2);
  font-size: 0.88rem;
  line-height: 1.55;
}

.onboarding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.onboarding-actions button:disabled {
  cursor: default;
  opacity: 0.45;
}

/* ===== workspace ===== */
.workspace {
  min-width: 0;
  padding: 0 28px 40px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -28px 20px;
  padding: 16px 28px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.55));
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold-2);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

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

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

h2 {
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted-2);
  text-transform: none;
  letter-spacing: 0;
}

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

.search-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(300px, 28vw);
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
}

.search-shell input {
  border: 0;
  padding: 0;
  min-height: auto;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 0.86rem;
}

.search-shell input:focus {
  box-shadow: none;
  outline: none;
}

.search-shell kbd {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 0.68rem;
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 4px 14px 4px 5px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.profile-pill:hover {
  transform: translateY(-1px);
}

.profile-pill strong,
.profile-pill small {
  display: block;
  line-height: 1.2;
}

.profile-pill strong {
  font-size: 0.82rem;
  font-weight: 700;
}

.profile-pill small {
  color: var(--muted);
  font-size: 0.72rem;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
}

.primary-button,
.secondary-button,
.small-button,
.chip-button {
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.84rem;
  min-height: 42px;
  border-radius: 999px;
}

.primary-button {
  background: var(--gold);
  color: #1b1b1d;
  border-color: transparent;
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px -12px rgba(199, 149, 58, 0.7);
}

.primary-button i[data-lucide] {
  color: #1b1b1d;
}

.secondary-button {
  background: var(--surface);
  color: var(--ink);
  border-color: transparent;
  box-shadow: var(--shadow-soft);
}

.secondary-button i[data-lucide] {
  color: var(--muted-2);
}

.secondary-button:hover {
  transform: translateY(-1px);
}

.small-button {
  min-height: 34px;
  padding: 7px 12px;
  background: var(--surface);
  color: var(--muted-2);
  border-color: var(--line-2);
  font-size: 0.8rem;
}

.small-button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.primary-button:disabled,
.secondary-button:disabled,
.small-button:disabled,
.chip-button:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

.lead-alert-panel {
  border-color: var(--gold-line);
  box-shadow: 0 20px 45px -28px rgba(199, 149, 58, 0.55);
}

.lead-alert-card {
  background: linear-gradient(135deg, rgba(255, 250, 236, 0.96), rgba(255, 255, 255, 0.98));
}

.chip-button {
  min-height: 36px;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--line-2);
  font-size: 0.82rem;
}

.chip-button:hover {
  background: var(--surface-2);
}

.chip-button.active {
  background: var(--gold-soft);
  border-color: var(--gold-line);
  color: var(--gold-2);
}

/* ===== views ===== */
.view-region {
  min-width: 0;
}

.grid {
  display: grid;
  gap: 16px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two-column {
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
}

.three-column {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header .muted,
.panel-header p {
  font-size: 0.8rem;
}

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

.metric {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 13px;
  min-height: 96px;
  align-items: center;
}

.metric-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.metric-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.metric .row-meta {
  font-size: 0.76rem;
}

.metric-line {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.metric-line span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-2), var(--gold));
}

.list {
  display: grid;
  gap: 9px;
}

.relationship-row,
.commitment-row,
.timeline-row,
.community-row,
.folder-row,
.moment-row {
  display: grid;
  gap: 7px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}

.relationship-row {
  grid-template-columns: auto minmax(160px, 0.95fr) minmax(200px, 1.05fr);
  align-items: center;
  text-align: left;
}

.relationship-row:hover,
.commitment-row:hover,
.timeline-row:hover,
.community-row:hover,
.folder-row:hover {
  background: var(--surface-2);
  transform: translateX(2px);
}

.relationship-row.selected {
  border-color: var(--gold-line);
  background: var(--gold-soft);
}

.moment-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.moment-row:hover {
  background: var(--surface-2);
}

.folder-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--gold-soft);
  color: var(--gold-2);
}

.row-next {
  min-width: 0;
  max-width: 260px;
  padding-left: 13px;
  border-left: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 0.82rem;
}

.row-title {
  font-weight: 700;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

/* ===== badges / pills ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted-2);
  font-size: 0.73rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge.teal,
.badge.gold {
  background: var(--gold-soft);
  color: var(--gold-2);
  border-color: var(--gold-line);
}

.badge.icon-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  border: 1px solid var(--gold-line);
  background: var(--gold-soft);
  color: var(--gold-2);
}

.badge.amber {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: var(--amber-line);
}

.badge.coral,
.badge.rose {
  background: var(--rose-soft);
  color: var(--rose-2);
  border-color: var(--rose-line);
}

.badge.leaf {
  background: var(--leaf-soft);
  color: var(--leaf);
  border-color: var(--leaf-line);
}

/* ===== forms ===== */
.form-grid {
  display: grid;
  gap: 10px;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.36fr) auto;
  gap: 8px;
}

.form-row.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 11px 13px;
  font-size: 0.86rem;
  outline: none;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

input:focus,
textarea:focus,
select:focus {
  border-color: transparent;
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(199, 149, 58, 0.25);
}

.helper-output,
.folder-preview,
.summary-box {
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
}

.summary-box {
  line-height: 1.55;
}

.folder-preview {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  background: var(--surface-2);
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* ===== second brain ===== */
.brain-form {
  display: grid;
  gap: 10px;
}

.brain-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 0.4fr) minmax(100px, 0.24fr) auto;
  gap: 9px;
  align-items: end;
}

.brain-controls .primary-button {
  width: 100%;
}

.brain-query-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.brain-results {
  display: grid;
  gap: 11px;
}

.brain-hit {
  display: grid;
  gap: 11px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.brain-hit-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: start;
}

.brain-hit h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.brain-excerpt {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.88rem;
  line-height: 1.56;
  overflow-wrap: anywhere;
}

.brain-evidence {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-top: 2px;
}

.brain-evidence code {
  min-width: 0;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted-2);
  font-size: 0.74rem;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

.split-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.health-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--leaf-soft);
  color: var(--leaf);
  font-weight: 700;
  font-size: 0.84rem;
  border: 1px solid var(--leaf-line);
}

.care-flag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--rose-line);
  border-left: 3px solid var(--rose);
  border-radius: var(--radius-sm);
  background: var(--rose-soft);
  color: var(--rose-2);
  font-size: 0.85rem;
  line-height: 1.45;
}

.care-flag i[data-lucide] {
  color: var(--rose);
  flex: 0 0 17px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--surface);
  font-size: 0.84rem;
}

.inline-block,
.inline-form {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.inline-block p {
  margin: 0;
  font-size: 0.86rem;
}

.spark-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 86px;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.spark-card svg {
  width: 82px;
  height: 26px;
}

.assistant-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.assistant-note:hover {
  background: var(--surface-2);
}

.assistant-note .small-button {
  min-width: 34px;
  padding: 8px;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.recent-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.recent-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

i[data-lucide] {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

/* ===== responsive ===== */
@media (max-width: 1080px) {
  .metrics-grid,
  .three-column,
  .dashboard-grid,
  .two-column,
  .recent-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* mobile nav drawer (off-canvas) — hidden on desktop */
.topbar-lead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nav-toggle { display: none; }
.nav-scrim { display: none; }

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  /* sidebar becomes a slide-in drawer keeping its full labeled nav */
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(286px, 84vw);
    height: 100%;
    margin: 0;
    border-radius: 0 22px 22px 0;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  body.nav-open {
    overflow: hidden;
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line-2);
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-soft);
  }
  .nav-toggle i[data-lucide] {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
  }

  .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(20, 18, 12, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  body.nav-open .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .topbar {
    position: static;
    margin: -16px -16px 16px;
    padding: 12px 16px;
  }

  .onboarding-card {
    position: fixed;
    inset: auto 12px 12px;
    width: auto;
  }

  .onboarding-actions {
    justify-content: stretch;
  }

  .onboarding-actions button {
    flex: 1;
  }

  .workspace {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .search-shell {
    min-width: 100%;
  }

  .search-status {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-card {
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .modal-actions,
  .form-row.compact {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    display: grid;
  }

  .profile-pill {
    flex: 1 1 160px;
  }

  .topbar-actions button {
    flex: 1 1 140px;
  }

  .metrics-grid,
  .three-column,
  .dashboard-grid,
  .two-column,
  .recent-grid {
    grid-template-columns: 1fr;
  }

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

  .brain-controls {
    grid-template-columns: 1fr;
  }

  .brain-evidence {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    gap: 9px;
  }

  .panel {
    padding: 15px;
  }

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

  .row-next {
    max-width: none;
    padding-left: 0;
    border-left: 0;
  }
}

/* ===== sidebar groups ===== */
.nav-sub {
  display: grid;
  gap: 2px;
  margin-left: 14px;
  padding-left: 11px;
  border-left: 1px solid var(--navy-line);
}
.nav-child {
  min-height: 34px;
  font-size: 0.84rem;
}
.nav-label {
  margin: 14px 10px 2px;
  color: var(--navy-muted);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ===== agent home / chat ===== */
.agent-home {
  max-width: 760px;
  margin: 0 auto;
  padding-top: 6vh;
}
.agent-greeting {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.agent-greeting span {
  color: var(--muted);
}
.composer {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 16px 16px 12px;
}
.composer textarea {
  border: 0;
  min-height: 52px;
  padding: 0;
  font-size: 0.98rem;
  background: transparent;
  resize: none;
}
.composer textarea:focus {
  box-shadow: none;
}
.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.composer-foot .model-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--muted);
}
.send-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--gold);
  color: #1b1b1d;
  box-shadow: var(--shadow-gold);
}
.send-btn:hover {
  transform: translateY(-1px);
}
.suggested {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}
.suggested button {
  width: auto;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.84rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.suggested button:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
}

.chat-thread {
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
  padding-bottom: 8px;
}
.bubble-user {
  justify-self: end;
  max-width: 80%;
  padding: 11px 15px;
  border-radius: 16px 16px 5px 16px;
  background: var(--navy);
  color: #fff;
  font-size: 0.9rem;
}
.bubble-agent {
  justify-self: start;
  max-width: 92%;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
}
.bubble-agent .agent-mk b {
  font-weight: 700;
}
.bubble-agent .agent-mk {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.agent-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: start;
}
.agent-ava {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--gold-soft);
  color: var(--gold-2);
  border: 1px solid var(--gold-line);
}
.thinking {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}
.thinking i {
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.draft-card {
  margin-top: 12px;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
  padding: 14px;
}
.draft-card .draft-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.draft-card .draft-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 12px;
  font-size: 0.88rem;
  white-space: pre-wrap;
  margin-bottom: 10px;
}
.draft-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.send-status {
  font-size: 0.82rem;
  color: var(--leaf);
  align-self: center;
}
.composer-docked {
  max-width: 820px;
  margin: 14px auto 0;
}

/* ===== data table ===== */
.seg {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.seg button {
  border: 0;
  background: transparent;
  padding: 8px 15px;
  font-size: 0.82rem;
  color: var(--muted-2);
  min-height: 36px;
}
.seg button.active {
  background: var(--gold);
  color: #1b1b1d;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
table.crm {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 720px;
}
table.crm th {
  text-align: left;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
table.crm td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.crm tr:last-child td {
  border-bottom: 0;
}
table.crm tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}
table.crm tbody tr:hover {
  background: var(--surface-2);
}
table.crm.audit-table {
  min-width: 880px;
}
table.crm.audit-table tbody tr {
  cursor: default;
}
.audit-meta {
  display: block;
  max-width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
table.crm .cell-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
table.crm .mini-ava {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold-2);
  font-size: 0.72rem;
  font-weight: 700;
  flex: 0 0 30px;
}
.col-ai {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.col-ai .ai-tag {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--gold-2);
  border: 1px solid var(--gold-line);
  background: var(--gold-soft);
  border-radius: 5px;
  padding: 2px 5px;
  letter-spacing: 0.04em;
}

/* ===== reports ===== */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 180px;
  padding: 8px 4px 0;
}
.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.chart-col .bar {
  width: 70%;
  max-width: 46px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
}
.chart-col small {
  color: var(--muted);
  font-size: 0.74rem;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  color: var(--muted-2);
}
.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: middle;
}

/* ===== automations ===== */
.auto-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.auto-card:hover {
  background: var(--surface-2);
}
.auto-card .toggle {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--leaf);
  position: relative;
  flex: 0 0 38px;
  transition: background 0.15s ease;
}
.auto-card .toggle.off {
  background: var(--surface-3);
  border: 1px solid var(--line-2);
}
.auto-card .toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 18px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: left 0.15s ease;
}
.auto-card .toggle.off::after {
  left: 2px;
}
.flow-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.flow-arrow {
  text-align: center;
  color: var(--gold-2);
}

/* ===== calendar — agenda ===== */
.cal {
  margin-bottom: 18px;
}
.calendar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.calendar-actions a {
  text-decoration: none;
}

.cal-agenda {
  display: grid;
  gap: 0;
}
.cal-dayrow {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.cal-dayrow:first-child {
  border-top: 0;
  padding-top: 2px;
}
.cal-dayrow:last-child {
  padding-bottom: 2px;
}

/* left date rail */
.cal-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 3px;
}
.cal-dow {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.cal-dnum {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.cal-dayrow.is-today .cal-dow {
  color: var(--gold-2);
}
.cal-dayrow.is-today .cal-dnum {
  border-radius: 50%;
  background: var(--gold);
  color: #1b1b1d;
  font-size: 0.98rem;
  box-shadow: 0 8px 16px -8px rgba(199, 149, 58, 0.7);
}

/* rides for a day */
.cal-rides {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.ride-row {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  transition: background 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
}
.ride-row:hover {
  background: var(--surface-2);
  transform: translateX(2px);
  box-shadow: var(--shadow-soft);
}
.ride-row.tone-leaf { border-left-color: var(--leaf); }
.ride-row.tone-gold { border-left-color: var(--gold); }
.ride-row.tone-rose { border-left-color: var(--rose); }
.ride-row.tone-amber { border-left-color: var(--amber); }

.ride-time {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ride-main {
  min-width: 0;
}
.ride-rider {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink);
}
.ride-route {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.79rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 1080px) {
  .ride-route {
    white-space: normal;
  }
}
.ride-request {
  cursor: default;
}
.ride-call {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-2);
}
.ride-call i[data-lucide] {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--gold-2);
}
.ride-call:hover {
  text-decoration: underline;
}
.ride-note {
  display: block;
  margin-top: 5px;
  font-size: 0.79rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.ride-note i[data-lucide] {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  color: var(--muted-2);
  vertical-align: -2px;
  margin-right: 3px;
}
.ride-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.loop-receipt {
  color: var(--gold-2);
  font-weight: 600;
}

/* ===== premium dashboard (Home) ===== */
.dash {
  display: grid;
  gap: 20px;
}

.dash-greet {
  margin: 2px 0 2px;
}
.dash-greet .eyebrow {
  margin-bottom: 8px;
}
.greet-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.04;
  margin: 0;
}
.greet-title span {
  color: var(--muted);
  font-weight: 700;
}
.greet-sub {
  margin: 8px 0 0;
  color: var(--muted-2);
  font-size: 1.02rem;
  font-weight: 500;
}

/* dark hero card */
.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding: 24px 26px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 88% -10%, rgba(199, 149, 58, 0.22), transparent 55%),
    linear-gradient(160deg, #26262b 0%, #161619 70%);
  color: #fff;
  box-shadow: 0 26px 54px -30px rgba(20, 16, 8, 0.7);
}
.hero-main {
  min-width: 0;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.hero-eyebrow i[data-lucide] {
  color: var(--gold);
}
.hero-head {
  margin: 0 0 8px;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: #fff;
}
.hero-sub {
  margin: 0;
  color: #b6b2c0;
  font-size: 0.92rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 0 auto;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--gold);
  color: #1b1b1d;
  font-weight: 700;
  font-size: 0.86rem;
  box-shadow: var(--shadow-gold);
  transition: transform 0.15s ease;
}
.hero-pill:hover {
  transform: translateY(-1px);
}
.hero-pill.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}
.hero-pill.ghost i[data-lucide] {
  color: #fff;
}

/* quick-access tiles */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.tile {
  display: grid;
  gap: 12px;
  align-content: start;
  text-align: left;
  padding: 18px;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}
.tile-ic {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--gold-soft);
  color: var(--gold-2);
  border: 1px solid var(--gold-line);
}
.tile-ic i[data-lucide] {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}
.tile-title {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.tile-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ask-the-concierge card */
.ask-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}
.ask-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.ask-title {
  font-size: 1rem;
  font-weight: 700;
}
.ask-sub {
  font-size: 0.82rem;
}
.ask-card .composer {
  border-color: var(--line-2);
  box-shadow: none;
  background: var(--surface-2);
}

/* two-column lower dash */
.dash-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  align-items: start;
}
.dash-cols .cal {
  margin-bottom: 0;
}

/* dark panel variant */
.panel.dark {
  background: linear-gradient(165deg, var(--navy) 0%, var(--navy-2) 100%);
  border-color: var(--navy-line);
  color: #ededf2;
  box-shadow: 0 24px 50px -32px rgba(20, 16, 8, 0.7);
}
.panel.dark h2 {
  color: #fff;
}
.panel.dark .muted {
  color: #9a9aa6;
}
/* light cards inside a dark focal panel keep dark text (names were inheriting near-white) */
.panel.dark .auto-card {
  color: var(--ink);
}
.panel.dark .auto-card .row-meta {
  color: var(--muted-2);
}
.panel.dark .attn-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.panel.dark .attn-row:last-child {
  border-bottom: 0;
}
.attn-ic {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--gold);
  flex: 0 0 36px;
}
.attn-ic.rose {
  color: #f0a99e;
  background: rgba(207, 124, 112, 0.16);
}
.attn-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #f3f3f6;
  overflow-wrap: anywhere;
}
.attn-meta {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.78rem;
  color: #9a9aa6;
  margin-top: 2px;
}
.attn-when {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

@media (max-width: 1080px) {
  .tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-cols {
    grid-template-columns: 1fr;
  }
  .greet-title {
    font-size: 2rem;
  }
}
@media (max-width: 820px) {
  .hero-card {
    padding: 20px;
    flex-direction: column;
    align-items: stretch;
  }
  .hero-head {
    font-size: 1.45rem;
  }
  .hero-actions {
    width: 100%;
  }
  .hero-pill {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding: 0 12px;
  }
}
@media (max-width: 480px) {
  .tile-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .tile {
    min-height: 0;
    padding: 14px;
  }
  .greet-title {
    font-size: 1.7rem;
  }
}

/* ===================================================================
   Cabin/Beehive design framework — Home rings, tasks carousel, concierge FAB
   (brought from the-beehive-crm reference build)
=================================================================== */

/* Home: header + workspace grid */
.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin: 2px 0 2px;
}
.dash-head-lead { min-width: 0; }
.dash-head .greet-title { margin: 2px 0 0; }
.dash-today {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 0;
  color: var(--muted-2);
  font-size: 0.96rem;
}
.dash-today svg { width: 15px; height: 15px; color: var(--gold-2); }
.dash-actions { display: flex; gap: 8px; flex-shrink: 0; }
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.home-main, .home-side { min-width: 0; }
@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .dash-actions { width: 100%; }
  .dash-actions .secondary-button, .dash-actions .primary-button { flex: 1; }
}

/* Operations at a glance — SVG rings */
.ops-panel { margin-top: 18px; }
.ops-rings {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.ops-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 16px 8px 14px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.ops-ring:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--gold-line);
}
.ring-svg { width: 78px; height: 78px; }
.ring-track { fill: none; stroke: var(--surface-3); stroke-width: 8; }
.ring-arc { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.7s ease; }
.ring-center {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  fill: var(--ink);
}
.ops-ring-label { font-weight: 600; font-size: 0.86rem; color: var(--ink); line-height: 1.2; }
.ops-ring-sub { font-size: 0.72rem; color: var(--muted); }
@media (max-width: 1100px) { .ops-rings { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ops-rings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Home: Today's Tasks carousel (dark) */
.tasks-carousel {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  color: #fff;
  box-shadow: var(--shadow-soft);
  min-width: 0;
  overflow: hidden;
}
.tasks-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.tasks-head h2 {
  margin: 0;
  color: #fff;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0;
}
.tasks-count { color: var(--gold); font-weight: 700; font-size: 0.95rem; }
.tasks-track {
  display: flex;
  width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tasks-track::-webkit-scrollbar { display: none; }
.tasks-page { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; display: flex; flex-direction: column; }
.task-row { display: flex; align-items: center; gap: 14px; padding: 13px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.task-row:last-child { border-bottom: 0; }
.task-ic { display: grid; place-items: center; flex: 0 0 46px; width: 46px; height: 46px; border-radius: 13px; background: rgba(255, 255, 255, 0.06); color: #fff; }
.task-ic svg { width: 20px; height: 20px; }
.task-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.task-title { font-weight: 600; font-size: 0.98rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-sub { font-size: 0.8rem; color: var(--navy-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-check {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28); background: transparent;
  display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.task-check:hover { border-color: var(--gold); }
.task-check svg { width: 15px; height: 15px; color: #1b1b1d; opacity: 0; transition: opacity 0.15s ease; }
.task-row.done .task-check { background: var(--gold); border-color: var(--gold); }
.task-row.done .task-check svg { opacity: 1; }
.task-row.done .task-title, .task-row.done .task-sub { text-decoration: line-through; color: var(--navy-muted); }
.tasks-dots { display: flex; justify-content: center; gap: 7px; padding-top: 12px; }
.tasks-dot { width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; background: rgba(255, 255, 255, 0.22); cursor: pointer; transition: background 0.15s ease, width 0.15s ease; }
.tasks-dot.active { background: var(--gold); width: 18px; border-radius: 4px; }
.task-empty { color: var(--navy-muted); padding: 18px 2px; font-size: 0.9rem; }

/* Floating AI Concierge */
.concierge-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--navy-line);
  background: var(--navy);
  color: var(--gold);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-lift);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.concierge-fab:hover { transform: translateY(-2px) scale(1.04); }
.concierge-fab svg { width: 24px; height: 24px; }
.concierge-fab .fab-close { display: none; }
body.concierge-open .concierge-fab .fab-open { display: none; }
body.concierge-open .concierge-fab .fab-close { display: block; }
.concierge-pop {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 50;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: min(72vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
body.concierge-open .concierge-pop {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.concierge-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: var(--navy);
  color: #fff;
}
.concierge-pop-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.95rem; }
.concierge-pop-title svg { width: 18px; height: 18px; color: var(--gold); }
.concierge-pop-close {
  background: transparent; border: 0; color: rgba(255, 255, 255, 0.8);
  cursor: pointer; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px;
}
.concierge-pop-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.concierge-pop-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.concierge-thread {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.concierge-intro { display: flex; gap: 10px; align-items: flex-start; color: var(--muted-2); font-size: 0.9rem; }
.concierge-intro p { margin: 0; }
.concierge-composer { border-top: 1px solid var(--line); padding: 10px; background: var(--surface); }
@media (max-width: 560px) {
  .concierge-fab { right: 16px; bottom: 16px; width: 54px; height: 54px; }
  .concierge-pop { right: 10px; left: 10px; bottom: 78px; width: auto; max-width: none; max-height: 76vh; }
}

/* Mobile: inline-styled two-column grids (Revenue/Bills/Operations) must collapse —
   an inline grid-template-columns beats a media query without !important. */
@media (max-width: 820px) {
  .grid.two-column { grid-template-columns: 1fr !important; }
}

/* Mobile: 12-month revenue chart must fit — tighten gaps + labels */
@media (max-width: 560px) {
  .chart-bars { gap: 4px; }
  .chart-col { min-width: 0; }
  .chart-col small { font-size: 0.56rem; }
}

/* ===== Home calendar: Schedule / Month toggle + month grid ===== */
.cal-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; flex: none; }
.cal-tab { border: 0; background: transparent; color: var(--muted-2); font-weight: 600; font-size: 0.82rem; padding: 6px 14px; border-radius: 999px; cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.cal-tab.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-soft); }
.cal-tab:hover:not(.active) { color: var(--ink); }
.small-button.icon-only { padding: 7px 9px; }
.cal-month { margin-top: 4px; }
.cal-month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 12px; }
.cal-month-label { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.cal-m-grid { display: grid; gap: 6px; }
.cal-m-head, .cal-m-body { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-m-dow { text-align: center; font-size: 0.7rem; font-weight: 700; color: var(--muted); padding: 2px 0; }
.cal-m-cell { position: relative; aspect-ratio: 1 / 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-2); font-size: 0.85rem; padding: 0; cursor: default; transition: transform 0.14s ease, box-shadow 0.14s ease; }
.cal-m-cell.empty { border: 0; background: transparent; }
.cal-m-cell.has { cursor: pointer; border-color: var(--gold-line); background: var(--gold-soft); }
.cal-m-cell.has:hover { box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.cal-m-cell.is-today { outline: 2px solid var(--gold); outline-offset: -2px; }
.cal-m-cell .cal-m-n { font-weight: 600; }
.cal-m-dot { font-size: 0.62rem; font-weight: 700; color: #1b1916; background: var(--gold); min-width: 16px; height: 16px; border-radius: 999px; display: grid; place-items: center; padding: 0 4px; }
@media (max-width: 560px) {
  .cal-m-cell { border-radius: 8px; font-size: 0.78rem; }
  .cal-m-dot { min-width: 14px; height: 14px; }
  .cal-tab { padding: 6px 11px; }
}
