.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: clamp(18px, 3vw, 34px);
}

.landing-page {
  min-height: 100vh;
  padding: clamp(18px, 3vw, 34px);
}

.landing-shell {
  width: 100%;
  min-height: calc(100vh - clamp(36px, 6vw, 68px));
  margin: 0 auto;
  padding: 0;
}

.landing-topbar {
  position: fixed;
  top: clamp(14px, 2.4vw, 28px);
  left: 50%;
  z-index: 30;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1560px, calc(100vw - clamp(20px, 3vw, 48px)));
  min-height: 76px;
  margin: 0 auto;
  padding: 10px 12px 10px 28px;
  border: 1px solid var(--color-line-soft);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.landing-topbar img {
  width: 228px;
  max-height: 56px;
  object-fit: contain;
}

.landing-topbar .btn {
  min-height: 50px;
  padding: 0 24px;
  border-radius: 14px;
  background: var(--color-primary);
  box-shadow: none;
}

.landing-topbar .btn:hover {
  transform: none;
  background: #0b63e5;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 0.9fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(88px, 12vh, 140px) 0 clamp(34px, 6vh, 72px);
}

.landing-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(52px, 7vw, 104px);
  line-height: 0.95;
  font-weight: 950;
}

.landing-lead {
  max-width: 680px;
  margin: 0;
  color: var(--color-muted);
  font-size: clamp(17px, 1.35vw, 22px);
  line-height: 1.55;
  font-weight: 650;
}

.landing-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.landing-actions .btn {
  min-height: 64px;
  padding: 0 36px;
  border: 1px solid transparent;
  border-radius: 16px;
  box-shadow: none;
  font-size: 16px;
  font-weight: 850;
}

.landing-actions .btn:hover {
  transform: none;
}

.landing-actions .btn-primary {
  background: #0d6efd;
}

.landing-actions .btn-primary:hover {
  background: #0b5ed7;
  border-color: #0a58ca;
}

.landing-actions .btn:not(.btn-primary) {
  color: #0d6efd;
  background: #eef6ff;
  border-color: #dbeafe;
}

.landing-actions .btn:not(.btn-primary):hover {
  color: #0a58ca;
  background: #e7f1ff;
  border-color: #bfdbfe;
}

.landing-preview {
  padding: clamp(18px, 2vw, 28px);
  border: 1px solid var(--color-line);
  border-radius: 30px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.landing-preview__bar {
  display: flex;
  gap: 8px;
  height: 42px;
  align-items: center;
  padding: 0 14px;
  border-radius: 18px;
  background: #f2f7fd;
}

.landing-preview__bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.landing-preview__bar span:nth-child(1) {
  background: #ef4444;
}

.landing-preview__bar span:nth-child(2) {
  background: #f59e0b;
}

.landing-preview__bar span:nth-child(3) {
  background: #22c55e;
}

.landing-preview__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0;
}

.landing-preview__stats div,
.landing-preview__table div {
  border: 1px solid var(--color-line);
  border-radius: 22px;
  background: #fbfdff;
}

.landing-preview__stats div {
  padding: clamp(16px, 1.7vw, 24px);
}

.landing-preview__stats strong {
  display: block;
  color: var(--color-text);
  font-size: clamp(26px, 2.4vw, 40px);
  font-weight: 950;
}

.landing-preview__stats span {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 800;
}

.landing-preview__table {
  display: grid;
  gap: 12px;
}

.landing-preview__table div {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: clamp(14px, 1.5vw, 20px);
}

.landing-preview__table strong {
  font-size: clamp(14px, 1.1vw, 17px);
  font-weight: 900;
}

.landing-preview__table em {
  color: var(--color-primary);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  width: min(1480px, 100%);
  margin: 0 auto clamp(48px, 8vh, 96px);
}

.landing-grid h2 {
  margin: 18px 0 10px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 950;
}

.landing-grid p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.55;
  font-weight: 650;
}

.scroll-story {
  position: relative;
  width: min(1480px, 100%);
  margin: 0 auto clamp(54px, 9vh, 110px);
  padding: clamp(56px, 8vh, 96px) 0;
}

.story-head {
  max-width: 840px;
  margin-bottom: clamp(34px, 6vh, 72px);
}

.story-head h2 {
  margin: 0 0 14px;
  color: var(--color-text);
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1;
  font-weight: 950;
}

.story-head p {
  margin: 0;
  color: var(--color-muted);
  font-size: clamp(17px, 1.25vw, 21px);
  line-height: 1.58;
  font-weight: 650;
}

.story-layout {
  display: block;
}

.story-track {
  --story-rail: clamp(58px, 6vw, 88px);
  position: relative;
  display: grid;
  gap: clamp(48px, 7vh, 86px);
  padding: 8px 0 14px;
  isolation: isolate;
}

.story-line {
  position: absolute;
  top: 18px;
  bottom: 24px;
  left: 50%;
  z-index: 0;
  width: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(180deg, #dbeafe 0%, #e0f2fe 54%, #dcfce7 100%);
  transform: translateX(-50%);
}

.story-line span {
  display: block;
  width: 100%;
  height: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #0d6efd 0%, #06b6d4 58%, #22c55e 100%);
  transition: height 110ms linear;
}

.story-step {
  position: relative;
  display: grid;
  z-index: 1;
  grid-template-columns: minmax(0, 1fr) var(--story-rail) minmax(0, 1fr);
  align-items: start;
  min-height: 0;
  opacity: 0.48;
  transform: translateY(26px);
  transition: opacity 220ms ease, transform 260ms ease;
  will-change: opacity, transform;
}

.story-step--left {
  transform: translate(-28px, 26px);
}

.story-step--right {
  transform: translate(28px, 26px);
}

.story-step--center {
  transform: translateY(34px);
}

.story-step.active {
  opacity: 1;
  transform: translate(0, 0);
}

.story-card {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  overflow: hidden;
  padding: clamp(22px, 2.4vw, 34px);
  border: 1px solid var(--color-line);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.045);
  transition: border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.story-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  opacity: 0;
  background: linear-gradient(90deg, #0d6efd, #06b6d4, #22c55e);
  transition: opacity 220ms ease;
}

.story-step--right .story-card {
  grid-column: 3;
}

.story-step--center .story-card {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(820px, 100%);
  margin-top: 30px;
  text-align: center;
}

.story-step--center p,
.story-step--center .story-mobile-image {
  margin-right: auto;
  margin-left: auto;
}

.story-step.active .story-card {
  border-color: rgba(13, 110, 253, 0.32);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
}

.story-step.active .story-card::before {
  opacity: 1;
}

.story-dot {
  position: relative;
  top: 30px;
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  width: 26px;
  height: 26px;
  border: 6px solid #eef6ff;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 1px var(--color-line), 0 0 0 0 rgba(13, 110, 253, 0);
  transition: background 180ms ease, box-shadow 220ms ease, transform 180ms ease;
}

.story-dot::after {
  content: "";
  position: absolute;
  inset: -12px;
  border: 1px solid rgba(13, 110, 253, 0.24);
  border-radius: inherit;
  opacity: 0;
  transform: scale(0.65);
}

.story-step--center .story-dot {
  top: 0;
  z-index: 2;
}

.story-step.active .story-dot {
  background: #0d6efd;
  box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.28), 0 0 0 12px rgba(13, 110, 253, 0.12);
  transform: scale(1.12);
}

.story-step.active .story-dot::after {
  animation: story-pulse 1800ms ease-out infinite;
}

.story-step h3 {
  margin: 0 0 12px;
  color: var(--color-text);
  font-size: clamp(26px, 2.5vw, 40px);
  line-height: 1.08;
  font-weight: 950;
}

.story-step p {
  max-width: 610px;
  margin: 0;
  color: var(--color-muted);
  font-size: clamp(16px, 1.1vw, 19px);
  line-height: 1.6;
  font-weight: 650;
}

.story-mobile-image {
  display: block;
  position: relative;
  margin: 22px 0 0;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 24px;
  background: #f7fbff;
  transition: transform 260ms ease, border-color 220ms ease;
}

.story-image-open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: zoom-in;
}

.story-image-open img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #f7fbff;
  transition: transform 240ms ease;
}

.story-image-open:hover img,
.story-image-open:focus-visible img {
  transform: scale(1.012);
}

.story-image-open:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.28);
  outline-offset: -3px;
}

.story-step.active .story-mobile-image {
  border-color: rgba(13, 110, 253, 0.26);
  transform: translateY(-2px);
}

.story-zoom {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  gap: 8px;
  border: 1px solid rgba(13, 110, 253, 0.18);
  border-radius: 999px;
  color: #0d6efd;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.story-zoom .icon {
  width: 18px;
  height: 18px;
}

.story-zoom:hover,
.story-zoom:focus-visible {
  color: #ffffff;
  background: #0d6efd;
  border-color: #0d6efd;
  outline: none;
}

