:root {
  color-scheme: dark;
  --bg: #070912;
  --bg-deep: #05060b;
  --sidebar: #090c16;
  --surface: #101421;
  --surface-2: #151a2a;
  --surface-3: #1b2032;
  --surface-hover: #1c2234;
  --line: rgba(157, 170, 205, 0.14);
  --line-strong: rgba(157, 170, 205, 0.24);
  --text: #f5f7ff;
  --muted: #929bb4;
  --muted-2: #6b748b;
  --violet: #8778ff;
  --violet-2: #6757ee;
  --cyan: #5fd7e6;
  --green: #69d7a3;
  --amber: #f1bb6c;
  --red: #ff7b92;
  --blue: #79a9ff;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-w: 238px;
  --topbar-h: 68px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-variant-numeric: tabular-nums lining-nums;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-width: 1120px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(920px 540px at 50% -10%, rgba(114, 91, 246, 0.31), transparent 64%),
    radial-gradient(780px 610px at 94% 25%, rgba(48, 190, 205, 0.18), transparent 65%),
    radial-gradient(720px 570px at 24% 104%, rgba(117, 75, 217, 0.18), transparent 68%),
    radial-gradient(470px 390px at 75% 78%, rgba(187, 79, 179, 0.085), transparent 69%),
    linear-gradient(145deg, rgba(91, 66, 188, .055), transparent 42%, rgba(34, 129, 155, .04)),
    var(--bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  font-variant-numeric: tabular-nums lining-nums;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-w);
  border-right: 1px solid var(--line);
  background:
    radial-gradient(380px 250px at 18% -3%, rgba(126, 104, 255, .13), transparent 72%),
    linear-gradient(180deg, rgba(12, 15, 27, 0.99), rgba(7, 9, 17, 0.995));
  box-shadow: 18px 0 48px rgba(0, 0, 0, 0.15);
}

.brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: linear-gradient(145deg, #9a8bff, #5442d7 70%);
  box-shadow: 0 8px 22px rgba(108, 88, 242, 0.33), inset 0 1px rgba(255,255,255,.35);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background: white;
  border-radius: 2px;
}

.brand-mark::before {
  width: 18px;
  height: 3px;
  left: 8px;
  top: 11px;
  transform: rotate(45deg);
}

.brand-mark::after {
  width: 12px;
  height: 3px;
  right: 7px;
  bottom: 10px;
  transform: rotate(-45deg);
}

.brand-name {
  font-size: 14px;
  font-weight: 760;
  letter-spacing: -0.01em;
}

