:root {
  font-family: "Segoe UI",Arial,sans-serif;
  color: #242c39;
  background: #f3f5f8;
  line-height: 1.48;
  font-synthesis: none;
  --line: #e3e8ee;
  --muted: #586478;
  --blue: #223f78;
  --blue-light: #eaf0fc;
  --nav: #152540;
  --accent: #ffc763;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none!important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px minmax(0,1fr);
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 1px solid #d4dce8;
  color: #243651;
  background: white;
  border-radius: 8px;
  padding: 8px 13px;
  font-weight: 600;
}

button:hover:not(:disabled) {
  background: #f1f5fb;
}

button:disabled {
  opacity: .48;
  cursor: default;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #628ee4;
  outline-offset: 2px;
}

a {
  color: var(--blue);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--nav);
  color: #f6f8fe;
  padding: 28px 19px 22px;
  display: flex;
  flex-direction: column;
  gap: 42px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 8px;
  color: inherit;
  text-decoration: none;
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -.65px;
  white-space: nowrap;
}

.brand b {
  font-weight: 430;
}

.monogram {
  font-size: 23px;
  letter-spacing: -2px;
  font-weight: 850;
  line-height: 1;
  background: var(--accent);
  color: #172640;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  padding-right: 2px;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.sidebar nav button {
  color: #c2d0e7;
  border-color: transparent;
  text-align: left;
  background: transparent;
  padding: 10px 12px;
  white-space: nowrap;
}

.sidebar nav button span {
  width: 22px;
  display: inline-block;
  font-weight: 400;
  font-size: 17px;
}

.sidebar nav button:hover, .sidebar nav button[aria-pressed=true] {
  color: #fff;
  background: #283e60;
}

.sidebar nav button[aria-pressed=true] {
  box-shadow: inset 3px 0 var(--accent);
}

.connection {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #c2d0e7;
  padding: 9px 6px;
}

.light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #67c9a2;
}

.connection.warning .light {
  background: var(--accent);
}

main {
  min-width: 0;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 36px clamp(22px,3vw,51px) 40px;
}

.page-head, .workspace-head, .drawer-top, .pagination, .actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-head {
  margin-bottom: 22px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(29px,3vw,42px);
  letter-spacing: -.05em;
  line-height: 1.1;
  font-weight: 750;
}

.page-head p, .workspace-head p, .drawer-top p {
  color: var(--muted);
  margin: 7px 0 0;
}

.primary {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  white-space: nowrap;
  padding: 10px 15px;
}

.primary:hover:not(:disabled) {
  background: #2e5398;
}

.primary span {
  font-size: 16px;
  font-weight: 400;
}

.collection {
  padding: 11px 14px;
  border: 1px solid #dce5f1;
  background: #edf3fb;
  color: #344869;
  border-radius: 9px;
  margin-bottom: 19px;
  font-size: 13px;
  min-height: 42px;
}

.collection.warning {
  background: #fff5dd;
  border-color: #f0ddae;
  color: #654817;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 13px;
  margin-bottom: 24px;
}

.metrics>div, .metrics>button {
  text-align: left;
  min-width: 0;
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 13px 15px;
  display: grid;
  align-content: center;
  gap: 3px;
  font-weight: 400;
}

.metrics span {
  font-size: 13px;
  font-weight: 680;
  color: #46546a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metrics strong {
  font-size: 30px;
  font-weight: 750;
  line-height: 1.18;
  color: #203553;
  letter-spacing: -1px;
}

.metrics small {
  font-size: 12px;
  color: var(--muted);
}

.metrics i {
  font-style: normal;
  color: var(--blue);
}

.workspace {
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}

.workspace-head {
  padding: 17px 19px 12px;
}

.workspace-head h2, .drawer-top h2 {
  font-size: 20px;
  margin: 0;
  letter-spacing: -.45px;
  color: #203353;
}

.workspace-head p {
  font-size: 13px;
  margin-top: 3px;
}

.quiet {
  border-color: transparent;
  background: none;
}

.filters {
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(175px,1.5fr) repeat(4,minmax(100px,1fr));
  padding: 0 19px 17px;
}

label {
  min-width: 0;
  display: grid;
  gap: 5px;
  font-weight: 600;
  font-size: 13px;
  color: #38465b;
}

input, select, textarea {
  min-width: 0;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #d8e0ea;
  border-radius: 7px;
  color: #23344e;
  background: #fff;
  font-weight: 400;
}

input::placeholder, textarea::placeholder {
  color: #68768a;
}

textarea {
  resize: vertical;
}

.table-scroll {
  overflow: auto;
  position: relative;
}

