@import url("fonts.css");

:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #172638;
  background: #f3f6f9;
  color-scheme: light;
  font-synthesis: none;
  --ink: #172638;
  --muted: #5c6c7d;
  --muted-dark: #aab8c7;
  --line: #dce4eb;
  --line-soft: #edf1f5;
  --canvas: #f3f6f9;
  --surface: #fff;
  --rail: #121e2d;
  --accent: #08796f;
  --accent-dark: #07665e;
  --accent-soft: #e8f6f3;
  --focus: #008d87;
  --radius: 12px;
  --shadow: 0 2px 3px rgb(11 42 60 / 3%);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: .875rem; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(1.55rem, 2.7vw, 2rem); line-height: 1.2; letter-spacing: -.038em; font-weight: 700; }
h2 { font-size: 1.02rem; line-height: 1.45; letter-spacing: -.022em; font-weight: 650; }
h3 { font-size: .9rem; font-weight: 650; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { position: fixed; z-index: 5; top: 12px; left: 12px; padding: 9px 14px; background: white; border-radius: 7px; }
.subtle { font-size: .79rem; color: var(--muted); }
.tabular { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-hint { display: block; margin-top: 3px; }
.quiet-link { color: var(--accent-dark); font-weight: 600; text-underline-offset: 3px; }
.quiet-link:hover { text-decoration: underline; }

.layout { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.rail {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  padding: 27px 17px 15px;
  background: var(--rail);
  color: #fff;
}
.brand { display: inline-flex; align-items: center; align-self: flex-start; gap: 10px; padding: 0 8px; }
.brand-word { font-size: 1.13rem; font-weight: 700; letter-spacing: -.046em; white-space: nowrap; }
.brand-word > span { color: #85dacb; font-weight: 550; }
.brand-mark {
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 6px;
  background: #08796f;
  color: #fff;
  border: 1px solid #53b5a7;
  border-radius: 10px;
}
.brand-mark i { width: 3px; height: 12px; background: currentColor; border-radius: 2px; transform: rotate(32deg); }
.brand-mark i:nth-child(2) { height: 16px; }
.brand-mark i:nth-child(3) { height: 8px; }

.nav { margin-top: 39px; display: grid; gap: 5px; }
.nav a {
  display: flex;
  position: relative;
  gap: 11px;
  align-items: center;
  padding: 10px 12px;
  min-height: 44px;
  color: var(--muted-dark);
  border-radius: 8px;
  font-weight: 550;
  white-space: nowrap;
}
.nav a:hover { color: white; background: #202e3e; }
.nav a[aria-current="page"] { color: #a2e7db; background: #1b3a3e; }
.rail :focus-visible { outline-color: #a2e7db; }
.rail-bottom {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 13px 5px 1px;
  border-top: 1px solid #324151;
}
.account-mark {
  display: grid;
  place-items: center;
  flex: 0 0 31px;
  height: 31px;
  border-radius: 50%;
  color: #c8e8e5;
  background: #2c4350;
  font-size: .78rem;
  font-weight: 650;
}
.account-name { color: #dce4ee; flex: 1; font-size: .8rem; font-weight: 550; }
.rail-bottom form { margin-left: auto; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 37px;
  height: 37px;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: inherit;
}
.signout { color: var(--muted-dark); }
.signout:hover { background: #2a3a4b; color: white; }
.icon { display: inline-block; flex: 0 0 auto; position: relative; width: 17px; height: 17px; color: currentColor; }
.icon-list::before { content: ""; position: absolute; width: 14px; height: 15px; left: 1px; top: 1px; border: 1.5px solid; border-radius: 3px; }
.icon-list::after { content: ""; position: absolute; width: 7px; height: 1.5px; left: 5px; top: 5px; background: currentColor; box-shadow: 0 3px currentColor, 0 6px currentColor; }
.icon-chart::before { content: ""; position: absolute; inset: 2px 1px 2px 1px; border-left: 1.5px solid; border-bottom: 1.5px solid; border-radius: 0 0 0 3px; }
.icon-chart::after { content: ""; position: absolute; left: 5px; bottom: 4px; width: 2px; height: 4px; background: currentColor; box-shadow: 4px -2px 0 currentColor, 8px -5px 0 currentColor; }
.icon-exit::before { content: ""; position: absolute; inset: 2px 8px 2px 1px; border: 1.5px solid; border-right: 0; border-radius: 2px 0 0 2px; }
.icon-exit::after { content: "→"; position: absolute; left: 4px; top: -4px; font-size: 16px; font-weight: 650; }
.icon-search::before { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border: 1.5px solid; border-radius: 50%; }
.icon-search::after { content: ""; position: absolute; top: 11px; left: 10px; width: 6px; height: 1.5px; transform: rotate(45deg); transform-origin: left center; background: currentColor; }

.workspace { min-width: 0; }
.toolbar {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px clamp(18px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.toolbar > p { font-size: .84rem; font-weight: 650; color: #33475a; }
.sync { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; text-align: right; }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: #16877a; display: inline-block; vertical-align: 1px; margin-right: 5px; }
.sync-warning { color: #825006; }
.sync-warning .sync-dot { background: #ba7615; }
.content { max-width: 1480px; margin: 0 auto; padding: 31px clamp(18px, 3vw, 40px) 48px; }
.page-heading { margin-bottom: 23px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { padding: 18px 20px; }
.panel-heading h2 { margin-bottom: 4px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 22px; }
.metric {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 11px;
  row-gap: 2px;
  align-items: start;
  padding: 15px 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 86px;
  box-shadow: var(--shadow);
}
a.metric:hover { border-color: #79b9b0; }
.metric-icon {
  display: grid;
  place-items: center;
  grid-row: span 2;
  height: 34px;
  border-radius: 9px;
  background: #eaf0f7;
  color: #38567a;
  font-weight: 650;
  font-size: 1.03rem;
}
.metric-pending .metric-icon { background: #fbf0d7; color: #85500a; }
.metric-approved .metric-icon { background: #e4f4ec; color: #176646; }
.metric-quote .metric-icon { background: #e0f3f2; color: #08746c; }
.metric-label { color: var(--muted); font-weight: 550; font-size: .78rem; align-self: end; }
.metric strong { font-size: 1.55rem; font-weight: 650; line-height: 1.12; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.metric strong small { color: var(--muted); font-size: .83rem; letter-spacing: 0; }

.tabs { display: flex; flex-wrap: wrap; align-items: stretch; gap: 17px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; min-height: 47px; position: relative; font-size: .83rem; font-weight: 600; white-space: nowrap; color: var(--muted); }
.tabs a:hover { color: var(--accent-dark); }
.tabs a[aria-current="page"] { color: var(--accent-dark); }
.tabs a[aria-current="page"]::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; }
.filters { padding: 16px 18px 11px; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(125px, 195px) auto; gap: 9px; align-items: center; }
.search { position: relative; }
.search .icon { position: absolute; top: 11px; left: 11px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 35px; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 39px;
  border: 1px solid #cbd6e1;
  border-radius: 7px;
  color: var(--ink);
  background: white;
  padding: 8px 10px;
  accent-color: var(--accent);
}
input::placeholder, textarea::placeholder { color: #627386; opacity: 1; }
textarea { resize: vertical; }
input[type="date"] { padding-inline: 7px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: .83rem;
  line-height: 1.25;
  font-weight: 650;
  white-space: nowrap;
}
.button-primary { color: white; background: var(--accent); border-color: var(--accent); }
.button-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.button-secondary { color: #2c485b; background: #fff; border-color: #cbd6e1; }
.button-secondary:hover { color: var(--accent-dark); border-color: #93bdb7; background: #f4faf8; }
.advanced-filters { margin-top: 6px; }
details > summary { cursor: pointer; color: var(--accent-dark); font-weight: 600; width: fit-content; }
.advanced-filters > summary { padding: 6px 1px; font-size: .8rem; color: #41566a; }
.filter-active { display: inline-block; width: 6px; height: 6px; margin-left: 3px; border-radius: 50%; vertical-align: 2px; background: var(--accent); }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; padding-top: 8px; }
.filter-grid > label { display: grid; gap: 4px; font-size: .78rem; font-weight: 600; }
.filter-grid :is(input, select) { font-weight: 450; }
.filter-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 11px; margin-bottom: 4px; font-size: .8rem; }

.lead-table, .summary-table { table-layout: auto; width: 100%; border-collapse: collapse; }
.lead-table thead, .summary-table thead { color: #4b6073; background: #f5f8fb; }
.lead-table th, .summary-table th { font-size: .76rem; font-weight: 650; text-align: left; }
.lead-table td, .lead-table th, .summary-table td, .summary-table th { padding: 11px clamp(8px, 1.22vw, 17px); vertical-align: top; }
.lead-table th:first-child, .lead-table td:first-child, .summary-table th:first-child, .summary-table td:first-child { padding-left: 18px; }
.lead-table th:last-child, .lead-table td:last-child, .summary-table th:last-child, .summary-table td:last-child { padding-right: 18px; }
.lead-table td, .summary-table tbody :is(th, td) { border-top: 1px solid var(--line-soft); }
.lead-table tbody tr:hover, .summary-table tbody tr:hover { background: #fbfdfd; }
.lead-title-cell { min-width: 165px; width: 42%; }
.lead-title { display: inline-block; font-size: .87rem; font-weight: 650; white-space: initial; word-break: break-word; }
.lead-title:hover, .summary-table a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.truncated { display: block; width: clamp(168px, 24vw, 365px); max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: .77rem; margin-top: 3px; }
.source-tag { display: inline-block; width: fit-content; max-width: 100%; padding: 3px 7px; color: #40576c; background: #edf2f7; border-radius: 5px; font-size: .73rem; font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  font-size: .72rem;
  line-height: 1.35;
  font-weight: 600;
  border-radius: 5px;
  white-space: nowrap;
}
.badge-dot { width: 5px; height: 5px; flex: 0 0 auto; background: currentColor; border-radius: 50%; opacity: .8; }
.badge-pending { background: #f9edd3; color: #7b4a08; }
.badge-approved { background: #e3f3ea; color: #1c664b; }
.badge-rejected { background: #f8e9e9; color: #8f323b; }
.badge-location { background: #e8f4f2; color: #15675a; }
.badge-neutral { background: #eef2f5; color: #41566a; }
.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.pagination nav { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .button { min-height: 34px; }
.empty { display: grid; justify-items: center; gap: 12px; text-align: center; border-top: 1px solid var(--line-soft); padding: 39px 16px; }
.empty-symbol { display: grid; place-items: center; width: 42px; height: 42px; background: var(--accent-soft); color: var(--accent-dark); border-radius: 10px; }
.summary-table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius); }
.summary-table tbody tr:last-child th:first-child { border-bottom-left-radius: var(--radius); }
.summary-table tbody th { font-size: .82rem; }
.summary-table td { white-space: nowrap; font-variant-numeric: tabular-nums; }

.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 13px; font-size: .81rem; }
.detail-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 13px; }
.detail-heading > div { min-width: 0; }
.detail-heading h1 { overflow-wrap: anywhere; }
.detail-tags, .signal-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.detail-tags { margin-bottom: 10px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(255px, 340px); gap: 16px; align-items: start; }
.detail-main, .detail-side { display: grid; gap: 16px; min-width: 0; }
.detail-panel { padding: 17px 18px; }
.detail-panel h2 { margin-bottom: 14px; }
.post-content, .note, .evidence { white-space: pre-wrap; overflow-wrap: anywhere; }
.post-content { font-size: .91rem; line-height: 1.7; }
.info-list > div { display: grid; grid-template-columns: minmax(0, 145px) minmax(0, 1fr); gap: 9px; padding-block: 8px; border-bottom: 1px solid var(--line-soft); }
.info-list > div:first-child { padding-top: 0; }
.info-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.info-list dt { font-size: .78rem; font-weight: 550; color: var(--muted); }
.info-list dd { font-size: .82rem; }
.timeline > div { grid-template-columns: minmax(0, 92px) minmax(0, 1fr); }
.evidence { margin-top: 5px; color: var(--muted); font-size: .8rem; }
.signal-tags + .info-list { margin-top: 13px; }
.form-stack { display: grid; gap: 7px; }
.form-stack label { font-size: .83rem; font-weight: 600; }
.form-stack :is(input, select, textarea) + label { margin-top: 4px; }
.form-stack .button { justify-self: start; margin-top: 5px; }
.history-heading { margin-top: 19px; border-top: 1px solid var(--line); padding-top: 12px; }
.feedback-list { margin: 7px 0 0; padding: 0; list-style: none; font-size: .82rem; }
.feedback-list > li { padding-block: 9px; border-bottom: 1px solid var(--line-soft); }
.feedback-list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.note { margin-top: 5px; }
.feedback-actions { display: grid; gap: 4px; margin-top: 6px; font-size: .77rem; }
.feedback-actions .form-stack { margin-block: 6px; }
.version-list { padding: 0 0 0 11px; margin: 8px 0 0; list-style: none; border-left: 2px solid var(--line); }
.version-list li { padding-bottom: 9px; }
.version-list li:last-child { padding-bottom: 0; }

.guest-page {
  background:
    radial-gradient(ellipse at 14% 88%, rgb(10 118 110 / 28%), transparent 58%),
    radial-gradient(ellipse at 91% 11%, rgb(86 124 164 / 17%), transparent 54%),
    #101d2d;
}
.guest-content { min-height: 100vh; min-height: 100svh; display: grid; align-content: center; justify-items: center; padding: 28px 16px; }
.login-card {
  width: min(100%, 407px);
  padding: 28px 29px 30px;
  border-radius: 15px;
  border: 1px solid #dce7e9;
  background: white;
  box-shadow: 0 18px 52px rgb(0 0 0 / 22%);
}
.login-brand { align-self: auto; margin: 0 0 20px; padding: 0; }
.login-brand .brand-word > span { color: var(--accent-dark); }
.login-card h1 { margin: 0 0 17px; font-size: clamp(1.38rem, 4vw, 1.65rem); }
.login-card .form-stack input { min-height: 43px; }
.login-card .login-submit { margin-top: 11px; justify-self: stretch; display: flex; justify-content: space-between; min-height: 43px; }
.flash { padding: 9px 12px; margin-bottom: 12px; border-radius: 7px; font-size: .82rem; }
.flash-success { color: #195e42; border: 1px solid #c3e1d0; background: #eaf6ef; }
.flash-error { color: #8c2f37; border: 1px solid #ecd0d3; background: #fbefef; }
.error-panel { padding: 21px 23px; }
.error-panel h1 { margin-bottom: 10px; }
.error-panel .button { margin-top: 15px; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 177px minmax(0, 1fr); }
  .rail { padding-inline: 12px; }
  .lead-table :is(th, td):first-child, .summary-table :is(th, td):first-child { padding-left: 13px; }
  .lead-table :is(th, td):last-child, .summary-table :is(th, td):last-child { padding-right: 13px; }
}
@media (max-width: 940px) {
  .lead-table .lead-location-cell, .lead-table thead th:nth-child(4) { display: none; }
  .metrics { gap: 8px; }
  .metric { padding: 13px 10px; column-gap: 8px; grid-template-columns: 29px minmax(0, 1fr); }
  .metric-icon { height: 29px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr) minmax(232px, 265px); gap: 11px; }
  .detail-panel { padding: 14px; }
  .info-list > div { grid-template-columns: minmax(0, 100px) minmax(0, 1fr); }
}

@media (max-width: 790px) {
  .layout { display: block; }
  .rail { position: static; height: auto; padding: 11px 14px 6px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; }
  .brand { padding: 0; }
  .nav { margin: 0; gap: 4px; display: flex; grid-column: span 2; grid-row: 2; }
  .nav a { padding: 6px 11px; min-height: 38px; font-size: .82rem; }
  .rail-bottom { border: 0; margin: 0; padding: 0; gap: 6px; grid-column: 2; grid-row: 1; }
  .rail-bottom .account-mark { display: none; }
  .rail-bottom .account-name { flex: none; white-space: nowrap; }
  .toolbar { min-height: 47px; padding-inline: 15px; }
  .content { padding: 22px 15px 34px; }
  .page-heading { margin-bottom: 16px; }
  .metrics { gap: 9px; margin-bottom: 16px; }
  .metric { min-height: 75px; }
}
@media (max-width: 640px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs { gap: 13px; padding-inline: 12px; }
  .tabs a { font-size: .77rem; min-height: 42px; }
  .filters { padding: 12px 12px 8px; }
  .search-row { grid-template-columns: minmax(0, 1fr) auto; }
  .search { grid-column: span 2; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-table thead, .summary-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .lead-table, .summary-table, .lead-table tbody, .summary-table tbody { display: block; }
  .lead-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; padding: 12px; border-top: 1px solid var(--line-soft); }
  .lead-table td, .lead-table td:first-child, .lead-table td:last-child { border: 0; padding: 2px 0; }
  .lead-table .lead-title-cell { grid-column: span 2; width: 100%; }
  .lead-table .lead-source-cell { grid-column: 1; }
  .lead-table .lead-status-cell { grid-column: 2; grid-row: 2; justify-self: end; }
  .lead-table .lead-sent-cell { grid-column: 1; grid-row: 3; font-size: .73rem; color: var(--muted); }
  .lead-table .lead-location-cell { display: block; grid-column: 2; grid-row: 3; justify-self: end; }
  .truncated { width: auto; }
  .summary-table tr { padding: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 10px; border-top: 1px solid var(--line-soft); }
  .summary-table tbody tr :is(th, td), .summary-table tbody tr :is(th, td):first-child, .summary-table tbody tr :is(th, td):last-child { padding: 2px 0; border: 0; }
  .summary-table th { grid-column: span 2; margin-bottom: 3px; }
  .summary-table td { font-size: .8rem; white-space: normal; }
  .summary-table td::before { content: attr(data-label); display: block; font-size: .71rem; color: var(--muted); }
  .detail-heading { align-items: flex-start; flex-direction: column; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-side, .detail-main { gap: 11px; }
  .login-card { padding: 23px 21px; }
}
@media (max-width: 355px) {
  .content { padding-inline: 10px; }
  .metric { padding-inline: 8px; }
  .metric-label { font-size: .72rem; }
  .tabs { column-gap: 10px; }
  .tabs a { font-size: .74rem; }
  .sync { font-size: .67rem; }
}
