:root {
  --ink-950: #0b1720;
  --ink-900: #12232d;
  --ink-800: #1f3540;
  --ink-700: #334c58;
  --ink-600: #526a74;
  --ink-500: #70848d;
  --ink-400: #9aaab1;
  --ink-300: #c8d2d6;
  --ink-200: #dfe6e8;
  --ink-100: #edf1f2;
  --ink-50: #f6f8f8;
  --paper: #ffffff;
  --canvas: #f3f5f5;
  --accent-700: #a93813;
  --accent-600: #c74719;
  --accent-500: #e25b25;
  --accent-400: #ef7648;
  --accent-100: #ffdfd1;
  --accent-50: #fff3ed;
  --blue-700: #175ca8;
  --blue-100: #dceeff;
  --violet-700: #6941c6;
  --violet-100: #eee8ff;
  --green-700: #177451;
  --green-100: #d9f3e8;
  --amber-700: #9a5b08;
  --amber-100: #fff0cb;
  --red-700: #b42318;
  --red-100: #fee4e2;
  --shadow-xs: 0 1px 2px rgb(13 31 39 / 5%);
  --shadow-sm: 0 8px 24px rgb(13 31 39 / 7%);
  --shadow-lg: 0 28px 70px rgb(13 31 39 / 18%);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --sidebar-width: 250px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink-950);
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink-950);
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(226 91 37 / 28%);
  outline-offset: 2px;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink-950);
}

.brand > span:last-child {
  display: grid;
  line-height: 1.08;
}

.brand strong {
  font-size: 18px;
  font-weight: 790;
  letter-spacing: -.03em;
}

.brand small {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-500);
  color: #fff;
  box-shadow: 0 8px 22px rgb(226 91 37 / 22%);
}

.brand-mark svg {
  width: 23px;
  fill: currentColor;
  stroke: none;
}

.brand--light,
.brand--light small {
  color: #fff;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent-600);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 18px;
  height: 2px;
  border-radius: 9px;
  background: currentColor;
  content: "";
}

.eyebrow--light {
  color: #ffb494;
}

.primary-button,
.secondary-button,
.text-button,
.icon-button,
.menu-button,
.logout-button,
.dialog-close {
  cursor: pointer;
  transition: transform 160ms var(--ease), background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 760;
}

.primary-button {
  background: var(--accent-500);
  color: #fff;
  box-shadow: 0 6px 16px rgb(226 91 37 / 18%);
}

.primary-button:hover {
  background: var(--accent-600);
  box-shadow: 0 8px 22px rgb(226 91 37 / 24%);
  transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(0);
}

.primary-button:disabled {
  cursor: wait;
  opacity: .66;
  transform: none;
}

.primary-button svg,
.secondary-button svg {
  width: 17px;
  height: 17px;
}

.secondary-button {
  border: 1px solid var(--ink-200);
  background: var(--paper);
  color: var(--ink-800);
  box-shadow: var(--shadow-xs);
}

.secondary-button:hover {
  border-color: var(--ink-300);
  background: var(--ink-50);
}

/* Login */
.login-page {
  overflow-x: hidden;
  background: var(--paper);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, .92fr) minmax(480px, 1.08fr);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(32px, 5vw, 66px);
  background:
    radial-gradient(circle at 86% 18%, rgb(226 91 37 / 25%), transparent 30%),
    radial-gradient(circle at 15% 85%, rgb(255 255 255 / 8%), transparent 31%),
    linear-gradient(145deg, #10242d 0%, #162e37 58%, #0c1b22 100%);
  color: #fff;
  isolation: isolate;
}

.login-story::before,
.login-story::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 50%;
  content: "";
}

.login-story::before {
  width: 470px;
  height: 470px;
  top: 19%;
  right: -270px;
}

.login-story::after {
  width: 310px;
  height: 310px;
  right: -125px;
  bottom: -160px;
  box-shadow: 0 0 0 54px rgb(255 255 255 / 2.5%), 0 0 0 108px rgb(255 255 255 / 1.5%);
}

