:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #153c4b;
  background: #edf3f5;
  font-size: 14px;
  --navy: #0a374b;
  --ink: #153c4b;
  --accent: #17627b;
  --line: #cbdde4;
  --muted: #506f7d;
  --surface: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button {
  cursor: pointer;
  padding: 9px 13px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
button:hover { background: #e6f0f4; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid #207f9c; outline-offset: 2px; }
.primary { color: #fff; background: var(--navy); border-color: var(--navy); }
.primary:hover { background: #15536d; border-color: #15536d; }
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100dvh; }
aside {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: auto;
  padding: 26px 14px 18px;
  color: #fff;
  background: var(--navy);
}
.sidebar-brand { margin: 0 10px 24px; padding-bottom: 18px; border-bottom: 1px solid #487182; }
.wordmark {
  display: inline-grid;
  justify-items: start;
  color: inherit;
  font: 400 25px/.84 "Playfair Display", Georgia, serif;
  letter-spacing: -.5px;
}
.sidebar-project { display: block; color: #c6dce5; margin-top: 13px; font-size: 12px; }
nav { display: grid; gap: 3px; }
nav button { text-align: left; background: transparent; color: #e3eef1; border-color: transparent; padding: 8px 10px; }
nav button.active { background: #e3edf1; color: var(--navy); font-weight: 700; }
nav button:not(.active):hover { background: #1c5267; color: #fff; }
aside :focus-visible { outline-color: #a9dcee; }
.profile { color: #d3e4eb; padding: 14px 10px 0; margin-top: 20px; border-top: 1px solid #487182; font-size: 12px; }
.profile button { margin-top: 7px; color: inherit; background: transparent; border-color: #7194a2; padding: 5px 10px; }
.profile button:hover { background: #1c5267; }
main { padding: clamp(16px, 2.5vw, 32px); min-width: 0; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 19px 22px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  border-radius: 9px;
  background: var(--surface);
}
.page-header h1 { margin: 5px 0 0; line-height: 1.1; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: 1px; text-transform: uppercase; }
h1 { margin: 8px 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.8px; }
h2 { letter-spacing: -.35px; }
.event-context { display: grid; gap: 3px; text-align: right; }
.event-context span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.toolbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin: 0 0 15px; }
.toolbar input { flex: 1 1 210px; }
.toolbar select { width: auto; max-width: 100%; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.stat, .panel { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.stat { line-height: 1.35; }
.stat strong { display: block; margin: 10px 0 3px; font-size: clamp(18px, 2vw, 27px); font-variant-numeric: tabular-nums; }
.stat span, .muted { color: var(--muted); font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.panel h3 { margin: 0 0 13px; }
.row { padding: 10px 0; border-bottom: 1px solid #e1ebef; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row:last-child { border: 0; }
.danger { color: #973e35; }
.badge { display: inline-block; padding: 4px 7px; border-radius: 5px; background: #e7f0f4; color: #305c70; font-size: 11px; }
.board { display: flex; gap: 12px; overflow: auto; padding-bottom: 14px; align-items: flex-start; scrollbar-color: #648d9e #dce9ef; }
.column { flex: 0 0 255px; width: 255px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #dfebf0; }
.column h3 { display: flex; align-items: center; min-height: 28px; margin: 0 0 8px; font-size: 14px; }
.card { width: 100%; text-align: left; padding: 12px; margin-bottom: 8px; background: var(--surface); border-color: #c1d6df; }
.card strong { display: block; margin-bottom: 6px; }
.card p { margin: 5px 0; }
.empty { padding: 22px 12px; text-align: center; color: var(--muted); line-height: 1.6; }
.table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
table { border-collapse: collapse; width: 100%; white-space: nowrap; }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid #e1ebef; }
th { font-size: 11px; letter-spacing: .3px; text-transform: uppercase; color: #3e6170; background: #e7f0f4; }
td button { padding: 5px 8px; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #bdd1da;
  border-radius: 6px;
}
input::placeholder { color: #587582; }
textarea { min-height: 75px; resize: vertical; }
label { display: block; font-size: 12px; color: #456672; }
label input, label textarea, label select { margin-top: 5px; }
dialog {
  width: 780px;
  max-width: 95vw;
  max-height: 90dvh;
  color: var(--ink);
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  border-radius: 10px;
  box-shadow: 0 14px 60px #0a374b4d;
}
dialog::backdrop { background: #072b3bb8; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.wide { grid-column: 1 / -1; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.detail { margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--line); }
.auth { max-width: 465px; margin: 8vh auto; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); overflow: hidden; }
.auth-brand { display: grid; gap: 20px; padding: 24px; background: var(--navy); color: white; }
.auth-brand div > span { color: #d3e4eb; }
.auth-fields { padding: 14px 24px 24px; }
.auth label { margin: 12px 0; }
#toast { position: fixed; bottom: 20px; right: 20px; max-width: min(450px, calc(100% - 40px)); background: var(--navy); color: #fff; padding: 13px 18px; border-radius: 7px; display: none; z-index: 10; }
.note { color: #304d5b; background: #edf4f7; padding: 10px; border-radius: 7px; font-size: 12px; line-height: 1.55; }
.bar { height: 7px; background: #dceaf0; border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #26728b; }
a { color: var(--accent); }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }
select[multiple] { min-height: 95px; }
.select-lookup { display: grid; gap: 5px; margin-bottom: 2px; min-width: 0; align-content: start; }
.select-lookup input[type=search] { padding: 5px 8px; background: #f2f7f9; font-size: 12px; }
.select-lookup small { color: var(--muted); }
.select-lookup option[hidden] { display: none; }
.board-navigation {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  padding: 5px 7px;
  width: min(100%, 430px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.board-navigation[hidden] { display: none; }
.board-navigation button { padding: 4px 9px; color: var(--navy); }
.board-navigation button:disabled { opacity: .45; }
.board-navigation label { display: flex; align-items: center; flex: 1; gap: 8px; }
.board-navigation input { flex: 1; margin: 0; padding: 0; accent-color: var(--accent); }
.participant-board-item { margin-bottom: 10px; }
.participant-board-item .card { margin-bottom: 4px; }
.participant-board-item > button:last-child { padding: 5px 8px; font-size: 12px; }
@media (max-width: 950px) {
  .shell { grid-template-columns: 170px minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .shell { display: block; }
  aside { position: static; height: auto; padding: 12px; }
  .sidebar-brand { display: flex; align-items: end; justify-content: space-between; margin: 0 0 8px; padding: 0 0 7px; }
  nav { display: flex; overflow-x: auto; padding-bottom: 4px; }
  nav button { flex: none; }
  .profile { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; padding: 5px 0 0; }
  .profile button { margin-top: 0; }
  .profile br { display: none; }
  main { padding: 12px; }
  .page-header { padding: 13px; gap: 8px; align-items: start; flex-direction: column; }
  .event-context { text-align: left; }
  .fields { grid-template-columns: 1fr; }
  .stat, .panel { padding: 12px; }
  .auth { margin: 16px; }
}

.contact-comment{white-space:pre-wrap;min-width:180px;max-width:320px;line-height:1.5}

.checkbox-group {
  min-width: 0;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid #cfd9d0;
  border-radius: 7px;
  background: white;
}
.checkbox-group legend {
  padding: 0 4px;
  font-size: 12px;
  color: var(--muted);
}
.checkbox-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  padding: 8px 0;
  color: #243c2e;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}
.checkbox-option input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: #265d48;
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}
.partner-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-wrap: anywhere;
}
.partner-card dl { display: grid; gap: 12px; margin: 0; }
.partner-card dt { color: var(--muted); font-size: 12px; }
.partner-card dd { margin: 4px 0 0; line-height: 1.45; }
.partner-card h3 { margin: 0; }
.partner-card ul { margin: 0; padding-left: 18px; }
.partner-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.partner-pipeline { margin-top: 32px; }
.outside-pipeline summary { margin-bottom: 12px; cursor: pointer; }

.transfer-button {
  background: #087749;
  border-color: #087749;
  color: white;
  font-weight: 700;
}
.transfer-button:hover { background: #065e39; }
.transfer-button:disabled { opacity: .65; cursor: wait; }

.deal-step {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.deal-step summary { font-weight: 700; cursor: pointer; }
.deal-step[open] summary { margin-bottom: 12px; }
.deal-step .fields:empty { display: none; }
.card strong + span { display: block; margin-bottom: 8px; }
.card p { overflow-wrap: anywhere; }

.client-list { min-width: 0; }
.client-list .table-wrap {
  max-height: 66vh;
  overscroll-behavior-x: contain;
  scrollbar-color: #648d79 #edf2ee;
}
.client-scroll-control {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  color: #40554a;
}
.client-scroll-control[hidden] { display: none; }
.client-scroll-control input {
  width: min(260px, 42vw);
  margin: 0;
  padding: 0;
  accent-color: #265d48;
  cursor: ew-resize;
}
.client-list table {
  min-width: 1120px;
  table-layout: fixed;
  white-space: normal;
}
.client-list th,
.client-list td {
  padding: 8px 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.client-list th { position: sticky; top: 0; z-index: 2; }
.client-list th:nth-child(1) { width: 15%; }
.client-list th:nth-child(2) { width: 13%; }
.client-list th:nth-child(3) { width: 15%; }
.client-list th:nth-child(4) { width: 11%; }
.client-list th:nth-child(5) { width: 14%; }
.client-list th:nth-child(6) { width: 12%; }
.client-list th:nth-child(7) { width: 8%; }
.client-list th:nth-child(8) { width: 12%; }
.client-list tbody tr { background: white; }
.client-list tbody tr:nth-child(even) { background: #f7faf8; }
.client-list tbody tr:hover,
.client-list tbody tr:focus-within { background: #eef5ef; }
.client-list th:first-child,
.client-list td:first-child {
  position: sticky;
  left: 0;
  box-shadow: 1px 0 var(--line);
}
.client-list th:first-child { z-index: 3; }
.client-list td:first-child { background: inherit; z-index: 1; }
.client-details summary { cursor: pointer; color: var(--accent); }
.client-details div { margin-top: 4px; white-space: pre-wrap; }
.client-details ul { margin: 5px 0 0; padding-left: 16px; }
.client-details li + li { margin-top: 4px; }
.client-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.client-actions button { padding: 3px 6px; font-size: 12px; }
@media (max-width: 650px) {
  .client-list th:nth-child(1) { width: 115px; }
  .client-scroll-control { gap: 8px; }
}

.booking-ticket { padding-top: 10px; border-top: 1px solid var(--line); }
.booking-ticket > label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.booking-ticket > label input { width: 80px; margin: 0; }
.booking-names:not(:empty) { margin-top: 10px; }
.booking-total { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; }

.stage-people {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  color: #154c62;
  background: #d2e9f2;
}
.stage-people strong { font-size: 22px; }

.overdue-stat { text-align: left; }
.overdue-stat span { color: var(--accent); text-decoration: underline; }
.overdue-stat:focus-visible, .overdue-task-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.overdue-task-link { color: #943b2d; text-align: left; overflow-wrap: anywhere; }

[data-deal-board] [data-drag-deal] { cursor: grab; }
[data-deal-board] .deal-dragging { opacity: .45; cursor: grabbing; }
[data-deal-board] .drop-active {
  background: #d2e9f2;
  outline: 2px solid #237d9b;
  outline-offset: -2px;
}

.client-name { display: flex; align-items: flex-start; gap: 8px; }
.client-work-check {
  appearance: none;
  display: grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 2px solid #087749;
  border-radius: 5px;
  cursor: pointer;
}
.client-work-check:focus-visible { outline: 2px solid #087749; outline-offset: 2px; }
.client-work-check:checked { background: #087749; }
.client-work-check:checked::before {
  content: '';
  width: 9px;
  height: 5px;
  border: solid white;
  border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg);
}
.client-work-check:disabled { opacity: 1; cursor: default; }
.client-list tbody tr.client-in-work { background: #cdeed7; }
.client-list tbody tr.client-in-work:hover,
.client-list tbody tr.client-in-work:focus-within { background: #bfe8cb; }

.client-search { width: min(100%, 400px); margin-bottom: 10px; }
.client-search-count { margin: 0 0 10px; }

.client-counts, .pipeline-totals { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.client-counts > div, .pipeline-totals > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.client-counts strong, .pipeline-totals strong { font-size: 20px; }
.client-counts .client-count-working { background: #cdeed7; color: #174b34; border-color: #b4ddc1; }

.sponsor-board-item { margin-bottom: 12px; }
.sponsor-board-item .card { margin-bottom: 4px; }
.sponsor-board-item > button:last-child { padding: 5px 8px; font-size: 12px; }

.sponsor-capacity > div { flex-direction: column; gap: 4px; min-width: 175px; }
.sponsor-capacity strong { color: var(--accent); }