.brand-sub {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.sidebar-scroll {
  height: calc(100vh - var(--topbar-h) - 64px);
  padding: 14px 10px 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #242a3d transparent;
}

.nav-section + .nav-section {
  margin-top: 14px;
}

.nav-label {
  padding: 0 10px 7px;
  color: #586177;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #9aa3ba;
  font-size: 12px;
  font-weight: 600;
  transition: 160ms ease;
}

.nav-link:hover {
  color: #e8ebf6;
  background: rgba(255,255,255,.035);
}

.nav-link.active {
  color: #fff;
  border-color: rgba(137, 120, 255, .21);
  background: linear-gradient(90deg, rgba(128, 107, 255, .19), rgba(128, 107, 255, .055));
  box-shadow: inset 2px 0 #8b7aff;
}

.nav-icon {
  width: 18px;
  color: #69738e;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

.nav-link.active .nav-icon {
  color: #a89cff;
}

.nav-count {
  margin-left: auto;
  min-width: 19px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid rgba(139, 122, 255, .25);
  border-radius: 8px;
  color: #b9b0ff;
  background: rgba(130, 111, 255, .11);
  font-size: 9px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.sidebar-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 17px;
  border-top: 1px solid var(--line);
  background: #090c15;
  color: var(--muted);
  font-size: 11px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(105, 215, 163, .09), 0 0 14px rgba(105, 215, 163, .4);
}

.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 35;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 0 28px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(69, 52, 150, .085), rgba(8, 10, 18, .94) 38%, rgba(22, 96, 112, .055)),
    rgba(8, 10, 18, .94);
  backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-actions,
.action-group {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 12px;
}

.crumb {
  color: #667087;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.crumb-sep {
  color: #353c50;
}

.crumb-current {
  color: #d9deed;
}

.topbar-actions {
  gap: 9px;
}

.action-group {
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0e111c;
}

.rate-display {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(19, 24, 38, .78);
}

.rate-label {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rate-value {
  color: #e9ecf7;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
}

.rate-change {
  color: var(--green);
  font-size: 9px;
  font-weight: 800;
}

.btn {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: #dce1f0;
  background: #151a29;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .01em;
  box-shadow: inset 0 1px rgba(255,255,255,.035);
  transition: 150ms ease;
}

.btn:hover {
  border-color: rgba(174, 184, 214, .38);
  background: #1a2031;
  transform: translateY(-1px);
}

.btn-primary {
  border-color: rgba(168, 153, 255, .5);
  color: #fff;
  background: linear-gradient(125deg, #9a89ff 0%, #7059ef 48%, #4e63d9 100%);
  box-shadow: 0 9px 24px rgba(87, 66, 207, .27), inset 0 1px rgba(255,255,255,.25);
}

.btn-primary:hover {
  background: linear-gradient(125deg, #aa9cff 0%, #7e68f5 48%, #5d71e2 100%);
}

.btn-theme {
  min-width: 76px;
  border-color: rgba(138, 122, 255, .23);
  color: #c9c3ff;
  background: linear-gradient(135deg, rgba(120, 99, 240, .15), rgba(65, 169, 183, .08));
}

.btn-theme span:first-child {
  color: #8de0e9;
  font-size: 13px;
}

.btn-compact {
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: 3px;
  padding-left: 9px;
  border-left: 1px solid var(--line);
}

.avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #59627c, #272d3e);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
  box-shadow: 0 4px 12px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.15);
}

.avatar.violet { background: linear-gradient(145deg, #8a76ef, #4936a6); }
.avatar.blue { background: linear-gradient(145deg, #5e9ee5, #285985); }
.avatar.green { background: linear-gradient(145deg, #56bd99, #23684f); }
.avatar.gold { background: linear-gradient(145deg, #d6a55b, #7f5328); }
.avatar.rose { background: linear-gradient(145deg, #d77798, #7e3852); }
.avatar.teal { background: linear-gradient(145deg, #4fb6bd, #24636a); }

.user-meta {
  line-height: 1.15;
}

.user-name {
  color: #e9ecf6;
  font-size: 11px;
  font-weight: 750;
}

.user-role {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
}

.page {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: calc(var(--topbar-h) + 22px) 24px 26px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 45px;
  margin-bottom: 18px;
}

.eyebrow {
  margin-bottom: 6px;
  color: #7469d5;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}

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

h1 {
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -.035em;
  color: #f7f8ff;
  background: linear-gradient(105deg, #ffffff 10%, #dcd7ff 58%, #a9e5ec 115%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

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

.card {
  border: 1px solid transparent;
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(21, 26, 42, .97), rgba(13, 17, 28, .98)) padding-box,
    linear-gradient(135deg, rgba(151, 132, 255, .26), rgba(91, 211, 224, .08) 46%, rgba(255,255,255,.045) 72%, rgba(163, 99, 225, .13)) border-box;
  box-shadow: 0 12px 38px rgba(0, 0, 0, .16), inset 0 1px rgba(255,255,255,.025);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 51px;
  padding: 0 17px;
  border-bottom: 1px solid var(--line);
}

.card-title {
  font-size: 12px;
  font-weight: 780;
  letter-spacing: -.01em;
}

.card-subtitle {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
}

.text-link {
  border: 0;
  color: #a79cff;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

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

.kpi-card {
  position: relative;
  min-height: 116px;
  padding: 16px;
  overflow: hidden;
  background:
    linear-gradient(148deg, rgba(25, 29, 48, .985), rgba(14, 18, 30, .99)) padding-box,
    linear-gradient(125deg, color-mix(in srgb, var(--tone, #9c91ff) 34%, transparent), rgba(255,255,255,.045) 56%, rgba(93, 205, 218, .09)) border-box;
}

.kpi-card::after {
  content: "";
  position: absolute;
  top: -45px;
  right: -32px;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: var(--glow, rgba(128, 109, 255, .14));
  filter: blur(12px);
}

.kpi-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 670;
}

.kpi-icon {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  color: var(--tone, #9c91ff);
  background: rgba(255,255,255,.035);
  font-size: 11px;
}

.kpi-value {
  margin-top: 14px;
  color: #f8f9ff;
  font-size: 25px;
  font-weight: 780;
  letter-spacing: -.04em;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 9px;
}

.trend-up { color: var(--green); }
.trend-down { color: var(--red); }

.company-strip {
  display: grid;
  grid-template-columns: 1.55fr repeat(4, 1fr);
  min-height: 66px;
  margin-top: 10px;
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(38, 30, 78, .72), rgba(18, 23, 37, .98) 39%, rgba(14, 35, 42, .86)) padding-box,
    linear-gradient(110deg, rgba(149, 126, 255, .35), rgba(94, 214, 226, .11), rgba(255,255,255,.04)) border-box;
}

.company-intro,
.company-stat {
  display: flex;
  align-items: center;
  padding: 0 17px;
}

.company-stat {
  border-left: 1px solid var(--line);
}

.company-kicker {
  color: #9e92ff;
  font-size: 9px;
  font-weight: 820;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.company-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.company-stat-value {
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -.025em;
}

.company-stat-label {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 9px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr);
  gap: 10px;
  margin-top: 10px;
}

.pipeline-card {
  min-height: 288px;
}

.pipeline-body {
  display: grid;
  grid-template-columns: 214px 1fr;
  align-items: center;
  min-height: 235px;
  padding: 12px 17px 16px;
}

.donut-wrap {
  position: relative;
  width: 166px;
  height: 166px;
  margin: auto;
}

.donut {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 29% 20%, rgba(255,255,255,.3), transparent 36%),
    conic-gradient(
      #b6abff 0%, #7867ed 20.8%,
      #79e7ef 21%, #43bece 37.8%,
      #8ae8bd 38%, #4fc48f 57.8%,
      #ffd28a 58%, #e6a448 72.8%,
      #8cb2ff 73%, #536fd1 87.8%,
      #6d768d 88%, #343b50 100%
    );
  box-shadow: 0 0 38px rgba(117, 98, 242, .2), inset 0 0 18px rgba(255,255,255,.1);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #111522;
  box-shadow: inset 0 0 30px rgba(0,0,0,.34);
}

.donut-center {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.donut-value {
  font-size: 21px;
  font-weight: 790;
  letter-spacing: -.04em;
}

.donut-label {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 650;
}

.chart-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px 20px;
}

.legend-item {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 3px;
  background: var(--dot);
  box-shadow: 0 0 10px color-mix(in srgb, var(--dot) 40%, transparent);
}

.legend-name {
  color: #b9c0d2;
  font-size: 10px;
}

.legend-value {
  color: #eef0f8;
  font-size: 10px;
  font-weight: 760;
}

.automation-card {
  position: relative;
  min-height: 288px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(33, 29, 65, .95), rgba(15, 19, 31, .98) 62%);
}

.automation-card::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  top: -115px;
  right: -70px;
  border-radius: 50%;
  background: rgba(112, 88, 241, .22);
  filter: blur(18px);
}

.automation-body {
  position: relative;
  padding: 18px;
}

.automation-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid rgba(140, 124, 255, .25);
  border-radius: 8px;
  color: #c4bcff;
  background: rgba(114, 93, 232, .1);
  font-size: 9px;
  font-weight: 770;
}

.automation-headline {
  margin-top: 14px;
  font-size: 21px;
  font-weight: 760;
  letter-spacing: -.035em;
}

.automation-copy {
  margin-top: 6px;
  max-width: 330px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.automation-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 17px;
}

.automation-metric {
  min-height: 71px;
  padding: 11px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  background: rgba(7, 9, 16, .36);
}

.automation-value {
  font-size: 18px;
  font-weight: 780;
}

.automation-label {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 690;
  line-height: 1.3;
  text-transform: uppercase;
}

.followups-card {
  grid-column: 1 / -1;
  overflow: hidden;
}

.followup-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.25fr) minmax(240px, 1.8fr) 110px 120px 35px;
  align-items: center;
  min-height: 54px;
  padding: 0 16px;
  border-top: 1px solid rgba(151, 165, 201, .09);
}

.followup-row:first-child {
  border-top: 0;
}

.followup-person {
  display: flex;
  align-items: center;
  gap: 9px;
}

.followup-person .avatar {
  width: 28px;
  height: 28px;
  font-size: 8px;
}

.person-name {
  font-size: 10px;
  font-weight: 730;
}

.person-detail,
.followup-note {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
}

.followup-note {
  margin-top: 0;
  color: #aab2c7;
}

.time-badge,
.status-chip,
.type-badge,
.tag {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border: 1px solid var(--chip-line, rgba(255,255,255,.09));
  color: var(--chip-color, #b7bfd2);
  background: var(--chip-bg, rgba(255,255,255,.045));
  font-weight: 700;
}

.time-badge {
  height: 22px;
  padding: 0 7px;
  border-radius: 7px;
  font-size: 8px;
}

.status-chip,
.type-badge {
  height: 23px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 8px;
}

.chip-violet { --chip-color: #b9afff; --chip-bg: rgba(127, 105, 255, .11); --chip-line: rgba(139, 121, 255, .22); }
.chip-green { --chip-color: #91e5ba; --chip-bg: rgba(70, 177, 124, .1); --chip-line: rgba(85, 198, 143, .2); }
.chip-amber { --chip-color: #f5c987; --chip-bg: rgba(210, 145, 52, .1); --chip-line: rgba(232, 164, 63, .2); }
.chip-red { --chip-color: #ff9eb0; --chip-bg: rgba(214, 79, 106, .1); --chip-line: rgba(238, 93, 121, .2); }
.chip-blue { --chip-color: #9fc0ff; --chip-bg: rgba(79, 125, 213, .12); --chip-line: rgba(102, 150, 235, .2); }
.chip-gray { --chip-color: #9ea6b9; --chip-bg: rgba(139, 149, 174, .07); --chip-line: rgba(139, 149, 174, .13); }

.icon-button {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: #121624;
  cursor: pointer;
}

.icon-button:hover {
  color: #fff;
  border-color: var(--line-strong);
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 90;
  width: 196px;
  padding: 7px;
  border: 1px solid #2b3248;
  border-radius: 12px;
  background: #141827;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: 140ms ease;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  color: #c8cede;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
  text-align: left;
}

.dropdown-item:hover {
  color: #fff;
  background: #1d2335;
}

.dropdown-key {
  width: 23px;
  color: #8c80eb;
  font-size: 11px;
  text-align: center;
}

/* Pipeline */
.pipeline-page {
  height: 100vh;
  padding-bottom: 15px;
  overflow: hidden;
}

.pipeline-page .page-heading {
  margin-bottom: 13px;
}

.segmented {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d101b;
}

.segment {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  color: var(--muted-2);
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  font-weight: 730;
}

.segment.active {
  color: #e8ebf5;
  background: #202638;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

.kanban {
  height: calc(100vh - 151px);
  display: flex;
  gap: 9px;
  padding-bottom: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: #333b53 #0d101a;
  scrollbar-width: thin;
}

.kanban-column {
  width: 272px;
  min-width: 272px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(148, 161, 195, .11);
  border-radius: 16px;
  background: rgba(11, 14, 23, .68);
  overflow: hidden;
}

.column-header {
  flex: 0 0 auto;
  padding: 13px 13px 11px;
  border-bottom: 1px solid rgba(148, 161, 195, .09);
  background: rgba(17, 21, 34, .88);
}

.column-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.column-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #d7dbea;
  font-size: 10px;
  font-weight: 780;
  white-space: nowrap;
}

.stage-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--stage);
  box-shadow: 0 0 9px color-mix(in srgb, var(--stage) 45%, transparent);
}

.column-count {
  min-width: 20px;
  height: 19px;
  padding: 0 5px;
  border-radius: 7px;
  color: #7d8599;
  background: rgba(255,255,255,.045);
  font-size: 8px;
  font-weight: 800;
  line-height: 19px;
  text-align: center;
}

.column-total {
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 9px;
}

.column-cards {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #293047 transparent;
}

.loan-card {
  position: relative;
  padding: 13px;
  border: 1px solid rgba(148, 161, 195, .14);
  border-radius: 13px;
  background:
    linear-gradient(145deg, #191e30, #121621) padding-box,
    linear-gradient(135deg, rgba(139, 122, 255, .18), rgba(95, 215, 230, .045), rgba(255,255,255,.04)) border-box;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .15), inset 0 1px rgba(255,255,255,.025);
  cursor: pointer;
  transition: 150ms ease;
}

.loan-card + .loan-card {
  margin-top: 7px;
}

.loan-card:hover {
  border-color: rgba(139, 122, 255, .42);
  background:
    linear-gradient(145deg, #1e2338, #151927) padding-box,
    linear-gradient(135deg, rgba(151, 135, 255, .6), rgba(99, 216, 228, .18)) border-box;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0,0,0,.25), 0 0 0 1px rgba(132, 112, 255, .08);
}

.loan-top {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.loan-top .avatar {
  width: 30px;
  height: 30px;
  font-size: 8px;
}

.loan-name {
  margin-top: 1px;
  color: #edf0f8;
  font-size: 11px;
  font-weight: 760;
}

.loan-id {
  margin-top: 3px;
  color: #606a82;
  font-size: 8px;
}

.loan-more {
  margin-left: auto;
  color: #626b82;
  font-size: 15px;
  line-height: .8;
}

.loan-amount {
  margin-top: 14px;
  font-size: 18px;
  font-weight: 780;
  letter-spacing: -.025em;
}

.loan-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 11px;
}

.program-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 7px;
  color: #9da6bb;
  background: rgba(255,255,255,.03);
  font-size: 8px;
  font-weight: 720;
}

.avatar-stack {
  display: flex;
  align-items: center;
  padding-left: 5px;
}

.avatar-stack .avatar {
  width: 22px;
  height: 22px;
  margin-left: -5px;
  border: 2px solid #151a28;
  font-size: 6px;
  box-shadow: none;
}

.days-label {
  position: absolute;
  top: 13px;
  right: 28px;
  color: #6d768d;
  font-size: 8px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 4, 8, .78);
  opacity: 0;
  visibility: hidden;
  transition: 160ms ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.loan-modal {
  width: 1040px;
  height: 720px;
  max-width: 95vw;
  max-height: 91vh;
  display: flex;
  flex-direction: column;
  border: 1px solid #303750;
  border-radius: 20px;
  background: #111522;
  box-shadow: 0 32px 100px rgba(0,0,0,.68), inset 0 1px rgba(255,255,255,.04);
  overflow: hidden;
  transform: translateY(12px) scale(.99);
  transition: 180ms ease;
}

.modal-backdrop.open .loan-modal {
  transform: translateY(0) scale(1);
}

.modal-top {
  flex: 0 0 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid #272d41;
  background: #141927;
}

.modal-person {
  display: flex;
  align-items: center;
  gap: 11px;
}

.modal-person .avatar {
  width: 40px;
  height: 40px;
  font-size: 11px;
}

.modal-name {
  font-size: 14px;
  font-weight: 790;
}

.modal-file-meta {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 9px;
}

.modal-top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.modal-close {
  width: 34px;
  height: 34px;
  border: 1px solid #30364a;
  border-radius: 10px;
  color: #aeb5c8;
  background: #1a1f2e;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.loan-stepper {
  flex: 0 0 83px;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  padding: 16px 19px 12px;
  border-bottom: 1px solid #262c40;
  background: #0e121d;
}

.loan-step {
  position: relative;
  min-width: 0;
  text-align: center;
}

.loan-step::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 10px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: #2b3144;
}

.loan-step:first-child::before { display: none; }
.loan-step.complete::before,
.loan-step.current::before { background: #7565e8; }

.step-number {
  position: relative;
  z-index: 1;
  width: 21px;
  height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #333a50;
  border-radius: 50%;
  color: #687188;
  background: #111522;
  font-size: 7px;
  font-weight: 850;
}

.loan-step.complete .step-number {
  border-color: #7464e8;
  color: #fff;
  background: #7464e8;
}

.loan-step.current .step-number {
  border-color: #9b8fff;
  color: #e7e3ff;
  background: #262044;
  box-shadow: 0 0 0 4px rgba(130, 110, 255, .12);
}

.step-label {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: #656e85;
  font-size: 7px;
  font-weight: 760;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loan-step.complete .step-label,
.loan-step.current .step-label { color: #aeb5c8; }

.modal-tabs {
  flex: 0 0 48px;
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 0 18px;
  border-bottom: 1px solid #272d41;
  background: #151a28;
}

.modal-tab {
  position: relative;
  padding: 0 13px;
  border: 0;
  color: #737c92;
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  font-weight: 760;
}

.modal-tab.active { color: #f2f3f9; }
.modal-tab.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: #8d7eff;
}

.modal-content {
  flex: 1;
  min-height: 0;
  padding: 16px 18px 18px;
  background: #111522;
  overflow: hidden;
}

.condition-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.condition-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.condition-title {
  font-size: 14px;
  font-weight: 780;
}

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

.progress-area {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 0 12px;
}

.progress-track {
  height: 7px;
  border-radius: 99px;
  background: #242a3d;
  overflow: hidden;
}

.progress-fill {
  width: 62%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7564ea, #61cbd6);
  box-shadow: 0 0 14px rgba(100, 172, 221, .22);
}

.progress-copy {
  color: #b9c0d2;
  font-size: 9px;
  font-weight: 760;
}

.condition-list {
  min-height: 0;
  border: 1px solid #282e43;
  border-radius: 13px;
  background: #0d111b;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #30384f transparent;
}

.condition-row {
  display: grid;
  grid-template-columns: 30px 1fr 175px 94px;
  align-items: center;
  min-height: 53px;
  padding: 0 12px;
  border-top: 1px solid #202638;
}

.condition-row:first-child { border-top: 0; }

.condition-check {
  appearance: none;
  width: 17px;
  height: 17px;
  margin: 0;
  border: 1px solid #414960;
  border-radius: 5px;
  background: #161b29;
  cursor: pointer;
}

.condition-check:checked {
  border-color: #7867e9;
  background:
    linear-gradient(45deg, transparent 43%, #fff 44% 59%, transparent 60%) 3px 8px / 6px 5px no-repeat,
    linear-gradient(-45deg, transparent 43%, #fff 44% 58%, transparent 59%) 7px 5px / 7px 8px no-repeat,
    #7867e9;
}

.condition-name {
  color: #dce0ec;
  font-size: 10px;
  font-weight: 690;
}

.condition-detail {
  margin-top: 3px;
  color: #687188;
  font-size: 8px;
}

.condition-owner {
  color: #7f889e;
  font-size: 8px;
  text-align: right;
}

/* Contacts */
.search-control {
  position: relative;
  width: 300px;
}

.search-control input {
  width: 100%;
  height: 36px;
  padding: 0 13px 0 34px;
  border: 1px solid var(--line);
  outline: 0;
  border-radius: 10px;
  color: #eef1f9;
  background: #101421;
  font-size: 10px;
}

.search-control input:focus {
  border-color: rgba(139, 122, 255, .52);
  box-shadow: 0 0 0 3px rgba(123, 104, 241, .09);
}

.search-control::before {
  content: "⌕";
  position: absolute;
  z-index: 1;
  left: 12px;
  top: 8px;
  color: #737d94;
  font-size: 16px;
}

.contact-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-table-card {
  overflow: hidden;
}

.contact-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.contact-table th {
  height: 40px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  color: #666f86;
  background: rgba(8, 11, 18, .42);
  font-size: 8px;
  font-weight: 820;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
}

.contact-table td {
  height: 57px;
  padding: 0 13px;
  border-bottom: 1px solid rgba(151, 165, 201, .09);
  color: #aeb6c9;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-table tbody tr {
  transition: 120ms ease;
}

.contact-table tbody tr:hover {
  background: rgba(136, 120, 255, .045);
}

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

.contact-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-name-cell .avatar {
  width: 31px;
  height: 31px;
  font-size: 8px;
}

.contact-name {
  color: #e6e9f3;
  font-weight: 730;
}

.contact-sub {
  margin-top: 3px;
  color: #626b81;
  font-size: 8px;
}

.tags {
  display: flex;
  gap: 5px;
  overflow: hidden;
}

.tag {
  height: 21px;
  padding: 0 7px;
  border-radius: 7px;
  color: #9ea7ba;
  font-size: 8px;
}

.table-footer {
  height: 47px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  color: #697288;
  font-size: 9px;
}

.pagination {
  display: flex;
  gap: 5px;
}

.page-btn {
  width: 27px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #818aa0;
  background: #121624;
  cursor: pointer;
  font-size: 9px;
}

.page-btn.active {
  border-color: rgba(139, 122, 255, .4);
  color: #fff;
  background: #4f43a5;
}

.empty-search {
  display: none;
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

/* Messages */
.messages-page {
  height: 100vh;
  overflow: hidden;
}

.messages-layout {
  height: calc(100vh - 176px);
  display: grid;
  grid-template-columns: 328px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0d111b;
  box-shadow: 0 18px 45px rgba(0,0,0,.2);
  overflow: hidden;
}

.thread-panel {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #101421;
}

.thread-panel-head {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.thread-heading {
  font-size: 13px;
  font-weight: 780;
}

.thread-tabs {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.thread-tab {
  border: 0;
  color: #687188;
  background: transparent;
  cursor: pointer;
  font-size: 8px;
  font-weight: 780;
}

.thread-tab.active { color: #b9afff; }

.thread-list {
  height: calc(100% - 104px);
  overflow-y: auto;
}

.thread-item {
  width: 100%;
  min-height: 73px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 0;
  border-bottom: 1px solid rgba(151, 165, 201, .085);
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.thread-item:hover { background: rgba(255,255,255,.025); }
.thread-item.active {
  background: linear-gradient(90deg, rgba(123, 103, 242, .15), rgba(123,103,242,.035));
  box-shadow: inset 2px 0 #8271f5;
}

.thread-item .avatar {
  width: 36px;
  height: 36px;
  font-size: 9px;
}

.thread-name {
  color: #e0e4ef;
  font-size: 10px;
  font-weight: 750;
}

.thread-preview {
  max-width: 195px;
  margin-top: 5px;
  overflow: hidden;
  color: #737d93;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-time {
  align-self: start;
  margin-top: 4px;
  color: #5f687e;
  font-size: 7px;
}

.unread-dot {
  width: 7px;
  height: 7px;
  margin: 9px 0 0 auto;
  border-radius: 50%;
  background: #8a7aff;
  box-shadow: 0 0 9px rgba(138, 122, 255, .5);
}

.conversation {
  min-width: 0;
  display: grid;
  grid-template-rows: 66px 1fr 73px;
  background:
    radial-gradient(550px 350px at 90% 15%, rgba(88, 71, 187, .08), transparent 70%),
    #0b0f18;
}

.conversation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 17px;
  border-bottom: 1px solid var(--line);
  background: #121623;
}

.conversation-person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.conversation-person .avatar {
  width: 35px;
  height: 35px;
  font-size: 9px;
}

.online-label {
  margin-top: 4px;
  color: var(--green);
  font-size: 8px;
}

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

.message-stream {
  min-height: 0;
  padding: 18px 22px;
  overflow-y: auto;
}

.day-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 17px;
  color: #5f687e;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.day-divider::before,
.day-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(151, 165, 201, .09);
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 9px;
}

.message-row.outgoing { justify-content: flex-end; }

.message-row .avatar {
  width: 25px;
  height: 25px;
  font-size: 6px;
}

.bubble-wrap {
  max-width: 62%;
}

.message-bubble {
  padding: 10px 12px;
  border: 1px solid #293046;
  border-radius: 13px 13px 13px 4px;
  color: #ccd2df;
  background: #171c2a;
  font-size: 10px;
  line-height: 1.55;
}

.outgoing .message-bubble {
  border-color: rgba(139, 122, 255, .28);
  border-radius: 13px 13px 4px 13px;
  color: #f0efff;
  background: linear-gradient(135deg, #5848b5, #453b8c);
}

.message-time {
  margin-top: 4px;
  color: #596277;
  font-size: 7px;
}

.outgoing .message-time { text-align: right; }

.message-composer {
  display: grid;
  grid-template-columns: 31px 1fr 34px;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #111522;
}

.message-input {
  height: 41px;
  padding: 0 13px;
  border: 1px solid #2a3146;
  outline: 0;
  border-radius: 11px;
  color: #e5e8f1;
  background: #0d111c;
  font-size: 10px;
}

.message-input:focus { border-color: rgba(139, 122, 255, .5); }

.send-button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(166, 151, 255, .4);
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #8878ff, #5a49d7);
  cursor: pointer;
}

.chat-launcher {
  position: fixed;
  z-index: 110;
  right: 23px;
  bottom: 21px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(177, 164, 255, .53);
  border-radius: 15px;
  color: white;
  background: linear-gradient(145deg, #8c7cff, #5745d4);
  box-shadow: 0 14px 36px rgba(77, 57, 190, .43), inset 0 1px rgba(255,255,255,.28);
  cursor: pointer;
  font-size: 18px;
}

.chat-launcher::after {
  content: "2";
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  border: 2px solid #0a0d16;
  border-radius: 50%;
  color: #fff;
  background: #ff6e87;
  font-size: 8px;
  font-weight: 850;
  line-height: 18px;
}

.mini-chat {
  position: fixed;
  z-index: 109;
  right: 23px;
  bottom: 80px;
  width: 318px;
  height: 410px;
  display: grid;
  grid-template-rows: 57px 1fr 57px;
  border: 1px solid #353c54;
  border-radius: 17px;
  background: #131725;
  box-shadow: 0 26px 80px rgba(0,0,0,.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(.98);
  transition: 160ms ease;
  overflow: hidden;
}

.mini-chat.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border-bottom: 1px solid #2a3044;
  background: #181d2c;
}

.mini-title {
  font-size: 11px;
  font-weight: 770;
}

.mini-status {
  margin-top: 3px;
  color: var(--green);
  font-size: 7px;
}

.mini-body {
  padding: 13px;
  overflow-y: auto;
  background: #10141f;
}

.mini-bubble {
  max-width: 85%;
  margin-top: 7px;
  padding: 9px 10px;
  border: 1px solid #2a3042;
  border-radius: 11px 11px 11px 4px;
  color: #cbd1df;
  background: #1a1f2e;
  font-size: 9px;
  line-height: 1.45;
}

.mini-bubble.mine {
  margin-left: auto;
  border-color: #6556bf;
  border-radius: 11px 11px 4px 11px;
  color: #f0efff;
  background: #4c4098;
}

.mini-compose {
  display: grid;
  grid-template-columns: 1fr 30px;
  align-items: center;
  gap: 7px;
  padding: 9px;
  border-top: 1px solid #292f42;
  background: #171b29;
}

.mini-compose input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #30364a;
  outline: 0;
  border-radius: 9px;
  color: #e6e8f1;
  background: #0e121c;
  font-size: 9px;
}

.toast {
  position: fixed;
  z-index: 300;
  left: 50%;
  bottom: 24px;
  padding: 10px 14px;
  border: 1px solid #343b50;
  border-radius: 10px;
  color: #e5e8f2;
  background: #171c29;
  box-shadow: 0 15px 45px rgba(0,0,0,.5);
  font-size: 10px;
  font-weight: 680;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: 170ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1260px) {
  :root { --sidebar-w: 218px; }
  .user-meta { display: none; }
  .kpi-card { padding: 14px; }
  .kpi-value { font-size: 21px; }
  .pipeline-body { grid-template-columns: 190px 1fr; }
}

/* Luminous light theme */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f8;
  --bg-deep: #e7ebf4;
  --sidebar: #f8f9fd;
  --surface: #ffffff;
  --surface-2: #f5f7fc;
  --surface-3: #edf1f8;
  --surface-hover: #f1f3fb;
  --line: rgba(58, 70, 104, .13);
  --line-strong: rgba(58, 70, 104, .23);
  --text: #172033;
  --muted: #69748c;
  --muted-2: #8790a5;
  --shadow: 0 18px 50px rgba(60, 70, 105, .15);
  background: #e7ebf4;
}

html[data-theme="light"] body {
  color: var(--text);
  background:
    radial-gradient(880px 520px at 49% -8%, rgba(135, 115, 255, .27), transparent 64%),
    radial-gradient(760px 590px at 96% 28%, rgba(75, 203, 218, .23), transparent 66%),
    radial-gradient(700px 540px at 23% 104%, rgba(176, 116, 235, .16), transparent 68%),
    radial-gradient(430px 340px at 74% 75%, rgba(241, 154, 210, .11), transparent 70%),
    linear-gradient(140deg, rgba(255,255,255,.72), rgba(236,239,248,.82)),
    var(--bg);
}

html[data-theme="light"] .sidebar {
  border-color: rgba(72, 82, 117, .13);
  background:
    radial-gradient(410px 270px at 16% -2%, rgba(136, 117, 255, .18), transparent 72%),
    linear-gradient(180deg, rgba(252,252,255,.985), rgba(244,247,252,.99));
  box-shadow: 18px 0 48px rgba(72, 82, 115, .08);
}

html[data-theme="light"] .brand,
html[data-theme="light"] .sidebar-footer {
  border-color: rgba(72, 82, 117, .12);
}

html[data-theme="light"] .brand-name { color: #222a3d; }
html[data-theme="light"] .brand-sub,
html[data-theme="light"] .nav-label { color: #8892aa; }
html[data-theme="light"] .nav-link { color: #68738b; }
html[data-theme="light"] .nav-link:hover {
  color: #252d41;
  background: rgba(92, 77, 179, .055);
}

html[data-theme="light"] .nav-link.active {
  color: #33286d;
  border-color: rgba(111, 91, 222, .17);
  background: linear-gradient(90deg, rgba(124, 102, 240, .18), rgba(82, 190, 207, .045));
  box-shadow: inset 2px 0 #7564e8;
}

html[data-theme="light"] .nav-icon { color: #8c94a9; }
html[data-theme="light"] .nav-link.active .nav-icon { color: #6753d9; }
html[data-theme="light"] .nav-count {
  color: #5e4fc2;
  background: rgba(115, 94, 222, .09);
}

html[data-theme="light"] .sidebar-footer {
  color: #6e788f;
  background: rgba(247, 249, 253, .98);
}

html[data-theme="light"] .topbar {
  border-color: rgba(60, 71, 105, .12);
  background:
    linear-gradient(90deg, rgba(127, 104, 240, .09), rgba(250,251,255,.94) 39%, rgba(58, 185, 203, .075)),
    rgba(250,251,255,.95);
  box-shadow: 0 10px 34px rgba(66, 75, 105, .08);
}

html[data-theme="light"] .crumb { color: #929bb0; }
html[data-theme="light"] .crumb-sep { color: #c4cad8; }
html[data-theme="light"] .crumb-current { color: #3b455c; }
html[data-theme="light"] .action-group {
  border-color: rgba(60, 71, 105, .13);
  background: rgba(241,244,250,.88);
}

html[data-theme="light"] .rate-display {
  border-color: rgba(60, 71, 105, .13);
  background: rgba(255,255,255,.82);
  box-shadow: inset 0 1px rgba(255,255,255,.8);
}

html[data-theme="light"] .rate-label { color: #8b94a9; }
html[data-theme="light"] .rate-value { color: #293247; }
html[data-theme="light"] .btn {
  border-color: rgba(61, 73, 108, .18);
  color: #435069;
  background: rgba(255,255,255,.82);
  box-shadow: 0 4px 12px rgba(77, 88, 121, .065), inset 0 1px rgba(255,255,255,.9);
}

html[data-theme="light"] .btn:hover {
  border-color: rgba(105, 86, 211, .27);
  color: #2b3346;
  background: #ffffff;
}

html[data-theme="light"] .btn-primary {
  border-color: rgba(103, 84, 215, .42);
  color: #fff;
  background: linear-gradient(125deg, #9887ff 0%, #7259ee 49%, #4c74db 100%);
  box-shadow: 0 10px 24px rgba(94, 73, 206, .25), inset 0 1px rgba(255,255,255,.32);
}

html[data-theme="light"] .btn-theme {
  border-color: rgba(109, 90, 217, .21);
  color: #5d4bb7;
  background: linear-gradient(135deg, rgba(133, 111, 245, .14), rgba(67, 194, 207, .12));
}

html[data-theme="light"] .btn-theme span:first-child { color: #4babb8; }
html[data-theme="light"] .user-name { color: #30394d; }
html[data-theme="light"] .user-role { color: #8a93a8; }

html[data-theme="light"] h1 {
  color: #1f2840;
  background: linear-gradient(105deg, #182136 8%, #55429f 60%, #298394 118%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html[data-theme="light"] .eyebrow { color: #6754cb; }
html[data-theme="light"] .page-subtitle,
html[data-theme="light"] .card-subtitle { color: #79839a; }
html[data-theme="light"] .card {
  background:
    linear-gradient(150deg, rgba(255,255,255,.94), rgba(246,248,253,.965)) padding-box,
    linear-gradient(135deg, rgba(126, 104, 238, .3), rgba(50, 184, 201, .15) 47%, rgba(255,255,255,.7) 72%, rgba(181, 113, 224, .17)) border-box;
  box-shadow: 0 13px 35px rgba(65, 75, 108, .11), inset 0 1px rgba(255,255,255,.95);
}

html[data-theme="light"] .card-header { border-color: rgba(61, 73, 108, .11); }
html[data-theme="light"] .card-title { color: #2b344a; }
html[data-theme="light"] .text-link { color: #6552cc; }

html[data-theme="light"] .kpi-card {
  background:
    linear-gradient(148deg, rgba(255,255,255,.97), rgba(245,247,253,.97)) padding-box,
    linear-gradient(125deg, color-mix(in srgb, var(--tone, #806eff) 48%, transparent), rgba(255,255,255,.72) 56%, rgba(65, 186, 201, .18)) border-box;
}

html[data-theme="light"] .kpi-card::after { opacity: .9; }
html[data-theme="light"] .kpi-label { color: #737d94; }
html[data-theme="light"] .kpi-icon {
  border-color: rgba(63, 74, 108, .1);
  background: rgba(255,255,255,.7);
}
html[data-theme="light"] .kpi-value { color: #212a3f; }
html[data-theme="light"] .kpi-foot { color: #8690a5; }

html[data-theme="light"] .company-strip {
  background:
    linear-gradient(110deg, rgba(238,232,255,.95), rgba(255,255,255,.94) 40%, rgba(228,249,251,.88)) padding-box,
    linear-gradient(110deg, rgba(126, 104, 238, .38), rgba(50, 184, 201, .2), rgba(255,255,255,.8)) border-box;
}

html[data-theme="light"] .company-copy,
html[data-theme="light"] .company-stat-label { color: #7d879d; }
html[data-theme="light"] .company-stat { border-color: rgba(61, 73, 108, .1); }
html[data-theme="light"] .company-stat-value { color: #273047; }
html[data-theme="light"] .donut::after {
  border-color: rgba(61, 73, 108, .12);
  background: #fafbfe;
  box-shadow: inset 0 0 24px rgba(71, 82, 116, .06);
}
html[data-theme="light"] .donut-value { color: #273047; }
html[data-theme="light"] .donut-label,
html[data-theme="light"] .legend-name { color: #778198; }
html[data-theme="light"] .legend-value { color: #313a50; }

html[data-theme="light"] .automation-card {
  background:
    linear-gradient(145deg, rgba(234,228,255,.98), rgba(249,249,255,.98) 60%, rgba(228,248,250,.96)) padding-box,
    linear-gradient(135deg, rgba(127, 104, 239, .38), rgba(70, 195, 210, .17), rgba(181, 112, 222, .14)) border-box;
}
html[data-theme="light"] .automation-card::before { background: rgba(130, 107, 246, .18); }
html[data-theme="light"] .automation-headline { color: #2e2851; }
html[data-theme="light"] .automation-copy { color: #6f7891; }
html[data-theme="light"] .automation-metric {
  border-color: rgba(81, 69, 139, .1);
  background: rgba(255,255,255,.57);
}
html[data-theme="light"] .automation-value { color: #332b5a; }
html[data-theme="light"] .automation-label { color: #7c7698; }

html[data-theme="light"] .followup-row { border-color: rgba(61, 73, 108, .085); }
html[data-theme="light"] .person-name,
html[data-theme="light"] .contact-name { color: #30394e; }
html[data-theme="light"] .person-detail { color: #8a93a8; }
html[data-theme="light"] .followup-note { color: #69748a; }
html[data-theme="light"] .icon-button {
  border-color: rgba(61, 73, 108, .14);
  color: #778198;
  background: rgba(255,255,255,.78);
}
html[data-theme="light"] .icon-button:hover { color: #44358d; }

html[data-theme="light"] .dropdown-menu {
  border-color: #cfd5e3;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(67, 76, 108, .24);
}
html[data-theme="light"] .dropdown-item { color: #4f5a71; }
html[data-theme="light"] .dropdown-item:hover {
  color: #2d3548;
  background: #f0f2fa;
}

html[data-theme="light"] .segmented {
  border-color: rgba(61, 73, 108, .14);
  background: rgba(239,242,249,.83);
}
html[data-theme="light"] .segment { color: #8790a5; }
html[data-theme="light"] .segment.active {
  color: #3a4358;
  background: #fff;
  box-shadow: 0 3px 10px rgba(64, 74, 105, .09), inset 0 0 0 1px rgba(61,73,108,.08);
}

html[data-theme="light"] .kanban { scrollbar-color: #b8c0d3 #e5e9f2; }
html[data-theme="light"] .kanban-column {
  border-color: rgba(61, 73, 108, .12);
  background: rgba(239,242,249,.72);
}
html[data-theme="light"] .column-header {
  border-color: rgba(61, 73, 108, .09);
  background: rgba(251,252,255,.88);
}
html[data-theme="light"] .column-title { color: #4a556c; }
html[data-theme="light"] .column-count {
  color: #6f7890;
  background: rgba(70,81,112,.055);
}
html[data-theme="light"] .column-total,
html[data-theme="light"] .loan-id,
html[data-theme="light"] .days-label { color: #8a93a9; }
html[data-theme="light"] .column-cards { scrollbar-color: #bcc4d6 transparent; }

html[data-theme="light"] .loan-card {
  background:
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(246,248,253,.98)) padding-box,
    linear-gradient(135deg, rgba(124, 103, 235, .24), rgba(57, 184, 199, .11), rgba(255,255,255,.7)) border-box;
  box-shadow: 0 8px 20px rgba(68, 77, 108, .1), inset 0 1px rgba(255,255,255,.9);
}
html[data-theme="light"] .loan-card:hover {
  border-color: transparent;
  background:
    linear-gradient(145deg, #ffffff, #f5f7fd) padding-box,
    linear-gradient(135deg, rgba(112, 89, 225, .62), rgba(54, 185, 201, .32)) border-box;
  box-shadow: 0 13px 28px rgba(68, 77, 108, .15), 0 0 0 1px rgba(115, 94, 224, .04);
}
html[data-theme="light"] .loan-name { color: #2d364b; }
html[data-theme="light"] .loan-amount { color: #222b3f; }
html[data-theme="light"] .loan-more { color: #929aaf; }
html[data-theme="light"] .program-badge {
  border-color: rgba(61,73,108,.1);
  color: #707a90;
  background: rgba(239,242,248,.8);
}
html[data-theme="light"] .avatar-stack .avatar { border-color: #f8f9fd; }

html[data-theme="light"] .modal-backdrop { background: rgba(39, 43, 59, .57); }
html[data-theme="light"] .loan-modal {
  border-color: #c8cede;
  background: #f8f9fd;
  box-shadow: 0 32px 100px rgba(43, 49, 70, .35), inset 0 1px #fff;
}
html[data-theme="light"] .modal-top {
  border-color: #d9deea;
  background: linear-gradient(105deg, #f0edff, #fbfcff 46%, #eaf8fa);
}
html[data-theme="light"] .modal-name { color: #273047; }
html[data-theme="light"] .modal-file-meta { color: #7c869c; }
html[data-theme="light"] .modal-close {
  border-color: #cfd5e2;
  color: #69748a;
  background: #fff;
}
html[data-theme="light"] .loan-stepper {
  border-color: #d9deea;
  background: #f2f4f9;
}
html[data-theme="light"] .loan-step::before { background: #d7dce7; }
html[data-theme="light"] .loan-step.complete::before,
html[data-theme="light"] .loan-step.current::before { background: #7969e6; }
html[data-theme="light"] .step-number {
  border-color: #c9cfdd;
  color: #8a94a9;
  background: #fafbfe;
}
html[data-theme="light"] .step-label { color: #8992a7; }
html[data-theme="light"] .loan-step.complete .step-label,
html[data-theme="light"] .loan-step.current .step-label { color: #5f6980; }
html[data-theme="light"] .modal-tabs {
  border-color: #d9deea;
  background: #ffffff;
}
html[data-theme="light"] .modal-tab { color: #8a93a8; }
html[data-theme="light"] .modal-tab.active { color: #332a65; }
html[data-theme="light"] .modal-content { background: #f8f9fd; }
html[data-theme="light"] .condition-title { color: #283148; }
html[data-theme="light"] .progress-track { background: #dfe3ec; }
html[data-theme="light"] .progress-copy { color: #667188; }
html[data-theme="light"] .condition-list {
  border-color: #d6dce8;
  background: #ffffff;
  scrollbar-color: #bcc4d5 transparent;
}
html[data-theme="light"] .condition-row { border-color: #e7eaf1; }
html[data-theme="light"] .condition-check {
  border-color: #b7bfce;
  background-color: #f7f8fb;
}
html[data-theme="light"] .condition-check:checked {
  border-color: #7867e9;
  background:
    linear-gradient(45deg, transparent 43%, #fff 44% 59%, transparent 60%) 3px 8px / 6px 5px no-repeat,
    linear-gradient(-45deg, transparent 43%, #fff 44% 58%, transparent 59%) 7px 5px / 7px 8px no-repeat,
    #7867e9;
}
html[data-theme="light"] .condition-name { color: #374056; }
html[data-theme="light"] .condition-detail,
html[data-theme="light"] .condition-owner { color: #8790a5; }

html[data-theme="light"] .search-control input,
html[data-theme="light"] .message-input,
html[data-theme="light"] .mini-compose input {
  border-color: rgba(61,73,108,.15);
  color: #2f394f;
  background: rgba(255,255,255,.87);
}
html[data-theme="light"] .search-control::before { color: #8992a7; }
html[data-theme="light"] .contact-table th {
  border-color: rgba(61,73,108,.11);
  color: #7d879d;
  background: rgba(238,241,248,.7);
}
html[data-theme="light"] .contact-table td {
  border-color: rgba(61,73,108,.085);
  color: #667187;
}
html[data-theme="light"] .contact-table tbody tr:hover { background: rgba(116, 94, 226, .045); }
html[data-theme="light"] .contact-sub { color: #8c95aa; }
html[data-theme="light"] .tag {
  border-color: rgba(61,73,108,.11);
  color: #6f7990;
  background: rgba(239,242,248,.75);
}
html[data-theme="light"] .table-footer {
  border-color: rgba(61,73,108,.11);
  color: #7e889d;
}
html[data-theme="light"] .page-btn {
  border-color: rgba(61,73,108,.14);
  color: #747e94;
  background: #fff;
}
html[data-theme="light"] .page-btn.active {
  border-color: #7664dc;
  color: #fff;
  background: linear-gradient(135deg, #8978ef, #6250c5);
}

html[data-theme="light"] .messages-layout {
  border-color: rgba(61,73,108,.13);
  background: #f4f6fb;
  box-shadow: 0 18px 45px rgba(64,74,106,.13);
}
html[data-theme="light"] .thread-panel {
  border-color: rgba(61,73,108,.11);
  background: rgba(250,251,254,.95);
}
html[data-theme="light"] .thread-panel-head,
html[data-theme="light"] .thread-tabs,
html[data-theme="light"] .thread-item { border-color: rgba(61,73,108,.085); }
html[data-theme="light"] .thread-heading { color: #2c354a; }
html[data-theme="light"] .thread-tab { color: #8790a5; }
html[data-theme="light"] .thread-tab.active { color: #6250c4; }
html[data-theme="light"] .thread-item:hover { background: rgba(80,92,129,.035); }
html[data-theme="light"] .thread-item.active {
  background: linear-gradient(90deg, rgba(126, 104, 239, .16), rgba(58, 187, 203, .045));
  box-shadow: inset 2px 0 #7665df;
}
html[data-theme="light"] .thread-name { color: #3c465c; }
html[data-theme="light"] .thread-preview { color: #7d879c; }
html[data-theme="light"] .thread-time { color: #929aaf; }
html[data-theme="light"] .conversation {
  background:
    radial-gradient(560px 360px at 91% 14%, rgba(116, 94, 226, .1), transparent 70%),
    radial-gradient(430px 300px at 15% 90%, rgba(53, 184, 199, .075), transparent 72%),
    #f4f6fb;
}
html[data-theme="light"] .conversation-head {
  border-color: rgba(61,73,108,.11);
  background: rgba(255,255,255,.91);
}
html[data-theme="light"] .day-divider { color: #8f98ac; }
html[data-theme="light"] .day-divider::before,
html[data-theme="light"] .day-divider::after { background: rgba(61,73,108,.1); }
html[data-theme="light"] .message-bubble {
  border-color: #d5dae6;
  color: #566177;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(70,80,111,.07);
}
html[data-theme="light"] .outgoing .message-bubble {
  border-color: rgba(108, 88, 213, .35);
  color: #fff;
  background: linear-gradient(135deg, #7968db, #5749ac);
}
html[data-theme="light"] .message-time { color: #9099ad; }
html[data-theme="light"] .message-composer {
  border-color: rgba(61,73,108,.11);
  background: rgba(250,251,254,.96);
}

html[data-theme="light"] .mini-chat {
  border-color: #cbd1df;
  background: #f8f9fd;
  box-shadow: 0 26px 80px rgba(49,57,80,.28);
}
html[data-theme="light"] .mini-head {
  border-color: #d9deea;
  background: linear-gradient(105deg, #f0edff, #f8fcfd);
}
html[data-theme="light"] .mini-title { color: #313a50; }
html[data-theme="light"] .mini-body { background: #f5f7fb; }
html[data-theme="light"] .mini-bubble {
  border-color: #d6dbe7;
  color: #566176;
  background: #fff;
}
html[data-theme="light"] .mini-bubble strong { color: #313a50 !important; }
html[data-theme="light"] .mini-bubble.mine {
  border-color: #7564d8;
  color: #fff;
  background: linear-gradient(135deg, #7c6bdf, #594aac);
}
html[data-theme="light"] .mini-compose {
  border-color: #d8dde8;
  background: #f8f9fd;
}

html[data-theme="light"] .toast {
  border-color: #cbd1df;
  color: #374157;
  background: #ffffff;
  box-shadow: 0 15px 45px rgba(54,63,89,.22);
}