.story-grid {
  position: absolute;
  z-index: -2;
  inset: 0;
  background-image: linear-gradient(rgb(255 255 255 / 3.5%) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 3.5%) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 72%, transparent);
}

.story-copy {
  max-width: 580px;
  margin: auto 0;
  padding: 64px 0;
}

.story-copy h1 {
  max-width: 560px;
  margin: 18px 0 20px;
  font-size: clamp(36px, 4.8vw, 62px);
  font-weight: 760;
  letter-spacing: -.055em;
  line-height: 1.02;
}

.story-copy p {
  max-width: 515px;
  margin: 0;
  color: rgb(255 255 255 / 67%);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.65;
}

.story-proof {
  display: flex;
  max-width: 430px;
  align-items: center;
  gap: 14px;
  padding: 15px 17px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 13px;
  background: rgb(255 255 255 / 5%);
  backdrop-filter: blur(10px);
}

.story-proof p {
  margin: 0;
  color: rgb(255 255 255 / 56%);
  font-size: 12px;
  line-height: 1.5;
}

.story-proof strong {
  color: #fff;
  font-size: 13px;
}

.proof-dot {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: rgb(54 211 153 / 11%);
}

.proof-dot span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #36d399;
  box-shadow: 0 0 0 5px rgb(54 211 153 / 13%);
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(28px, 6vw, 88px);
  background: var(--paper);
}

.login-card {
  width: min(100%, 430px);
}

.mobile-brand {
  display: none;
  margin-bottom: 44px;
}

.login-heading h2 {
  margin: 12px 0 9px;
  color: var(--ink-950);
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 780;
  letter-spacing: -.04em;
  line-height: 1.15;
}

.login-heading p {
  margin: 0 0 31px;
  color: var(--ink-600);
  font-size: 14px;
}

.form-error {
  display: none;
  align-items: flex-start;
  gap: 11px;
  margin: -7px 0 21px;
  border: 1px solid #fecdca;
  border-radius: 10px;
  padding: 11px 13px;
  background: #fff5f4;
  color: var(--red-700);
  font-size: 13px;
}

.form-error.is-visible {
  display: flex;
}

.form-error > span {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--red-700);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.form-error p {
  margin: 0;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form > label,
.label-row label,
.field label {
  color: var(--ink-800);
  font-size: 12px;
  font-weight: 730;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-shell > svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--ink-500);
  pointer-events: none;
}

.input-shell input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--ink-300);
  border-radius: 9px;
  background: #fff;
  box-shadow: inset 0 1px 1px rgb(13 31 39 / 2%);
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.input-shell input {
  height: 48px;
  padding: 10px 46px 10px 43px;
}

.input-shell input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-400);
}

.input-shell:focus-within input,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent-500);
  outline: 0;
  box-shadow: 0 0 0 4px rgb(226 91 37 / 10%);
}

.password-toggle {
  position: absolute;
  right: 8px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-500);
  cursor: pointer;
}

.password-toggle:hover {
  background: var(--ink-100);
  color: var(--ink-800);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.login-submit {
  width: 100%;
  min-height: 49px;
  justify-content: space-between;
  margin-top: 15px;
  padding-inline: 18px;
  font-size: 14px;
}

.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 25px;
  color: var(--ink-500);
  font-size: 11px;
}

.secure-note svg {
  width: 15px;
  height: 15px;
  color: var(--green-700);
}

