:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --blue: #0b70d8;
  --red: #ef4444;
  --purple: #7c3aed;
  --green: #16a34a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

.sidebar {
  width: 306px;
  min-height: 100vh;
  padding: 24px 18px;
  background: #eef1f6;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.brand {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
  margin: 8px 0 22px;
}

.nav-group,
.quick-grid {
  display: grid;
  gap: 8px;
}

.nav-item,
.chip,
.primary-btn,
.ghost-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
}

.nav-item.active,
.chip.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.side-card {
  margin-top: 18px;
}

.side-card label,
.field-label {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  color: #374151;
  font-weight: 700;
}

select,
input[type="date"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  font-size: 15px;
}

.file-input {
  display: none;
}

.upload-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel);
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 20px 16px;
  cursor: pointer;
}

.upload-box strong {
  font-size: 17px;
}

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

.upload-box em {
  width: fit-content;
  margin-top: 6px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 12px;
  font-style: normal;
  color: #111827;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 38px 46px 60px;
  overflow-x: hidden;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.15;
}

h2 {
  margin: 30px 0 16px;
  font-size: 27px;
}

h3 {
  margin: 22px 0 12px;
  font-size: 20px;
}

.hero p {
  color: var(--muted);
  margin: 12px 0 0;
  font-size: 16px;
}

.primary-btn {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  text-align: center;
  white-space: nowrap;
}

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

.message {
  padding: 18px 20px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
}

.message.hidden {
  display: none;
}

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

.kpi-card {
  min-height: 112px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.kpi-label {
  color: #64748b;
  font-weight: 700;
  margin-bottom: 16px;
}

.kpi-value {
  font-size: 30px;
  line-height: 1.18;
  font-weight: 800;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

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

.chart.small {
  min-height: 280px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

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

th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 700;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}

.toolbar .chip {
  text-align: center;
}

.filter-block {
  margin-top: 14px;
}

@media (max-width: 1120px) {
  body {
    display: block;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
  }

  .main {
    padding: 26px 18px 42px;
  }

  .hero {
    display: block;
  }

  .kpi-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 34px;
  }
}
