:root {
  --primary: #d97706;
  --secondary: #92400e;
  --accent: #f59e0b;
  --background: #12100e;
  --card-bg: #1c1917;
  --text-primary: #fafaf9;
  --text-secondary: #a8a29e;
  --success: #15803d;
  --error: #991b1b;
  --warning: #ca8a04;
  --border: #2d2a28;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  background: var(--card-bg);
  padding: 1rem 2rem;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-controls {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.project-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.project-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.project-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.4rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.toggle-group {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  width: fit-content;
}

.toggle-group input {
  display: none;
}

.toggle-group label {
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 7px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.toggle-group input:checked + label {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.4);
}

.filter-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  min-width: 80px;
}

.form-select, .form-control {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  outline: none;
  transition: all 0.3s ease;
}

.form-select:focus, .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}

.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

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

.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-container {
  width: 100%;
  height: 300px;
  position: relative;
}

/* Visualization Styles */
.dc-chart {
  float: none !important;
}

.dc-chart path.area {
  fill-opacity: .3;
}

.dc-chart g.row text {
  fill: var(--text-primary);
}

.dc-chart .axis path, .dc-chart .axis line {
  stroke: var(--border);
}

.dc-chart .axis text {
  fill: var(--text-secondary);
}

.dc-chart .grid-line line {
  stroke: var(--border);
  stroke-dasharray: 4;
}

/* Login Page Styles */
body.login-page {
  background: radial-gradient(circle at center, #1a237e 0%, #121212 100%);
}

body.login-page main {
  align-items: center;
  justify-content: center;
}

.login-card {
  max-width: 400px;
  width: 100%;
  padding: 3rem;
  text-align: center;
}

.login-logo {
  font-size: 3rem;
  margin-bottom: 2rem;
  display: block;
}

.input-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.input-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.status-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge.success { background: rgba(102, 187, 106, 0.2); color: var(--success); }
.status-badge.error { background: rgba(239, 83, 80, 0.2); color: var(--error); }

.logout-link {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  margin-left: 1rem;
}

.logout-link:hover {
  color: var(--accent);
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.filter-clear {
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.filter-clear:hover {
  color: var(--text-primary);
}

.version-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 0.5rem;
}

.version-select:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}

.version-select option {
  background: #1c1917;
  color: var(--text-primary);
}

.btn-reset {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 1rem;
  transition: all 0.2s ease;
}

.btn-reset:hover {
  background: var(--primary);
  color: white;
}

/* --- Footer --- */
footer {
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.version-tag {
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
}

.github-link {
  color: inherit;
  text-decoration: none;
}
.github-link:hover {
  text-decoration: underline;
}

/* Utility & Login specific */
.login-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.w-full {
  width: 100%;
}

.flex-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-skip {
  background: transparent !important;
  color: var(--text-secondary) !important;
  text-decoration: underline !important;
  border: none !important;
}

.btn-skip:hover {
  color: var(--text-primary) !important;
}

.status-container {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  display: none;
}

.hidden {
  display: none !important;
}

.chart-h-400 {
  height: 400px;
}