/* App shell */
.app-page {
  overflow-x: hidden;
  background: var(--canvas);
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  z-index: 40;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid rgb(255 255 255 / 5%);
  padding: 25px 17px 18px;
  background: linear-gradient(180deg, #142832 0%, #10222b 100%);
  color: #fff;
}

.sidebar-brand {
  margin: 0 9px 37px;
  color: #fff;
}

.sidebar-brand small {
  color: rgb(255 255 255 / 49%);
}

.nav-list {
  display: grid;
  gap: 5px;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  border-radius: 9px;
  padding: 9px 11px;
  background: transparent;
  color: rgb(255 255 255 / 61%);
  cursor: pointer;
  font-size: 13px;
  font-weight: 620;
  text-align: left;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms var(--ease);
}

.nav-item svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.nav-item:hover {
  background: rgb(255 255 255 / 5%);
  color: #fff;
  transform: translateX(2px);
}

.nav-item.is-active {
  background: rgb(226 91 37 / 15%);
  color: #fff;
}

.nav-item.is-active::before {
  position: absolute;
  left: -17px;
  width: 3px;
  height: 24px;
  border-radius: 0 8px 8px 0;
  background: var(--accent-400);
  content: "";
}

.nav-badge {
  min-width: 21px;
  margin-left: auto;
  border-radius: 999px;
  padding: 2px 6px;
  background: var(--accent-500);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.sidebar-footer {
  display: grid;
  gap: 13px;
  margin-top: auto;
}

.system-state {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 10px;
  padding: 11px;
  background: rgb(255 255 255 / 3.5%);
}

.system-state > div:last-child {
  display: grid;
}

.system-state strong {
  font-size: 11px;
  font-weight: 700;
}

.system-state small {
  margin-top: 2px;
  color: rgb(255 255 255 / 43%);
  font-size: 9px;
}

.status-light {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #36d399;
  box-shadow: 0 0 0 4px rgb(54 211 153 / 11%);
}

.logout-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 9px 11px;
  background: transparent;
  color: rgb(255 255 255 / 48%);
  font-size: 11px;
  text-align: left;
}

.logout-button:hover {
  background: rgb(255 255 255 / 5%);
  color: #fff;
}

.logout-button svg {
  width: 17px;
  height: 17px;
}

.app-main {
  min-width: 0;
  grid-column: 2;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  height: 72px;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--ink-200);
  padding: 0 clamp(20px, 3vw, 42px);
  background: rgb(255 255 255 / 91%);
  backdrop-filter: blur(16px);
}

.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 9px;
  background: var(--ink-100);
  color: var(--ink-800);
}

.menu-button svg {
  width: 20px;
  height: 20px;
}

.global-search,
.local-search {
  position: relative;
  display: flex;
  align-items: center;
}

.global-search {
  width: min(440px, 46vw);
}

.global-search > svg,
.local-search > svg {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--ink-500);
  pointer-events: none;
}

.global-search input,
.local-search input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--ink-50);
  color: var(--ink-900);
}

.global-search input {
  height: 40px;
  padding: 8px 54px 8px 40px;
}

.global-search input:focus,
.local-search input:focus {
  border-color: var(--accent-400);
  outline: 0;
  background: #fff;
  box-shadow: 0 0 0 4px rgb(226 91 37 / 8%);
}

.global-search input::placeholder,
.local-search input::placeholder {
  color: var(--ink-500);
}

.global-search kbd {
  position: absolute;
  right: 9px;
  border: 1px solid var(--ink-200);
  border-radius: 5px;
  padding: 2px 5px;
  background: #fff;
  color: var(--ink-500);
  font-family: inherit;
  font-size: 9px;
  box-shadow: 0 1px 1px rgb(13 31 39 / 5%);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-left: auto;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--ink-200);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-600);
}

.icon-button:hover {
  border-color: var(--ink-300);
  background: var(--ink-50);
  color: var(--ink-900);
}

.icon-button.is-spinning svg {
  animation: spin 700ms linear infinite;
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 2px;
}

.user-chip > span:last-child {
  display: grid;
}

.user-chip strong {
  max-width: 130px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip small {
  color: var(--ink-500);
  font-size: 9px;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--ink-900);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.content {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: clamp(26px, 3.5vw, 46px) clamp(20px, 3.2vw, 48px) 72px;
}

.page {
  display: none;
  animation: page-in 260ms var(--ease) both;
}

.page.is-active {
  display: block;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 27px;
}

.page-heading h1 {
  margin: 7px 0 4px;
  color: var(--ink-950);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 780;
  letter-spacing: -.045em;
  line-height: 1.12;
}

.page-heading p {
  margin: 0;
  color: var(--ink-600);
  font-size: 13px;
}

.heading-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  display: flex;
  min-height: 126px;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  padding: 19px;
  background: var(--paper);
  box-shadow: var(--shadow-xs);
  transition: border-color 180ms ease, transform 180ms var(--ease), box-shadow 180ms ease;
}

