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

:root {
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  
  --yellow-100: #fef9c3;
  --yellow-400: #facc15;
  --yellow-600: #ca8a04;
  
  --blue-100: #dbeafe;
  --blue-400: #60a5fa;
  --blue-600: #2563eb;
  
  --purple-100: #f3e8ff;
  --purple-400: #c084fc;
  
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.5;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: white;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  border-bottom: 1px solid var(--gray-200);
}

.logo-icon {
  font-size: 24px;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--green-700);
}

.nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-600);
  transition: all 0.15s;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.nav-item.active {
  background: var(--green-100);
  color: var(--green-700);
  font-weight: 500;
}

.nav-icon {
  font-size: 18px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--gray-200);
}

.plan-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--green-700);
  background: var(--green-100);
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 6px;
}

.products-used {
  font-size: 12px;
  color: var(--gray-500);
}

/* Main */
.main {
  flex: 1;
  margin-left: 240px;
  padding: 24px 32px;
}

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

.page-title {
  font-size: 24px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--green-500);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.btn-primary {
  background: var(--green-600);
  color: white;
}

.btn-primary:hover {
  background: var(--green-700);
}

.btn-outline {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* Views */
.view {
  display: none;
}

.view.active {
  display: block;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.green { background: var(--green-100); }
.stat-icon.blue { background: var(--blue-100); }
.stat-icon.yellow { background: var(--yellow-100); }
.stat-icon.purple { background: var(--purple-100); }

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
}

.stat-label {
  font-size: 13px;
  color: var(--gray-500);
}

.stat-trend {
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
}

.stat-trend.down {
  color: var(--green-600);
}

.stat-action {
  margin-left: auto;
  color: var(--blue-600);
  font-size: 13px;
  cursor: pointer;
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

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

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* Bar Chart */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-label {
  width: 80px;
  font-size: 13px;
  color: var(--gray-600);
}

.bar-track {
  flex: 1;
  height: 24px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-400), var(--green-500));
  border-radius: var(--radius-sm);
  transition: width 0.5s ease;
}

.bar-value {
  width: 50px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  text-align: right;
}

/* Compliance List */
.compliance-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compliance-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--gray-50);
}

.compliance-item.pass .compliance-icon {
  background: var(--green-100);
  color: var(--green-600);
}

.compliance-item.warning .compliance-icon {
  background: var(--yellow-100);
  color: var(--yellow-600);
}

.compliance-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.compliance-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--gray-800);
}

.compliance-desc {
  font-size: 12px;
  color: var(--gray-500);
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}

.table th {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td {
  font-size: 14px;
}

.badge-icon {
  font-size: 18px;
}

.badge-icon.inactive {
  opacity: 0.3;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.green {
  background: var(--green-100);
  color: var(--green-700);
}

.status-badge.yellow {
  background: var(--yellow-100);
  color: var(--yellow-600);
}

/* Compliance Check */
.check-card {
  max-width: 700px;
  margin: 0 auto;
}

.check-header {
  text-align: center;
  margin-bottom: 32px;
}

.check-header h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.check-header p {
  color: var(--gray-500);
}

.check-progress {
  margin-bottom: 32px;
}

.progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--green-500);
  width: 20%;
  transition: width 0.3s;
}

.progress-text {
  font-size: 13px;
  color: var(--gray-500);
}

.check-question h3 {
  font-size: 18px;
  margin-bottom: 20px;
}

.check-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.check-option {
  cursor: pointer;
}

.check-option input {
  display: none;
}

.option-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  transition: all 0.15s;
}

.check-option input:checked + .option-content {
  border-color: var(--green-500);
  background: var(--green-50);
}

.option-icon {
  font-size: 24px;
}

.check-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}

.check-result {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.check-result.hidden {
  display: none;
}

.result-header {
  margin-bottom: 24px;
}

.result-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.result-items {
  text-align: left;
  margin: 24px 0;
}

.result-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
}

.result-item.required {
  border-left: 4px solid var(--yellow-400);
}

