:root {
  color-scheme: dark;
  --bg: #07101d;
  --panel: rgba(11, 28, 51, 0.92);
  --panel-soft: rgba(18, 43, 75, 0.76);
  --line: rgba(113, 183, 255, 0.22);
  --text: #f2f7ff;
  --muted: #93a9c4;
  --blue: #2d8cff;
  --gold: #dfb76a;
  --danger: #ff6d61;
}

/* Dashboard layout inspired by the provided admin reference. */
.admin {
  width: 100vw;
  min-height: 100vh;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 28px;
  background:
    radial-gradient(circle at 54% 18%, rgba(13, 93, 196, 0.28), transparent 34rem),
    linear-gradient(180deg, rgba(3, 11, 24, 0.98), rgba(2, 13, 29, 0.98));
  box-shadow: none;
  overflow-x: hidden;
}

.admin::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(17, 124, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 124, 255, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 92%);
}

.admin-sidebar,
.kpi-card,
.chart-card,
.table-panel,
.recent-panel {
  position: relative;
  border: 1px solid rgba(48, 153, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(8, 34, 71, 0.88), rgba(2, 18, 40, 0.94)),
    rgba(2, 15, 34, 0.95);
  box-shadow:
    0 0 22px rgba(0, 123, 255, 0.28),
    inset 0 0 36px rgba(0, 119, 255, 0.12);
}

.admin-sidebar::before,
.kpi-card::before,
.chart-card::before,
.table-panel::before,
.recent-panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    linear-gradient(90deg, #36b7ff 0 42px, transparent 42px calc(100% - 42px), #36b7ff calc(100% - 42px)) top / 100% 2px no-repeat,
    linear-gradient(90deg, #36b7ff 0 42px, transparent 42px calc(100% - 42px), #36b7ff calc(100% - 42px)) bottom / 100% 2px no-repeat;
  filter: drop-shadow(0 0 8px rgba(42, 164, 255, 0.9));
}

.admin-sidebar {
  min-height: calc(100vh - 32px);
  margin: 16px 0 16px 18px;
  padding: 18px 16px 72px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  color: #f7fbff;
  font-size: 20px;
  font-weight: 700;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #02142c;
  background: linear-gradient(135deg, #00d7ff, #1976ff);
  clip-path: polygon(50% 0, 92% 25%, 92% 75%, 50% 100%, 8% 75%, 8% 25%);
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 0;
}

.side-nav button,
.side-nav a,
.collapse-button {
  width: 100%;
  height: 48px;
  border: 0;
  background: transparent;
  color: #c8d7ef;
  justify-content: flex-start;
  padding: 0 14px;
  font-size: 16px;
  text-decoration: none;
}

.side-nav button.active {
  color: white;
  background: linear-gradient(90deg, rgba(14, 120, 255, 0.9), rgba(7, 51, 112, 0.72));
  box-shadow: inset 0 0 18px rgba(65, 181, 255, 0.35), 0 0 16px rgba(0, 119, 255, 0.35);
}

.side-nav a {
  height: 34px;
  padding-left: 54px;
  color: #9fb2d2;
  font-size: 15px;
}

.collapse-button {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: calc(100% - 32px);
  border-top: 1px solid rgba(75, 157, 255, 0.22);
  background: rgba(5, 26, 58, 0.78);
}

.admin-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 22px;
  min-width: 0;
  padding: 16px 22px 18px 0;
}

.topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.mobile-brand {
  margin-right: auto;
  font-size: 22px;
  font-weight: 700;
  color: #f5fbff;
}

.top-search {
  width: min(380px, 30vw);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(56, 143, 255, 0.45);
  background: rgba(3, 20, 47, 0.88);
}

.top-search input,
.house-filter select {
  height: 100%;
  border: 0;
  background: transparent;
}

.house-filter {
  width: 140px;
  height: 42px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(56, 143, 255, 0.45);
  background: rgba(3, 20, 47, 0.88);
}

.house-filter span {
  margin: 0;
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 8px;
}

.ghost-button {
  height: 42px;
  border-color: rgba(66, 161, 255, 0.55);
  background: rgba(5, 29, 64, 0.78);
}

.admin-user {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}

.notice {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: 12px;
  background: #d8344a;
}

.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #43c1ff, #154b9d);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
  margin: 0;
}

.kpi-card {
  min-height: 156px;
  padding: 26px 30px;
  display: grid;
  align-content: center;
  gap: 12px;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  right: 28px;
  top: 42px;
  width: 74px;
  height: 74px;
  border-radius: 16px;
  background:
    radial-gradient(circle, rgba(81, 188, 255, 0.95), rgba(18, 92, 220, 0.42) 55%, transparent 58%),
    linear-gradient(135deg, rgba(0, 220, 255, 0.22), rgba(41, 106, 255, 0.1));
  box-shadow: 0 0 28px rgba(0, 136, 255, 0.46);
}

.kpi-card span {
  color: #dbe8ff;
  font-size: 17px;
}

.kpi-card strong {
  font-size: 42px;
  letter-spacing: 0;
}

.kpi-card small {
  color: #98acc9;
  font-size: 15px;
}

.kpi-card small,
.kpi-card small b {
  color: #26eaa4;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1.25fr 1.25fr 1fr 1fr;
  gap: 22px;
  margin: 0;
}

.chart-card {
  min-height: 282px;
  padding: 20px 22px;
}

.house-card {
  display: none;
}

.card-head {
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-head h2 {
  font-size: 20px;
  color: #f3f8ff;
}

.card-head span {
  color: #78a8e9;
}

.status-list {
  display: grid;
  gap: 12px;
}

.status-list div {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border: 1px solid rgba(69, 149, 244, 0.32);
  background: rgba(4, 22, 51, 0.78);
}

.status-list b {
  color: #51ee87;
}

.status-list em {
  color: #ffb540;
  font-style: normal;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(360px, 0.9fr);
  gap: 22px;
}

.table-panel,
.recent-panel {
  min-height: 360px;
  padding: 18px;
}

.table-wrap {
  border: 1px solid rgba(67, 143, 238, 0.26);
  background: rgba(3, 17, 39, 0.74);
}

table {
  min-width: 1120px;
}

th,
td {
  padding: 14px 18px;
  border-bottom-color: rgba(70, 150, 255, 0.18);
}

th {
  background: rgba(4, 27, 62, 0.88);
}

.tag {
  color: #81c8ff;
  border-color: rgba(64, 157, 255, 0.34);
  background: rgba(33, 116, 255, 0.08);
}

.paid-option-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 150px;
}

.paid-option-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: rgba(244, 208, 111, 0.48);
  color: #f7df9d;
  background: rgba(244, 208, 111, 0.1);
}

.paid-option-tag em {
  color: #49c7ff;
  font-size: 12px;
  font-style: normal;
}

.paid-option-empty {
  border-color: rgba(145, 183, 222, 0.22);
  color: #9eb8d8;
  background: rgba(145, 183, 222, 0.08);
}

.delete {
  min-width: 62px;
  height: 32px;
}

.recent-plans {
  display: grid;
  gap: 16px;
}

.recent-plan {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid rgba(73, 149, 242, 0.18);
}

.plan-thumb {
  height: 74px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(196, 211, 227, 0.5)),
    radial-gradient(circle at 38% 38%, rgba(0, 128, 255, 0.24), transparent 42%);
}

.recent-plan h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #f5f9ff;
}

.recent-plan p {
  margin: 0;
  color: #8fa6c8;
}

.plan-status {
  min-width: 68px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: #36a3ff;
  background: rgba(18, 93, 186, 0.34);
}

.admin-footer {
  text-align: center;
  color: #788aaa;
  font-size: 14px;
}