.story-lightbox[hidden] {
  display: none;
}

.story-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 40px) clamp(92px, 8vw, 140px);
  background: rgba(15, 23, 42, 0.74);
  backdrop-filter: blur(14px);
  overscroll-behavior: contain;
}

.story-lightbox__frame {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: 12px;
  width: min(1500px, calc(100vw - 184px));
  height: min(86vh, 900px);
  margin: 0;
}

.story-lightbox__image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  touch-action: pan-y;
  transform-origin: top left;
}

.story-lightbox__frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 1px solid rgba(219, 234, 254, 0.42);
  border-radius: 26px;
  background: transparent;
  box-shadow: 0 30px 90px rgba(2, 6, 23, 0.28);
  user-select: none;
  -webkit-user-drag: none;
}

.story-lightbox__frame figcaption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #ffffff;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.story-lightbox__frame figcaption strong {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.story-lightbox__close {
  position: fixed;
  top: clamp(14px, 2.4vw, 28px);
  right: clamp(14px, 2.4vw, 28px);
  z-index: 101;
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.34);
  box-shadow: none;
  backdrop-filter: blur(14px);
  cursor: pointer;
}

.story-lightbox__close .icon {
  width: 24px;
  height: 24px;
}

.story-lightbox__close:hover,
.story-lightbox__close:focus-visible {
  color: #ffffff;
  background: #0d6efd;
  border-color: #0d6efd;
  outline: none;
}

.story-lightbox__nav {
  position: fixed;
  top: 50%;
  z-index: 101;
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.34);
  box-shadow: none;
  backdrop-filter: blur(14px);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.story-lightbox__nav--prev {
  left: clamp(18px, 3.5vw, 56px);
}

.story-lightbox__nav--next {
  right: clamp(18px, 3.5vw, 56px);
}

.story-lightbox__nav .icon {
  width: 34px;
  height: 34px;
}

.story-lightbox__nav:hover,
.story-lightbox__nav:focus-visible {
  background: #0d6efd;
  border-color: #0d6efd;
  outline: none;
  transform: translateY(-50%) scale(1.04);
}

@keyframes story-pulse {
  0% {
    opacity: 0.62;
    transform: scale(0.65);
  }

  70%,
  100% {
    opacity: 0;
    transform: scale(1.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-step,
  .story-card,
  .story-mobile-image,
  .story-image-open img,
  .story-line span,
  .story-dot,
  .story-lightbox__nav {
    transition: none;
  }

  .story-step,
  .story-step.active {
    transform: none;
  }

  .story-step.active .story-dot::after {
    animation: none;
  }
}

.login-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: min(1100px, 100%);
  min-height: min(760px, calc(100vh - clamp(36px, 6vw, 68px)));
  border: 1px solid var(--color-line);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.login-frame::before {
  content: "";
  position: absolute;
  left: -70px;
  top: 120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(13, 110, 253, 0.07);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 48px));
  padding: clamp(34px, 4vw, 48px);
  border: 1px solid var(--color-line);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.login-logo {
  display: block;
  width: min(280px, 78%);
  max-height: 76px;
  object-fit: contain;
  margin: 0 auto clamp(34px, 4vw, 48px);
}

.login-title {
  margin: 0 0 26px;
  text-align: center;
  font-size: clamp(28px, 2.8vw, 34px);
  line-height: 1.2;
  font-weight: 900;
}

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

.login-form .field {
  gap: 10px;
  font-size: 13px;
}

.login-form .input {
  min-height: 58px;
  border-radius: 16px;
  padding-right: 16px;
  font-size: 15px;
}

.login-form .btn {
  min-height: 56px;
  font-size: 14px;
}

.login-form .small {
  font-size: 13px;
  line-height: 1.45;
}

.remember-toggle {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 42px;
  gap: 14px;
  padding: 2px 0 2px 2px;
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  user-select: none;
}

.remember-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.remember-toggle__control {
  position: relative;
  flex: 0 0 auto;
  width: 56px;
  height: 34px;
  border: 1px solid #cfe0f6;
  border-radius: 999px;
  background: #eef6ff;
  transition: background 160ms ease, border-color 160ms ease;
}

.remember-toggle__control::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  width: 24px;
  height: 24px;
  border: 1px solid #dbeafe;
  border-radius: 50%;
  background: #ffffff;
  transform: translateY(-50%);
  transition: transform 180ms ease, border-color 160ms ease;
}

.remember-toggle input:checked + .remember-toggle__control {
  border-color: #0d6efd;
  background: #0d6efd;
}

.remember-toggle input:checked + .remember-toggle__control::after {
  border-color: #ffffff;
  transform: translate(24px, -50%);
}

.remember-toggle input:focus-visible + .remember-toggle__control {
  outline: 4px solid rgba(13, 110, 253, 0.14);
  outline-offset: 2px;
}

.remember-toggle__copy {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  line-height: 1.2;
}

.demo-login-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--color-line);
  border-radius: 18px;
  background: #f8fbff;
}

.demo-login-panel strong {
  color: var(--color-text);
  font-size: 15px;
  font-weight: 950;
}

.demo-login-panel > span {
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

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

.demo-login-option {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--color-line);
  border-radius: 14px;
  color: var(--color-text);
  background: #ffffff;
  font-weight: 900;
  text-align: left;
}

.demo-login-option:hover {
  border-color: rgba(13, 110, 253, 0.42);
}

.demo-login-option small {
  min-width: 0;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
}

.input-icon {
  position: relative;
}

.input-icon .icon {
  position: absolute;
  left: 16px;
  top: 18px;
  color: #9aa9bd;
}

.input-icon .input {
  padding-left: 50px;
}

.content-stack {
  display: grid;
  gap: 18px;
}

.activities-page,
.activities-page * {
  box-shadow: none;
}

.activities-grid {
  align-items: start;
}

.activities-card {
  min-width: 0;
}

.activities-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.activities-card__head .card-title {
  margin-bottom: 6px;
}

.activities-trash-all {
  flex: 0 0 auto;
}

.activities-timeline {
  max-height: min(62vh, 680px);
  overflow: auto;
  padding-right: 4px;
}

.activities-notifications {
  display: grid;
  gap: 10px;
}

.activities-notification {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--color-line);
  border-radius: 18px;
  background: #fbfdff;
}

.activities-notification.unread {
  border-color: rgba(24, 194, 198, 0.34);
  background: #f2fffd;
}

.activities-notification__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--color-teal);
}

.activities-notification strong,
.activities-notification p,
.activities-notification small {
  display: block;
  min-width: 0;
}

.activities-notification p {
  margin: 5px 0;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
}

.activities-notification small {
  color: #8a9ab0;
  font-weight: 800;
}

.activities-notification__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

:root[data-theme="dark"] .activities-page .card,
:root[data-theme="dark"] .activities-notification {
  border-color: #223653;
  color: #edf4ff;
  background: #101b2d;
}

:root[data-theme="dark"] .activities-notification.unread {
  border-color: rgba(54, 216, 222, 0.34);
  background: #0f2435;
}

:root[data-theme="dark"] .activities-notification p,
:root[data-theme="dark"] .activities-card__head .muted {
  color: #a9bbd2;
}

:root[data-theme="dark"] .activities-notification small {
  color: #8fa6c2;
}

@media (max-width: 780px) {
  .activities-header,
  .activities-card__head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

  .activities-timeline {
    max-height: none;
  }

  .activities-notification {
    grid-template-columns: 8px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
  }

  .activities-notification__actions {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: 2px;
  }

  .activities-trash-all {
    justify-self: start;
  }
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.75fr);
  gap: 18px;
}

.import-drop {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 24px;
  min-height: 210px;
  padding: 34px;
}

.csv-tile {
  display: grid;
  place-items: center;
  width: 138px;
  height: 108px;
  border-radius: 26px;
  color: var(--color-primary);
  background: #eaf3ff;
  font-size: 34px;
  font-weight: 900;
}

.mapping-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.import-page,
.import-page * {
  box-shadow: none !important;
}

.import-page .btn,
.import-page button,
.import-page label.btn {
  box-shadow: none !important;
}

.import-page .btn:hover,
.import-page button:hover {
  transform: none;
}

.import-page__header {
  margin-bottom: 8px;
}

.import-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.35fr);
  gap: 16px;
}

.import-upload-panel,
.import-check-panel,
.import-workbench {
  border: 1px solid #d7e6f7;
  border-radius: 18px;
  background: #ffffff;
}

.import-upload-panel {
  display: grid;
  grid-template-columns: 138px 1fr;
  align-items: center;
  gap: 28px;
  min-height: 188px;
  padding: 28px 32px;
  transition: border-color 160ms ease, background 160ms ease;
}

.import-upload-panel.is-dragging {
  border-color: rgba(13, 110, 253, 0.56);
  background: #f8fbff;
}

