:root {
  --ink-950: #0b1f33;
  --ink-900: #17324d;
  --ink-800: #29445d;
  --ink-700: #405a70;
  --ink-600: #536b7e;
  --ink-500: #697f90;
  --ink-400: #7d91a0;
  --ink-300: #becdd8;
  --ink-200: #dbe6ee;
  --ink-100: #eaf1f6;
  --ink-50: #f5f9fc;
  --paper: #ffffff;
  --canvas: #f3f7fa;
  --accent-700: #06476a;
  --accent-600: #075985;
  --accent-500: #075985;
  --accent-400: #0e7490;
  --accent-100: #e0f2fe;
  --accent-50: #f0f9ff;
  --orange-600: #c2410c;
  --orange-500: #f97316;
  --blue-700: #075985;
  --blue-100: #e0f2fe;
  --violet-700: #6d28d9;
  --violet-100: #ede9fe;
  --green-700: #166534;
  --green-100: #dcfce7;
  --amber-700: #92400e;
  --amber-100: #fef3c7;
  --red-700: #991b1b;
  --red-100: #fee2e2;
  --shadow-xs: 0 1px 2px rgb(11 31 51 / 5%);
  --shadow-sm: 0 8px 24px rgb(11 31 51 / 8%);
  --shadow-lg: 0 28px 70px rgb(11 31 51 / 19%);
  --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(14 116 144 / 34%);
  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(7 89 133 / 24%);
}

.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: var(--orange-500);
}

.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(7 89 133 / 20%);
}

.primary-button:hover {
  background: var(--accent-600);
  box-shadow: 0 8px 22px rgb(7 89 133 / 28%);
  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(252 179 86 / 28%), transparent 30%),
    radial-gradient(circle at 15% 85%, rgb(255 255 255 / 8%), transparent 31%),
    linear-gradient(145deg, #17324d 0%, #0b1f33 58%, #071421 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(72 168 31 / 13%);
}

.proof-dot span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #48a81f;
  box-shadow: 0 0 0 5px rgb(72 168 31 / 15%);
}

.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(11 31 51 / 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(14 116 144 / 12%);
}

.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, #17324d 0%, #0b1f33 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(252 179 86 / 18%);
  color: #fff;
}

.nav-item.is-active::before {
  position: absolute;
  left: -17px;
  width: 3px;
  height: 24px;
  border-radius: 0 8px 8px 0;
  background: var(--orange-500);
  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: #48a81f;
  box-shadow: 0 0 0 4px rgb(72 168 31 / 13%);
}

.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 / 92%);
  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(14 116 144 / 10%);
}

.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(37 51 21 / 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: #48a81f;
  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: #48a81f;
  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(11 31 51 / 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(11 31 51 / 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(11 31 51 / 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(7 89 133 / 20%);
  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;
}

.prospect-search-panel {
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgb(255 255 255 / 98%), rgb(239 246 255 / 92%));
}

.prospect-search {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(180px, 1.2fr) minmax(160px, 1fr) minmax(100px, .55fr) auto;
  gap: 12px;
  align-items: end;
}

.prospect-search-submit {
  min-height: 42px;
  white-space: nowrap;
}

.form-hint {
  margin: 12px 0 0;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.55;
}

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

.mini-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  border: 1px solid var(--ink-100);
  border-radius: 15px;
  background: var(--surface, #fff);
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgb(15 23 42 / 5%);
}

.mini-metric span {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.mini-metric strong {
  color: var(--ink-900);
  font-size: 24px;
}

.source-link {
  color: var(--accent-700);
  font-weight: 700;
  text-decoration: none;
}

.source-link:hover { text-decoration: underline; }

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 980px) {
  .prospect-search { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prospect-search-submit { width: 100%; }
}

@media (max-width: 640px) {
  .prospect-search,
  .prospect-metrics { grid-template-columns: 1fr; }
  .mini-metric { min-height: 58px; }
}

.prospecting-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.discovery-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 14px;
}

.discovery-form .primary-button {
  min-height: 44px;
  justify-self: start;
}

.is-hidden {
  display: none !important;
}

.source-note {
  margin: 16px 0 0;
  border-top: 1px solid var(--ink-100);
  padding-top: 13px;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.55;
}

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

.prospecting-metrics > div {
  border: 1px solid var(--ink-100);
  border-radius: 14px;
  background: var(--ink-50);
  padding: 13px;
}

.prospecting-metrics span {
  display: block;
  color: var(--ink-500);
  font-size: 10px;
}

.prospecting-metrics strong {
  display: block;
  margin-top: 5px;
  color: var(--ink-900);
  font-size: 22px;
}

.compliance-note {
  margin-top: 14px;
  border-left: 3px solid var(--accent-500);
  border-radius: 8px;
  background: var(--accent-50);
  padding: 12px 14px;
}

.email-sync-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid var(--ink-100);
  border-radius: 12px;
  padding: 12px 13px;
  background: var(--paper);
}

.email-overview-panel {
  margin-bottom: 18px;
  border-color: color-mix(in srgb, var(--accent-500) 26%, var(--ink-200));
  background: linear-gradient(135deg, var(--paper), var(--accent-50));
}

.email-overview-summary {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(120px, .6fr));
  gap: 12px;
}

.email-overview-summary > div,
.email-transport-state {
  border: 1px solid var(--ink-100);
  border-radius: 12px;
  padding: 14px;
  background: rgb(255 255 255 / 72%);
}

.email-overview-summary span,
.email-transport-state span {
  display: block;
  color: var(--ink-500);
  font-size: 10px;
}

