:root {
  --ink: #2d3748;
  --navy: #0c1424;
  --muted: #4a5568;
  --line: #e2e8f0;
  --paper: #f7fafc;
  --teal: #255fdd;
  --teal-dark: #1e4fbe;
  --bs-primary: #255fdd;
  --bs-primary-rgb: 37, 95, 221;
  --bs-body-color: #2d3748;
  --bs-body-font-family: "Open Sans", system-ui, sans-serif;
  --bs-link-color: #255fdd;
  --bs-link-hover-color: #1e4fbe;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Open Sans", system-ui, sans-serif;
}
h1, h2, h3, .page-head h1, .kanban-head, .auth-card h1 {
  font-family: Oswald, "Open Sans", sans-serif;
  letter-spacing: .01em;
}
.stat .value, .stat .label, .h6 {
  font-family: "Open Sans", system-ui, sans-serif;
}
.btn-primary {
  --bs-btn-bg: var(--teal);
  --bs-btn-border-color: var(--teal);
  --bs-btn-hover-bg: var(--teal-dark);
  --bs-btn-hover-border-color: var(--teal-dark);
  --bs-btn-active-bg: var(--teal-dark);
  --bs-btn-disabled-bg: var(--teal);
  --bs-btn-disabled-border-color: var(--teal);
}
a { color: var(--teal); }
.sidebar {
  width: 260px;
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(37, 95, 221, .42), transparent 58%),
    radial-gradient(80% 50% at 100% 100%, rgba(79, 215, 252, .16), transparent 52%),
    linear-gradient(180deg, #07111f 0%, #0c1a33 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1030;
  padding: 18px 14px;
  overflow: auto;
}
.brand { display: block; text-decoration: none; background: #fff; border-radius: 12px; padding: 10px 12px; }
.brand-logo { width: 70%; height: auto; display: block; margin: 0 auto; }
.brand-logo-sm { width: 118px; margin: 0; background: #fff; border-radius: 10px; padding: 6px 8px; }
.side-nav { display: flex; flex-direction: column; gap: 6px; margin-top: 22px; }
.side-nav a {
  color: #e8eef8; text-decoration: none; display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; font-weight: 600; font-size: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06);
}
.side-nav a:hover {
  color: #fff;
  background: linear-gradient(90deg, rgba(37, 95, 221, .38), rgba(255, 255, 255, .06));
  border-color: rgba(255, 255, 255, .12);
}
.side-nav a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(37, 95, 221, .78), rgba(79, 215, 252, .22));
  border-color: rgba(255, 255, 255, .16);
}
.side-copy { margin-top: auto; color: rgba(232, 238, 248, .62); font-size: 11px; line-height: 1.45; padding: 18px 12px 0; }
.offcanvas {
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(37, 95, 221, .42), transparent 58%),
    linear-gradient(180deg, #07111f 0%, #0c1a33 100%);
  color: #e8eef8;
}
.offcanvas-body { display: flex; flex-direction: column; }
.app-main { min-height: 100vh; }
@media (min-width: 992px) { .app-main { margin-left: 260px; } }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 24px;
  background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1020;
}
.profile-link {
  font-size: 13px; color: var(--muted); text-decoration: none; white-space: nowrap;
}
.profile-link:hover { color: var(--teal); }
.content { padding: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.page-head h1, .auth-card h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: -.03em; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.panel, .stat, .vault-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.stat .label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.stat-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat-badge { background: #16a34a; color: #fff; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 3px 8px; }
.stat-badge-lost { background: #be123c; }
.activity-chart { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.activity-legend { list-style: none; margin: 0; padding: 0; }
.activity-legend li { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.activity-kinds { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 12px 0 0; padding: 0; }
.activity-kinds li, .activity-kinds button {
  background: #f1f5f9; color: #334155; border: 0; border-radius: 999px; padding: 3px 10px;
  font-size: 12px; font-weight: 700; line-height: 1.4; cursor: default;
}
.activity-kinds button { cursor: pointer; }
.activity-kinds button:hover, .activity-kinds button.on {
  background: rgba(37, 95, 221, .14); color: #1d4ed8;
}
.activity-pager-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 4px; }
.activity-pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line);
}
.activity-pager[hidden] { display: none; }
.activity-pager button {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 700;
}
.activity-pager button:disabled { opacity: .45; }
.week-target { display: none; margin-top: 14px; }
.week-target span { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.week-bar { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.week-bar span { display: block; height: 100%; background: var(--teal); border-radius: 999px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.swatch-0 { background: #255fdd; }
.swatch-1 { background: #0b1021; }
.swatch-2 { background: #b45309; }
.swatch-3 { background: #6d28d9; }
.swatch-4 { background: #047857; }
.swatch-5 { background: #be123c; }
.swatch-6 { background: #0369a1; }
.swatch-7 { background: #64748b; }
.stat .value { font-size: 1.7rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stage-line, .recent-row, .file-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.file-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: auto; }
.file-actions form { margin: 0; }
.file-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; border-radius: 8px; padding: 5px 10px;
  font-size: 12px; font-weight: 700; line-height: 1.2;
  text-decoration: none; cursor: pointer;
}
.file-btn:hover { filter: brightness(.96); text-decoration: none; }
.file-btn-view { background: rgba(37, 95, 221, .14); color: #1d4ed8; }
.file-btn-view:hover { color: #1d4ed8; }
.file-btn-download { background: rgba(12, 20, 36, .1); color: #0c1424; }
.file-btn-download:hover { color: #0c1424; }
.file-btn-archive { background: #fff7ed; color: #c2410c; }
.file-btn-archive:hover { color: #c2410c; }
.file-btn-restore { background: #ecfdf5; color: #047857; }
.file-btn-restore:hover { color: #047857; }
.file-btn-remove { background: #fff1f2; color: #be123c; }
.file-btn-remove:hover { color: #be123c; }
.file-rename { display: flex; gap: 8px; align-items: center; flex: 1 1 220px; }
.file-rename .form-control { min-width: 0; }
.folder-picks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.note-row { padding: 10px 0; border-top: 1px solid var(--line); }
.priority { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
.priority-low { background: #e2e8f0; color: #334155; }
.priority-normal { background: rgba(37, 95, 221, .12); color: #255fdd; }
.priority-high { background: #ffe4e6; color: #be123c; }
.month-head, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.month-head { margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.month-day { min-height: 92px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.month-day.out { opacity: .45; }
.month-day.today { border-color: var(--teal); background: #fff; }
.month-date { font-size: 12px; font-weight: 700; }
.month-item { display: block; margin-top: 4px; border-radius: 6px; padding: 2px 4px; font-size: 12px; font-weight: 600; text-decoration: none; line-height: 1.3; }
.month-grid { overflow: auto; }
.note-body { white-space: pre-wrap; margin-top: 6px; }
.history-toggle {
  width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  border: 0; background: transparent; padding: 0; text-align: left; color: inherit;
}
.history-summary { min-width: 0; flex: 1; }
.history-preview {
  display: block; max-width: 100%; margin-top: 2px; color: var(--muted); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-toggle .bi { color: var(--muted); margin-top: 2px; transition: transform .15s ease; }
.history-toggle[aria-expanded="true"] .bi { transform: rotate(180deg); }
.history-toggle[aria-expanded="true"] .history-preview { display: none; }
.note-row > .collapse:not(.show) { display: none; }
.form-label { font-size: 13px; font-weight: 600; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 2.6rem; }
.password-toggle {
  position: absolute; right: 0.2rem; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--muted); padding: 0.3rem 0.55rem; line-height: 1;
}
.password-toggle:hover { color: var(--ink); }
.filter-bar { display: flex; gap: 8px; margin-bottom: 12px; max-width: 520px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  display: inline-block; background: rgba(37, 95, 221, .1); color: var(--teal);
  border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 600; text-decoration: none;
}
a.chip.on, a.chip:hover { background: var(--teal); color: #fff; }
.kanban {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}
.kanban-col {
  min-width: 0;
  background: #f5f7fb;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}
.kanban-col.drag-over { outline: 2px dashed var(--teal); }
.kanban-head { display: flex; justify-content: space-between; gap: 8px; padding: 12px 12px 0; font-weight: 700; font-size: 14px; }
.kanban-head span:first-child { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.kanban-cards { padding: 8px; min-height: 120px; flex: 1; }
.deal-card {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; text-decoration: none; color: inherit; margin-bottom: 8px;
  min-width: 0;
}
.deal-card[draggable="true"] { cursor: grab; }
.deal-card:hover { border-color: var(--teal); color: inherit; }
.deal-card .chip { white-space: normal; max-width: 100%; }
.deal-title { font-weight: 700; overflow-wrap: anywhere; }
.amount { font-variant-numeric: tabular-nums; font-weight: 700; margin: 2px 0 6px; }
.empty-col { color: var(--muted); font-size: 13px; padding: 8px; }
.kanban-col[data-stage="funded"] .kanban-head span:first-child { color: #047857; }
.kanban-col[data-stage="lost"] .kanban-head span:first-child { color: #b91c1c; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 16px; margin: 0; }
.profile-grid div { margin: 0; }
.profile-grid dt { color: var(--muted); font-size: 12px; font-weight: 600; }
.profile-grid dd { margin: 0; font-weight: 600; }
.stage-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.match-list { display: flex; flex-direction: column; gap: 8px; }
.match-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.buybox-row { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #f8fafc; }
.buybox-row.has-error { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); background: #fff7f7; }
.room-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.room-layout.is-gate { grid-template-columns: 1fr; }
.room-nav { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.room-nav a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; }
.room-nav a.active, .room-nav a:hover { background: rgba(37, 95, 221, .12); color: var(--teal); }
.room-sheet { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.room-banner { height: 128px; background: linear-gradient(100deg, #07111f 0%, #12306b 58%, #255fdd 100%); }
.room-sheet-body { padding: 20px 22px 24px; }
.room-sheet-body h1, .room-title h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.03em; margin: 0 0 4px; }
.room-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.request-list { margin: 0 0 18px; padding-left: 18px; color: #334155; }
.request-list li { margin: 2px 0; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.folder-tile { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.folder-mark { height: 92px; border-radius: 8px; background: #f1f5f9; display: grid; place-items: center; color: #94a3b8; font-size: 32px; margin-bottom: 10px; }
.nda-body { white-space: pre-wrap; margin-bottom: 16px; }
.vault-card { display: block; text-decoration: none; color: inherit; height: 100%; }
.vault-card:hover { border-color: var(--teal); color: inherit; }
.vault-card-closed { background: #f8fafc; color: #475569; }
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow: auto; }
.msg { border-radius: 12px; padding: 12px 14px; }
.msg.user { background: var(--navy); color: #fff; align-self: flex-end; max-width: 85%; }
.msg.assistant { background: #f8fafc; border: 1px solid var(--line); }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--paper); }
.auth-card { width: min(440px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px 26px; }
.auth-logo { width: min(280px, 100%); height: auto; display: block; margin: 0 auto 8px; }
.auth-product {
  margin: 0 0 2px; color: var(--ink); font-family: "Open Sans", system-ui, sans-serif;
  font-size: 2rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
}
.auth-product sup { font-size: .45em; top: -.85em; }
.auth-tagline { margin: 0; color: var(--ink); font-size: 1rem; }
.auth-copy { margin: 22px 0 0; text-align: center; color: var(--ink); font-size: 14px; }
.app-product {
  color: var(--ink); font-family: "Open Sans", system-ui, sans-serif;
  font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; line-height: 1;
}
.app-product sup { font-size: .45em; top: -.7em; }
.mention-menu {
  position: absolute; z-index: 1080; min-width: 240px; max-width: 360px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12); padding: 4px 0; max-height: 240px; overflow: auto;
}
.mention-menu button {
  display: flex; justify-content: space-between; gap: 12px; width: 100%;
  border: 0; background: transparent; text-align: left; padding: 8px 12px; font-size: 13px;
}
.mention-menu button[aria-selected="true"], .mention-menu button:hover { background: #f1f5f9; }
.mention-kind { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.mention-link, .note-body .mention-link, a.mention-link:hover, .mention-editor .mention-link {
  color: #255fdd; text-decoration: underline; font-weight: 600;
}
.mention-wrap { width: 100%; }
.mention-editor {
  white-space: pre-wrap; word-break: break-word; overflow-y: auto; max-height: 240px;
  background: #fff;
}
.mention-editor:focus { outline: 0; box-shadow: var(--bs-focus-ring-box-shadow, 0 0 0 .25rem rgba(37, 95, 221, .25)); }
.brand-kicker { color: var(--teal); font-family: Oswald, "Open Sans", sans-serif; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.table { --bs-table-bg: transparent; }
h2.h6 { font-weight: 700; margin-bottom: 10px; }
.bcc-copy { margin: 0 0 16px; }
.bcc-copy-row { display: flex; gap: 8px; align-items: center; max-width: 520px; }
.bcc-copy-row .form-control { background: #fff; }
.history .bcc-copy, #history .bcc-copy { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.call-bar { display: none; }
@media (max-width: 991px) {
  .call-bar {
    display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--line);
  }
  .call-bar .btn { flex: 1; }
  .content:has(.call-bar) { padding-bottom: 76px; }
}
@media (max-width: 1800px) {
  .kanban { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .kanban { grid-template-columns: 1fr; }
  .page-head, .room-title { flex-direction: column; }
  .content { padding: 16px; }
  .room-layout { grid-template-columns: 1fr; }
}
