/* ==========================================================================
   AGRIVA DESIGN SYSTEM — AGROMIND DARK-FIRST MODERN AGRITECH STYLE
   Inspired by modern dark agronomy dashboards with vibrant emerald accents
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg: #0B131B;
  --sidebar-bg: #0F1722;
  --topbar-bg: #0F1722;
  --surface: #14202C;
  --surface-sec: #182635;
  --surface-hover: #1D2D3E;
  --border: #1E2E3E;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --text: #F1F5F9;
  --text-primary: #FFFFFF;
  --muted: #94A3B8;
  --muted-dim: #64748B;
  
  /* Vibrant Agro Emerald Green */
  --primary: #00D06C;
  --primary-hover: #00E67A;
  --primary-gradient: linear-gradient(135deg, #00A651 0%, #00C868 55%, #05DF76 100%);
  --primary-soft: rgba(0, 208, 108, 0.12);
  --primary-border: rgba(0, 208, 108, 0.3);
  --primary-text: #04180E;
  --primary-glow: 0 4px 20px rgba(0, 208, 108, 0.35);
  
  /* Secondary Accents */
  --info: #38BDF8;
  --info-soft: rgba(56, 189, 248, 0.12);
  --warning: #FBBF24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --warning-text: #FDE047;
  --danger: #F87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
  
  --radius: 18px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-pill: 9999px;
  --font-base: 15px;
}

[data-theme="light"] {
  --bg: #F4F7F6;
  --sidebar-bg: #FFFFFF;
  --topbar-bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-sec: #EDF3F0;
  --surface-hover: #E4ECE8;
  --border: #D1DCD6;
  --border-subtle: rgba(0, 0, 0, 0.05);
  --text: #0E1E19;
  --text-primary: #04180E;
  --muted: #4F645D;
  --muted-dim: #718780;
  
  --primary: #00A859;
  --primary-hover: #008F4C;
  --primary-gradient: linear-gradient(135deg, #008F4C 0%, #00A859 60%, #00C268 100%);
  --primary-soft: #E5F9EF;
  --primary-border: #B7ECCF;
  --primary-text: #FFFFFF;
  --primary-glow: 0 4px 16px rgba(0, 168, 89, 0.25);
  
  --info: #0284C7;
  --info-soft: #E0F2FE;
  --warning: #D97706;
  --warning-soft: #FEF3C7;
  --warning-text: #92400E;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;
  
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 14px 32px rgba(0, 0, 0, 0.12);
}

/* Ukuran Teks Besar / Mode Ramah Petani */
body.text-large {
  --font-base: 17px;
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: var(--font-base);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: var(--primary);
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.icon-xs { width: 15px; height: 15px; vertical-align: middle; }
.icon-sm { width: 18px; height: 18px; vertical-align: middle; }
.icon-md { width: 22px; height: 22px; vertical-align: middle; }
.icon-lg { width: 28px; height: 28px; vertical-align: middle; }
.icon-xl { width: 34px; height: 34px; vertical-align: middle; }

/* ==========================================================================
   TOP SIMULATION BANNER (COMPACT & SLEEK)
   ========================================================================== */
.sim-banner {
  background-color: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  padding: 6px 18px;
  font-size: 0.8rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.sim-banner-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sim-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--warning-text);
  background: var(--warning-soft);
  border: 1px solid var(--warning);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
}

.sim-info {
  color: var(--muted);
  font-size: 0.78rem;
}

.sim-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.76rem;
  transition: all 0.2s ease;
}

.btn-banner:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

/* ==========================================================================
   BRAND LOGO & USER PROFILE BADGE
   ========================================================================== */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  cursor: pointer;
}

.brand-icon-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 208, 108, 0.4);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  margin: 16px 0 10px;
  border-radius: var(--radius-md);
  background: var(--surface-sec);
  border: 1px solid var(--border-subtle);
}

.sidebar-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: #11202D;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(0, 208, 108, 0.25);
}

.sidebar-profile-info {
  min-width: 0;
  flex: 1;
}

.sidebar-profile-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-org {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   BUTTONS (MODERN PILL STYLING AS IN SCREENSHOT)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  border: 1.5px solid transparent;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-text);
  font-weight: 700;
  box-shadow: var(--primary-glow);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(0, 208, 108, 0.45);
}