.metric-card:hover {
  border-color: var(--ink-300);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.metric-icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
}

.metric-icon svg {
  width: 20px;
  height: 20px;
}

.metric-card--blue .metric-icon { background: var(--blue-100); color: var(--blue-700); }
.metric-card--violet .metric-icon { background: var(--violet-100); color: var(--violet-700); }
.metric-card--orange .metric-icon { background: var(--accent-100); color: var(--accent-700); }
.metric-card--green .metric-icon { background: var(--green-100); color: var(--green-700); }

.metric-card > div:last-child {
  display: grid;
}

.metric-card span {
  color: var(--ink-600);
  font-size: 11px;
  font-weight: 650;
}

.metric-card strong {
  margin: 2px 0 1px;
  color: var(--ink-950);
  font-size: 27px;
  font-weight: 790;
  letter-spacing: -.04em;
  line-height: 1.12;
}

.metric-card small {
  color: var(--ink-400);
  font-size: 9px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  padding: 21px;
  background: var(--paper);
  box-shadow: var(--shadow-xs);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.panel-heading h2 {
  margin: 0 0 3px;
  color: var(--ink-900);
  font-size: 14px;
  font-weight: 760;
  letter-spacing: -.015em;
}

.panel-heading p {
  margin: 0;
  color: var(--ink-500);
  font-size: 10px;
}

.text-button {
  flex: 0 0 auto;
  padding: 3px 0;
  background: transparent;
  color: var(--accent-600);
  font-size: 10px;
  font-weight: 760;
}

.text-button:hover {
  color: var(--accent-700);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 9px;
  font-weight: 730;
}

.live-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #20a46f;
  animation: breathe 1.8s ease-in-out infinite;
}

.pipeline {
  display: grid;
  min-height: 184px;
  align-items: end;
}

.pipeline-chart {
  display: grid;
  height: 170px;
  align-items: end;
  gap: 12px;
  grid-template-columns: repeat(4, 1fr);
}

.pipeline-stage {
  display: grid;
  height: 100%;
  align-content: end;
  gap: 8px;
}

.pipeline-stage strong {
  color: var(--ink-900);
  font-size: 14px;
}

.pipeline-bar-shell {
  display: flex;
  height: 108px;
  align-items: end;
  overflow: hidden;
  border-radius: 8px;
  background: var(--ink-50);
}

.pipeline-bar {
  width: 100%;
  min-height: 5px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--accent-400), var(--accent-600));
  animation: grow-up 520ms var(--ease) both;
}

.pipeline-stage span {
  overflow: hidden;
  color: var(--ink-500);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-list,
.activity-list {
  display: grid;
  gap: 9px;
}

.priority-item,
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border-radius: 9px;
  padding: 10px;
  background: var(--ink-50);
}

.priority-mark,
.activity-mark {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-100);
  color: var(--accent-700);
  font-size: 10px;
  font-weight: 800;
}

.priority-item > div:last-child,
.activity-item > div:last-child {
  min-width: 0;
}

.priority-item strong,
.activity-item strong {
  display: block;
  overflow: hidden;
  color: var(--ink-800);
  font-size: 10px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-item p,
.activity-item p {
  display: -webkit-box;
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--ink-500);
  font-size: 9px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.activity-list {
  grid-template-columns: repeat(3, 1fr);
}

.activity-item {
  border: 1px solid var(--ink-100);
  background: #fff;
}

.activity-mark {
  background: var(--blue-100);
  color: var(--blue-700);
}

.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 28px;
  color: var(--ink-500);
  text-align: center;
}

.empty-state > div {
  max-width: 330px;
}

.empty-state-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  place-items: center;
  border-radius: 14px;
  background: var(--ink-100);
  color: var(--ink-600);
  font-size: 20px;
}

.empty-state strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-800);
  font-size: 13px;
}

.empty-state p {
  margin: 0;
  font-size: 11px;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--ink-100);
  padding: 14px 17px;
}

.local-search {
  width: min(380px, 70%);
}

