:root {
  /* Databricks/Data Science Palette */
  --bg-color: #f5f6f7;
  --card-bg: #ffffff;
  --text-main: #1b2533;
  --text-muted: #5f738c;
  --primary: #ff3621; /* Databricks Orange/Red */
  --secondary: #1b2533; /* Dark Navy */
  --border-color: #e8eaed;
  --accent-blue: #00a2ff;
  --accent-teal: #00bdac;
  --accent-purple: #7b61ff;
  --accent-amber: #ffb800;
  
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  --radius: 4px;
  --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

header {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  padding: var(--spacing-md) var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--secondary);
}

.brand-icon {
  width: 24px;
  height: 24px;
  background: var(--primary);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2L2 7v10l10 5 10-5V7L12 2zm0 18l-8-4V8.5l8 4 8-4V16l-8 4z'/%3E%3C/svg%3E") no-repeat center;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2L2 7v10l10 5 10-5V7L12 2zm0 18l-8-4V8.5l8 4 8-4V16l-8 4z'/%3E%3C/svg%3E") no-repeat center;
}

.dashboard-container {
  padding: var(--spacing-lg);
  max-width: 1600px;
  margin: 0 auto;
}

.dashboard-title {
  margin-bottom: var(--spacing-lg);
}

.dashboard-title h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

.dashboard-title p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Grid Layouts */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.charts-grid-top {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.charts-grid-middle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.charts-grid-bottom {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

/* Components */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: var(--spacing-md);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.stat-card .label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--spacing-xs);
}

.stat-card .value {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-card .trend {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.trend.up { color: #008a00; }
.trend.down { color: #d11100; }

.chart-card {
  display: flex;
  flex-direction: column;
}

.chart-card .chart-header {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  display: flex;
  justify-content: space-between;
}

.chart-content {
  flex-grow: 1;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Visualization Placeholders */

/* Pie Chart Simulation */
.pie-placeholder {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  position: relative;
  background: conic-gradient(
    var(--accent-blue) 0% 35%,
    var(--accent-teal) 35% 60%,
    var(--accent-purple) 60% 85%,
    var(--accent-amber) 85% 100%
  );
}

.pie-placeholder::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: var(--card-bg);
  border-radius: 50%;
}

/* Bar Chart Simulation */
.bar-placeholder {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 0 10px;
}

.bar-item {
  flex: 1;
  background: var(--accent-blue);
  border-radius: 2px 2px 0 0;
  position: relative;
  transition: opacity 0.2s;
}

.bar-item:hover { opacity: 0.8; }

.bar-item.alt { background: var(--accent-teal); }

/* Line Chart Simulation */
.line-placeholder {
  width: 100%;
  height: 160px;
  position: relative;
  overflow: hidden;
}

.svg-line {
  width: 100%;
  height: 100%;
  stroke: var(--primary);
  stroke-width: 2.5;
  fill: none;
}

.svg-area {
  fill: rgba(255, 54, 33, 0.05);
}

.grid-lines {
  stroke: var(--border-color);
  stroke-width: 1;
}

/* Tooltips & Legends */
.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
  font-size: 0.7rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.btn-icon:hover {
  background: #f0f2f5;
}

@media (max-width: 1200px) {
  .stats-grid, .charts-grid-top, .charts-grid-middle, .charts-grid-bottom {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .stats-grid, .charts-grid-top, .charts-grid-middle, .charts-grid-bottom {
    grid-template-columns: 1fr;
  }
}
