/* ---------- Reset & base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13.5px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
svg { display: block; flex: none; width: 16px; height: 16px; }
::selection { background: var(--gold-100); }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--brand);
  color: #eef4f2;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 17px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-700); font-weight: 800; font-size: 13px; font-family: var(--font-mono);
}
.pulse-mark-frame {
  width: 34px; height: 34px; display: block; overflow: hidden; flex: none;
  border-radius: 8px; background: #0b2724;
}
.pulse-mark-frame img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.65); }
.sidebar-mark { width: 29px; height: 29px; border-radius: 7px; background: rgba(255,255,255,0.08); }
.sidebar-brand .name { font-weight: 700; font-size: 15px; letter-spacing: 0.2px; color: #fff; }
.sidebar-brand .sub { font-size: 10px; color: rgba(255,255,255,0.5); margin-top: 1px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.nav-group { margin-bottom: 14px; }
.nav-group-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.09em;
  color: rgba(255,255,255,0.38); padding: 6px 10px 4px;
  font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.82); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}
.nav-item svg { width: 16px; height: 16px; opacity: 0.85; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(255,255,255,0.12); color: #fff; }
.nav-item.active svg { color: var(--gold); opacity: 1; }
.nav-item .count {
  margin-left: auto; font-size: 10.5px; font-family: var(--font-mono);
  color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.08);
  padding: 1px 6px; border-radius: 10px;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 10px;
  display: flex; align-items: center; gap: 9px;
}
.sidebar-footer .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold-100); color: var(--brand-700);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11.5px; flex: none;
}
.sidebar-footer .who { min-width: 0; flex: 1; }
.sidebar-footer .who .n { font-size: 12.5px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .who .w { font-size: 10.5px; color: rgba(255,255,255,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Main column ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar .page-title { font-size: 15px; font-weight: 700; color: var(--text); white-space: nowrap; }
.topbar .search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 10px; color: var(--text-faint);
  position: relative;            /* anchors the search results dropdown */
}
.topbar .search svg { width: 14px; height: 14px; }
.topbar .search input {
  border: none; background: transparent; outline: none; color: var(--text);
  font-size: 12.5px; width: 100%;
}
.topbar .search kbd {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px;
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent;
  color: var(--text-dim); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .dot {
  position: absolute; top: 5px; right: 6px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--danger); border: 1.5px solid var(--surface);
}
.workspace-pill {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px;
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--text-dim); background: var(--surface-2);
}
.workspace-pill .sq { width: 16px; height: 16px; border-radius: 4px; background: var(--brand); }

