/* Atlas — Atlas Alliance. Dark, clean, indigo. The unified holding app. */
:root {
  --bg: #0b0d12;
  --bg-elev: #12151d;
  --bg-card: #161a24;
  --bg-card-hi: #1b2030;
  --border: #232838;
  --border-soft: #1c2130;
  --text: #e7e9ee;
  --text-dim: #9aa1b1;
  --text-faint: #6b7283;
  --accent: #4f46e5;
  --accent-hi: #6366f1;
  --accent-soft: rgba(79, 70, 229, 0.15);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.14);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.14);
  --gray: #6b7283;
  --gray-soft: rgba(107, 114, 131, 0.16);
  --blue: #3b82f6;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #15182250, transparent), var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

.logo-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-hi);
  font-size: 20px;
  border: 1px solid rgba(79, 70, 229, 0.4);
  flex: none;
}

/* ---------- Boot ---------- */
.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--text-dim);
}
.boot .logo-mark { width: 54px; height: 54px; font-size: 26px; }

/* ---------- Auth screen ---------- */
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 28px;
}
.brand-mark { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.auth-title { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.auth-sub { margin: 2px 0 0; color: var(--text-dim); font-size: 13.5px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.field-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.text-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
}
.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn-primary {
  margin-top: 4px;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary:hover { background: var(--accent-hi); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.auth-msg { margin: 14px 0 0; font-size: 14px; min-height: 1px; }
.auth-msg.is-ok { color: var(--green); }
.auth-msg.is-error { color: var(--red); }
.auth-foot { margin: 18px 0 0; color: var(--text-faint); font-size: 12.5px; }

/* ---------- App shell ---------- */
.app { max-width: 1100px; margin: 0 auto; padding: 24px 20px 56px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-text h1 { margin: 0; font-size: 19px; letter-spacing: -0.02em; }
.brand-text .tagline { margin: 1px 0 0; color: var(--text-dim); font-size: 12.5px; }
.session { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.session-email { color: var(--text-dim); font-size: 13px; }

/* ---------- Business switcher (owner) ---------- */
.biz-switch { display: inline-flex; align-items: center; gap: 8px; }
.biz-switch-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.biz-select {
  padding: 7px 30px 7px 12px;
  background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%239aa1b1' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") no-repeat right 11px center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.biz-select:hover { border-color: var(--gray); }
.biz-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Role badge ---------- */
.role-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.role-badge.is-owner { color: #c7d2fe; background: var(--accent-soft); border-color: rgba(79, 70, 229, 0.5); }
.role-badge.is-staff { color: var(--text-dim); background: var(--gray-soft); }
.btn-ghost {
  padding: 7px 13px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-ghost:hover { color: var(--text); border-color: var(--gray); background: var(--bg-elev); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; margin: 18px 0 22px; flex-wrap: wrap; }
.tab {
  padding: 9px 16px;
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab:hover { color: var(--text); border-color: var(--gray); }
.tab.is-active {
  background: var(--accent-soft);
  color: #c7d2fe;
  border-color: rgba(79, 70, 229, 0.5);
}

/* ---------- View headers ---------- */
.view-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.view-head h2 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.count-badge {
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 999px;
}
.loading, .empty { color: var(--text-faint); font-size: 14px; padding: 18px 0; }
.muted { color: var(--text-faint); }
.error-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--red-soft);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.error-box strong { color: #fecaca; }
.error-box span { color: var(--text-dim); }

/* ---------- Contacts table ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.data-table thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.data-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-card-hi); }
.cell-strong { font-weight: 600; color: var(--text); }
.source-tag {
  display: inline-block;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--gray-soft);
  border-radius: 6px;
  padding: 2px 8px;
}
.tags-cell { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-block;
  font-size: 11.5px;
  color: #c7d2fe;
  background: var(--accent-soft);
  border: 1px solid rgba(79, 70, 229, 0.35);
  border-radius: 999px;
  padding: 1px 9px;
}

/* ---------- Pipeline kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kanban-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 120px;
}
.kanban-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 12px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 12px;
}
.kanban-title { font-size: 13px; font-weight: 600; letter-spacing: 0.01em; }
.kanban-count {
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-elev);
  border-radius: 999px;
  padding: 1px 8px;
  min-width: 22px;
  text-align: center;
}
.stage-new .kanban-title { color: var(--blue); }
.stage-working .kanban-title { color: var(--amber); }
.stage-won .kanban-title { color: var(--green); }
.stage-lost .kanban-title { color: var(--text-faint); }
.kanban-list { display: flex; flex-direction: column; gap: 10px; }
.kanban-empty { color: var(--text-faint); font-size: 13px; text-align: center; padding: 8px 0; margin: 0; }
.lead-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.lead-card:hover { border-color: var(--gray); }
.lead-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lead-who { font-weight: 600; font-size: 14px; }
.lead-value { font-size: 13px; font-weight: 600; color: var(--green); white-space: nowrap; }
.lead-acct { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.lead-notes { font-size: 12.5px; color: var(--text-faint); margin: 8px 0 0; line-height: 1.45; }

/* ---------- Clients grid ---------- */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.client-card:hover { border-color: var(--gray); }
.client-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.client-head h3 { margin: 0; font-size: 16px; letter-spacing: -0.01em; }
.kind-tag {
  font-size: 11px;
  text-transform: capitalize;
  color: var(--text-dim);
  background: var(--gray-soft);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.client-contact { margin: 8px 0 14px; font-size: 13px; color: var(--text-dim); }
.client-links { display: flex; flex-wrap: wrap; gap: 8px; }
.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-dim);
}
.link-pill.repo:hover, .link-pill.site:hover {
  border-color: var(--accent);
  color: #c7d2fe;
  text-decoration: none;
  background: var(--accent-soft);
}
.link-pill.is-empty { color: var(--text-faint); opacity: 0.6; }
.pill-ico { color: var(--accent-hi); font-weight: 700; }
.client-pms { margin: 14px 0 0; font-size: 12px; color: var(--text-faint); }
.client-pms code { font-family: var(--mono); color: var(--text-dim); }

/* ---------- Business tag (per-record) ---------- */
.biz-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 9px;
  border-radius: 999px;
  color: var(--text-dim);
  background: var(--gray-soft);
  border: 1px solid var(--border);
  white-space: nowrap;
}
/* Each business gets a subtle accent so the holding view reads at a glance. */
.biz-fullyo        { color: #c7d2fe; background: var(--accent-soft); border-color: rgba(79, 70, 229, 0.4); }
.biz-lux           { color: #fbcfe8; background: rgba(236, 72, 153, 0.14); border-color: rgba(236, 72, 153, 0.35); }
.biz-tmp           { color: #a7f3d0; background: rgba(16, 185, 129, 0.14); border-color: rgba(16, 185, 129, 0.35); }
.biz-axis          { color: #bae6fd; background: rgba(59, 130, 246, 0.14); border-color: rgba(59, 130, 246, 0.35); }
.biz-owl_valley    { color: #fde68a; background: var(--amber-soft); border-color: rgba(245, 158, 11, 0.35); }
.biz-casa          { color: #fca5a5; background: var(--red-soft); border-color: rgba(239, 68, 68, 0.35); }
.biz-basecamp      { color: #c4b5fd; background: rgba(139, 92, 246, 0.14); border-color: rgba(139, 92, 246, 0.35); }
.biz-other_clients { color: var(--text-dim); background: var(--gray-soft); }
.lead-meta { margin-top: 6px; }
.client-biz { margin: 8px 0 0; }

/* ---------- Command Center placeholder ---------- */
.placeholder-card {
  background: linear-gradient(180deg, var(--bg-card-hi), var(--bg-card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 32px;
  text-align: center;
  max-width: 640px;
}
.placeholder-ico {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-hi);
  font-size: 26px;
  border: 1px solid rgba(79, 70, 229, 0.4);
  margin-bottom: 16px;
}
.placeholder-card h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -0.01em; }
.placeholder-card p { margin: 0 auto 10px; color: var(--text-dim); font-size: 14px; max-width: 480px; line-height: 1.55; }
.placeholder-note { color: var(--text-faint) !important; font-size: 12.5px !important; }

/* ====================================================================
   COMMAND CENTER (cockpit) — owner-only tab. Ported from the standalone
   dashboard/. Atlas dark + indigo, native to the app shell.
   ==================================================================== */
.cockpit { display: block; }

/* Cockpit header: title + Neo status */
.cockpit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.cockpit-title h2 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.cockpit-sub { display: block; margin-top: 3px; color: var(--text-faint); font-size: 13px; }

.neo-status {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--gray); box-shadow: 0 0 0 0 transparent;
}
.status-dot.online { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.status-dot.idle { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.status-label { font-weight: 600; }
.status-meta { color: var(--text-faint); font-family: var(--mono); font-size: 12px; }

/* Cockpit sections */
.cockpit-section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; }
.section-sub { color: var(--text-faint); font-size: 12.5px; }
.tag {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 3px 9px; border-radius: 999px;
}
.sample-tag { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.35); }

/* ---------- Priorities board (business-aware, two columns) ---------- */
.prio-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.prio-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 8px;
}
.prio-col-head { margin-bottom: 10px; }
.prio-col-title { margin: 0; font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; }
.prio-col-sub { display: block; margin-top: 2px; color: var(--text-faint); font-size: 11.5px; }
.prio-list { list-style: none; margin: 0; padding: 0; }
.prio-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--border-soft);
}
.prio-row:first-child { border-top: none; }
.prio-order {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-hi);
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--mono);
  border: 1px solid rgba(79, 70, 229, 0.3);
}
.prio-body { min-width: 0; }
.prio-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prio-title { font-size: 13px; font-weight: 600; color: var(--text); }
.prio-note { margin: 3px 0 0; color: var(--text-dim); font-size: 12px; line-height: 1.45; }
.prio-status {
  align-self: center;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--text-dim);
  background: var(--gray-soft);
  border: 1px solid var(--border);
}
.prio-empty { color: var(--text-faint); font-size: 12.5px; padding: 8px 0 14px; margin: 0; }
/* Atlas (holding-wide) tag — indigo, distinct from per-business tags. */
.biz-atlas { color: #c7d2fe; background: var(--accent-soft); border-color: rgba(79, 70, 229, 0.45); }

/* Portfolio overview — business cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: rgba(79, 70, 229, 0.5); transform: translateY(-2px); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-name { font-size: 15px; font-weight: 650; margin: 0; }
.card-blurb { color: var(--text-dim); font-size: 13px; margin: 0; }
.card-metrics {
  margin-top: auto; padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  display: flex; flex-direction: column; gap: 9px;
}
.metric { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.metric-label {
  color: var(--text-faint); text-transform: uppercase;
  font-size: 10px; letter-spacing: 0.06em; white-space: nowrap;
}
.metric-value { font-size: 12.5px; text-align: right; }
.metric-value.placeholder { color: var(--text-faint); font-family: var(--mono); font-size: 11.5px; }

.pill { font-size: 11px; font-weight: 600; text-transform: capitalize; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill-running { background: var(--green-soft); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.35); }
.pill-early { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.35); }
.pill-idea { background: var(--gray-soft); color: var(--text-dim); border: 1px solid var(--border); }

/* Goals — grouped daily / weekly / monthly */
.goal-groups { display: flex; flex-direction: column; gap: 22px; }
.goal-group-label {
  margin: 0 0 10px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim);
}
.goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.goal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left-width: 3px; border-left-color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.goal.goal-tbd { border-left-color: var(--gray); opacity: 0.82; }
.goal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.goal-biz { font-weight: 650; font-size: 13.5px; }
.goal-status {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: #c7d2fe; background: var(--accent-soft); border: 1px solid rgba(79, 70, 229, 0.4);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap; flex-shrink: 0;
}
.goal.goal-tbd .goal-status { color: var(--text-dim); background: var(--gray-soft); border-color: var(--border); }
.goal-objective { margin: 0; font-size: 13px; color: var(--text-dim); line-height: 1.4; }
.goal-metric {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-top: 8px; border-top: 1px solid var(--border-soft);
}
.goal-numbers { font-family: var(--mono); white-space: nowrap; }
.goal-current { font-size: 17px; font-weight: 700; color: var(--text); }
.goal-sep { color: var(--text-faint); }
.goal-target { font-size: 15px; font-weight: 650; color: var(--accent-hi); }
.goal-signal { font-size: 11px; color: var(--text-faint); text-align: right; line-height: 1.35; }

/* Needs your decision */
.decisions { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.decision {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left-width: 3px; border-left-color: var(--amber);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.decision-head { display: flex; align-items: center; gap: 9px; }
.decision-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  background: var(--amber); box-shadow: 0 0 0 0 var(--amber);
  animation: dec-pulse 1.9s ease-out infinite;
}
.decision-title { font-weight: 600; font-size: 13.5px; color: var(--text); flex: 1; min-width: 0; }
.decision-status {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--amber); background: var(--amber-soft); border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap; flex-shrink: 0;
}
.decision-why { margin: 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.45; padding-left: 18px; }
@keyframes dec-pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Your team */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.member {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.member-avatar {
  display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent-hi);
  font-weight: 700; font-size: 15px; border: 1px solid rgba(79, 70, 229, 0.4);
}
.member-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.member-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.member-name { font-weight: 650; font-size: 14px; }
.member-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 8px; border-radius: 999px;
}
.mbr-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.member-role { font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.member-skill { font-size: 11.5px; color: var(--text-faint); line-height: 1.35; }
.member.mbr-live .member-status { color: var(--green); background: var(--green-soft); border: 1px solid rgba(34, 197, 94, 0.35); }
.member.mbr-live .mbr-dot { background: var(--green); }
.member.mbr-building .member-status { color: var(--accent-hi); background: var(--accent-soft); border: 1px solid rgba(79, 70, 229, 0.4); }
.member.mbr-building .mbr-dot { background: var(--accent-hi); }
.member.mbr-pending .member-status { color: var(--amber); background: var(--amber-soft); border: 1px solid rgba(245, 158, 11, 0.35); }
.member.mbr-pending .mbr-dot { background: var(--amber); }

/* Neo activity (live fleet) */
.livefleet {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.fleet-map { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 26px; }
.neo-node {
  position: relative; display: grid; place-items: center;
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--accent-soft); border: 1px solid rgba(79, 70, 229, 0.5);
  color: var(--text); text-align: center; flex-shrink: 0;
}
.neo-node::before {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0; animation: neo-pulse 2.6s ease-out infinite;
}
.neo-core { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: var(--accent-hi); }
.neo-sub { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-top: 2px; }
@keyframes neo-pulse {
  0% { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.35); opacity: 0; }
}
.workers { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.worker { position: relative; display: flex; align-items: stretch; }
.worker-link { position: relative; width: 22px; flex-shrink: 0; align-self: center; height: 2px; background: var(--border); overflow: hidden; }
.worker-running .worker-link { background: rgba(79, 70, 229, 0.25); }
.worker-running .worker-link::after {
  content: ""; position: absolute; top: 0; left: -40%; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: flow 1.8s linear infinite;
}
@keyframes flow { 0% { left: -40%; } 100% { left: 100%; } }
.worker-card { flex: 1; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 11px 13px; min-width: 0; }
.worker-running .worker-card { border-color: rgba(79, 70, 229, 0.45); }
.worker-done .worker-card { opacity: 0.55; }
.worker-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.worker-biz { font-weight: 600; font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.worker-state { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); }
.worker-running .worker-state { color: var(--accent-hi); }
.worker-task { margin: 0; font-size: 12px; color: var(--text-dim); line-height: 1.35; }
.worker-activity { position: relative; display: inline-flex; width: 9px; height: 9px; flex-shrink: 0; }
.activity-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gray); }
.worker-running .activity-dot { background: var(--accent-hi); }
.worker-running .worker-activity::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--accent-hi); opacity: 0.6; animation: activity-ping 1.4s ease-out infinite;
}
.worker-queued .activity-dot { background: var(--blue); }
.worker-done .activity-dot { background: var(--gray); }
@keyframes activity-ping {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.6); opacity: 0; }
}
@media (max-width: 600px) {
  .fleet-map { grid-template-columns: 1fr; justify-items: center; gap: 18px; }
  .workers { width: 100%; grid-template-columns: 1fr; }
  .worker-link { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .decision-dot,
  .neo-node::before,
  .worker-running .worker-link::after,
  .worker-running .worker-activity::after { animation: none; }
  .neo-node::before { display: none; }
}
@media (max-width: 600px) {
  .grid, .goals, .decisions, .team { grid-template-columns: 1fr; }
  .cockpit-head { flex-direction: column; }
}

/* ====================================================================
   CONTENT CALENDAR (planner) — month grid, brand-colored posts, drawer.
   Role-scoped like the CRM. No publish: planning view only.
   ==================================================================== */
.btn-add {
  margin-left: auto;
  padding: 7px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-add:hover { background: var(--accent-hi); }

.plan-note {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--accent-soft);
  border: 1px solid rgba(79, 70, 229, 0.35);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.plan-note strong { color: #c7d2fe; }

.cal-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-nav {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 18px; line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cal-nav:hover { color: var(--text); border-color: var(--gray); background: var(--bg-elev); }
.cal-month-label { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; min-width: 150px; text-align: center; }
.cal-today {
  margin-left: 6px;
  padding: 6px 12px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cal-today:hover { color: var(--text); border-color: var(--gray); background: var(--bg-elev); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.cal-weekday {
  background: var(--bg-elev);
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 9px 4px;
}
.cal-cell {
  background: var(--bg-card);
  min-height: 104px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-cell.is-blank { background: var(--bg); }
.cal-cell.is-today { background: var(--bg-card-hi); box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.45); }
.cal-cell-head { display: flex; align-items: center; justify-content: flex-end; }
.cal-daynum { font-size: 12px; color: var(--text-faint); font-weight: 600; }
.cal-cell.is-today .cal-daynum {
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  font-size: 11px;
}

/* A post chip inside a day — brand color from the .biz-* palette, status dimming. */
.cal-post {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
  width: 100%;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 7px;
  padding: 5px 7px;
  cursor: pointer;
  background: var(--bg-elev);
  color: var(--text);
  font-family: var(--font);
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.cal-post:hover { border-color: var(--gray); transform: translateY(-1px); }
.cal-post-title {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cal-post-status {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}
.cal-post-time {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-faint);
}
/* Brand left-border accents (mirror the .biz-* tag palette). */
.cal-post.biz-fullyo        { border-left-color: #4f46e5; }
.cal-post.biz-lux           { border-left-color: #ec4899; }
.cal-post.biz-tmp           { border-left-color: #10b981; }
.cal-post.biz-axis          { border-left-color: #3b82f6; }
.cal-post.biz-owl_valley    { border-left-color: #f59e0b; }
.cal-post.biz-casa          { border-left-color: #ef4444; }
.cal-post.biz-basecamp      { border-left-color: #8b5cf6; }
.cal-post.biz-other_clients { border-left-color: var(--gray); }
/* Per-property (brand) accents — distinct so the two LUX properties read apart. */
.cal-post.brand-skyhouse     { border-left-color: #ec4899; }
.cal-post.brand-sempre_avanti{ border-left-color: #14b8a6; }
.queue-card.brand-skyhouse     { border-left: 3px solid #ec4899; }
.queue-card.brand-sempre_avanti{ border-left: 3px solid #14b8a6; }
.queue-card.biz-lux            { border-left: 3px solid #ec4899; }
/* Status cues on chips: posted dimmed; needs_changes = amber; approved = green. */
.cal-post.status-posted { opacity: 0.6; }
.cal-post.status-posted .cal-post-status { color: var(--text-faint); }
.cal-post.status-approved .cal-post-status { color: var(--green); }
.cal-post.status-pending_approval .cal-post-status { color: var(--amber); }
.cal-post.status-needs_changes .cal-post-status { color: #fb7185; }
.cal-post.status-draft { opacity: 0.9; }
.cal-post.status-draft .cal-post-status { color: var(--text-faint); }
/* Pending posts get a soft amber wash so they stand out in the grid. */
.cal-post.status-pending_approval {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.10), var(--bg-elev));
}

@media (max-width: 700px) {
  .cal-cell { min-height: 78px; padding: 4px; }
  .cal-post-title { -webkit-line-clamp: 1; }
}

/* ====================================================================
   SEGMENTED FILTER CHIPS — shared by Contacts lifecycle + Calendar property.
   ==================================================================== */
.seg-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.seg-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.seg-chip:hover { color: var(--text); border-color: var(--gray); }
.seg-chip.is-active {
  background: var(--accent-soft);
  color: #c7d2fe;
  border-color: rgba(79, 70, 229, 0.5);
}
.seg-count {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text-faint);
  background: var(--bg-elev);
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}
.seg-chip.is-active .seg-count { color: #c7d2fe; background: rgba(79, 70, 229, 0.25); }
.cal-brand-filter { margin-bottom: 12px; }

/* ---------- Contact lifecycle-stage badge ---------- */
.stage-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid var(--border);
}
.stage-badge.stage-client      { color: var(--green); background: var(--green-soft); border-color: rgba(34, 197, 94, 0.35); }
.stage-badge.stage-booked_call { color: var(--accent-hi); background: var(--accent-soft); border-color: rgba(79, 70, 229, 0.4); }
.stage-badge.stage-lead        { color: var(--amber); background: var(--amber-soft); border-color: rgba(245, 158, 11, 0.35); }
.stage-badge.stage-other       { color: var(--text-dim); background: var(--gray-soft); }

/* ====================================================================
   CALENDAR VIEW TOGGLE + APPROVAL QUEUE
   ==================================================================== */
.cal-views { display: flex; gap: 8px; margin-bottom: 14px; }
.cal-viewtab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cal-viewtab:hover { color: var(--text); border-color: var(--gray); }
.cal-viewtab.is-active {
  background: var(--accent-soft);
  color: #c7d2fe;
  border-color: rgba(79, 70, 229, 0.5);
}
/* The approval tab pulses amber when posts are waiting. */
.cal-viewtab.has-pending {
  color: var(--amber);
  border-color: rgba(245, 158, 11, 0.5);
  background: var(--amber-soft);
}
.cal-viewtab.has-pending.is-active { color: #fcd34d; }
.approval-count {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  color: #0b0d12;
  background: var(--amber);
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

.queue-empty { text-align: center; padding: 40px 0; font-size: 14px; }
.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.queue-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.queue-card:hover { border-color: var(--gray); }
.queue-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.queue-who { font-size: 12px; font-weight: 700; color: var(--text-dim); }
.queue-when {
  font-size: 11.5px;
  color: var(--text-faint);
  font-family: var(--mono);
  margin-left: auto;
}
.queue-title { margin: 2px 0 0; font-size: 14.5px; letter-spacing: -0.01em; }
.queue-caption {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  max-height: 8.5em;
  overflow: auto;
}
.queue-photo { margin: 0; font-size: 12px; color: var(--text-faint); }
.queue-photo code { font-family: var(--mono); color: var(--text-dim); }
.queue-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  line-height: 1.45;
}
.queue-note strong { color: #fcd34d; }
.queue-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- Approve / Request-changes buttons (queue + drawer) ---------- */
.btn-approve {
  padding: 8px 14px;
  background: var(--green-soft);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-approve:hover { background: rgba(34, 197, 94, 0.22); color: #bbf7d0; }
.btn-approve:disabled { opacity: 0.6; cursor: default; }
.btn-request {
  padding: 8px 14px;
  background: var(--amber-soft);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-request:hover { background: rgba(245, 158, 11, 0.22); color: #fde68a; }

/* ---------- Status badge (drawer header + queue) ---------- */
.status-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.status-badge.status-draft            { color: var(--text-dim); background: var(--gray-soft); }
.status-badge.status-pending_approval { color: var(--amber); background: var(--amber-soft); border-color: rgba(245, 158, 11, 0.4); }
.status-badge.status-approved         { color: var(--green); background: var(--green-soft); border-color: rgba(34, 197, 94, 0.4); }
.status-badge.status-needs_changes    { color: #fb7185; background: var(--red-soft); border-color: rgba(239, 68, 68, 0.4); }
.status-badge.status-posted           { color: var(--accent-hi); background: var(--accent-soft); border-color: rgba(79, 70, 229, 0.4); }

/* ---------- Drawer: approval bar + request box + prior feedback ---------- */
.drawer-head-titles { display: flex; align-items: center; gap: 10px; min-width: 0; }
.approve-bar {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-card);
}
.approve-bar .btn-approve, .approve-bar .btn-request { flex: 1; }
.request-box {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.request-actions { display: flex; justify-content: flex-end; gap: 8px; }
.review-note-display {
  margin: 14px 20px 0;
  padding: 10px 13px;
  background: var(--amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
}
.rn-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fcd34d;
}
.rn-text { margin: 4px 0 0; font-size: 13px; color: var(--text-dim); line-height: 1.45; }

@media (max-width: 600px) {
  .queue-grid { grid-template-columns: 1fr; }
}

/* ---------- Post drawer (slide-in editor + add form) ---------- */
.drawer-overlay { position: fixed; inset: 0; z-index: 50; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); }
.drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(460px, 92vw);
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  animation: drawer-in 0.18s ease;
}
@keyframes drawer-in { from { transform: translateX(20px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; background: var(--bg-elev); z-index: 1;
}
.drawer-head h3 { margin: 0; font-size: 16px; letter-spacing: -0.01em; }
.drawer-close { padding: 5px 10px; }
.drawer-form { padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.field-row { display: flex; flex-direction: column; gap: 5px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.drawer-form textarea.text-input { resize: vertical; line-height: 1.5; font-size: 14px; }
.drawer-form select.text-input { cursor: pointer; }
.drawer-msg { margin: 0; font-size: 13px; min-height: 1px; }
.drawer-msg.is-error { color: var(--red); }
.drawer-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.drawer-spacer { flex: 1; }
.btn-danger {
  padding: 9px 14px;
  background: var(--red-soft);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.22); color: #fecaca; }
body.drawer-open { overflow: hidden; }
@media (max-width: 460px) {
  .field-grid { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.app-foot { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.app-foot p { margin: 0; color: var(--text-faint); font-size: 12.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .kanban { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
  .session { width: 100%; justify-content: space-between; }
}