.btn-secondary {
  background-color: var(--surface-sec);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--surface-hover);
}

.btn-danger {
  background-color: var(--danger);
  color: #FFFFFF;
}

.btn-warning {
  background-color: var(--warning);
  color: #0B131B;
  font-weight: 700;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 16px;
  font-size: 0.82rem;
}

.btn-pill-green {
  background: var(--primary);
  color: var(--primary-text);
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all 0.2s ease;
  position: relative;
}

.icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.notif-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ==========================================================================
   STATUS BADGES
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.badge-success {
  background-color: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-border);
}

.badge-info {
  background-color: var(--info-soft);
  color: var(--info);
  border-color: rgba(56, 189, 248, 0.3);
}

.badge-warning {
  background-color: var(--warning-soft);
  color: var(--warning-text);
  border-color: rgba(251, 191, 36, 0.3);
}

.badge-danger {
  background-color: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.3);
}

.badge-neutral {
  background-color: var(--surface-sec);
  color: var(--muted);
  border-color: var(--border);
}

/* ==========================================================================
   WORKSPACE LAYOUT & SIDEBAR (AGROMIND ARCHITECTURE)
   ========================================================================== */
.workspace {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 38px);
}

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 16px;
  position: sticky;
  top: 38px;
  height: calc(100vh - 38px);
  overflow-y: auto;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 14px;
}

.sidebar-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-dim);
  font-weight: 700;
  padding: 12px 12px 6px;
}

/* Nav Item (The Iconic Green Active Pill from the Reference Image) */
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92rem;
  text-align: left;
  width: 100%;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-item:hover {
  background: var(--surface);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--primary);
  color: var(--primary-text);
  font-weight: 700;
  box-shadow: var(--primary-glow);
}

.nav-item.active i {
  color: var(--primary-text);
}

/* Special Featured Sidebar Action Buttons (like "Analyze Crop Image" in image) */
.sidebar-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  width: 100%;
  margin-top: 8px;
  transition: all 0.2s ease;
}

.sidebar-action-green {
  background: rgba(0, 208, 108, 0.08);
  border: 1px solid rgba(0, 208, 108, 0.35);
  color: var(--primary);
}

.sidebar-action-green:hover {
  background: var(--primary);
  color: var(--primary-text);
  box-shadow: var(--primary-glow);
}

.sidebar-action-blue {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--info);
}

.sidebar-action-blue:hover {
  background: var(--info);
  color: #04180E;
}

.workspace-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg);
}

.topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 38px;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.workspace-content {
  padding: 28px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 100px;
}

/* ==========================================================================
   AGROMIND SIGNATURE HERO WELCOME BANNER (GREEN VIBRANT CARD)
   ========================================================================== */
.agro-hero-banner {
  background: var(--primary-gradient);
  border-radius: 20px;
  padding: 26px 28px;
  color: #FFFFFF;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 168, 89, 0.28);
}

.agro-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.agro-hero-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.agro-hero-subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 4px;
}

.agro-hero-badge-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.agro-hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.agro-hero-metric-box {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 14px 18px;
  text-align: center;
  backdrop-filter: blur(6px);
  transition: transform 0.2s ease;
}

.agro-hero-metric-box:hover {
  transform: translateY(-2px);
  background: rgba(0, 0, 0, 0.24);
}

.agro-hero-metric-label {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  margin-bottom: 4px;
}

.agro-hero-metric-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   INSIGHT CARDS (ROW OF 3 UNDER HERO BANNER)
   ========================================================================== */
.insight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.insight-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.insight-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insight-icon-green {
  background: rgba(0, 208, 108, 0.14);
  color: var(--primary);
}

.insight-icon-blue {
  background: rgba(56, 189, 248, 0.14);
  color: var(--info);
}

.insight-icon-amber {
  background: rgba(251, 191, 36, 0.14);
  color: var(--warning);
}

.insight-content {
  min-width: 0;
}

.insight-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.insight-desc {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ==========================================================================
   CARDS, GRIDS & KPI
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}

.card-soft {
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius);
  padding: 20px;
}

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

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 3px;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.kpi-foot {
  font-size: 0.78rem;
  color: var(--muted-dim);
}

/* ==========================================================================
   LIST ITEMS WITH SLIM PROGRESS BARS & BADGES (ACTIVE CROPS & TASKS)
   ========================================================================== */
