:root {
  --brand: #ef300a;
  --bg: #0b0f1a;
  --panel: #0f1629;
  --text: #e8eefc;
  --muted: #9fb0d3;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --radius: 16px;
  --grad-1: linear-gradient(135deg, #10192f 0%, #182442 50%, #233155 100%);
  --grad-2: linear-gradient(135deg, #35e0ad 0%, #3ea2ff 100%);
  --grad-3: linear-gradient(135deg, #ffa63d 0%, #ff5f6d 100%);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
  max-width: 400px;
  padding: 40px;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top: 4px solid #7a5cff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-content h2 {
  margin: 0 0 12px 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.loading-content p {
  margin: 0 0 24px 0;
  font-size: 16px;
  color: var(--muted);
  font-weight: 500;
}

.loading-progress {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  background: linear-gradient(90deg, #7a5cff, #b298ff);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

.app { max-width: 1280px; margin: 0 auto; padding: 32px 28px; }

.app-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 40px;
}

.logo-left, .logo-right { 
  display: flex; align-items: center; 
}

.logo-left {
  gap: 16px;
}

.company-name {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.page-title {
  margin-bottom: 20px;
}
.page-title h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: 0.2px; }
.partner-logo { 
  height: 60px; max-width: 150px; object-fit: contain; 
  filter: brightness(0) invert(1); 
}
.logo-left .partner-logo { 
  height: 29px; max-width: 71px; 
}

.card {
  background: transparent;
  border: none;
  border-radius: var(--radius);
  padding: 18px;
}
.hoverable { transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease; }
.hoverable:hover { transform: translateY(-2px); }

.page-title h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: 0.3px; }
.page-title { margin: 2px 0 10px; }
.intro { margin: 8px 0 56px; color: var(--muted); }

.controls { margin: 0; }
.overall-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 6px 0 14px; }
.overall-controls { display: flex; align-items: center; gap: 8px; }
.overall-controls label { font-weight: 600; color: var(--muted); }
.year-select {
  padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.15);
  background: #0d1426; color: var(--text);
  font-size: 14px; font-weight: 600;
}
.year-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(239,48,10,0.25); }

.overall { display: block; margin: 28px 0; }
.overall-header h2 { margin: 0 0 6px; font-size: 22px; }
.overall-header p { margin: 0; color: var(--muted); }
.gauge-wrap { display: flex; align-items: center; gap: 32px; margin-top: 10px; min-height: 150px; }
.gauge { display: none; }
.overall-bar { flex: 1; }
.gauge-legend { display: flex; gap: 16px; color: var(--muted); font-size: 14px; align-items: center; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-current { background: #7a5cff; }
.dot-target { background: #ef300a; }

.products-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 28px 0 40px; }
.product-card { position: relative; overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03)); border: 1px solid rgba(255,255,255,0.08); box-shadow: var(--shadow); backdrop-filter: blur(6px); }
.product-card::before {
  content: ""; position: absolute; inset: -2px; border-radius: calc(var(--radius) + 2px);
  background: var(--grad-1); filter: blur(30px); opacity: 0.20; z-index: 0;
}
.product-card:hover::before { opacity: 0.35; }
.product-disabled { opacity: 0.4; pointer-events: none; }
.product-disabled .product-title,
.product-disabled .product-metric,
.product-disabled .kpi,
.product-disabled .kpi .label,
.product-disabled .kpi .value { color: rgba(159,176,211,0.5) !important; }

.product-inactive { opacity: 0.6; }
.product-inactive .product-title,
.product-inactive .product-subtitle,
.product-inactive .kpi,
.product-inactive .kpi .label,
.product-inactive .kpi .value { color: rgba(159,176,211,0.7) !important; }
.product-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 160px; gap: 16px; align-items: start; }
.product-title { font-size: 18px; font-weight: 700; margin: 0 0 2px; line-height: 1.2; }
.product-subtitle { color: var(--muted); margin: 0 0 12px; font-size: 13px; font-weight: 500; }
.kpis { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.kpi { background: #0c1323; padding: 8px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.06); width: 100%; }
.kpi .label { display: block; color: var(--muted); font-size: 9px; }
.kpi .value { display: block; font-weight: 700; margin-top: 0; font-size: 13px; }
.kpi-muted { background: rgba(12,19,35,0.28) !important; border-color: rgba(255,255,255,0.05) !important; }
.kpi-strong { background: #0c1323 !important; border-color: rgba(239,48,10,0.00) !important; }
.kpi .label.label-saving { display: block; white-space: normal; overflow-wrap: anywhere; word-break: break-all; line-height: 1.05; }
.product-gauge { width: 140px; height: 90px; margin-top: 48px; background: transparent; border: none; border-radius: 12px; }

.app-footer { text-align: center; color: var(--muted); margin: 24px 0 8px; }

@media (max-width: 1024px) {
  .gauge { width: 100%; max-width: 320px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .product-inner { grid-template-columns: 1fr; }
  .product-gauge { width: 100%; height: 120px; margin-top: 16px; }
}

@media (max-width: 768px) {
  .products-grid { grid-template-columns: 1fr; }
  .product-inner { grid-template-columns: 1fr; }
  .product-gauge { width: 100%; height: 100px; margin-top: 16px; }
  .app { padding: 16px 14px; }
  .app-header { margin-bottom: 24px; }
  .page-title h1 { font-size: 24px; }
  .overall-header h2 { font-size: 20px; }
  .gauge-wrap { flex-direction: column; gap: 16px; }
  .overall-bar { width: 100%; }
}

@media (max-width: 640px) {
  .products-grid { grid-template-columns: 1fr; }
  .product-inner { grid-template-columns: 1fr; }
  .product-gauge { width: 100%; height: 80px; margin-top: 12px; }
  .kpis { margin-top: 8px; }
  .kpi { padding: 6px 10px; }
  .app { padding: 12px 10px; }
  .page-title h1 { font-size: 20px; }
  .overall-header h2 { font-size: 18px; }
  .overall-header p { font-size: 14px; }
}