.email-overview-summary strong,
.email-transport-state strong {
  display: block;
  margin-top: 5px;
  color: var(--ink-900);
  font-size: 17px;
}

.email-overview-summary small,
.email-transport-state p {
  display: block;
  margin: 4px 0 0;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.45;
}

.email-center-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 18px;
  margin-bottom: 18px;
}

.email-status-panel .email-sync-control {
  margin-top: 0;
}

.email-transport-state {
  margin-top: 12px;
  background: var(--ink-50);
}

.email-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.email-sync-control > div {
  min-width: 0;
}

.email-sync-control strong {
  display: block;
  color: var(--ink-800);
  font-size: 11px;
}

.email-sync-control p {
  max-width: 280px;
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.4;
  text-overflow: ellipsis;
}

.email-sync-control .secondary-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.email-inbox-panel {
  margin-top: 18px;
}

.table-panel > .panel-heading {
  margin: 0;
  border-bottom: 1px solid var(--ink-100);
  padding: 17px;
}

.email-inbox-table {
  min-width: 900px;
}

.email-snippet {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.page--mail {
  min-width: 0;
}

.mail-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 14px;
}

.mail-heading {
  min-width: 220px;
}

.mail-title-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 5px;
}

.mail-title-line h1 {
  margin: 0;
  color: var(--ink-950);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 790;
  letter-spacing: -.045em;
  line-height: 1.12;
}

.mail-heading > p {
  margin: 5px 0 0;
  color: var(--ink-600);
  font-size: 12px;
}

.mail-header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.mail-search {
  position: relative;
  display: block;
  width: min(32vw, 330px);
  min-width: 190px;
}

.mail-search svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--ink-400);
  pointer-events: none;
  transform: translateY(-50%);
}

.mail-search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 38px;
  background: var(--paper);
  box-shadow: var(--shadow-xs);
  outline: 0;
}

.mail-search input:focus {
  border-color: var(--accent-400);
  box-shadow: 0 0 0 3px rgb(14 116 144 / 12%);
}

.mail-system-strip {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--paper);
  color: var(--ink-600);
}

.mail-system-light {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--amber-700);
  box-shadow: 0 0 0 4px var(--amber-100);
}

.mail-system-strip.is-ready .mail-system-light {
  background: var(--green-700);
  box-shadow: 0 0 0 4px var(--green-100);
}

.mail-system-strip.is-error .mail-system-light {
  background: var(--red-700);
  box-shadow: 0 0 0 4px var(--red-100);
}

.mail-system-strip > div,
.mail-delivery-summary {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 7px;
}

.mail-system-strip strong {
  color: var(--ink-800);
  font-size: 10px;
  white-space: nowrap;
}

.mail-system-strip span {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-delivery-summary {
  margin-left: auto;
  border-left: 1px solid var(--ink-200);
  padding-left: 12px;
}

.mail-shell {
  display: grid;
  height: min(760px, calc(100dvh - 238px));
  min-height: 550px;
  grid-template-columns: 176px minmax(300px, 370px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.mail-folders {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  border-right: 1px solid var(--ink-200);
  padding: 12px 9px;
  background: var(--ink-50);
}

.mail-folder {
  display: grid;
  min-height: 42px;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border-radius: 8px;
  padding: 8px 9px;
  background: transparent;
  color: var(--ink-600);
  cursor: pointer;
  font-size: 11px;
  font-weight: 670;
  text-align: left;
}

.mail-folder:hover {
  background: var(--paper);
  color: var(--ink-900);
}

.mail-folder.is-active {
  background: var(--accent-50);
  color: var(--accent-700);
}

.mail-folder-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: var(--paper);
  font-size: 10px;
  font-style: normal;
}

.mail-folder strong {
  min-width: 21px;
  border-radius: 999px;
  padding: 2px 5px;
  background: var(--ink-100);
  color: var(--ink-600);
  font-size: 9px;
  text-align: center;
}

.mail-folder.is-active strong {
  background: var(--accent-100);
  color: var(--accent-700);
}

.mail-folder-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  border-top: 1px solid var(--ink-200);
  padding: 12px 9px 3px;
  color: var(--ink-500);
  font-size: 9px;
}

.mail-folder-total strong {
  color: var(--ink-700);
  font-size: 10px;
}

.mail-list-pane {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--ink-200);
  background: var(--paper);
}

.mail-list-header {
  display: flex;
  min-height: 65px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--ink-200);
  padding: 11px 14px;
}

.mail-list-header h2 {
  margin: 0;
  color: var(--ink-900);
  font-size: 14px;
  font-weight: 770;
}

.mail-list-header span {
  display: block;
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 9px;
}

.mail-filter select {
  max-width: 116px;
  height: 34px;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  padding: 5px 8px;
  background: var(--ink-50);
  color: var(--ink-700);
  font-size: 10px;
}

.mail-thread-list {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  overscroll-behavior: contain;
}

