/* Outreach CRM — one stylesheet. Part of the hyper suite (see CLAUDE.md).
 *
 * Two token layers:
 *   SUITE — identical in every suite app (this CRM, hyper-buzz Content CMS).
 *           Change them in all apps or none.
 *   APP   — this app's identity: its accent and its domain colours.
 */

:root {
  /* ---- SUITE: neutrals, shape, type (keep in sync across apps) ---- */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --ink: #0f172a;            /* primary actions */
  --ink-hover: #1e293b;
  --green: #047857;
  --green-soft: #ecfdf5;
  --green-line: #a7f3d0;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --amber-line: #fde68a;
  --red: #be123c;
  --red-soft: #fff1f2;
  --red-line: #fecdd3;
  --blue: #0369a1;
  --blue-soft: #f0f9ff;
  --blue-line: #bae6fd;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 24px -12px rgba(15, 23, 42, 0.25);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sidebar: 248px;

  /* ---- APP: Outreach CRM identity (slate) ---- */
  --accent: #0f172a;         /* brand mark, active nav, counters, focus */
  --accent-hover: #1e293b;
  --accent-soft: #eef2f7;
  --accent-line: #cbd5e1;
  --chart-1: #2a78d6;
  --chart-track: #eef2f7;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

/* ---------- layout ---------- */

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 14px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.04em;
}

