:root {
  --bg: #071017;
  --surface: #101a22;
  --surface-2: #14222c;
  --surface-3: #182a35;
  --line: rgba(151, 176, 190, 0.18);
  --line-strong: rgba(78, 200, 185, 0.45);
  --text: #eef6f4;
  --muted: #91a7b0;
  --teal: #4ec8b9;
  --blue: #80adff;
  --amber: #efb95a;
  --red: #f07167;
  --green: #59cf88;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(78, 200, 185, 0.12), transparent 260px),
    linear-gradient(180deg, #071017, #0b1218 55%, #070c10);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
.ghost-link {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(78, 200, 185, 0.12);
  color: var(--text);
  padding: 0 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.ghost-link:hover {
  border-color: rgba(239, 185, 90, 0.65);
  background: rgba(239, 185, 90, 0.12);
}

button.primary {
  background: linear-gradient(180deg, rgba(78, 200, 185, 0.9), rgba(56, 162, 152, 0.9));
  color: #071017;
  font-weight: 800;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(7, 16, 23, 0.82);
  color: var(--text);
  padding: 0 10px;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(78, 200, 185, 0.12);
}

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

h1 {
  margin-top: 3px;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.muted,
.status-line {
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.shell {
  width: min(1680px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--line);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.icon-btn {
  width: 40px;
  padding: 0;
  font-size: 18px;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 0;
  background: rgba(7, 16, 23, 0.88);
  backdrop-filter: blur(12px);
}

.tab {
  position: relative;
  min-width: 156px;
  justify-content: flex-start;
  gap: 10px;
  border-color: rgba(151, 176, 190, 0.14);
  background: linear-gradient(180deg, rgba(20, 34, 44, 0.94), rgba(11, 20, 27, 0.94));
  color: #dce8e5;
  font-weight: 800;
}

.tab span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 24px;
  border: 1px solid rgba(151, 176, 190, 0.18);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.tab.active {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(78, 200, 185, 0.24), rgba(78, 200, 185, 0.1));
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--teal);
}

.tab.active span {
  border-color: rgba(78, 200, 185, 0.48);
  background: rgba(78, 200, 185, 0.16);
  color: var(--teal);
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 14px;
}

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

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(20, 34, 44, 0.98), rgba(13, 23, 30, 0.98));
  box-shadow: var(--shadow);
  padding: 14px;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--teal);
}

.metric-card.amber::before { background: var(--amber); }
.metric-card.blue::before { background: var(--blue); }
.metric-card.green::before { background: var(--green); }
.metric-card.red::before { background: var(--red); }

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

.metric-card strong {
  display: block;
  margin: 11px 0 7px;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-card small {
  color: #c9d7d4;
  font-size: 12px;
  line-height: 1.45;
}

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

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 26, 34, 0.86);
  box-shadow: var(--shadow);
  padding: 16px;
}

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

.panel-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chart {
  width: 100%;
  height: 330px;
}

.chart.large {
  height: 420px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 12px;
}

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

.filter-grid label,
.range-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.filter-actions,
.export-options,
.range-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.range-row.slim {
  margin: 0;
}

.sales-scope-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.sales-scope-row label,
.year-boxes label,
.filter-actions label:not(.inline-control) {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #dce8e5;
  font-size: 13px;
}

.sales-scope-row input,
.year-boxes input {
  width: auto;
  min-height: auto;
  accent-color: var(--teal);
}

.compact-panel {
  padding: 12px 14px;
}

.range-row label {
  width: 118px;
}

.inline-control {
  display: grid !important;
  grid-template-columns: auto minmax(86px, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 136px;
  width: auto !important;
  color: #dce8e5;
  font-size: 13px;
  white-space: nowrap;
}

.inline-control span {
  color: var(--muted);
  white-space: nowrap;
}

.inline-control select {
  min-width: 86px;
}

.district-controls {
  justify-content: flex-end;
  max-width: 760px;
}

.mode-btn {
  border-color: rgba(151, 176, 190, 0.18);
  background: rgba(7, 16, 23, 0.38);
  color: #dce8e5;
}

.mode-btn.active {
  border-color: rgba(239, 185, 90, 0.62);
  background: rgba(239, 185, 90, 0.18);
  color: var(--amber);
  font-weight: 800;
}

.mode-spacer {
  flex: 1 1 160px;
}

.rank-controls {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

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

.mini-kpi-grid .metric-card {
  min-height: 102px;
}

.mini-kpi-grid .metric-card strong {
  font-size: clamp(20px, 1.8vw, 27px);
  line-height: 1.15;
}

.district-table table {
  min-width: 860px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(151, 176, 190, 0.12);
  border-radius: 8px;
  background: rgba(7, 16, 23, 0.36);
  scrollbar-width: thin;
  scrollbar-color: rgba(78, 200, 185, 0.72) rgba(7, 16, 23, 0.42);
}

.table-wrap.tall {
  max-height: 520px;
}

.company-search-table {
  max-height: 430px;
}

.sales-matrix {
  max-height: 340px;
  margin-bottom: 12px;
}

.table-wrap::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-wrap::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: rgba(7, 16, 23, 0.45);
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  border: 2px solid rgba(7, 16, 23, 0.45);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(78, 200, 185, 0.9), rgba(128, 173, 255, 0.72));
}

