:root {
  --primary: #6c5dd3;
  --primary-rgb: 108, 93, 211;
  --ink: #111b3d;
  --muted: #8792ad;
  --line: #e5e8f2;
  --page: #f1f3f9;
  --panel: #fff;
  --panel-alt: #f7f8fb;
  --sidebar: #fff;
  --cell: #4e5f91;
  --shadow: 0 5px 16px rgba(32, 45, 82, 0.07);
}
:root[data-theme="dark"],
body[data-theme="dark"] {
  --primary: #8d86ed;
  --primary-rgb: 141, 134, 237;
  --ink: #eef0fa;
  --muted: #a0a6b7;
  --line: #36394d;
  --page: #191b2a;
  --panel: #252738;
  --panel-alt: #202233;
  --sidebar: #202233;
  --cell: #c6cad7;
  --shadow: 0 3px 14px rgba(0, 0, 0, 0.18);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--page);
  transition: background 0.2s, color 0.2s;
}
img,
canvas {
  max-width: 100%;
}
button {
  font: inherit;
  cursor: pointer;
}
.sidebar {
  position: fixed;
  z-index: 20;
  top: 0;
  bottom: 0;
  left: 0;
  width: 270px;
  overflow-y: auto;
  color: var(--ink);
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  box-shadow: 5px 0 17px rgba(37, 51, 88, 0.05);
  scrollbar-color: transparent transparent;
  scrollbar-width: thin;
  transition: transform 0.22s, scrollbar-color 0.2s;
}
.sidebar:hover {
  scrollbar-color: rgba(108, 93, 211, 0.42) transparent;
}
.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 10px;
}
.sidebar:hover::-webkit-scrollbar-thumb {
  background: rgba(108, 93, 211, 0.42);
}
.sidebar:hover::-webkit-scrollbar-thumb:hover {
  background: rgba(108, 93, 211, 0.7);
}
.sidebar.closed {
  transform: translateX(-100%);
}
.logo-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}
.brand-logo {
  display: block;
  width: 210px;
  max-width: 100%;
  height: auto;
  max-height: 90px;
  padding: 4px 8px;
  background: #fff;
  border-radius: 6px;
  object-fit: cover;
}
.nav-section {
  padding: 11px 15px 15px 0;
}
.nav-title {
  padding: 14px 0 9px 30px;
  color: #a6afc3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 2px 0;
  padding: 12px 16px 12px 30px;
  border: 0;
  border-radius: 0 24px 24px 0;
  color: var(--cell);
  background: transparent;
  font-size: 13px;
  text-align: left;
  transition: 0.18s;
  cursor: pointer;
}
.nav-item > i:first-child {
  width: 17px;
  color: #586da7;
  text-align: center;
  font-size: 15px;
}
.nav-item span {
  flex: 1;
}
.nav-item:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
}
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, #6755cb, #9a91e3);
  box-shadow: 0 9px 17px rgba(108, 93, 211, 0.25);
}
.nav-item.active > i:first-child {
  color: #fff;
}
.nav-item:hover > i:first-child {
  color: var(--primary);
}
.nav-item.active:hover > i:first-child {
  color: #fff;
}
.nav-arrow {
  font-size: 9px;
  transition: transform 0.22s ease;
}
.nav-group.open .nav-toggle .nav-arrow {
  transform: rotate(180deg);
}
.nav-submenu {
  display: grid;
  grid-template-rows: 0fr;
  margin: 0 0 0 22px;
  overflow: hidden;
  border-left: 1px solid var(--line);
  transition: grid-template-rows 0.24s ease;
}
.nav-group.open .nav-submenu {
  grid-template-rows: 1fr;
}
.nav-submenu-inner {
  min-height: 0;
  padding: 4px 0 8px;
}
.nav-subitem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 8px 14px 8px 16px;
  border: 0;
  border-radius: 0 18px 18px 0;
  color: var(--cell);
  background: transparent;
  font-size: 13px;
  text-align: left;
  transition: color 0.18s, background 0.18s, transform 0.18s;
}
.nav-subitem i {
  width: 16px;
  color: #2f3f65;
  text-align: center;
  font-size: 14px;
}
.nav-subitem span {
  flex: 1;
}
.nav-subitem:hover,
.nav-subitem.active {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
}
.nav-subitem:hover {
  transform: translateX(2px);
}
.nav-subitem:hover i,
.nav-subitem.active i {
  color: var(--primary);
}
:root[data-theme="dark"] .nav-subitem i,
body[data-theme="dark"] .nav-subitem i {
  color: #aeb6d5;
}
:root[data-theme="dark"] .nav-subitem:hover i,
:root[data-theme="dark"] .nav-subitem.active i,
body[data-theme="dark"] .nav-subitem:hover i,
body[data-theme="dark"] .nav-subitem.active i {
  color: var(--primary);
}

.model-portfolio-page {
  display: grid;
  gap: 18px;
}

.model-page-hero,
.model-card,
.model-kpi-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.model-page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  overflow: hidden;
  position: relative;
}

.model-page-hero::after {
  content: "";
  position: absolute;
  right: -55px;
  top: -55px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.18), transparent 68%);
  pointer-events: none;
}

.model-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.model-page-hero h2,
.model-section-head h3 {
  margin: 8px 0 5px;
  color: var(--ink);
}

.model-page-hero p,
.model-section-head p,
.model-kpi-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.model-kpi-card {
  min-height: 138px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.model-kpi-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -54px auto;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(var(--primary-rgb), 0.09);
}

.model-kpi-card span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #6c5dd3, #9b8cf4);
  box-shadow: 0 12px 24px rgba(108, 93, 211, 0.22);
}

.model-kpi-card.pink span {
  background: linear-gradient(135deg, #d84ec7, #ff8bc8);
  box-shadow: 0 12px 24px rgba(216, 78, 199, 0.2);
}

.model-kpi-card.blue span {
  background: linear-gradient(135deg, #3d8bfd, #75d5ff);
  box-shadow: 0 12px 24px rgba(61, 139, 253, 0.18);
}

.model-kpi-card small {
  display: block;
  margin-top: 16px;
  color: var(--cell);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.model-kpi-card strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.model-card {
  padding: 20px;
}

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

.model-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-alt);
  color: var(--muted);
}

.model-search input {
  width: 100%;
  min-height: 40px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

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

.model-table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.model-table th,
.model-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  color: var(--cell);
  font-size: 13px;
  text-align: left;
}

.model-table th {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.06);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.model-table td:first-child {
  color: var(--ink);
  font-weight: 700;
}

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

.model-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  color: #0a9f72;
  background: rgba(25, 197, 141, 0.12);
  font-size: 11px;
  font-weight: 800;
}

.model-status.muted {
  color: var(--muted);
  background: var(--panel-alt);
}

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

.model-setting-list,
.model-toggle-list {
  display: grid;
  gap: 12px;
}

.model-setting-list label,
.model-toggle-list label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--cell);
  background: var(--panel-alt);
  font-size: 13px;
}

.model-setting-list input {
  width: 110px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--panel);
  text-align: right;
}

.portfolio-hero {
  background:
    radial-gradient(circle at 86% 18%, rgba(216, 78, 199, 0.16), transparent 28%),
    linear-gradient(135deg, var(--panel), rgba(var(--primary-rgb), 0.08));
}

.portfolio-hero-actions,
.portfolio-filter-row,
.portfolio-model-top,
.portfolio-model-meta,
.portfolio-insight-head,
.drawer-metrics,
.portfolio-holding-list div,
.portfolio-step-list span {
  display: flex;
  align-items: center;
}

.portfolio-hero-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.model-soft-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(var(--primary-rgb), 0.16);
  border-radius: 10px;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.09);
  font-size: 13px;
  font-weight: 800;
}

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

.portfolio-control-card {
  padding: 14px;
}

.portfolio-filter-row {
  gap: 12px;
  flex-wrap: wrap;
}

.portfolio-search {
  flex: 1 1 320px;
  min-width: min(100%, 320px);
}

.portfolio-filter-row select {
  min-height: 42px;
  min-width: 190px;
  padding: 0 36px 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--panel);
  outline: 0;
}

.portfolio-view-toggle {
  display: inline-flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-alt);
}

.portfolio-view-toggle button {
  min-height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  color: var(--cell);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.portfolio-view-toggle button.active {
  color: #fff;
  background: linear-gradient(135deg, #6c5dd3, #9a91e3);
  box-shadow: 0 8px 16px rgba(108, 93, 211, 0.22);
}

.portfolio-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.portfolio-grid-panel,
.portfolio-insight-panel,
.portfolio-detail-drawer {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.portfolio-grid-panel {
  padding: 20px;
}

.portfolio-result-count {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.09);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

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

.portfolio-model-card {
  display: grid;
  gap: 12px;
  min-height: 230px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(var(--primary-rgb), 0.05), transparent 46%),
    var(--panel);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.portfolio-model-card:hover,
.portfolio-model-card.active {
  border-color: rgba(var(--primary-rgb), 0.35);
  box-shadow: 0 14px 30px rgba(32, 45, 82, 0.11);
  transform: translateY(-2px);
}

.portfolio-model-top {
  justify-content: space-between;
  gap: 12px;
}

.portfolio-model-top span {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  font-size: 11px;
  font-weight: 900;
}

.portfolio-model-top b {
  color: #0a9f72;
  font-size: 18px;
}

.portfolio-model-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.portfolio-model-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.portfolio-model-meta {
  gap: 10px;
  flex-wrap: wrap;
  color: var(--cell);
  font-size: 12px;
}

.portfolio-model-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.portfolio-model-meta i {
  color: var(--primary);
}

.portfolio-mini-allocation {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--primary-rgb), 0.12);
}

.portfolio-model-card button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.09);
  font-size: 12px;
  font-weight: 900;
}

.portfolio-empty-state {
  padding: 36px 20px;
  border: 1px dashed rgba(var(--primary-rgb), 0.24);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.portfolio-empty-state i {
  display: block;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 28px;
}

.portfolio-insight-panel {
  position: sticky;
  top: 12px;
  padding: 18px;
}

.portfolio-insight-head {
  justify-content: space-between;
  gap: 12px;
}

.portfolio-insight-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.portfolio-insight-head h3 {
  margin: 5px 0;
  color: var(--ink);
  font-size: 17px;
}

.portfolio-insight-head p {
  margin: 0;
  color: var(--cell);
  font-size: 12px;
}

.portfolio-insight-head button {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}

.portfolio-donut {
  display: grid;
  place-items: center;
  width: 190px;
  height: 190px;
  margin: 22px auto;
  position: relative;
  border-radius: 50%;
  background: var(--portfolio-donut, conic-gradient(#6c5dd3 0 65%, #d84ec7 65% 82%, #45c6b0 82% 100%));
}

.portfolio-donut::after {
  content: "";
  position: absolute;
  inset: 27px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}

.portfolio-donut strong,
.portfolio-donut small {
  position: relative;
  z-index: 1;
}

.portfolio-donut strong {
  color: var(--ink);
  font-size: 24px;
}

.portfolio-donut small {
  margin-top: 31px;
  color: var(--muted);
  font-size: 11px;
}

.allocation-list {
  display: grid;
  gap: 11px;
}

.allocation-row div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--cell);
  font-size: 12px;
}

.allocation-row b {
  color: var(--ink);
}

.allocation-row i {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--primary-rgb), 0.1);
}

.allocation-row em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6c5dd3, #d84ec7);
}

.allocation-list.large .allocation-row i {
  height: 10px;
}

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

.portfolio-map-table td,
.portfolio-map-table th {
  white-space: nowrap;
}

.portfolio-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(9, 13, 31, 0.42);
  backdrop-filter: blur(2px);
}

.portfolio-detail-drawer {
  position: fixed;
  z-index: 46;
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(440px, calc(100vw - 28px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(calc(100% + 32px));
  transition: transform 0.24s ease;
}

.portfolio-detail-drawer.open {
  transform: translateX(0);
}

.portfolio-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 100% 0, rgba(216, 78, 199, 0.16), transparent 42%),
    rgba(var(--primary-rgb), 0.06);
}

.portfolio-drawer-head span {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.portfolio-drawer-head h3 {
  margin: 7px 0;
  color: var(--ink);
}

.portfolio-drawer-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.portfolio-drawer-head button {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 11px;
  color: var(--primary);
  background: var(--panel);
}

.portfolio-drawer-body {
  display: grid;
  gap: 16px;
  padding: 18px;
  overflow-y: auto;
}

.drawer-metrics {
  gap: 10px;
}

.drawer-metrics article {
  flex: 1;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-alt);
}

.drawer-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.drawer-metrics strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 16px;
}

.portfolio-drawer-section {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.portfolio-drawer-section h4 {
  margin: 0 0 13px;
  color: var(--ink);
}

.portfolio-holding-list {
  display: grid;
  gap: 9px;
}

.portfolio-holding-list div {
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  color: var(--cell);
  background: var(--panel-alt);
  font-size: 12px;
}

.portfolio-holding-list b {
  color: var(--ink);
}

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

.portfolio-step-list span {
  gap: 9px;
  color: var(--cell);
  font-size: 12px;
}

.portfolio-step-list i {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  font-size: 10px;
}

.portfolio-step-list .done i {
  color: #0a9f72;
  background: rgba(25, 197, 141, 0.14);
}

.model-portfolio-builder {
  display: grid;
  gap: 18px;
}

.mp-board,
.mp-create-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.mp-board {
  overflow: hidden;
}

.mp-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
}

.mp-board-head h2 {
  margin: 8px 0 5px;
  color: var(--ink);
}

.mp-board-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.mp-mode-toggle,
.mp-mode-toggle button,
.mp-risk-header,
.mp-risk-row,
.mp-risk-name,
.mp-risk-chart-cell,
.mp-create-head,
.mp-panel-meta,
.mp-add-head,
.mp-check,
.mp-security-controls,
.mp-weight-message,
.mp-security-row,
.mp-security-row label,
.mp-create-actions,
.mp-preview-legend span {
  display: flex;
  align-items: center;
}

.mp-mode-toggle {
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

.mp-mode-toggle button {
  width: 40px;
  height: 22px;
  padding: 3px;
  border: 0;
  border-radius: 999px;
  background: #dedfe6;
  transition: background 0.2s;
}

.mp-mode-toggle button i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(32, 45, 82, 0.18);
  transition: transform 0.2s;
}

.mp-mode-toggle button.active {
  background: linear-gradient(135deg, #6c5dd3, #d84ec7);
}

.mp-mode-toggle button.active i {
  transform: translateX(18px);
}

.mp-risk-table {
  margin: 0 22px 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.mp-risk-header {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  background: var(--panel-alt);
  border-bottom: 1px solid var(--line);
}

.mp-risk-header div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 16px;
  color: var(--ink);
  font-size: 13px;
}

.mp-risk-header div + div,
.mp-risk-chart-cell {
  border-left: 1px solid var(--line);
}

.mp-risk-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  width: 100%;
  min-height: 94px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
  text-align: left;
  transition: background 0.18s;
}

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

.mp-risk-row:hover {
  background: rgba(var(--primary-rgb), 0.04);
}

.mp-risk-name {
  gap: 10px;
  padding: 18px 16px;
  font-size: 15px;
  font-weight: 600;
}

.mp-risk-name i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.mp-risk-chart-cell {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  padding: 14px;
}

.mp-risk-chart-cell small {
  color: var(--cell);
  font-size: 11px;
  font-weight: 700;
}

.mp-row-chart {
  width: 100%;
  min-height: 46px;
  position: relative;
  border-radius: 6px;
  background: var(--panel-alt);
}

.mp-row-chart::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 26px;
  height: 26px;
  border: 4px solid #d7dbe5;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--panel-alt);
}

.mp-row-chart.ready::before {
  border: 0;
  background: var(--mp-chart);
  box-shadow: inset 0 0 0 8px var(--panel-alt), 0 8px 18px rgba(32, 45, 82, 0.12);
}

.mp-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(9, 13, 31, 0.4);
  backdrop-filter: blur(2px);
}

.mp-create-panel {
  position: fixed;
  z-index: 46;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(1090px, 100vw);
  display: flex;
  flex-direction: column;
  border-radius: 0 18px 18px 0;
  overflow: hidden;
  transform: translateX(-104%);
  transition: transform 0.24s ease;
}

.mp-create-panel.open {
  transform: translateX(0);
}

.mp-create-head {
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.mp-create-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
}

.mp-create-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.mp-create-head button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  color: var(--cell);
  background: transparent;
}

.mp-create-head button:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
}

.mp-panel-meta {
  gap: 26px;
  flex-wrap: wrap;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.mp-panel-meta b {
  color: var(--ink);
  font-weight: 600;
}

.mp-panel-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 22px;
  padding: 22px;
  overflow-y: auto;
}

.mp-security-area {
  display: grid;
  gap: 14px;
  align-content: start;
}

.mp-add-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.mp-add-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 12px;
}

.mp-check {
  gap: 7px;
  color: var(--cell);
}

.mp-check input {
  accent-color: #f7c900;
}

.mp-security-controls {
  gap: 10px;
}

.mp-security-controls select {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
}

.mp-weight-message {
  gap: 9px;
  min-height: 32px;
  padding: 8px 12px;
  border: 1px solid #f7c900;
  border-radius: 8px;
  color: #c78b00;
  background: rgba(247, 201, 0, 0.1);
  font-size: 12px;
}

.mp-weight-message.success {
  border-color: #25c78c;
  color: #0a9f72;
  background: rgba(37, 199, 140, 0.1);
}

.mp-security-list {
  display: grid;
  gap: 4px;
}