.brand-name {
  display: block;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand-sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

/* Venture switcher: which of your businesses the whole app is showing. */
.venture-switch {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.venture-switch .select {
  width: 100%;
  font-weight: 600;
}

.venture-links {
  align-items: center;
  gap: 6px;
}

.venture-links .nav-label {
  padding: 0 4px 0 0;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-label {
  padding: 8px 10px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 120ms ease, color 120ms ease;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-link.is-active {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}

.nav-link .icon {
  color: var(--muted);
}

.nav-link.is-active .icon {
  color: var(--text);
}

.nav-count {
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
  line-height: 18px;
}

.nav-count.is-quiet {
  background: #e2e8f0;
  color: var(--text-2);
}

.suite {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
}

.suite-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

.suite-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.suite-link.is-current {
  color: var(--text);
  font-weight: 600;
}

.suite-mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.suite-link.is-current .suite-mark {
  background: var(--accent);
  color: #fff;
}

.suite + .sidebar-foot {
  margin-top: 0;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 10px 2px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--faint);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 32px;
  background: rgba(248, 250, 252, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-title h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar-sub {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.content {
  padding: 26px 32px 56px;
  max-width: 1440px;
  width: 100%;
}

/* ---------- icons ---------- */

.icon {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 14px;
  height: 14px;
}

.icon-lg {
  width: 20px;
  height: 20px;
}

/* ---------- cards & panels ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.card-head h2,
.card-head h3 {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.card-head .count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 7px;
  line-height: 18px;
}

.card-body {
  padding: 16px 18px;
}

.card-body.is-flush {
  padding: 0;
}

.card-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-head h2 {
  font-size: 13px;
  font-weight: 650;
}

.panel-head .count {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.panel-body {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease,
    transform 80ms ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  background: var(--ink-hover);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

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

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border-color: var(--red-line);
}

.btn-danger:hover {
  background: #ffe4e6;
}

.btn-sm {
  padding: 4px 9px;
  font-size: 12px;
  border-radius: 7px;
}

.btn-xs {
  padding: 3px 7px;
  font-size: 11.5px;
  border-radius: 6px;
}

.btn-icon {
  padding: 7px;
  border-radius: 7px;
}

.btn-group {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* ---------- badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 19px;
  white-space: nowrap;
  background: #f1f5f9;
  color: #475569;
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.14);
}

.badge-emerald {
  background: var(--green-soft);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.2);
}

.badge-amber {
  background: var(--amber-soft);
  color: var(--amber);
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.22);
}

.badge-rose {
  background: var(--red-soft);
  color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.18);
}

.badge-sky {
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(2, 132, 199, 0.18);
}

.badge-violet {
  background: #f5f3ff;
  color: #6d28d9;
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.18);
}

.badge-slate {
  background: #f8fafc;
  color: #475569;
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.16);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 550;
  color: var(--muted);
  line-height: 18px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- stat cards ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
}

.stat-pair {
  display: flex;
  gap: 20px;
}

.stat-pair-link {
  padding-left: 20px;
  border-left: 1px solid var(--border);
}

.stat-pair-link:hover .stat-value {
  text-decoration: underline;
  text-underline-offset: 3px;
}

#overdue {
  scroll-margin-top: 96px; /* clears the sticky topbar */
}

.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.stat-value {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-meta {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- your week (Today) ---------- */

.week {
  margin-bottom: 20px;
}

.week-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: stretch;
}

.week-hero {
  margin-top: 2px;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.week-goal-of {
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
}

.goal-track {
  height: 8px;
  margin-top: 10px;
  border-radius: 4px;
  background: var(--chart-track);
  overflow: hidden;
}

.goal-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--chart-1);
}

.week-facts {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.week-facts dt {
  font-size: 11.5px;
  color: var(--muted);
}

.week-facts dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.chart {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bars {
  position: relative;
  flex: 1;
  display: flex;
  align-items: stretch;
  gap: 2px;
  min-height: 170px;
  margin-top: 8px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  border-radius: 6px;
  outline: none;
  cursor: default;
}

.bar-col:hover,
.bar-col:focus-visible {
  background: var(--surface-2);
}

.bar-value {
  height: 18px;
  line-height: 18px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-top: 18px;
  border-bottom: 1px solid var(--border-strong);
}

.bar {
  flex: none;
  width: min(28px, 70%);
  border-radius: 4px 4px 0 0;
  background: var(--chart-1);
}

.bar-label {
  height: 22px;
  padding-top: 4px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.bar-col.is-today .bar-label {
  color: var(--text);
  font-weight: 650;
}

.bar-col.is-future .bar-label {
  color: var(--faint);
}

.goal-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--muted);
  pointer-events: none;
  z-index: 1;
}

.goal-line span {
  position: absolute;
  right: 0;
  top: -16px;
  padding: 0 4px;
  font-size: 10.5px;
  color: var(--muted);
  background: var(--surface);
}

.chart-tip {
  position: fixed;
  z-index: 50;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--text);
  color: #fff;
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 8px));
}

/* ---------- grid ---------- */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.split-7-5 {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 16px;
  align-items: start;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wrap {
  flex-wrap: wrap;
}

.spacer {
  margin-left: auto;
}

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto;
}

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  padding: 9px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: #fbfcfe;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: #fbfcfd;
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table .strong {
  font-weight: 600;
  color: var(--text);
}

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

.table a.link {
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid transparent;
}

.table a.link:hover {
  border-color: var(--border-strong);
}

.cell-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cell-sub {
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- forms ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label,
.label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}

.textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.55;
}

.input-sm,
.select-sm {
  padding: 5px 8px;
  font-size: 12.5px;
}

.select-sm {
  width: auto;
  padding-right: 26px;
}

.product-row + .product-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.product-row .input-sm {
  width: 100%;
}

.help {
  font-size: 11.5px;
  color: var(--muted);
}

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

.form-grid .span-2 {
  grid-column: span 2;
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filters .input,
.filters .select {
  width: auto;
  min-width: 150px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search .icon {
  position: absolute;
  left: 9px;
  color: var(--faint);
}

.search .input {
  padding-left: 30px;
  min-width: 240px;
}

/* ---------- task rows ---------- */

.task-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-row:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.task-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-who {
  font-weight: 620;
  font-size: 13px;
}

.task-sub {
  font-size: 11.5px;
  color: var(--muted);
}

.task-message {
  position: relative;
  border-left: 2px solid #e2e8f0;
  padding: 2px 0 2px 10px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-message.is-clamped {
  max-height: 120px;
  overflow: hidden;
}

.kv-wide dt {
  width: 136px;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.task-actions .spacer {
  margin-left: auto;
}

.task-done {
  opacity: 0.55;
}

.task-done .task-who {
  text-decoration: line-through;
}

/* ---------- calendar ---------- */

.cal-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.cal-title {
  min-width: 150px;
  text-align: center;
  font-size: 16px;
  font-weight: 650;
}

.cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: 1px;
  overflow: hidden;
}

.cal-head {
  background: var(--surface-2);
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cal-day {
  background: var(--surface);
  min-height: 118px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.cal-day.is-weekend {
  background: var(--surface-2);
}

.cal-day.is-out {
  background: #f1f5f9;
}

.cal-day.is-out .cal-date,
.cal-day.is-out .cal-task {
  opacity: 0.55;
}

.cal-day.is-selected {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.cal-day.is-drop-target {
  background: #e8eef6;
  outline: 2px dashed #94a3b8;
  outline-offset: -4px;
}

.cal-date {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
}

.cal-date:hover {
  background: var(--surface-2);
}

.cal-day.is-today .cal-date > span:first-child {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}

.cal-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.cal-day.is-overdue .cal-count {
  color: #be123c;
}

.cal-task {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-decoration: none;
  cursor: grab;
  min-width: 0;
}

.cal-task:hover {
  border-color: var(--border-strong);
}

.cal-day.is-overdue .cal-task {
  background: #fff1f2;
  border-color: rgba(225, 29, 72, 0.18);
}

.cal-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--faint);
}

.dot-email {
  background: #0284c7;
}

.dot-linkedin_connect,
.dot-linkedin_message {
  background: #7c3aed;
}

.dot-whatsapp {
  background: #059669;
}

.dot-call {
  background: #d97706;
}

.cal-more {
  font-size: 11.5px;
  color: var(--muted);
  padding: 0 6px;
}

@media (max-width: 860px) {
  .cal-head {
    padding: 6px 4px;
    font-size: 10.5px;
    text-align: center;
  }
  .cal-day {
    min-height: 88px;
    padding: 3px;
  }
  .cal-task {
    gap: 4px;
    padding: 2px 4px;
    font-size: 11px;
  }
}

@media (max-width: 520px) {
  .cal-task .truncate {
    display: none;
  }
  .cal-task {
    justify-content: center;
    padding: 4px;
  }
}

/* ---------- kanban ---------- */

.kanban {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  align-items: flex-start;
}

.kanban-col {
  flex: 1 1 250px;
  width: auto;
  min-height: 170px;
  max-width: 360px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 210px);
}

.kanban-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 650;
  border-bottom: 1px solid var(--border);
}

.kanban-col-head .count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 7px;
  line-height: 18px;
}

.kanban-cards {
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 48px;
}

.kanban-cards.is-drop-target {
  background: #e8eef6;
  outline: 2px dashed #94a3b8;
  outline-offset: -5px;
  border-radius: 9px;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 10px;
  box-shadow: var(--shadow-xs);
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kanban-card:hover {
  border-color: var(--border-strong);
}

.kanban-card {
  position: relative;
}

.kanban-card .k-open {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--muted);
}

.kanban-card .k-open:hover {
  color: var(--text);
}

.kanban-card .k-cancel {
  position: absolute;
  top: 5px;
  right: 31px;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--muted);
  opacity: 0;
}

.kanban-card:hover .k-cancel,
.kanban-card .k-cancel:focus-visible {
  opacity: 1;
}

.kanban-card .k-cancel:hover {
  color: var(--text);
}

.kanban-card .k-title {
  padding-right: 52px;
}

.kanban-card.is-dragging {
  opacity: 0.45;
}

.kanban-card .k-title {
  font-size: 12.5px;
  font-weight: 600;
}

.kanban-card .k-sub {
  font-size: 11px;
  color: var(--muted);
}

.kanban-card .badge {
  align-self: flex-start;
}

.kanban-card .k-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- timeline ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.timeline li {
  position: relative;
  padding: 0 0 14px 22px;
  border-left: 1px solid var(--border);
  margin-left: 5px;
}

.timeline li:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -4.5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--border-strong);
}