@media (max-width: 1280px) {
  .admin {
    grid-template-columns: 220px 1fr;
    gap: 18px;
  }

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

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

@media (max-width: 860px) {
  .admin {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .admin-sidebar {
    min-height: auto;
    margin: 12px;
  }

  .admin-main {
    padding: 0 12px 16px;
  }

  .topbar,
  .kpis,
  .chart-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

  .top-search,
  .house-filter {
    width: 100%;
  }
}

body:has(#adminView:not(.hidden)) .shell {
  width: 100%;
  margin: 0;
  padding: 0;
}

body:has(#adminView:not(.hidden)) {
  overflow-x: hidden;
}

body:has(#adminView:not(.hidden)) .admin-main,
body:has(#adminView:not(.hidden)) .topbar,
body:has(#adminView:not(.hidden)) .kpis,
body:has(#adminView:not(.hidden)) .chart-grid,
body:has(#adminView:not(.hidden)) .content-grid,
body:has(#adminView:not(.hidden)) .kpi-card,
body:has(#adminView:not(.hidden)) .chart-card,
body:has(#adminView:not(.hidden)) .table-panel,
body:has(#adminView:not(.hidden)) .recent-panel {
  min-width: 0;
  max-width: 100%;
}

body:has(#adminView:not(.hidden)) .table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

body:has(#adminView:not(.hidden)) .admin {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 1500px) {
  .admin {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
  }

  .admin-main {
    padding-right: 16px;
  }

  .brand {
    font-size: 17px;
  }

  .kpis {
    gap: 16px;
  }

  .kpi-card {
    min-height: 138px;
    padding: 20px 22px;
  }

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

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

  .status-card,
.material-card {
  min-height: 248px;
}

.material-card canvas {
  display: none;
}

.startup-auth-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(69, 149, 244, 0.28);
}

.startup-auth-form label {
  display: grid;
  gap: 6px;
}

.startup-auth-form label > span {
  margin: 0;
  color: #9fb2d2;
  font-size: 13px;
}

.startup-auth-form input[type="text"],
.startup-auth-form input:not([type]) {
  height: 36px;
  border: 1px solid rgba(69, 149, 244, 0.32);
  background: rgba(3, 17, 39, 0.74);
}

.switch-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.switch-row input {
  width: 16px;
  height: 16px;
  accent-color: #239cff;
}

.startup-auth-message {
  min-height: 18px;
  margin: 0;
  color: #51ee87;
  font-size: 13px;
}

.startup-auth-message.error {
  color: #ff6d61;
}

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

.material-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 8px;
  border: 1px solid rgba(69, 149, 244, 0.28);
  background: rgba(4, 22, 51, 0.68);
}

.material-thumb {
  width: 54px;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(100, 174, 255, 0.32);
  background: linear-gradient(135deg, rgba(14, 59, 118, 0.8), rgba(4, 20, 45, 0.8));
}

.material-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.material-item strong {
  display: block;
  color: #f3f8ff;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-item span {
  display: block;
  margin-top: 4px;
  color: #89a7ca;
  font-size: 13px;
}
}

@media (max-width: 1100px) {
  .admin {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    min-height: auto;
    margin: 12px 12px 0;
    padding: 14px;
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    overflow-x: auto;
  }

  .side-nav a {
    display: none;
  }

  .collapse-button {
    display: none;
  }

  .admin-main {
    padding: 0 12px 16px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .mobile-brand {
    width: 100%;
    margin: 0;
  }

  .top-search {
    flex: 1 1 340px;
    width: auto;
  }

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

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

/* Keep material thumbnails fixed. This block intentionally stays last. */
.material-card {
  min-height: 282px;
  overflow: hidden;
}

.material-card #colorChart {
  display: none !important;
}

.material-list {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 6px;
  max-height: 246px;
  overflow: hidden;
}

.material-item {
  display: grid !important;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 4px 8px;
  overflow: hidden;
  border: 1px solid rgba(69, 149, 244, 0.28);
  background: rgba(4, 22, 51, 0.68);
}

.material-thumb {
  width: 52px !important;
  height: 34px !important;
  min-width: 52px;
  max-width: 52px;
  min-height: 34px;
  max-height: 34px;
  overflow: hidden;
  border: 1px solid rgba(100, 174, 255, 0.32);
  background: linear-gradient(135deg, rgba(14, 59, 118, 0.8), rgba(4, 20, 45, 0.8));
}

.material-thumb img {
  width: 52px !important;
  height: 34px !important;
  max-width: 52px !important;
  max-height: 34px !important;
  display: block;
  object-fit: cover;
}

.material-item strong,
.material-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-item strong {
  font-size: 14px;
  line-height: 18px;
}

.material-item span {
  margin-top: 1px;
  font-size: 12px;
  line-height: 16px;
}

.startup-auth-button.hidden {
  display: none !important;
}

.startup-auth-form {
  position: fixed !important;
  left: 50%;
  top: 50%;
  z-index: 200;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: none !important;
  transform: translate(-50%, -50%);
  padding: 24px;
  overflow: auto;
  border: 1px solid rgba(48, 153, 255, 0.78);
  background:
    linear-gradient(180deg, rgba(8, 34, 71, 0.98), rgba(2, 18, 40, 0.98)),
    rgba(2, 15, 34, 0.98);
  box-shadow: 0 0 0 9999px rgba(0, 5, 14, 0.68), 0 0 36px rgba(0, 123, 255, 0.42);
}

body.startup-auth-visible .startup-auth-form {
  display: grid !important;
}

.startup-auth-form::before {
  content: "启动验证设置";
  display: block;
  margin: 0 0 8px;
  color: #f3f8ff;
  font-size: 20px;
  font-weight: 700;
}

.startup-auth-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(66, 161, 255, 0.45);
  background: rgba(5, 29, 64, 0.78);
  color: #dbe8ff;
  font-size: 22px;
  line-height: 1;
  padding: 0;
}

/* New sliced panel assets. Keep this block last so the new UI wins. */
.brand-mark,
.notice {
  display: none !important;
}

.brand {
  gap: 0 !important;
}

.admin-user {
  gap: 8px !important;
}

.kpi-card,
.chart-card,
.table-panel,
.recent-panel {
  border: 0 !important;
  box-shadow: none !important;
  background-color: transparent !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 100% 100% !important;
}

.kpi-card::before,
.chart-card::before,
.table-panel::before,
.recent-panel::before {
  display: none !important;
}

.kpi-card::after {
  display: none !important;
}

.kpi-card {
  min-height: 132px !important;
  padding: 22px 34% 18px 28px !important;
}

.kpi-card:nth-child(1) {
  background-image: url("/assets/图层 233.png") !important;
}

.kpi-card:nth-child(2) {
  background-image: url("/assets/图层 333.png") !important;
}

.kpi-card:nth-child(3) {
  background-image: url("/assets/图层 4.png") !important;
}

.kpi-card:nth-child(4) {
  background-image: url("/assets/图层 5.png") !important;
}

.chart-card {
  min-height: 300px !important;
  padding: 24px 28px !important;
}

.trend-card:nth-child(1),
.trend-card:nth-child(2) {
  background-image: url("/assets/图层 9.png") !important;
}

.material-card {
  background-image: url("/assets/图层 10.png") !important;
}

.status-card {
  background-image: url("/assets/图层 11.png") !important;
}

.table-panel {
  background-image: url("/assets/图层 8.png") !important;
  padding: 26px 30px !important;
}

.recent-panel {
  background-image: url("/assets/图层 10.png") !important;
  padding: 26px 28px !important;
}

.table-wrap {
  border: 0 !important;
  background: rgba(2, 16, 38, 0.38) !important;
}

.delete {
  min-width: 56px !important;
  height: 30px !important;
  color: #ff7580 !important;
  border-color: rgba(255, 117, 128, 0.35) !important;
  background: rgba(80, 18, 32, 0.28) !important;
  font-size: 14px !important;
  letter-spacing: 0 !important;
  text-indent: 0 !important;
}

.material-card {
  min-height: 300px !important;
  overflow: hidden !important;
}

.material-list {
  gap: 5px !important;
  max-height: 232px !important;
}

.material-item {
  height: 41px !important;
  min-height: 41px !important;
  max-height: 41px !important;
  padding: 3px 8px !important;
}

.material-thumb,
.material-thumb img {
  width: 48px !important;
  height: 31px !important;
  max-width: 48px !important;
  max-height: 31px !important;
}

@media (max-width: 1500px) {
  .kpi-card {
    padding-right: 30% !important;
  }
}

@media (max-width: 640px) {
  .admin-sidebar {
    margin: 8px;
  }

  .side-nav {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .topbar {
    gap: 10px;
  }

  .actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ghost-button {
    min-width: 0;
    padding: 0 8px;
    font-size: 13px;
  }

  .admin-user {
    justify-content: flex-end;
  }

  .kpis,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card,
  .chart-card,
  .table-panel,
  .recent-panel {
    padding: 14px;
  }

  .recent-plan {
    grid-template-columns: minmax(72px, 84px) minmax(0, 1fr);
  }

  .plan-status {
    grid-column: 2;
    width: 68px;
  }
}

.material-card canvas {
  display: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(45, 140, 255, 0.20), transparent 32rem),
    linear-gradient(135deg, #040914 0%, var(--bg) 52%, #020711 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1480px, calc(100vw - 56px));
  margin: 0 auto;
  padding: 40px 0;
}

.hidden {
  display: none !important;
}

.admin {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34), inset 0 0 40px rgba(45, 140, 255, 0.08);
}

.login-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #020813;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.login-stage {
  position: relative;
  width: min(100vw, 177.7778vh);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  container-type: size;
  background: url("/assets/admin-login-bg.png") center / 100% 100% no-repeat;
  background-image: image-set(url("/assets/admin-login-bg.webp") type("image/webp"), url("/assets/admin-login-bg.png") type("image/png"));
}

.login-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.login-panel .login-form {
  position: absolute;
  left: 65.43%;
  top: 36.52%;
  width: 27.05%;
  min-width: 360px;
  max-width: 560px;
  display: grid;
  gap: 4.15cqh;
}

.login-panel .login-form label {
  display: block;
}

.login-panel .login-form label > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.login-panel .login-form input {
  height: 8.29cqh;
  min-height: 46px;
  border: 0;
  border-radius: 1.4cqh;
  background: url("/assets/图层 2.png") center / 100% 100% no-repeat;
  background-image: image-set(url("/assets/图层 2.webp") type("image/webp"), url("/assets/图层 2.png") type("image/png"));
  color: #f4f8ff;
  font-size: 2.35cqh;
  padding: 0 13% 0 14%;
  outline: none;
  box-shadow: none;
}

.login-panel .login-form #password {
  background-image: image-set(url("/assets/图层 3.webp") type("image/webp"), url("/assets/图层 3.png") type("image/png"));
  padding-right: 18%;
}

.login-panel .login-form input::placeholder {
  color: rgba(225, 232, 244, 0.68);
}

.login-panel .login-form input:focus {
  filter: brightness(1.1);
}

.login-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -0.39cqh;
}

.remember {
  display: inline-flex !important;
  align-items: center;
  gap: 0.87cqh;
  color: rgba(246, 249, 255, 0.9);
  font-size: 1.91cqh;
}

.remember input {
  width: 2.34cqh !important;
  height: 2.34cqh !important;
  min-width: 18px;
  min-height: 18px;
  accent-color: #1788ff;
  padding: 0 !important;
  border-radius: 4px !important;
}

.remember span {
  position: static !important;
  width: auto !important;
  height: auto !important;
  opacity: 1 !important;
  overflow: visible !important;
  margin: 0;
  color: rgba(246, 249, 255, 0.9);
}

.forgot {
  height: auto;
  border: 0;
  background: transparent;
  color: rgba(246, 249, 255, 0.92);
  padding: 0;
  font-size: 1.91cqh;
  box-shadow: none;
}

.login-panel .login-form > button[type="submit"] {
  height: 8.24cqh;
  min-height: 52px;
  border-radius: 1.4cqh;
  border: 0;
  background: url("/assets/图层 1.png") center / 100% 100% no-repeat;
  background-image: image-set(url("/assets/图层 1.webp") type("image/webp"), url("/assets/图层 1.png") type("image/png"));
  color: white;
  font-size: 3.47cqh;
  font-weight: 700;
  letter-spacing: 0.45em;
  text-indent: 0.45em;
  box-shadow: none;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.45);
}

.login-panel .login-form > button[type="submit"]:hover {
  filter: brightness(1.08);
}

.login-panel .login-form > button[type="submit"]:active {
  filter: brightness(0.92);
}

.login-panel .message {
  min-height: 24px;
  margin: -20px 0 0;
  text-align: center;
  color: #ff766d;
  font-size: 16px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 40px;
  font-weight: 700;
}

.subtle,
.message {
  color: var(--muted);
}

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

label span {
  display: block;
  margin-bottom: 8px;
  color: #c9d8ea;
  font-size: 14px;
}

input,
select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  background: rgba(2, 9, 20, 0.72);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(79, 164, 255, 0.8);
}

button,
.ghost-button {
  height: 46px;
  border: 1px solid rgba(77, 159, 255, 0.5);
  background: linear-gradient(180deg, rgba(45, 140, 255, 0.95), rgba(16, 82, 194, 0.95));
  color: white;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}

.ghost-button {
  background: rgba(7, 20, 38, 0.72);
}

.message.error {
  color: var(--danger);
}

.admin {
  min-height: calc(100vh - 80px);
  padding: 28px;
}

.topbar,
.filters {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.actions {
  display: flex;
  gap: 10px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.kpi-card,
.chart-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(30, 78, 129, 0.40), rgba(5, 17, 34, 0.82)),
    rgba(8, 22, 42, 0.94);
  box-shadow: inset 0 0 28px rgba(45, 140, 255, 0.08);
}

.kpi-card {
  min-height: 132px;
  padding: 20px;
  display: grid;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 0 18px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
}

.kpi-card span,
.kpi-card small,
.card-head span {
  color: var(--muted);
}

.kpi-card strong {
  font-size: 38px;
  line-height: 1;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 16px;
  margin-top: 16px;
}

.chart-card {
  min-height: 300px;
  padding: 18px;
}

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

.card-head h2 {
  margin: 0;
  font-size: 18px;
}

canvas {
  width: 100%;
  display: block;
}

.filters {
  margin: 30px 0 18px;
  padding: 18px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.filters label {
  flex: 1;
}

.metric {
  width: 150px;
  height: 74px;
  border-left: 1px solid var(--line);
  display: grid;
  place-content: center;
  text-align: center;
}

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

.metric strong {
  font-size: 30px;
}

.table-wrap {
  position: relative;
  overflow: auto;
  border: 1px solid var(--line);
  background: rgba(3, 12, 25, 0.68);
}

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

th,
td {
  padding: 16px;
  border-bottom: 1px solid rgba(113, 183, 255, 0.14);
  text-align: left;
  vertical-align: top;
}

th {
  color: #b8cbdf;
  font-weight: 600;
  background: rgba(11, 30, 56, 0.92);
}

.phone {
  color: #9fd0ff;
  font-weight: 700;
}

.color-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid rgba(223, 183, 106, 0.34);
  color: #f1d79e;
  background: rgba(223, 183, 106, 0.08);
  padding: 5px 8px;
  font-size: 13px;
}

.delete {
  color: var(--danger);
  border-color: rgba(255, 109, 97, 0.36);
  background: rgba(255, 109, 97, 0.08);
}

.empty {
  padding: 60px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 860px) {
  .shell {
    width: min(100vw - 24px, 1480px);
    padding: 16px 0;
  }

  .login-stage {
    width: max(100vw, 177.7778vh);
    height: 100vh;
  }

  .login-panel .login-form {
    left: 60%;
    top: 36.6%;
    width: 33%;
    min-width: 260px;
    max-width: 440px;
  }

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

  .kpis,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-wrap: wrap;
  }

  .metric {
    width: 100%;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

/* Final dashboard skin: keep this block after legacy styles so it wins. */
.admin {
  width: 100vw;
  min-height: 100vh;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 28px;
  background:
    radial-gradient(circle at 54% 18%, rgba(13, 93, 196, 0.28), transparent 34rem),
    linear-gradient(180deg, rgba(3, 11, 24, 0.98), rgba(2, 13, 29, 0.98));
  box-shadow: none;
  overflow-x: hidden;
}

.admin::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(17, 124, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 124, 255, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
}

.admin-sidebar,
.kpi-card,
.chart-card,
.table-panel,
.recent-panel {
  position: relative;
  border: 1px solid rgba(48, 153, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(8, 34, 71, 0.88), rgba(2, 18, 40, 0.94)),
    rgba(2, 15, 34, 0.95);
  box-shadow: 0 0 22px rgba(0, 123, 255, 0.28), inset 0 0 36px rgba(0, 119, 255, 0.12);
}

.admin-sidebar::before,
.kpi-card::before,
.chart-card::before,
.table-panel::before,
.recent-panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    linear-gradient(90deg, #36b7ff 0 42px, transparent 42px calc(100% - 42px), #36b7ff calc(100% - 42px)) top / 100% 2px no-repeat,
    linear-gradient(90deg, #36b7ff 0 42px, transparent 42px calc(100% - 42px), #36b7ff calc(100% - 42px)) bottom / 100% 2px no-repeat;
  filter: drop-shadow(0 0 8px rgba(42, 164, 255, 0.9));
}

.admin-sidebar {
  min-height: calc(100vh - 32px);
  margin: 16px 0 16px 18px;
  padding: 18px 16px 72px;
}

.brand,
.topbar,
.admin-user,
.recent-plan {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  min-height: 44px;
  color: #f7fbff;
  font-size: 20px;
  font-weight: 700;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #02142c;
  background: linear-gradient(135deg, #00d7ff, #1976ff);
  clip-path: polygon(50% 0, 92% 25%, 92% 75%, 50% 100%, 8% 75%, 8% 25%);
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.side-nav button,
.side-nav a,
.collapse-button {
  width: 100%;
  height: 48px;
  border: 0;
  background: transparent;
  color: #c8d7ef;
  justify-content: flex-start;
  padding: 0 14px;
  font-size: 16px;
  text-decoration: none;
}

.side-nav button.active {
  color: white;
  background: linear-gradient(90deg, rgba(14, 120, 255, 0.9), rgba(7, 51, 112, 0.72));
  box-shadow: inset 0 0 18px rgba(65, 181, 255, 0.35), 0 0 16px rgba(0, 119, 255, 0.35);
}

.side-nav a {
  height: 34px;
  padding-left: 54px;
  color: #9fb2d2;
  font-size: 15px;
}

.collapse-button {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: calc(100% - 32px);
  border-top: 1px solid rgba(75, 157, 255, 0.22);
  background: rgba(5, 26, 58, 0.78);
}

.admin-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 22px;
  min-width: 0;
  padding: 16px 22px 18px 0;
}

.topbar {
  min-height: 54px;
  justify-content: flex-end;
  gap: 14px;
}

.mobile-brand {
  margin-right: auto;
  font-size: 22px;
  font-weight: 700;
  color: #f5fbff;
}

.top-search,
.house-filter {
  height: 42px;
  border: 1px solid rgba(56, 143, 255, 0.45);
  background: rgba(3, 20, 47, 0.88);
}

.top-search {
  width: min(380px, 30vw);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}

.top-search input,
.house-filter select {
  height: 100%;
  border: 0;
  background: transparent;
}

.house-filter {
  width: 140px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.house-filter span {
  margin: 0;
  font-size: 13px;
}

.ghost-button {
  height: 42px;
  border-color: rgba(66, 161, 255, 0.55);
  background: rgba(5, 29, 64, 0.78);
}

.admin-user {
  height: 42px;
  gap: 10px;
  color: white;
}

.notice,
.avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.notice {
  width: 28px;
  height: 28px;
  color: white;
  font-size: 12px;
  background: #d8344a;
}

.avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #43c1ff, #154b9d);
}

.kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
  margin: 0;
}

.kpi-card {
  min-height: 156px;
  padding: 26px 30px;
  align-content: center;
  gap: 12px;
  overflow: hidden;
}

.kpi-card::after {
  right: 28px;
  top: 42px;
  left: auto;
  bottom: auto;
  width: 74px;
  height: 74px;
  border-radius: 16px;
  background: radial-gradient(circle, rgba(81, 188, 255, 0.95), rgba(18, 92, 220, 0.42) 55%, transparent 58%);
  box-shadow: 0 0 28px rgba(0, 136, 255, 0.46);
}

.kpi-card span {
  color: #dbe8ff;
  font-size: 17px;
}

.kpi-card strong {
  font-size: 42px;
  letter-spacing: 0;
}

.kpi-card small,
.kpi-card small b {
  color: #26eaa4;
  font-size: 15px;
}

.chart-grid {
  grid-template-columns: 1.25fr 1.25fr 1fr 1fr;
  gap: 22px;
  margin: 0;
}

.chart-card {
  min-height: 282px;
  padding: 20px 22px;
}

.house-card {
  display: none;
}

.card-head {
  margin: 0 0 16px;
}

.card-head h2 {
  font-size: 20px;
  color: #f3f8ff;
}

.card-head span {
  color: #78a8e9;
}

.status-list {
  display: grid;
  gap: 12px;
}

.status-list div {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border: 1px solid rgba(69, 149, 244, 0.32);
  background: rgba(4, 22, 51, 0.78);
}

.status-list b {
  color: #51ee87;
}

.status-list em {
  color: #ffb540;
  font-style: normal;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(360px, 0.9fr);
  gap: 22px;
}

.table-panel,
.recent-panel {
  min-height: 360px;
  padding: 18px;
}

.table-wrap {
  border: 1px solid rgba(67, 143, 238, 0.26);
  background: rgba(3, 17, 39, 0.74);
}

table {
  min-width: 1120px;
}

th,
td {
  padding: 14px 18px;
  border-bottom-color: rgba(70, 150, 255, 0.18);
}

th {
  background: rgba(4, 27, 62, 0.88);
}

.tag {
  color: #81c8ff;
  border-color: rgba(64, 157, 255, 0.34);
  background: rgba(33, 116, 255, 0.08);
}

.delete {
  min-width: 62px;
  height: 32px;
}

.recent-plans {
  display: grid;
  gap: 16px;
}

.recent-plan {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  gap: 16px;
  padding: 12px;
  border-bottom: 1px solid rgba(73, 149, 242, 0.18);
}

.plan-thumb {
  height: 74px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(196, 211, 227, 0.5)),
    radial-gradient(circle at 38% 38%, rgba(0, 128, 255, 0.24), transparent 42%);
}

.recent-plan h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #f5f9ff;
}

.recent-plan p {
  margin: 0;
  color: #8fa6c8;
}

.plan-status {
  min-width: 68px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: #36a3ff;
  background: rgba(18, 93, 186, 0.34);
}

.admin-footer {
  text-align: center;
  color: #788aaa;
  font-size: 14px;
}

@media (max-width: 1280px) {
  .admin {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
  }

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

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

@media (max-width: 860px) {
  .admin {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .admin-sidebar {
    min-height: auto;
    margin: 12px;
  }

  .admin-main {
    padding: 0 12px 16px;
  }

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

  .top-search,
  .house-filter {
    width: 100%;
  }

  .kpis,
  .chart-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }
}


/* Final layout tuning for sliced dashboard panels. */
.collapse-button,
.top-search,
.house-filter,
#refreshButton,
#exportLink {
  display: none !important;
}

.actions {
  margin-left: auto !important;
}

.kpis {
  align-items: start !important;
}

.kpi-card {
  aspect-ratio: 834 / 401 !important;
  min-height: 0 !important;
  height: auto !important;
  padding: clamp(16px, 1.2vw, 24px) 34% clamp(12px, 1vw, 18px) clamp(18px, 1.5vw, 28px) !important;
  background-size: 100% 100% !important;
}

.kpi-card strong {
  font-size: clamp(28px, 2.1vw, 40px) !important;
}

.kpi-card span,
.kpi-card small {
  white-space: nowrap !important;
}

.content-grid {
  grid-template-columns: minmax(0, 1.62fr) minmax(320px, 0.82fr) !important;
  align-items: stretch !important;
}

.table-panel {
  aspect-ratio: 983 / 600 !important;
  min-height: 420px !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  background-size: 100% 100% !important;
}

.table-panel .card-head,
.recent-panel .card-head {
  flex: 0 0 auto !important;
}

.table-wrap {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}

.table-wrap table {
  min-width: 1120px !important;
}

th:last-child,
td:last-child {
  width: 76px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.delete {
  width: 58px !important;
  min-width: 58px !important;
  max-width: 58px !important;
  height: 30px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  line-height: 30px !important;
}

.recent-panel {
  min-height: 420px !important;
  display: flex !important;
  flex-direction: column !important;
  background-size: 100% 100% !important;
}

.recent-plans {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  gap: 12px !important;
}

.recent-plan {
  grid-template-columns: 96px minmax(0, 1fr) 68px !important;
  min-height: 82px !important;
  padding: 10px 8px !important;
  gap: 12px !important;
}

.plan-thumb {
  width: 96px !important;
  height: 64px !important;
}

.recent-plan h3,
.recent-plan p {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.status-list b,
.status-list em {
  color: #51ee87 !important;
  font-style: normal !important;
}

@media (max-width: 1280px) {
  .content-grid {
    grid-template-columns: 1fr !important;
  }

  .table-panel {
    aspect-ratio: auto !important;
  }
}

@media (max-width: 860px) {
  .kpi-card {
    aspect-ratio: auto !important;
    min-height: 132px !important;
  }

  .table-panel,
  .recent-panel {
    min-height: 360px !important;
  }
}

/* Final anti-stretch pass for KPI sliced cards. */
.kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: clamp(12px, 1.15vw, 22px) !important;
}

.kpi-card {
  aspect-ratio: 834 / 401 !important;
  min-height: 0 !important;
  height: auto !important;
  padding: clamp(12px, 1.1vw, 20px) 28% clamp(10px, 0.9vw, 16px) clamp(14px, 1.25vw, 24px) !important;
  background-size: 100% 100% !important;
}

.kpi-card::after {
  width: clamp(42px, 4.4vw, 74px) !important;
  height: clamp(42px, 4.4vw, 74px) !important;
  right: clamp(18px, 2.4vw, 34px) !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

.kpi-card span {
  font-size: clamp(13px, 0.95vw, 17px) !important;
}

.kpi-card strong {
  font-size: clamp(24px, 1.85vw, 38px) !important;
  line-height: 1.05 !important;
}

.kpi-card small {
  font-size: clamp(11px, 0.8vw, 14px) !important;
}

.plan-thumb {
  flex: 0 0 96px !important;
  width: 96px !important;
  height: 64px !important;
  background-size: cover !important;
  background-position: center !important;
}

.status-list div:last-child b {
  color: #51ee87 !important;
}

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

@media (max-width: 640px) {
  .kpis {
    grid-template-columns: 1fr !important;
  }
}

/* Use the newest table/recent panel assets at their real aspect ratios. */
.content-grid {
  grid-template-columns: minmax(560px, 1fr) minmax(300px, 0.46fr) !important;
  align-items: start !important;
}

.table-panel {
  aspect-ratio: 2167 / 920 !important;
  min-height: 0 !important;
  height: auto !important;
  background-size: 100% 100% !important;
}

.recent-panel {
  aspect-ratio: 720 / 616 !important;
  min-height: 0 !important;
  height: auto !important;
  background-size: 100% 100% !important;
}

.recent-panel .card-head span,
.plan-thumb {
  display: none !important;
}

.recent-plans {
  overflow: auto !important;
  gap: clamp(8px, 0.8vw, 12px) !important;
}

.recent-plan {
  grid-template-columns: minmax(0, 1fr) 62px !important;
  min-height: auto !important;
  padding: clamp(8px, 0.8vw, 12px) 2px !important;
  gap: 10px !important;
}

.recent-plan h3 {
  font-size: clamp(14px, 1vw, 18px) !important;
  margin-bottom: 6px !important;
}

.recent-plan p {
  font-size: clamp(12px, 0.8vw, 14px) !important;
}

.plan-status {
  min-width: 62px !important;
  height: 30px !important;
  font-size: 13px !important;
}

.kpi-card:nth-child(1),
.kpi-card:nth-child(3) {
  padding-left: clamp(24px, 1.9vw, 36px) !important;
}

@media (max-width: 1080px) {
  .content-grid {
    grid-template-columns: 1fr !important;
  }

  .recent-panel {
    width: min(100%, 720px) !important;
    justify-self: start !important;
  }
}

/* Functional navigation and export controls. */
.side-nav a.active {
  border-color: rgba(72, 167, 255, 0.9) !important;
  color: #ffffff !important;
  background: linear-gradient(90deg, rgba(0, 106, 255, 0.42), rgba(0, 40, 84, 0.68)) !important;
  box-shadow: inset 0 0 18px rgba(20, 139, 255, 0.32), 0 0 22px rgba(0, 120, 255, 0.18) !important;
}

#exportLink,
#sideExportLink {
  display: inline-flex !important;
}

.export-button {
  min-width: 92px !important;
  justify-content: center !important;
}

.recent-panel .card-head,
.recent-plans {
  padding-left: clamp(18px, 1.8vw, 30px) !important;
}

.recent-plan {
  padding-left: clamp(8px, 1vw, 16px) !important;
}

.material-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.insight-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: clamp(12px, 1.1vw, 20px) !important;
}

.insight-card {
  min-height: 116px !important;
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 18px 20px !important;
  border: 1px solid rgba(61, 155, 255, 0.48) !important;
  border-radius: 6px !important;
  background:
    linear-gradient(135deg, rgba(10, 48, 95, 0.92), rgba(2, 15, 34, 0.84)),
    radial-gradient(circle at 86% 18%, rgba(38, 157, 255, 0.28), transparent 38%) !important;
  box-shadow: inset 0 0 22px rgba(38, 151, 255, 0.12), 0 0 22px rgba(0, 115, 255, 0.13) !important;
  overflow: hidden !important;
}

.data-icon {
  width: 48px !important;
  height: 48px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 6px !important;
  color: #79c7ff !important;
  background: rgba(12, 80, 160, 0.48) !important;
  box-shadow: inset 0 0 16px rgba(44, 180, 255, 0.22), 0 0 18px rgba(22, 144, 255, 0.20) !important;
}

.data-icon svg {
  width: 28px !important;
  height: 28px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.insight-card p,
.insight-card strong,
.insight-card small {
  margin: 0 !important;
  white-space: nowrap !important;
}

.insight-card p {
  color: #a9bfda !important;
  font-size: 13px !important;
}

.insight-card strong {
  display: block !important;
  max-width: 100% !important;
  margin-top: 7px !important;
  overflow: hidden !important;
  color: #f6fbff !important;
  font-size: clamp(20px, 1.4vw, 30px) !important;
  line-height: 1.05 !important;
  text-overflow: ellipsis !important;
}

.insight-card small {
  display: block !important;
  margin-top: 7px !important;
  overflow: hidden !important;
  color: #5ed6ff !important;
  font-size: 12px !important;
  text-overflow: ellipsis !important;
}

@media (max-width: 1280px) {
  .insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .insight-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Final admin cards: remove sliced PNG panels and use data-card styling. */
body:has(#adminView:not(.hidden)) .kpi-card,
body:has(#adminView:not(.hidden)) .chart-card,
body:has(#adminView:not(.hidden)) .table-panel,
body:has(#adminView:not(.hidden)) .recent-panel,
body:has(#adminView:not(.hidden)) .insight-card {
  position: relative !important;
  overflow: hidden !important;
  border: 1px solid rgba(61, 155, 255, 0.48) !important;
  border-radius: 6px !important;
  background:
    linear-gradient(135deg, rgba(10, 48, 95, 0.92), rgba(2, 15, 34, 0.86)),
    radial-gradient(circle at 88% 18%, rgba(38, 157, 255, 0.28), transparent 38%) !important;
  background-image:
    linear-gradient(135deg, rgba(10, 48, 95, 0.92), rgba(2, 15, 34, 0.86)),
    radial-gradient(circle at 88% 18%, rgba(38, 157, 255, 0.28), transparent 38%) !important;
  box-shadow: inset 0 0 22px rgba(38, 151, 255, 0.12), 0 0 22px rgba(0, 115, 255, 0.13) !important;
}

body:has(#adminView:not(.hidden)) .kpi-card::before,
body:has(#adminView:not(.hidden)) .chart-card::before,
body:has(#adminView:not(.hidden)) .table-panel::before,
body:has(#adminView:not(.hidden)) .recent-panel::before,
body:has(#adminView:not(.hidden)) .insight-card::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  pointer-events: none !important;
  background:
    linear-gradient(90deg, transparent, rgba(78, 178, 255, 0.34), transparent) top left / 100% 1px no-repeat,
    linear-gradient(90deg, transparent, rgba(78, 178, 255, 0.24), transparent) bottom left / 100% 1px no-repeat,
    linear-gradient(180deg, transparent, rgba(78, 178, 255, 0.24), transparent) left top / 1px 100% no-repeat,
    linear-gradient(180deg, transparent, rgba(78, 178, 255, 0.24), transparent) right top / 1px 100% no-repeat !important;
  opacity: 0.95 !important;
}

body:has(#adminView:not(.hidden)) .kpi-card::after,
body:has(#adminView:not(.hidden)) .chart-card::after,
body:has(#adminView:not(.hidden)) .table-panel::after,
body:has(#adminView:not(.hidden)) .recent-panel::after,
body:has(#adminView:not(.hidden)) .insight-card::after {
  content: "" !important;
  position: absolute !important;
  right: 18px !important;
  top: 18px !important;
  width: 46px !important;
  height: 46px !important;
  border-radius: 6px !important;
  pointer-events: none !important;
  background:
    linear-gradient(135deg, rgba(72, 190, 255, 0.36), rgba(12, 76, 156, 0.24)),
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(115, 205, 255, 0.16) 8px 9px) !important;
  box-shadow: inset 0 0 14px rgba(67, 185, 255, 0.22), 0 0 18px rgba(24, 142, 255, 0.18) !important;
  transform: none !important;
}

body:has(#adminView:not(.hidden)) .kpi-card {
  min-height: 116px !important;
  aspect-ratio: auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  padding: 18px 78px 18px 22px !important;
}

body:has(#adminView:not(.hidden)) .chart-card {
  min-height: 320px !important;
  padding: 20px !important;
  background-size: auto !important;
}

body:has(#adminView:not(.hidden)) .table-panel {
  min-height: 430px !important;
  aspect-ratio: auto !important;
  padding: 20px !important;
}

body:has(#adminView:not(.hidden)) .recent-panel {
  min-height: 430px !important;
  aspect-ratio: auto !important;
  padding: 20px !important;
}

body:has(#adminView:not(.hidden)) .card-head {
  position: relative !important;
  z-index: 1 !important;
  margin-bottom: 14px !important;
}

body:has(#adminView:not(.hidden)) .card-head h2 {
  color: #f6fbff !important;
}

body:has(#adminView:not(.hidden)) .card-head span {
  color: #66d8ff !important;
}

body:has(#adminView:not(.hidden)) canvas,
body:has(#adminView:not(.hidden)) .table-wrap,
body:has(#adminView:not(.hidden)) .recent-plans,
body:has(#adminView:not(.hidden)) .material-list,
body:has(#adminView:not(.hidden)) .status-list,
body:has(#adminView:not(.hidden)) .position-gap-chart,
body:has(#adminView:not(.hidden)) .house-preference-chart {
  position: relative !important;
  z-index: 1 !important;
}

body:has(#adminView:not(.hidden)) .content-grid {
  grid-template-columns: minmax(620px, 1.25fr) minmax(320px, 0.75fr) !important;
  align-items: stretch !important;
}

body:has(#adminView:not(.hidden)) .recent-panel .card-head,
body:has(#adminView:not(.hidden)) .recent-plans {
  padding-left: clamp(20px, 2vw, 34px) !important;
}

@media (max-width: 1080px) {
  body:has(#adminView:not(.hidden)) .content-grid {
    grid-template-columns: 1fr !important;
  }

  body:has(#adminView:not(.hidden)) .recent-panel {
    width: 100% !important;
  }
}

/* Current dashboard refinements. */
body:has(#adminView:not(.hidden)) .side-nav a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 44px !important;
  padding: 0 10px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

body:has(#adminView:not(.hidden)) .kpi-card {
  padding-right: 98px !important;
}

body:has(#adminView:not(.hidden)) .kpi-card::after,
body:has(#adminView:not(.hidden)) .insight-card::after {
  display: none !important;
  content: none !important;
}

.kpi-icon {
  position: absolute;
  right: 22px;
  top: 50%;
  z-index: 1;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgba(93, 190, 255, 0.35);
  border-radius: 12px;
  color: #73caff;
  background:
    radial-gradient(circle at 35% 25%, rgba(91, 203, 255, 0.38), transparent 48%),
    linear-gradient(135deg, rgba(12, 86, 178, 0.84), rgba(4, 30, 75, 0.58));
  box-shadow: inset 0 0 18px rgba(54, 179, 255, 0.22), 0 0 22px rgba(17, 126, 255, 0.22);
}

.kpi-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body:has(#adminView:not(.hidden)) .insight-card {
  padding-right: 20px !important;
}

body:has(#adminView:not(.hidden)) .chart-card canvas {
  display: block !important;
  width: 100% !important;
  height: 190px !important;
}

body:has(#adminView:not(.hidden)) .content-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}

body:has(#adminView:not(.hidden)) .table-panel {
  width: 100% !important;
  min-height: 430px !important;
}

.table-toggle {
  min-width: 82px !important;
  height: 32px !important;
  padding: 0 12px !important;
  border: 1px solid rgba(73, 199, 255, 0.36) !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #78dfff !important;
  font-size: 13px !important;
}

@media (max-width: 640px) {
  body:has(#adminView:not(.hidden)) .kpi-card {
    padding-right: 82px !important;
  }

  .kpi-icon {
    right: 16px;
    width: 50px;
    height: 50px;
  }

  .kpi-icon svg {
    width: 29px;
    height: 29px;
  }
}

/* Icon-only pass: no icon tiles, larger line icons. */
body:has(#adminView:not(.hidden)) .kpi-card {
  padding-right: 112px !important;
}

body:has(#adminView:not(.hidden)) .insight-card {
  grid-template-columns: 72px minmax(0, 1fr) !important;
  gap: 18px !important;
}

.kpi-icon,
.data-icon {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.kpi-icon {
  right: 22px !important;
  width: 76px !important;
  height: 76px !important;
  color: #55beff !important;
  opacity: 0.98 !important;
  filter: drop-shadow(0 0 10px rgba(42, 164, 255, 0.62)) !important;
}

.kpi-icon svg {
  width: 58px !important;
  height: 58px !important;
  stroke-width: 1.55 !important;
}

.data-icon {
  width: 72px !important;
  height: 72px !important;
  color: #65c8ff !important;
  filter: drop-shadow(0 0 10px rgba(42, 164, 255, 0.56)) !important;
}

.data-icon svg {
  width: 52px !important;
  height: 52px !important;
  stroke-width: 1.55 !important;
}

@media (max-width: 640px) {
  body:has(#adminView:not(.hidden)) .kpi-card {
    padding-right: 88px !important;
  }

  body:has(#adminView:not(.hidden)) .insight-card {
    grid-template-columns: 60px minmax(0, 1fr) !important;
  }

  .kpi-icon {
    width: 62px !important;
    height: 62px !important;
    right: 14px !important;
  }

  .kpi-icon svg {
    width: 46px !important;
    height: 46px !important;
  }

  .data-icon {
    width: 60px !important;
    height: 60px !important;
  }

  .data-icon svg {
    width: 44px !important;
    height: 44px !important;
  }
}

/* Customer analytics home layout. */
body:has(#adminView:not(.hidden)) .dashboard-overview {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 20px !important;
  min-width: 0 !important;
}

body:has(#adminView:not(.hidden)) .module-section {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 20px !important;
  min-width: 0 !important;
}

body:has(#adminView:not(.hidden)) .completion-section {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 20px !important;
  min-width: 0 !important;
}

body:has(#adminView:not(.hidden)) .overview-card,
body:has(#adminView:not(.hidden)) .completion-card {
  position: relative !important;
  overflow: hidden !important;
  min-width: 0 !important;
  min-height: 330px !important;
  padding: 20px !important;
  border: 1px solid rgba(61, 155, 255, 0.48) !important;
  border-radius: 6px !important;
  background:
    linear-gradient(135deg, rgba(10, 48, 95, 0.92), rgba(2, 15, 34, 0.86)),
    radial-gradient(circle at 88% 18%, rgba(38, 157, 255, 0.22), transparent 40%) !important;
  box-shadow: inset 0 0 22px rgba(38, 151, 255, 0.12), 0 0 22px rgba(0, 115, 255, 0.13) !important;
}

.module-tip {
  position: relative;
  z-index: 1;
  margin: -4px 0 16px;
  padding: 9px 12px;
  border-left: 3px solid #49c7ff;
  color: #a9c6e8;
  background: rgba(3, 24, 55, 0.46);
  font-size: 13px;
  line-height: 1.65;
}

body:has(#adminView:not(.hidden)) .overview-card::after,
body:has(#adminView:not(.hidden)) .chart-card::after,
body:has(#adminView:not(.hidden)) .completion-card::after {
  display: none !important;
  content: none !important;
}

.customer-overview-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
}

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

.overview-metric-card {
  min-width: 0;
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid rgba(73, 199, 255, 0.26);
  background: rgba(3, 24, 55, 0.58);
}

.overview-metric-card span {
  color: #9eb8d8;
  font-size: 13px;
}

.overview-metric-card strong {
  overflow: hidden;
  color: #f7fbff;
  font-size: clamp(24px, 2.1vw, 38px);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#overviewHotColor {
  overflow: visible;
  font-size: clamp(20px, 1.55vw, 30px);
  line-height: 1.18;
  white-space: normal;
  word-break: keep-all;
}

.overview-metric-card em {
  color: #dbe8ff;
  font-size: 13px;
  font-style: normal;
}

.overview-metric-card small {
  overflow: hidden;
  color: #46e0a7;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.overview-mini-chart {
  min-width: 0;
  min-height: 268px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(73, 199, 255, 0.22);
  background: rgba(2, 18, 42, 0.36);
}

.overview-mini-chart header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.overview-mini-chart h3 {
  margin: 0;
  color: #f6fbff;
  font-size: 16px;
  font-weight: 800;
}

.overview-mini-chart span {
  color: #9eb8d8;
  font-size: 12px;
}

.overview-mini-chart canvas {
  width: 100% !important;
  height: 190px !important;
}

.overview-growth-chart {
  width: 100%;
  min-height: 220px;
}

.overview-growth-svg {
  width: 100%;
  height: 220px;
  display: block;
}

.growth-grid,
.growth-guide {
  stroke: rgba(113, 183, 255, 0.14);
  stroke-width: 1;
}

.growth-axis {
  stroke: rgba(113, 183, 255, 0.34);
  stroke-width: 1;
}

.growth-line {
  fill: none;
  stroke: #49c7ff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.growth-point {
  fill: #061b32;
  stroke: #49c7ff;
  stroke-width: 3;
}

.growth-value {
  fill: #49c7ff;
  font-size: 13px;
  font-weight: 800;
  text-anchor: middle;
}

.growth-x-label,
.growth-y-label {
  fill: #9eb8d8;
  font-size: 12px;
}

.growth-x-label {
  text-anchor: middle;
}

.growth-y-label {
  text-anchor: end;
}

.overview-house-bars {
  display: grid;
  gap: 18px;
  align-content: center;
  min-height: 190px;
}

.overview-house-row {
  display: grid;
  grid-template-columns: 62px minmax(130px, 1fr) 54px 56px;
  gap: 10px;
  align-items: center;
  color: #dbe8ff;
}

.overview-house-row span {
  color: #f6fbff;
  font-size: 14px;
  font-weight: 700;
}

.overview-house-row b {
  display: block;
  height: 16px;
  overflow: hidden;
  border: 1px solid rgba(73, 199, 255, 0.28);
  background: #102844;
}

.overview-house-row b i {
  display: block;
  height: 100%;
  background: #49c7ff;
}

.overview-house-row strong {
  color: #f6fbff;
  font-size: 13px;
  text-align: right;
}

.overview-house-row em {
  color: #9fdcff;
  font-size: 13px;
  font-style: normal;
  text-align: right;
}

.paid-options-card {
  min-height: 360px !important;
}

.paid-option-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.paid-summary-card {
  min-width: 0;
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(73, 199, 255, 0.24);
  background: rgba(3, 24, 55, 0.58);
}

.paid-summary-card span,
.paid-summary-card em {
  overflow: hidden;
  color: #9eb8d8;
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paid-summary-card strong {
  overflow: hidden;
  color: #f7fbff;
  font-size: clamp(20px, 1.45vw, 28px);
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paid-option-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
  min-width: 0;
}

.paid-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 14px;
  margin-bottom: 14px;
}

.paid-option-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(73, 199, 255, 0.22);
  background: rgba(2, 18, 42, 0.36);
}

.paid-option-panel header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.paid-option-panel h3 {
  margin: 0;
  color: #f6fbff;
  font-size: 16px;
}

.paid-option-panel header span {
  color: #9eb8d8;
  font-size: 12px;
}

.paid-option-catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.paid-option-item {
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(87, 168, 255, 0.18);
  background: rgba(3, 23, 52, 0.52);
}

.paid-option-item div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.paid-option-item strong,
.paid-ranking-row strong {
  overflow: hidden;
  color: #f7fbff;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paid-option-item span,
.paid-ranking-row span {
  overflow: hidden;
  color: #9eb8d8;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paid-option-item b {
  flex: 0 0 auto;
  color: #f4d06f;
  font-size: 14px;
}

.paid-option-ranking {
  display: grid;
  gap: 9px;
}

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

.paid-ranking-row > i {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(73, 199, 255, 0.28);
  color: #49c7ff;
  font-style: normal;
  font-weight: 800;
  background: rgba(3, 24, 55, 0.66);
}

.paid-ranking-row div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.paid-ranking-row b {
  height: 6px;
  overflow: hidden;
  background: rgba(88, 142, 196, 0.24);
}

.paid-ranking-row b em {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f4d06f, #49c7ff);
}

.paid-ranking-row small {
  color: #f4d06f;
  font-size: 12px;
  white-space: nowrap;
}

.paid-trend-bars {
  height: 188px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 9px;
  padding-top: 10px;
}

.paid-trend-day {
  min-width: 0;
  display: grid;
  grid-template-rows: 22px 1fr 30px;
  align-items: end;
  justify-items: center;
  gap: 6px;
  color: #dbe8ff;
}

.paid-trend-day strong {
  color: #f4d06f;
  font-size: 13px;
}

.paid-trend-day b {
  width: 100%;
  height: 118px;
  display: flex;
  align-items: end;
  overflow: hidden;
  border: 1px solid rgba(73, 199, 255, 0.18);
  background: rgba(3, 24, 55, 0.58);
}

.paid-trend-day i {
  width: 100%;
  display: block;
  background: #f4d06f;
  box-shadow: 0 0 16px rgba(244, 208, 111, 0.36);
}

.paid-trend-day span {
  overflow: hidden;
  color: #9eb8d8;
  font-size: 11px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paid-amount-ranking,
.paid-house-preference {
  display: grid;
  gap: 11px;
}

.paid-amount-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(110px, 1.2fr) auto;
  gap: 10px;
  align-items: center;
}

.paid-amount-row div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.paid-amount-row strong {
  overflow: hidden;
  color: #f7fbff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paid-amount-row span {
  overflow: hidden;
  color: #9eb8d8;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paid-amount-row b,
.paid-house-row b {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(73, 199, 255, 0.2);
  background: rgba(3, 24, 55, 0.64);
}

.paid-amount-row b i,
.paid-house-row b i {
  display: block;
  height: 100%;
  background: #49c7ff;
}

.paid-amount-row em {
  color: #f4d06f;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.paid-house-row {
  display: grid;
  grid-template-columns: 56px minmax(100px, 1fr) 48px 72px;
  gap: 9px;
  align-items: center;
}

.paid-house-row span {
  color: #f7fbff;
  font-size: 13px;
  font-weight: 700;
}

.paid-house-row strong {
  color: #49c7ff;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.paid-house-row em {
  color: #f4d06f;
  font-size: 12px;
  font-style: normal;
  text-align: right;
  white-space: nowrap;
}

.customer-total {
  display: grid;
  gap: 8px;
  align-self: stretch;
  align-content: center;
  padding: 16px;
  border: 1px solid rgba(75, 157, 255, 0.25);
  background: rgba(3, 18, 42, 0.42);
}

.customer-total span,
.lead-tools span {
  color: #9eb8d8;
  font-size: 13px;
}

.customer-total strong {
  color: #f7fbff;
  font-size: clamp(42px, 4vw, 64px);
  line-height: 1;
}

.customer-total small {
  color: #46e0a7;
}

#colorPreferenceChart {
  width: 250px !important;
  min-width: 250px !important;
  max-width: 250px !important;
  height: 250px !important;
  min-height: 250px !important;
  max-height: 250px !important;
  justify-self: center;
  aspect-ratio: 1 / 1;
  cursor: default;
}

.chart-tooltip {
  position: fixed;
  z-index: 500;
  display: none;
  gap: 2px;
  pointer-events: none;
  padding: 7px 10px;
  border: 1px solid rgba(87, 178, 255, 0.5);
  border-radius: 4px;
  color: #f6fbff;
  background: rgba(2, 16, 36, 0.94);
  box-shadow: 0 0 18px rgba(0, 136, 255, 0.28);
  font-size: 13px;
  white-space: nowrap;
}

.chart-tooltip strong {
  font-size: 13px;
  font-weight: 700;
}

.chart-tooltip span {
  color: #dbe8ff;
  font-size: 12px;
}

.color-preference-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  max-height: 170px;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(65, 181, 255, 0.86) rgba(3, 24, 55, 0.68);
}

.color-preference-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.color-preference-list::-webkit-scrollbar-track {
  border: 1px solid rgba(72, 150, 255, 0.22);
  border-radius: 8px;
  background: rgba(3, 24, 55, 0.68);
  box-shadow: inset 0 0 8px rgba(0, 95, 180, 0.22);
}

.color-preference-list::-webkit-scrollbar-thumb {
  border: 1px solid rgba(121, 221, 255, 0.58);
  border-radius: 8px;
  background: linear-gradient(180deg, #64ddff 0%, #168dff 52%, #0a4fbd 100%);
  box-shadow: 0 0 10px rgba(37, 174, 255, 0.55);
}

.color-preference-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #8de9ff 0%, #2da8ff 52%, #1262d8 100%);
}

.color-preference-list::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.preference-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 72px 64px;
  gap: 10px;
  align-items: center;
  min-height: 30px;
  color: #dbe8ff;
}

.preference-item i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 10px var(--swatch);
}

.preference-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preference-item strong {
  color: #f6fbff;
  text-align: right;
}

.preference-item em {
  min-width: 48px;
  color: #67d8ff;
  font-style: normal;
  text-align: right;
}

.heatmap {
  display: grid;
  gap: 14px;
  max-width: 100%;
  overflow: hidden;
}

.point-winner-chart {
  display: grid;
  gap: 12px;
}

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

.point-preference-card,
.house-preference-card {
  min-width: 0;
  border: 1px solid rgba(145, 183, 222, 0.32);
  border-radius: 4px;
  background: rgba(2, 18, 42, 0.34);
}

.point-preference-card {
  min-height: 168px;
  padding: 13px 14px;
}

.point-preference-card header,
.house-preference-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.point-preference-card header strong,
.house-preference-card header strong {
  overflow: hidden;
  color: #f6fbff;
  font-size: 17px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.point-preference-card header span,
.house-preference-card header span {
  flex: 0 0 auto;
  color: #9eb8d8;
  font-size: 12px;
}

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

.preference-color-row {
  display: grid;
  grid-template-columns: minmax(84px, 1fr) 42px 58px minmax(72px, 110px);
  gap: 8px;
  align-items: center;
  min-height: 22px;
  color: #dbe8ff;
  font-size: 13px;
}

.preference-color-name {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preference-color-name i {
  width: 20px;
  font-style: normal;
  text-align: center;
}

.preference-color-name .rank-first {
  width: 20px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 211, 112, 0.9);
  border-radius: 3px;
  color: #ffd370;
  background: rgba(255, 211, 112, 0.1);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.preference-color-count,
.preference-color-percent {
  color: #f6fbff;
  text-align: right;
  white-space: nowrap;
}

.preference-color-percent {
  color: #9fdcff;
}

.preference-bar {
  display: block;
  height: 16px;
  overflow: hidden;
  border: 1px solid rgba(73, 199, 255, 0.28);
  background: #102844;
}

.preference-bar i {
  display: block;
  height: 100%;
  background: #49c7ff;
}

.preference-bar.is-empty {
  border-color: transparent;
  background: transparent;
}

.house-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.house-preference-card {
  padding: 14px;
}

.house-point-list {
  display: grid;
  gap: 12px;
}

.house-point-block {
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid rgba(72, 150, 255, 0.15);
}

.house-point-block:first-child {
  padding-top: 0;
  border-top: 0;
}

.house-point-block h3 {
  margin: 0;
  color: #78dfff;
  font-size: 13px;
  font-weight: 700;
}

.point-color-list.indented {
  padding-left: 8px;
}

.house-preference-card .preference-color-row {
  grid-template-columns: minmax(74px, 1fr) 38px 54px minmax(56px, 86px);
  gap: 6px;
  font-size: 12px;
}

.house-preference-card .preference-bar {
  height: 12px;
}

.muted-row {
  color: #7693b6;
  font-size: 12px;
}

.point-winner-row {
  display: grid;
  grid-template-columns: minmax(92px, 128px) minmax(0, 1fr) 56px;
  gap: 12px;
  align-items: center;
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid rgba(72, 150, 255, 0.18);
  background: rgba(2, 18, 42, 0.34);
}

.point-winner-row:hover {
  border-color: rgba(95, 207, 255, 0.42);
  background: rgba(17, 81, 142, 0.24);
}

.point-name {
  overflow: hidden;
  color: #f6fbff;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winner-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.winner-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.winner-meta strong {
  overflow: hidden;
  color: #dff5ff;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winner-meta em {
  flex: 0 0 auto;
  color: #8fb4d8;
  font-size: 12px;
  font-style: normal;
}

.winner-track,
.gap-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(86, 176, 255, 0.18);
  background: rgba(3, 26, 58, 0.78);
}

.winner-track i,
.gap-track i {
  display: block;
  height: 100%;
}

.winner-track i {
  background: linear-gradient(90deg, var(--winner), #73e7ff);
  box-shadow: 0 0 14px rgba(80, 201, 255, 0.42);
}

.point-winner-row > b {
  color: #65ddff;
  font-size: 17px;
  text-align: right;
}

@media (max-width: 1280px) {
  .house-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .point-card-grid {
    grid-template-columns: 1fr;
  }
}

.preference-stat-block {
  min-width: 0;
}

.preference-stat-block h3 {
  margin: 0 0 8px;
  color: #f6fbff;
  font-size: 15px;
  font-weight: 700;
}

.simple-table-scroll {
  max-width: 100%;
  overflow: auto;
  border: 1px solid rgba(72, 150, 255, 0.22);
  background: rgba(2, 18, 42, 0.42);
  scrollbar-width: thin;
  scrollbar-color: rgba(65, 181, 255, 0.86) rgba(3, 24, 55, 0.68);
}

.simple-table-scroll.compact {
  max-height: 178px;
}

.simple-table-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.simple-table-scroll::-webkit-scrollbar-track {
  background: rgba(3, 24, 55, 0.68);
}

.simple-table-scroll::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: linear-gradient(180deg, #64ddff 0%, #168dff 52%, #0a4fbd 100%);
}

.simple-stat-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  table-layout: fixed;
}

.simple-stat-table th,
.simple-stat-table td {
  height: 42px;
  padding: 8px 10px;
  border-right: 1px solid rgba(72, 150, 255, 0.16);
  border-bottom: 1px solid rgba(72, 150, 255, 0.16);
  color: #dbe8ff;
  font-size: 13px;
  text-align: center;
  vertical-align: middle;
}

.simple-stat-table th {
  color: #78dfff;
  font-weight: 700;
  background: rgba(3, 24, 55, 0.72);
}

.simple-stat-table td:first-child,
.simple-stat-table th:first-child {
  text-align: left;
  color: #f6fbff;
  font-weight: 700;
}

.simple-stat-table tbody tr:hover td {
  background: rgba(31, 141, 255, 0.08);
}

.house-preference-table {
  min-width: 860px;
}

.house-preference-chart {
  min-width: 0;
}

.house-compare-table-wrap {
  max-width: 100%;
  overflow: visible;
  border: 1px solid rgba(72, 150, 255, 0.22);
  background: rgba(2, 18, 42, 0.42);
}

.house-compare-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.house-compare-table th,
.house-compare-table td {
  min-height: 50px;
  padding: 8px 9px;
  border-right: 1px solid rgba(72, 150, 255, 0.16);
  border-bottom: 1px solid rgba(72, 150, 255, 0.16);
  color: #dbe8ff;
  font-size: 12px;
  vertical-align: middle;
}

.house-compare-table th {
  color: #78dfff;
  font-weight: 800;
  text-align: left;
  background: rgba(3, 24, 55, 0.72);
}

.house-compare-table tbody tr:hover td {
  background: rgba(31, 141, 255, 0.08);
}

.compare-position {
  color: #f6fbff !important;
  font-weight: 800;
}

.compare-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.compare-cell b {
  width: fit-content;
  min-width: 50px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border: 1px solid rgba(73, 199, 255, 0.32);
  color: #49c7ff;
  background: rgba(7, 35, 66, 0.86);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.compare-cell strong {
  overflow: hidden;
  color: #f6fbff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-cell em {
  color: #9eb8d8;
  font-size: 11px;
  font-style: normal;
}

.compare-cell.is-favorite b {
  border-color: #49c7ff;
  color: #061b32;
  background: #49c7ff;
}

.compare-cell.is-shared b {
  border-color: rgba(92, 225, 174, 0.55);
  color: #5ce1ae;
}

.compare-cell.is-low b {
  border-color: rgba(142, 166, 196, 0.36);
  color: #8ea6c4;
}

.compare-empty {
  color: #7693b6;
}

.difference-badge {
  min-width: 58px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid rgba(73, 199, 255, 0.32);
  color: #49c7ff;
  background: rgba(7, 35, 66, 0.86);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.difference-badge.is-large {
  border-color: rgba(73, 199, 255, 0.7);
  color: #061b32;
  background: #49c7ff;
}

.difference-badge.is-medium {
  border-color: rgba(92, 225, 174, 0.55);
  color: #5ce1ae;
}

.difference-badge.is-small {
  border-color: rgba(255, 194, 94, 0.62);
  color: #ffc25e;
}

.difference-badge.is-none {
  border-color: rgba(142, 166, 196, 0.36);
  color: #8ea6c4;
}

.house-preference-scroll {
  max-height: 300px;
}

.house-preference-table .preference-color {
  display: block;
  overflow: hidden;
  color: #f6fbff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.house-preference-table strong {
  display: block;
  margin-top: 4px;
  color: #65ddff;
  font-size: 17px;
  line-height: 1;
}

.house-cell-bar {
  display: block;
  height: 5px;
  margin-top: 7px;
  overflow: hidden;
  background: rgba(22, 60, 105, 0.78);
}

.house-cell-bar b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1e8cff, #61e1ff);
  box-shadow: 0 0 10px rgba(65, 187, 255, 0.45);
}

.position-gap-chart {
  display: grid;
  gap: 12px;
}

.gap-row {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid rgba(72, 150, 255, 0.18);
  background: rgba(2, 18, 42, 0.34);
}

.gap-head,
.gap-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gap-head strong {
  overflow: hidden;
  color: #f6fbff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gap-head span,
.gap-foot span {
  overflow: hidden;
  color: #9eb8d8;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gap-foot b {
  flex: 0 0 auto;
  font-size: 12px;
}

.gap-row.is-crush .gap-track i {
  background: linear-gradient(90deg, #1e8cff, #66e4ff);
  box-shadow: 0 0 14px rgba(71, 198, 255, 0.45);
}

.gap-row.is-clear .gap-track i {
  background: linear-gradient(90deg, #46dba8, #8df4d3);
  box-shadow: 0 0 14px rgba(70, 219, 168, 0.42);
}

.gap-row.is-close {
  border-color: rgba(255, 190, 74, 0.38);
}

.gap-row.is-close .gap-track i {
  background: linear-gradient(90deg, #ffb13d, #ffe083);
  box-shadow: 0 0 16px rgba(255, 180, 70, 0.58);
}

.gap-row.is-close .gap-foot b {
  color: #ffd26d;
}

.gap-row.is-clear .gap-foot b {
  color: #7beec8;
}

.gap-row.is-crush .gap-foot b {
  color: #6fe3ff;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: var(--heatmap-columns);
  min-width: max-content;
  border: 1px solid rgba(72, 150, 255, 0.2);
}

.heatmap-corner,
.heatmap-head,
.heatmap-row-head,
.heatmap-cell {
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border-right: 1px solid rgba(72, 150, 255, 0.18);
  border-bottom: 1px solid rgba(72, 150, 255, 0.18);
  color: #dbe8ff;
  font-size: 13px;
  white-space: nowrap;
}

.heatmap-head {
  min-height: 68px;
  grid-template-rows: 1fr 1fr;
  gap: 0;
  align-content: center;
  padding: 0 !important;
}

.heatmap-position,
.heatmap-color {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
}

.heatmap-position {
  color: #78a8e9;
  font-size: 12px;
  font-weight: 400;
  border-bottom: 1px solid rgba(72, 150, 255, 0.18);
}

.heatmap-color {
  color: #f6fbff;
  font-size: 13px;
  font-weight: 700;
}

.heatmap-corner,
.heatmap-head,
.heatmap-row-head {
  background: rgba(3, 18, 42, 0.68);
}

.heatmap-row-head {
  justify-content: start;
  color: #f6fbff;
  font-weight: 700;
}

.heatmap-cell {
  background: rgba(31, 141, 255, var(--heat));
  color: #ffffff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

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

.completion-row {
  display: grid;
  grid-template-columns: minmax(90px, 150px) minmax(160px, 1fr) 58px 72px;
  gap: 12px;
  align-items: center;
}

.completion-row span {
  overflow: hidden;
  color: #f6fbff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.completion-track {
  height: 16px;
  overflow: hidden;
  border: 1px solid rgba(87, 168, 255, 0.24);
  background: repeating-linear-gradient(90deg, rgba(47, 93, 144, 0.32) 0 10px, rgba(18, 42, 78, 0.32) 10px 20px);
}

.completion-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1e8cff, #61e1ff);
  box-shadow: 0 0 18px rgba(51, 175, 255, 0.62);
}

.completion-row strong {
  color: #64e4ff;
}

.completion-row em {
  color: #9eb8d8;
  font-style: normal;
}

.lead-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px);
  gap: 12px;
  margin-bottom: 12px;
}

.lead-tools label {
  display: grid;
  gap: 6px;
}

.lead-tools input,
.lead-tools select {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(72, 150, 255, 0.34);
  border-radius: 4px;
  padding: 0 12px;
  color: #f6fbff;
  background: rgba(3, 18, 42, 0.72);
  outline: none;
}

body:has(#adminView:not(.hidden)) .table-wrap table {
  min-width: 1120px !important;
}

#leadsSection::after {
  display: none !important;
  content: none !important;
}

#leadsSection .table-wrap table {
  min-width: 1400px !important;
  table-layout: auto !important;
}

#leadsSection th:nth-child(1),
#leadsSection td:nth-child(1) {
  width: 168px !important;
  min-width: 168px !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

#leadsSection th:nth-child(2),
#leadsSection td:nth-child(2) {
  width: 128px !important;
  min-width: 128px !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

#leadsSection th:nth-child(3),
#leadsSection td:nth-child(3) {
  width: 90px !important;
  min-width: 90px !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

@media (max-width: 1180px) {
  body:has(#adminView:not(.hidden)) .dashboard-overview,
  body:has(#adminView:not(.hidden)) .completion-section {
    grid-template-columns: 1fr !important;
  }

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

  .paid-chart-grid,
  .paid-option-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .overview-metric-grid,
  .overview-chart-grid,
  .customer-overview-layout,
  .paid-option-summary,
  .paid-option-catalog,
  .lead-tools {
    grid-template-columns: 1fr;
  }

  .overview-house-row {
    grid-template-columns: 58px minmax(90px, 1fr) 48px 50px;
  }

  #colorPreferenceChart {
    width: min(250px, 100%) !important;
    min-width: 0 !important;
    max-width: 250px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  .completion-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .paid-amount-row,
  .paid-house-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.lead-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.lead-pagination button {
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(73, 199, 255, 0.36);
  border-radius: 4px;
  color: #cfe8ff;
  background: rgba(3, 18, 42, 0.72);
  box-shadow: none;
}

.lead-pagination button.active {
  border-color: #49c7ff;
  color: #061b32;
  background: #49c7ff;
  font-weight: 800;
}

.lead-pagination button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.lead-pagination span {
  min-width: 48px;
  color: #9eb8d8;
  font-size: 13px;
  text-align: right;
}

@media (min-width: 1101px) {
  body:has(#adminView:not(.hidden)) .admin {
    --sidebar-column: 250px;
    grid-template-columns: var(--sidebar-column) minmax(0, 1fr) !important;
    overflow: visible !important;
  }

  body:has(#adminView:not(.hidden)) .admin-main {
    grid-column: 2 !important;
  }

  body:has(#adminView:not(.hidden)) .admin-sidebar {
    position: fixed !important;
    z-index: 20 !important;
    top: 16px !important;
    left: 18px !important;
    width: calc(var(--sidebar-column) - 18px) !important;
    height: calc(100vh - 32px) !important;
    min-height: 0 !important;
    max-height: calc(100vh - 32px) !important;
    margin: 0 !important;
    overflow-y: auto !important;
  }
}

@media (min-width: 1101px) and (max-width: 1500px) {
  body:has(#adminView:not(.hidden)) .admin {
    --sidebar-column: 220px;
  }
}