.mp-security-row {
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 8px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.mp-security-row > div {
  min-width: 0;
}

.mp-security-row b,
.mp-security-row span {
  display: block;
}

.mp-security-row b {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-security-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.mp-security-row label {
  flex: 0 0 102px;
  position: relative;
}

.mp-security-row label input {
  width: 100%;
  min-height: 36px;
  padding: 0 34px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
}

.mp-security-row label span {
  position: absolute;
  right: 10px;
  top: 50%;
  margin: 0;
  color: var(--muted);
  transform: translateY(-50%);
}

.mp-security-row button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
}

.mp-security-row button:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.mp-chart-preview {
  display: grid;
  gap: 18px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.mp-chart-preview section {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 176px;
}

.mp-chart-preview section + section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.mp-chart-preview h4 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.mp-preview-donut {
  justify-self: center;
  width: 88px;
  height: 88px;
  position: relative;
  border-radius: 50%;
  background: var(--mp-chart, conic-gradient(rgba(135, 146, 173, 0.14) 0 100%));
  box-shadow: inset 0 0 0 1px var(--line);
}

.mp-preview-donut::after {
  content: "";
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--line);
}

.mp-preview-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mp-preview-legend span {
  gap: 6px;
  color: var(--cell);
  font-size: 11px;
}

.mp-preview-legend i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.mp-preview-legend b {
  color: var(--ink);
  font-weight: 700;
}

.mp-preview-legend small {
  color: var(--muted);
  font-size: 11px;
}

.mp-create-actions {
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
  padding: 20px 22px;
  border-top: 1px solid var(--line);
}

.mp-create-actions .btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 900px) {
  .model-kpi-grid,
  .model-config-grid {
    grid-template-columns: 1fr;
  }

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

  .portfolio-workspace {
    grid-template-columns: 1fr;
  }

  .portfolio-insight-panel {
    position: static;
  }

  .model-page-hero,
  .model-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .model-page-hero .btn-primary,
  .model-search {
    width: 100%;
  }

  .portfolio-filter-row select,
  .portfolio-view-toggle,
  .portfolio-hero-actions,
  .portfolio-hero-actions button {
    width: 100%;
  }

  .portfolio-view-toggle {
    justify-content: space-between;
  }

  .portfolio-view-toggle button {
    flex: 1;
  }

  .mp-board-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mp-mode-toggle {
    justify-content: flex-end;
  }

  .mp-panel-body {
    grid-template-columns: 1fr;
  }

  .mp-chart-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 0;
    border-left: 0;
  }

  .mp-chart-preview section + section {
    padding-top: 0;
    border-top: 0;
  }
}

