:root {
  color-scheme: light;
  --font-sans: 'Inter', 'Noto Sans', 'Noto Sans Devanagari', 'Noto Sans Bengali', 'Noto Sans Gurmukhi', 'Noto Sans Gujarati', 'Noto Sans Tamil', 'Noto Sans Telugu', 'Noto Sans Kannada', 'Noto Sans Malayalam', 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --color-forest: #163D2A;
  --color-emerald: #1E7A43;
  --color-leaf: #4CAF50;
  --color-mint: #A5D6A7;
  --color-beige: #F5F1E8;
  --color-gold: #C6A75E;
  --color-blue: #4DA6FF;
  --color-orange: #FF9800;
  --color-red: #E53935;

  --color-text: #132418;
  --color-muted: #5A6B60;

  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.7);
  --surface-border: rgba(22, 61, 42, 0.12);

  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;

  --shadow-soft: 0 12px 30px -18px rgba(22, 61, 42, 0.32);
  --shadow-floating: 0 20px 50px -28px rgba(15, 23, 42, 0.4);
  --shadow-card: 0 16px 40px -24px rgba(22, 61, 42, 0.35);

  --bg-grad-1: #E4F2E7;
  --bg-grad-2: #F5F1E8;
  --bg-grad-3: #DFF3EE;
  --transition-base: 200ms ease;
}

.theme-dark {
  color-scheme: dark;
  --color-beige: #0F2A1E;
  --color-text: #E6F4EA;
  --color-muted: #9FB7A7;
  --surface: rgba(27, 58, 42, 0.86);
  --surface-solid: #1B3A2A;
  --surface-glass: rgba(27, 58, 42, 0.72);
  --surface-border: rgba(165, 214, 167, 0.18);
  --shadow-soft: 0 18px 50px -28px rgba(0, 0, 0, 0.6);
  --shadow-floating: 0 24px 60px -32px rgba(0, 0, 0, 0.72);
  --shadow-card: 0 20px 50px -28px rgba(0, 0, 0, 0.68);
  --bg-grad-1: #0F2A1E;
  --bg-grad-2: #122C21;
  --bg-grad-3: #1B3A2A;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--color-beige);
  color: var(--color-text);
  font-family: var(--font-sans);
}

.layout-shell {
  width: 100%;
  overflow-x: hidden;
}

.font-sans {
  font-family: var(--font-sans);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes navBounce {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.05); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-16px); }
  100% { transform: translateY(0px); }
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-in-out forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.3s ease-in-out forwards;
}

.nav-bounce {
  animation: navBounce 0.3s ease-out;
}

.shimmer-bg {
  position: relative;
  overflow: hidden;
  background-color: rgba(148, 163, 184, 0.2);
}

.shimmer-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.2) 20%, rgba(255, 255, 255, 0.45) 60%, rgba(255, 255, 255, 0));
  animation: shimmer 1.5s infinite;
}

.badge-shimmer {
  position: relative;
  overflow: hidden;
}

.badge-shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.45) 50%, transparent 100%);
  animation: shimmer 2.4s infinite;
}

.count-up {
  animation: fadeInUp 0.3s ease;
}

.form-input-high-contrast {
  margin-top: 0.25rem;
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background-color: var(--surface-solid);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: box-shadow 150ms ease, border-color 150ms ease;
}

.form-input-high-contrast:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(30, 122, 67, 0.35);
  border-color: rgba(30, 122, 67, 0.6);
}

.form-input-inline-edit {
  background: transparent;
  border: 0;
  border-bottom: 2px solid rgba(15, 23, 42, 0.2);
  transition: border-color 150ms ease;
}

.form-input-inline-edit:focus {
  outline: none;
  border-bottom-color: var(--color-emerald);
  box-shadow: none;
}

.form-input-modal {
  margin-top: 0.25rem;
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background-color: var(--surface-solid);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: box-shadow 150ms ease;
}

.form-input-modal:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(30, 122, 67, 0.35);
}

.form-input-dark-modal {
  margin-top: 0.25rem;
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background-color: var(--surface-solid);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  color: var(--color-text);
  transition: box-shadow 150ms ease;
}

.form-input-dark-modal::placeholder {
  color: rgba(90, 107, 96, 0.8);
}

.form-input-dark-modal:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(30, 122, 67, 0.35);
}

.text-forest { color: var(--color-forest); }
.bg-forest { background-color: var(--color-forest); }
.text-emerald { color: var(--color-emerald); }
.bg-emerald { background-color: var(--color-emerald); }
.text-leaf { color: var(--color-leaf); }
.bg-leaf { background-color: var(--color-leaf); }
.text-mint { color: var(--color-mint); }
.bg-mint { background-color: var(--color-mint); }
.text-gold { color: var(--color-gold); }
.bg-gold { background-color: var(--color-gold); }
.text-muted { color: var(--color-muted); }
.bg-beige { background-color: var(--color-beige); }
.bg-surface { background-color: var(--surface-solid); }
.bg-surface-glass { background-color: var(--surface-glass); }
.border-forest { border-color: var(--color-forest); }
.border-emerald { border-color: var(--color-emerald); }
.border-surface { border-color: var(--surface-border); }