.import-upload-copy {
  min-width: 0;
}

.import-upload-copy h2,
.import-section-head h2,
.import-preview-head h2 {
  margin: 0;
  color: var(--color-text);
  font-size: 18px;
  font-weight: 950;
}

.import-upload-copy p,
.import-section-head p,
.import-preview-head p {
  margin: 8px 0 0;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 700;
}

.import-upload-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.import-file-btn {
  min-height: 48px;
  border-radius: 12px;
}

.import-upload-actions > span {
  color: #52647c;
  font-size: 13px;
  font-weight: 850;
}

.import-check-panel {
  padding: 24px;
}

.import-check-panel strong {
  display: block;
  margin-bottom: 12px;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 950;
}

.import-check-panel ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.import-check-panel li {
  position: relative;
  padding-left: 18px;
  color: #52647c;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 760;
}

.import-check-panel li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #0d6efd;
}

.import-workbench {
  overflow: hidden;
}

.import-section-head,
.import-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid #edf2f8;
}

.import-state {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid #d7e6f7;
  border-radius: 999px;
  padding: 0 13px;
  color: #52647c;
  background: #fbfdff;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.import-state.is-ready {
  border-color: #bbf7d0;
  color: #15803d;
  background: #f0fdf4;
}

.import-map-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.import-column-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 24px 0;
}

.import-column-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid #d7e6f7;
  border-radius: 999px;
  padding: 0 12px;
  color: #52647c;
  background: #fbfdff;
  font-size: 12px;
  font-weight: 850;
}

.import-column-summary span.is-mapped {
  border-color: #b6d4fe;
  color: #0d6efd;
  background: #eff6ff;
}

.import-map-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.56);
}

.import-map-modal {
  display: grid;
  gap: 16px;
  width: min(980px, 100%);
  max-height: min(92vh, 860px);
  overflow: auto;
  border: 1px solid #d7e6f7;
  border-radius: 20px;
  padding: 20px;
  background: #ffffff;
  box-shadow: none;
}

.import-map-modal-backdrop .btn,
.import-map-modal-backdrop button {
  box-shadow: none !important;
}

.import-map-modal header,
.import-map-modal footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.import-map-modal header h2 {
  margin: 0;
  color: var(--color-text);
  font-size: 22px;
  font-weight: 950;
}

.import-map-modal header p {
  margin: 7px 0 0;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 720;
}

.import-map-modal footer {
  align-items: center;
  border-top: 1px solid #edf2f8;
  padding-top: 16px;
}

.import-map-modal footer > div {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.import-modal-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid #edf2f8;
  border-radius: 14px;
  padding: 12px;
  background: #fbfdff;
}

.import-modal-columns span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #d7e6f7;
  border-radius: 999px;
  padding: 0 10px;
  color: #52647c;
  background: #ffffff;
  font-size: 12px;
  font-weight: 850;
}

.import-map-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 24px 24px;
}

.import-map-item {
  display: grid;
  gap: 10px;
  border: 1px solid #d7e6f7;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.import-map-item.is-ready {
  border-color: rgba(13, 110, 253, 0.34);
  background: #fbfdff;
}

.import-map-item > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.import-map-item strong {
  color: var(--color-text);
  font-size: 13px;
  font-weight: 950;
}

.import-map-item em {
  color: #0d6efd;
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
}

.import-map-item select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d7e6f7;
  border-radius: 12px;
  padding: 0 12px;
  color: var(--color-text);
  background: #ffffff;
  outline: none;
  font-size: 13px;
  font-weight: 850;
}

.import-map-item select:focus {
  border-color: rgba(13, 110, 253, 0.58);
  outline: 3px solid rgba(13, 110, 253, 0.12);
  outline-offset: 1px;
}

.import-map-item small {
  color: var(--color-muted);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 760;
}

.import-preview-head {
  border-top: 1px solid #edf2f8;
}

.import-preview-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.import-preview-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid #d7e6f7;
  border-radius: 999px;
  padding: 0 11px;
  color: #52647c;
  background: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.import-preview-stats .is-warning {
  border-color: #fed7aa;
  color: #c2410c;
  background: #fff7ed;
}

.import-preview-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.import-preview-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

.import-preview-table th,
.import-preview-table td {
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid #edf2f8;
  color: #24324a;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.import-preview-table th {
  color: #5f718a;
  background: #f8fbff;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.import-preview-table td {
  font-size: 13px;
  font-weight: 760;
}

.import-preview-table tr.has-warning td:first-child {
  border-left: 4px solid #f97316;
}

.import-empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 850;
}

.import-preview-empty {
  min-height: 260px;
}

.import-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-top: 1px solid #d7e6f7;
  background: #fbfdff;
}

.import-action-bar strong {
  min-width: 0;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.import-submit-btn {
  min-height: 48px;
  border-radius: 12px;
  padding: 0 22px;
}

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

.settings-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 150px;
  padding: 22px;
}

.settings-page,
.settings-page * {
  box-shadow: none !important;
}

.settings-clean-card {
  border-radius: 18px;
}

.settings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.settings-section-head .card-title {
  margin-bottom: 8px;
}

.services-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #d7e6f7;
  border-radius: 14px;
}

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

.services-table th,
.services-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf2f8;
  text-align: left;
  vertical-align: middle;
}

.services-table th {
  color: #5f718a;
  background: #f8fbff;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.services-table td {
  color: #24324a;
  font-size: 14px;
  font-weight: 760;
}

.services-table tr:last-child td {
  border-bottom: 0;
}

.services-table .input {
  min-height: 44px;
}

.service-row-id {
  display: block;
  margin-top: 4px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
}

.service-cycle-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #d7e6f7;
  border-radius: 999px;
  padding: 0 12px;
  color: #1f3656;
  background: #f8fbff;
  font-size: 12px;
  font-weight: 900;
}

.service-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lead-row-action.danger {
  color: #dc2626;
}

.service-modal-form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.service-modal-toggle {
  width: fit-content;
}

.service-delete-copy {
  display: grid;
  gap: 8px;
  color: var(--color-text);
  text-align: center;
}

.service-delete-copy span {
  color: var(--color-muted);
  line-height: 1.45;
}

.service-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border: 1px solid #d7e6f7;
  border-radius: 999px;
  padding: 0 12px;
  background: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.service-active-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #0d6efd;
}

.services-empty {
  height: 92px;
  color: var(--color-muted);
  text-align: center !important;
  font-weight: 850;
}

.settings-save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  border: 1px solid #d7e6f7;
  border-radius: 14px;
  padding: 14px;
  background: #fbfdff;
}

.settings-save-bar > div {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sales-page,
.sales-page * {
  box-shadow: none !important;
}

.sales-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.sales-summary-card {
  display: grid;
  gap: 8px;
  min-height: 96px;
  border: 1px solid #d7e6f7;
  border-radius: 16px;
  padding: 18px;
  background: #ffffff;
}

.sales-summary-card strong {
  color: var(--color-text);
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
}

.sales-summary-card span {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.sales-clean-card {
  border-radius: 18px;
}

.sales-agent-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #d7e6f7;
  border-radius: 14px;
}

.sales-agent-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.sales-agent-table th,
.sales-agent-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf2f8;
  text-align: left;
  vertical-align: middle;
}

.sales-agent-table th {
  color: #5f718a;
  background: #f8fbff;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.sales-agent-table td {
  color: #24324a;
  font-size: 14px;
  font-weight: 760;
}

.sales-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  border: 1px solid #d7e6f7;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.sales-row strong {
  color: var(--color-text);
  font-weight: 950;
}

.sales-row span {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
}

.lead-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.lead-detail-metric {
  display: grid;
  gap: 6px;
  min-height: 96px;
  border: 1px solid #d7e6f7;
  border-radius: 16px;
  padding: 18px;
  background: #ffffff;
}

.lead-detail-metric strong {
  color: var(--color-text);
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
}

.lead-detail-metric span {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.lead-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.lead-detail-card {
  min-width: 0;
  border-radius: 18px;
}

.lead-detail-header {
  align-items: center;
}

.lead-back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: 0 0 10px;
  border: 1px solid #d7e6f7;
  border-radius: 999px;
  padding: 0 13px 0 10px;
  color: #52647c;
  background: #ffffff;
  box-shadow: none;
  font-size: 13px;
  font-weight: 900;
}

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

.lead-back-button:hover {
  border-color: #b6d4fe;
  color: #0d6efd;
  background: #f4f8ff;
}

.lead-detail-actions,
.lead-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.lead-detail-actions {
  justify-content: flex-start;
  margin-top: 18px;
}

.lead-sales-list,
.lead-notes-list {
  display: grid;
  gap: 12px;
}

.lead-sale-row,
.lead-note {
  display: grid;
  gap: 8px;
  border: 1px solid #d7e6f7;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.lead-sale-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.lead-sale-row__money {
  text-align: right;
}