@media (max-width: 560px) {
  .model-page-hero,
  .model-card {
    padding: 16px;
  }

  .model-page-hero h2 {
    font-size: 22px;
  }

  .model-kpi-card strong {
    font-size: 22px;
  }

  .portfolio-summary-grid,
  .portfolio-card-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-grid-panel {
    padding: 16px;
  }

  .portfolio-model-card {
    min-height: auto;
  }

  .portfolio-donut {
    width: 166px;
    height: 166px;
  }

  .portfolio-detail-drawer {
    inset: auto 0 0;
    width: 100%;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
    transform: translateY(calc(100% + 28px));
  }

  .portfolio-detail-drawer.open {
    transform: translateY(0);
  }

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

  .mp-board-head {
    padding: 16px;
  }

  .mp-risk-table {
    margin: 0 12px 16px;
    overflow-x: auto;
  }

  .mp-risk-header,
  .mp-risk-row {
    grid-template-columns: 145px minmax(330px, 1fr);
    min-width: 520px;
  }

  .mp-risk-name {
    padding: 14px 12px;
    font-size: 13px;
  }

  .mp-create-panel {
    width: 100vw;
    border-radius: 0;
  }

  .mp-create-head,
  .mp-panel-meta,
  .mp-panel-body,
  .mp-create-actions {
    padding-left: 14px;
    padding-right: 14px;
  }

  .mp-panel-meta {
    gap: 10px;
  }

  .mp-panel-meta span {
    flex: 1 1 100%;
  }

  .mp-security-controls,
  .mp-security-row,
  .mp-create-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .mp-security-row label {
    flex: 0 0 auto;
    width: 100%;
  }

  .mp-security-row button {
    width: 100%;
  }

  .mp-chart-preview {
    grid-template-columns: 1fr;
  }

  .model-setting-list label,
  .model-toggle-list label {
    align-items: stretch;
    flex-direction: column;
  }

  .model-setting-list input {
    width: 100%;
    text-align: left;
  }
}
.sidebar-footer {
  padding: 15px 15px 15px 30px;
  border-top: 1px solid var(--line);
}
.sidebar-footer a {
  display: block;
  margin-top: 12px;
  color: var(--primary);
  font-size: 12px;
  text-decoration: none;
}
.sidebar-user,
.top-user {
  display: flex;
  align-items: center;
  gap: 9px;
}
.sidebar-user b,
.top-user b {
  display: block;
  font-size: 12px;
}
.sidebar-user small,
.top-user small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}
.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}
.main-content {
  display: flex;
  height: 100vh;
  margin-left: 270px;
  min-width: 0;
  flex-direction: column;
  transition: margin 0.22s;
}
.main-content.full {
  margin-left: 0;
}
.bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-icon {
  position: relative;
  width: 36px;
  height: 36px;
  color: var(--cell);
  background: transparent;
  border: 0;
  border-radius: 50%;
}
.header-icon:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}
.notification-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  background: #22c55e;
  border: 1px solid var(--panel);
  border-radius: 50%;
}
.notification-dot.warning {
  background: #f59e0b;
}
.top-user {
  margin: 0 8px;
  padding: 0 6px;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.top-user > i {
  margin-left: 4px;
  color: var(--muted);
  font-size: 9px;
}
.header-dropdown {
  position: fixed;
  top: 58px;
  right: 88px;
  z-index: 50;
  display: none;
  width: 280px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(20, 27, 48, 0.16);
}
.header-dropdown.open {
  display: block;
}
.header-dropdown h4 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 13px;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 5px;
}
.dropdown-item:hover {
  background: rgba(var(--primary-rgb), 0.08);
}
.dropdown-item b,
.dropdown-item small {
  display: block;
}
.dropdown-item b {
  color: var(--ink);
  font-size: 12px;
}
.dropdown-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}
.avatar.sm {
  width: 30px;
  height: 30px;
  font-size: 10px;
}
.dropdown-item .success {
  color: #10b981;
}
.dropdown-item .warning {
  color: #f59e0b;
}
.dropdown-action,
.profile-menu button {
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
  border: 0;
  border-radius: 4px;
  font-size: 12px;
}
.profile-menu {
  right: 38px;
  width: 230px;
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--line);
}
.profile-head b,
.profile-head small {
  display: block;
}
.profile-head small {
  color: var(--muted);
  font-size: 10px;
}
.profile-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 6px;
  padding: 8px 10px;
  color: var(--cell);
  background: transparent;
}
.profile-menu button:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
}
.settings-drawer {
  position: fixed;
  top: 0;
  right: -330px;
  bottom: 0;
  z-index: 70;
  width: 320px;
  padding: 18px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 30px rgba(20, 27, 48, 0.18);
  transition: right 0.22s ease;
}
.settings-drawer.open {
  right: 0;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.drawer-head h3 {
  margin: 0;
  color: var(--ink);
}
.drawer-head button {
  width: 32px;
  height: 32px;
  color: var(--cell);
  background: var(--panel-alt);
  border: 0;
  border-radius: 50%;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  color: var(--cell);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.mini-toggle {
  width: 42px;
  height: 22px;
  padding: 2px;
  background: #d8deea;
  border: 0;
  border-radius: 20px;
  transition: background 0.18s;
}
.mini-toggle i {
  display: block;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(20, 27, 48, 0.18);
  transition: transform 0.18s;
}
.mini-toggle.active {
  background: var(--primary);
}
.mini-toggle.active i {
  transform: translateX(20px);
}
.mini-button {
  min-height: 30px;
  padding: 6px 12px;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: 4px;
}
.settings-drawer p {
  margin-top: 16px;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  background: rgba(10, 14, 26, 0.35);
}
.drawer-backdrop.open {
  display: block;
}
.content-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 8px 17px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.heading-left {
  display: flex;
  align-items: center;
  gap: 13px;
}
.heading-menu {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.12);
  border: 0;
  border-radius: 8px;
}
.heading-menu:hover {
  background: rgba(var(--primary-rgb), 0.2);
}
.content-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
.content-heading p {
  margin: 3px 0 0;
  color: #7b8eac;
  font-size: 10px;
}
.quick-nav {
  display: flex;
  gap: 7px;
  min-height: 67px;
  overflow-x: auto;
  padding: 8px 17px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.quick-nav::-webkit-scrollbar {
  display: none;
}
.quick-item {
  display: flex;
  min-width: 72px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 7px 10px;
  color: #657696;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 10px;
}
.quick-item i {
  color: var(--primary);
  font-size: 15px;
}
.quick-item:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), 0.2);
}
.quick-item.active {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.13);
  border-color: rgba(var(--primary-rgb), 0.28);
  box-shadow: 0 6px 14px rgba(var(--primary-rgb), 0.1);
}
.quick-item.active i {
  color: var(--primary);
}
:root[data-theme="dark"] .quick-item,
body[data-theme="dark"] .quick-item {
  color: #b8bfd0;
}
:root[data-theme="dark"] .quick-item:hover,
:root[data-theme="dark"] .quick-item.active,
body[data-theme="dark"] .quick-item:hover,
body[data-theme="dark"] .quick-item.active {
  color: #ffffff;
  background: rgba(var(--primary-rgb), 0.18);
  border-color: rgba(var(--primary-rgb), 0.38);
}
.page-content {
  width: 100%;
  min-height: 0;
  padding: 18px 20px 16px;
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-menu-btn,
.sidebar-overlay {
  display: none;
}
.module-page,
body:not(.app-shell):not(.login-page) {
  padding: 0 !important;
  background: var(--page) !important;
  color: var(--ink) !important;
}
.card,
.form-card,
.stat-card {
  background: var(--panel) !important;
  border: 1px solid var(--line) !important;
  border-radius: 6px !important;
  box-shadow: var(--shadow) !important;
}
.card,
.form-card {
  padding: 20px !important;
}
.stats-grid {
  gap: 16px !important;
  margin-bottom: 18px !important;
}
.stat-card {
  padding: 18px !important;
}
.stat-title,
label {
  color: var(--muted) !important;
}
.stat-value,
h1,
h2,
h3,
.section-title {
  color: var(--ink) !important;
}
h2,
h3 {
  font-size: 16px;
}
.section-title {
  border-left-color: var(--primary) !important;
  font-size: 14px !important;
}
p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
table {
  width: 100%;
  overflow: hidden;
  background: var(--panel) !important;
  border-collapse: collapse;
  border-radius: 5px !important;
}
th {
  background: var(--panel-alt) !important;
  color: var(--primary) !important;
  font-size: 11px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}
th,
td {
  padding: 11px !important;
  border-bottom: 1px solid var(--line) !important;
  text-align: left;
}
td {
  color: var(--cell);
  font-size: 13px;
}
input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px !important;
  color: var(--ink) !important;
  background: var(--panel) !important;
  border: 1px solid #d8deea !important;
  border-radius: 4px !important;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  transition: border-color 0.18s, box-shadow 0.18s;
}
textarea {
  min-height: 78px;
  resize: vertical;
}
select {
  padding-right: 32px !important;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8e99af 50%),
    linear-gradient(135deg, #8e99af 50%, transparent 50%) !important;
  background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px !important;
  background-repeat: no-repeat !important;
  background-size: 5px 5px, 5px 5px !important;
}
input::placeholder,
textarea::placeholder {
  color: #a4adbd;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary) !important;
  outline: 0;
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.14) !important;
}
.btn,
.btn-primary,
.btn-login {
  color: #fff !important;
  background: linear-gradient(90deg, #6656cd, #897de0) !important;
  border: 0 !important;
  border-radius: 4px !important;
}
.btn-secondary {
  color: #5e6c88 !important;
  background: var(--panel) !important;
  border: 1px solid #d8deea !important;
  border-radius: 4px !important;
}
.edit-btn,
h2 i,
h3 i,
.section-title i,
.upload-area i {
  color: var(--primary) !important;
}
.upload-area {
  background: rgba(var(--primary-rgb), 0.06) !important;
  border-color: var(--primary) !important;
}
.radio-group,
.toggle-group {
  background: var(--panel-alt) !important;
  border-color: var(--line) !important;
}
.badge {
  color: #15803d !important;
  background: #dcfce7 !important;
}
canvas {
  max-height: 235px !important;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 17px 22px;
}
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-group.full-width {
  grid-column: 1/-1;
}
.field-group > label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #5e6b85 !important;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: none;
}
.field-group > label i {
  color: #7c88a3;
  font-size: 11px;
}
.required:after {
  margin-left: 2px;
  color: #ef4444;
  content: "*";
}
.help-text {
  margin-top: -1px;
  color: #9ca7ba;
  font-size: 10px;
}
.radio-group,
.toggle-group {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 18px;
  padding: 7px 10px;
  border: 1px solid #d8deea !important;
  border-radius: 4px;
}
.radio-option {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #5e6b85 !important;
  font-size: 12px;
  font-weight: 400 !important;
  cursor: pointer;
}
.radio-option input[type="radio"],
input[type="radio"],
input[type="checkbox"] {
  width: 15px;
  min-height: 15px;
  height: 15px;
  accent-color: var(--primary);
}
.action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.action-buttons button,
.btn-primary,
.btn-secondary {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 8px 17px !important;
  font-size: 12px;
  font-weight: 600;
}
.section-title {
  margin: 23px -20px 17px;
  padding: 11px 20px;
  color: var(--ink) !important;
  background: var(--panel-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 0 !important;
  font-size: 13px !important;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.product-list,
.client-list {
  margin-top: 18px;
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 16px;
}
.search-bar input {
  min-height: 38px;
  flex: 1;
  border-radius: 4px 0 0 4px !important;
}
.search-bar button {
  min-height: 38px;
  border-radius: 0 4px 4px 0 !important;
}
.upload-area {
  margin: 16px 0;
  padding: 34px;
  border: 1px dashed rgba(var(--primary-rgb), 0.7) !important;
  border-radius: 5px !important;
  text-align: center;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.upload-area:hover {
  background: rgba(var(--primary-rgb), 0.1) !important;
  border-color: var(--primary) !important;
}
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.folder,
.maintenance-item {
  padding: 16px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.folder {
  text-align: center;
  cursor: pointer;
}
.folder:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
}
.folder i {
  color: var(--primary);
  font-size: 30px;
}
.folder h4 {
  margin: 9px 0 4px;
}
.folder span {
  color: var(--muted);
  font-size: 12px;
}
.maintenance-item h4 {
  margin: 0 0 10px;
  color: var(--ink);
}
.pending-item {
  margin-bottom: 12px;
  padding: 15px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
}
.btn,
.btn-primary,
.btn-secondary,
.btn-sm,
.add-btn,
.btn-download,
.btn-approve,
.btn-reject,
.btn-pending {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px !important;
  border-radius: 4px !important;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:hover,
.btn-primary:hover,
.btn-sm:hover,
.add-btn:hover,
.btn-download:hover,
.btn-pending:hover {
  box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.24);
  transform: translateY(-1px);
}
.btn,
.btn-primary,
.btn-sm,
.add-btn,
.btn-download,
.btn-pending {
  color: #fff !important;
  background: linear-gradient(90deg, #6656cd, #897de0) !important;
}
.btn-secondary:hover {
  color: var(--primary) !important;
  border-color: rgba(var(--primary-rgb), 0.46) !important;
  background: rgba(var(--primary-rgb), 0.06) !important;
}
.btn-approve {
  color: #fff;
  background: #10b981;
}
.btn-reject {
  color: #fff;
  background: #ef4444;
}
.btn-approve:hover,
.btn-reject:hover {
  filter: brightness(1.07);
}
.edit-btn,
.delete-btn {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}
.edit-btn:hover {
  background: rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), 0.18);
}
.delete-btn {
  color: #ef4444;
}
.delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.18);
}
.badge-pending,
.badge-approved {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
}
.badge-pending {
  color: #b45309;
  background: #fef3c7;
}
.badge-approved {
  color: #047857;
  background: #d1fae5;
}
.positive {
  color: #10b981 !important;
}
.negative {
  color: #ef4444 !important;
}
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .btn-secondary {
  background: var(--panel-alt) !important;
  border-color: #41465b !important;
  color: var(--ink) !important;
}
:root[data-theme="dark"] .field-group > label {
  color: #b8bfd0 !important;
}
:root[data-theme="dark"] .radio-option {
  color: #b8bfd0 !important;
}
.login-page {
  min-height: 100vh;
  padding: 28px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(216, 78, 199, .15), transparent 28%),
    radial-gradient(circle at 88% 88%, rgba(var(--primary-rgb), .18), transparent 34%),
    linear-gradient(145deg, #f7f5ff, #edf2ff 58%, #fff5fa);
  overflow-x: hidden;
}
:root[data-theme="dark"] .login-page {
  background:
    radial-gradient(circle at 12% 10%, rgba(216, 78, 199, .12), transparent 28%),
    radial-gradient(circle at 88% 88%, rgba(var(--primary-rgb), .2), transparent 34%),
    linear-gradient(145deg, #171928, #202237 58%, #241c2b);
}
.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
  width: min(1180px, 100%);
  min-height: calc(100vh - 56px);
  margin: auto;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid rgba(var(--primary-rgb), .14);
  border-radius: 28px;
  box-shadow: 0 32px 80px rgba(45, 42, 90, .17);
}
.login-visual {
  position: relative;
  display: flex;
  min-height: 650px;
  overflow: hidden;
  padding: 42px 48px;
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(circle at 72% 36%, rgba(255,255,255,.18), transparent 27%),
    radial-gradient(circle at 15% 88%, rgba(255, 164, 209, .28), transparent 32%),
    linear-gradient(145deg, #5546bd, #7666dc 55%, #bd5dc4);
}
.login-visual::before,
.login-visual::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
}
.login-visual::before {
  top: -140px;
  right: -110px;
  width: 380px;
  height: 380px;
}
.login-visual::after {
  right: -180px;
  bottom: -240px;
  width: 520px;
  height: 520px;
}
.login-visual-brand {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .03em;
}
.login-visual-brand > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #6556cc;
  background: #fff;
  border-radius: 11px;
}
.login-visual-copy {
  position: relative;
  z-index: 1;
  max-width: 500px;
  margin-top: 52px;
}
.login-eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.login-visual .login-eyebrow {
  color: #f8d8f1;
}
.login-visual-copy h2 {
  margin: 0 0 16px;
  color: #fff;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -.035em;
}
.login-visual-copy p {
  max-width: 470px;
  margin: 0;
  color: rgba(255,255,255,.8);
  font-size: 15px;
  line-height: 1.65;
}
.wealth-illustration {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  height: 260px;
  margin: 22px auto 8px;
}
.wealth-orbit {
  position: absolute;
  border: 1px dashed rgba(255,255,255,.22);
  border-radius: 50%;
}
.orbit-one { inset: 20px 65px 5px; transform: rotate(-10deg); }
.orbit-two { inset: 48px 30px 38px; transform: rotate(16deg); }
.wealth-preview-card {
  position: absolute;
  top: 38px;
  left: 50%;
  width: min(320px, 78%);
  padding: 20px;
  color: #18203a;
  background: rgba(255,255,255,.93);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 22px;
  box-shadow: 0 24px 55px rgba(25, 19, 70, .26);
  transform: translateX(-50%) rotate(-2deg);
  backdrop-filter: blur(12px);
}
.preview-head,
.preview-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.preview-head span,
.preview-balance span { color: #7783a3; font-size: 11px; }
.preview-head b { color: #18a873; font-size: 12px; }
.preview-balance strong { color: #18203a; font-size: 17px; }
.preview-chart {
  display: flex;
  height: 82px;
  gap: 8px;
  align-items: flex-end;
  margin: 18px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #e9eaf4;
}
.preview-chart i {
  flex: 1;
  height: 30%;
  background: linear-gradient(180deg, #d84ec7, #7666dc);
  border-radius: 7px 7px 3px 3px;
  opacity: .82;
}
.preview-chart i:nth-child(2) { height: 45%; }
.preview-chart i:nth-child(3) { height: 38%; }
.preview-chart i:nth-child(4) { height: 64%; }
.preview-chart i:nth-child(5) { height: 56%; }
.preview-chart i:nth-child(6) { height: 76%; }
.preview-chart i:nth-child(7) { height: 92%; }
.floating-metric {
  position: absolute;
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 9px 12px;
  color: #fff;
  background: rgba(30, 25, 78, .43);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  box-shadow: 0 12px 26px rgba(30, 24, 75, .18);
  backdrop-filter: blur(10px);
  font-size: 11px;
  font-weight: 700;
}
.metric-one { top: 22px; right: 10px; }
.metric-two { bottom: 30px; left: 10px; }
.login-trust-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
}
.login-trust-row > span {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 1px 8px;
  align-items: center;
  padding: 11px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
}
.login-trust-row i { grid-row: span 2; color: #ffd5ee; }
.login-trust-row b { font-size: 11px; }
.login-trust-row small { color: rgba(255,255,255,.64); font-size: 9px; }
.login-panel {
  display: grid;
  padding: 36px clamp(32px, 5vw, 64px);
  place-items: center;
}
.login-card {
  width: 100%;
  max-width: 430px;
}
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}
.login-logo .brand-logo {
  width: min(320px, 100%);
  max-height: 122px;
  object-fit: contain;
  object-position: center;
  /* filter: drop-shadow(0 10px 18px rgba(53, 43, 125, .12)); */
}
:root[data-theme="dark"] .login-logo .brand-logo {
  filter: drop-shadow(0 12px 22px rgba(142, 124, 235, .24));
}
.login-card h1 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 29px;
  letter-spacing: -.025em;
}
.login-card-heading > p {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13px;
}
.login-card .input-group {
  margin-bottom: 17px;
}
.login-card .input-group label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}
.login-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.login-label-row a,
.checkbox a {
  color: var(--primary);
  font-size: 11px;
  text-decoration: none;
}
.login-input {
  display: flex;
  min-height: 46px;
  align-items: center;
  padding: 0 13px;
  color: var(--muted);
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.login-input:focus-within {
  background: var(--panel);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .11);
}
.login-input > i { width: 24px; color: var(--primary); }
.login-input input {
  width: 100%;
  min-height: 44px;
  padding: 0 8px;
  color: var(--ink);
  background: transparent !important;
  border: 0 !important;
  outline: 0;
  box-shadow: none !important;
}
.login-input button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.login-captcha-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}
.login-captcha-row > div {
  display: grid;
  flex: 1;
  gap: 5px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), .09), rgba(216,78,199,.08));
  border: 1px dashed rgba(var(--primary-rgb), .28);
  border-radius: 12px;
}
.login-captcha-row span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.login-captcha-row .captcha {
  margin: 0;
  padding: 0;
  color: var(--primary);
  background: transparent;
  text-align: left;
  font-weight: 700;
  letter-spacing: 3px;
}
.login-captcha-row > button {
  width: 48px;
  color: var(--primary);
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.login-card .checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.login-card .checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}
.login-card .checkbox label {
  font-size: 12px;
  text-transform: none;
}
.login-card .btn-login {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: linear-gradient(100deg, #6556cc, #8b76e5 55%, #d84ec7) !important;
  border-radius: 12px !important;
  box-shadow: 0 14px 28px rgba(var(--primary-rgb), .24);
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.login-card .btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(var(--primary-rgb), .3);
}
.login-card .links {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  color: var(--muted);
  font-size: 11px;
}
.login-card .links a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.login-security-note {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 10px;
}
.login-security-note i { color: #16a574; }
.login-theme-switch {
  position: fixed;
  z-index: 10;
  top: 22px;
  right: 22px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--primary);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid rgba(var(--primary-rgb), .15);
  border-radius: 13px;
  box-shadow: 0 12px 28px rgba(36, 31, 81, .13);
  backdrop-filter: blur(12px);
  cursor: pointer;
}
@media (max-width: 980px) {
  .login-page { padding: 18px; }
  .login-shell { grid-template-columns: 1fr; min-height: auto; }
  .login-visual { min-height: 300px; padding: 30px 34px; }
  .login-visual-copy { margin-top: 30px; }
  .login-visual-copy h2 { font-size: 34px; }
  .wealth-illustration { position: absolute; right: 18px; bottom: 5px; width: 43%; height: 210px; opacity: .86; }
  .login-trust-row { width: 54%; margin-top: 28px; }
  .login-panel { padding: 38px; }
}
@media (max-width: 640px) {
  .login-page { padding: 0; background: var(--panel); }
  .login-shell { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .login-visual { min-height: 180px; padding: 26px 22px; border-radius: 0 0 28px 28px; }
  .login-visual-copy { margin-top: 24px; }
  .login-visual-copy h2 { margin-bottom: 8px; font-size: 27px; }
  .login-visual-copy p { max-width: 90%; font-size: 12px; line-height: 1.5; }
  .wealth-illustration,
  .login-trust-row { display: none; }
  .login-panel { padding: 28px 20px 34px; place-items: start center; }
  .login-logo { margin-bottom: 20px; }
  .login-logo .brand-logo { width: min(250px, 88vw); max-height: 96px; }
  .login-card h1 { font-size: 25px; }
  .login-card .links { align-items: flex-start; flex-direction: column; }
  .login-theme-switch { top: 16px; right: 16px; color: #fff; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.2); }
}

/* Professional login refresh */
.login-page {
  display: grid;
  min-height: 100vh;
  padding: 32px;
  background:
    radial-gradient(circle at 15% 12%, rgba(var(--primary-rgb), 0.14), transparent 30%),
    linear-gradient(135deg, #f8f9fd 0%, #eef1f8 52%, #f8f5fb 100%);
}

:root[data-theme="dark"] .login-page,
body[data-theme="dark"].login-page {
  background:
    radial-gradient(circle at 16% 10%, rgba(var(--primary-rgb), 0.16), transparent 30%),
    linear-gradient(135deg, #171a28 0%, #202334 55%, #191b2a 100%);
}

.login-shell {
  grid-template-columns: minmax(360px, 0.9fr) minmax(390px, 0.72fr);
  width: min(1040px, 100%);
  min-height: min(650px, calc(100vh - 64px));
  align-self: center;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(31, 38, 72, 0.14);
  backdrop-filter: blur(18px);
}

:root[data-theme="dark"] .login-shell,
body[data-theme="dark"] .login-shell {
  background: rgba(37, 39, 56, 0.9);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.login-visual {
  min-height: auto;
  padding: clamp(34px, 5vw, 58px);
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(var(--primary-rgb), 0.11), rgba(216, 78, 199, 0.07)),
    var(--panel);
  border-right: 1px solid var(--line);
}

.login-visual::before,
.login-visual::after,
.wealth-illustration,
.floating-metric,
.login-trust-row {
  display: none;
}

.login-visual-brand {
  display: flex;
  align-items: center;
}

.login-visual-brand img {
  width: min(290px, 100%);
  max-height: 112px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 10px 18px rgba(43, 49, 85, 0.08));
}

.login-visual-copy {
  max-width: 430px;
  margin-top: 56px;
}

.login-visual .login-eyebrow {
  color: var(--primary);
}

.login-visual-copy h2 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.13;
  letter-spacing: -0.035em;
}

.login-visual-copy p {
  max-width: 390px;
  color: var(--cell);
  font-size: 14px;
  line-height: 1.7;
}

.login-feature-list {
  display: grid;
  gap: 12px;
  margin-top: 38px;
}

.login-feature-list span {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 12px;
  color: var(--cell);
  background: color-mix(in srgb, var(--panel) 74%, rgba(var(--primary-rgb), 0.12));
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 650;
}

.login-feature-list i {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border-radius: 9px;
}

.login-visual-note {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 12px;
}

.login-panel {
  padding: clamp(34px, 5vw, 58px);
  background: var(--panel);
}

.login-card {
  max-width: 390px;
  padding: 0;
}

.login-card-heading {
  margin-bottom: 28px;
}

.login-card h1 {
  font-size: 32px;
  line-height: 1.1;
}

.login-card-heading > p {
  margin-bottom: 0;
}

.login-card .input-group {
  margin-bottom: 18px;
}

.login-card .input-group label {
  margin-bottom: 8px;
  color: var(--cell);
  font-size: 12px;
  font-weight: 750;
}

.login-input {
  min-height: 48px;
  background: var(--panel);
  border-color: var(--line);
  border-radius: 10px;
}

.login-input input {
  min-height: 46px;
}

.login-card .checkbox {
  align-items: flex-start;
  margin: 4px 0 22px;
}

.login-card .btn-login {
  min-height: 48px;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #6c5dd3, #8d86ed) !important;
  border: 0;
  border-radius: 10px !important;
  box-shadow: 0 12px 24px rgba(var(--primary-rgb), 0.24);
}

.login-card .btn-login:hover {
  transform: translateY(-1px);
}

.login-card .links {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.login-security-note {
  justify-content: flex-start;
  margin-top: 20px;
}

.login-theme-switch {
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
}

@media (max-width: 980px) {
  .login-page {
    padding: 20px;
  }

  .login-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-visual {
    min-height: auto;
    padding: 32px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .login-visual-copy {
    margin-top: 32px;
  }

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

  .login-feature-list span {
    width: auto;
  }

  .login-visual-note {
    margin-top: 28px;
  }

  .login-panel {
    padding: 36px 32px;
  }
}

@media (max-width: 640px) {
  .login-page {
    padding: 0;
    background: var(--panel);
  }

  .login-shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-visual {
    padding: 24px 20px;
    border-radius: 0;
  }

  .login-visual-brand img {
    width: min(230px, 78vw);
  }

  .login-visual-copy {
    margin-top: 22px;
  }

  .login-visual-copy h2 {
    font-size: 26px;
  }

  .login-feature-list {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 22px;
  }

  .login-feature-list span {
    padding: 8px 10px;
    font-size: 12px;
  }

  .login-visual-note {
    display: none;
  }

  .login-panel {
    padding: 28px 20px 34px;
  }

  .login-card h1 {
    font-size: 28px;
  }

  .login-card .links {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-theme-switch {
    color: var(--primary);
    background: color-mix(in srgb, var(--panel) 90%, transparent);
    border-color: rgba(var(--primary-rgb), 0.15);
  }
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .mobile-menu-btn {
    display: block;
    position: fixed;
    z-index: 22;
    top: 14px;
    left: 13px;
    width: 36px;
    height: 36px;
    color: #fff;
    background: var(--primary);
    border: 0;
    border-radius: 4px;
  }
  .sidebar-overlay.active {
    display: block;
    position: fixed;
    z-index: 19;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
  }
  .heading-menu {
    visibility: hidden;
  }
  .top-user span,
  .heading-actions .header-icon[title="Full screen"],
  .heading-actions .header-icon[title="Settings"] {
    display: none;
  }
  .content-heading {
    padding: 8px 10px 8px 55px;
  }
  .content-heading h1 {
    font-size: 14px;
  }
  .heading-actions {
    gap: 3px;
  }
  .header-icon {
    width: 32px;
    height: 32px;
  }
  .top-user {
    margin: 0 2px;
  }
  .page-content {
    padding: 12px 10px 10px;
  }
  .quick-nav {
    min-height: 62px;
    padding: 7px 10px;
  }
  .quick-item {
    min-width: 68px;
  }
  .grid-2,
  .form-grid {
    grid-template-columns: 1fr !important;
  }
}
.dashboard-module {
  padding: 0 2px 2px !important;
}
.rm-dashboard {
  max-width: 1220px;
  margin: 0 auto;
  color: var(--ink);
}
.rm-topline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-bottom: 16px;
}
.rm-topline h2 {
  margin: 0;
  color: var(--ink) !important;
  font-size: 27px;
}
.rm-topline span {
  padding: 7px 12px;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border: 1px solid rgba(var(--primary-rgb), 0.32);
  border-radius: 4px;
  font-size: 12px;
}
.rm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 30px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.rm-kpi-card {
  display: flex;
  min-height: 106px;
  justify-content: space-between;
  gap: 14px;
  padding: 19px 22px;
  background: var(--panel);
  border: 0;
}
.rm-kpi-card.compact {
  grid-column: span 1;
  min-height: 66px;
  align-items: center;
  justify-content: flex-start;
}
.rm-kpi-card:nth-child(6) {
  grid-column: span 2;
}
.rm-kpi-card:nth-child(7) {
  grid-column: span 2;
}
.rm-kpi-card p {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.rm-kpi-card strong {
  display: block;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.12;
}
.rm-kpi-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.rm-kpi-card > i {
  color: var(--primary);
  font-size: 15px;
}
.rm-kpi-card.compact > i {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  background: rgba(var(--primary-rgb), 0.1);
  border-radius: 50%;
}
.rm-tabs {
  display: flex;
  gap: 22px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.rm-tabs button {
  padding: 0 12px 13px;
  color: var(--primary);
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  font-size: 13px;
  font-weight: 700;
}
.rm-tabs button.active {
  color: var(--ink);
  border-bottom-color: var(--primary);
}
.rm-section-title {
  margin: 0 0 22px 8px;
  color: var(--ink) !important;
  font-size: 20px;
}
.rm-summary-grid,
.rm-two-col {
  display: grid;
  gap: 16px;
  grid-template-columns: 2fr 1fr;
  margin-bottom: 16px;
}
.rm-panel,
.rm-small-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.rm-panel {
  min-height: 250px;
  padding: 22px 22px 16px;
}
.rm-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 13px;
}
.rm-panel h4,
.rm-small-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}
.rm-panel h4 span {
  color: var(--primary);
}
.rm-panel header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.rm-panel header button,
.rm-chart-actions button,
.rm-count {
  min-width: 42px;
  padding: 5px 10px;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}
.rm-chart-actions button.light {
  color: var(--muted);
  background: var(--panel-alt);
}
.rm-side-stack {
  display: grid;
  gap: 16px;
  grid-template-rows: repeat(3, 1fr);
}
.rm-small-card {
  position: relative;
  min-height: 125px;
  padding: 24px 20px;
}
.rm-small-card > i {
  position: absolute;
  top: 22px;
  right: 22px;
  color: var(--primary);
  font-size: 26px;
}
.rm-small-card strong {
  display: block;
  margin-top: 18px;
  color: var(--ink);
  font-size: 36px;
  line-height: 1;
  text-align: center;
}
.rm-small-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.rm-small-card p b {
  display: inline-grid;
  min-width: 31px;
  height: 22px;
  margin-right: 6px;
  place-items: center;
  color: #fff;
  background: var(--primary);
  border-radius: 12px;
}
.rm-table-scroll {
  overflow-x: auto;
}
.rm-table-scroll table {
  min-width: 620px;
  width: 100%;
  border-collapse: collapse;
}
.rm-table-scroll th {
  padding: 10px 14px;
  color: #8a9ab4;
  background: transparent;
  border-bottom: 2px solid var(--line);
  font-size: 10px;
  letter-spacing: 0.6px;
  text-align: left;
  text-transform: uppercase;
}
.rm-table-scroll td {
  padding: 13px 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}
.rm-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 9px;
  white-space: nowrap;
}
.rm-pill.green {
  color: #16a55a;
  background: #f4fff8;
  border: 1px solid #23c56b;
}
.chart-panel {
  min-height: 360px;
}
.chart-panel.tall {
  min-height: 390px;
}
.rm-chart-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}
.rm-chart-actions i {
  position: relative;
  display: inline-block;
  width: 29px;
  height: 16px;
  background: var(--primary);
  border-radius: 20px;
}
.rm-chart-actions i::after {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 10px;
  height: 10px;
  content: "";
  background: #fff;
  border-radius: 50%;
}
.rm-chart-box {
  height: 275px;
  padding: 14px 4px 0;
}
.chart-panel.tall .rm-chart-box {
  height: 300px;
}
.rm-corporate-panel {
  min-height: 310px;
}
.rm-corporate-panel select {
  min-width: 130px;
  height: 36px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.rm-empty {
  display: grid;
  min-height: 145px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}
.rm-empty i {
  color: #777;
  font-size: 28px;
}
.rm-empty b,
.rm-empty span {
  display: block;
}
.rm-total {
  display: block;
  color: var(--ink);
  text-align: right;
}
@media (max-width: 1180px) {
  .rm-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rm-kpi-card,
  .rm-kpi-card:nth-child(5),
  .rm-kpi-card:nth-child(8) {
    border: 0;
  }
  .rm-kpi-card:nth-child(6),
  .rm-kpi-card:nth-child(7) {
    grid-column: span 1;
  }
}
@media (max-width: 820px) {
  .rm-topline,
  .rm-panel header {
    flex-direction: column;
  }
  .rm-summary-grid,
  .rm-two-col {
    grid-template-columns: 1fr;
  }
  .rm-kpi-grid {
    margin-bottom: 28px;
  }
}
@media (max-width: 560px) {
  .rm-kpi-grid {
    grid-template-columns: 1fr;
  }
  .rm-kpi-card {
    min-height: auto;
  }
  .rm-topline h2 {
    font-size: 23px;
  }
  .rm-panel {
    padding: 16px 14px;
  }
  .rm-chart-box,
  .chart-panel.tall .rm-chart-box {
    height: 260px;
  }
}
.welcome-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 18px 22px;
  color: #fff;
  background: linear-gradient(105deg, #6755cb, #988be5);
  border-radius: 5px;
  overflow: hidden;
}
.welcome-card h2 {
  margin: 0 0 5px;
  color: #fff !important;
  font-size: 18px;
}
.welcome-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
}
.welcome-illustration {
  display: grid;
  width: 72px;
  height: 58px;
  place-items: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 43px;
}
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 23px;
}
.metric-card {
  position: relative;
  display: flex;
  min-height: 205px;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  overflow: hidden;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.metric-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 15px;
}
.metric-icon {
   display: grid;
    flex: 0 0 34px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 14px;
    box-shadow: none;
    padding: 0.35rem 0.5rem;
    line-height: 1;
}

.metric-icon.purple {
  color: #6553ca !important;
  background: rgba(101, 83, 202, 0.12);
  border-color: rgba(101, 83, 202, 0.22);
}
.metric-icon.orange {
  color: #f58a2c !important;
  background: rgba(245, 138, 44, 0.12);
  border-color: rgba(245, 138, 44, 0.22);
}
.metric-icon.pink {
  color: #d84ec7 !important;
  background: rgba(216, 78, 199, 0.12);
  border-color: rgba(216, 78, 199, 0.22);
}
.metric-icon.blue {
  color: #2d8ee8 !important;
  background: rgba(45, 142, 232, 0.12);
  border-color: rgba(45, 142, 232, 0.22);
}
.metric-icon.green {
  color: #16a978 !important;
  background: rgba(22, 169, 120, 0.12);
  border-color: rgba(22, 169, 120, 0.22);
}
.metric-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}
.metric-badge.success {
  color: #008766;
  background: rgba(16, 185, 129, 0.12);
}
.metric-badge.muted {
  color: var(--cell);
  background: var(--panel-alt);
}
.metric-label,
.metric-card small {
  display: block;
  color: #63729a;
  font-size: 12px;
}
.metric-label {
  margin-bottom: 10px;
  color: var(--cell);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.metric-card strong {
  display: block;
  margin: 0 0 5px;
  color: #071337;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.18;
}
.metric-card small {
  min-height: 18px;
  color: var(--cell);
}
.metric-sparkline {
  position: relative;
  height: 40px;
  margin-top: auto;
  overflow: hidden;
}
.metric-sparkline::before {
  position: absolute;
  inset: 7px 0 0;
  content: "";
  opacity: 0.24;
  clip-path: polygon(0 80%, 12% 68%, 24% 72%, 36% 48%, 49% 54%, 61% 35%, 73% 41%, 85% 25%, 100% 18%, 100% 100%, 0 100%);
}
.metric-sparkline::after {
  position: absolute;
  inset: 0 0 auto;
  height: 32px;
  content: "";
  /* background: currentColor; */
  clip-path: polygon(0 83%, 12% 71%, 24% 75%, 36% 51%, 49% 57%, 61% 38%, 73% 44%, 85% 28%, 100% 21%, 100% 27%, 85% 34%, 73% 50%, 61% 44%, 49% 63%, 36% 57%, 24% 81%, 12% 77%, 0 89%);
}
.metric-sparkline.purple {
  color: #6553ca;
}
.metric-sparkline.orange {
  color: #f58a2c;
}
.metric-sparkline.pink {
  color: #d84ec7;
}
.metric-sparkline.blue {
  color: #2d8ee8;
}
.metric-sparkline.green {
  color: #16a978;
}
.metric-sparkline.purple::before {
  background: linear-gradient(180deg, #6553ca, transparent);
}
.metric-sparkline.orange::before {
  background: linear-gradient(180deg, #f58a2c, transparent);
}
.metric-sparkline.pink::before {
  background: linear-gradient(180deg, #d84ec7, transparent);
}
.metric-sparkline.blue::before {
  background: linear-gradient(180deg, #2d8ee8, transparent);
}
.metric-sparkline.green::before {
  background: linear-gradient(180deg, #16a978, transparent);
}
.dashboard-sub-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: -7px 0 23px;
}
.sub-kpi-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 17px 58px 17px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.sub-kpi-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  content: "";
  background: linear-gradient(180deg, var(--primary), rgba(var(--primary-rgb), 0.38));
}
.sub-kpi-icon {
  position: absolute;
  top: 14px;
  right: 16px;
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.12);
  font-size: 14px;
}
.sub-kpi-card strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}
.sub-kpi-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}
.dashboard-tabs {
  display: flex;
  gap: 8px;
  margin: 6px 0 18px;
  padding: 6px;
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.dashboard-tabs button,
.client-subtabs button,
.card-actions button {
  min-height: 34px;
  padding: 8px 14px;
  color: var(--cell);
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.dashboard-tabs button.active,
.client-subtabs button.active,
.card-actions button.active {
  color: #fff;
  background: linear-gradient(90deg, #6755cb, #9a91e3);
  box-shadow: 0 8px 16px rgba(var(--primary-rgb), 0.22);
}
.dashboard-tabs button:hover,
.client-subtabs button:hover,
.card-actions button:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}
.dashboard-tabs button.active:hover,
.client-subtabs button.active:hover,
.card-actions button.active:hover {
  color: #fff;
}
.dashboard-tab-panel {
  display: none;
}
.dashboard-tab-panel.active {
  display: block;
}
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}
.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
}
.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.section-heading.split {
  align-items: center;
}
.client-subtabs,
.card-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.dashboard-summary-panel {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.9fr);
  gap: 16px;
  margin-bottom: 16px;
}
.pending-card {
  overflow: hidden;
}
.pending-card header {
  position: relative;
  background:
    radial-gradient(circle at top right, rgba(var(--primary-rgb), 0.14), transparent 32%),
    var(--panel);
}
.pending-card .highlight {
  color: var(--primary);
}
.pending-card .table-scroll {
  max-width: 100%;
  max-height: 340px;
  overflow: auto;
  padding: 0 18px 16px;
  overscroll-behavior: contain;
  scrollbar-color: transparent transparent;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.pending-card .table-scroll:hover {
  scrollbar-color: rgba(var(--primary-rgb), 0.42) transparent;
}
.pending-card .table-scroll::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
.pending-card .table-scroll::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}
.pending-card .table-scroll:hover::-webkit-scrollbar-thumb {
  background: rgba(var(--primary-rgb), 0.42);
}
.pending-card table {
  min-width: 820px;
  table-layout: auto;
}
.pending-card th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: var(--panel);
}
.pending-card th,
.pending-card td {
  white-space: nowrap;
}
.pending-card tbody tr:nth-child(even) {
  background: rgba(var(--primary-rgb), 0.035);
}
.pending-card tbody tr:hover {
  background: rgba(var(--primary-rgb), 0.09);
}
.pending-card td:last-child {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
.pending-actions {
  position: relative;
}
.insight-card {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.insight-card:hover {
  box-shadow: 0 14px 28px rgba(37, 45, 82, 0.12);
  transform: translateY(-2px);
}
.dashboard-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 22px;
}
.dashboard-modal.open {
  display: grid;
}
.dashboard-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}
.dashboard-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(82vh, 680px);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}
.dashboard-modal-dialog.large {
  width: min(980px, 100%);
}
.dashboard-modal-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 14px;
}
.dashboard-modal-dialog header h3 {
  margin: 0;
  color: var(--ink) !important;
  font-size: 18px;
}
.dashboard-modal-dialog header button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--cell);
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.modal-table-wrap {
  max-height: 480px;
  margin: 0 24px 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  scrollbar-color: rgba(var(--primary-rgb), 0.48) transparent;
  scrollbar-width: thin;
}
.modal-table-wrap.compact {
  max-height: 320px;
}
.modal-table-wrap table {
  min-width: 760px;
  width: 100%;
}
.modal-table-wrap.compact table {
  min-width: 640px;
}
.modal-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-alt);
}
.modal-table-wrap tbody tr:nth-child(even) {
  background: rgba(var(--primary-rgb), 0.035);
}
.modal-table-wrap tbody tr:hover {
  background: rgba(var(--primary-rgb), 0.09);
}
.modal-table-wrap td {
  vertical-align: middle;
}
.modal-table-wrap td:last-child {
  white-space: nowrap;
}
.dashboard-modal-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px 22px;
  color: var(--muted);
  font-size: 12px;
}
.dashboard-modal-dialog footer select {
  width: auto;
  min-width: 120px;
  border-radius: 10px !important;
}
.modal-table-wrap.empty {
  min-height: 180px;
}
.modal-empty {
  display: grid;
  min-height: 128px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}
