/* AgriHub Design System — harvest green tokens, typography, motion */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700;9..144,800&family=Nunito:wght@400;600;700;800&display=swap');

:root,
[data-theme="dark"] {
  color-scheme: dark;

  --bg: #07140c;
  --bg2: #0c1c12;
  --card: #12241a;
  --card2: #17301f;
  --border: #1f3d2a;
  --border2: #2d5740;

  --cyan: #3dcc6a;
  --cyan2: #2aad54;
  --cyan3: #15803d;
  --text: #e8f5ec;
  --text2: #8eae98;
  --white: #f4fbf6;

  --gold: #e8b84a;
  --green: #4ade80;
  --red: #ff4d6a;
  --purple: #b06cff;

  --gradient: linear-gradient(135deg, #4ade80, #15803d);
  --gradient-gold: linear-gradient(135deg, #c8860a, #e8b84a);
  --hero-bg: linear-gradient(145deg, #102418 0%, #0e1c12 58%, #14280c 100%);
  --hero-glow: radial-gradient(circle, rgba(61, 204, 106, 0.22), transparent 68%);

  --table-head: #0e1c14;
  --row-line: #1a3224;
  --row-hover: #17301f;
  --nav-hover: #17301f;
  --nav-active: rgba(61, 204, 106, 0.12);
  --inset: #0a1810;
  --overlay: rgba(4, 12, 8, 0.72);
  --on-accent: #06210e;
  --ghost-bg: rgba(255, 255, 255, 0.1);
  --ghost-border: rgba(255, 255, 255, 0.2);
  --accent-soft: rgba(61, 204, 106, 0.12);
  --success-bg: rgba(74, 222, 128, 0.12);
  --success-border: rgba(74, 222, 128, 0.32);
  --warn-bg: rgba(232, 184, 74, 0.12);
  --warn-border: rgba(232, 184, 74, 0.34);
  --danger-bg: rgba(255, 77, 106, 0.12);
  --danger-border: rgba(255, 77, 106, 0.34);
  --info-bg: rgba(56, 160, 255, 0.12);
  --info-border: rgba(56, 160, 255, 0.3);
  --pending-bg: rgba(232, 184, 74, 0.12);
  --pending-border: rgba(232, 184, 74, 0.34);
  --neutral-bg: rgba(142, 174, 152, 0.12);
  --neutral-border: rgba(142, 174, 152, 0.28);
  --purple-soft: rgba(176, 108, 255, 0.14);
  --chrome: #07140c;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 18px 52px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 28px rgba(61, 204, 106, 0.18);

  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --sw: 250px;
  --nh: 72px;
  --bh: 78px;
  --radius: 22px;
  --radius2: 16px;
  --radius3: 10px;

  --font-sans: 'Nunito', 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 150ms;
  --dur-normal: 250ms;
  --dur-slow: 400ms;
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #f2f7f0;
  --bg2: #f7fbf6;
  --card: #ffffff;
  --card2: #f3f8f2;
  --border: #c5d8c8;
  --border2: #b3cbb7;

  --cyan: #1b8a45;
  --cyan2: #157a3c;
  --cyan3: #116433;
  --text: #1c2e22;
  --text2: #5c7364;
  --white: #122018;

  --gold: #b77908;
  --green: #0f9d58;
  --red: #c62840;
  --purple: #7c3aed;

  --gradient: linear-gradient(135deg, #4ade80, #15803d);
  --gradient-gold: linear-gradient(135deg, #b8780a, #e8b020);
  --hero-bg: linear-gradient(145deg, #f7fbf4 0%, #e7f5e4 52%, #d4edc8 100%);
  --hero-glow: radial-gradient(circle, rgba(27, 138, 69, 0.18), transparent 70%);

  --table-head: #eaf3ea;
  --row-line: #dce8dc;
  --row-hover: #eef6ee;
  --nav-hover: #e8f3e8;
  --nav-active: rgba(27, 138, 69, 0.1);
  --inset: #e6efe6;
  --overlay: rgba(18, 32, 24, 0.45);
  --on-accent: #06210e;
  --ghost-bg: rgba(18, 32, 24, 0.06);
  --ghost-border: rgba(18, 32, 24, 0.14);
  --accent-soft: rgba(27, 138, 69, 0.1);
  --success-bg: rgba(15, 157, 88, 0.1);
  --success-border: rgba(15, 157, 88, 0.28);
  --warn-bg: rgba(183, 121, 8, 0.1);
  --warn-border: rgba(183, 121, 8, 0.3);
  --danger-bg: rgba(198, 40, 64, 0.1);
  --danger-border: rgba(198, 40, 64, 0.28);
  --info-bg: rgba(14, 116, 184, 0.1);
  --info-border: rgba(14, 116, 184, 0.26);
  --pending-bg: rgba(183, 121, 8, 0.1);
  --pending-border: rgba(183, 121, 8, 0.3);
  --neutral-bg: rgba(92, 115, 100, 0.1);
  --neutral-border: rgba(92, 115, 100, 0.24);
  --purple-soft: rgba(124, 58, 237, 0.1);
  --chrome: #f2f7f0;

  --shadow-sm: 0 2px 10px rgba(20, 48, 28, 0.07);
  --shadow-md: 0 10px 28px rgba(20, 48, 28, 0.1);
  --shadow-lg: 0 18px 48px rgba(20, 48, 28, 0.14);
  --shadow-glow: 0 8px 28px rgba(27, 138, 69, 0.16);
}

/* Global typography & motion overrides */
html {
  background: var(--bg);
}

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(1100px 480px at 92% -8%, var(--accent-soft), transparent 52%),
    var(--bg);
  color: var(--text);
}

h1, h2, h3, .brand-name, .u-hero-val, .mcard-name, .adm-topbar h2 {
  font-family: var(--font-display);
}

/* Smooth theme transition */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition: background-color var(--dur-normal) var(--ease-out),
              border-color var(--dur-normal) var(--ease-out),
              color var(--dur-normal) var(--ease-out),
              box-shadow var(--dur-normal) var(--ease-out) !important;
}

/* Theme toggle button */
.theme-btn {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-spring),
              border-color var(--dur-fast),
              background-color var(--dur-fast);
  flex-shrink: 0;
}
.theme-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: scale(1.06);
}
.theme-btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.theme-btn .theme-icon-moon,
.theme-btn .lucide-moon { display: none; }
[data-theme="light"] .theme-btn .theme-icon-sun,
[data-theme="light"] .theme-btn .lucide-sun { display: none; }
[data-theme="light"] .theme-btn .theme-icon-moon,
[data-theme="light"] .theme-btn .lucide-moon { display: block; }
.theme-btn svg { width: 18px; height: 18px; }

::placeholder { color: var(--text2); opacity: 0.78; }
::selection { background: var(--accent-soft); color: var(--white); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