.lead-sale-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.lead-sale-row strong,
.lead-note strong {
  color: var(--color-text);
  font-weight: 950;
}

.lead-sale-row span,
.lead-note span {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
}

.sale-estimate {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  border: 1px solid #b6d4fe;
  border-radius: 14px;
  padding: 12px;
  color: #0b5ed7;
  background: #eff6ff;
  font-weight: 850;
}

.sale-estimate span {
  color: #52647c;
  font-size: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 14px;
}

.timeline-item::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--color-teal);
}

.lead-reminder-detail {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  border: 1px solid #d7e6f7;
  border-radius: 12px;
  padding: 12px;
  background: #fbfdff;
}

.lead-reminder-detail strong {
  color: #101a2f;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 900;
}

.lead-reminder-detail span {
  color: #0d6efd;
  font-size: 12px;
  font-weight: 850;
}

:root[data-theme="dark"] .lead-detail-page {
  color: #edf4ff;
}

:root[data-theme="dark"] .lead-detail-page .page-title,
:root[data-theme="dark"] .lead-detail-page .card-title,
:root[data-theme="dark"] .lead-detail-page .lead-sale-row strong,
:root[data-theme="dark"] .lead-detail-page .lead-note strong,
:root[data-theme="dark"] .lead-detail-page .timeline-item strong {
  color: #edf4ff;
}

:root[data-theme="dark"] .lead-detail-page .page-subtitle,
:root[data-theme="dark"] .lead-detail-page .field,
:root[data-theme="dark"] .lead-detail-page .lead-sale-row span,
:root[data-theme="dark"] .lead-detail-page .lead-note span {
  color: #a9bbd2;
}

:root[data-theme="dark"] .lead-back-button {
  border-color: #2a3d59;
  color: #dbeafe;
  background: #13243a;
}

:root[data-theme="dark"] .lead-back-button:hover {
  border-color: rgba(79, 147, 255, 0.68);
  color: #ffffff;
  background: #18345a;
}

:root[data-theme="dark"] .lead-detail-metric,
:root[data-theme="dark"] .lead-detail-card,
:root[data-theme="dark"] .lead-sale-row,
:root[data-theme="dark"] .lead-note,
:root[data-theme="dark"] .lead-reminder-detail {
  border-color: #243955;
  background: #111c2e;
  box-shadow: none;
}

:root[data-theme="dark"] .lead-detail-metric strong {
  color: #f8fbff;
}

:root[data-theme="dark"] .lead-detail-metric span {
  color: #93a8c4;
}

:root[data-theme="dark"] .lead-detail-page :is(.input, .select, .textarea) {
  border-color: #2a3d59;
  color: #f8fbff;
  background: #15243a;
}

:root[data-theme="dark"] .lead-detail-page :is(.input, .select, .textarea)::placeholder {
  color: #7f93ad;
}

:root[data-theme="dark"] .lead-reminder-detail strong {
  color: #f8fbff;
}

:root[data-theme="dark"] .lead-reminder-detail span {
  color: #7db7ff;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.report-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 84px;
  padding: 18px 22px;
}

.agent-row {
  display: grid;
  grid-template-columns: 1fr repeat(5, minmax(80px, 110px));
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-line-soft);
}

.agent-row:last-child {
  border-bottom: 0;
}

.agent-row strong {
  font-weight: 900;
}

.muted {
  color: var(--color-muted);
}

.small {
  font-size: 12px;
}

.money {
  color: var(--color-text);
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 1080px) {
  .dashboard-layout,
  .detail-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .agent-row {
    grid-template-columns: 1fr 1fr;
  }

  .landing-hero,
  .landing-grid {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    max-width: 760px;
  }

  .landing-grid {
    max-width: 760px;
  }

  .story-layout {
    grid-template-columns: 1fr;
  }

  .story-visual {
    display: none;
  }

  .story-mobile-image {
    display: block;
  }

  .story-step {
    min-height: 0;
  }
}