.modal-empty i {
  color: #b6c1d3;
  font-size: 30px;
}
.modal-empty b {
  display: block;
  margin-top: 10px;
  text-transform: uppercase;
}
.dashboard-insight-stack {
  display: grid;
  gap: 16px;
  background: #dcd2fb;
  padding: 10px;
  box-shadow: var(--shadow);
}
.insight-card {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  padding: 20px 76px 20px 22px;
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.09), transparent 50%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.insight-card.birthday-today {
  background:
    linear-gradient(135deg, rgba(108, 93, 211, 0.14), rgba(108, 93, 211, 0.03)),
    var(--panel);
}
.insight-card.birthday-next {
  background:
    linear-gradient(135deg, rgba(216, 78, 199, 0.14), rgba(216, 78, 199, 0.03)),
    var(--panel);
}
.insight-card.cash-inflow {
  background:
    linear-gradient(135deg, rgba(22, 169, 120, 0.14), rgba(22, 169, 120, 0.03)),
    var(--panel);
}
.insight-card::after {
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 112px;
  height: 112px;
  content: "";
  background: rgba(var(--primary-rgb), 0.08);
  border-radius: 50%;
}
.insight-card h3 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.insight-card strong {
  display: block;
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.insight-card.birthday-today h3,
.insight-card.birthday-today strong {
  color: #5d50c7;
}
.insight-card.birthday-next h3,
.insight-card.birthday-next strong {
  color: #c744b8;
}
.insight-card.cash-inflow h3,
.insight-card.cash-inflow strong {
  color: #13956d;
}
.insight-card span {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}
.insight-card span b {
  display: inline-grid;
  min-width: 32px;
  height: 24px;
  margin-right: 8px;
  place-items: center;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  font-size: 12px;
}
.insight-card > i {
  position: absolute;
  top: 20px;
  right: 22px;
  z-index: 1;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.12);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  border-radius: 12px;
  font-size: 19px;
}
.insight-card.birthday-next > i {
  color: #c744b8;
  background: rgba(216, 78, 199, 0.13);
  border-color: rgba(216, 78, 199, 0.2);
}
.insight-card.cash-inflow > i {
  color: #13956d;
  background: rgba(22, 169, 120, 0.13);
  border-color: rgba(22, 169, 120, 0.2);
}
.dashboard-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.chart-card {
  min-height: 360px;
  overflow: hidden;
}
.renewal-card {
  min-height: 360px;
}
.renewal-card .table-scroll {
  padding-top: 12px;
}
.count-pill {
  display: inline-grid;
  min-width: 24px;
  height: 20px;
  margin-left: 6px;
  place-items: center;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  font-size: 11px;
}
.client-table-card {
  overflow: hidden;
}
.client-table-toolbar {
  align-items: center !important;
  gap: 16px;
}
.client-search {
  position: relative;
  display: block;
  width: min(360px, 100%);
}
.client-search i {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--muted);
  transform: translateY(-50%);
}
.client-search input {
  min-height: 42px;
  padding-left: 40px !important;
  border-radius: 12px !important;
}
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.toolbar-actions > button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--cell);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.toolbar-actions > button:hover {
  color: var(--primary);
  border-color: rgba(var(--primary-rgb), 0.35);
  background: rgba(var(--primary-rgb), 0.08);
}
.client-table-wrap {
  padding: 0 24px 16px;
}
.client-table-wrap table {
  min-width: 820px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.client-table-wrap td:first-child small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}
.client-table-wrap td:first-child b,
.pending-card td:first-child b {
  font-weight: 600;
}
.client-table-wrap .negative {
  color: #dc2626;
}
.client-table-wrap .neutral {
  color: var(--ink);
}
.client-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--line);
}
.pagination,
.rows-count {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pagination button {
  min-width: 34px;
  height: 34px;
  color: var(--cell);
  background: var(--panel);
  border: 1px solid transparent;
  border-radius: 8px;
}
.pagination button.active {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), 0.25);
}
.pagination button:disabled {
  opacity: 0.45;
}
.rows-count span {
  color: var(--muted);
  font-size: 12px;
}
.rows-count select {
  width: auto;
  min-height: 38px;
  border-radius: 10px !important;
}
.dashboard-row {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.dashboard-primary {
  grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr);
}
.dashboard-secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dashboard-card {
  padding: 0;
  background: var(--panel);
  border: 0;
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.dashboard-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}
.dashboard-card h3 {
  margin: 0;
  color: #071337 !important;
  font-size: 14px;
  font-weight: 700;
}
.dashboard-card header p {
  margin: 4px 0 0;
  font-size: 11px;
}
.dashboard-card header button {
  padding: 7px 10px;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border: 0;
  border-radius: 4px;
  font-size: 11px;
}
.dashboard-card header button:hover {
border: 1px solid var(--primary);
}
.card-menu {
  color: var(--muted);
  font-size: 13px;
}
.earnings-summary {
  display: flex;
  gap: 34px;
  padding: 15px 24px 4px;
}
.earnings-summary span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.earnings-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 16px;
}
.chart-wrap {
  height: 245px;
  padding: 0 16px 12px;
}
.target-card .doughnut-wrap,
.target-card .chart-legend,
.strategy-list,
.activity-list,
.mini-chart-wrap,
.performance-footer {
  margin-left: 17px;
  margin-right: 17px;
}
.doughnut-wrap {
  position: relative;
  height: 225px;
  margin-top: 15px;
}
.doughnut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  text-align: center;
  transform: translate(-50%, -50%);
}
.doughnut-center strong,
.doughnut-center span {
  display: block;
}
.doughnut-center strong {
  font-size: 20px;
}
.doughnut-center span {
  color: var(--muted);
  font-size: 10px;
}
.chart-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding-bottom: 16px;
}
.chart-legend span {
  color: var(--muted);
  font-size: 10px;
}
.chart-legend i,
.performance-footer i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-radius: 50%;
}
.chart-legend .equity {
  background: var(--primary);
}
.chart-legend .debt {
  background: #22c55e;
}
.chart-legend .hybrid {
  background: #355070;
}
.chart-legend .alternate {
  background: #f59e0b;
}
.chart-legend.custom {
  display: inline-flex;
  align-self: center;
  margin: 0 auto 16px;
  padding: 8px 14px;
  gap: 12px;
  background: var(--panel);
  border: 2px solid rgba(var(--primary-rgb), 0.42);
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(var(--primary-rgb), 0.08);
}
.chart-card .chart-legend.custom {
  display: flex;
  width: fit-content;
}
.chart-legend.custom span {
  display: inline-flex;
  align-items: center;
  color: var(--cell);
  font-size: 11px;
  font-weight: 600;
}
.chart-legend.custom i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.chart-legend.custom .aum,
.chart-legend.custom .net {
  background: #6c5dd3;
}
.chart-legend.custom .clients {
  position: relative;
  width: 18px;
  height: 2px;
  background: #6c5dd3;
  border-radius: 4px;
}
.chart-legend.custom .clients::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 6px;
  height: 6px;
  content: "";
  background: #6c5dd3;
  border-radius: 50%;
  transform: translateY(-50%);
}
.chart-legend.custom .purchase {
  background: #a99eef;
}
.chart-legend.custom .redemption {
  background: #7c3aed;
}
.strategy-list {
  padding-bottom: 14px;
}
.strategy-list > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin-top: 14px;
  color: var(--cell);
  font-size: 11px;
}
.strategy-list i {
  height: 5px;
  overflow: hidden;
  background: var(--panel-alt);
  border-radius: 6px;
}
.strategy-list em {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 6px;
}
.strategy-list small {
  color: var(--muted);
  text-align: right;
}
.activity-list {
  padding-bottom: 8px;
}
.activity-list > div {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}
.activity-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  flex: 0 0 10px;
  border-radius: 50%;
}
.activity-dot.green {
  background: #22c55e;
}
.activity-dot.purple {
  background: var(--primary);
}
.activity-dot.orange {
  background: #f59e0b;
}
.activity-dot.blue {
  background: #0ea5e9;
}
.activity-list p {
  margin: 0;
}
.activity-list b,
.activity-list span,
.activity-list small {
  display: block;
}
.activity-list b {
  color: var(--ink);
  font-size: 11px;
}
.activity-list span,
.activity-list small {
  font-size: 10px;
}
.mini-chart-wrap {
  height: 185px;
}
.performance-footer {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding-bottom: 14px;
}
.performance-footer span {
  color: var(--muted);
  font-size: 10px;
}
.performance-footer span:first-child i {
  background: var(--primary);
}
.performance-footer span:last-child i {
  background: #22c55e;
}
.dashboard-mini-stats {
  display: grid;
  gap: 14px;
  padding: 18px 22px 22px;
}
.dashboard-mini-stats > div {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  column-gap: 12px;
  padding: 13px;
  background: var(--panel-alt);
  border-radius: 6px;
}
.dashboard-mini-stats i {
  display: grid;
  width: 42px;
  height: 42px;
  grid-row: span 2;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #6553ca, #a69be6);
  border-radius: 50%;
}
.dashboard-mini-stats strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}
.dashboard-mini-stats span {
  color: var(--muted);
  font-size: 11px;
}
.empty-state {
  display: grid;
  min-height: 130px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}
