:root {
  color-scheme: light;
  --ink: #111827;
  --black: #111827;
  --muted: #667085;
  --paper: #f3f5f7;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-solid: #ffffff;
  --line: #d0d7e2;
  --line-soft: #eaedf2;
  --accent: #ec6530;
  --accent-dark: #bd4a1f;
  --accent-soft: #fff3e9;
  --navy: #162033;
  --navy-hover: #23314a;
  --text: #344054;
  --green: #1f8a62;
  --amber: #b98422;
  --danger: #b42318;
  --shadow: 0 18px 42px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 10px 26px rgba(16, 24, 40, 0.055);
  --action-primary: linear-gradient(135deg, #bd4a1f, #ec6530);
  --action-create: linear-gradient(135deg, #ec6530, #ffad45);
  --action-view: linear-gradient(135deg, #fff3e9, #ffe2c8);
  --action-neutral: linear-gradient(135deg, #ffffff, #f8fafc);
  --action-danger: linear-gradient(135deg, #9f2f3a, #e25f5f);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

body::before,
body::after {
  display: none;
}

.login-view {
  position: relative;
  isolation: isolate;
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 620px) 430px;
  align-items: center;
  justify-content: center;
  gap: clamp(34px, 6vw, 78px);
  padding: 48px 0;
  animation: pageReveal 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-bg-animation {
  position: fixed;
  inset: clamp(18px, 4vw, 46px) max(-7vw, -110px);
  z-index: -1;
  overflow: hidden;
  border-radius: 8px;
  pointer-events: none;
}

.login-bg-animation::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(rgba(189, 74, 31, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(189, 74, 31, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 22% 28%, rgba(236, 101, 48, 0.2), transparent 28%),
    radial-gradient(circle at 82% 42%, rgba(36, 83, 121, 0.1), transparent 26%);
  background-size: 54px 54px, 54px 54px, 100% 100%, 100% 100%;
  opacity: 0.78;
  animation: loginGridFlow 24s ease-in-out infinite;
}

.login-bg-animation::after {
  position: absolute;
  top: -24%;
  left: -18%;
  width: 42%;
  height: 148%;
  content: "";
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  opacity: 0.36;
  transform: rotate(17deg);
  animation: loginLightSweep 10.5s ease-in-out infinite;
}

.login-bg-card,
.login-bg-route,
.login-bg-spark {
  position: absolute;
  display: block;
}

.login-bg-card {
  border: 1px solid rgba(236, 101, 48, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 250, 242, 0.36));
  box-shadow: 0 24px 60px rgba(154, 94, 23, 0.08);
  backdrop-filter: blur(10px);
}

.login-bg-card i {
  position: absolute;
  display: block;
  height: 8px;
  border-radius: 999px;
  background: rgba(189, 74, 31, 0.22);
  animation: loginDataPulse 4.8s ease-in-out infinite;
}

.login-bg-card-party {
  left: 0;
  bottom: 3%;
  width: min(330px, 28vw);
  height: 182px;
  opacity: 0.68;
  animation: loginCardFloat 8.5s ease-in-out infinite;
}

.login-bg-card-party i:nth-child(1) {
  top: 34px;
  left: 28px;
  width: 42%;
}

.login-bg-card-party i:nth-child(2) {
  top: 72px;
  left: 28px;
  width: 72%;
  animation-delay: 0.5s;
}

.login-bg-card-party i:nth-child(3) {
  top: 110px;
  left: 28px;
  width: 58%;
  animation-delay: 1s;
}

.login-bg-card-party i:nth-child(4) {
  top: 148px;
  left: 28px;
  width: 36%;
  animation-delay: 1.5s;
}

.login-bg-card-file {
  right: 1%;
  top: 8%;
  width: min(355px, 30vw);
  height: 214px;
  animation: loginCardFloat 9.5s ease-in-out -2s infinite;
}

.login-bg-card-file i {
  left: 78px;
  width: 58%;
}

.login-bg-card-file i:nth-child(1) {
  top: 52px;
}

.login-bg-card-file i:nth-child(2) {
  top: 104px;
  width: 68%;
  animation-delay: 0.65s;
}

.login-bg-card-file i:nth-child(3) {
  top: 156px;
  width: 48%;
  animation-delay: 1.3s;
}

.login-bg-route {
  right: 11%;
  top: 24%;
  width: 3px;
  height: 260px;
  background: linear-gradient(180deg, transparent, rgba(189, 74, 31, 0.52), transparent);
  animation: loginRouteGlow 5.8s ease-in-out infinite;
}

.login-bg-route i,
.login-bg-spark {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 8px rgba(236, 101, 48, 0.11), 0 0 24px rgba(236, 101, 48, 0.24);
}

.login-bg-route i {
  left: -5px;
}

.login-bg-route i:nth-child(1) {
  top: 8px;
}

.login-bg-route i:nth-child(2) {
  top: 120px;
  animation-delay: 0.55s;
}

.login-bg-route i:nth-child(3) {
  bottom: 8px;
  animation-delay: 1.1s;
}

.login-bg-spark {
  opacity: 0.48;
  animation: loginSparkTravel 7.2s ease-in-out infinite;
}

.login-bg-spark-one {
  left: 7%;
  top: 34%;
}

.login-bg-spark-two {
  left: 47%;
  bottom: 9%;
  animation-delay: 1.6s;
}

.login-bg-spark-three {
  right: 9%;
  top: 58%;
  animation-delay: 3.1s;
}

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

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.login-brand {
  color: var(--black);
  text-align: center;
}

.brand-logo {
  display: flex;
  justify-content: center;
  width: min(360px, 72vw);
  margin: 0 auto 32px;
  text-decoration: none;
  animation: brandFloat 5.5s ease-in-out infinite;
}

.brand-logo img {
  width: 100%;
  height: auto;
  display: block;
  filter: brightness(0) saturate(100%) opacity(0.82);
}

.eyebrow,
.access-pill {
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 12px;
  letter-spacing: 0.16em;
}

.login-brand h1 {
  max-width: 520px;
  margin: 0 auto 18px;
  font-family: "Sora", "Plus Jakarta Sans", Arial, sans-serif;
  color: var(--black);
  font-size: clamp(3.8rem, 5.8vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.login-brand p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.75;
}

.login-box,
.stats-row article,
.table-shell,
.party-modal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.login-box {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: clamp(28px, 4vw, 42px);
  transform-origin: center right;
}

.login-box::before {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  content: "";
  background: linear-gradient(90deg, var(--accent-dark), var(--accent), #ffad45);
}

.login-box h2,
.modal-card h2 {
  margin: 10px 0 0;
  color: var(--black);
  font-family: "Sora", "Plus Jakarta Sans", Arial, sans-serif;
  font-size: 1.72rem;
  letter-spacing: 0;
}

.access-pill {
  display: inline-flex;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
}

.form-grid {
  display: grid;
  gap: 16px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 13px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(236, 101, 48, 0.14);
}

.primary-button,
.secondary-button,
.nav-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
}

.primary-button {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: var(--action-primary);
  box-shadow: 0 14px 30px rgba(236, 101, 48, 0.2);
}

.primary-button:hover {
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--action-neutral);
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 800;
}

.app-view {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--navy);
  font-weight: 900;
}

.brand-block strong {
  display: block;
  color: var(--black);
}

.brand-block span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.nav-button {
  justify-content: flex-start;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
}

.nav-button.active,
.nav-button:hover {
  border-color: var(--line);
  color: var(--navy);
  background: var(--paper);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-button.muted {
  margin-top: auto;
}

.file-button input {
  display: none;
}

.workspace {
  min-width: 0;
  padding: 24px;
  background: var(--paper);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.topbar h1 {
  margin: 0;
  color: var(--black);
  font-family: "Sora", "Plus Jakarta Sans", Arial, sans-serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.06;
  letter-spacing: 0;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stats-row article {
  position: relative;
  overflow: hidden;
  padding: 16px;
  background: var(--panel-solid);
}

.stats-row article::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  content: "";
  background: var(--accent);
}

.stats-row span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-row strong {
  display: block;
  margin-top: 7px;
  color: var(--black);
  font-size: 1.7rem;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 12px;
  margin-bottom: 14px;
}

.search-box {
  position: relative;
}

.search-box .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  color: var(--accent-dark);
  transform: translateY(-50%);
}

.search-box input {
  padding-left: 42px;
}

.table-shell {
  position: relative;
  overflow: auto;
  background: var(--panel-solid);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.pager span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.pager button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td strong,
td span {
  display: block;
}

td span {
  color: var(--muted);
  font-size: 0.78rem;
}

.type-pill {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 900;
}

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

.icon-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--navy);
  background: #ffffff;
}

.icon-button.danger {
  border-color: transparent;
  color: #fff;
  background: var(--action-danger);
}

.empty-state {
  padding: 36px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.party-modal {
  width: min(840px, calc(100vw - 28px));
  border: 0;
  padding: 0;
}

.party-modal::backdrop {
  background: rgba(11, 23, 28, 0.54);
}

.modal-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  background: #fff;
}

.modal-card header,
.modal-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@keyframes pageReveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes brandFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes loginGridFlow {
  0%,
  100% {
    background-position: 0 0, 0 0, center, center;
    transform: translate3d(0, 0, 0);
  }

  50% {
    background-position: 28px 18px, -18px 28px, center, center;
    transform: translate3d(0, -8px, 0);
  }
}

@keyframes loginLightSweep {
  0%,
  18% {
    transform: translateX(-24%) rotate(17deg);
  }

  62%,
  100% {
    transform: translateX(280%) rotate(17deg);
  }
}

@keyframes loginCardFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(0, -14px, 0);
  }
}

@keyframes loginDataPulse {
  0%,
  100% {
    opacity: 0.42;
    transform: scaleX(0.82);
    transform-origin: left center;
  }

  50% {
    opacity: 0.9;
    transform: scaleX(1);
  }
}

@keyframes loginRouteGlow {
  0%,
  100% {
    opacity: 0.42;
    filter: saturate(0.8);
  }

  50% {
    opacity: 0.95;
    filter: saturate(1.25);
  }
}

@keyframes loginSparkTravel {
  0%,
  100% {
    opacity: 0;
    transform: translate3d(-18px, 16px, 0) scale(0.72);
  }

  18%,
  72% {
    opacity: 0.78;
  }

  50% {
    transform: translate3d(38px, -26px, 0) scale(1);
  }
}

@media (max-width: 980px) {
  .login-view,
  .app-view {
    grid-template-columns: 1fr;
  }

  .login-view {
    width: min(720px, calc(100% - 32px));
    gap: 28px;
  }

  .login-bg-animation {
    inset: 12px -18px;
  }

  .login-bg-card-party {
    left: -54px;
    bottom: 5%;
    width: 260px;
  }

  .login-bg-card-file,
  .login-bg-route,
  .login-bg-spark {
    display: none;
  }

  .login-brand h1 {
    font-size: clamp(3rem, 12vw, 4.4rem);
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    height: auto;
    display: grid;
    grid-template-columns: 1fr repeat(3, auto);
    align-items: center;
  }

  .nav-button.active {
    display: none;
  }

  .stats-row,
  .toolbar,
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .pager {
    justify-content: stretch;
  }

  .pager button {
    flex: 1;
  }
}

@media (max-width: 560px) {
  .login-view {
    width: min(100% - 24px, 520px);
    padding: 26px 0;
  }

  .brand-logo {
    margin-bottom: 20px;
  }

  .login-box,
  .workspace,
  .modal-card,
  .sidebar {
    padding: 16px;
  }

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

  .sidebar {
    grid-template-columns: 1fr 42px 42px 42px;
    gap: 8px;
  }

  .nav-button {
    min-width: 42px;
    overflow: hidden;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-logo,
  .login-bg-animation::before,
  .login-bg-animation::after,
  .login-bg-card,
  .login-bg-card i,
  .login-bg-route,
  .login-bg-spark {
    animation: none !important;
  }
}

/* v6: advanced CRM workspace layer. */
.side-nav {
  display: grid;
  gap: 8px;
}

.section-switcher {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf6;
}

.section-switcher span {
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-button {
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--muted);
  background: #ffffff;
  font-weight: 900;
  text-align: left;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.section-button.active,
.section-button:hover {
  border-color: rgba(236, 101, 48, 0.42);
  color: var(--accent-dark);
  transform: translateY(-1px);
}

.nav-button .icon,
.primary-button .icon,
.secondary-button .icon {
  flex: 0 0 18px;
}

.head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.view {
  display: none;
  animation: panelIn 260ms ease both;
}

.view.active {
  display: block;
}

.metric-card {
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.metric-card:hover,
.panel:hover,
.manual-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.metric-card small,
.priority-text {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.metric-card.metric-customer::before {
  background: #0f766e;
}

.metric-card.metric-indian::before {
  background: var(--accent);
}

.metric-card.metric-international::before {
  background: #2563eb;
}

.metric-card.metric-focus::before {
  background: #b7791f;
}

.metric-card.metric-updated::before {
  background: #475467;
}

.metric-card.metric-overdue::before {
  background: var(--danger);
}

.metric-card.metric-today::before {
  background: #2563eb;
}

.metric-card.metric-priority::before {
  background: #9a5b08;
}

.metric-card.metric-unassigned::before {
  background: #7c3aed;
}

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

.section-card {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 132px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  text-align: left;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.section-card::after {
  position: absolute;
  right: -34px;
  bottom: -44px;
  width: 128px;
  height: 128px;
  border-radius: 999px;
  content: "";
  background: rgba(236, 101, 48, 0.1);
}

.section-card.international::after {
  background: rgba(37, 99, 235, 0.1);
}

.section-card:hover,
.section-card.active {
  border-color: rgba(236, 101, 48, 0.42);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.section-card span,
.section-card strong,
.section-card small,
.section-card em {
  position: relative;
  z-index: 1;
}

.section-card span {
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-card strong {
  color: var(--ink);
  font-size: 2rem;
}

.section-card small,
.section-card em {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.section-card em {
  font-style: normal;
  overflow-wrap: anywhere;
}

.dashboard-grid,
.smart-grid,
.manual-grid {
  display: grid;
  gap: 16px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
}

.dashboard-grid .panel:first-child {
  grid-row: span 2;
}

.smart-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
}

.manual-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.filter-panel,
.manual-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.panel,
.manual-card {
  padding: 18px;
}

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

.panel-head h2,
.manual-card h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Sora", "Plus Jakarta Sans", Arial, sans-serif;
  font-size: 1.15rem;
  line-height: 1.2;
}

.panel-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.insight-list {
  display: grid;
  gap: 10px;
}

.insight-card {
  position: relative;
  overflow: hidden;
  padding: 13px 14px 13px 16px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
}

.insight-card::after {
  position: absolute;
  right: -18px;
  top: -30px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  content: "";
  background: rgba(236, 101, 48, 0.09);
}

.insight-card strong,
.insight-card span {
  position: relative;
  z-index: 1;
  display: block;
}

.insight-card strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.insight-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.insight-card.good {
  border-left-color: var(--green);
}

.insight-card.warn,
.insight-card.focus {
  border-left-color: var(--amber);
}

.insight-card.risk {
  border-left-color: var(--danger);
}

.insight-card.market {
  border-left-color: #2563eb;
}

.followup-mini-list,
.owner-load,
.segment-list,
.followup-list {
  display: grid;
  gap: 10px;
}

.mini-followup,
.owner-row,
.segment-button,
.pipeline-stat {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 11px 12px;
  text-align: left;
  background: #ffffff;
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mini-followup:hover,
.owner-row:hover,
.segment-button:hover,
.pipeline-stat:hover {
  border-color: rgba(236, 101, 48, 0.38);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.mini-followup strong,
.mini-followup span,
.owner-row strong,
.owner-row em,
.segment-button strong,
.segment-button span {
  display: block;
}

.mini-followup span,
.owner-row em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.owner-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
}

.owner-row b {
  color: var(--accent-dark);
  text-align: right;
}

.owner-row i {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f6;
}

.owner-row i em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ffad45);
}

.pipeline-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.pipeline-stat {
  display: grid;
  gap: 5px;
}

.pipeline-stat span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pipeline-stat strong {
  color: var(--ink);
  font-size: 1.45rem;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(250px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pipeline-column {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.pipeline-column header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  background: #fffaf6;
}

.pipeline-column header strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.pipeline-column header span {
  border-radius: 999px;
  padding: 4px 8px;
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 900;
}

.pipeline-column-body {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 460px;
  padding: 10px;
}

.pipeline-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 11px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.045);
  cursor: grab;
}

.pipeline-card:active {
  cursor: grabbing;
}

.pipeline-card.overdue {
  border-left-color: var(--danger);
}

.pipeline-card.today {
  border-left-color: #2563eb;
}

.pipeline-card.upcoming {
  border-left-color: var(--green);
}

.pipeline-card strong,
.pipeline-card span {
  display: block;
}

.pipeline-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.pipeline-card div,
.pipeline-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pipeline-card em,
.pipeline-card footer button {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 5px 8px;
  background: #fffaf6;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.pipeline-card footer button {
  cursor: pointer;
}

.pipeline-more,
.empty-inline {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.followup-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.followup-tab.active {
  border-color: rgba(236, 101, 48, 0.42);
  color: var(--accent-dark);
  background: #fffaf6;
}

.followup-desk {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.65fr);
  gap: 16px;
}

.followup-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.followup-card.overdue {
  border-left-color: var(--danger);
}

.followup-card.today {
  border-left-color: #2563eb;
}

.followup-card.upcoming {
  border-left-color: var(--green);
}

.followup-card strong,
.followup-card span {
  display: block;
}

.followup-card > div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.followup-meta,
.followup-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.followup-meta span {
  width: max-content;
  border-radius: 999px;
  padding: 6px 9px;
  background: #fffaf6;
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 900;
}

.followup-card footer {
  justify-content: flex-end;
}

.segment-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.segment-button span {
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 900;
}

.health-bars {
  display: grid;
  gap: 14px;
}

.health-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
}

.health-row strong,
.health-row span {
  display: block;
}

.health-row strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.health-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.health-row b {
  color: var(--accent-dark);
  font-size: 0.86rem;
  text-align: right;
}

.health-row i {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f6;
}

.health-row em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ffad45);
}

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.city-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.city-chip span {
  color: var(--accent-dark);
  font-size: 0.78rem;
}

.filter-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px;
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) repeat(5, minmax(136px, 1fr));
  gap: 10px;
  align-items: end;
}

.filter-row.compact {
  grid-template-columns: repeat(5, minmax(136px, 1fr)) auto auto;
}

.search-box {
  min-width: 0;
}

.search-box input {
  min-height: 46px;
}

tbody tr {
  transition: background 160ms ease, transform 160ms ease;
}

tbody tr:hover {
  background: #fffaf6;
}

.stage-pill {
  display: inline-flex;
  width: max-content;
  max-width: 150px;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.market-pill {
  display: inline-flex;
  width: max-content;
  max-width: 150px;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff3e9;
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.market-pill.international {
  background: #eef4ff;
  color: #1d4ed8;
}

.stage-pill.active {
  background: #e6f4f1;
  color: #0f766e;
}

.stage-pill.verify-kyc,
.stage-pill.follow-up {
  background: #fff7e6;
  color: #9a5b08;
}

.stage-pill.needs-data,
.stage-pill.do-not-contact {
  background: #fff1f0;
  color: var(--danger);
}

.stage-pill.dormant {
  background: #eef2f6;
  color: #475467;
}

.smart-console textarea {
  width: 100%;
  min-height: 140px;
  margin-bottom: 12px;
}

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

.smart-answer {
  min-height: 86px;
  margin-top: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px;
  background: #fffaf6;
}

.smart-answer strong,
.smart-answer p {
  margin: 0;
}

.smart-answer p {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
}

.smart-filter-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.smart-filter-preview span {
  border-radius: 999px;
  padding: 6px 9px;
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 900;
}

.manual-card {
  position: relative;
  min-height: 180px;
  overflow: hidden;
}

.manual-card::after {
  position: absolute;
  right: -34px;
  bottom: -42px;
  width: 132px;
  height: 132px;
  border-radius: 999px;
  content: "";
  background: rgba(236, 101, 48, 0.08);
}

.manual-card span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: var(--navy);
  color: #ffffff;
  font-weight: 900;
}

.manual-card p {
  position: relative;
  z-index: 1;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.65;
}

.detail-modal {
  width: min(920px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.detail-modal::backdrop {
  background: rgba(11, 23, 28, 0.54);
}

.detail-card {
  max-height: min(82vh, 820px);
  overflow: auto;
}

.detail-content {
  display: grid;
  gap: 14px;
}

.detail-summary,
.detail-grid {
  display: grid;
  gap: 10px;
}

.detail-summary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-summary div,
.detail-grid div,
.detail-notes {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.detail-summary span,
.detail-grid span,
.detail-notes span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-summary strong,
.detail-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.detail-notes {
  display: grid;
  gap: 8px;
}

.detail-notes p {
  margin: 0 0 6px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .dashboard-grid,
  .smart-grid,
  .followup-desk,
  .manual-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-grid .panel:first-child {
    grid-row: auto;
  }

  .filter-row,
  .filter-row.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .sidebar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .side-nav,
  .section-switcher {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  }

  .section-switcher span {
    grid-column: 1 / -1;
  }

  .nav-button.active {
    display: inline-flex;
  }
}

@media (max-width: 760px) {
  .dashboard-grid,
  .smart-grid,
  .followup-desk,
  .manual-grid,
  .section-overview,
  .detail-summary,
  .detail-grid,
  .filter-row,
  .filter-row.compact {
    grid-template-columns: 1fr;
  }

  .head-actions,
  .smart-actions {
    justify-content: stretch;
  }

  .head-actions button,
  .smart-actions button {
    flex: 1;
  }
}