@media (max-width: 780px) {
  .landing-page {
    padding: 10px;
  }

  .landing-shell {
    min-height: calc(100vh - 20px);
  }

  .landing-topbar {
    top: 8px;
    width: calc(100vw - 12px);
    min-height: 68px;
    padding: 8px 8px 8px 14px;
    border-radius: 18px;
  }

  .landing-topbar img {
    width: min(178px, 50vw);
    max-height: 52px;
  }

  .landing-topbar .btn {
    min-height: 46px;
    padding: 0 14px;
    font-size: 12px;
  }

  .landing-hero {
    gap: 24px;
    padding: 92px 0 22px;
  }

  .landing-copy h1 {
    font-size: clamp(48px, 15vw, 64px);
  }

  .landing-lead {
    font-size: 16px;
  }

  .landing-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .landing-actions .btn {
    width: 100%;
    min-height: 60px;
  }

  .landing-preview {
    padding: 14px;
    border-radius: 24px;
  }

  .landing-preview__stats {
    grid-template-columns: 1fr;
  }

  .landing-preview__table div {
    grid-template-columns: auto 1fr;
  }

  .landing-preview__table em {
    grid-column: 2;
  }

  .scroll-story {
    padding: 42px 0;
  }

  .story-head {
    margin-bottom: 30px;
  }

  .story-head h2 {
    font-size: clamp(36px, 11vw, 48px);
  }

  .story-head p {
    font-size: 16px;
  }

  .story-track {
    --story-rail: 28px;
    gap: 30px;
    padding: 4px 0 8px;
  }

  .story-line {
    top: 18px;
    bottom: 18px;
    left: 12px;
    width: 3px;
  }

  .story-step,
  .story-step--left,
  .story-step--right,
  .story-step--center {
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 14px;
    opacity: 0.78;
    transform: translateY(18px);
  }

  .story-card,
  .story-step--right .story-card,
  .story-step--center .story-card {
    grid-column: 2;
    width: 100%;
    margin-top: 0;
    padding: 18px;
    border-radius: 24px;
    text-align: left;
  }

  .story-dot,
  .story-step--center .story-dot {
    top: 24px;
    grid-column: 1;
    width: 20px;
    height: 20px;
    border-width: 5px;
  }

  .story-step.active {
    transform: none;
  }

  .story-step.active .story-dot {
    box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.28), 0 0 0 8px rgba(13, 110, 253, 0.12);
  }

  .story-step h3 {
    font-size: clamp(24px, 7vw, 31px);
  }

  .story-step p {
    font-size: 16px;
    line-height: 1.56;
  }

  .story-mobile-image {
    margin-top: 18px;
    border-radius: 18px;
  }

  .story-image-open img {
    aspect-ratio: 16 / 11;
  }

  .story-zoom {
    top: 10px;
    right: 10px;
    min-height: 40px;
    padding: 0 11px;
  }

  .story-zoom span {
    display: none;
  }

  .story-lightbox {
    padding: 76px 12px 92px;
  }

  .story-lightbox__frame {
    width: 100%;
    height: min(76vh, 680px);
    gap: 10px;
  }

  .story-lightbox__frame img {
    border-radius: 20px;
  }

  .story-lightbox__frame figcaption {
    display: grid;
    gap: 4px;
    font-size: 13px;
  }

  .story-lightbox__close {
    top: 12px;
    right: 12px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .story-lightbox__nav {
    top: auto;
    bottom: 20px;
    width: 54px;
    height: 54px;
    transform: none;
  }

  .story-lightbox__nav--prev {
    left: calc(50% - 66px);
  }

  .story-lightbox__nav--next {
    right: calc(50% - 66px);
  }

  .story-lightbox__nav:hover,
  .story-lightbox__nav:focus-visible {
    transform: scale(1.04);
  }

  .remember-toggle {
    min-height: 44px;
    font-size: 14px;
  }

  .login-page {
    padding: 12px;
  }

  .login-frame {
    width: 100%;
    min-height: calc(100vh - 24px);
    border-radius: 26px;
  }

  .login-card {
    width: min(100%, 480px);
    padding: clamp(24px, 7vw, 34px);
    border-radius: 24px;
  }

  .login-logo {
    width: min(238px, 78%);
    margin-bottom: 30px;
  }

  .login-title {
    margin-bottom: 22px;
    font-size: clamp(24px, 7vw, 30px);
  }

  .login-form {
    gap: 16px;
  }

  .login-form .input {
    min-height: 56px;
    font-size: 15px;
  }

  .login-form .btn {
    min-height: 54px;
  }

  .demo-login-grid {
    grid-template-columns: 1fr;
  }

  .import-drop {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .csv-tile {
    width: 100%;
  }

  .import-top-grid {
    grid-template-columns: 1fr;
  }

  .import-upload-panel {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 20px;
  }

  .import-upload-panel .csv-tile {
    width: 100%;
    height: 92px;
    border-radius: 18px;
    font-size: 30px;
  }

  .import-upload-actions,
  .import-action-bar,
  .import-section-head,
  .import-preview-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .import-file-btn,
  .import-submit-btn {
    width: 100%;
    justify-content: center;
  }

  .import-map-actions {
    justify-content: flex-start;
  }

  .import-map-actions .btn,
  .import-map-actions .import-state {
    width: 100%;
    justify-content: center;
  }

  .import-map-modal-backdrop {
    align-items: end;
    padding: 10px;
  }

  .import-map-modal {
    max-height: calc(100vh - 20px);
    border-radius: 18px;
    padding: 16px;
  }

  .import-map-modal header,
  .import-map-modal footer,
  .import-map-modal footer > div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .import-map-modal footer .btn {
    width: 100%;
  }

  .import-check-panel {
    padding: 18px;
  }

  .import-section-head,
  .import-preview-head,
  .import-action-bar {
    padding: 18px;
  }

  .import-column-summary {
    padding: 16px 18px 0;
  }

  .import-map-grid {
    grid-template-columns: 1fr;
    padding: 16px 18px 18px;
  }

  .import-map-item {
    padding: 14px;
  }

  .import-map-item select {
    min-height: 48px;
  }

  .import-preview-stats {
    justify-content: flex-start;
  }

  .import-preview-table {
    min-width: 0;
  }

  .import-preview-table,
  .import-preview-table tbody,
  .import-preview-table tr,
  .import-preview-table td {
    display: block;
    width: 100%;
  }

  .import-preview-table thead {
    display: none;
  }

  .import-preview-table tbody {
    display: grid;
    gap: 12px;
    padding: 16px;
  }

  .import-preview-table tr {
    display: grid;
    gap: 10px;
    border: 1px solid #d7e6f7;
    border-radius: 14px;
    padding: 14px;
    background: #ffffff;
  }

  .import-preview-table tr.has-warning {
    border-left: 4px solid #f97316;
  }

  .import-preview-table tr.has-warning td:first-child {
    border-left: 0;
  }

  .import-preview-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    height: auto;
    padding: 0;
    border: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .import-preview-table td::before {
    content: attr(data-label);
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .settings-section-head,
  .settings-save-bar,
  .settings-save-bar > div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .services-table {
    min-width: 0;
  }

  .services-table,
  .services-table tbody,
  .services-table tr,
  .services-table td {
    display: block;
    width: 100%;
  }

  .services-table thead {
    display: none;
  }

  .services-table tbody {
    display: grid;
    gap: 12px;
    padding: 14px;
  }

  .services-table tr {
    display: grid;
    gap: 12px;
    border: 1px solid #d7e6f7;
    border-radius: 14px;
    padding: 14px;
    background: #ffffff;
  }

  .services-table td {
    display: grid;
    gap: 7px;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  .services-table td::before {
    content: attr(data-label);
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .services-empty::before {
    display: none;
  }

  .sales-agent-table {
    min-width: 0;
  }

  .sales-agent-table,
  .sales-agent-table tbody,
  .sales-agent-table tr,
  .sales-agent-table td {
    display: block;
    width: 100%;
  }

  .sales-agent-table thead {
    display: none;
  }

  .sales-agent-table tbody {
    display: grid;
    gap: 12px;
    padding: 14px;
  }

  .sales-agent-table tr {
    display: grid;
    gap: 10px;
    border: 1px solid #d7e6f7;
    border-radius: 14px;
    padding: 14px;
    background: #ffffff;
  }

  .sales-agent-table td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 0;
    border: 0;
  }

  .sales-agent-table td::before {
    content: attr(data-label);
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .sales-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  :root[data-theme="dark"] .sales-agent-table tbody {
    background: #0d1727;
  }

  :root[data-theme="dark"] .sales-agent-table tr,
  :root[data-theme="dark"] .sales-agent-table tbody tr:nth-child(even) {
    border-color: #1f314a;
    background: #101b2d;
  }

  :root[data-theme="dark"] .sales-agent-table tr td,
  :root[data-theme="dark"] .sales-agent-table tbody tr:nth-child(even) td {
    background: transparent;
  }

  :root[data-theme="dark"] .sales-agent-table td::before {
    color: #8ea3bd;
  }
}

@media (max-width: 780px) {
  .landing-preview,
  .landing-grid .card,
  .settings-clean-card,
  .sales-clean-card,
  .lead-detail-card {
    box-shadow: none;
  }

  .landing-preview__table strong,
  .landing-grid p,
  .page-subtitle,
  .card-title,
  .sales-row,
  .lead-sale-row,
  .lead-note {
    overflow-wrap: anywhere;
  }

  .landing-grid {
    gap: 12px;
  }

  .landing-grid .card {
    border-radius: 18px;
    padding: 18px;
  }

  .landing-preview__table div {
    min-width: 0;
  }

  .story-card {
    min-width: 0;
  }

  .story-step--center p,
  .story-step--center .story-mobile-image {
    max-width: 100%;
  }

  .lead-detail-stats,
  .sales-summary-grid {
    grid-template-columns: 1fr;
  }

  .lead-detail-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
  }

  .lead-detail-header .status-badge {
    justify-self: start;
  }

  .lead-back-button {
    width: fit-content;
    min-height: 42px;
    margin-bottom: 12px;
    border-radius: 14px;
    padding: 0 14px 0 11px;
  }

  .lead-detail-header .page-title {
    font-size: 23px;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .lead-detail-metric,
  .sales-summary-card {
    min-height: 82px;
    border-radius: 14px;
    padding: 16px;
  }

  .lead-detail-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .lead-detail-actions,
  .lead-card-head,
  .settings-section-head,
  .settings-save-bar,
  .settings-save-bar > div {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .lead-detail-actions .btn,
  .lead-card-head .btn,
  .settings-save-bar .btn,
  .settings-section-head .btn {
    width: 100%;
  }

  .lead-sale-row,
  .sales-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .lead-sale-row__money,
  .lead-sale-row > div:last-child,
  .sales-row > div:last-child {
    text-align: left;
  }

  .lead-sale-actions {
    justify-content: flex-start;
  }

  .lead-reminder-detail {
    border-radius: 14px;
  }

  .timeline {
    gap: 12px;
  }

  .timeline-item {
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 10px;
  }

  .import-column-summary,
  .import-modal-columns,
  .import-preview-stats {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .import-column-summary span,
  .import-modal-columns span,
  .import-preview-stats span {
    flex: 0 0 auto;
  }

  .report-band {
    border-radius: 16px;
  }

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

@media (max-width: 430px) {
  .landing-topbar img,
  .topbar__brand {
    width: min(142px, 38vw);
  }

  .landing-topbar .btn {
    min-width: 0;
    padding: 0 12px;
  }

  .lead-db-table tbody {
    padding: 12px;
  }

  .lead-db-table tbody tr {
    padding: 14px;
  }

  .lead-db-table td {
    gap: 10px;
  }

  .lead-row-action {
    width: 40px;
    height: 40px;
  }

  .lead-row-actions {
    gap: 6px;
  }

  .lead-status-select {
    width: min(178px, 54vw);
  }

  .lead-reminder-cell {
    max-width: 54vw;
  }

  .story-step h3 {
    font-size: 24px;
  }
}

:root[data-theme="dark"] :is(
  .landing-topbar,
  .landing-preview,
  .landing-preview__stats div,
  .landing-preview__table div,
  .landing-grid .card,
  .story-card,
  .login-frame,
  .login-card,
  .settings-clean-card,
  .settings-card,
  .sales-summary-card,
  .sales-clean-card,
  .lead-detail-card,
  .report-band
) {
  border-color: var(--color-line);
  color: var(--color-text);
  background: var(--color-surface);
  box-shadow: none;
}

:root[data-theme="dark"] :is(
  .landing-preview__bar,
  .demo-login-option,
  .demo-login-panel,
  .service-active-toggle,
  .lead-reminder-detail,
  .lead-sale-row,
  .lead-note,
  .sales-row
) {
  border-color: var(--color-line);
  background: #0b1728;
}

:root[data-theme="dark"] :is(
  .landing-lead,
  .page-subtitle,
  .muted,
  .small,
  .demo-login-panel > span,
  .demo-login-option small,
  .sales-summary-card span,
  .lead-detail-metric span
) {
  color: var(--color-muted);
}

:root[data-theme="dark"] .reports-page {
  --reports-panel: #111c2e;
  --reports-panel-2: #0d1727;
  --reports-border: #2a3d59;
  --reports-border-soft: #1f314a;
  --reports-text: #f4f8ff;
  --reports-muted: #a9bbd2;
}

:root[data-theme="dark"] .reports-page .page-header,
:root[data-theme="dark"] .reports-page .stat-card,
:root[data-theme="dark"] .reports-page .card {
  border-color: var(--reports-border-soft);
  color: var(--reports-text);
  background: var(--reports-panel);
  box-shadow: none;
}

:root[data-theme="dark"] .reports-page .page-title,
:root[data-theme="dark"] .reports-page .card-title,
:root[data-theme="dark"] .reports-page .stat-card__value,
:root[data-theme="dark"] .reports-page .activity-item strong,
:root[data-theme="dark"] .reports-page .agent-row strong {
  color: var(--reports-text);
}

:root[data-theme="dark"] .reports-page .page-subtitle,
:root[data-theme="dark"] .reports-page .stat-card__label,
:root[data-theme="dark"] .reports-page .agent-row span {
  color: var(--reports-muted);
}

:root[data-theme="dark"] .reports-page .chip {
  min-width: 48px;
  border: 1px solid rgba(79, 147, 255, 0.26);
  color: #dbeafe;
  background: #132b4c;
}

:root[data-theme="dark"] .reports-page .donut {
  background: conic-gradient(#4f93ff var(--value), #263b57 0);
}

:root[data-theme="dark"] .reports-page .donut::after {
  color: var(--reports-text);
  background: var(--reports-panel);
}

:root[data-theme="dark"] .reports-page .agent-row {
  border-bottom-color: var(--reports-border-soft);
}

:root[data-theme="dark"] .reports-page .mini-chart path {
  stroke: #263b57;
}

:root[data-theme="dark"] .reports-page .mini-chart circle {
  fill: var(--reports-panel);
  stroke: #4f93ff;
}

:root[data-theme="dark"] .reports-page .page-actions .btn:not(.btn-primary) {
  border: 1px solid var(--reports-border);
  color: #dbeafe;
  background: #13243a;
}

:root[data-theme="dark"] .sales-agent-table-wrap {
  border-color: #2a3d59;
  background: #0d1727;
}

:root[data-theme="dark"] .sales-agent-table th {
  border-bottom-color: #1f314a;
  color: #a9bbd2;
  background: #0b1423;
}

:root[data-theme="dark"] .sales-agent-table td {
  border-bottom-color: #1f314a;
  color: #dce8f7;
  background: #101b2d;
}

:root[data-theme="dark"] .sales-agent-table tbody tr:nth-child(even) td {
  background: #0d1828;
}

:root[data-theme="dark"] .sales-agent-table td strong {
  color: #f4f8ff;
}

:root[data-theme="dark"] .sales-agent-table .services-empty {
  color: #a9bbd2;
  background: #101b2d;
}

:root[data-theme="dark"] .login-frame::before {
  opacity: 0.16;
}

:root[data-theme="dark"] .landing-actions .btn:not(.btn-primary) {
  color: #dbeafe;
  background: #132b4c;
  border-color: var(--color-line);
}

:root[data-theme="dark"] .settings-page {
  --settings-panel: #111c2e;
  --settings-panel-2: #0d1727;
  --settings-border: #2a3d59;
  --settings-border-soft: #1f314a;
  --settings-text: #f4f8ff;
  --settings-muted: #a9bbd2;
}

:root[data-theme="dark"] .settings-page .settings-clean-card {
  border-color: var(--settings-border-soft);
  background: var(--settings-panel);
}

:root[data-theme="dark"] .settings-page .card-title,
:root[data-theme="dark"] .settings-save-bar strong,
:root[data-theme="dark"] .services-table td strong {
  color: var(--settings-text);
}

:root[data-theme="dark"] .settings-page .muted,
:root[data-theme="dark"] .settings-section-head p {
  color: var(--settings-muted);
}

:root[data-theme="dark"] .services-table-wrap {
  border-color: var(--settings-border);
  background: var(--settings-panel-2);
}

:root[data-theme="dark"] .service-cycle-badge {
  border-color: var(--settings-border);
  color: #dbeafe;
  background: #0b1728;
}

:root[data-theme="dark"] .services-table th {
  border-bottom-color: var(--settings-border-soft);
  color: #a9bbd2;
  background: #0b1423;
}

:root[data-theme="dark"] .services-table td {
  border-bottom-color: var(--settings-border-soft);
  color: #dce8f7;
  background: #101b2d;
}

:root[data-theme="dark"] .services-table tr:nth-child(even) td {
  background: #0d1828;
}

:root[data-theme="dark"] .services-table .input,
:root[data-theme="dark"] .settings-page .input {
  border-color: var(--settings-border);
  color: var(--settings-text);
  background: #0c1727;
}

:root[data-theme="dark"] .services-table .input:focus,
:root[data-theme="dark"] .settings-page .input:focus {
  border-color: rgba(79, 147, 255, 0.82);
  box-shadow: 0 0 0 3px rgba(79, 147, 255, 0.14) !important;
}

:root[data-theme="dark"] .service-active-toggle {
  border-color: var(--settings-border);
  color: #c4d4e8;
  background: #14243a;
}

:root[data-theme="dark"] .service-active-toggle input {
  accent-color: #4f93ff;
}

:root[data-theme="dark"] .services-empty {
  color: var(--settings-muted);
  background: var(--settings-panel-2);
}

:root[data-theme="dark"] .settings-save-bar {
  border-color: var(--settings-border-soft);
  background: var(--settings-panel-2);
}

:root[data-theme="dark"] .settings-save-bar .btn:not(.btn-teal) {
  border: 1px solid var(--settings-border);
  color: #dbeafe;
  background: #13243a;
}

:root[data-theme="dark"] .settings-save-bar .btn:not(.btn-teal):hover {
  border-color: rgba(79, 147, 255, 0.68);
  color: #ffffff;
  background: #18345a;
}

@media (max-width: 780px) {
  :root[data-theme="dark"] .services-table tbody {
    background: var(--settings-panel-2);
  }

  :root[data-theme="dark"] .services-table tr,
  :root[data-theme="dark"] .services-table tr:nth-child(even) {
    border-color: var(--settings-border-soft);
    background: #101b2d;
  }

  :root[data-theme="dark"] .services-table tr td,
  :root[data-theme="dark"] .services-table tr:nth-child(even) td {
    background: transparent;
  }

  :root[data-theme="dark"] .services-table td::before {
    color: #8ea3bd;
  }
}

.import-page,
.import-map-modal {
  --import-panel: #ffffff;
  --import-panel-2: #fbfdff;
  --import-panel-3: #f6faff;
  --import-border: #d7e6f7;
  --import-border-soft: #edf2f8;
  --import-text: #0f172a;
  --import-muted: #5f718a;
  --import-muted-2: #52647c;
  --import-chip: #eff6ff;
  --import-chip-border: #cfe2ff;
  --import-primary: #0d6efd;
  --import-success-text: #15803d;
  --import-success-bg: #f0fdf4;
  --import-success-border: #bbf7d0;
  --import-warning-text: #c2410c;
  --import-warning-bg: #fff7ed;
  --import-warning-border: #fed7aa;
}

.import-page :is(.import-upload-panel, .import-check-panel, .import-workbench),
.import-map-modal {
  border-color: var(--import-border);
  color: var(--import-text);
  background: var(--import-panel);
}

.import-page :is(.page-title, .import-upload-copy h2, .import-section-head h2, .import-preview-head h2, .import-check-panel strong, .import-action-bar strong),
.import-map-modal :is(h2, .import-map-item strong, .import-value-card strong, .import-value-panel__head strong) {
  color: var(--import-text);
}

.import-page :is(.page-subtitle, .import-upload-copy p, .import-section-head p, .import-preview-head p, .import-check-panel li, .import-upload-actions > span, .import-empty),
.import-map-modal :is(header p, .import-map-item small, .import-value-panel__head span) {
  color: var(--import-muted);
}

.import-page .csv-tile {
  color: var(--import-primary);
  background: var(--import-chip);
}

.import-page .import-upload-panel.is-dragging {
  border-color: color-mix(in srgb, var(--import-primary) 56%, var(--import-border));
  background: var(--import-panel-3);
}

.import-page .import-section-head,
.import-page .import-preview-head,
.import-page .import-action-bar,
.import-map-modal footer {
  border-color: var(--import-border-soft);
}

.import-page .import-action-bar {
  background: var(--import-panel-2);
}

.import-page :is(.import-state, .import-column-summary span, .import-preview-stats span),
.import-map-modal :is(.import-modal-columns, .import-modal-columns span, .import-map-item, .import-map-item select, .import-value-panel, .import-value-card, .import-value-card span) {
  border-color: var(--import-border);
  color: var(--import-muted-2);
  background: var(--import-panel-2);
}

.import-page .import-column-summary span.is-mapped,
.import-map-modal .import-map-item.is-ready {
  border-color: var(--import-chip-border);
  color: var(--import-primary);
  background: var(--import-chip);
}

.import-page .import-state.is-ready {
  border-color: var(--import-success-border);
  color: var(--import-success-text);
  background: var(--import-success-bg);
}

.import-page .import-preview-stats .is-warning {
  border-color: var(--import-warning-border);
  color: var(--import-warning-text);
  background: var(--import-warning-bg);
}

.import-page .import-preview-table th {
  border-color: var(--import-border-soft);
  color: var(--import-muted);
  background: var(--import-panel-3);
}

.import-page .import-preview-table td {
  border-color: var(--import-border-soft);
  color: var(--import-text);
  background: var(--import-panel);
}

.import-map-modal-backdrop {
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(10px);
}

.import-map-modal {
  gap: 18px;
}

.import-map-modal,
.import-preview-table-wrap {
  scrollbar-color: var(--import-border) transparent;
  scrollbar-width: thin;
}

.import-map-modal::-webkit-scrollbar,
.import-preview-table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.import-map-modal::-webkit-scrollbar-track,
.import-preview-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.import-map-modal::-webkit-scrollbar-thumb,
.import-preview-table-wrap::-webkit-scrollbar-thumb {
  border: 3px solid var(--import-panel);
  border-radius: 999px;
  background: var(--import-border);
}

.import-modal-columns {
  align-items: flex-start;
}

.import-value-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--import-border);
  border-radius: 16px;
  padding: 14px;
}

.import-value-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.import-value-panel__head strong {
  font-size: 14px;
  font-weight: 950;
}

.import-value-panel__head span {
  font-size: 12px;
  font-weight: 850;
}

.import-value-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.import-value-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  border: 1px solid var(--import-border);
  border-radius: 14px;
  padding: 12px;
}

.import-value-card strong {
  font-size: 12px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.import-value-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.import-value-card span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  border: 1px solid var(--import-border);
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 820;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-map-modal .lead-row-action {
  flex: 0 0 auto;
}

.import-map-modal .btn:not(.btn-primary) {
  border: 1px solid var(--import-border);
  color: var(--import-text);
  background: var(--import-panel-2);
}

.import-map-modal .btn-primary,
.import-page :is(.import-file-btn, .import-submit-btn, .import-map-actions .btn-primary) {
  background: var(--import-primary);
}

:root[data-theme="dark"] .import-page,
:root[data-theme="dark"] .import-map-modal {
  --import-panel: #101b2d;
  --import-panel-2: #0c1727;
  --import-panel-3: #14243a;
  --import-border: #2a3f5d;
  --import-border-soft: #1e314b;
  --import-text: #f4f8ff;
  --import-muted: #a9bbd2;
  --import-muted-2: #bfd0e6;
  --import-chip: rgba(79, 147, 255, 0.15);
  --import-chip-border: rgba(93, 166, 255, 0.42);
  --import-primary: #2f80ff;
  --import-success-text: #86efac;
  --import-success-bg: rgba(34, 197, 94, 0.13);
  --import-success-border: rgba(74, 222, 128, 0.34);
  --import-warning-text: #fdba74;
  --import-warning-bg: rgba(249, 115, 22, 0.12);
  --import-warning-border: rgba(251, 146, 60, 0.34);
}

:root[data-theme="dark"] .import-page {
  color: var(--import-text);
}

:root[data-theme="dark"] .import-page :is(.import-upload-panel, .import-check-panel, .import-workbench),
:root[data-theme="dark"] .import-map-modal {
  border-color: var(--import-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 52px),
    var(--import-panel);
}

:root[data-theme="dark"] .import-page .csv-tile {
  border: 1px solid var(--import-border);
  color: #9cc7ff;
  background: #13243a;
}

:root[data-theme="dark"] .import-page .import-check-panel li::before {
  background: #5b9dff;
}

:root[data-theme="dark"] .import-page :is(.import-state, .import-column-summary span, .import-preview-stats span),
:root[data-theme="dark"] .import-map-modal :is(.import-modal-columns, .import-modal-columns span, .import-map-item, .import-map-item select, .import-value-panel, .import-value-card, .import-value-card span) {
  border-color: var(--import-border);
  color: var(--import-muted-2);
  background: var(--import-panel-2);
}

:root[data-theme="dark"] .import-map-modal .import-map-item.is-ready {
  color: #dbeafe;
  background: #13243a;
}

:root[data-theme="dark"] .import-map-modal .import-map-item em {
  color: #93c5fd;
}

:root[data-theme="dark"] .import-map-modal .import-map-item select {
  color: var(--import-text);
}

:root[data-theme="dark"] .import-map-modal .import-map-item select:focus {
  border-color: rgba(91, 157, 255, 0.78);
  outline-color: rgba(91, 157, 255, 0.20);
}

:root[data-theme="dark"] .import-page .import-preview-table tr:nth-child(even) td {
  background: #0d1828;
}

:root[data-theme="dark"] .import-page .import-preview-table tr.has-warning td:first-child {
  border-left-color: #fb923c;
}

:root[data-theme="dark"] .import-map-modal-backdrop {
  background: rgba(3, 7, 18, 0.72);
}

:root[data-theme="dark"] .import-map-modal .lead-row-action {
  border-color: var(--import-border);
  color: #dbeafe;
  background: #13243a;
}

:root[data-theme="dark"] .import-map-modal .btn:not(.btn-primary) {
  border-color: var(--import-border);
  color: #e8f1ff;
  background: #13243a;
}

@media (max-width: 780px) {
  .import-value-panel__head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .import-value-list {
    grid-template-columns: 1fr;
  }

  :root[data-theme="dark"] .import-page .import-preview-table tbody {
    background: var(--import-panel-2);
  }

  :root[data-theme="dark"] .import-page .import-preview-table tr,
  :root[data-theme="dark"] .import-page .import-preview-table tr:nth-child(even) {
    border-color: var(--import-border);
    background: var(--import-panel);
  }

  :root[data-theme="dark"] .import-page .import-preview-table tr td,
  :root[data-theme="dark"] .import-page .import-preview-table tr:nth-child(even) td {
    background: transparent;
  }

  :root[data-theme="dark"] .import-page .import-preview-table td::before {
    color: #8ea3bd;
  }
}

.reports-dashboard,
.owner-dashboard-page,
.agent-dashboard-page {
  --report-bg: #ffffff;
  --report-bg-soft: #f7fbff;
  --report-bg-muted: #edf5ff;
  --report-border: #d7e6f7;
  --report-border-soft: #eaf2fb;
  --report-text: #0f172a;
  --report-muted: #64748b;
  --report-blue: #0d6efd;
  --report-cyan: #18c2c6;
  --report-green: #16a34a;
  --report-orange: #f59e0b;
  --report-red: #ef4444;
}

.reports-dashboard *,
.owner-dashboard-page :is(.card, .stat-card, .table-card, .selection-bar),
.agent-dashboard-page :is(.card, .stat-card, .table-card) {
  box-shadow: none;
}

.owner-dashboard-page .dashboard-assign-tools {
  justify-content: flex-end;
}

.owner-dashboard-page .dashboard-agent-select {
  width: min(360px, 32vw);
  min-width: 230px;
}

.owner-dashboard-page > .grid-2 {
  align-items: start;
}

.owner-dashboard-page > .grid-2 > .table-card {
  align-self: start;
  height: auto;
}

.reports-hero,
.report-panel {
  border: 1px solid var(--report-border);
  border-radius: 24px;
  color: var(--report-text);
  background: var(--report-bg);
  box-shadow: none;
}

.reports-hero {
  align-items: center;
  margin-bottom: 0;
  padding: 20px;
}

.reports-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.reports-controls .select {
  width: 190px;
}

.reports-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.report-metric {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  min-height: 118px;
  padding: 20px;
  border: 1px solid var(--report-border);
  border-radius: 22px;
  background: var(--report-bg);
}

.report-metric span,
.report-panel__head p,
.report-funnel__step span,
.report-bar-row em,
.source-chart__row strong,
.agent-performance-card em,
.agent-performance-card p,
.agent-performance-card__money,
.insight-tiles span,
.agent-earnings-card__line span {
  color: var(--report-muted);
}

.report-metric strong {
  display: block;
  margin-top: 8px;
  color: var(--report-text);
  font-size: clamp(25px, 2.2vw, 34px);
  line-height: 1;
  font-weight: 950;
}

.report-metric em {
  display: block;
  margin-top: 8px;
  color: var(--report-muted);
  font-style: normal;
  font-weight: 750;
}

.report-metric i {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: var(--report-blue);
  background: #edf5ff;
}

.report-metric--cyan i {
  color: var(--report-cyan);
  background: #e9fbfa;
}

.report-metric--green i {
  color: var(--report-green);
  background: #ecfdf5;
}

.report-metric--orange i {
  color: var(--report-orange);
  background: #fff7ed;
}

.reports-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.report-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 22px;
}

.report-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.report-panel__head h2,
.report-export-panel h2 {
  margin: 0;
  color: var(--report-text);
  font-size: 17px;
  font-weight: 950;
}

.report-panel__head p,
.report-export-panel p {
  margin: 6px 0 0;
  line-height: 1.45;
  font-weight: 680;
}

.report-panel__head > strong {
  white-space: nowrap;
  color: var(--report-blue);
  font-weight: 950;
}

.report-funnel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.report-funnel__step {
  position: relative;
  display: grid;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--report-border-soft);
  border-radius: 18px;
  background: var(--report-bg-soft);
}

.report-funnel__step div {
  display: grid;
  gap: 4px;
}

.report-funnel__step strong {
  color: var(--report-text);
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
}

.report-funnel__step em {
  justify-self: start;
  min-height: 26px;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--report-blue);
  background: #eaf3ff;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.report-funnel__step > i,
.agent-meter,
.report-bar-row > i,
.source-chart__row > i {
  display: block;
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: var(--report-bg-muted);
}

.report-funnel__step > i::before {
  content: "";
  display: block;
  width: var(--bar);
  height: 100%;
  border-radius: inherit;
  background: var(--report-blue);
}

.report-funnel__step--cyan > i::before {
  background: var(--report-cyan);
}

.report-funnel__step--green > i::before {
  background: var(--report-green);
}

.report-funnel__step--red > i::before {
  background: var(--report-red);
}

.insight-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.insight-tiles div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--report-border-soft);
  border-radius: 16px;
  background: var(--report-bg-soft);
}

.insight-tiles strong {
  display: block;
  color: var(--report-text);
  font-size: 20px;
  line-height: 1;
  font-weight: 950;
}

.insight-tiles span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
}

.report-line-chart {
  width: 100%;
  height: 210px;
  min-height: 180px;
}

.report-line-chart__grid {
  fill: none;
  stroke: var(--report-border-soft);
  stroke-width: 1.5;
}

.report-line-chart__line {
  fill: none;
  stroke: var(--chart-color, var(--report-blue));
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-line-chart circle {
  fill: var(--report-bg);
  stroke: var(--chart-color, var(--report-blue));
  stroke-width: 4;
}

.report-bars,
.source-chart {
  display: grid;
  gap: 12px;
}

.report-bar-row,
.source-chart__row {
  display: grid;
  align-items: center;
  gap: 10px;
}

.report-bar-row {
  grid-template-columns: 1fr;
}

.report-bar-row div,
.source-chart__row {
  min-width: 0;
}

.report-bar-row div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.report-bar-row span,
.source-chart__row span {
  min-width: 0;
  overflow: hidden;
  color: var(--report-text);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-bar-row strong,
.source-chart__row strong {
  font-weight: 950;
}

.report-bar-row b,
.source-chart__row b,
.agent-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.report-bar-row b {
  background: var(--bar-color, var(--report-blue));
}

.source-chart__row {
  grid-template-columns: minmax(0, 1fr) minmax(80px, 0.8fr) auto;
}

.source-chart__row b {
  background: var(--report-cyan);
}

.source-chart__row:nth-child(2n) b {
  background: var(--report-blue);
}

.source-chart__row:nth-child(3n) b {
  background: var(--report-green);
}

.report-export-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.reports-export-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.agent-performance-panel {
  gap: 16px;
}

.agent-performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
}

.agent-performance-panel--compact .agent-performance-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.agent-performance-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--report-border-soft);
  border-radius: 18px;
  background: var(--report-bg-soft);
}