.local-search input {
  height: 37px;
  padding: 7px 11px 7px 39px;
}

.result-count {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 650;
}

.responsive-table {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.data-table th {
  padding: 11px 16px;
  background: var(--ink-50);
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 790;
  letter-spacing: .075em;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  border-top: 1px solid var(--ink-100);
  padding: 13px 16px;
  color: var(--ink-700);
  font-size: 11px;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 140ms ease;
}

.data-table tbody tr:hover {
  background: #fbfcfc;
}

.cell-title {
  display: block;
  color: var(--ink-900);
  font-size: 11px;
  font-weight: 710;
}

.cell-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 9px;
}

.status-pill,
.urgency-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--ink-100);
  color: var(--ink-700);
  font-size: 9px;
  font-weight: 720;
  text-transform: capitalize;
}

.status-pill::before,
.urgency-pill::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status--active,
.status--won,
.status--resolved { background: var(--green-100); color: var(--green-700); }
.status--pending,
.status--new { background: var(--amber-100); color: var(--amber-700); }
.status--lost,
.urgency--critical { background: var(--red-100); color: var(--red-700); }
.status--progress,
.urgency--high { background: var(--accent-100); color: var(--accent-700); }
.status--open { background: var(--blue-100); color: var(--blue-700); }

.row-action {
  border: 1px solid var(--ink-200);
  border-radius: 7px;
  padding: 6px 9px;
  background: #fff;
  color: var(--ink-700);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.row-action:hover {
  border-color: var(--accent-400);
  color: var(--accent-700);
}

.kanban {
  display: grid;
  align-items: start;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  overflow-x: auto;
  padding-bottom: 10px;
}

.kanban-column {
  min-height: 420px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  padding: 12px;
  background: #ebefef;
}

.kanban-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 3px 12px;
  color: var(--ink-700);
  font-size: 10px;
  font-weight: 760;
}

.kanban-count {
  display: grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 999px;
  background: rgb(255 255 255 / 75%);
  font-size: 9px;
}

.kanban-cards {
  display: grid;
  gap: 9px;
}

.lead-card {
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  padding: 13px;
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.lead-card:hover {
  border-color: var(--ink-300);
  box-shadow: var(--shadow-sm);
}

.lead-card strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-900);
  font-size: 11px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lead-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  margin-top: 10px;
  color: var(--ink-500);
  font-size: 9px;
}

.lead-owner {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 13px;
  border-top: 1px solid var(--ink-100);
  padding-top: 10px;
  color: var(--ink-600);
  font-size: 9px;
}

.lead-owner span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 6px;
  background: var(--violet-100);
  color: var(--violet-700);
  font-weight: 800;
}

.lead-owner .row-action {
  margin-left: auto;
}

.conversation-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.conversation-card {
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.conversation-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.channel-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green-700);
  font-size: 9px;
  font-weight: 760;
  text-transform: capitalize;
}

.channel-badge::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #20a46f;
  content: "";
}

.conversation-card time {
  color: var(--ink-400);
  font-size: 8px;
}

.conversation-card p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 54px;
  margin: 0;
  color: var(--ink-700);
  font-size: 11px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.conversation-card footer {
  margin-top: 14px;
  border-top: 1px solid var(--ink-100);
  padding-top: 10px;
  color: var(--ink-500);
  font-size: 9px;
}

.entity-dialog {
  width: min(94vw, 570px);
  max-height: 90vh;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  background: transparent;
  box-shadow: var(--shadow-lg);
}

.entity-dialog::backdrop {
  background: rgb(8 20 26 / 58%);
  backdrop-filter: blur(4px);
}

.entity-dialog[open] {
  animation: dialog-in 220ms var(--ease) both;
}

.dialog-shell {
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  background: #fff;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.dialog-heading h2 {
  margin: 7px 0 3px;
  font-size: 22px;
  font-weight: 780;
  letter-spacing: -.035em;
}

.dialog-heading p {
  margin: 0;
  color: var(--ink-500);
  font-size: 11px;
}

.dialog-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--ink-100);
  color: var(--ink-600);
}

.dialog-close:hover {
  background: var(--ink-200);
  color: var(--ink-900);
}

