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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #172b4d;
  background: #fff;
  padding: 8px;
}

button {
  background: #0079bf;
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
}

button:hover {
  background: #026aa7;
}

button:disabled {
  background: #a5adba;
  cursor: not-allowed;
}

/* Improved loading states */
.loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5e6c84;
}

.loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid #e4e9f0;
  border-top-color: #0079bf;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Improved error states */
.error {
  background: #ffebe6;
  border: 1px solid #eb5a46;
  border-radius: 6px;
  padding: 16px;
  color: #ae2e24;
}

.error button {
  margin-top: 12px;
  background: #eb5a46;
}

.error button:hover {
  background: #c9372c;
}

/* Success states */
.success {
  background: #e3fcef;
  border: 1px solid #4bce97;
  border-radius: 6px;
  padding: 16px;
  color: #216e4e;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 40px;
  color: #5e6c84;
}

.empty-state p {
  margin-bottom: 16px;
}

/* Tooltip styles */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: #172b4d;
  color: white;
  font-size: 12px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* Focus styles for accessibility */
button:focus,
input:focus,
select:focus {
  outline: 2px solid #0079bf;
  outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    flex-wrap: wrap;
  }

  .cards-table {
    font-size: 13px;
  }

  .cards-table th,
  .cards-table td {
    padding: 8px;
  }

  .export-buttons {
    flex-wrap: wrap;
  }

  .list-average-row .list-name {
    width: 100px;
  }
}