.mail-load-more {
  flex: 0 0 auto;
  width: 100%;
  min-height: 44px;
  border-top: 1px solid var(--ink-100);
  background: var(--paper);
  color: var(--accent-700);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.mail-load-more:hover,
.mail-load-more:focus-visible {
  background: var(--accent-50);
}

.mail-thread-list li + li {
  border-top: 1px solid var(--ink-100);
}

.mail-thread-row {
  position: relative;
  display: block;
  width: 100%;
  min-height: 116px;
  padding: 13px 14px;
  background: var(--paper);
  color: var(--ink-700);
  cursor: pointer;
  text-align: left;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.mail-thread-row:hover {
  background: #fafcfc;
}

.mail-thread-row.is-active {
  z-index: 1;
  background: var(--accent-50);
  box-shadow: inset 3px 0 0 var(--accent-500);
}

.mail-thread-row.is-unread {
  background: #fffdfb;
}

.mail-thread-row.is-unread.is-active {
  background: var(--accent-50);
}

.mail-thread-topline,
.mail-thread-subject,
.mail-thread-preview,
.mail-thread-flags {
  display: flex;
  min-width: 0;
  align-items: center;
}

.mail-thread-topline {
  justify-content: space-between;
  gap: 10px;
}

.mail-thread-topline strong {
  overflow: hidden;
  color: var(--ink-800);
  font-size: 11px;
  font-weight: 690;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-thread-row.is-unread .mail-thread-topline strong,
.mail-thread-row.is-unread .mail-thread-subject {
  color: var(--ink-950);
  font-weight: 790;
}

.mail-thread-topline time {
  flex: 0 0 auto;
  color: var(--ink-400);
  font-size: 8px;
}

.mail-thread-subject {
  gap: 6px;
  margin-top: 6px;
  overflow: hidden;
  color: var(--ink-800);
  font-size: 11px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-unread-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent-500);
}

.mail-thread-preview {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mail-thread-flags {
  gap: 5px;
  min-height: 18px;
  margin-top: 7px;
}

.mail-flag {
  border-radius: 999px;
  padding: 2px 6px;
  background: var(--ink-100);
  color: var(--ink-600);
  font-size: 8px;
  font-style: normal;
  font-weight: 720;
}

.mail-flag--incident {
  background: var(--red-100);
  color: var(--red-700);
}

.mail-list-empty,
.mail-reader-empty {
  display: grid;
  min-height: 100%;
  place-content: center;
  justify-items: center;
  padding: 32px 24px;
  color: var(--ink-500);
  text-align: center;
}

.mail-list-empty {
  min-height: 300px;
}

.mail-list-empty strong,
.mail-reader-empty strong {
  margin-top: 12px;
  color: var(--ink-800);
  font-size: 12px;
}

.mail-list-empty p,
.mail-reader-empty p {
  max-width: 260px;
  margin: 5px 0 0;
  font-size: 10px;
}

.mail-reader-empty-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: var(--ink-100);
  color: var(--ink-500);
}

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

.mail-reader {
  min-width: 0;
  overflow-y: auto;
  background: #fbfcfc;
  overscroll-behavior: contain;
}

.mail-reader > [hidden] {
  display: none !important;
}

.mail-reader-back {
  display: none;
}

.mail-reader-content {
  min-height: 100%;
  padding: 22px clamp(18px, 2.4vw, 30px) 34px;
}

.mail-reader-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--ink-200);
  padding-bottom: 18px;
}

.mail-reader-company {
  color: var(--accent-700);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mail-reader-heading h2 {
  margin: 5px 0 3px;
  color: var(--ink-950);
  font-size: clamp(19px, 2vw, 25px);
  font-weight: 760;
  letter-spacing: -.03em;
  line-height: 1.2;
}

.mail-reader-heading p,
.mail-reader-date {
  margin: 0;
  color: var(--ink-500);
  font-size: 9px;
}

.mail-reader-date {
  flex: 0 0 auto;
  padding-top: 4px;
}

.mail-thread-timeline {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.mail-message {
  position: relative;
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  padding: 16px;
  background: var(--paper);
  box-shadow: var(--shadow-xs);
}

.mail-message--outgoing {
  border-left: 3px solid var(--blue-700);
}

.mail-message--incoming {
  border-left: 3px solid var(--accent-500);
}

.mail-message-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mail-message-heading > div {
  display: grid;
}

.mail-direction {
  color: var(--ink-400);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mail-message-heading strong {
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: var(--ink-800);
  font-size: 10px;
}

.mail-message-heading time {
  flex: 0 0 auto;
  color: var(--ink-400);
  font-size: 8px;
}

.mail-message h3 {
  margin: 14px 0 8px;
  color: var(--ink-900);
  font-size: 13px;
  font-weight: 730;
}

.mail-message-body {
  color: var(--ink-700);
  font-size: 11px;
  line-height: 1.72;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.mail-message-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  border-top: 1px solid var(--ink-100);
  padding-top: 12px;
}

.mail-message-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--ink-100);
  color: var(--ink-600);
  font-size: 8px;
  font-weight: 760;
  text-transform: capitalize;
}

.mail-message-status--sent,
.mail-message-status--delivered,
.mail-message-status--replied,
.mail-message-status--resolved {
  background: var(--green-100);
  color: var(--green-700);
}

.mail-message-status--draft,
.mail-message-status--approved,
.mail-message-status--unread {
  background: var(--amber-100);
  color: var(--amber-700);
}

.mail-message-status--failed,
.mail-message-status--bounced,
.mail-message-status--blocked,
.mail-message-status--delivery-unknown {
  background: var(--red-100);
  color: var(--red-700);
}

.mail-message-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.mail-message-action {
  min-height: 32px;
  border: 1px solid var(--ink-200);
  border-radius: 7px;
  padding: 5px 9px;
  background: var(--paper);
  color: var(--ink-700);
  cursor: pointer;
  font-size: 9px;
  font-weight: 720;
}

.mail-message-action:hover {
  border-color: var(--ink-300);
  background: var(--ink-50);
}

.mail-message-action--primary {
  border-color: var(--accent-500);
  background: var(--accent-500);
  color: #fff;
}

.mail-message-action--primary:hover {
  border-color: var(--accent-600);
  background: var(--accent-600);
}

.mail-reader-empty--inline {
  min-height: 260px;
}

.mail-compose-dialog textarea {
  min-height: 190px;
}

#email-compose-recipient-help {
  display: block;
  margin-top: 5px;
  color: var(--ink-500);
  font-size: 9px;
}

