:root {
  --ink: #142641;
  --muted: #50627c;
  --action: #174ece;
  --accent: #1356bd;
  --line: #d5dfed;
  --control-line: #adbfd5;
  --paper: #ffffff;
  --wash: #f2f6fc;
  --surface-alt: #eaf1fa;
  --field: #ffffff;
  --tint: #dceaff;
  --label: #334966;
  --focus: #1689db;
  --red: #9e342f;
  --warm-bg: #fff0d9;
  --warm-text: #73420c;
  --danger-bg: #ffebe8;
  --danger-text: #9a3433;
  --hero: linear-gradient(115deg, #051d46, #073c91 67%, #0956b4);
  --rail: linear-gradient(167deg, #0b244a, #061a38 55%, #06122a);
  --shadow: 0 18px 65px #0820472e;
  color-scheme: light;
  font:
    15px/1.45 "Inter",
    "Segoe UI",
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--wash);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8f1ff;
  --muted: #abc0dc;
  --action: #235bcb;
  --accent: #81bdff;
  --line: #2b425e;
  --control-line: #536c8b;
  --paper: #122339;
  --wash: #091321;
  --surface-alt: #1a304a;
  --field: #0c1c30;
  --tint: #18375c;
  --label: #cddef1;
  --focus: #69c9ff;
  --red: #ffaaa2;
  --warm-bg: #432f16;
  --warm-text: #ffd28c;
  --danger-bg: #482b35;
  --danger-text: #ffb6ad;
  --hero: linear-gradient(115deg, #0d2445, #123979 67%, #114888);
  --rail: linear-gradient(167deg, #091931, #061125 85%);
  --shadow: 0 18px 65px #00000066;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
button {
  color: inherit;
}
a {
  color: var(--accent);
}
[hidden] {
  display: none !important;
}
svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(30px, 3.1vw, 45px);
  line-height: 1.08;
  letter-spacing: -0.052em;
  font-weight: 630;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.035em;
}
h3 {
  font-size: 15px;
}
.eyebrow,
.org-label,
.nav-group,
.kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.eyebrow,
.kicker {
  color: var(--accent);
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand-symbol, .brand-name {
  display: inline-block;
  flex: none;
  background: url("iconlay.webp") no-repeat;
}
/* Two crops of the supplied square lockup form a compact horizontal signature. */
.brand-symbol {
  width: 26px;
  height: 36px;
  background-size: 52px 52px;
  background-position: -13px -5px;
}
.brand-name {
  width: 97px;
  height: 18px;
  background-size: 106px 106px;
  background-position: -4px -84px;
}
.brand-lockup b {
  padding: 2px 5px;
  border: 1px solid #476994;
  border-radius: 4px;
  color: #c8e6ff;
  font-size: 10px;
  letter-spacing: .08em;
}
#shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}
#sidebar {
  background: var(--rail);
  color: #fff;
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 28px 16px 16px;
  z-index: 4;
}
#sidebar .wordmark {
  margin: 0 10px 32px;
}
.org-label {
  color: #c2d7f1;
  margin: 0 9px 6px;
}
#org {
  background: #12325b;
  border: 1px solid #4b6b92;
  color: #fff;
  width: 100%;
  font-size: 14px;
  margin-bottom: 20px;
}
#nav {
  overflow-y: auto;
  scrollbar-width: thin;
  flex: 1;
}
.nav-group {
  color: #a9c4e7;
  margin: 20px 11px 6px;
}
.nav-group:first-child {
  margin-top: 0;
}
.nav-link {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  width: 100%;
  border: 0;
  background: none;
  color: #e2edff;
  padding: 9px 11px;
  border-radius: 6px;
  font-size: 14px;
}
.nav-link:hover {
  background: #163961;
}
.nav-link.active {
  background: #204f97;
  color: #ffffff;
  font-weight: 650;
}
.work {
  min-width: 0;
}
header {
  height: 65px;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  padding: 0 clamp(16px, 3.2vw, 48px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.crumb {
  font-size: 13px;
  color: var(--muted);
}
.crumb span {
  margin: 0 10px;
  color: var(--muted);
}
.crumb b {
  color: var(--ink);
  font-weight: 600;
}
.header-right,
.actions,
.pills,
.controls,
.row,
.section-head,
.pager {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.header-right {
  margin-left: auto;
}
.iconbtn,
.searchbtn,
.avatar,
.btn,
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 37px;
  padding: 7px 12px;
  font-weight: 550;
  font-size: 13px;
}
.iconbtn {
  width: 38px;
  padding: 6px;
}
.searchbtn {
  background: var(--wash);
  color: var(--muted);
}
.avatar {
  border-radius: 50%;
  background: var(--tint);
  color: var(--accent);
  width: 35px;
  min-height: 35px;
}
.mobile {
  display: none;
}
#main {
  max-width: 1650px;
  margin: auto;
  padding: clamp(20px, 2.6vw, 42px) clamp(16px, 3.2vw, 48px) 60px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 15px;
  flex-wrap: wrap;
  margin: 4px 0 22px;
}
.page-head .eyebrow {
  margin-bottom: 7px;
}
.btn:hover,
.tab:hover,
.iconbtn:hover {
  border-color: var(--accent);
}
.btn.primary,
.login-submit input {
  background: var(--action);
  color: white;
  border: 1px solid var(--action);
}
.btn.ghost {
  border: 0;
  background: none;
  color: var(--accent);
}
.btn.small {
  min-height: 31px;
  padding: 4px 9px;
}
.box,
.metric,
.hero {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  min-width: 0;
}
.box {
  padding: 20px;
}
.box + .box {
  margin-top: 14px;
}
.section-head {
  justify-content: space-between;
  margin-bottom: 15px;
}
.muted,
small {
  color: var(--muted);
}
.filters {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 17px;
}
.filters label,
.field {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--label);
}
.filters select,
.filters input {
  max-width: 230px;
}
.filter-box {
  margin-bottom: 15px;
}
.filters .btn {
  min-height: 39px;
}
input,
textarea,
select {
  border: 1px solid var(--control-line);
  background: var(--field);
  color: var(--ink);
  border-radius: 6px;
  min-height: 39px;
  padding: 7px 10px;
  max-width: 100%;
}
textarea {
  resize: vertical;
  min-height: 70px;
}
.field select[multiple] {
  min-height: 96px;
}
.field.check {
  display: flex;
  align-items: center;
  gap: 7px;
}
.field.check input {
  min-height: 18px;
  width: 18px;
}
.hero {
  background: var(--hero);
  color: #fff;
  padding: 24px 26px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 13px;
}
.hero:after {
  content: "";
  position: absolute;
  width: 145px;
  height: 145px;
  right: 23%;
  bottom: -95px;
  transform: rotate(-26deg);
  border: 1px solid #89caff66;
  box-shadow:
    0 0 0 10px #183e801a,
    0 0 0 11px #8ed8ff4d,
    0 0 0 21px #19468112,
    0 0 0 22px #77b8ff44;
  pointer-events: none;
}
.hero .kicker {
  color: #b2e7ff;
}
.hero strong {
  display: block;
  font-size: clamp(28px, 3vw, 44px);
  letter-spacing: -0.05em;
}
.hero small {
  color: #d0e8ff;
}
.hero > div {
  z-index: 1;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.metric {
  padding: 16px;
}
.metric .metric-label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.metric strong {
  display: block;
  font-size: 31px;
  letter-spacing: -0.05em;
  margin-top: 7px;
}
.split {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: 15px;
  align-items: start;
  margin-bottom: 15px;
}
.split > .box {
  margin: 0;
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) 1.1fr 32px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin: 11px 0;
}
.track {
  background: var(--surface-alt);
  height: 8px;
  border-radius: 3px;
  overflow: hidden;
}
.fill {
  height: 100%;
  background: linear-gradient(90deg, #1754db, #189ad8);
  border-radius: 3px;
}
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 11px 0;
}
.list-row:last-child {
  border-bottom: 0;
}
.list-row small {
  display: block;
}
.chip {
  display: inline-block;
  border-radius: 20px;
  background: var(--tint);
  color: var(--accent);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.chip.warm {
  background: var(--warm-bg);
  color: var(--warm-text);
}
.chip.cold {
  background: var(--tint);
  color: var(--accent);
}
.chip.danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}
.empty {
  color: var(--muted);
  font-size: 14px;
  padding: 18px 0;
}
.scroll {
  overflow-x: auto;
  max-width: 100%;
}
table {
  border-collapse: collapse;
  text-align: left;
  width: 100%;
  font-size: 13px;
}
th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 650;
  background: var(--surface-alt);
}
th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td:first-child {
  font-weight: 570;
}
.link {
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 650;
  padding: 3px 0;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--control-line);
  text-underline-offset: 3px;
}
.pager {
  justify-content: space-between;
  padding-top: 12px;
}
.tabs {
  display: inline-flex;
  background: var(--surface-alt);
  border-radius: 7px;
  padding: 3px;
}
.tab {
  background: transparent;
  border: 0;
  min-height: 30px;
}
.tab.active {
  background: var(--paper);
  box-shadow: 0 1px 4px #10244224;
}
.board {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 5px 0 16px;
}
.lane {
  min-width: 210px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
}
.lane > h3 {
  margin: 3px 0 12px;
}
.card {
  width: 100%;
  text-align: left;
  display: block;
  margin: 7px 0;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.card small {
  display: block;
}
.form-grid,
.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.full {
  grid-column: 1/-1;
}
.form-actions,
.subsection {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 15px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.subsection h3 {
  margin-bottom: 9px;
}
.details {
  margin: 12px 0;
}
.details dt {
  font-size: 11px;
  color: var(--muted);
}
.details dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.inline-error {
  color: var(--red);
  font-size: 13px;
  white-space: pre-wrap;
  margin-top: 10px;
}
.inline-error:empty {
  display: none;
}
dialog {
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0;
  max-width: min(690px, 94vw);
  width: 650px;
  max-height: 90dvh;
  box-shadow: var(--shadow);
  background: var(--paper);
}
dialog::backdrop {
  background: #030e20ac;
}
.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 21px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 2;
}
.dialog-top h2 {
  overflow-wrap: anywhere;
}
#dialog-body {
  padding: 18px 21px;
}
.history {
  list-style: none;
  padding: 0;
  margin: 0;
}
.history li {
  border-left: 2px solid var(--control-line);
  padding: 2px 0 10px 12px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.history small {
  display: block;
}
.folder-img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--action);
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  display: none;
  z-index: 10;
}
#toast.on {
  display: block;
}
#scrim {
  position: fixed;
  inset: 0;
  background: #020a18a8;
  border: 0;
  z-index: 3;
}
.login-layout {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-art {
  padding: 6vw;
  background: var(--hero);
  color: #ebf4ff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}
.login-art h1 {
  font-size: clamp(40px, 5.6vw, 90px);
  z-index: 1;
}
.architecture {
  height: 45vh;
  display: flex;
  gap: 13px;
  align-items: end;
  transform: skewY(-17deg);
  opacity: 0.75;
}
.architecture i {
  width: 20%;
  height: 70%;
  border: 1px solid #7bbdff;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 12px,
    #79bfff44 13px
  );
}
.architecture i:nth-child(2) {
  height: 100%;
}
.architecture i:nth-child(3) {
  height: 84%;
}
.login-panel {
  position: relative;
  background: var(--paper);
  display: grid;
  align-items: center;
  justify-content: center;
  padding: 25px;
}
.login-panel .login-form {
  width: min(340px, 85vw);
}
.login-panel h2 {
  font-size: 40px;
  margin: 8px 0 18px;
}
.login-panel p {
  margin: 12px 0;
}
.login-panel label {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.login-panel input:not([type="checkbox"]) {
  width: 100%;
}
.login-remember input {
  vertical-align: middle;
  min-height: 1em;
}
.login-panel a {
  font-size: 13px;
}
@media (max-width: 1050px) {
  #shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  #sidebar {
    padding-left: 10px;
    padding-right: 10px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 760px) {
  #shell {
    display: block;
  }
  #sidebar {
    position: fixed;
    left: 0;
    width: 245px;
    transform: translateX(-105%);
  }
  body.nav-open #sidebar {
    transform: translateX(0);
  }
  .mobile {
    display: inline-flex;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .crumb {
    font-size: 12px;
  }
  .hero {
    padding: 18px;
  }
  .login-layout {
    grid-template-columns: 1fr;
  }
  .login-art {
    min-height: 26vh;
    padding: 24px;
  }
  .login-art h1 {
    font-size: 38px;
  }
  .architecture {
    display: none;
  }
  .login-panel {
    align-items: start;
  }
  .page-head {
    align-items: start;
  }
  .searchbtn span:last-child {
    display: none;
  }
  .form-grid,
  .details {
    gap: 10px;
  }
  .filters label {
    min-width: 0;
  }
  .filters input,
  .filters select {
    max-width: 150px;
  }
  .box {
    padding: 15px;
  }
  header {
    padding: 0 13px;
    gap: 6px;
  }
  .hero:after {
    right: 10%;
  }
}
@media (max-width: 440px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    align-items: start;
    flex-direction: column;
  }
  .metrics {
    gap: 8px;
  }
  .metric {
    padding: 12px;
  }
  .crumb > span,
  .crumb {
    font-size: 0;
  }
  .crumb b {
    font-size: 13px;
  }
  .page-head h1 {
    font-size: 31px;
  }
  #dialog-body {
    padding: 15px;
  }
  .filters input {
    max-width: 137px;
  }
  .searchbtn {
    font-size: 18px;
  }
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 5px 8px;
  color: var(--label);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
}
.theme-switch:hover { background: var(--surface-alt); }
.switch-track {
  position: relative;
  width: 30px;
  height: 18px;
  border: 1px solid var(--control-line);
  border-radius: 20px;
  background: var(--surface-alt);
}
.switch-track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  width: 10px;
  height: 10px;
  background: var(--muted);
}
[data-theme="dark"] .switch-track { background: #235bcb; border-color: #85bfff; }
[data-theme="dark"] .switch-track::after { left: 15px; background: #fff; }
.login-preference { position: absolute; right: 22px; top: 17px; }
.login-panel { padding-top: 70px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"] { accent-color: var(--action); }
#org { color-scheme: dark; }
@media (max-width: 760px) {
  .header-right .switch-label { display: none; }
  .header-right { gap: 5px; }
  .login-panel { align-content: start; }
  .login-preference { right: 14px; top: 8px; }
}
@media (max-width: 370px) {
  header .crumb { display: none; }
}
.import-leads-form { display: grid; gap: 12px; margin-top: 16px; }
.import-leads-form .tabs { justify-self: start; }
.import-leads-form textarea { width: 100%; font-family: ui-monospace, monospace; }
.import-preview { min-width: 0; }
.import-preview:empty { display: none; }
.import-preview h3 { margin-bottom: 8px; }
