:root {
  --primary-purple: #863DFF;
  --primary-dark: #060A27;
  --success-green: #10b981;
  --danger-red: #ef4444;
  --text-dark: #111827;
  --text-light: #6b7280;
  --bg-light: #f9fafb;
  --bg-white: #ffffff;
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #fafafa;
  color: var(--text-dark);
  padding: 0;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.main-header {
  background: #000000;
  width: 100%;
  padding: 1rem 3rem;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  position: relative;
}

.header-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
}

.main-container {
  display: flex;
  min-height: calc(100vh - 72px);
  position: relative;
}

.dashboard-content {
  flex: 1;
  padding: 2rem 3rem;
  overflow-y: auto;
  transition: margin-right 0.3s ease;
  max-width: 100%;
}

.dashboard-content.popup-open {
  margin-right: 480px;
}

@media (max-width: 1200px) {
  .dashboard-content.popup-open {
    margin-right: 0;
  }

  .simulation-popup {
    width: 100%;
    right: -100%;
  }

  .simulation-popup.open {
    right: 0;
  }
}

.dashboard-header {
  margin-bottom: 2rem;
}

.top-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.date-info {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  font-weight: 400;
}

.week-selector-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.date-selector {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-dark);
  font-weight: 400;
  transition: all 0.2s;
}

.date-selector:hover {
  border-color: #d1d5db;
  background: #fafafa;
}

.kpi-description {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 2rem;
  font-weight: 400;
  line-height: 1.5;
}

.config-button {
  background: var(--primary-purple);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.config-button:hover {
  background: #7c3aed;
  box-shadow: var(--shadow-md);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 1400px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.kpi-card {
  background: var(--bg-white);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.kpi-label {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.kpi-value {
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.kpi-value.empty {
  color: var(--text-light);
  font-weight: 400;
}

.kpi-change {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.kpi-change.positive {
  color: var(--success-green);
}

.kpi-change.negative {
  color: var(--danger-red);
}

.kpi-average {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 400;
  line-height: 1.4;
  margin-top: 0.25rem;
}

.charts-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--bg-white);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.chart-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.chart-container {
  position: relative;
  height: 250px;
}

.full-width-chart {
  grid-column: 1 / -1;
}

.full-width-chart .chart-container {
  height: 300px;
}

.table-card {
  background: var(--bg-white);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.table-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.coverage-table {
  width: 100%;
  border-collapse: collapse;
}

.coverage-table th,
.coverage-table td {
  padding: 0.875rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.coverage-table th {
  font-weight: 500;
  color: var(--text-dark);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.coverage-table td {
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 400;
}

.coverage-table tbody tr:hover {
  background: var(--bg-light);
}

.simulation-popup {
  position: fixed;
  top: 0;
  right: -480px;
  width: 480px;
  height: 100vh;
  background: var(--bg-white);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  z-index: 1001;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding: 2rem;
  border-left: 1px solid var(--border-light);
}

.simulation-popup.open {
  right: 0;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.popup-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: -0.01em;
}

.close-popup {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.close-popup:hover {
  color: var(--text-dark);
  background: var(--bg-light);
}

.simulation-popup-intro {
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

.simulation-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text-dark);
  background: var(--bg-white);
  transition: all 0.2s;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3px rgba(134, 61, 255, 0.1);
}

.form-input:hover {
  border-color: #d1d5db;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.375rem;
  font-weight: 400;
}

.popup-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.btn-cancel {
  flex: 1;
  padding: 0.625rem 1rem;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-dark);
  font-size: 0.875rem;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background: var(--bg-light);
  border-color: #d1d5db;
}

.btn-update {
  flex: 1;
  padding: 0.625rem 1rem;
  background: var(--primary-purple);
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  color: white;
  font-size: 0.875rem;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.btn-update:hover {
  background: #7c3aed;
  box-shadow: var(--shadow-md);
}

.simulated-results {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.simulated-intro {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
  font-weight: 400;
  line-height: 1.5;
}

.simulated-kpi-card {
  background: var(--bg-light);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 0.875rem;
  border: 1px solid var(--border-light);
}

.simulated-kpi-label {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 0.375rem;
  font-weight: 500;
}

.simulated-kpi-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.simulated-kpi-value.empty {
  color: var(--text-light);
  font-weight: 400;
}

.simulated-kpi-change {
  font-size: 0.8125rem;
  font-weight: 500;
}

.simulated-kpi-change.positive {
  color: var(--success-green);
}

.simulated-kpi-change.negative {
  color: var(--danger-red);
}

.chart-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.chart-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.8125rem;
  background: var(--bg-white);
  color: var(--text-dark);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.chart-select:hover {
  border-color: #d1d5db;
}

.chart-select:focus {
  outline: none;
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3px rgba(134, 61, 255, 0.1);
}

.custom-tooltip {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  z-index: 10000;
  transition: opacity 0.2s;
  background: #1e293b;
  color: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-size: 0.85rem;
  min-width: 220px;
}

.custom-tooltip.is-visible {
  opacity: 1;
}

.tooltip-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  gap: 1rem;
}

.tooltip-label {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
}

.tooltip-value {
  color: white;
  font-weight: 600;
  text-align: right;
}

.is-hidden {
  display: none !important;
}