.dialog-close svg {
  width: 17px;
  height: 17px;
}

.dialog-fields {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 6px;
}

.field--wide {
  grid-column: 1 / -1;
}

.field input,
.field select,
.field textarea {
  min-height: 43px;
  padding: 9px 11px;
  font-size: 12px;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field-hint {
  color: var(--ink-500);
  font-size: 9px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
  border-top: 1px solid var(--ink-100);
  padding-top: 18px;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 22px;
  bottom: 22px;
  display: flex;
  max-width: min(420px, calc(100vw - 32px));
  align-items: center;
  gap: 10px;
  border: 1px solid rgb(255 255 255 / 11%);
  border-radius: 11px;
  padding: 12px 15px;
  background: var(--ink-900);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 11px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity 200ms ease, transform 220ms var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: var(--red-700);
}

.toast-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: rgb(255 255 255 / 15%);
  font-size: 10px;
}

.sidebar-scrim {
  display: none;
}

.skeleton {
  height: 48px;
  border-radius: 9px;
  background: linear-gradient(100deg, var(--ink-100) 30%, #f9fbfb 48%, var(--ink-100) 66%);
  background-size: 220% 100%;
  animation: shimmer 1.35s linear infinite;
}

.skeleton--chart {
  height: 165px;
}

.load-error {
  display: grid;
  min-height: 250px;
  place-items: center;
  border: 1px dashed #fda29b;
  border-radius: var(--radius-md);
  padding: 30px;
  background: #fff8f7;
  color: var(--red-700);
  text-align: center;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shimmer {
  to { background-position-x: -220%; }
}

@keyframes grow-up {
  from { height: 0; }
}

@keyframes breathe {
  50% { opacity: .45; transform: scale(.82); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-list,
  .conversation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .login-shell {
    grid-template-columns: minmax(320px, .85fr) minmax(420px, 1.15fr);
  }

  .story-copy h1 {
    font-size: 42px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    width: min(290px, 84vw);
    box-shadow: 20px 0 55px rgb(8 20 26 / 30%);
    transform: translateX(-105%);
    transition: transform 220ms var(--ease);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .app-main {
    grid-column: auto;
  }

  .menu-button {
    display: grid;
    flex: 0 0 auto;
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 35;
    inset: 0;
    background: rgb(8 20 26 / 48%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .sidebar-scrim.is-visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .login-shell {
    display: block;
  }

  .login-story {
    display: none;
  }

  .login-panel {
    min-height: 100svh;
    align-items: start;
    padding: 42px 22px;
  }

  .login-card {
    margin: auto;
  }

  .mobile-brand {
    display: inline-flex;
  }

  .topbar {
    height: 64px;
    gap: 10px;
    padding-inline: 15px;
  }

  .global-search {
    width: auto;
    flex: 1;
  }

  .global-search kbd,
  .user-chip > span:last-child {
    display: none;
  }

  .user-chip {
    display: none;
  }

  .content {
    padding: 26px 15px 64px;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .heading-actions,
  .heading-actions > button,
  .page-heading > .primary-button {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 104px;
  }

  .activity-list,
  .conversation-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-chart {
    gap: 7px;
  }

  .panel {
    padding: 17px;
  }

  .table-panel {
    padding: 0;
  }

  .local-search {
    width: 100%;
  }

  .result-count {
    display: none;
  }

  .dialog-shell {
    padding: 21px;
  }

  .dialog-fields {
    grid-template-columns: 1fr;
  }

  .field--wide {
    grid-column: auto;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions button {
    width: 100%;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }
}

@media (max-width: 430px) {
  .global-search input {
    padding-right: 10px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .page-heading h1 {
    font-size: 28px;
  }

  .metric-grid {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Data components rendered by app.js */
.nav-badge:not(.is-visible) {
  display: none;
}

.icon-button.is-loading svg {
  animation: spin 700ms linear infinite;
}

.pipeline {
  align-items: stretch;
  align-content: center;
  gap: 12px;
}

.pipeline-row {
  display: grid;
  align-items: center;
  gap: 12px;
  grid-template-columns: 82px minmax(80px, 1fr) 24px;
}

.pipeline-label {
  overflow: hidden;
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 680;
  text-overflow: ellipsis;
  text-transform: capitalize;
  white-space: nowrap;
}

.pipeline-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ink-100);
}

.pipeline-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-500), var(--accent-400));
  box-shadow: 5px 0 12px rgb(226 91 37 / 18%);
  transition: width 520ms var(--ease);
}

.pipeline-value {
  color: var(--ink-800);
  font-size: 11px;
  font-weight: 780;
  text-align: right;
}

.priority-avatar,
.entity-avatar,
.activity-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  font-weight: 800;
}

.priority-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-100);
  color: var(--accent-700);
  font-size: 9px;
}

.priority-copy,
.activity-copy {
  min-width: 0;
  flex: 1;
}

.priority-copy strong,
.activity-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink-800);
  font-size: 10px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-copy small,
.activity-copy small {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 9px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.urgency-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ink-400);
}

.urgency-dot--alta { background: var(--accent-500); box-shadow: 0 0 0 4px var(--accent-100); }
.urgency-dot--critica { background: var(--red-700); box-shadow: 0 0 0 4px var(--red-100); }

.activity-icon {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 11px;
}

.empty-state-icon svg {
  width: 22px;
  height: 22px;
}

.entity-cell {
  display: flex;
  min-width: 160px;
  align-items: center;
  gap: 10px;
}

.entity-cell > span:last-child {
  min-width: 0;
}

.entity-cell strong,
.entity-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-cell strong {
  color: var(--ink-900);
  font-size: 11px;
  font-weight: 720;
}

.entity-cell small {
  max-width: 180px;
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 9px;
}

.entity-avatar {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: var(--ink-100);
  color: var(--ink-700);
  font-size: 9px;
}

.status-chip,
.channel-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--ink-100);
  color: var(--ink-700);
  font-size: 9px;
  font-weight: 720;
  text-transform: capitalize;
  white-space: nowrap;
}