table {
  width: 100%;
  min-width: 690px;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

th {
  color: #59667a;
  font-weight: 640;
  background: #f7f9fc;
  border-block: 1px solid var(--line);
  padding: 10px 11px;
  white-space: nowrap;
}

th:first-child, td:first-child {
  padding-left: 19px;
}

td {
  border-bottom: 1px solid #edf0f4;
  padding: 10px 11px;
  color: #425169;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover, tbody tr:focus-within {
  background: #f7faff;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.company {
  display: block;
  border: 0;
  padding: 0;
  background: none;
  text-align: left;
  font-weight: 720;
  color: #203753;
  font-size: 14px;
}

.company:hover:not(:disabled) {
  background: none;
  text-decoration: underline;
}

.subtle {
  display: block;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
  margin-top: 3px;
}

.arrow {
  color: var(--blue);
  font-weight: 700;
  font-size: 16px;
  min-width: 26px;
}

.chip {
  display: inline-block;
  border-radius: 20px;
  background: #eef2f7;
  padding: 3px 9px;
  color: #3e536d;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
}

.chip.good {
  background: #e4f3ec;
  color: #1d6048;
}

.chip.attention {
  background: #fff0cd;
  color: #755011;
}

.chip.stop {
  background: #f9e8e8;
  color: #923838;
}

.chip.blue {
  background: var(--blue-light);
  color: var(--blue);
}

.empty {
  color: var(--muted);
  padding: 24px 19px;
  margin: 0;
}

.pagination {
  border-top: 1px solid var(--line);
  padding: 12px 17px;
  color: var(--muted);
  font-size: 13px;
}

.pagination div {
  display: flex;
  gap: 7px;
}

.pagination button {
  padding: 6px 10px;
}

dialog {
  color: #24334a;
  border: 1px solid var(--line);
  box-shadow: 0 12px 50px #11274638;
  padding: 0;
  border-radius: 13px;
}

dialog::backdrop {
  background: #18253c80;
}

.drawer {
  position: fixed;
  margin: 0 0 0 auto;
  inset: 0 0 0 auto;
  width: min(620px,100%);
  height: 100%;
  max-height: none;
  max-width: none;
  border-radius: 14px 0 0 14px;
  overflow: auto;
}

.drawer-top {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding: 18px 22px;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.drawer-top p {
  font-size: 13px;
  margin-top: 4px;
}

.close {
  background: white;
  border-color: var(--line);
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 23px;
  line-height: 1;
}

.lead-section {
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
}

.lead-section h3 {
  font-size: 17px;
  letter-spacing: -.2px;
  margin: 0 0 10px;
}

.lead-section h4 {
  margin: 13px 0 6px;
  font-size: 14px;
}

.lead-section p {
  margin: 8px 0;
}

.lead-section ul, .lead-section ol {
  margin: 8px 0;
  padding-left: 21px;
}

.lead-section li+li {
  margin-top: 5px;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.facts a, .evidence a {
  font-size: 13px;
}

.evidence {
  padding: 10px 12px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 8px;
  font-size: 13px;
}

.evidence p {
  margin: 3px 0;
}

.evidence .subtle {
  margin-bottom: 5px;
}

.opening {
  padding: 12px 13px;
  border-left: 3px solid #7198df;
  border-radius: 0 8px 8px 0;
  background: #f0f5fe;
  margin: 0 0 10px;
}

.lead-form {
  display: grid;
  gap: 9px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
}

.lead-form .actions, .modal .actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.modal {
  width: min(520px,calc(100% - 26px));
}

.modal form {
  display: grid;
  gap: 12px;
  padding: 18px 21px 21px;
}

.modal form p {
  margin: 0;
  color: #654817;
  background: #fff5dd;
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 13px;
}

#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #1b3159;
  color: #fff;
  padding: 11px 14px;
  border-radius: 8px;
  z-index: 10;
  max-width: min(440px,calc(100vw - 36px));
  box-shadow: 0 7px 20px #1b31594d;
}

.form-message {
  font-size: 13px;
  color: #3d567e;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.connection button {
  margin-left: auto;
  color: #eef4ff;
  background: transparent;
  border-color: #536686;
  padding: 4px 9px;
}

.connection button:hover:not(:disabled) {
  background: #283e60;
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, #e8eef9, #f3f5f8 65%);
}

.auth-card {
  max-width: 430px;
  padding: clamp(22px, 5vw, 34px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 15px 45px #142b5320;
}

.auth-card .brand {
  color: var(--nav);
  margin: 0 0 26px;
}

.auth-card h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.18;
  letter-spacing: -.03em;
}

.auth-card p {
  color: var(--muted);
  margin: 8px 0 0;
  font-size: 14px;
}

.auth-card form {
  display: grid;
  gap: 13px;
  margin: 20px 0 12px;
}

.auth-card .primary {
  justify-content: center;
}

.auth-card #access-message {
  margin: 0;
  color: #6b4818;
  background: #fff5dd;
  border-radius: 7px;
  padding: 8px 10px;
}

@media (max-width: 1060px) {
  body {
    grid-template-columns: 177px minmax(0,1fr);
  }
  .sidebar {
    padding-inline: 12px;
  }
  .brand {
    font-size: 18px;
  }
  .filters {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .filters .search {
    grid-column: span 2;
  }
}

@media (max-width: 700px) {
  body {
    display: block;
  }
  .sidebar {
    height: auto;
    position: static;
    padding: 11px 13px;
    gap: 12px;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
  }
  .sidebar nav button {
    padding: 6px 8px;
    font-size: 12px;
  }
  .sidebar nav button span {
    display: none;
  }
  .connection {
    padding: 0 4px;
  }
  main {
    padding: 20px 12px 22px;
  }
  .page-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .page-head p {
    font-size: 13px;
  }
  .metrics {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 7px;
  }
  .metrics>div, .metrics>button {
    min-height: 97px;
    padding: 9px;
  }
  .workspace-head, .filters {
    padding-inline: 12px;
  }
  .drawer-top, .lead-section {
    padding-inline: 14px;
  }
  table {
    min-width: 0;
  }
  th:nth-child(2), td:nth-child(2), th:nth-child(4), td:nth-child(4) {
    display: none;
  }
  th, td {
    padding-inline: 7px;
  }
  th:first-child, td:first-child {
    padding-left: 12px;
  }
}