.empty-state i {
  color: var(--primary);
  font-size: 25px;
}
.empty-state b,
.empty-state span {
  display: block;
}
.analysis-page {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
}
.analysis-page [hidden] {
  display: none !important;
}
.analysis-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  min-width: 0;
}
.analysis-topbar > div:first-child {
  min-width: 0;
}
.analysis-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}
.analysis-breadcrumb i {
  font-size: 9px;
}
.analysis-topbar h2 {
  margin: 0;
  color: var(--ink) !important;
  font-size: 22px;
  font-weight: 700;
}
.analysis-topbar p {
  margin: 5px 0 0;
  font-size: 14px;
}
.analysis-actions {
  display: flex;
  gap: 12px;
  flex: 0 0 auto;
  max-width: 100%;
}
.analysis-actions button {
  min-height: 40px;
  padding: 9px 18px !important;
  white-space: nowrap;
}
.analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 1fr);
  gap: 16px;
  min-width: 0;
}
.analysis-card {
  min-width: 0;
  min-height: 520px;
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.analysis-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
  min-width: 0;
}
.analysis-form-grid .field-group {
  min-width: 0;
}
.analysis-combo {
  position: relative;
  display: flex;
  min-width: 0;
}
.analysis-combo input {
  padding-right: 76px !important;
}
.analysis-combo button {
  position: absolute;
  top: 1px;
  bottom: 1px;
  display: grid;
  width: 38px;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
}
#clearFamilyBtn {
  right: 38px;
  border-left: 1px solid var(--line);
}
#familyDropdownBtn {
  right: 0;
}
.family-search-wrap {
  position: relative;
}
.analysis-suggestions,
.product-menu {
  position: absolute;
  z-index: 15;
  display: none;
  width: 100%;
  max-height: 230px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(30, 38, 65, 0.16);
}
.analysis-suggestions {
  top: calc(100% + 6px);
  left: 0;
}
.analysis-suggestions.open,
.product-menu.open {
  display: block;
}
.analysis-suggestions button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  color: var(--cell);
  background: transparent;
  border: 0;
  text-align: left;
}
.analysis-suggestions button:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
}
.analysis-suggestions span {
  color: var(--muted);
  font-size: 11px;
}
.analysis-multiselect {
  position: relative;
  min-width: 0;
}
.analysis-multiselect > button {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid #d8deea;
  border-radius: 4px;
}
.analysis-multiselect > button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.analysis-multiselect > button i {
  color: var(--muted);
  font-size: 11px;
}
.product-menu {
  top: calc(100% + 6px);
  right: 0;
  width: min(250px, 100%);
  padding: 8px;
}
.product-menu label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 8px;
  color: var(--cell) !important;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.product-menu label:hover {
  background: rgba(var(--primary-rgb), 0.08);
}
.product-menu input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-height: 17px;
}
.product-search {
  position: relative;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  border-radius: 0 !important;
}
.product-search i {
  color: var(--muted);
}
.product-search input {
  min-height: 32px;
  padding: 6px 6px !important;
  border: 0 !important;
  box-shadow: none !important;
}
.selection-name {
  grid-column: 2;
}
.selection-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}
.selection-action-row button {
  min-height: 38px;
  padding-right: 14px !important;
  padding-left: 14px !important;
  white-space: nowrap;
}
.selected-family-chip {
  display: inline-flex;
  margin-top: 18px;
  padding: 6px 14px;
  color: #4b3da8;
  background: linear-gradient(135deg, #f6e8ff, #ffeef9);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.family-empty-state,
.model-empty-state,
.model-result-state {
  display: grid;
  place-items: center;
  text-align: center;
}
.family-empty-state {
  min-height: 340px;
  color: var(--muted);
  font-size: 14px;
}
.family-empty-state i {
  display: none;
}
.family-tree-wrap {
  max-height: 340px;
  margin-top: 52px;
  overflow: auto;
  padding-right: 8px;
  scrollbar-color: rgba(var(--primary-rgb), 0.45) transparent;
  scrollbar-width: thin;
}
.family-tree {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.tree-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  min-width: 0;
  color: var(--ink);
}
.tree-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  color: var(--ink) !important;
  font-size: 13px;
  cursor: pointer;
}
.tree-row label span,
.tree-row label strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-height: 15px;
  accent-color: #ffd21f;
}
.tree-toggle {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-size: 10px;
}
.tree-group {
  margin-left: 22px;
}
.child-row {
  margin-left: 38px;
  color: var(--cell);
}
.child-row label {
  color: var(--cell) !important;
}
.tree-gap {
  display: none;
}
.model-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.model-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}
.model-panel-head h3 {
  min-width: 0;
  margin: 0;
  color: #756756 !important;
  font-size: 18px;
  line-height: 1.35;
}
.model-panel-head label {
  position: relative;
  width: min(260px, 100%);
  flex: 0 0 auto;
  min-width: 0;
}
.model-panel-head label i {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--muted);
  transform: translateY(-50%);
}
.model-panel-head input {
  padding-left: 38px !important;
}
.model-empty-state,
.model-result-state {
  min-height: 385px;
  flex: 1;
  color: var(--cell);
}
.model-empty-state > i,
.model-empty-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  place-items: center;
  color: #a9b1c2;
  background: var(--panel-alt);
  border-radius: 50%;
  font-size: 30px;
}
.model-empty-state h4,
.model-result-state h4 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 18px;
}
.model-empty-state p,
.model-result-state p {
  max-width: 420px;
  margin: 0 auto;
  font-size: 16px;
}
.model-dummy-list {
  display: grid;
  width: min(430px, 100%);
  gap: 10px;
  margin: 26px auto 0;
}
.model-dummy-list > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), rgba(216, 78, 199, 0.05));
  border: 1px solid rgba(var(--primary-rgb), 0.14);
  border-radius: 10px;
}
.model-dummy-list span {
  color: var(--muted);
  font-size: 12px;
}
.model-dummy-list strong {
  color: var(--ink);
  font-size: 12px;
  text-align: right;
}
.tagging-page {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
}
.tagging-topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: start;
  gap: 24px;
  margin-bottom: 22px;
}
.tagging-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 13px;
}
.tagging-breadcrumb i {
  font-size: 9px;
}
.tagging-topbar h2 {
  margin: 0;
  color: var(--ink) !important;
  font-size: 20px;
  font-weight: 700;
}
.tagging-map-btn {
  min-width: 154px;
  min-height: 40px;
  align-self: center;
  white-space: nowrap;
}
.tagging-map-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.tagging-card {
  padding: 0;
}
.tagging-form-grid {
  display: grid;
  grid-template-columns: minmax(240px, 350px) minmax(240px, 350px);
  gap: 16px;
  max-width: 720px;
}
.tagging-select-wrap {
  position: relative;
  min-width: 0;
}
.label-with-tooltip {
  position: relative;
  display: inline-flex !important;
  width: fit-content;
  align-items: center;
  gap: 5px;
}
.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  cursor: help;
}
.tooltip-card {
  position: absolute;
  z-index: 40;
  right: -18px;
  bottom: calc(100% + 10px);
  display: none;
  width: min(390px, 86vw);
  padding: 12px 14px;
  color: #4a3a11;
  background: #fff9db;
  border: 1px solid #f2dc8b;
  border-radius: 6px;
  box-shadow: 0 8px 22px rgba(96, 75, 15, 0.18);
  font-size: 12px;
  line-height: 1.45;
}
.tooltip-card::after {
  position: absolute;
  right: 18px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  content: "";
  background: #fff9db;
  border-right: 1px solid #f2dc8b;
  border-bottom: 1px solid #f2dc8b;
  transform: rotate(45deg);
}
.tooltip-card strong,
.tooltip-card span {
  display: block;
}
.info-tooltip:hover .tooltip-card,
.info-tooltip:focus .tooltip-card,
.info-tooltip:focus-within .tooltip-card {
  display: block;
}
.tagging-combo {
  position: relative;
  display: flex;
  min-width: 0;
}
.tagging-combo input {
  padding-right: 74px !important;
}
.tagging-combo button {
  position: absolute;
  top: 1px;
  bottom: 1px;
  display: grid;
  width: 36px;
  place-items: center;
  color: var(--ink);
  background: transparent;
  border: 0;
}
#clearTagFamilyBtn {
  right: 36px;
  border-left: 1px solid var(--line);
}
#tagFamilyDropdownBtn,
#tagModelDropdownBtn {
  right: 0;
}
.tagging-dropdown {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  display: none;
  width: 100%;
  max-height: 240px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(30, 38, 65, 0.16);
}
.tagging-dropdown.open {
  display: block;
}
.tagging-dropdown button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  color: var(--cell);
  background: transparent;
  border: 0;
  text-align: left;
}
.tagging-dropdown button:hover {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
}
.tagging-dropdown button b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tagging-dropdown button span,
.tagging-dropdown-message {
  color: var(--muted);
  font-size: 11px;
}
.tagging-dropdown-message {
  padding: 14px;
}
.tagging-preview {
  margin-top: 32px;
}
.tagging-empty {
  display: grid;
  min-height: 290px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}
.tagging-empty i {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 12px;
  place-items: center;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border-radius: 50%;
  font-size: 24px;
}
.tagging-empty h3 {
  margin: 0 0 8px;
  color: var(--ink) !important;
  font-size: 18px;
}
.tagging-empty p {
  max-width: 420px;
  margin: 0;
}
.tagging-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.tagging-summary-card,
.tagging-allocation-card {
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), rgba(216, 78, 199, 0.05)),
    var(--panel);
  border: 1px solid rgba(var(--primary-rgb), 0.14);
  border-radius: 12px;
}
.tagging-summary-card span,
.tagging-summary-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.tagging-summary-card strong {
  display: block;
  margin: 8px 0 5px;
  color: var(--ink);
  font-size: 17px;
}
.tagging-allocation-card {
  margin-top: 16px;
}
.tagging-allocation-card h3 {
  margin: 0 0 8px;
  color: var(--ink) !important;
  font-size: 16px;
}
.tagging-allocation-card p {
  margin: 0 0 14px;
}
.allocation-bars {
  display: grid;
  gap: 9px;
}
.allocation-bars span {
  display: block;
  height: 8px;
  background: linear-gradient(90deg, #6c5dd3, #d84ec7);
  border-radius: 999px;
}
.allocation-bars .bar-lg {
  width: 72%;
}
.allocation-bars .bar-md {
  width: 48%;
}
.allocation-bars .bar-sm {
  width: 30%;
}
.fund-compare-page {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
}
.fund-compare-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.fund-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}
.fund-breadcrumb i {
  font-size: 9px;
}
.fund-compare-head h2 {
  margin: 0;
  color: var(--ink) !important;
  font-size: 22px;
}
.fund-compare-head p {
  margin: 5px 0 0;
}
.fund-export-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.fund-export-actions button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}
.fund-export-actions button:hover {
  background: rgba(var(--primary-rgb), 0.16);
}
.fund-selector-card,
.fund-compare-panel,
.fund-performance-panel,
.fund-empty-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.fund-selector-card {
  position: relative;
  z-index: 5;
  margin-bottom: 18px;
  padding: 16px;
}
.fund-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.fund-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.sip_value{
    font-size: 12px;
    color: var(--muted);
    font-weight: unset;
}
.fund-chip button {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  background: transparent;
  border: 0;
}
.fund-chip.red,
.fund-option.red,
.fund-chip.green,
.fund-option.green,
.fund-chip.blue,
.fund-option.blue,
.fund-chip.yellow,
.fund-option.yellow {
  color: var(--primary);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), rgba(216, 78, 199, 0.11));
  border-color: rgba(var(--primary-rgb), 0.25);
}
.fund-select-wrap {
  position: relative;
  width: min(380px, 100%);
}
.fund-select-input {
  width: 100%;
  min-height: 42px;
  padding-right: 42px !important;
  font-size: 14px;
}
.fund-select-arrow {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  display: grid;
  width: 40px;
  place-items: center;
  color: var(--cell);
  background: transparent;
  border: 0;
}
.fund-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: none;
  width: min(620px, calc(100vw - 40px));
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(30, 38, 65, 0.16);
}
.fund-select-menu.open {
  display: grid;
  gap: 8px;
}
.fund-search-message {
  padding: 12px;
  color: var(--muted);
  text-align: center;
}
.fund-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}
#fundChipRow .fas{
    color:#fff;
}
#fundChipRow .fund-chip{
    color: rgb(255, 255, 255);
    background: linear-gradient(135deg, rgb(108, 93, 211), rgb(154, 145, 227));
    border-color: var(--primary);
    box-shadow: 0 8px 16px rgba(var(--primary-rgb), 0.2);
}
.fund-option input {
  width: 16px;
  height: 16px;
  min-height: 16px;
}
.fund-empty-card {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}
.fund-empty-card i {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  place-items: center;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border-radius: 50%;
  font-size: 26px;
}
.fund-empty-card h3 {
  margin: 0 0 8px;
  color: var(--ink) !important;
}
.fund-compare-page [hidden] {
  display: none !important;
}
.fund-compare-panel {
  margin-bottom: 18px;
  padding: 20px;
  overflow: auto;
  scrollbar-color: rgba(var(--primary-rgb), 0.45) transparent;
  scrollbar-width: thin;
}
.fund-compare-panel::-webkit-scrollbar,
.fund-performance-panel::-webkit-scrollbar,
.fund-chip-row::-webkit-scrollbar {
  height: 7px;
}
.fund-compare-panel::-webkit-scrollbar-thumb,
.fund-performance-panel::-webkit-scrollbar-thumb,
.fund-chip-row::-webkit-scrollbar-thumb {
  background: rgba(var(--primary-rgb), 0.36);
  border-radius: 999px;
}
.fund-card-grid,
.fund-detail-grid,
.fund-performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.fund-performance-grid.count-1 {
  grid-template-columns: minmax(260px, 360px);
}
.fund-performance-grid.count-2 {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}
.fund-performance-grid.count-3 {
  grid-template-columns: repeat(3, minmax(260px, 1fr));
}
.fund-performance-grid.count-4 {
  grid-template-columns: repeat(4, minmax(230px, 1fr));
}
.fund-summary-card,
.fund-detail-card,
.fund-performance-card {
  min-width: 0;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 8px 18px rgba(30, 38, 65, 0.08);
}