.agent-performance-card header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.agent-performance-card header > span {
  width: 6px;
  height: 44px;
  border-radius: 999px;
  background: var(--agent-color, var(--report-blue));
}

.agent-performance-card header div {
  display: grid;
  min-width: 0;
}

.agent-performance-card header strong {
  overflow: hidden;
  color: var(--report-text);
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-performance-card header b {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  color: var(--agent-color, var(--report-blue));
  background: var(--report-bg);
  font-weight: 950;
}

.agent-performance-card__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.agent-performance-card__metrics div {
  min-width: 0;
  padding: 10px;
  border-radius: 14px;
  background: var(--report-bg);
}

.agent-performance-card__metrics strong {
  display: block;
  color: var(--report-text);
  font-weight: 950;
}

.agent-performance-card__metrics span {
  display: block;
  margin-top: 3px;
  color: var(--report-muted);
  font-size: 11px;
  font-weight: 800;
}

.agent-meter i {
  background: var(--agent-color, var(--report-blue));
}

.agent-performance-card__money {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 850;
}

.agent-performance-card p {
  margin: 0;
  line-height: 1.45;
  font-weight: 760;
}

.dashboard-report-panel {
  padding: 20px;
}

.agent-earnings-card__commission {
  margin-top: 22px;
  font-size: 24px;
}

.agent-earnings-card__line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--report-border-soft);
  border-radius: 15px;
  background: var(--report-bg-soft);
}