.timeline li.is-in::before {
  border-color: #0284c7;
  background: #e0f2fe;
}

.timeline li.is-out::before {
  border-color: #059669;
  background: #d1fae5;
}

.timeline .t-title {
  font-size: 12.5px;
  font-weight: 600;
}

.timeline .t-meta {
  font-size: 11px;
  color: var(--muted);
}

.timeline .t-body {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-2);
  white-space: pre-wrap;
}

/* ---------- provenance ---------- */

.prov {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.prov-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  border: 1px solid #94a3b8;
  cursor: help;
}

.prov-dot.is-manual {
  background: #fff;
  border-color: #64748b;
}

.prov-tip {
  display: none;
}

.kv {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
}

.kv:last-child {
  border-bottom: 0;
}

.kv dt {
  width: 104px;
  flex: none;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.kv dd {
  margin: 0;
  min-width: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* ---------- misc ---------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

.empty .icon {
  width: 22px;
  height: 22px;
  color: var(--faint);
}

.empty-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

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

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

.mono {
  font-family: var(--mono);
  font-size: 11.5px;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.small {
  font-size: 12px;
}

.xs {
  font-size: 11px;
}

.right {
  text-align: right;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: 380px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

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

.toast.is-error {
  background: #be123c;
}

/* ---------- dialog ---------- */

dialog.modal {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 30px 60px -24px rgba(15, 23, 42, 0.35);
}

dialog.modal::backdrop {
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  font-size: 15px;
  font-weight: 650;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  background: #fbfcfe;
  border-radius: 0 0 14px 14px;
}

.modal-close {
  margin-left: auto;
}

dialog.ask-text {
  width: min(440px, calc(100vw - 32px));
}

/* ---------- steps editor ---------- */

.step-row {
  display: grid;
  grid-template-columns: 26px 1.3fr 0.7fr 1.6fr 92px 30px;
  gap: 8px;
  align-items: end;
  padding: 9px 0;
  border-bottom: 1px solid #f1f5f9;
}

.step-no {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 5px;
}

.step-row .field label {
  font-size: 10.5px;
}

/* ---------- checkbox table ---------- */

.row-check {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 12.5px;
}

.bulk-bar .select {
  width: auto;
  min-width: 190px;
}

/* ---------- projects ---------- */

.pm-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.pm-progress .goal-track {
  flex: 1 1 auto;
  margin-top: 0;
  height: 6px;
}

.pm-progress .xs {
  flex: none;
  font-variant-numeric: tabular-nums;
}

.pm-hours {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pm-hours.is-over,
.pm-late {
  color: var(--red);
}

.pm-status-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.pm-status-cell {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.pm-status-cell:hover {
  border-color: var(--border-strong);
}

.pm-status-n {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pm-board-head {
  margin-bottom: 14px;
}

.pm-board-facts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.pm-board-facts .pm-progress {
  flex: 0 1 280px;
}

.kanban-card .pm-card-status {
  margin-top: 4px;
  width: 100%;
}

.pm-description {
  white-space: pre-wrap;
}

@media (max-width: 520px) {
  .pm-status-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .week-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid-3,
  .split-7-5 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 14px;
    gap: 6px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .brand {
    border-bottom: 0;
    padding: 0 10px 0 0;
  }
  .nav-group {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .venture-switch .select {
    width: auto;
    max-width: 180px;
  }
  .nav-label,
  .sidebar-foot {
    display: none;
  }
  .suite {
    flex-direction: row;
    margin: 0 0 0 auto;
  }
  .suite-link {
    padding: 4px;
  }
  .suite-link > span:last-child {
    display: none;
  }
  .nav-link {
    padding: 6px 9px;
    font-size: 12.5px;
  }
  .topbar {
    padding: 14px 18px;
    flex-wrap: wrap;
  }
  .content {
    padding: 18px 18px 40px;
  }
  .grid-2,
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-grid .span-2 {
    grid-column: span 1;
  }
}

.pager {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

/* ---------- sign-in (SUITE: identical in every app) ---------- */

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-md);
}

.auth-brand {
  margin-bottom: 22px;
  pointer-events: none;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form .field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.auth-submit {
  justify-content: center;
  width: 100%;
}

.auth-error {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--red-line);
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: var(--red);
  font-size: 12.5px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.sidebar-user-name {
  overflow: hidden;
  font-weight: 600;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-foot > span {
  display: block;
}

@media (max-width: 860px) {
  /* The foot is hidden in the wrapped top bar; keep Sign out reachable. */
  .sidebar-foot:has(.sidebar-user) {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .sidebar-foot > span,
  .sidebar-user-name {
    display: none;
  }
  .sidebar-user {
    margin: 0;
  }
}