.fund-performance-card {
  border-top: 4px solid var(--fund-color);
}
.fund-summary-card.red,
.fund-detail-card.red,
.fund-performance-card.red {
  --fund-color: #8071db83;
}
.fund-summary-card.green,
.fund-detail-card.green,
.fund-performance-card.green {
  --fund-color: #ec77df98;
}
.fund-summary-card.blue,
.fund-detail-card.blue,
.fund-performance-card.blue {
  --fund-color: #9a91e3;
}
.fund-summary-card.yellow,
.fund-detail-card.yellow,
.fund-performance-card.yellow {
  --fund-color: #f7bae1;
}
.fund-summary-card h3,
.fund-detail-card h3,
.fund-performance-card h3 {
  min-height: 42px;
  margin: 0 0 14px;
  color: var(--cell) !important;
  font-size: 13px;
  text-align: center;
  font-weight: 600;
}
.fund-rating,
.fund-fees {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.fund-rating {
  align-items: center;
  margin-bottom: 18px;
}
.fund-rating b {
  padding: 5px 9px;
  background: var(--panel-alt);
  border-radius: 999px;
  font-size: 11px;
}
.fund-rating span {
  color: #cbd5e1;
}
.fund-rating .active {
  color: #facc15;
}
.fund-fees,
.fund-summary-card p {
  color: var(--cell);
  font-size: 12px;
}
.fund-summary-card p {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.fund-detail-grid {
  margin-top: 16px;
}
.fund-detail-card {
  min-height: 620px;
}
.mini-donut-row {
  display: grid;
  grid-template-columns: 1fr 82px;
  align-items: center;
  gap: 10px;
  margin: 20px 0 28px;
}
.mini-donut-row.second {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.legend-list {
  display: grid;
  gap: 5px;
  color: var(--cell);
  font-size: 10px;
}
.legend-list i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
}
.legend-list .coral {
  background: #6c5dd3;
}
.legend-list .teal {
  background: #d84ec7;
}
.legend-list .navy {
  background: #f3a9d8;
}
.dynamic-donut {
  width: 76px;
  height: 76px;
  transform: rotate(-90deg);
}
.sector-list {
  display: grid;
  gap: 10px;
}
.sector-row span {
  display: block;
  margin-bottom: 4px;
  color: var(--cell);
  font-size: 11px;
}
.sector-row i {
  display: block;
  height: 7px;
  overflow: hidden;
  background: #e7ebf2;
  border-radius: 999px;
}
.sector-row em {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6c5dd3, hwb(263 68% 2%));
  border-radius: 999px;
}
.fund-performance-panel {
  padding: 20px;
  overflow: auto;
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.05), rgba(216, 78, 199, 0.04)),
    var(--panel);
  scrollbar-color: rgba(var(--primary-rgb), 0.45) transparent;
  scrollbar-width: thin;
}
.fund-performance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.fund-performance-head h3 {
  margin: 0;
  color: var(--ink) !important;
  font-size: 16px;
  font-weight: 800;
}
.period-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: rgba(var(--primary-rgb), 0.06);
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  border-radius: 10px;
}
.period-tabs button {
  min-width: 34px;
  min-height: 34px;
  color: var(--primary);
  background: var(--panel);
  border: 1px solid rgba(var(--primary-rgb), 0.15);
  border-radius: 4px;
  font-weight: 500;
  font-size: 12px;
}
.period-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, #6c5dd3, #9a91e3);
  border-color: var(--primary);
  box-shadow: 0 8px 16px rgba(var(--primary-rgb), 0.2);
}
.fund-performance-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(var(--primary-rgb), 0.08), rgba(216, 78, 199, 0.06) 48%, rgba(255, 255, 255, 0) 100%),
    var(--panel);
  border-radius: 12px;
}
.fund-performance-card::after {
  position: absolute;
  right: -34px;
  bottom: -40px;
  width: 118px;
  height: 118px;
  content: "";
  background: rgba(var(--primary-rgb), 0.06);
  border-radius: 50%;
}
.fund-performance-card > * {
  position: relative;
  z-index: 1;
}
.return-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.return-line span {
  color: var(--cell);
  font-size: 11px;
}
.return-line strong {
  color: var(--primary);
  font-size: 18px;
}
.return-line.positive strong,
.sip-block b:last-child,
.sip-block p b {
  color: var(--primary);
}
.return-line.negative strong {
  color: #d84ec7;
}
.range-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}
.range-line i {
  height: 7px;
  overflow: hidden;
  background: rgba(var(--primary-rgb), 0.12);
  border-radius: 999px;
}
.range-line em {
  display: block;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, #6c5dd3, #d5c3f9);
  border-radius: 999px;
}
.range-line em.bad {
  width: 28%;
  background: linear-gradient(90deg, #d84ec7, #f3a9d8);
}
.sip-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--primary-rgb), 0.14);
}
.sip-block span,
.sip-block p {
  color: var(--cell);
  font-size: 11px;
}
.sip-block div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}
.sip-block strong {
  color: var(--ink);
}
.spark-row {
  display: flex;
  gap: 5px;
  margin: 18px 0 12px;
}
.spark-row i {
  width: 10px;
  height: 10px;
  border-radius: 4px;
}
.spark-row .green {
  background: #6c5dd3;
}
.spark-row .red {
  background: #f3a9d8;
}
.risk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  color: var(--cell);
  font-size: 11px;
}
.risk-grid span {
  padding: 7px 8px;
  background: rgba(var(--primary-rgb), 0.06);
  border: 1px solid rgba(var(--primary-rgb), 0.09);
  border-radius: 8px;
}
.risk-grid b {
  color: var(--ink);
}
.transaction-card {
  margin-bottom: 2px;
}
.table-scroll {
  overflow-x: auto;
  padding: 0 18px 12px;
}
.status {
  padding: 4px 9px;
  border-radius: 12px;
  font-size: 10px;
}
.status.success {
  color: #15803d;
  background: #dcfce7;
}
.status.pending {
  color: #b45309;
  background: #fef3c7;
}
.status.danger {
  color: #b91c1c;
  background: #fee2e2;
}
@media (max-width: 1100px) {
  .dashboard-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-sub-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-summary-panel {
    grid-template-columns: 1fr;
  }
  .dashboard-chart-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-insight-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .dashboard-secondary {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-secondary .dashboard-card:last-child {
    grid-column: 1/-1;
  }
}
@media (max-width: 900px) {
  .dashboard-insight-stack {
    grid-template-columns: 1fr;
  }
  .dashboard-modal {
    padding: 14px;
  }
  .dashboard-modal-dialog {
    width: min(100%, 720px);
    max-height: 88vh;
  }
  .modal-table-wrap {
    max-height: 58vh;
    margin-right: 16px;
    margin-left: 16px;
  }
  .dashboard-modal-dialog header,
  .dashboard-modal-dialog footer {
    padding-right: 16px;
    padding-left: 16px;
  }
}
@media (hover: none) {
  .pending-card .table-scroll {
    scrollbar-color: rgba(var(--primary-rgb), 0.35) transparent;
  }
  .pending-card .table-scroll::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.35);
  }
}
@media (max-width: 700px) {
  .dashboard-kpis,
  .dashboard-sub-kpis,
  .dashboard-insight-stack,
  .dashboard-primary,
  .dashboard-secondary {
    grid-template-columns: 1fr;
  }
  .dashboard-secondary .dashboard-card:last-child {
    grid-column: auto;
  }
  .welcome-card {
    padding: 15px;
  }
  .welcome-illustration {
    display: none;
  }
  .earnings-summary {
    flex-wrap: wrap;
    gap: 17px;
  }
  .dashboard-card header {
    gap: 10px;
    padding: 14px 16px;
  }
  .section-heading,
  .section-heading.split,
  .client-table-toolbar,
  .client-table-footer {
    align-items: stretch !important;
    flex-direction: column;
  }
  .client-subtabs,
  .toolbar-actions,
  .rows-count {
    width: 100%;
    overflow-x: auto;
  }
  .toolbar-actions {
    margin-left: 0;
  }
  .client-table-wrap {
    padding: 0 12px 14px;
  }
  .pending-card .table-scroll {
    max-height: 300px;
    padding: 0 12px 14px;
    overflow: auto;
  }
  .pending-card table {
    display: table;
    min-width: 820px;
    width: 820px;
  }
  .pending-card thead {
    display: table-header-group;
  }
  .pending-card tbody {
    display: table-row-group;
  }
  .pending-card tr {
    display: table-row;
  }
  .pending-card td,
  .pending-card th {
    display: table-cell;
    width: auto;
    white-space: nowrap;
  }
  .insight-card {
    min-height: 118px;
    padding: 18px 70px 18px 18px;
  }
  .dashboard-modal {
    align-items: end;
    padding: 10px;
  }
  .dashboard-modal-dialog {
    width: 100%;
    max-height: 92vh;
    border-radius: 16px;
  }
  .dashboard-modal-dialog header {
    padding-top: 16px;
  }
  .dashboard-modal-dialog header h3 {
    font-size: 16px;
  }
  .modal-table-wrap {
    max-height: 56vh;
    margin: 0 12px 14px;
  }
  .modal-table-wrap table {
    min-width: 680px;
  }
  .modal-table-wrap.compact table {
    min-width: 620px;
  }
  .dashboard-modal-dialog footer {
    align-items: stretch;
    flex-direction: column;
    padding-top: 10px;
  }
  .dashboard-modal-dialog footer select {
    width: 100%;
  }
  .dashboard-card header button {
    white-space: nowrap;
  }
  .chart-wrap {
    height: 220px;
  }
  .doughnut-wrap {
    height: 205px;
  }
  .metric-card {
    min-height: 120px;
    padding: 18px;
  }
}
@media (max-width: 480px) {
  .content-heading p {
    display: none;
  }
  .header-dropdown {
    right: 10px;
    left: 10px;
    width: auto;
  }
  .metric-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 15px;
  }
  .metric-card strong {
    font-size: 19px;
  }
  .pending-card table {
    min-width: 760px;
    width: 760px;
  }
  .modal-table-wrap table,
  .modal-table-wrap.compact table {
    min-width: 560px;
  }
  .dashboard-modal-dialog header button {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
  }
  .dashboard-card header {
    flex-direction: column;
  }
  .table-scroll {
    padding: 0 10px 12px;
  }
}
:root[data-theme="dark"] .metric-card strong,
:root[data-theme="dark"] .dashboard-card h3 {
  color: var(--ink) !important;
}
:root[data-theme="dark"] .metric-card .metric-label,
:root[data-theme="dark"] .metric-card small {
  color: var(--muted);
}
body[data-theme="dark"] .quick-nav,
body[data-theme="dark"] .content-heading {
  background: var(--panel);
}
@media (max-width: 1180px) {
  .analysis-layout {
    grid-template-columns: 1fr;
  }
  .analysis-card {
    min-height: auto;
  }
  .tagging-topbar {
    grid-template-columns: 1fr auto;
  }
  .tagging-map-btn {
    justify-self: end;
  }
  .tagging-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fund-card-grid,
  .fund-detail-grid,
  .fund-performance-grid {
    grid-template-columns: repeat(4, 230px);
    min-width: max-content;
  }
  .fund-compare-panel,
  .fund-performance-panel {
    -webkit-overflow-scrolling: touch;
  }
}
@media (max-width: 900px) {
  .analysis-topbar {
    align-items: stretch;
    flex-direction: column;
  }
  .analysis-actions {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .analysis-actions::-webkit-scrollbar {
    display: none;
  }
  .analysis-form-grid {
    grid-template-columns: 1fr;
  }
  .selection-name {
    grid-column: auto;
  }
  .model-panel-head {
    align-items: stretch;
    flex-direction: column;
  }
  .model-panel-head label {
    width: 100%;
  }
  .family-tree-wrap {
    margin-top: 28px;
  }
  .tagging-form-grid {
    grid-template-columns: 1fr;
    max-width: none;
  }
  .tagging-topbar {
    grid-template-columns: 1fr;
  }
  .tagging-map-btn {
    width: 100%;
    justify-self: stretch;
  }
  .info-tooltip {
    position: static;
  }
  .tooltip-card {
    top: calc(100% + 8px);
    bottom: auto;
    left: 0;
    right: auto;
    width: min(360px, calc(100vw - 52px));
  }
  .tooltip-card::after {
    top: -7px;
    bottom: auto;
    left: 92px;
    right: auto;
    border: 0;
    border-top: 1px solid #f2dc8b;
    border-left: 1px solid #f2dc8b;
  }
  .fund-compare-head,
  .fund-performance-head {
    align-items: stretch;
    flex-direction: column;
  }
  .fund-export-actions,
  .period-tabs {
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .fund-export-actions::-webkit-scrollbar,
  .period-tabs::-webkit-scrollbar {
    display: none;
  }
  .fund-select-wrap {
    width: 100%;
  }
  .fund-select-menu {
    width: 100%;
  }
}
@media (max-width: 700px) {
  .analysis-page {
    overflow: visible;
  }
  .analysis-actions {
    width: 100%;
  }
  .analysis-actions button {
    flex: 1 0 calc(50% - 6px);
    justify-content: center;
  }
  .analysis-card {
    padding: 18px;
  }
  .analysis-suggestions,
  .product-menu {
    max-height: 210px;
  }
  .family-tree-wrap {
    max-height: 360px;
    overflow: auto;
    padding-bottom: 8px;
  }
  .model-empty-state,
  .model-result-state {
    min-height: 290px;
  }
  .model-empty-state p,
  .model-result-state p {
    font-size: 14px;
  }
  .tagging-breadcrumb {
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
  }
  .tooltip-card {
    left: 0;
    width: min(330px, calc(100vw - 44px));
    font-size: 11px;
  }
  .tooltip-card::after {
    left: 82px;
  }
  .tagging-dropdown {
    max-height: 210px;
  }
  .tagging-preview-grid {
    grid-template-columns: 1fr;
  }
  .tagging-empty {
    min-height: 220px;
  }
  .fund-selector-card,
  .fund-compare-panel,
  .fund-performance-panel,
  .fund-empty-card {
    border-radius: 8px;
  }
  .fund-selector-card,
  .fund-compare-panel,
  .fund-performance-panel {
    padding: 14px;
  }
  .fund-chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-color: rgba(var(--primary-rgb), 0.4) transparent;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .fund-chip {
    max-width: 260px;
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .fund-chip {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .fund-card-grid,
  .fund-detail-grid,
  .fund-performance-grid {
    grid-template-columns: repeat(4, 220px);
  }
  .fund-detail-card {
    min-height: 600px;
  }
}
@media (max-width: 480px) {
  .analysis-breadcrumb {
    font-size: 12px;
  }
  .analysis-topbar h2 {
    font-size: 19px;
  }
  .analysis-topbar p {
    font-size: 13px;
  }
  .analysis-card {
    padding: 14px;
    border-radius: 8px;
  }
  .analysis-actions {
    flex-direction: column;
  }
  .analysis-actions button {
    width: 100%;
  }
  .selection-action-row {
    grid-template-columns: 1fr;
  }
  .selection-action-row button {
    width: 100%;
  }
  .analysis-combo input {
    padding-right: 70px !important;
  }
  .analysis-combo button {
    width: 34px;
  }
  #clearFamilyBtn {
    right: 34px;
  }
  .family-tree {
    min-width: 520px;
  }
  .tree-row label {
    font-size: 12px;
  }
  .tree-group,
  .child-row {
    margin-left: 14px;
  }
  .model-dummy-list > div {
    align-items: flex-start;
    flex-direction: column;
  }
  .model-dummy-list strong {
    text-align: left;
  }
  .tagging-topbar h2 {
    font-size: 18px;
  }
  .tagging-combo input {
    padding-right: 68px !important;
  }
  .tagging-combo button {
    width: 34px;
  }
  #clearTagFamilyBtn {
    right: 34px;
  }
  .tagging-dropdown button {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .tagging-summary-card strong {
    font-size: 15px;
  }
  .fund-compare-head h2 {
    font-size: 19px;
  }
  .fund-export-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .fund-export-actions button {
    justify-content: center;
    padding-right: 8px;
    padding-left: 8px;
    min-width: 0;
    font-size: 11px;
  }
  .fund-select-menu {
    max-height: 240px;
  }
  .fund-empty-card {
    min-height: 220px;
    padding: 22px 14px;
  }
  .fund-card-grid,
  .fund-detail-grid,
  .fund-performance-grid {
    grid-template-columns: repeat(4, minmax(210px, 78vw));
  }
  .mini-donut-row {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .legend-list {
    justify-self: stretch;
  }
}

/* Fund Details */
.fund-details-page {
  display: grid;
  gap: 14px;
  color: var(--ink);
}

.fund-details-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: stretch;
}

.fund-details-top select {
  width: min(420px, 100%);
  min-height: 38px;
  margin-bottom: 12px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.fund-details-top h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.fund-nav-box,
.fund-risk-box {
  min-width: 190px;
}

.fund-mini-stat {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 86px;
  padding: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 100%, rgba(255, 255, 255, 0.42), transparent 28%),
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.11), rgba(216, 78, 199, 0.08)),
    var(--panel);
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(30, 38, 65, 0.08);
}

.fund-mini-stat::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -24px;
  width: 80px;
  height: 80px;
  background: rgba(var(--primary-rgb), 0.07);
  border-radius: 50%;
}

.fund-mini-icon {
  position: relative;
    z-index: 1;
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    color: #ffffff;
    background: #09ad95;
    border-radius: 6px;
    font-size: 22px;
}

.fund-mini-icon.risk {
  color: #fff;
  background:#f82649;
    
}

.fund-mini-stat > div {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.fund-mini-stat span:not(.fund-mini-icon) {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.fund-mini-stat strong {
  display: block;
  margin: 5px 0 2px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.05;
}

.fund-nav-box small {
  color: #0aa36c;
  font-weight: 700;
}

.fund-risk-box small {
  color: var(--muted);
  font-weight: 600;
}

.fund-details-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
}

.fund-left-column {
  display: grid;
  align-self: start;
  gap: 14px;
}

.fund-facts-card,
.fund-card {
  background:
    linear-gradient(145deg, rgba(var(--primary-rgb), 0.05), rgba(216, 78, 199, 0.035)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.fund-facts-card {
  display: grid;
  gap: 0;
  padding: 8px;
}

.fund-fact-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}

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

.fund-fact-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border-radius: 50%;
}

.fund-fact-row small,
.return-tile span,
.portfolio-kpi span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.fund-fact-row strong,
.portfolio-kpi strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 13px;
}

.fund-details-main {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.fund-card {
  min-width: 0;
  padding: 16px;
}

.fund-card > header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.fund-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.fund-card h3 i {
  margin-right: 7px;
  color: var(--primary);
}

.nav-movement-head {
  align-items: flex-start;
}

.nav-movement-head h3 {
  display: flex;
  gap: 8px;
  align-items: center;
  text-transform: uppercase;
}

.fund-title-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #fff;
  background: var(--primary);
  border-radius: 5px;
  font-size: 12px;
}

.fund-title-icon i {
  margin: 0 !important;
  color: #fff !important;
}

.nav-movement-head h3 b {
  padding: 4px 8px;
  color: #07966d;
  background: #daf8ed;
  border-radius: 999px;
  font-size: 11px;
  text-transform: none;
}

.nav-zoom-toolbar {
  display: flex;
  max-width: 100%;
  gap: 5px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.nav-zoom-toolbar span {
  flex: 0 0 auto;
  color: var(--ink) !important;
  font-size: 12px !important;
}

.nav-zoom-toolbar button {
  flex: 0 0 auto;
  min-width: 36px;
  min-height: 36px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}

.nav-zoom-toolbar button.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.fund-card header span {
  color: var(--muted);
  font-size: 12px;
}

.returns-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(92px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.return-tile {
  padding: 8px;
  /* background: var(--panel-alt); */
  border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
}

.return-tile strong {
  display: block;
  margin: 0;
  color: #08a66d;
  font-size: 15px;
}

.return-tile.negative strong {
  color: #ef4444;
}

.return-tile small {
  color: var(--muted);
  font-size: 10px;
}

.chart-card-inner {
  min-height: 280px;
}

.chart-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.chart-title-row h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.mini-period-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.mini-period-tabs button {
  min-width: 34px;
  min-height: 26px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
}

.mini-period-tabs button.active {
  color: #fff;
  background: var(--primary);
}

.yellow-tabs {
  background: transparent;
  border: 0;
}

.yellow-tabs button {
  min-width: 34px;
  min-height: 34px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
}

.yellow-tabs button.active {
  color: #fff;
    background: #6c5dd3;
    border-color: #6656d5;
}

.fund-range-brush {
  position: relative;
  height: 34px;
  margin: 6px auto 10px;
  overflow: visible;
  max-width: 860px;
  background: transparent;
}

.draggable-brush {
  border-radius: 2px;
}

.brush-track,
.brush-window {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brush-track {
    right: 4px;
    bottom: 5px;
    left: 4px;
    border-radius: 4px;
    height: 12px;
    background: #f2f3f9;
}

.brush-window {
  top: 18px;
  height: 10px;
  background: #6259ca;
  cursor: grab;
  user-select: none;
  touch-action: none;
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
  z-index: 2;
}

.brush-window em {
  font-style: normal;
  pointer-events: none;
}

.brush-handle {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 18px;
  background: #6259ca;
  border: 1px solid #fff;
  border-radius: 3px;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.brush-handle.left {
  left: -5px;
}

.brush-handle.right {
  right: -5px;
}

.fund-range-brush.dragging .brush-window {
  cursor: grabbing;
}

.compact-brush {
  height: 28px;
  max-width: 560px;
  margin-top: 2px;
}

.compact-brush .brush-track {
  bottom: 7px;
  height: 12px;
  background: #f2f3f9;
 
}

.compact-brush .brush-window {
  top: 10px;
  height: 10px;
  background: #6259ca;
  color: #fff;
}

.compact-brush .brush-handle {
  width: 6px;
  height: 18px;
  background: #6656d5;
  border: 0;
  border-radius: 0;
}

.rolling-section > header {
  align-items: flex-start;
}

.rolling-section h3 {
  letter-spacing: .02em;
}

.rolling-section header span {
  display: block;
  margin-top: 5px;
}

.chart-inline-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  align-items: center;
  color: var(--ink);
  font-size: 12px;
}

.chart-inline-legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.fund-dot {
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
}

.peer-line {
  width: 14px;
  height: 2px;
  background: var(--ink);
}

.fund-card canvas,
.alpha-card canvas {
  width: 100% !important;
  height: 240px !important;
}

.fund-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.fund-stat-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.fund-stat-table div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.fund-stat-table div:last-child {
  border-bottom: 0;
}

.fund-stat-table span {
  color: var(--muted);
  font-size: 13px;
}

.fund-stat-table strong {
  color: var(--ink);
  font-size: 13px;
}

.fund-two-col .fund-card {
  overflow: hidden;
}

.fund-two-col .fund-card canvas {
  height: 220px !important;
}

.risk-chart-card canvas {
  display: block !important;
  max-width: 760px;
  height: 300px !important;
  margin: 0 auto;
}

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

.alpha-card {
  min-width: 0;
  padding: 12px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.alpha-card h4 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.portfolio-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
}

.portfolio-kpi {
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(216, 78, 199, 0.08)),
    var(--panel-alt);
  border: 1px solid rgba(var(--primary-rgb), 0.16);
  border-radius: 12px;
}

.allocation-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: center;
  justify-items: center;
}

.sector-chart-box {
  display: grid;
  width: 285px !important;
  max-width: 100%;
  height: 285px !important;
  place-items: center;
  margin: 18px auto 8px;
}

.sector-chart-box canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 1 / 1;
}

.allocation-list {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 34px;
}

.allocation-pill {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 13px;
}