.table-wrap::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(239, 185, 90, 0.95), rgba(78, 200, 185, 0.88));
}

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

th,
td {
  border-bottom: 1px solid rgba(151, 176, 190, 0.1);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.35;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #101a22;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

td {
  color: #e7f0ed;
}

tr:hover td {
  background: rgba(78, 200, 185, 0.05);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.row-btn {
  border: 0;
  background: transparent;
  color: var(--teal);
  padding: 0;
  min-height: 0;
  text-align: left;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 2px 8px;
  font-size: 12px;
}

.tag.head { color: var(--amber); border-color: rgba(239, 185, 90, 0.45); }
.tag.street { color: var(--blue); border-color: rgba(128, 173, 255, 0.45); }
.tag.up { color: var(--green); border-color: rgba(89, 207, 136, 0.45); }
.tag.down { color: var(--red); border-color: rgba(240, 113, 103, 0.45); }
.tag.active { color: var(--green); border-color: rgba(89, 207, 136, 0.45); }
.tag.exited { color: var(--red); border-color: rgba(240, 113, 103, 0.45); }

.danger-text {
  color: var(--red);
}

.summary-row td {
  position: sticky;
  top: 37px;
  z-index: 1;
  background: rgba(78, 200, 185, 0.16) !important;
  color: var(--text);
  font-weight: 800;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

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

.detail-item {
  min-width: 0;
  border: 1px solid rgba(151, 176, 190, 0.13);
  border-radius: 8px;
  background: rgba(7, 16, 23, 0.38);
  padding: 9px 10px;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-item b {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

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

.mini-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.mini-card {
  border: 1px solid rgba(151, 176, 190, 0.14);
  border-radius: 8px;
  background: rgba(7, 16, 23, 0.36);
  padding: 9px 10px;
}

.mini-card strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.mini-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.rank-card b {
  display: block;
  margin-top: 5px;
  color: #dce8e5;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

#taxAnnualBody,
#taxFixedBody,
#taxTypeBody {
  font-variant-numeric: tabular-nums;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chip {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 16, 23, 0.36);
  color: var(--text);
  padding: 0 10px;
}

.field-groups {
  display: grid;
  gap: 12px;
}

.field-group {
  border: 1px solid rgba(151, 176, 190, 0.14);
  border-radius: 8px;
  background: rgba(7, 16, 23, 0.32);
  padding: 12px;
}

.field-group h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--text);
}

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

.field-list label,
.export-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #dce8e5;
  font-size: 13px;
}

.field-list input,
.export-options input {
  width: auto;
  min-height: auto;
  accent-color: var(--teal);
}

.toggle-label {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.year-boxes {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.empty-box {
  padding: 18px;
}

.login-body {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(16, 26, 34, 0.92);
  box-shadow: var(--shadow);
  padding: 28px;
}

.upload-shell {
  width: min(1320px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.upload-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 16, 23, 0.9);
  backdrop-filter: blur(14px);
}

.upload-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: start;
}

.upload-gate {
  width: min(520px, 100%);
  margin: 36px auto 0;
}

.locked {
  display: none !important;
}

.upload-form {
  display: grid;
  gap: 12px;
}

.upload-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.file-drop {
  position: relative;
  min-height: 144px;
  place-items: center;
  border: 1px dashed rgba(78, 200, 185, 0.45);
  border-radius: 8px;
  background: rgba(7, 16, 23, 0.38);
  color: var(--text) !important;
  text-align: center;
  cursor: pointer;
}

.file-drop span {
  max-width: 100%;
  padding: 0 18px;
  font-size: 17px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.file-drop small {
  color: var(--muted);
}

.file-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

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

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.result-grid .metric-card {
  min-height: 96px;
  box-shadow: none;
}

.result-grid .metric-card strong {
  font-size: 28px;
}

.upload-issues {
  grid-column: 1 / -1;
  border: 1px solid rgba(240, 113, 103, 0.32);
  border-radius: 8px;
  background: rgba(240, 113, 103, 0.08);
  padding: 12px;
}

.upload-issues strong {
  display: block;
  margin-bottom: 6px;
  color: var(--red);
}

.upload-issues p {
  color: #f4d0cc;
  font-size: 13px;
  line-height: 1.55;
}

.history-list,
.issue-list {
  display: grid;
  gap: 10px;
}

.history-item,
.issue-item {
  border: 1px solid rgba(151, 176, 190, 0.14);
  border-radius: 8px;
  background: rgba(7, 16, 23, 0.34);
  padding: 11px 12px;
}

.history-item > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.history-item strong,
.issue-item strong {
  overflow-wrap: anywhere;
}

.history-item span,
.issue-item span {
  color: var(--muted);
  font-size: 12px;
}

.history-item dl {
  display: grid;
  grid-template-columns: repeat(5, auto);
  gap: 5px 12px;
  margin: 0;
}

.history-item dt {
  color: var(--muted);
  font-size: 12px;
}

.history-item dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.issue-list {
  margin-top: 14px;
}

.issue-item p {
  margin-top: 6px;
  color: #dce8e5;
  font-size: 13px;
  line-height: 1.5;
}

.login-panel h1 {
  margin: 4px 0 8px;
  font-size: 30px;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.status-line {
  min-height: 22px;
  margin-top: 12px;
}

@media (max-width: 1180px) {
  .kpi-grid,
  .grid.two,
  .filter-grid,
  .detail-grid,
  .detail-grid.compact,
  .field-list,
  .mini-kpi-grid,
  .upload-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1680px);
    padding-top: 10px;
  }

  .topbar,
  .search-row,
  .split-list {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    display: grid;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    min-width: 142px;
  }

  .kpi-grid,
  .grid.two,
  .filter-grid,
  .detail-grid,
  .detail-grid.compact,
  .field-list,
  .mini-kpi-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .inline-control {
    grid-template-columns: 54px minmax(0, 1fr);
    min-width: 142px;
  }

  .district-controls {
    justify-content: flex-start;
    max-width: none;
  }

  .chart,
  .chart.large {
    height: 320px;
  }

  .upload-shell {
    width: min(100% - 20px, 1320px);
    padding-top: 10px;
  }

  .history-item > div,
  .upload-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .history-item dl {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Final glassmorphism reference theme */
:root {
  --bg: #0f172a;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-3: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: rgba(255, 255, 255, 0.94);
  --muted: rgba(255, 255, 255, 0.58);
  --teal: #38bdf8;
  --blue: #60a5fa;
  --amber: #fbbf24;
  --red: #fb7185;
  --green: #34d399;
  --pink: #f472b6;
  --purple: #a855f7;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --glass-blur: blur(24px) saturate(135%);
}

html {
  background: #0f172a;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at -10% -10%, rgba(147, 51, 234, 0.42), transparent 34%),
    radial-gradient(circle at 104% 18%, rgba(219, 39, 119, 0.34), transparent 30%),
    radial-gradient(circle at 28% 112%, rgba(37, 99, 235, 0.34), transparent 32%),
    linear-gradient(135deg, #0f172a 0%, #111827 52%, #020617 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 0%, rgba(168, 85, 247, 0.42), transparent 28%),
    radial-gradient(circle at 72% 10%, rgba(244, 114, 182, 0.28), transparent 26%),
    radial-gradient(circle at 54% 92%, rgba(59, 130, 246, 0.28), transparent 30%);
  filter: blur(50px);
  opacity: 0.88;
}

.shell,
.upload-shell {
  position: relative;
  z-index: 1;
  width: min(1760px, calc(100% - 32px));
}

.topbar {
  position: relative;
  justify-content: space-between;
  min-height: auto;
  margin: 16px 0 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.topbar::before,
.panel::before,
.metric-card::after,
.table-wrap::before,
.detail-item::before,
.mini-card::before,
.field-group::before,
.login-panel::before {
  display: none;
}

.topbar > div {
  position: relative;
  z-index: 1;
  text-align: left;
}

.top-actions {
  position: static;
  z-index: 2;
}

h1 {
  color: #ffffff;
  font-size: clamp(28px, 2.6vw, 42px);
  font-weight: 900;
  text-shadow: 0 18px 46px rgba(0, 0, 0, 0.35);
}

.eyebrow {
  color: var(--pink);
  letter-spacing: 0.9px;
  text-shadow: 0 0 18px rgba(244, 114, 182, 0.38);
}

.topbar .muted,
.muted,
.status-line,
.panel-head p,
.detail-item span,
.mini-card span,
.metric-card span,
.metric-card small {
  color: var(--muted);
  text-shadow: none;
}

.tabs {
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.tab,
button,
.ghost-link {
  border-radius: 16px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 34px rgba(2, 6, 23, 0.22);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

button:hover,
.ghost-link:hover,
.tab:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.tab {
  min-width: 166px;
  justify-content: flex-start;
  color: rgba(255, 255, 255, 0.72);
}

.tab span {
  border-radius: 12px;
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.tab.active,
.mode-btn.active {
  border-color: rgba(244, 114, 182, 0.34);
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.2), rgba(168, 85, 247, 0.18));
  color: #ffffff;
  box-shadow: 0 18px 46px rgba(168, 85, 247, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.panel,
.metric-card,
.table-wrap,
.detail-item,
.mini-card,
.field-group,
.history-item,
.issue-item,
.login-panel,
.upload-issues,
.file-drop {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.panel::after,
.metric-card::after,
.detail-item::after,
.mini-card::after,
.field-group::after,
.history-item::after,
.issue-item::after,
.login-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent 34%),
    radial-gradient(circle at 90% 0%, rgba(255, 255, 255, 0.08), transparent 24%);
  opacity: 0.7;
}

.panel > *,
.metric-card > *,
.detail-item > *,
.mini-card > *,
.field-group > *,
.history-item > *,
.issue-item > *,
.login-panel > * {
  position: relative;
  z-index: 1;
}

.panel {
  padding: 18px;
}

.panel-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

h2 {
  color: #ffffff;
  font-weight: 900;
  text-shadow: none;
}

h2::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  margin-right: 10px;
  vertical-align: 1px;
  background: var(--pink);
  box-shadow: 0 0 18px rgba(244, 114, 182, 0.82);
}

.metric-card {
  min-height: 96px;
  text-align: left;
  transition: background 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.metric-card:hover,
.mini-card:hover,
.history-item:hover,
.issue-item:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
  box-shadow: 0 26px 80px rgba(2, 6, 23, 0.42), 0 0 44px rgba(168, 85, 247, 0.08);
}

.metric-card::before {
  inset: 16px auto 16px 14px;
  width: 4px;
  height: auto;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--pink), var(--purple));
  box-shadow: 0 0 18px rgba(244, 114, 182, 0.44);
}

.metric-card strong {
  color: #ffffff;
  font-size: clamp(28px, 2.5vw, 40px);
  letter-spacing: 0;
  text-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

input,
select {
  border-radius: 18px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
}

select {
  background:
    linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.72) 50%) right 15px center / 7px 7px no-repeat,
    linear-gradient(135deg, rgba(255, 255, 255, 0.72) 50%, transparent 50%) right 10px center / 7px 7px no-repeat,
    rgba(0, 0, 0, 0.18);
}

select option {
  color: #111827;
  background: #f8fafc;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.34);
}

input:focus,
select:focus {
  border-color: rgba(244, 114, 182, 0.5);
  box-shadow: 0 0 0 4px rgba(244, 114, 182, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

th {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.66);
}

td {
  color: rgba(255, 255, 255, 0.88);
}

th,
td {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.07);
}

.summary-row td {
  background: rgba(244, 114, 182, 0.12) !important;
}

.tag,
.chip {
  border-radius: 999px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
}

.tag.head { color: #fbbf24; border-color: rgba(251, 191, 36, 0.24); }
.tag.street { color: #93c5fd; border-color: rgba(147, 197, 253, 0.24); }
.tag.up,
.tag.active { color: #34d399; border-color: rgba(52, 211, 153, 0.24); }
.tag.down,
.tag.exited { color: #fb7185; border-color: rgba(251, 113, 133, 0.24); }

.chart {
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.035);
}

.row-btn {
  color: #ffffff;
  text-shadow: none;
  text-decoration: underline;
  text-decoration-color: rgba(244, 114, 182, 0.4);
  text-underline-offset: 3px;
}

.field-group h3 {
  color: #ffffff;
}

.rank-subhead {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.rank-controls.compact {
  justify-content: flex-start;
}

.login-shell {
  background:
    radial-gradient(circle at -10% -10%, rgba(147, 51, 234, 0.42), transparent 34%),
    radial-gradient(circle at 104% 18%, rgba(219, 39, 119, 0.34), transparent 30%),
    radial-gradient(circle at 28% 112%, rgba(37, 99, 235, 0.34), transparent 32%),
    linear-gradient(135deg, #0f172a 0%, #111827 52%, #020617 100%);
}

.login-panel h1 {
  color: #ffffff;
  text-align: left;
}

.login-panel .eyebrow {
  text-align: left;
}

.file-drop {
  border-style: dashed;
}

.upload-gate {
  margin-top: 42px;
}

@media (max-width: 720px) {
  .shell,
  .upload-shell {
    width: min(100% - 20px, 1760px);
  }

  .topbar {
    padding: 16px;
  }

  .top-actions {
    position: relative;
    justify-content: flex-start;
  }
}