.report-empty {
  display: grid;
  place-items: center;
  min-height: 110px;
  border: 1px dashed var(--report-border);
  border-radius: 18px;
  color: var(--report-muted);
  background: var(--report-bg-soft);
  font-weight: 850;
  text-align: center;
}

:root[data-theme="dark"] .reports-dashboard,
:root[data-theme="dark"] .owner-dashboard-page,
:root[data-theme="dark"] .agent-dashboard-page {
  --report-bg: #101b2d;
  --report-bg-soft: #0d1727;
  --report-bg-muted: #172842;
  --report-border: #2b405f;
  --report-border-soft: #223653;
  --report-text: #edf4ff;
  --report-muted: #a9bbd2;
  --report-blue: #5b9dff;
  --report-cyan: #36d8de;
  --report-green: #3ddc84;
  --report-orange: #fbbf24;
  --report-red: #fb7185;
}

:root[data-theme="dark"] .reports-hero,
:root[data-theme="dark"] .report-panel,
:root[data-theme="dark"] .report-metric,
:root[data-theme="dark"] .agent-performance-card,
:root[data-theme="dark"] .agent-performance-card__metrics div,
:root[data-theme="dark"] .insight-tiles div,
:root[data-theme="dark"] .agent-earnings-card__line,
:root[data-theme="dark"] .report-empty {
  border-color: var(--report-border-soft);
  color: var(--report-text);
  background: var(--report-bg);
}

