:root {
  --bot-primary: #9a0036;
  --bot-light-red: #d93657;
  --bot-gold-brown: #9c7625;
  --bot-gold: #f7c84d;
  --bot-deep-purple: #591a4a;
  --bot-gray: #8398b2;
  --bot-soft-panel: #f6e8e8;
  --bot-text: #000000;
  --bot-background: #ffffff;
  --bot-border: #e4d5d9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bot-background);
  color: var(--bot-text);
  font-family: "Segoe UI", "Microsoft JhengHei", Arial, sans-serif;
}

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

.app-header {
  padding: 28px 32px 20px;
  border-bottom: 4px solid var(--bot-primary);
  background: linear-gradient(90deg, var(--bot-soft-panel), #ffffff);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-brand-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.app-logo {
  display: block;
  width: 84px;
  height: 84px;
  object-fit: contain;
  flex: 0 0 auto;
}

.app-title {
  font-size: 30px;
  line-height: 1.25;
  font-weight: 800;
  color: var(--bot-primary);
}

.app-subtitle {
  margin-top: 6px;
  color: var(--bot-deep-purple);
  font-size: 15px;
}

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

.kpi-card {
  border: 1px solid var(--bot-border);
  border-left: 5px solid var(--bot-primary);
  border-radius: 8px;
  padding: 14px 16px;
  min-height: 86px;
  background: #ffffff;
}

.kpi-label {
  font-size: 13px;
  color: var(--bot-deep-purple);
}

.kpi-value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 800;
  color: var(--bot-primary);
}

.filter-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 12px 32px 22px;
  border-bottom: 1px solid var(--bot-border);
}

.filter-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--bot-border);
  border-radius: 8px;
  background: #ffffff;
}

.filter-group-title {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 800;
  color: var(--bot-primary);
}

.filter-item {
  min-width: 0;
}

.filter-item label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--bot-deep-purple);
}

.filter-item input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #c9b9be;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px 32px 28px;
}

.chart,
.table-section {
  border: 1px solid var(--bot-border);
  border-radius: 8px;
  background: #ffffff;
  min-width: 0;
  overflow: hidden;
}

.chart-wide {
  grid-column: 1 / -1;
}

.table-section {
  padding: 14px;
}

.table-section h2 {
  margin: 0 0 12px;
  font-size: 20px;
  color: var(--bot-primary);
}

.app-footer {
  padding: 16px 32px 26px;
  color: var(--bot-deep-purple);
  font-size: 13px;
  border-top: 1px solid var(--bot-border);
}

a {
  color: var(--bot-primary);
}

a:visited {
  color: #6c1f76;
}

@media (max-width: 1180px) {
  .kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

@media (max-width: 760px) {
  .app-header,
  .kpi-strip,
  .filter-panel,
  .chart-grid,
  .app-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .app-title {
    font-size: 24px;
  }

  .app-logo {
    width: 64px;
    height: 64px;
  }

  .kpi-strip,
  .filter-panel,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .filter-group {
    grid-template-columns: 1fr;
  }

  .chart-wide {
    grid-column: auto;
  }
}