.status-chip::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-chip--activo,
.status-chip--cliente,
.status-chip--ganado,
.status-chip--resuelto { background: var(--green-100); color: var(--green-700); }
.status-chip--prospecto,
.status-chip--nuevo,
.status-chip--pendiente,
.status-chip--normal { background: var(--amber-100); color: var(--amber-700); }
.status-chip--contactado,
.status-chip--calificado,
.status-chip--abierta { background: var(--blue-100); color: var(--blue-700); }
.status-chip--propuesta,
.status-chip--negociacion,
.status-chip--alta { background: var(--accent-100); color: var(--accent-700); }
.status-chip--perdido,
.status-chip--cerrado,
.status-chip--cerrada,
.status-chip--critica { background: var(--red-100); color: var(--red-700); }

.row-actions {
  display: flex;
  justify-content: flex-end;
}

.mini-button,
.lead-meta button {
  border: 1px solid var(--ink-200);
  border-radius: 7px;
  padding: 6px 8px;
  background: #fff;
  color: var(--ink-700);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.mini-button:hover,
.lead-meta button:hover {
  border-color: var(--accent-400);
  color: var(--accent-700);
}

.mini-button:disabled,
.lead-meta button:disabled {
  cursor: wait;
  opacity: .55;
}

.kanban-heading > span {
  display: grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 999px;
  background: rgb(255 255 255 / 78%);
  font-size: 9px;
}

.lead-card h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink-900);
  font-size: 11px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.lead-card > p {
  overflow: hidden;
  margin: 7px 0 0;
  color: var(--ink-500);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
  border-top: 1px solid var(--ink-100);
  padding-top: 10px;
}

.lead-meta strong {
  color: var(--ink-700);
  font-size: 9px;
}

.conversation-top,
.conversation-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.conversation-top {
  margin-bottom: 13px;
}

.channel-chip {
  background: var(--green-100);
  color: var(--green-700);
}

.conversation-footer {
  margin-top: 14px;
  border-top: 1px solid var(--ink-100);
  padding-top: 10px;
  color: var(--ink-500);
  font-size: 9px;
}