.result-item.optional {
  border-left: 4px solid var(--green-400);
}

.result-item-icon {
  font-size: 24px;
}

.result-item-content h4 {
  font-size: 15px;
  margin-bottom: 4px;
}

.result-item-content p {
  font-size: 13px;
  color: var(--gray-500);
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
}

/* Calculator */
.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--green-500);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.input-with-unit {
  position: relative;
}

.input-with-unit input {
  padding-right: 50px;
}

.input-unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
}

.radio-group {
  display: flex;
  gap: 12px;
}

.radio-option {
  flex: 1;
  cursor: pointer;
}

.radio-option input {
  display: none;
}

.radio-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  transition: all 0.15s;
}

.radio-option input:checked + span {
  border-color: var(--green-500);
  background: var(--green-50);
}

.calc-results {
  position: sticky;
  top: 24px;
}

.results-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-500);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.results-content.hidden {
  display: none;
}

.result-total {
  text-align: center;
  padding: 32px 20px;
  background: linear-gradient(135deg, var(--green-50), var(--green-100));
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.result-label {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.result-value {
  font-size: 42px;
  font-weight: 700;
  color: var(--green-700);
}

.result-unit {
  font-size: 14px;
  color: var(--gray-500);
}

.result-breakdown {
  margin-bottom: 24px;
}

.result-breakdown h4,
.result-comparison h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}

.breakdown-value {
  font-weight: 500;
}

.result-comparison {
  margin-bottom: 24px;
}

.comparison-item {
  padding: 16px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  font-size: 14px;
  text-align: center;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Products Grid */
.products-header {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 10px 16px;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}

.search-bar input {
  flex: 1;
  border: none;
  font-size: 14px;
  outline: none;
}

.filter-group {
  display: flex;
  gap: 12px;
}

.filter-group select {
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: white;
  cursor: pointer;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.product-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.product-card.add-product {
  border: 2px dashed var(--gray-300);
  background: transparent;
  box-shadow: none;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--gray-400);
}

.product-card.add-product:hover {
  border-color: var(--green-400);
  color: var(--green-600);
  transform: none;
}

.add-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.product-image {
  font-size: 36px;
  background: var(--gray-100);
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-info h4 {
  font-size: 15px;
  margin-bottom: 4px;
}

.product-category {
  font-size: 12px;
  color: var(--gray-500);
}

.product-carbon {
  margin-top: auto;
}

.carbon-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--green-700);
}

.carbon-label {
  font-size: 12px;
  color: var(--gray-500);
}

.product-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge-active {
  font-size: 18px;
}

/* Reports */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.report-card {
  text-align: center;
}

.report-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.report-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.report-card p {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 16px;
}

.report-meta {
  font-size: 12px;
  color: var(--gray-400);
  margin-bottom: 16px;
}

.report-meta.warning {
  color: var(--yellow-600);
  font-weight: 500;
}

/* Badge Preview */
.badge-preview {
  display: flex;
  gap: 32px;
  align-items: center;
}

.product-badge {
  width: 180px;
  padding: 16px;
  border: 2px solid var(--green-200);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--green-50), white);
  text-align: center;
}

.badge-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.badge-logo {
  font-size: 18px;
}

.badge-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--green-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-content {
  margin-bottom: 12px;
}

.badge-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--green-700);
}

.badge-label {
  font-size: 11px;
  color: var(--gray-500);
}

.badge-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--gray-400);
  padding-top: 8px;
  border-top: 1px solid var(--green-100);
}

.badge-qr {
  font-size: 16px;
}

.badge-info {
  flex: 1;
}

.badge-info p {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 12px;
}

.badge-info code {
  display: block;
  padding: 12px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--gray-600);
  overflow-x: auto;
}

/* Responsive */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .calculator-grid {
    grid-template-columns: 1fr;
  }
  
  .calc-results {
    position: static;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  
  .main {
    margin-left: 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .check-options {
    grid-template-columns: 1fr;
  }
  
  .header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}