.allocation-pill i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.allocation-pill:nth-child(1) i { background: #2f9f93; }
.allocation-pill:nth-child(2) i { background: #2fbf4a; }
.allocation-pill:nth-child(3) i { background: #ec6b50; }
.allocation-pill:nth-child(4) i { background: #f4a35d; }
.allocation-pill:nth-child(5) i { background: #8f56df; }
.allocation-pill:nth-child(6) i { background: #274b5a; }
.allocation-pill:nth-child(7) i { background: #e85abb; }
.allocation-pill:nth-child(8) i { background: #ecc85f; }

.allocation-pill strong {
  color: var(--muted);
  font-weight: 500;
}

.constituent-table table {
  width: 100%;
  border-collapse: collapse;
}

.constituent-table th,
.constituent-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.constituent-table th {
  color: var(--muted);
  background: var(--panel-alt);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.tag-chip {
  display: inline-flex;
  padding: 5px 9px;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.constituent-pagination {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.constituent-pagination button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border: 1px solid rgba(var(--primary-rgb), 0.16);
  border-radius: 8px;
  cursor: pointer;
}

.constituent-pagination button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.constituent-pagination span {
  color: var(--ink);
  font-weight: 700;
}

.constituent-pagination small {
  margin-left: auto;
  color: var(--muted);
}

.holding-allocation-card {
  position: relative;
  overflow: hidden;
}

.holding-allocation-card > p {
  margin: 0 0 18px;
  color: #7b5f5f;
  line-height: 1.45;
}

.holding-allocation-card header {
  margin-bottom: 28px;
}

.holding-allocation-card h3 {
  font-size: 18px;
}

.allocation-bar-list {
  display: grid;
  gap: 20px;
}

.holding-allocation-row {
  display: grid;
  gap: 6px;
}

.holding-allocation-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.holding-allocation-track {
  position: relative;
  height: 44px;
  overflow: hidden;
  background: rgba(var(--primary-rgb), 0.06);
}

.holding-allocation-fill {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  height: 100%;
  /* background:linear-gradient(90deg, #6755cb, #9a91e3); */
      background-color: #e5a623;
    border-color: #e5a623;
}

.holding-allocation-fill.fill-2 {
  background: #09ad95 ;
}

.holding-allocation-fill.fill-3 {
  background: #f3a9d8;
}

.buy-fund-fab,
.fund-plus-fab {
  position: fixed;
  z-index: 20;
  right: 24px;
  border: 0;
  box-shadow: 0 10px 26px rgba(30, 38, 65, 0.18);
  cursor: pointer;
}

.buy-fund-fab {
  bottom: 96px;
  display: inline-flex;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 0 22px;
  color: var(--ink);
  background: var(--panel);
  border-radius: 10px;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.buy-fund-fab i {
  color: #17a757;
}

.buy-fund-fab.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(.96);
  pointer-events: none;
}

.fund-plus-fab {
  bottom: 36px;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #fff;
 background-image: linear-gradient(to bottom right, #6259ca 0%, #6259ca 100%);
  border-radius: 50%;
  font-size: 18px;
}

.fund-purchase-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.fund-purchase-modal.open {
  display: flex;
}

.fund-purchase-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
}

.fund-purchase-dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.fund-purchase-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.fund-purchase-dialog h2 {
  margin: 0 34px 8px 0;
  color: var(--ink);
  font-size: 24px;
}

.fund-purchase-dialog > p {
  margin: 0 0 10px;
  color: var(--muted);
}

.purchase-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.purchase-meta span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.purchase-meta b {
  color: var(--muted);
}

.purchase-summary-card {
  padding: 14px;
  background: var(--panel-alt);
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  border-radius: 10px;
}

.purchase-summary-card h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.4;
}

.purchase-summary-card small,
.purchase-summary-grid span,
.purchase-field span {
  color: var(--muted);
}

.purchase-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 14px;
  align-items: center;
  margin-top: 12px;
}

.purchase-summary-grid strong {
  color: var(--ink);
  text-align: right;
}

.positive-pill,
.risk-pill {
  display: inline-flex;
  justify-self: end;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
}

.positive-pill {
  color: #087f5b !important;
  background: #d8f8e8;
}

.risk-pill {
  color: #b45309 !important;
  background: #ffedd5;
}

.success-text {
  color: #0aa36c !important;
}

.purchase-field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.purchase-field select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.fund-purchase-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

/* Fund Picker */
.fund-picker-page {
  position: relative;
  display: grid;
  gap: 18px;
  color: var(--ink);
}

.fund-picker-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.fund-picker-head h2 {
  margin: 0;
  font-size: 22px;
}

.fund-picker-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.fund-picker-mobile-filter {
  display: none;
}

.fund-picker-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.fund-info-note {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  background: var(--panel);
  border-radius: 3px;
  box-shadow: var(--shadow);
}

.fund-info-note.blue {
  border-left: 3px solid #4080ff;
}

.fund-info-note.green {
  border-left: 3px solid #2ec66d;
  background: linear-gradient(90deg, rgba(46, 198, 109, 0.08), transparent), var(--panel);
}

.fund-info-note b {
  color: var(--ink);
}

.fund-info-note span {
  color: var(--muted);
  font-size: 12px;
}

.fund-picker-toolbar {
  display: grid;
  grid-template-columns: minmax(270px, 1.2fr) minmax(220px, .8fr) 220px;
  gap: 10px;
  align-items: stretch;
}

.fund-multi-select,
.fund-picker-search,
.fund-compare-button {
  min-height: 48px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.fund-multi-select {
  position: relative;
  display: flex;
  align-items: center;
  padding: 7px 42px 7px 10px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.fund-multi-select:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.14);
}

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

.fund-chip-row.outside {
  min-height: 0;
  margin: -2px 0 12px;
}

.fund-chip-row.outside:empty {
  display: none;
}

.fund-multi-select select {
  width: 100%;
  min-height: 34px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 14px;
}

.fund-multi-select select option {
  color: var(--ink);
  background: var(--panel);
}

.fund-multi-select select option:checked {
  color: #fff;
  background: var(--primary);
}

.fund-filter-chip {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 6px 9px;
  color: var(--panel);
  background: linear-gradient(90deg, #6755cb, #9a91e3);
  font-size: 12px;
  border-radius: 20px;
  font-weight: 500;
}
.fund-filter-chip i {
  color: var(--panel);
}
.fund-filter-chip button,
.fund-picker-clear {
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.fund-picker-clear {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.fund-picker-clear {
  right: 10px;
}

.fund-picker-search {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 14px;
}

.fund-picker-search i {
  color: var(--muted);
}
#fundSummaryGrid .fund-summary-card{
  padding: 14px;
}
.fund-picker-search input {
  width: 100%;
  min-height: 42px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.fund-compare-button {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), 0.18);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.fund-compare-button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(var(--primary-rgb), 0.18);
}

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

.fund-summary-card {
  padding: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.fund-summary-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.fund-summary-top h3 {
  margin: 0;
  font-size: 16px;
}

.fund-summary-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.rating-scale,
.fund-summary-actions button {
  display: inline-flex;
  min-height: 38px;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}
#toggleFundFilters i, .fa-sliders{
  color: var(--primary);
}
.rating-scale {
  color: var(--muted);
  font-size: 13px;
}

.rating-scale i,
.return-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.rating-scale .red { background: #f05252; }
.rating-scale .orange,
.return-dot.orange { background: #fb923c; }
.rating-scale .yellow,
.return-dot.yellow { background: #facc15; }
.rating-scale .lime,
.return-dot.lime { background: #84cc16; }
.rating-scale .green,
.return-dot.green { background: #22c55e; }
.rating-scale .red,
.return-dot.red { background: #f05252; }

.fund-picker-table-wrap {
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.fund-picker-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.fund-picker-table th,
.fund-picker-table td {
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.fund-picker-table th {
  color: var(--muted);
  background: var(--panel-alt);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.fund-picker-table tbody tr:nth-child(even) {
  background: rgba(var(--primary-rgb), 0.025);
}

.fund-picker-table tbody tr:hover {
  background: rgba(var(--primary-rgb), 0.08);
}

.fund-picker-table a {
  color: #1e1d2e;
  font-weight: 600;
  text-decoration: none;
}

.fund-picker-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.fund-stars {
  margin-left: 8px;
  color: #cbd5e1;
  font-size: 11px;
}

.fund-picker-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.fund-picker-pagination {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.pager-buttons {
  display: inline-flex;
  gap: 6px;
  margin-right: auto;
}

.pager-buttons button {
  width: 30px;
  height: 30px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}

.pager-buttons button.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

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

.fund-picker-pagination span {
  color: var(--muted);
  font-size: 12px;
}

.fund-picker-pagination select {
  width: 110px;
  max-width: 25%;
  min-height: 34px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.fund-filter-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: block;
  pointer-events: none;
}

.fund-filter-modal.open {
  pointer-events: auto;
}

.fund-filter-backdrop {
  position: absolute;
  inset: 0;
  visibility: hidden;
  background: rgba(15, 23, 42, 0.48);
  opacity: 0;
  transition: opacity .2s ease, visibility .2s ease;
}

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

.fund-filter-dialog {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(620px, calc(100vw - 28px));
  height: 100vh;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px 0 0 16px;
  box-shadow: -18px 0 44px rgba(15, 23, 42, 0.18);
  transform: translateX(105%);
  transition: transform .25s ease;
}

.fund-filter-modal.open .fund-filter-dialog {
  transform: translateX(0);
}

.fund-filter-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--muted);
  background: rgba(var(--primary-rgb), 0.08);
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  border-radius: 10px;
  cursor: pointer;
}

.fund-filter-title {
  padding: 20px 24px 12px;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), transparent 68%);
}

.fund-filter-title h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 17px;
  letter-spacing: -.01em;
}

.fund-filter-title p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.fund-filter-body {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 0;
}

.fund-filter-tabs {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px 12px;
  background: rgba(var(--primary-rgb), 0.035);
  border-right: 1px solid var(--line);
}

.fund-filter-tabs button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.fund-filter-tabs button.active {
  color: var(--primary);
  background: var(--panel);
  border-color: rgba(var(--primary-rgb), 0.18);
  box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.12);
}

.fund-filter-content {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
}

.fund-filter-scroll {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 16px;
  align-content: start;
  overflow: auto;
  padding: 18px 20px;
  scrollbar-color: rgba(0, 0, 0, .45) transparent;
  scrollbar-width: thin;
}

.fund-filter-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.fund-filter-scroll::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.35);
  border-radius: 999px;
}

.fund-filter-section.wide {
  grid-column: 1 / -1;
  padding: 14px;
  background: rgba(var(--primary-rgb), 0.035);
  border: 1px solid rgba(var(--primary-rgb), 0.1);
  border-radius: 14px;
}

.fund-filter-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.fund-filter-section-head h4,
.fund-filter-range span {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}

.fund-filter-section-head button {
  min-height: 30px;
  padding: 0 12px;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.12);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.fund-filter-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 8px;
}

.fund-filter-check-grid label {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 36px;
  padding: 0 11px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  border-radius: 11px;
  font-size: 12px;
}

.fund-filter-check-grid input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

.fund-filter-range {
  display: grid;
  gap: 7px;
  padding: 13px;
  background: rgba(var(--primary-rgb), 0.035);
  border: 1px solid rgba(var(--primary-rgb), 0.1);
  border-radius: 14px;
}

.fund-filter-range input {
  width: 100%;
  accent-color: var(--primary);
}

.fund-filter-range small {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.fund-filter-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: rgba(var(--primary-rgb), 0.035);
}

.fund-filter-footer button {
  min-width: 116px;
  min-height: 36px;
  font-size: 12px;
  font-weight: 800;
  border-radius: 10px;
}

.btn-primary.yellow {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

/* Fund Tools */
.fund-tools-page {
  display: grid;
  gap: 18px;
  color: var(--ink);
}

.fund-tools-page [hidden] {
  display: none !important;
}

.fund-tools-breadcrumb {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.fund-tools-breadcrumb b {
  color: var(--ink);
}

.fund-tools-head h2,
.tool-screen-head h2 {
  margin: 0 0 8px;
  color: var(--ink) !important;
  font-size: 22px;
}

.fund-tools-head p,
.tool-screen-head p {
  margin: 0;
  color: var(--muted);
}

.fund-tools-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.fund-tool-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 210px;
  overflow: hidden;
  padding: 22px;
  text-align: left;
  color: var(--ink);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--tool-color) 10%, transparent), transparent 46%),
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--tool-color) 24%, transparent), transparent 36%),
    var(--panel);
  border: 1px solid color-mix(in srgb, var(--tool-color) 22%, var(--line));
  border-radius: 18px;
  box-shadow: 0 16px 34px rgba(30, 38, 65, .08);
  cursor: pointer;
  isolation: isolate;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.fund-tool-card::before {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -46px;
  width: 132px;
  height: 132px;
  background: color-mix(in srgb, var(--tool-color) 18%, transparent);
  border-radius: 999px;
  z-index: -1;
  transition: transform .22s ease, opacity .22s ease;
}

.fund-tool-card::after {
  content: "\f061";
  position: absolute;
  right: 20px;
  bottom: 18px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--tool-color), var(--primary));
  border-radius: 12px;
  box-shadow: 0 12px 22px color-mix(in srgb, var(--tool-color) 28%, transparent);
  font: 900 12px/1 "Font Awesome 6 Free";
  opacity: .92;
  transform: translateX(6px);
  transition: transform .22s ease, opacity .22s ease;
}

.fund-tool-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--tool-color) 44%, var(--line));
  box-shadow: 0 24px 44px color-mix(in srgb, var(--tool-color) 18%, rgba(30, 38, 65, .12));
}

.fund-tool-card:hover::before {
  opacity: .85;
  transform: scale(1.14) translate(-4px, -4px);
}

.fund-tool-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.fund-tool-card .tool-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--tool-color), color-mix(in srgb, var(--tool-color) 64%, var(--primary)));
  border-radius: 16px;
  box-shadow: 0 14px 26px color-mix(in srgb, var(--tool-color) 24%, transparent);
  font-size: 21px;
}

.fund-tool-card > b {
  position: absolute;
  top: 22px;
  right: 22px;
  padding: 6px 11px;
  color: var(--tool-color);
  background: color-mix(in srgb, var(--tool-color) 10%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--tool-color) 18%, transparent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .01em;
}

.fund-tool-card h3 {
  margin: 22px 0 8px;
  color: var(--ink) !important;
  font-size: 18px;
  line-height: 1.2;
}

.fund-tool-card p {
  max-width: calc(100% - 26px);
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.fund-tool-card.green { --tool-color: #6c5dd3; }
.fund-tool-card.orange { --tool-color: #d84ec7; }
.fund-tool-card.rose { --tool-color: #ff6b8f; }
.fund-tool-card.teal { --tool-color: #45c6b0; }

.fund-tool-screen {
  display: grid;
  gap: 16px;
}

.tool-screen-head {
  display: flex;
  gap: 12px;
  align-items: end;
}

.tool-screen-head.split {
  justify-content: space-between;
  align-items: flex-start;
}

.fund-tool-screen[data-tool-screen="overlap"] .tool-screen-head.split {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(760px, 1fr);
  gap: 18px;
  align-items: start;
}

.fund-tool-screen[data-tool-screen="overlap"] .tool-screen-head h2 {
  margin-bottom: 0;
  white-space: nowrap;
}

.fund-tool-screen[data-tool-screen="overlap"] .tool-screen-head > .tool-form-row {
  display: grid;
  width: 100%;
  justify-self: stretch;
}

.tool-screen-head > div {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.tool-back {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--primary);
  background: rgba(var(--primary-rgb), .1);
  border: 1px solid rgba(var(--primary-rgb), .16);
  border-radius: 10px;
  cursor: pointer;
}

.tool-screen-head label,
.tool-form-row label {
  display: grid;
  gap: 7px;
  min-width: min(100%, 310px);
  color: var(--ink);
  font-size: 13px;
}

.tool-screen-head select,
.tool-form-row select,
.tool-form-row input,
.tool-table-title input {
  min-height: 40px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

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

.tool-kpi-grid article,
.tool-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(30, 38, 65, .05);
}

.tool-kpi-grid article {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px 14px;
  align-items: center;
  min-height: 118px;
  padding: 18px;
}

.tool-kpi-grid i {
  display: grid;
  grid-row: span 2;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--primary);
  background: rgba(var(--primary-rgb), .11);
  border-radius: 13px;
  font-size: 18px;
}

.tool-kpi-grid strong {
  color: var(--ink);
  font-size: 19px;
  line-height: 1.1;
}

.tool-kpi-grid span {
  color: var(--muted);
  font-size: 13px;
}

.tool-two-col,
.tool-overlap-grid {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(380px, 1.2fr);
  gap: 16px;
}

.tool-panel {
  padding: 22px;
}

.tool-panel h3 {
  margin: 0 0 6px;
  color: var(--ink) !important;
  font-size: 16px;
}

.tool-panel p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.tool-donut-wrap {
  height: 290px;
  max-width: 330px;
  margin: 10px auto 18px;
}

.tool-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 22px;
}

.tool-legend span {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.tool-legend i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.tool-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.tool-table-wrap.compact {
  border-radius: 10px;
}

.tool-table {
  min-width: 620px;
  border-collapse: collapse;
}

.tool-table th,
.tool-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

.tool-table.compact th,
.tool-table.compact td {
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.25;
}

.tool-table th {
  color: var(--muted);
  background: var(--panel-alt);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.tool-table th button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.tool-table th button.active {
  color: var(--primary);
}

.tool-table th button i {
  font-size: 10px;
}

.tool-table tr:nth-child(even) td {
  background: rgba(var(--primary-rgb), .025);
}

.tool-pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.tool-form-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.tool-form-row.compact {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  min-width: min(100%, 760px);
}

.overlap-select-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: minmax(340px, 1.2fr) minmax(280px, 1fr) 74px;
  align-items: start;
}

.overlap-select-row .tool-primary {
  width: 74px;
}

.scheme-combo {
  position: relative;
  display: grid;
}

.scheme-combo input {
  width: 100%;
  min-height: 42px;
  padding: 0 44px 0 14px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.scheme-combo input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .14);
}

.scheme-combo > button {
  position: absolute;
  top: 1px;
  right: 1px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.scheme-combo-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 20;
  display: none;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, .18);
}

.scheme-combo-menu.open {
  display: grid;
}

.scheme-combo-menu button,
.scheme-combo-empty {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.scheme-combo-menu button:hover,
.scheme-combo-menu button.active {
  background: rgba(var(--primary-rgb), .11);
  color: var(--primary);
}

.scheme-combo-empty {
  color: var(--muted);
  cursor: default;
}

.tool-primary {
  min-height: 40px;
  padding: 0 18px;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.overlap-visual {
  display: grid;
  min-height: 320px;
  align-content: center;
}

.venn-wrap {
  position: relative;
  display: grid;
  min-height: 190px;
  place-items: center;
}

.venn-circle {
  position: absolute;
  display: grid;
  width: 170px;
  height: 170px;
  place-items: center;
  color: var(--primary);
  background: rgba(var(--primary-rgb), .12);
  border: 2px solid rgba(var(--primary-rgb), .28);
  border-radius: 50%;
}

.venn-circle.left { transform: translateX(-56px); }
.venn-circle.right {
  color: #d84ec7;
  background: rgba(216, 78, 199, .12);
  border-color: rgba(216, 78, 199, .28);
  transform: translateX(56px);
}

.venn-wrap strong {
  z-index: 1;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: var(--ink);
  background: var(--panel);
  border: 4px solid var(--panel-alt);
  border-radius: 50%;
}

.overlap-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.overlap-stats div {
  --tile-accent: #6c5dd3;
  display: grid;
  position: relative;
  grid-template-columns: 50px minmax(0, 1fr);
  grid-template-areas: "icon value" "icon label";
  gap: 3px 14px;
  min-height: 132px;
  overflow: hidden;
  padding: 20px;
  align-items: center;
  align-content: center;
  background:
    radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--tile-accent) 18%, transparent), transparent 46%),
    linear-gradient(145deg, color-mix(in srgb, var(--tile-accent) 8%, var(--panel)), var(--panel) 62%);
  border: 1px solid color-mix(in srgb, var(--tile-accent) 20%, var(--line));
  border-radius: 16px;
  box-shadow: 0 14px 28px rgba(30, 38, 65, .07);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.overlap-stats div:nth-child(2) { --tile-accent: #d84ec7; }
.overlap-stats div:nth-child(3) { --tile-accent: #ff6b8f; }
.overlap-stats div:nth-child(4) { --tile-accent: #45c6b0; }

.overlap-stats div::before {
  content: "";
  position: absolute;
  top: 0;
  right: 22px;
  left: 22px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--tile-accent), transparent);
  border-radius: 0 0 999px 999px;
}

.overlap-stats div::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -34px;
  width: 100px;
  height: 100px;
  background: color-mix(in srgb, var(--tile-accent) 10%, transparent);
  border-radius: 50%;
}

.overlap-stats div:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tile-accent) 38%, var(--line));
  box-shadow: 0 20px 34px color-mix(in srgb, var(--tile-accent) 12%, rgba(30, 38, 65, .1));
}