.content { flex: 1; padding: 22px 26px 60px; max-width: 1440px; width: 100%; margin: 0 auto; }
.content.wide { max-width: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; gap: 16px; }
.page-head h1 { font-size: 19px; font-weight: 700; margin: 0 0 3px; letter-spacing: -0.2px; }
.page-head .desc { color: var(--text-dim); font-size: 12.5px; }
.page-head-actions { display: flex; gap: 8px; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 7px 13px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}
.btn svg { width: 14px; height: 14px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-gold { background: var(--gold); color: var(--brand-700); }
.btn-gold:hover { background: var(--gold-600); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { opacity: 0.85; }
.btn-sm { padding: 5px 10px; font-size: 11.5px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-icon-only { padding: 7px; }

/* ---------- Inputs & selects ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11.5px; font-weight: 600; color: var(--text-dim); }
.input, .select, textarea.input {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 7px 10px; font-size: 12.5px; background: var(--surface); color: var(--text);
  outline: none; width: 100%; font-family: inherit;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235b6870' stroke-width='1.4' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

/* ---------- Filter bar ---------- */
.filterbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filterbar .input, .filterbar .select { width: auto; min-width: 140px; }
.filterbar .search-input { position: relative; }
.filterbar .search-input svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 13px; height: 13px; color: var(--text-faint); }
.filterbar .search-input input { padding-left: 28px; min-width: 220px; }
.filterbar-spacer { flex: 1; }
.chip-filter {
  display: flex; align-items: center; gap: 5px; padding: 5px 10px;
  border: 1px solid var(--border); border-radius: 20px; font-size: 12px; color: var(--text-dim);
  cursor: pointer; background: var(--surface);
}
.chip-filter.active { background: var(--brand-50); border-color: var(--link); color: var(--link); font-weight: 600; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.card-tight { padding: 12px 14px; }
.card-row { display: flex; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
  color: var(--text-faint); margin: 0 0 10px;
}
.metric-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.metric-label { font-size: 11px; color: var(--text-faint); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.metric-value { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.metric-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }

/* ---------- KPI grid ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 22px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.kpi .label { font-size: 11px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.kpi .value { font-size: 23px; font-weight: 800; letter-spacing: -0.3px; color: var(--text); }
.kpi .value.gold { color: var(--gold-600); }
.kpi .delta { font-size: 11px; margin-top: 4px; color: var(--text-faint); }
.kpi .delta.up { color: var(--success); }
.kpi .delta.down { color: var(--danger); }

/* ---------- Badges & status pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 20px; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em; white-space: nowrap;
}
.badge-neutral { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-gold { background: var(--gold-50); color: var(--gold-600); }
.badge-brand { background: var(--brand-50); color: var(--link); }

.tier-tag { font-family: var(--font-mono); font-weight: 800; font-size: 11px; padding: 1px 7px; border-radius: 5px; }
.tier-S { background: var(--gold-50); color: var(--gold-600); }
.tier-A { background: var(--success-bg); color: var(--success); }
.tier-B { background: var(--info-bg); color: var(--info); }
.tier-C { background: var(--surface-2); color: var(--text-faint); }

/* ---------- Tables ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table thead th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-faint); font-weight: 700; padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap; cursor: default;
  user-select: none;
}
.data-table thead th.sortable { cursor: pointer; }
.data-table thead th.sortable:hover { color: var(--text); }
.data-table thead th .arrow { font-size: 9px; margin-left: 3px; color: var(--brand); }
.data-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.clickable:hover { background: var(--surface-2); }
.data-table tbody tr.selected { background: var(--brand-50); }
.data-table .cell-primary { font-weight: 600; color: var(--text); }
.data-table .cell-dim { color: var(--text-faint); font-size: 11.5px; }
.data-table .cell-mono { font-family: var(--font-mono); }
.data-table th.checkbox-col, .data-table td.checkbox-col { width: 32px; }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-dim); }
.pagination-btns { display: flex; gap: 4px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
  padding: 9px 14px; font-size: 12.5px; font-weight: 600; color: var(--text-faint);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--link); border-bottom-color: var(--link); }

/* ---------- Empty / loading / error states ---------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 48px 24px; color: var(--text-faint);
}
.empty-state .icon { width: 40px; height: 40px; color: var(--border-strong); margin-bottom: 12px; }
.empty-state .title { font-size: 13.5px; font-weight: 700; color: var(--text-dim); margin-bottom: 4px; }
.empty-state .hint { font-size: 12px; max-width: 340px; }
.empty-state .btn { margin-top: 14px; }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skel-row { height: 14px; margin: 8px 0; }
.skel-line { height: 11px; margin: 6px 0; border-radius: 4px; }

.error-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 20px; color: var(--danger); }
.error-state .title { font-weight: 700; margin-bottom: 4px; }
.error-state .hint { color: var(--text-dim); font-size: 12px; }

/* ---------- Priority / activity cards ---------- */
.priority-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.priority-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; border-left: 3px solid var(--border); }
.priority-card.high { border-left-color: var(--gold); }
.priority-card .top-row { display: flex; align-items: center; justify-content: space-between; }
.priority-card .co-name { font-weight: 700; font-size: 13px; }
.priority-card .desc { font-size: 12px; color: var(--text-dim); }
.priority-card .meta { font-size: 11px; color: var(--text-faint); }
.priority-card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before { content: ''; position: absolute; left: -18px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); }
.timeline-item .t-label { font-size: 12.5px; color: var(--text); }
.timeline-item .t-meta { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* ---------- Evidence blocks ---------- */
.ev-block { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.ev-block .stmt { font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.ev-block .meta { font-size: 11px; color: var(--text-faint); }
.ev-block .src { font-size: 11px; color: var(--link); word-break: break-all; margin-top: 4px; }

/* ---------- Why Now block ---------- */
.why-now { background: var(--gold-50); border: 1px solid var(--gold-100); border-radius: var(--radius); padding: 12px 14px; }
.why-now .label { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold-600); margin-bottom: 5px; }
.why-now .text { font-size: 13px; color: var(--text); line-height: 1.5; }

/* ---------- Modals & drawers ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 16, 18, 0.4); z-index: 90; opacity: 0; pointer-events: none; transition: opacity 0.15s ease; }
.overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.97);
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  z-index: 91; width: 480px; max-width: calc(100vw - 32px); max-height: 85vh; overflow: auto;
  opacity: 0; transition: opacity 0.15s ease, transform 0.15s ease;
}
.modal.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 14.5px; font-weight: 700; margin: 0; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); }

.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 420px; max-width: 92vw;
  background: var(--surface); box-shadow: var(--shadow-lg); z-index: 91;
  transform: translateX(100%); transition: transform 0.18s ease; display: flex; flex-direction: column;
}
.drawer.show { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); flex: none; }
.drawer-body { padding: 18px; overflow-y: auto; flex: 1; }

/* ---------- Toasts ---------- */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--brand-700); color: #fff; padding: 10px 16px; border-radius: var(--radius);
  font-size: 12.5px; box-shadow: var(--shadow-md); max-width: 360px; display: flex; align-items: center; gap: 8px;
  animation: toast-in 0.18s ease;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Inbox layout ---------- */
.inbox-layout { display: grid; grid-template-columns: 300px 1fr 300px; gap: 0; height: calc(100vh - var(--topbar-h) - 44px); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.inbox-col { overflow-y: auto; }
.inbox-list-col { border-right: 1px solid var(--border); }
.inbox-context-col { border-left: 1px solid var(--border); padding: 16px; }
.inbox-thread-col { display: flex; flex-direction: column; }
.inbox-filters { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px; border-bottom: 1px solid var(--border); }
.conv-item { padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.conv-item:hover { background: var(--surface-2); }
.conv-item.active { background: var(--brand-50); }
.conv-item .row1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.conv-item .name { font-weight: 700; font-size: 12.5px; }
.conv-item .time { font-size: 10.5px; color: var(--text-faint); }
.conv-item .preview { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-head { padding: 14px 18px; border-bottom: 1px solid var(--border); flex: none; }
.thread-body { flex: 1; overflow-y: auto; padding: 18px; }
.msg-bubble { max-width: 78%; margin-bottom: 14px; }
.msg-bubble.inbound { margin-right: auto; }
.msg-bubble.outbound { margin-left: auto; }
.msg-bubble .bubble { padding: 10px 13px; border-radius: var(--radius); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; }
.msg-bubble.inbound .bubble { background: var(--surface-2); border: 1px solid var(--border); }
.msg-bubble.outbound .bubble { background: var(--brand-50); border: 1px solid var(--brand-100); }
.msg-bubble .meta { font-size: 10.5px; color: var(--text-faint); margin-top: 3px; }
.thread-composer { border-top: 1px solid var(--border); padding: 14px 18px; flex: none; }
.thread-composer textarea { min-height: 90px; resize: vertical; }
.composer-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.kanban-col { flex: none; width: 260px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 8px; }
.kanban-col-head .t { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.kanban-col-head .n { font-size: 10.5px; color: var(--text-faint); font-family: var(--font-mono); background: var(--surface-2); padding: 1px 6px; border-radius: 8px; }
.kanban-body { background: var(--surface-2); border-radius: var(--radius); padding: 8px; min-height: 60px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border); }
.deal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 11px; cursor: pointer; }
.deal-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.deal-card .co { font-weight: 700; font-size: 12px; margin-bottom: 2px; }
.deal-card .who { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }
.deal-card .foot { display: flex; justify-content: space-between; align-items: center; }

/* ---------- Misc ---------- */
.hr { height: 1px; background: var(--border); margin: 16px 0; border: none; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--font-mono); }
.flex { display: flex; align-items: center; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-14 { gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.sticky { position: sticky; top: 76px; }
.progress-bar { height: 4px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: var(--brand); }
.progress-bar.gold i { background: var(--gold); }

#mobile-nav-toggle { display: none; }
#sidebar-overlay { display: none; }

/* ---------- Stepper ---------- */
.stepper {
  display: flex; gap: 8px; list-style: none; margin: 0 0 18px; padding: 0;
  flex-wrap: wrap;
}
.stepper .step {
  display: flex; align-items: center; gap: 7px; padding: 7px 13px;
  border: 1px solid var(--border); border-radius: 20px;
  font-size: 12px; font-weight: 600; color: var(--text-faint);
  background: var(--surface);
}
.stepper .step-index {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-faint);
  font-size: 10.5px; font-weight: 700; border: 1px solid var(--border);
}
.stepper .step.active { border-color: var(--link); color: var(--link); }
.stepper .step.active .step-index { background: var(--link); color: var(--surface); border-color: var(--link); }
.stepper .step.done { color: var(--success); border-color: var(--success); }
.stepper .step.done .step-index { background: var(--success); color: var(--surface); border-color: var(--success); }

/* ---------- Upload dropzone ---------- */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: 34px 20px; text-align: center; cursor: pointer;
  background: var(--surface-2); transition: border-color 0.12s ease, background 0.12s ease;
}
.dropzone:hover, .dropzone.over { border-color: var(--link); background: var(--brand-50); }
.dropzone .dz-icon { width: 30px; height: 30px; margin: 0 auto 10px; color: var(--text-faint); }
.dropzone .dz-title { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.dropzone .dz-hint { font-size: 12px; color: var(--text-faint); }

@keyframes pulse { 0%,100% { opacity: 0.45; } 50% { opacity: 1; } }

/* ---------- Onboarding ---------- */
.onboarding { max-width: 680px; margin: 0 auto; padding-top: 8px; }
.onboarding-head { margin-bottom: 20px; }
.onboarding-head h1 { font-size: 22px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.3px; }
.onboarding-head p { font-size: 13px; color: var(--text-dim); margin: 0; line-height: 1.55; }
.onboarding-skip { text-align: center; margin-top: 16px; font-size: 12.5px; }

/* ---------- Global search results ---------- */
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  max-height: 340px; overflow-y: auto; padding: 4px;
}
.search-result {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; color: inherit;
}
.search-result:hover, .search-result.active { background: var(--surface-2); text-decoration: none; }
.search-result .r-title { font-size: 12.5px; font-weight: 600; }
.search-result .r-sub { font-size: 11px; color: var(--text-faint); }
.search-empty { padding: 14px; text-align: center; font-size: 12px; color: var(--text-faint); }

/* ---------- Public product surface ---------- */
.public-site {
  --public-bg: #08110f; --public-surface: #0d1917; --public-line: #1c302d;
  --public-text: #f1f4f2; --public-dim: #a5b2ae;
  min-height: 100dvh; background: var(--public-bg); color: var(--public-text);
}
.public-site .public-reveal { animation: none !important; }
.public-site button { color: inherit; }
.public-nav {
  height: 74px; max-width: 1240px; margin: 0 auto; padding: 0 30px;
  display: flex; align-items: center; gap: 40px; border-bottom: 1px solid var(--public-line);
}
.public-brand { color: inherit; text-decoration: none; }
.public-brand:hover { text-decoration: none; }
.pulse-lockup { display: flex; align-items: center; gap: 11px; }
.pulse-lockup > span:last-child { display: flex; flex-direction: column; }
.pulse-lockup strong { color: #fff; font-size: 15px; letter-spacing: 0.12em; line-height: 1.2; }
.pulse-lockup small { color: #71827d; font-size: 9px; letter-spacing: 0.08em; margin-top: 2px; }
.public-links { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.public-links button, .public-footer button {
  border: 0; background: transparent; padding: 7px 0; cursor: pointer;
  color: var(--public-dim); font-size: 12px;
}
.public-links button:hover, .public-footer button:hover { color: #fff; }
.public-actions { display: flex; align-items: center; gap: 8px; }
.public-signin, .public-secondary { background: transparent; border-color: #304440; color: #e9efec; }
.public-primary {
  background: var(--gold); border: 1px solid var(--gold); color: #09201d !important;
  font-weight: 700; box-shadow: none;
}
.public-primary:hover { background: #d5b15d; border-color: #d5b15d; }
.public-hero {
  min-height: 650px; max-width: 1240px; margin: 0 auto; padding: 88px 30px 92px;
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(370px, 0.88fr);
  align-items: center; gap: 92px;
}
.public-eyebrow {
  margin: 0 0 17px; color: var(--gold); font: 600 10.5px/1.3 var(--font);
  letter-spacing: 0.16em; text-transform: uppercase;
}
.hero-copy h1 {
  max-width: 670px; margin: 0; font-size: clamp(46px, 5.2vw, 72px); line-height: 0.99;
  letter-spacing: -0.055em; font-weight: 720;
}
.hero-lede { max-width: 610px; margin: 25px 0 0; color: var(--public-dim); font-size: 18px; line-height: 1.6; }
.hero-actions { display: flex; gap: 10px; margin-top: 32px; }
.public-cta { min-height: 44px; padding: 10px 18px; }
.hero-note { margin: 15px 0 0; color: #70817c; font-size: 11.5px; }
.hero-system {
  position: relative; background: var(--public-surface); border: 1px solid var(--public-line);
  padding: 24px; min-height: 430px; overflow: hidden;
}
.hero-system::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  border-left: 3px solid var(--gold); opacity: 0.75;
}
.hero-mark { position: absolute; width: 265px; height: 265px; overflow: hidden; right: -42px; top: -70px; opacity: 0.12; }
.hero-mark img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.65); }
.system-head { position: relative; z-index: 1; display: flex; justify-content: space-between; color: #81918c; font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; }
.system-status { color: #77b29f; }
.flow-list { position: relative; z-index: 1; list-style: none; margin: 72px 0 0; padding: 0; }
.flow-list li { display: grid; grid-template-columns: 35px 1fr auto; align-items: baseline; gap: 10px; padding: 17px 2px; border-bottom: 1px solid var(--public-line); }
.flow-list li > span { color: var(--gold); font: 10px var(--font-mono); }
.flow-list strong { font-size: 14px; font-weight: 600; }
.flow-list small { color: #73837e; font-size: 10.5px; }
.public-flow, .public-platform, .public-trust, .public-final, .public-footer { max-width: 1180px; margin: 0 auto; }
.public-flow { padding: 92px 0 100px; border-top: 1px solid var(--public-line); }
.section-intro { display: grid; grid-template-columns: 0.65fr 1.25fr 0.8fr; gap: 38px; align-items: start; }
.section-intro h2, .public-platform h2, .public-trust h2, .public-final h2 { margin: 0; font-size: clamp(28px, 3vw, 44px); line-height: 1.1; letter-spacing: -0.035em; }
.section-intro > p:last-child, .platform-statement > p:last-child { color: var(--public-dim); margin: 2px 0 0; line-height: 1.65; }
.flow-rail { display: grid; grid-template-columns: repeat(6, 1fr); margin-top: 54px; border: 1px solid var(--public-line); }
.flow-step { min-height: 114px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--public-line); }
.flow-step:last-child { border-right: 0; }
.flow-step span { color: #647570; font: 10px var(--font-mono); }
.flow-step strong { font-size: 12px; }
.public-platform { padding: 110px 0; display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 100px; border-top: 1px solid var(--public-line); }
.platform-detail article { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 27px 0; border-top: 1px solid var(--public-line); }
.platform-detail article:last-child { border-bottom: 1px solid var(--public-line); }
.platform-detail .why-now-panel { border-top-color: var(--gold); }
.detail-index { color: var(--gold); font: 10px var(--font-mono); padding-top: 4px; }
.platform-detail h3 { margin: 0 0 7px; font-size: 16px; }
.platform-detail p { margin: 0; color: var(--public-dim); font-size: 12.5px; line-height: 1.6; }
.public-trust { padding: 100px 0; display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 100px; border-top: 1px solid var(--public-line); }
.public-trust ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--public-line); border-left: 1px solid var(--public-line); }
.public-trust li { min-height: 130px; padding: 21px; border-right: 1px solid var(--public-line); border-bottom: 1px solid var(--public-line); display: flex; flex-direction: column; gap: 8px; }
.public-trust li strong { font-size: 12.5px; }
.public-trust li span { color: var(--public-dim); font-size: 11.5px; line-height: 1.55; }
.public-final { padding: 72px; background: #0d211e; border: 1px solid #25403b; display: flex; align-items: end; justify-content: space-between; gap: 50px; }
.public-final h2 { max-width: 710px; }
.public-footer { min-height: 160px; display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 35px; color: #71817c; font-size: 11px; }
.public-footer p { margin: 0; text-align: center; }
.footer-lockup small { color: #596a65; }
.public-auth-layer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; }
.public-auth-backdrop { position: absolute; inset: 0; background: rgba(3, 9, 8, 0.82); backdrop-filter: blur(7px); }
.auth-card {
  position: relative; z-index: 1; width: 100%; max-width: 420px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px 30px 24px; box-shadow: var(--shadow-md);
}
.auth-close { position: absolute; right: 14px; top: 12px; border: 0; background: transparent; color: var(--text-dim); cursor: pointer; font-size: 24px; line-height: 1; }
.auth-brand { margin-bottom: 24px; }
.auth-card .pulse-lockup strong { color: var(--text); }
.auth-card .pulse-lockup small { color: var(--text-faint); }
.auth-title { font-size: 19px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.2px; }
.auth-subtitle { font-size: 12.5px; color: var(--text-dim); margin: 0 0 20px; line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-submit { width: 100%; padding: 9px 13px; margin-top: 4px; }
.auth-switch {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-dim); text-align: center;
}
.linklike {
  background: none; border: none; padding: 0; color: var(--link);
  font-weight: 600; font-size: inherit; cursor: pointer; text-decoration: underline;
}
.linklike:hover { opacity: 0.8; }
.form-error {
  background: var(--danger-bg); color: var(--danger); border-radius: var(--radius-sm);
  padding: 9px 11px; font-size: 12.5px; font-weight: 500;
}
.field-error { color: var(--danger); font-size: 11.5px; }
.public-site button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .public-reveal { animation: public-enter 0.6s ease both; }
  .hero-system.public-reveal { animation-delay: 0.12s; }
  @keyframes public-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}
/* Visible keyboard focus on every interactive control. */
.input:focus-visible, .select:focus-visible, .btn:focus-visible, .linklike:focus-visible,
.nav-item:focus-visible, .tab:focus-visible, .chip-filter:focus-visible,
.icon-btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .public-hero { gap: 45px; }
  .public-flow, .public-platform, .public-trust, .public-final, .public-footer { margin-left: 30px; margin-right: 30px; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .inbox-layout { grid-template-columns: 240px 1fr; }
  .inbox-context-col { display: none; }
}
@media (max-width: 860px) {
  .public-links { display: none; }
  .public-nav { padding: 0 20px; }
  .public-actions { margin-left: auto; }
  .public-hero { grid-template-columns: 1fr; padding: 70px 30px; }
  .hero-system { min-height: 390px; }
  .section-intro, .public-platform, .public-trust { grid-template-columns: 1fr; gap: 45px; }
  .flow-rail { grid-template-columns: repeat(3, 1fr); }
  .flow-step:nth-child(3) { border-right: 0; }
  .flow-step:nth-child(-n+3) { border-bottom: 1px solid var(--public-line); }
  .public-final { align-items: flex-start; flex-direction: column; padding: 48px; }
  :root { --sidebar-w: 200px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar .search { display: none; }
}
@media (max-width: 680px) {
  .public-nav { height: 66px; }
  .public-nav .pulse-lockup small, .public-signin { display: none; }
  .public-hero { padding: 54px 20px 64px; gap: 52px; }
  .hero-copy h1 { font-size: 44px; }
  .hero-lede { font-size: 15px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-system { min-height: 370px; padding: 20px; }
  .flow-list li { grid-template-columns: 30px 1fr; }
  .flow-list small { grid-column: 2; }
  .public-flow, .public-platform, .public-trust, .public-final, .public-footer { margin-left: 20px; margin-right: 20px; }
  .public-flow, .public-platform, .public-trust { padding: 72px 0; }
  .flow-rail { grid-template-columns: 1fr 1fr; }
  .flow-step:nth-child(2n) { border-right: 0; }
  .flow-step:nth-child(-n+4) { border-bottom: 1px solid var(--public-line); }
  .public-trust ul { grid-template-columns: 1fr; }
  .public-final { margin: 0; padding: 46px 20px; border-left: 0; border-right: 0; }
  .public-footer { min-height: 210px; grid-template-columns: 1fr; gap: 15px; align-content: center; }
  .public-footer p { text-align: left; }
  .auth-card { padding: 26px 22px 22px; }
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform 0.18s ease; }
  .sidebar.open { transform: translateX(0); }
  #mobile-nav-toggle { display: flex; }
  #sidebar-overlay { display: block; z-index: 45; }
  .content { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Human-centered visual refinement ---------- */
body {
  font-family: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  background: #f4f6f3;
}
.sidebar { background: #103f39; }
.sidebar-brand { padding: 19px 18px; }
.sidebar-nav { padding-top: 14px; }
.nav-item { min-height: 36px; padding: 8px 10px; border-radius: 7px; }
.nav-item.active { background: rgba(255,255,255,0.14); }
.topbar { height: 62px; padding: 0 26px; background: rgba(255,255,255,0.96); }
.content { padding: 28px 32px 64px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 23px; letter-spacing: -0.45px; }
.page-head .desc { margin-top: 4px; font-size: 13px; }
.btn:active { transform: translateY(1px); }
.card, .metric-card, .kpi, .priority-card, .table-wrap { box-shadow: 0 1px 2px rgba(13, 52, 47, 0.035); }
.overview-metrics {
  grid-template-columns: repeat(6, 1fr); gap: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 30px;
}
.overview-metrics .kpi { border: 0; border-right: 1px solid var(--border); border-radius: 0; padding: 18px 20px; box-shadow: none; }
.overview-metrics .kpi:last-child { border-right: 0; }
.overview-metrics .kpi .label { text-transform: none; letter-spacing: 0; font-size: 11.5px; font-weight: 600; }
.overview-metrics .kpi .value { font-size: 26px; font-variant-numeric: tabular-nums; }
.overview-section-title { color: var(--text); font-size: 13px; text-transform: none; letter-spacing: 0; margin-bottom: 12px; }
.overview-priority { display: flex; flex-direction: column; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.overview-priority .priority-card { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; border-left: 3px solid transparent; padding: 16px 18px; box-shadow: none; display: grid; grid-template-columns: minmax(170px, 0.7fr) 1.3fr auto; align-items: center; gap: 18px; }
.overview-priority .priority-card:last-child { border-bottom: 0; }
.overview-priority .priority-card.high { border-left-color: var(--gold); }
.overview-priority .priority-card .foot { min-width: 210px; gap: 14px; }
.first-run-guide { grid-template-columns: 1.15fr 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.first-run-guide .card { border: 0; border-right: 1px solid var(--border); border-radius: 0; padding: 24px; box-shadow: none; }
.first-run-guide .card:last-child { border-right: 0; }

/* Public site uses an approachable daylight palette and real human photography. */
.public-site {
  --public-bg: #f6f5ef; --public-surface: #ffffff; --public-line: #d9ddd6;
  --public-text: #19302c; --public-dim: #596a65;
  background: var(--public-bg); color: var(--public-text);
}
.public-nav { height: 76px; border-color: var(--public-line); }
.public-site .pulse-lockup strong { color: #183a35; }
.public-site .pulse-lockup small { color: #75827d; }
.public-links button, .public-footer button { color: #53645f; }
.public-links button:hover, .public-footer button:hover { color: #123f39; }
.public-signin, .public-secondary { color: #173b35 !important; border-color: #bdc7c2; background: rgba(255,255,255,0.45); }
.public-primary { background: #103f39; border-color: #103f39; color: #fff !important; }
.public-primary:hover { background: #082f2a; border-color: #082f2a; }
.public-hero {
  min-height: 670px; grid-template-columns: minmax(0, 0.92fr) minmax(430px, 1.08fr);
  padding-top: 68px; padding-bottom: 86px; gap: 74px;
}
.public-eyebrow { color: #9b7221; letter-spacing: 0.11em; }
.hero-copy h1 { max-width: 690px; font-size: clamp(43px, 4.65vw, 67px); line-height: 1.02; color: #153630; }
.hero-lede { max-width: 560px; color: #556760; font-size: 17px; }
.hero-people { position: relative; margin: 0; min-height: 510px; overflow: hidden; border-radius: 4px 42px 4px 4px; background: #dce3de; }
.hero-people img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; filter: saturate(0.78) contrast(0.96); }
.hero-people::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,43,38,0.74), transparent 45%); }
.hero-people figcaption { position: absolute; z-index: 1; left: 28px; right: 28px; bottom: 25px; display: flex; align-items: end; justify-content: space-between; gap: 28px; color: #fff; }
.hero-people figcaption strong { font-size: 17px; }
.hero-people figcaption span { max-width: 230px; text-align: right; color: rgba(255,255,255,0.78); font-size: 11.5px; }
.public-flow, .public-platform, .public-trust { border-color: var(--public-line); }
.section-intro { display: block; max-width: 720px; }
.section-intro h2, .public-platform h2, .public-trust h2, .public-final h2 { color: #173b35; }
.section-intro > p:last-child { max-width: 650px; margin-top: 18px; font-size: 14px; }
.flow-rail { border-color: var(--public-line); background: rgba(255,255,255,0.46); }
.flow-step { border-color: var(--public-line); min-height: 126px; }
.flow-step span { color: #8a7650; font-family: inherit; font-size: 10.5px; }
.flow-step strong { color: #173b35; font-size: 13px; }
.public-platform { grid-template-columns: 0.85fr 1.15fr; }
.platform-statement > p:last-child { margin-top: 20px; }
.platform-detail article { grid-template-columns: 1fr; border-color: var(--public-line); padding: 29px 0; }
.platform-detail .why-now-panel { border-top-color: #b68a34; }
.platform-detail h3 { color: #173b35; font-size: 17px; }
.platform-detail p { color: var(--public-dim); }
.public-trust ul { border-color: var(--public-line); background: rgba(255,255,255,0.46); }
.public-trust li { border-color: var(--public-line); }
.public-trust li strong { color: #173b35; }
.public-final { background: #dfe9e3; border-color: #c4d2cb; }
.public-footer { color: #687873; }
.footer-lockup small { color: #75827d; }
.public-auth-backdrop { background: rgba(18,48,43,0.55); }
.public-auth-layer .auth-card { background: #fff; }
.connection-advanced { margin-top: 12px; color: var(--text-dim); font-size: 12px; }
.connection-advanced summary { cursor: pointer; width: fit-content; font-weight: 600; color: var(--link); }
.connection-advanced summary:hover { color: var(--brand); }

@media (max-width: 1100px) {
  .overview-metrics { grid-template-columns: repeat(3, 1fr); }
  .overview-metrics .kpi:nth-child(3) { border-right: 0; }
  .overview-metrics .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 860px) {
  .public-hero { grid-template-columns: 1fr; }
  .hero-people { min-height: 480px; }
  .first-run-guide { grid-template-columns: 1fr; }
  .first-run-guide .card { border-right: 0; border-bottom: 1px solid var(--border); }
  .overview-priority .priority-card { grid-template-columns: 1fr; gap: 8px; }
  .overview-priority .priority-card .foot { min-width: 0; }
}
@media (max-width: 680px) {
  .content { padding: 20px 18px 48px; }
  .public-hero { padding-top: 45px; }
  .hero-copy h1 { font-size: 41px; }
  .hero-people { min-height: 390px; border-radius: 4px 28px 4px 4px; }
  .hero-people figcaption { display: block; }
  .hero-people figcaption span { display: block; text-align: left; margin-top: 4px; }
  .overview-metrics { grid-template-columns: 1fr 1fr; }
  .overview-metrics .kpi:nth-child(2n) { border-right: 0; }
  .overview-metrics .kpi:nth-child(-n+4) { border-bottom: 1px solid var(--border); }
}

/* Reports trend bars */
.bar-gold, .bar-blue { width: 100%; border-radius: 2px 2px 0 0; }
.bar-gold { background: var(--gold); }
.bar-blue { background: color-mix(in srgb, var(--gold) 25%, transparent); }