.crop-item,
.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-sec);
  border: 1px solid var(--border-subtle);
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.crop-item:hover,
.task-item:hover {
  background: var(--surface-hover);
  border-color: var(--primary-border);
}

.crop-item-left,
.task-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.crop-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.crop-name,
.task-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.crop-field,
.task-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
}

.crop-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crop-progress-bar {
  width: 90px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.crop-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--primary);
}

.crop-pct {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 36px;
  text-align: right;
}

.task-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.task-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.task-badge-high {
  background: rgba(248, 113, 113, 0.15);
  color: #F87171;
}

.task-badge-med {
  background: rgba(251, 191, 36, 0.15);
  color: #FBBF24;
}

.task-due {
  font-size: 0.75rem;
  color: var(--muted-dim);
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface-sec);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary);
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(0, 208, 108, 0.18);
}

.form-help {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Choice Grid & Tile */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.choice-tile {
  border: 2px solid var(--border);
  background: var(--surface-sec);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  min-height: 96px;
  justify-content: center;
  transition: all 0.2s ease;
}

.choice-tile:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.choice-tile.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

/* ==========================================================================
   TABLES (RESPONSIVE CARD TRANSFORMATION ON MOBILE)
   ========================================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

.data-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface-sec);
  font-weight: 700;
}

.data-table tr:hover td {
  background-color: var(--surface-sec);
}

/* ==========================================================================
   MODAL & TOAST
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 13, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 300;
  backdrop-filter: blur(6px);
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.toast {
  background: var(--surface);
  color: var(--text);
  border-left: 5px solid var(--primary);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ==========================================================================
   FLOATING THEME TOGGLE (BOTTOM RIGHT SWITCH LIKE IN SCREENSHOT)
   ========================================================================== */
.floating-theme-switch {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 250;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px;
  box-shadow: var(--shadow-lg);
  gap: 4px;
}

.floating-theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.2s ease;
}

.floating-theme-btn.active {
  background: var(--primary);
  color: var(--primary-text);
  box-shadow: var(--primary-glow);
}

/* ==========================================================================
   WHATSAPP CHAT SIMULATOR
   ========================================================================== */
.chat-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-sec);
  display: flex;
  flex-direction: column;
  height: 520px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.chat-header {
  background: #00A651;
  color: #FFFFFF;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-messages {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.chat-bubble.incoming {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.chat-bubble.outgoing {
  align-self: flex-end;
  background: rgba(0, 208, 108, 0.18);
  border: 1px solid var(--primary-border);
  color: var(--text-primary);
}

.chat-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
  text-align: right;
}

.chat-input-bar {
  padding: 12px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

/* ==========================================================================
   PUBLIC LANDING SPECIFICS
   ========================================================================== */
.public-nav {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
}

.public-nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px;
}

.container-narrow {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 18px 96px;
}

.hero-section {
  padding: 48px 0 36px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hero-lead {
  font-size: 1.12rem;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* Mobile Bottom Navigation */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--sidebar-bg);
  border-top: 1px solid var(--border);
  z-index: 150;
  padding: 6px 8px;
  justify-content: space-around;
}

.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  min-height: 48px;
  justify-content: center;
}

.bottom-nav-btn.active {
  color: var(--primary);
  background: var(--primary-soft);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1024px) {
  .grid-5, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-section { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  .agro-hero-metrics { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .grid-3, .grid-2, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
  .hero-title { font-size: 2rem; }
  .workspace-content { padding: 18px 14px 96px; }

  /* Mobile Responsive Table -> Card Transform */
  .data-table thead {
    display: none;
  }
  .data-table, .data-table tbody, .data-table tr, .data-table td {
    display: block;
    width: 100%;
  }
  .data-table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    padding: 12px;
  }
  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 6px;
    border-bottom: 1px dashed var(--border);
    text-align: right;
  }
  .data-table td:last-child {
    border-bottom: none;
  }
  .data-table td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--muted);
    text-align: left;
    margin-right: 12px;
  }
}

@media print {
  .sim-banner, .sidebar, .topbar, .bottom-nav, .floating-theme-switch, .no-print {
    display: none !important;
  }
  .workspace {
    display: block;
  }
  .card {
    box-shadow: none;
    border: 1px solid #999;
    break-inside: avoid;
  }
}