.overlap-stats i {
  display: grid;
  grid-area: icon;
  width: 50px;
  height: 50px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--tile-accent), color-mix(in srgb, var(--tile-accent) 58%, var(--primary)));
  border-radius: 15px;
  box-shadow: 0 12px 22px color-mix(in srgb, var(--tile-accent) 26%, transparent);
  font-size: 19px;
}

.overlap-stats strong {
  grid-area: value;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.overlap-stats span {
  grid-area: label;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.tool-table-title {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.fund-tool-screen[data-tool-screen="overlap"] .tool-table-title h3 {
  flex: 0 0 auto;
  max-width: none;
  margin-bottom: 0;
  white-space: nowrap;
}

.fund-tool-screen[data-tool-screen="overlap"] .tool-table-title input {
  width: min(100%, 360px);
  min-height: 36px;
}

.overlap-pagination {
  justify-content: flex-end;
}

.overlap-pagination span {
  margin-right: auto;
  white-space: nowrap;
}

.overlap-pagination select {
  width: 112px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tool-empty {
  display: grid;
  min-height: 110px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.tool-empty i {
  color: #cbd5e1;
  font-size: 30px;
}

.overlap-pill {
  display: inline-flex;
  padding: 5px 10px;
  color: var(--primary);
  background: rgba(var(--primary-rgb), .1);
  border-radius: 999px;
  font-weight: 700;
}

.sip-form-panel {
  padding: 30px 22px;
}

.sip-form-row {
  grid-template-columns: minmax(340px, 1.65fr) minmax(140px, .65fr) minmax(150px, .7fr) minmax(170px, .75fr) auto;
  align-items: start;
}

.sip-form-row > .tool-primary {
  min-height: 42px;
  margin-top: 24px;
  align-self: start;
}

.sip-scheme-field {
  align-self: start;
}

.sip-scheme-combo input {
  min-height: 42px;
}

.sip-scheme-menu {
  min-width: 100%;
}

.sip-scheme-menu button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sip-scheme-chips {
  width: 100%;
  margin: 8px 0 0 !important;
}

.sip-scheme-chips .fund-chip {
  max-width: 100%;
  color: var(--primary);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), .12), rgba(216, 78, 199, .11));
  border-color: rgba(var(--primary-rgb), .25);
}

.sip-scheme-chips .fund-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.sip-performance-panel {
  overflow: hidden;
}

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

.sip-performance-head p {
  margin-bottom: 0;
}

.sip-performance-head > span {
  flex: 0 0 auto;
  padding: 7px 11px;
  color: var(--primary);
  background: rgba(var(--primary-rgb), .1);
  border: 1px solid rgba(var(--primary-rgb), .16);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.sip-performance {
  display: grid;
  width: 100%;
  min-height: 340px;
  place-items: center;
  color: var(--muted);
}

.sip-chart-wrap {
  width: 100%;
  height: 340px;
}

[data-tool-screen="sip"] .tool-table {
  width: 100%;
  min-width: 1120px;
  table-layout: fixed;
}

[data-tool-screen="sip"] .tool-table th,
[data-tool-screen="sip"] .tool-table td {
  white-space: nowrap;
}

[data-tool-screen="sip"] .tool-table th:first-child,
[data-tool-screen="sip"] .tool-table td:first-child {
  width: 360px;
  white-space: normal;
}

[data-tool-screen="sip"] .tool-table th:nth-child(2) { width: 80px; }
[data-tool-screen="sip"] .tool-table th:nth-child(3) { width: 90px; }
[data-tool-screen="sip"] .tool-table th:nth-child(4) { width: 90px; }
[data-tool-screen="sip"] .tool-table th:nth-child(5) { width: 130px; }
[data-tool-screen="sip"] .tool-table th:nth-child(6) { width: 120px; }
[data-tool-screen="sip"] .tool-table th:nth-child(7) { width: 130px; }
[data-tool-screen="sip"] .tool-table th:nth-child(8) { width: 90px; }

[data-tool-screen="sip"] .tool-table td:first-child b {
  display: block;
  line-height: 1.35;
}

.sip-positive {
  color: #10a56d;
  font-weight: 700;
}

.sip-negative {
  color: #ef476f;
  font-weight: 700;
}

.sip-result-card {
  display: grid;
  width: min(100%, 460px);
  gap: 8px;
  padding: 18px;
  background: rgba(var(--primary-rgb), .06);
  border: 1px solid rgba(var(--primary-rgb), .12);
  border-radius: 14px;
}

.sip-result-card strong {
  color: var(--primary);
  font-size: 28px;
}

.sip-result-card i {
  display: block;
  height: 8px;
  margin-top: 8px;
  background: linear-gradient(90deg, var(--primary), #d84ec7);
  border-radius: 999px;
}

/* Project-wide responsive safety layer */
.page-content,
.page-content *,
.module-page,
.dashboard-module,
.analysis-page,
.tagging-page,
.fund-compare-page,
.fund-details-page,
.fund-picker-page,
.fund-tools-page {
  min-width: 0;
}
.responsive-scroll,
.table-scroll,
.rm-table-scroll,
.client-table-wrap,
.modal-table-wrap,
.fund-compare-panel,
.fund-performance-panel,
.constituent-table,
.pending-card .table-scroll {
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.card,
.form-card,
.dashboard-card,
.analysis-card,
.tagging-card,
.fund-selector-card,
.fund-empty-card,
.fund-compare-panel,
.fund-performance-panel,
.fund-card,
.fund-facts-card,
.fund-summary-card {
  max-width: 100%;
}
.stats-grid,
.grid-2,
.form-grid,
.dashboard-row,
.dashboard-kpis,
.dashboard-sub-kpis,
.dashboard-chart-grid,
.dashboard-secondary,
.analysis-layout,
.analysis-form-grid,
.tagging-form-grid,
.tagging-preview-grid,
.fund-card-grid,
.fund-detail-grid,
.fund-performance-grid,
.fund-details-layout,
.fund-left-column,
.fund-two-col,
.alpha-grid,
.portfolio-kpis,
.allocation-wrap,
.fund-picker-toolbar,
.fund-picker-info-grid,
.fund-tools-grid,
.tool-kpi-grid,
.tool-two-col,
.tool-overlap-grid,
.tool-form-row {
  max-width: 100%;
}

@media (max-width: 1024px) {
  .page-content {
    padding: 16px;
  }
  .stats-grid,
  .dashboard-kpis,
  .dashboard-sub-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .grid-2,
  .form-grid,
  .dashboard-row,
  .dashboard-primary,
  .dashboard-chart-grid,
  .analysis-layout,
  .tagging-topbar,
  .tagging-form-grid,
  .fund-details-layout,
  .fund-left-column,
  .fund-two-col,
  .allocation-wrap,
  .fund-picker-toolbar {
    grid-template-columns: 1fr !important;
  }
  .fund-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tool-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tool-two-col,
  .tool-overlap-grid,
  .tool-form-row,
  .tool-form-row.compact {
    grid-template-columns: 1fr;
  }
  .sip-form-row .tool-primary {
    width: 100%;
    margin-top: 0;
  }
  .fund-tool-screen[data-tool-screen="overlap"] .tool-screen-head.split,
  .overlap-select-row {
    grid-template-columns: 1fr;
  }
  .fund-tool-screen[data-tool-screen="overlap"] .tool-screen-head h2 {
    white-space: normal;
  }
  .overlap-select-row .tool-primary {
    width: 100%;
  }
  .tool-screen-head,
  .tool-screen-head.split,
  .tool-table-title {
    align-items: stretch;
    flex-direction: column;
  }
  .fund-tool-screen[data-tool-screen="overlap"] .tool-table-title h3 {
    white-space: normal;
  }
  .fund-tool-screen[data-tool-screen="overlap"] .tool-table-title input {
    width: 100%;
  }
  .overlap-pagination {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .overlap-pagination span {
    margin-right: auto;
  }
  .overlap-pagination select {
    width: 112px;
  }
  .tool-screen-head > div {
    flex-wrap: wrap;
  }
  .fund-picker-info-grid {
    grid-template-columns: 1fr !important;
  }
  .fund-details-top {
    grid-template-columns: 1fr 1fr !important;
  }
  .fund-details-top > div:first-child {
    grid-column: 1 / -1;
  }
  .portfolio-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .alpha-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .fund-filter-dialog {
    width: min(720px, calc(100vw - 20px));
    height: 100vh;
  }
  .content-heading,
  .section-heading.split,
  .client-table-toolbar,
  .fund-compare-head,
  .fund-performance-head,
  .nav-movement-head {
    gap: 12px;
  }
  .nav-movement-head {
    flex-direction: column;
  }
  .nav-zoom-toolbar {
    width: 100%;
  }
  .fund-card-grid,
  .fund-detail-grid,
  .fund-performance-grid {
    grid-template-columns: repeat(4, minmax(220px, 32vw)) !important;
    min-width: max-content;
  }
  .fund-tools-grid,
  .tool-kpi-grid {
    grid-template-columns: 1fr !important;
  }
  .fund-tool-card {
    min-height: 150px;
  }
  .tool-kpi-grid article {
    min-height: 96px;
  }
  .tool-panel {
    padding: 16px;
  }
  .tool-donut-wrap {
    height: 230px;
  }
  .tool-legend {
    grid-template-columns: 1fr;
  }
  .overlap-stats {
    grid-template-columns: 1fr;
  }
  .venn-circle {
    width: 130px;
    height: 130px;
    font-size: 12px;
  }
  .venn-circle.left {
    transform: translateX(-42px);
  }
  .venn-circle.right {
    transform: translateX(42px);
  }
  .tool-pagination {
    align-items: flex-start;
    flex-direction: column;
  }
  .overlap-pagination {
    align-items: center;
    flex-direction: row;
  }
}

@media (max-width: 768px) {
  .page-content {
    padding: 14px 12px;
  }
  .content-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .heading-actions,
  .bar-right {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  .heading-actions::-webkit-scrollbar,
  .bar-right::-webkit-scrollbar {
    display: none;
  }
  .stats-grid,
  .dashboard-kpis,
  .dashboard-sub-kpis,
  .dashboard-secondary,
  .folder-grid,
  .maintenance-grid {
    grid-template-columns: 1fr !important;
  }
  .card,
  .form-card,
  .dashboard-card,
  .analysis-card,
  .tagging-card,
  .fund-selector-card,
  .fund-empty-card,
  .fund-compare-panel,
  .fund-performance-panel,
  .fund-card,
  .fund-facts-card {
    padding: 14px !important;
    border-radius: 10px !important;
  }
  .action-buttons,
  .analysis-actions,
  .fund-export-actions,
  .toolbar-actions,
  .client-subtabs,
  .period-tabs,
  .nav-zoom-toolbar,
  .yellow-tabs,
  .fund-summary-actions {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .action-buttons {
    align-items: stretch;
    flex-direction: column;
  }
  .action-buttons button,
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-login {
    min-height: 40px;
  }
  table {
    min-width: 680px;
  }
  .table-scroll table,
  .rm-table-scroll table,
  .client-table-wrap table,
  .modal-table-wrap table {
    width: max-content;
  }
  .fund-compare-panel,
  .fund-performance-panel {
    overflow: hidden;
  }
  .fund-details-top,
  .fund-details-layout,
  .fund-left-column,
  .fund-two-col,
  .alpha-grid,
  .allocation-wrap,
  .portfolio-kpis,
  .fund-picker-toolbar,
  .fund-picker-info-grid {
    grid-template-columns: 1fr !important;
  }
  .fund-picker-head,
  .fund-summary-top {
    align-items: flex-start;
    flex-direction: column;
  }
  .fund-picker-mobile-filter {
    display: inline-flex;
  }
  .fund-picker-toolbar {
    gap: 12px;
  }
  .fund-compare-button {
    min-height: 44px;
    font-size: 13px;
  }
  .fund-picker-pagination {
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    flex-direction: row;
  }
  .fund-picker-pagination select {
    width: 104px;
    max-width: 34%;
  }
  .fund-picker-pagination span {
    width: auto;
    margin-left: auto;
  }
  .returns-grid,
  .portfolio-kpis {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .return-tile,
  .portfolio-kpi {
    flex: 0 0 150px;
    scroll-snap-align: start;
  }
  .fund-card canvas,
  .alpha-card canvas {
    height: 240px !important;
  }
  .holding-allocation-track {
    height: 38px;
  }
  .sector-chart-box {
    width: 200px !important;
    height: 200px !important;
  }
  .allocation-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .buy-fund-fab {
    right: 16px;
    bottom: 82px;
    min-height: 48px;
    padding: 0 16px;
  }
  .fund-plus-fab {
    right: 16px;
    bottom: 24px;
    width: 44px;
    height: 44px;
  }
  .fund-purchase-dialog {
    padding: 20px;
  }
  .purchase-meta {
    grid-template-columns: 1fr;
  }
  .fund-card-grid,
  .fund-detail-grid,
  .fund-performance-grid {
    display: flex !important;
    grid-template-columns: none !important;
    min-width: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .fund-summary-card,
  .fund-detail-card,
  .fund-performance-card {
    flex: 0 0 100%;
    scroll-snap-align: start;
    box-shadow: 0 8px 18px rgba(30, 38, 65, 0.08);
  }
}

@media (max-width: 768px) {
  .sip-form-panel {
    padding: 18px 16px;
  }
  .sip-performance-head {
    align-items: stretch;
    flex-direction: column;
  }
  .sip-performance-head > span {
    align-self: flex-start;
  }
  .sip-performance,
  .sip-chart-wrap {
    min-height: 270px;
    height: 270px;
  }
  .sip-scheme-chips .fund-chip {
    width: 100%;
    justify-content: space-between;
  }
  .fund-filter-modal {
    padding: 0;
  }
  .fund-filter-dialog {
    width: calc(100vw - 12px);
    height: 100vh;
    border-radius: 16px 0 0 16px;
  }
  .fund-filter-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .fund-filter-tabs {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-width: thin;
  }
  .fund-filter-tabs button {
    flex: 0 0 auto;
    width: auto;
    min-width: 96px;
    min-height: 36px;
    padding: 0 14px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 999px;
  }
  .fund-filter-tabs button.active {
    border-color: rgba(var(--primary-rgb), 0.22);
    box-shadow: none;
  }
  .fund-filter-scroll {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }
  .fund-filter-check-grid {
    grid-template-columns: 1fr;
  }
  .fund-filter-footer {
    gap: 10px;
    padding: 12px 16px;
  }
  .fund-filter-footer button {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .page-content {
    padding: 12px 10px;
  }
  .content-heading h1,
  .analysis-topbar h2,
  .tagging-topbar h2,
  .fund-compare-head h2 {
    font-size: 18px !important;
  }
  .fund-picker-head h2 {
    font-size: 18px !important;
  }
  .fund-tools-head h2,
  .tool-screen-head h2 {
    font-size: 20px !important;
  }
  .tool-kpi-grid strong,
  .overlap-stats strong,
  .sip-result-card strong {
    font-size: 20px;
  }
  .fund-tool-card {
    padding: 18px;
  }
  .tool-table {
    min-width: 620px;
  }
  .tool-form-row label,
  .tool-screen-head label {
    min-width: 0;
  }
  .fund-multi-select {
    padding-right: 60px;
  }
  .fund-filter-title {
    padding: 18px 56px 12px 18px;
  }
  .fund-filter-title h3 {
    font-size: 16px;
  }
  .fund-filter-title p,
  .fund-filter-tabs button,
  .fund-filter-check-grid label,
  .fund-filter-range small {
    font-size: 12px;
  }
  .rating-scale,
  .fund-summary-actions button {
    flex: 0 0 auto;
  }
 
  .quick-item {
    min-width: 66px;
    padding-right: 8px;
    padding-left: 8px;
  }
  .top-user span:not(.avatar),
  .sidebar-footer {
    display: none;
  }
  input,
  select,
  textarea,
  .fund-select-input {
    min-height: 42px;
    font-size: 13px;
  }
  .stats-grid,
  .form-grid,
  .grid-2,
  .dashboard-row,
  .dashboard-kpis,
  .dashboard-sub-kpis,
  .dashboard-secondary {
    gap: 12px !important;
  }
  .fund-card > header,
  .chart-title-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .fund-nav-box,
  .fund-risk-box {
    min-width: 0;
  }
  .fund-mini-stat {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 76px;
    padding: 12px;
  }
  .fund-mini-icon {
    width: 46px;
    height: 46px;
    font-size: 18px;
  }
  .fund-mini-stat strong {
    font-size: 19px;
  }
  .fund-card canvas,
  .alpha-card canvas {
    height: 220px !important;
  }
  .buy-fund-fab {
    width: 44px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .buy-fund-fab span {
    display: none;
  }
  .fund-purchase-modal {
    align-items: flex-end;
    padding: 10px;
  }
  .fund-purchase-dialog {
    width: 100%;
    max-height: 90vh;
    border-radius: 14px;
  }
  .fund-purchase-dialog footer {
    flex-direction: column-reverse;
  }
  .fund-purchase-dialog footer button {
    width: 100%;
  }
  .dashboard-modal {
    padding: 8px;
  }
  .dashboard-modal-dialog {
    max-height: 92vh;
    border-radius: 14px;
  }
  .fund-export-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .fund-card-grid,
  .fund-detail-grid,
  .fund-performance-grid {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 12px;
    min-width: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .fund-summary-card,
  .fund-detail-card,
  .fund-performance-card {
    flex: 0 0 100%;
    max-width: 100%;
  }
}