.compliance-note strong {
  color: var(--accent-800);
  font-size: 11px;
}

.compliance-note p {
  margin: 4px 0 0;
  color: var(--ink-600);
  font-size: 10px;
  line-height: 1.55;
}

.score-badge {
  display: inline-flex;
  border-radius: 999px;
  background: var(--accent-50);
  padding: 5px 8px;
  color: var(--accent-700);
  font-weight: 700;
  font-size: 10px;
}

.source-link {
  color: var(--accent-700);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.source-link:hover {
  text-decoration: underline;
}

.row-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.live-pill.is-ready {
  border-color: var(--green-200);
  background: var(--green-100);
  color: var(--green-700);
}

@media (max-width: 1220px) {
  .mail-shell {
    grid-template-columns: 154px minmax(280px, 330px) minmax(0, 1fr);
  }

  .mail-folder {
    padding-inline: 7px;
  }
}

@media (max-width: 920px) {
  .prospecting-layout {
    grid-template-columns: 1fr;
  }

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

  .mail-header {
    align-items: stretch;
    flex-direction: column;
  }

  .mail-header-actions {
    justify-content: stretch;
  }

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

  .mail-shell {
    grid-template-columns: minmax(290px, .72fr) minmax(0, 1.28fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .mail-folders {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--ink-200);
    padding: 8px;
  }

  .mail-folder {
    min-width: max-content;
    grid-template-columns: 20px auto auto;
    padding: 7px 9px;
  }

  .mail-folder-icon {
    width: 20px;
    height: 20px;
  }

  .mail-folder-total {
    display: none;
  }

  .mail-list-pane {
    grid-column: 1;
    grid-row: 2;
  }

  .mail-reader {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 760px) {
  .page--mail {
    margin-inline: -2px;
  }

  .mail-header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .mail-search {
    width: 100%;
    min-width: 0;
  }

  .mail-system-strip {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .mail-system-strip > div {
    display: grid;
  }

  .mail-system-strip span {
    white-space: normal;
  }

  .mail-delivery-summary {
    width: 100%;
    margin-left: 18px;
    border-top: 1px solid var(--ink-100);
    border-left: 0;
    padding: 7px 0 0;
  }

  .mail-shell {
    display: block;
    height: auto;
    min-height: 62vh;
  }

  .mail-folders {
    display: flex;
  }

  .mail-list-pane {
    min-height: 58vh;
    border-right: 0;
  }

  .mail-reader {
    display: none;
    min-height: 62vh;
  }

  .mail-shell.is-reading .mail-folders,
  .mail-shell.is-reading .mail-list-pane {
    display: none;
  }

  .mail-shell.is-reading .mail-reader {
    display: block;
  }

  .mail-reader-back {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 5px;
    margin: 10px 12px 0;
    border-radius: 8px;
    padding: 7px 9px;
    background: var(--ink-100);
    color: var(--ink-700);
    cursor: pointer;
    font-size: 10px;
    font-weight: 720;
  }

  .mail-reader-back svg {
    width: 17px;
    height: 17px;
  }

  .mail-reader-content {
    padding: 16px 14px 28px;
  }

  .mail-reader-heading,
  .mail-message-heading,
  .mail-message-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .mail-message-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .mail-message-action {
    min-height: 38px;
  }
}

@media (max-width: 620px) {
  .discovery-form {
    grid-template-columns: 1fr;
  }

  .discovery-form .primary-button {
    width: 100%;
    justify-content: center;
  }

  .prospecting-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .email-sync-control {
    align-items: stretch;
    flex-direction: column;
  }

  .email-sync-control .secondary-button {
    justify-content: center;
    width: 100%;
  }

  .mail-title-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .mail-header-actions {
    grid-template-columns: 1fr 1fr;
  }

  .mail-search {
    grid-column: 1 / -1;
  }

  .mail-header-actions > button {
    width: 100%;
  }

  .mail-thread-row {
    min-height: 108px;
    padding-inline: 12px;
  }

  .mail-list-header {
    padding-inline: 12px;
  }
}

/* Hospital Conecta -------------------------------------------------------- */
:root {
  --hospital-navy: #0b1f33;
  --hospital-navy-soft: #17324d;
  --hospital-blue: #075985;
  --hospital-blue-dark: #06476a;
  --hospital-sky: #e0f2fe;
  --hospital-teal: #0f766e;
  --hospital-mint: #d1fae5;
  --hospital-canvas: #f3f7fa;
  --hospital-line: #dbe6ee;
  --hospital-muted: #5f7181;
  --hospital-danger: #b42318;
  --hospital-danger-bg: #fff1f0;
  --hospital-warning: #9a6700;
  --hospital-warning-bg: #fff8e1;
  --hospital-info-bg: #edf7ff;
}

.hospital-app {
  background:
    radial-gradient(circle at 90% 0, rgb(14 165 233 / 7%), transparent 28rem),
    var(--hospital-canvas);
  color: var(--hospital-navy);
}

.skip-link {
  position: fixed;
  z-index: 120;
  top: 10px;
  left: 10px;
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  color: var(--hospital-blue-dark);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 30px rgb(11 31 51 / 25%);
  transform: translateY(-160%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.hospital-app button:focus-visible,
.hospital-app input:focus-visible,
.hospital-app select:focus-visible,
.hospital-app textarea:focus-visible,
.hospital-app a:focus-visible {
  outline-color: rgb(14 165 233 / 52%);
}

.hospital-sidebar {
  width: 270px;
  border-right: 0;
  padding: 24px 16px 16px;
  background:
    radial-gradient(circle at 10% 0, rgb(14 165 233 / 16%), transparent 16rem),
    linear-gradient(180deg, var(--hospital-navy-soft), var(--hospital-navy));
  box-shadow: 12px 0 32px rgb(11 31 51 / 8%);
}

.hospital-app .app-shell {
  grid-template-columns: 270px minmax(0, 1fr);
}

.hospital-app .app-main {
  grid-column: 2;
}

.hospital-sidebar .sidebar-brand {
  margin: 0 9px 25px;
}

.hospital-brand-mark {
  border: 1px solid rgb(255 255 255 / 16%);
  background: linear-gradient(145deg, #0ea5e9, #087a82);
  box-shadow: 0 12px 28px rgb(0 0 0 / 24%);
}

.hospital-brand-mark svg {
  fill: currentColor;
}

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

.hospital-sidebar .nav-list {
  gap: 3px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 18%) transparent;
}

.nav-section-label {
  display: block;
  margin: 18px 11px 6px;
  color: rgb(255 255 255 / 38%);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.nav-section-label:first-child {
  margin-top: 0;
}

.hospital-sidebar .nav-item {
  min-height: 40px;
  border-radius: 10px;
  color: rgb(255 255 255 / 67%);
  font-size: 12px;
}

.hospital-sidebar .nav-item:hover {
  background: rgb(255 255 255 / 7%);
}

.hospital-sidebar .nav-item.is-active {
  background: linear-gradient(90deg, rgb(14 165 233 / 25%), rgb(15 118 110 / 16%));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgb(125 211 252 / 10%);
}

.hospital-sidebar .nav-item.is-active::before {
  left: -16px;
  background: #38bdf8;
}

.hospital-sidebar .nav-badge {
  background: var(--hospital-danger);
  color: #fff;
}

.sidebar-disclaimer {
  margin: 0;
  border-left: 2px solid rgb(56 189 248 / 55%);
  padding-left: 10px;
  color: rgb(255 255 255 / 47%);
  font-size: 9px;
  line-height: 1.5;
}

.hospital-sidebar .status-light {
  background: #34d399;
  box-shadow: 0 0 0 4px rgb(52 211 153 / 14%);
}

.hospital-sidebar .status-light--pending {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgb(245 158 11 / 16%);
}

.hospital-topbar {
  height: 74px;
  border-bottom-color: var(--hospital-line);
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 1px 0 rgb(11 31 51 / 2%);
}

.hospital-topbar .global-search input {
  border-color: var(--hospital-line);
  background: #f7fafc;
  color: var(--hospital-navy);
}

.hospital-topbar .global-search input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgb(14 165 233 / 11%);
}

.hospital-topbar .avatar {
  background: linear-gradient(145deg, var(--hospital-blue), var(--hospital-teal));
}

.emergency-shortcut {
  display: inline-flex;
  min-height: 37px;
  align-items: center;
  gap: 7px;
  border: 1px solid #fecaca;
  border-radius: 9px;
  padding: 7px 11px;
  background: #fff7f7;
  color: #991b1b;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.emergency-shortcut span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--hospital-danger);
  color: #fff;
}

.hospital-content {
  width: min(100%, 1580px);
  padding-top: 32px;
}

.hospital-app .page-heading h1 {
  color: var(--hospital-navy);
  font-weight: 800;
}

.hospital-app .page-heading p,
.hospital-app .panel-heading p {
  color: var(--hospital-muted);
}

.hospital-app .eyebrow {
  color: var(--hospital-blue);
}

.hospital-app .primary-button {
  background: var(--hospital-blue);
  box-shadow: 0 8px 18px rgb(7 89 133 / 17%);
}

.hospital-app .primary-button:hover {
  background: var(--hospital-blue-dark);
  box-shadow: 0 10px 24px rgb(7 89 133 / 25%);
}

.hospital-app .secondary-button {
  border-color: var(--hospital-line);
  color: var(--hospital-navy-soft);
}

.hospital-app .text-button {
  color: var(--hospital-blue);
}

.hospital-app .panel,
.hospital-app .metric-card {
  border-color: var(--hospital-line);
  border-radius: 15px;
  box-shadow: 0 6px 20px rgb(11 31 51 / 4%);
}

.hospital-app .panel:hover,
.hospital-app .metric-card:hover {
  border-color: #c5d9e7;
}

.safety-banner {
  display: grid;
  align-items: center;
  gap: 14px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-bottom: 26px;
  border: 1px solid #fecaca;
  border-left: 4px solid var(--hospital-danger);
  border-radius: 13px;
  padding: 14px 17px;
  background: linear-gradient(90deg, var(--hospital-danger-bg), #fffafa);
  color: #7f1d1d;
}

.safety-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  background: var(--hospital-danger);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.safety-banner strong {
  display: block;
  font-size: 12px;
}

.safety-banner p {
  margin: 2px 0 0;
  color: #9f3430;
  font-size: 10px;
}

.safety-banner button {
  min-height: 34px;
  border: 1px solid #efb3af;
  border-radius: 8px;
  padding: 7px 11px;
  background: #fff;
  color: #991b1b;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}

.safety-banner--compact {
  margin-bottom: 22px;
  grid-template-columns: auto minmax(0, 1fr);
}

.hospital-metrics .metric-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
}

.hospital-metrics .metric-card::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 64px;
  height: 64px;
  border-radius: 0 0 0 64px;
  background: rgb(14 165 233 / 4%);
  content: "";
}

.hospital-metrics .metric-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
}

.hospital-metrics .metric-card--blue .metric-icon { background: var(--hospital-sky); color: var(--hospital-blue); }
.hospital-metrics .metric-card--green .metric-icon { background: var(--hospital-mint); color: var(--hospital-teal); }
.hospital-metrics .metric-card--orange .metric-icon { background: var(--hospital-warning-bg); color: var(--hospital-warning); }
.hospital-metrics .metric-card--violet .metric-icon { background: #ede9fe; color: #6d28d9; }

.hospital-overview-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .9fr);
}

.overview-grid--balanced {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admissions-list {
  display: grid;
  gap: 8px;
}

.admission-row {
  display: grid;
  align-items: center;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  border: 1px solid #e4edf3;
  border-radius: 11px;
  padding: 11px 12px;
  background: #fbfdff;
}

.admission-row > div:nth-child(2) {
  min-width: 0;
}

.admission-row strong {
  display: block;
  color: var(--hospital-navy);
  font-size: 11px;
}

.admission-row p {
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--hospital-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admission-row__status {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.admission-row time {
  color: #7b8c99;
  font-size: 8px;
}

.patient-avatar,
.clinician-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: var(--hospital-sky);
  color: var(--hospital-blue);
  font-size: 10px;
  font-weight: 850;
}

.clinician-avatar {
  background: var(--hospital-mint);
  color: var(--hospital-teal);
}

.identity-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.priority-panel .priority-item {
  align-items: center;
  border: 1px solid #edf2f5;
  background: #fbfdff;
}

.priority-panel .priority-item > div {
  min-width: 0;
  flex: 1;
}

.priority-panel .priority-item small {
  color: #8293a0;
  font-size: 8px;
}

.priority-item--emergency {
  border-color: #fecaca !important;
  background: var(--hospital-danger-bg) !important;
}

.priority-item--emergency .priority-mark {
  background: var(--hospital-danger);
  color: #fff;
}

.capacity-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}

.capacity-grid > div {
  display: grid;
  border: 1px solid #deebf3;
  border-radius: 12px;
  padding: 16px;
  background: linear-gradient(145deg, #f7fcff, #fff);
}

.capacity-grid span {
  color: var(--hospital-muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.capacity-grid strong {
  margin: 5px 0 2px;
  color: var(--hospital-blue);
  font-size: 26px;
  letter-spacing: -.04em;
}

.capacity-grid small {
  color: #8a99a5;
  font-size: 8px;
}

.channel-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid #ccecdf;
  border-radius: 13px;
  padding: 15px;
  background: linear-gradient(145deg, #f0fdf7, #fff);
}

.channel-orb {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: var(--hospital-teal);
  color: #fff;
}

.channel-orb svg {
  width: 21px;
  height: 21px;
}

.channel-summary strong,
.channel-summary small {
  display: block;
}

.channel-summary strong {
  color: var(--hospital-navy);
  font-size: 12px;
}

.channel-summary small {
  margin-top: 3px;
  color: var(--hospital-muted);
  font-size: 9px;
  line-height: 1.45;
}

.notice-card,
.channel-policy {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 13px 15px;
  background: var(--hospital-info-bg);
  color: #0c4a6e;
}

.notice-card > span,
.channel-policy > span {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--hospital-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.notice-card p,
.channel-policy p {
  margin: 1px 0 0;
  font-size: 10px;
}

.channel-policy {
  border-color: #a7f3d0;
  background: #effdf7;
  color: #115e59;
}

.channel-policy > span {
  background: var(--hospital-teal);
}

.channel-policy svg {
  width: 14px;
  height: 14px;
}

.schedule-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--hospital-line);
  border-radius: 11px;
  padding: 10px 14px;
  background: #fff;
}

.schedule-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--hospital-muted);
  font-size: 9px;
  font-weight: 650;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}

.dot--pending { background: #f59e0b; }
.dot--confirmed { background: #0ea5e9; }
.dot--waiting { background: #8b5cf6; }
.dot--done { background: #10b981; }

.hospital-app .table-panel > .panel-heading {
  padding: 18px 18px 0;
}

.hospital-app .data-table th {
  background: #f5f9fc;
  color: #617687;
}

.hospital-app .data-table td {
  border-color: #edf2f5;
  color: #465d70;
}

.hospital-app .data-table tbody tr:hover {
  background: #f8fcff;
}

.hospital-app .cell-title,
.hospital-app .appointment-time {
  color: var(--hospital-navy);
  font-weight: 750;
}

.consent-state {
  display: block;
  color: #9a3412;
  font-size: 9px;
  font-weight: 720;
}

.consent-state.is-ok {
  color: var(--hospital-teal);
}

.money-value {
  color: var(--hospital-navy);
  font-variant-numeric: tabular-nums;
}

.hospital-app .row-action {
  min-height: 30px;
  border-color: #cddce7;
  color: var(--hospital-blue);
}

.hospital-app .row-action:hover {
  border-color: #38bdf8;
  background: #f0f9ff;
  color: var(--hospital-blue-dark);
}

.row-action--urgent {
  border-color: #f9b8b4 !important;
  color: var(--hospital-danger) !important;
}

.row--emergency {
  background: #fff8f7 !important;
  box-shadow: inset 3px 0 var(--hospital-danger);
}

.triage-need {
  display: block;
  max-width: 360px;
  white-space: normal;
}

.hospital-app .status-pill {
  text-transform: none;
}

.status--positive { background: #dcfce7; color: #166534; }
.status--warning { background: #fef3c7; color: #92400e; }
.status--danger { background: #fee2e2; color: #991b1b; }
.status--muted { background: #e2e8f0; color: #475569; }
.status--info { background: var(--hospital-sky); color: var(--hospital-blue-dark); }

.split-panels {
  display: grid;
  align-items: start;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.billing-grid {
  display: grid;
  align-items: start;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.billing-grid__accounts {
  grid-column: 1 / -1;
}

.hospital-conversation-card {
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--hospital-teal) !important;
}

.hospital-conversation-card header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.hospital-conversation-card header time {
  margin-left: auto;
}

.conversation-person {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
}

.conversation-person strong,
.conversation-person small {
  display: block;
}

.conversation-person strong {
  color: var(--hospital-navy);
  font-size: 11px;
}

.conversation-person small {
  margin-top: 1px;
  color: var(--hospital-muted);
  font-size: 8px;
}

.hospital-conversation-card footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hospital-conversation-card footer .row-action {
  margin-left: auto;
}

.hospital-app .entity-dialog::backdrop {
  background: rgb(5 23 38 / 66%);
}

.hospital-dialog,
.timeline-dialog {
  width: min(94vw, 680px);
}

.hospital-app .dialog-shell {
  padding: clamp(20px, 4vw, 30px);
}

.hospital-app .field input,
.hospital-app .field select,
.hospital-app .field textarea {
  border-color: #cbdbe6;
  border-radius: 9px;
  background: #fbfdff;
}

.hospital-app .field input:focus,
.hospital-app .field select:focus,
.hospital-app .field textarea:focus {
  border-color: #38bdf8;
  outline: 0;
  background: #fff;
  box-shadow: 0 0 0 4px rgb(14 165 233 / 10%);
}

.consent-fields {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #d9e6ee;
  border-radius: 10px;
  background: #f7fafc;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #40596d;
  cursor: pointer;
  font-size: 10px;
}

.check-field input {
  width: 16px;
  min-height: 16px !important;
  margin: 0;
  accent-color: var(--hospital-blue);
}

.form-guidance {
  margin-top: 16px;
  border-left: 3px solid #0ea5e9;
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  background: var(--hospital-info-bg);
  color: #24556f;
  font-size: 9px;
  line-height: 1.5;
}

.patient-timeline {
  display: grid;
  gap: 0;
}

.timeline-event {
  position: relative;
  display: grid;
  gap: 12px;
  grid-template-columns: 16px minmax(0, 1fr);
  padding-bottom: 18px;
}

.timeline-event:not(:last-child)::before {
  position: absolute;
  top: 15px;
  bottom: 0;
  left: 6px;
  width: 2px;
  background: #d7e5ee;
  content: "";
}

.timeline-event__dot {
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border: 3px solid #d9f1ff;
  border-radius: 50%;
  background: var(--hospital-blue);
}

.timeline-event header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.timeline-event strong {
  color: var(--hospital-navy);
  font-size: 11px;
}

.timeline-event time,
.timeline-event small {
  color: #8293a0;
  font-size: 8px;
}

.timeline-event p {
  margin: 3px 0;
  color: #53697b;
  font-size: 10px;
}

.hospital-app .toast {
  background: var(--hospital-navy);
}

.hospital-app .toast.is-error {
  background: var(--hospital-danger);
}

/* Legibilidad y objetivos táctiles para operación clínica-administrativa. */
.hospital-sidebar .nav-section-label {
  color: rgb(255 255 255 / 60%);
  font-size: 10px;
}

.hospital-sidebar .nav-item,
.hospital-sidebar .logout-button {
  min-height: 44px;
  font-size: 13px;
}

.hospital-sidebar .system-state strong {
  font-size: 12px;
}

.hospital-sidebar .system-state small,
.hospital-sidebar .sidebar-disclaimer {
  color: rgb(255 255 255 / 67%);
  font-size: 11px;
}

.hospital-topbar .menu-button,
.hospital-topbar .icon-button,
.hospital-app .dialog-close {
  width: 44px;
  height: 44px;
}

.hospital-topbar .emergency-shortcut,
.login-page .password-toggle {
  min-width: 44px;
  min-height: 44px;
}

.hospital-app .primary-button,
.hospital-app .secondary-button,
.hospital-app .row-action {
  min-height: 44px;
}

.hospital-app .text-button {
  min-height: 44px;
  padding: 8px 2px;
  font-size: 12px;
}

.hospital-app .panel-heading p,
.hospital-app .empty-state p,
.hospital-app .metric-card small,
.priority-panel .priority-item small,
.capacity-grid small,
.channel-summary small,
.conversation-person small,
.timeline-event time,
.timeline-event small {
  color: #536b7e;
  font-size: 11px;
}

.hospital-app .metric-card span,
.capacity-grid span,
.schedule-strip span,
.consent-state,
.hospital-app .data-table th,
.hospital-app .result-count {
  color: #536b7e;
  font-size: 11px;
}

.safety-banner strong,
.channel-summary strong {
  font-size: 14px;
}

.safety-banner p,
.safety-banner button,
.notice-card p,
.channel-policy p,
.check-field,
.form-guidance,
.timeline-event p {
  font-size: 12px;
}

.safety-banner button {
  min-height: 44px;
}

.admission-row strong,
.conversation-person strong,
.timeline-event strong {
  font-size: 13px;
}

.admission-row p,
.admission-row time {
  color: #536b7e;
  font-size: 11px;
}

.hospital-app .data-table td,
.hospital-app .cell-title {
  font-size: 12px;
}

.hospital-app .row-action {
  padding-inline: 12px;
  font-size: 11px;
}

.hospital-app .live-pill {
  min-height: 28px;
  font-size: 10px;
}

.hospital-app .live-pill.is-error {
  background: var(--red-100);
  color: var(--red-700);
}

.hospital-app .live-pill.is-error i {
  background: var(--hospital-danger);
  animation: none;
}

.hospital-app .responsive-table {
  position: relative;
  overscroll-behavior-inline: contain;
  scrollbar-color: #9fb7c8 transparent;
  scrollbar-width: thin;
}

.hospital-app .responsive-table:focus-visible {
  outline: 3px solid rgb(14 165 233 / 32%);
  outline-offset: -3px;
}

.hospital-app .data-table th:first-child,
.hospital-app .data-table td:first-child {
  position: sticky;
  z-index: 1;
  left: 0;
  background: #fff;
  box-shadow: 8px 0 12px -12px rgb(11 31 51 / 45%);
}

.hospital-app .data-table th:first-child {
  z-index: 2;
  background: #f5f9fc;
}

.hospital-app #entity-dialog .dialog-shell {
  display: grid;
  height: 100%;
  max-height: none;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
}

.hospital-app #entity-dialog {
  width: min(94vw, 680px);
  height: min(90dvh, 760px);
  max-height: min(90dvh, 760px);
}

.hospital-app #entity-dialog .dialog-fields {
  min-height: 0;
  overflow-y: auto;
  padding: 3px 8px 12px 3px;
  scrollbar-gutter: stable;
}

.hospital-app #entity-dialog .dialog-actions {
  margin-top: 12px;
  padding-top: 14px;
  background: #fff;
}

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

  .split-panels,
  .billing-grid {
    grid-template-columns: 1fr;
  }

  .billing-grid__accounts {
    grid-column: auto;
  }
}

@media (max-width: 960px) {
  .hospital-app .app-shell {
    display: block;
  }

  .hospital-sidebar {
    width: min(310px, 86vw);
  }

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

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

  .emergency-shortcut {
    display: none;
  }
}

@media (max-width: 760px) {
  .hospital-topbar {
    padding-inline: 14px;
  }

  .hospital-topbar .global-search {
    width: min(100%, 480px);
  }

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

  .hospital-content {
    padding: 20px 14px 52px;
  }

  .safety-banner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .safety-banner button {
    grid-column: 1 / -1;
  }

  .hospital-app .page-heading {
    align-items: stretch;
  }

  .hospital-app .heading-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

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

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

  .admission-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .admission-row__status {
    grid-column: 2;
    justify-items: start;
  }

  .capacity-grid,
  .hospital-app .dialog-fields {
    grid-template-columns: 1fr;
  }

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

  .hospital-app .empty-state {
    min-height: 142px;
    padding: 22px 16px;
  }

  .hospital-app .table-tools {
    flex-wrap: wrap;
  }

  .hospital-app .result-count {
    display: block;
    width: 100%;
    text-align: right;
  }

  .hospital-app #entity-dialog .dialog-shell {
    padding: 20px;
  }

  .hospital-app #entity-dialog .dialog-actions {
    flex-direction: row;
  }

  .hospital-app #entity-dialog .dialog-actions button {
    width: auto;
    flex: 1;
  }
}

@media (max-width: 360px) {
  .hospital-app .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .hospital-sidebar,
  .hospital-topbar,
  .heading-actions,
  .row-action,
  .safety-banner button {
    display: none !important;
  }

  .hospital-app .app-shell,
  .hospital-app .app-main {
    display: block;
  }

  .hospital-app {
    background: #fff;
  }

  .hospital-content {
    width: 100%;
    padding: 0;
  }
}

/* Acceso institucional */
.hospital-login-story {
  background:
    radial-gradient(circle at 85% 20%, rgb(14 165 233 / 28%), transparent 28%),
    radial-gradient(circle at 15% 85%, rgb(45 212 191 / 10%), transparent 31%),
    linear-gradient(145deg, #17324d 0%, #0b1f33 62%, #071421 100%);
}

.hospital-login-story .brand-mark,
.login-page .mobile-brand .brand-mark {
  background: linear-gradient(145deg, #0ea5e9, #0f766e);
  box-shadow: 0 9px 24px rgb(0 0 0 / 22%);
}

.hospital-login-story .eyebrow--light {
  color: #7dd3fc;
}

.hospital-login-story .proof-dot {
  background: rgb(52 211 153 / 14%);
}

.hospital-login-story .proof-dot span {
  background: #34d399;
}

.login-page .login-panel {
  background:
    radial-gradient(circle at 100% 0, rgb(14 165 233 / 8%), transparent 25rem),
    #f5f9fc;
}

.login-page .login-card {
  width: min(100%, 480px);
  border: 1px solid #dbe6ee;
  border-radius: 20px;
  padding: clamp(24px, 4vw, 36px);
  background: #fff;
  border-color: #dbe6ee;
  box-shadow: 0 26px 70px rgb(11 31 51 / 13%);
}

.login-page .eyebrow {
  color: var(--hospital-blue);
}

.login-page .primary-button {
  background: var(--hospital-blue);
  box-shadow: 0 8px 18px rgb(7 89 133 / 18%);
}

.login-page .primary-button:hover {
  background: var(--hospital-blue-dark);
}

.login-page .input-shell:focus-within {
  box-shadow: none;
}

.login-page .input-shell:focus-within input {
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgb(14 165 233 / 12%);
}
