:root {
  --brand-red: #dc2626;
  --brand-red-dark: #991b1b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  text-align: center;
  padding: 0.625rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table td {
  padding: 0.625rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  text-align: center;
  transition: background-color 0.15s;
}

.data-table tbody tr:hover td {
  background-color: #f8fafc;
}

.data-table .text-left {
  text-align: left;
}

.data-table .font-mono {
  font-variant-numeric: tabular-nums;
}

/* Performance cells */
.cell-positive {
  color: #dc2626;
  font-weight: 500;
}

.cell-negative {
  color: #16a34a;
  font-weight: 500;
}

.cell-neutral {
  color: #64748b;
}

.cell-heat {
  font-weight: 600;
}

/* Tabs */
.tab-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: transparent;
}

.tab-btn:hover {
  color: #334155;
}

.tab-btn.active {
  background: white;
  color: #dc2626;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Cards */
.metric-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
}

.metric-label {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

/* Custom range slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #dc2626;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #dc2626;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Checkbox */
.custom-checkbox {
  appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid #cbd5e1;
  border-radius: 0.25rem;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  flex-shrink: 0;
}

.custom-checkbox:checked {
  background-color: #dc2626;
  border-color: #dc2626;
}

.custom-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Print styles */
@media print {
  .print\:hidden {
    display: none !important;
  }

  header {
    position: static;
  }

  .data-table th {
    position: static;
  }

  section {
    break-inside: avoid;
  }
}