.bg-beige\/80 { background-color: rgba(245, 241, 232, 0.8); }
.bg-leaf\/20 { background-color: rgba(76, 175, 80, 0.2); }
.bg-leaf\/10 { background-color: rgba(76, 175, 80, 0.1); }
.bg-emerald\/80 { background-color: rgba(30, 122, 67, 0.8); }
.bg-emerald\/10 { background-color: rgba(30, 122, 67, 0.1); }
.bg-forest\/10 { background-color: rgba(22, 61, 42, 0.1); }
.bg-forest\/5 { background-color: rgba(22, 61, 42, 0.05); }
.bg-gold\/20 { background-color: rgba(198, 167, 94, 0.2); }

.shadow-soft {
  box-shadow: var(--shadow-soft);
}

.shadow-floating {
  box-shadow: var(--shadow-floating);
}

.shadow-card {
  box-shadow: var(--shadow-card);
}

.bg-gradient-forest {
  background-image: linear-gradient(120deg, var(--color-emerald), var(--color-leaf));
}

.bg-gradient-primary {
  background-image: linear-gradient(120deg, var(--color-emerald), var(--color-leaf));
}

.bg-gradient-carbon {
  background-image: linear-gradient(120deg, var(--color-emerald), var(--color-gold));
}

.bg-gradient-weather {
  background-image: linear-gradient(120deg, var(--color-blue), #8BCBFF);
}

.text-gradient-brand {
  background: linear-gradient(120deg, var(--color-emerald), var(--color-leaf));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.card-surface {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card-surface:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-floating);
}

.glass-panel {
  background: var(--surface-glass);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.btn-primary {
  background-image: linear-gradient(120deg, var(--color-emerald), var(--color-leaf));
  color: #fff;
  box-shadow: 0 12px 24px -18px rgba(30, 122, 67, 0.6);
}

.btn-primary:hover {
  box-shadow: 0 16px 30px -18px rgba(30, 122, 67, 0.75);
}

.btn-secondary {
  background: rgba(22, 61, 42, 0.08);
  color: var(--color-forest);
}

.btn-outline {
  border: 1px solid rgba(22, 61, 42, 0.2);
  color: var(--color-forest);
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(45deg, var(--bg-grad-1), var(--bg-grad-2), var(--bg-grad-3));
  background-size: 400% 400%;
  animation: gradientBG 18s ease infinite;
  z-index: -2;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.theme-dark .bg-white,
.theme-dark .bg-white\/80,
.theme-dark .bg-white\/70,
.theme-dark .bg-white\/50 {
  background-color: var(--surface-solid) !important;
}

.theme-dark .bg-gray-50,
.theme-dark .bg-gray-100,
.theme-dark .bg-gray-200 {
  background-color: rgba(255, 255, 255, 0.04) !important;
}

.theme-dark .text-gray-400,
.theme-dark .text-gray-500,
.theme-dark .text-gray-600,
.theme-dark .text-gray-700 {
  color: var(--color-muted) !important;
}

.theme-dark .text-gray-800,
.theme-dark .text-gray-900 {
  color: var(--color-text) !important;
}

.theme-dark .text-forest {
  color: var(--color-text) !important;
}

.theme-dark .border-gray-200,
.theme-dark .border-gray-300,
.theme-dark .border-gray-100 {
  border-color: var(--surface-border) !important;
}

.theme-dark .bg-amber-50,
.theme-dark .bg-amber-100,
.theme-dark .bg-amber-200 {
  background-color: rgba(198, 167, 94, 0.12) !important;
}

.theme-dark .shadow-lg,
.theme-dark .shadow-xl,
.theme-dark .shadow-2xl {
  box-shadow: var(--shadow-card) !important;
}

@media (max-width: 768px) {
  .layout-content {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .overflow-x-auto table {
    min-width: 680px;
  }
}

@media (max-width: 640px) {
  .overflow-x-auto {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .overflow-x-auto table {
    min-width: 620px;
  }

  .overflow-x-auto th,
  .overflow-x-auto td {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .overflow-x-auto th {
    font-size: 0.65rem !important;
  }

  .overflow-x-auto td {
    font-size: 0.82rem !important;
  }

  .text-6xl {
    font-size: 2.1rem !important;
    line-height: 1.15 !important;
  }

  .text-5xl {
    font-size: 1.9rem !important;
    line-height: 1.2 !important;
  }

  .text-4xl {
    font-size: 1.6rem !important;
    line-height: 1.25 !important;
  }

  .text-3xl {
    font-size: 1.35rem !important;
    line-height: 1.3 !important;
  }

  .text-2xl {
    font-size: 1.2rem !important;
    line-height: 1.35 !important;
  }

  .p-8 {
    padding: 1.5rem !important;
  }

  .p-6 {
    padding: 1.25rem !important;
  }

  .px-8 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }

  .py-8 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }

  .gap-8 {
    gap: 1.25rem !important;
  }

  .gap-10 {
    gap: 1.5rem !important;
  }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .rounded-3xl {
    border-radius: 1.25rem !important;
  }
}