:root[data-theme="dark"] .report-funnel__step,
:root[data-theme="dark"] .agent-performance-card,
:root[data-theme="dark"] .agent-earnings-card__line,
:root[data-theme="dark"] .report-empty,
:root[data-theme="dark"] .agent-performance-card__metrics div,
:root[data-theme="dark"] .insight-tiles div {
  background: var(--report-bg-soft);
}

:root[data-theme="dark"] .report-metric i,
:root[data-theme="dark"] .report-funnel__step em,
:root[data-theme="dark"] .agent-performance-card header b {
  color: #dbeafe;
  background: #13243a;
}

:root[data-theme="dark"] .reports-controls .select,
:root[data-theme="dark"] .reports-export-actions .btn,
:root[data-theme="dark"] .report-export-panel .btn:not(.btn-primary) {
  border-color: var(--report-border);
  color: var(--report-text);
  background: #13243a;
}

:root[data-theme="dark"] .report-service-wrap,
:root[data-theme="dark"] .report-service-table th,
:root[data-theme="dark"] .report-service-table td {
  border-color: var(--report-border-soft);
}

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

  .reports-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .reports-hero,
  .report-export-panel,
  .report-panel__head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .reports-controls,
  .reports-controls .select,
  .reports-controls .btn,
  .reports-export-actions,
  .reports-export-actions .btn,
  .owner-dashboard-page .dashboard-agent-select,
  .owner-dashboard-page .dashboard-assign-tools .btn {
    width: 100%;
  }

  .reports-kpi-grid,
  .report-funnel,
  .insight-tiles,
  .agent-performance-card__metrics {
    grid-template-columns: 1fr 1fr;
  }

  .report-panel,
  .dashboard-report-panel {
    gap: 14px;
    padding: 16px;
    border-radius: 20px;
  }

  .report-metric {
    min-height: 104px;
    padding: 16px;
    border-radius: 18px;
  }

  .report-metric i {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .report-line-chart {
    height: 160px;
    min-height: 150px;
  }

  .source-chart__row {
    grid-template-columns: minmax(0, 1fr) 76px auto;
  }

  .agent-performance-grid,
  .agent-performance-panel--compact .agent-performance-grid {
    grid-template-columns: 1fr;
  }

  .agent-performance-card {
    padding: 14px;
  }
}

@media (max-width: 430px) {
  .reports-kpi-grid,
  .report-funnel,
  .insight-tiles,
  .agent-performance-card__metrics {
    grid-template-columns: 1fr;
  }

  .source-chart__row {
    grid-template-columns: 1fr auto;
  }

  .source-chart__row > i {
    grid-column: 1 / -1;
  }
}

@media print {
  .sidebar,
  .topbar,
  .reports-controls,
  .report-export-panel {
    display: none !important;
  }

  .main-area {
    position: static !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .reports-dashboard {
    color: #0f172a !important;
    background: #ffffff !important;
  }
}
