@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  /* JuaKilimo Agricultural Palette */
  --primary: #1B4332;
  --primary-light: #2D6A4F;
  --primary-container: #D8F3DC;
  --on-primary-container: #081C15;

  --secondary: #D97706;
  --secondary-container: #FEF3C7;
  --on-secondary-container: #78350F;

  --tertiary: #0284C7;
  --tertiary-container: #E0F2FE;
  --on-tertiary-container: #0369A1;

  --soil: #582F0E;
  --success: #15803D;
  --success-bg: #DCFCE7;
  --warning: #EA580C;
  --warning-bg: #FFEDD5;
  --alert: #DC2626;
  --alert-bg: #FEE2E2;

  /* Surfaces & Backgrounds (Light Theme) */
  --bg-page: #F4F8F5;
  --surface: #FFFFFF;
  --surface-alt: #EDF5EE;
  --surface-border: #D5E2D7;
  --surface-border-subtle: #E5EFE7;
  --surface-hover: #F0F6F1;

  /* Typography Colors */
  --text-main: #142018;
  --text-muted: #4B5A50;
  --text-subtle: #76877B;
  --text-inverse: #FFFFFF;

  /* Elevation */
  --shadow-sm: 0 1px 3px rgba(20, 36, 27, 0.06), 0 1px 2px rgba(20, 36, 27, 0.04);
  --shadow-md: 0 4px 8px -1px rgba(20, 36, 27, 0.08), 0 2px 4px -2px rgba(20, 36, 27, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(20, 36, 27, 0.12), 0 4px 6px -2px rgba(20, 36, 27, 0.05);
  --shadow-glow: 0 0 20px rgba(45, 106, 79, 0.25);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-display: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --primary: #52B788;
  --primary-light: #74C69D;
  --primary-container: #1B4332;
  --on-primary-container: #D8F3DC;

  --secondary: #FBBF24;
  --secondary-container: #78350F;
  --on-secondary-container: #FEF3C7;

  --tertiary: #38BDF8;
  --tertiary-container: #082F49;
  --on-tertiary-container: #E0F2FE;

  --bg-page: #0B1610;
  --surface: #122119;
  --surface-alt: #182C22;
  --surface-border: #243D30;
  --surface-border-subtle: #1C3327;
  --surface-hover: #1E372A;

  --text-main: #EEF7F1;
  --text-muted: #B4C7BA;
  --text-subtle: #7D9384;
  --text-inverse: #081C15;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(82, 183, 136, 0.3);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, .brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* Header (Matching Screenshot) */
.app-header {
  background: #061911;
  border-bottom: 1px solid #123425;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.header-inner {
  width: 100%;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.brand-logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #09261a;
  border: 1px solid #1a533b;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #22c55e;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.2);
}

.brand-text h1 {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.15;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.brand-text .brand-subtitle {
  font-size: 11.5px;
  font-weight: 600;
  color: #22c55e;
  letter-spacing: 0.03em;
}

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

/* Farm Selector Pill */
.farm-select-pill {
  display: flex;
  align-items: center;
  background: #092117;
  border: 1px solid #164632;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  gap: 8px;
  color: #eef7f1;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s;
}

.farm-select-pill:hover {
  border-color: #22c55e;
}

.farm-select-icon {
  font-size: 13px;
  display: flex;
  align-items: center;
}

.farm-select {
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: #eef7f1;
  outline: none;
  cursor: pointer;
}

.farm-select option {
  background: #081d14;
  color: #eef7f1;
}

.dropdown-chevron {
  font-size: 11px;
  color: #6d8e7b;
  margin-left: 2px;
}

/* Header Action Pills */
.header-pill-btn {
  background: #092117;
  border: 1px solid #164632;
  color: #eef7f1;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.header-pill-btn:hover {
  background: #0e3022;
  border-color: #22c55e;
}

/* Segmented Theme Pill */
.theme-segmented-pill {
  display: flex;
  background: #061810;
  border: 1px solid #143d2b;
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.theme-seg-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: #6d8e7b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.theme-seg-btn.active {
  background: #0f392b;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

/* Profile Pill */
.auth-user-header-pill {
  display: flex;
  align-items: center;
  background: #092117;
  border: 1px solid #164632;
  border-radius: var(--radius-full);
  padding: 4px 12px 4px 5px;
  gap: 8px;
  cursor: pointer;
  color: #eef7f1;
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.auth-user-header-pill:hover {
  border-color: #22c55e;
}

.auth-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #22c55e;
  color: #04140d;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================================================================
   APP LAYOUT: LEFT SIDEBAR + MAIN CONTENT
   ========================================================================= */
.app-layout-wrapper {
  display: flex;
  min-height: calc(100vh - 60px);
  width: 100%;
}

/* Left Sidebar: ONLY THE FOUR TABS AS PER THE SCREENSHOT */
.app-sidebar {
  width: 230px;
  min-width: 230px;
  background: #05160f;
  border-right: 1px solid #103323;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  position: sticky;
  top: 59px;
  height: calc(100vh - 59px);
  overflow-y: auto;
}

[data-theme="light"] .app-sidebar {
  background: #edf5ee;
  border-right-color: #d5e2d7;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.sidebar-tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: #8da496;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  user-select: none;
  position: relative;
}

.sidebar-tab-btn:hover {
  background: #0b251a;
  color: #eef7f1;
}

[data-theme="light"] .sidebar-tab-btn:hover {
  background: #e2ede4;
  color: #142018;
}

.sidebar-tab-btn.active {
  background: #0d3829;
  border-color: #1c523e;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(13, 56, 41, 0.45);
}

[data-theme="light"] .sidebar-tab-btn.active {
  background: #d8f3dc;
  border-color: #74c69d;
  color: #081c15;
}

.sidebar-tab-btn .tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  transition: transform 0.2s ease;
}

.sidebar-tab-btn.active .tab-icon {
  color: #22c55e;
}

.sidebar-tab-btn:hover .tab-icon {
  transform: scale(1.1);
}

.sidebar-tab-badge {
  margin-left: auto;
  background: #22c55e;
  color: #04140d;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* App Main Content Area */
.app-main-content {
  flex: 1;
  min-width: 0;
  padding: 22px 26px 80px 26px;
  overflow-y: auto;
}

.screen-container {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.screen-container.active {
  display: block;
}

/* Responsive Sidebar for smaller screens */
@media (max-width: 900px) {
  .app-layout-wrapper {
    flex-direction: column;
  }
  .app-sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid #103323;
    padding: 10px 14px;
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
  }
  .sidebar-tab-btn {
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
    width: auto;
  }
  .app-main-content {
    padding: 16px 14px 60px 14px;
  }
}

.screen-container.active {
  display: block;
}

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

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

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

.card-title {
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-subtle);
  margin-top: 2px;
}

/* Forecasting Tab Stepped Workflow Banner */
.forecast-workflow-stepper {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.stepper-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stepper-steps-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.step-node {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.step-node.active {
  color: var(--primary);
}

.step-badge {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--primary-container);
  color: var(--on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.step-divider {
  flex: 1;
  height: 2px;
  background: var(--surface-border);
  min-width: 20px;
}

/* Staged Decision Card */
.decision-card {
  border-left: 6px solid var(--primary);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.decision-card.stage-plant {
  border-left-color: var(--success);
  background: linear-gradient(135deg, var(--surface) 80%, rgba(21, 128, 61, 0.08) 100%);
}

.decision-card.stage-favourable {
  border-left-color: var(--secondary);
  background: linear-gradient(135deg, var(--surface) 80%, rgba(217, 119, 6, 0.08) 100%);
}

.decision-card.stage-wait {
  border-left-color: var(--tertiary);
  background: linear-gradient(135deg, var(--surface) 80%, rgba(2, 132, 199, 0.08) 100%);
}

.decision-card.stage-abstain {
  border-left-color: var(--alert);
  background: linear-gradient(135deg, var(--surface) 80%, rgba(220, 38, 38, 0.08) 100%);
}

.decision-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.stage-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stage-pill.pill-favourable {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.stage-pill.pill-plant {
  background: var(--success-bg);
  color: var(--success);
}

.stage-pill.pill-wait {
  background: var(--tertiary-container);
  color: var(--on-tertiary-container);
}

.stage-pill.pill-abstain {
  background: var(--alert-bg);
  color: var(--alert);
}

.decision-main-headline {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
  color: var(--text-main);
}

.decision-natural-freq {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.worst-case-box {
  background: var(--surface-alt);
  border: 1px dashed var(--surface-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
}

.worst-case-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--warning);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
}

.worst-case-body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.worst-case-loss {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 12px;
  color: var(--alert);
  background: var(--alert-bg);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.mitigation-step {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-main);
  background: var(--surface);
  border-left: 3px solid var(--secondary);
  padding: 8px 12px;
  border-radius: 4px;
}

.decision-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--surface-border-subtle);
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(27, 67, 50, 0.2);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text-main);
  border: 1px solid var(--surface-border);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

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

.btn-alert {
  background: var(--alert-bg);
  color: var(--alert);
  border: 1px solid var(--alert);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

/* Quick Metrics */
.metrics-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-subtle);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 4px;
}

.metric-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Lead Bands & Forecast Grid */
.band-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.band-tab-btn {
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.band-tab-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(27, 67, 50, 0.2);
}

.band-tab-btn span.band-subtitle {
  font-size: 10px;
  opacity: 0.8;
  margin-top: 2px;
}

.forecast-days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.day-forecast-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease;
}

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

.day-forecast-card.dry-spell-warning {
  border-top: 3px solid var(--secondary);
}

.day-forecast-card.rain-heavy {
  border-top: 3px solid var(--tertiary);
  background: linear-gradient(180deg, var(--surface) 70%, rgba(2, 132, 199, 0.06) 100%);
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.day-title {
  font-weight: 700;
  font-size: 15px;
}

.day-date {
  font-size: 11px;
  color: var(--text-subtle);
}

.rain-amount-stat {
  font-size: 22px;
  font-weight: 800;
  color: var(--tertiary);
  font-family: var(--font-display);
}

.quantile-range {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-subtle);
  background: var(--surface-alt);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.weather-condition-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Water & Irrigation Styles */
.water-gauge-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .water-gauge-container {
    grid-template-columns: 1fr;
  }
}

.stress-progress-bar-wrap {
  margin: 14px 0;
}

.progress-track {
  height: 14px;
  background: var(--surface-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--surface-border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #15803D 0%, #D97706 60%, #DC2626 100%);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.stress-threshold-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #DC2626;
  z-index: 2;
}

.simulation-panel {
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 20px;
}

.simulation-panel h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-input {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

/* GATED OPERATIONAL STATUS CARDS (For Market & Crop Diagnosis) */
.gated-banner-card {
  background: var(--surface);
  border: 2px dashed var(--secondary);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}

.gated-icon-badge {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px auto;
}

.gated-phase-pill {
  display: inline-block;
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.gated-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
}

.gated-safeguard-box {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 20px auto;
  max-width: 720px;
  text-align: left;
  border-left: 4px solid var(--secondary);
}

.gated-safeguard-header {
  font-weight: 800;
  color: var(--secondary);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.gated-safeguard-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Upload Dropzone for Diagnosis */
.upload-dropzone {
  border: 2px dashed var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  background: var(--surface-alt);
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 16px 0;
}

.upload-dropzone:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

/* Farm-Business Budgeting Calculator */
.budget-calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .budget-calculator-grid {
    grid-template-columns: 1fr;
  }
}

.budget-result-card {
  background: var(--surface-alt);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.roi-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 13px;
}

/* Advisory Conversational Layout */
.advisory-chat-container {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .advisory-chat-container {
    grid-template-columns: 1fr;
  }
}

.chat-integrated-box {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  height: 520px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-integrated-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-page);
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--primary);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.chat-action-btn {
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-self: flex-start;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-action-btn:hover {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.chat-chips-bar {
  padding: 8px 12px;
  background: var(--surface);
  border-top: 1px solid var(--surface-border);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.chip-btn {
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

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

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

.chat-input {
  flex: 1;
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-main);
  outline: none;
}

.btn-send {
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Extension Officers Grid */
.officers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.officer-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.officer-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.officer-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--primary-container);
  color: var(--on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}

.officer-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.btn-contact {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.btn-contact.call {
  background: var(--primary);
  color: #FFFFFF;
  border: none;
}

.btn-contact.sms {
  background: var(--surface-alt);
  color: var(--text-main);
  border: 1px solid var(--surface-border);
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.data-table th {
  background: var(--surface-alt);
  color: var(--text-subtle);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--surface-border);
  text-transform: uppercase;
  font-size: 11px;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--surface-border-subtle);
  color: var(--text-main);
}

.badge-verify {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.badge-verify.verified { background: var(--success-bg); color: var(--success); }
.badge-verify.corroborated { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.badge-verify.pending { background: var(--warning-bg); color: var(--warning); }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 28, 21, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 22px;
}

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

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

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--surface-alt);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  background: var(--surface);
}

/* Footer */
.app-footer {
  background: var(--surface);
  border-top: 1px solid var(--surface-border);
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-subtle);
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

/* =========================================================================
   AUTHENTICATION MODULE & DYNAMIC CHANGING BACKGROUND STYLES
   Sign In, Sign Up, Email/Phone Verification, Forgot Password
   ========================================================================= */

.auth-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 16px;
  background: rgba(8, 28, 21, 0.7);
  backdrop-filter: blur(8px);
}

.auth-fullscreen-overlay.active {
  display: flex;
}

/* Dynamic Changing Background Slideshow Container */
.auth-bg-slideshow {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.auth-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  opacity: 0;
  transition: opacity 1.8s cubic-bezier(0.4, 0, 0.2, 1), transform 8s ease-out;
  transform: scale(1.0);
}

.auth-slide.active {
  opacity: 1;
  transform: scale(1.06);
}

.auth-bg-gradient-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(11, 22, 16, 0.6) 0%, rgba(8, 28, 21, 0.88) 100%);
  backdrop-filter: blur(3px);
  z-index: 2;
}

/* Glassmorphic Auth Card */
.auth-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 520px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
  margin: auto;
  animation: authCardPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-main);
}

[data-theme="dark"] .auth-card {
  background: rgba(18, 33, 25, 0.92);
  border: 1px solid rgba(82, 183, 136, 0.25);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(82, 183, 136, 0.15);
}

@keyframes authCardPop {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo-badge {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 60%, #D97706 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #FFFFFF;
  margin-bottom: 12px;
  box-shadow: 0 8px 18px rgba(27, 67, 50, 0.3);
}

.auth-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-subtle);
  line-height: 1.5;
}

/* Background Slide Indicators / Dots */
.auth-slide-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.auth-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}

.auth-dot.active {
  width: 24px;
  background: var(--secondary);
}

/* Password Input Wrapper with Eye Toggle */
.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  padding-right: 44px;
}

.password-eye-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-eye-btn:hover {
  color: var(--primary);
}

/* Password Strength Indicator */
.password-strength-wrap {
  margin-top: 8px;
}

.strength-meter-track {
  height: 5px;
  background: var(--surface-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 4px;
}

.strength-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
  display: flex;
  justify-content: space-between;
}

/* OTP 6-Digit Row */
.otp-inputs-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}

.otp-digit-input {
  width: 52px;
  height: 58px;
  border-radius: var(--radius-md);
  border: 2px solid var(--surface-border);
  background: var(--surface-alt);
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  outline: none;
  transition: all 0.2s ease;
}

.otp-digit-input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(27, 67, 50, 0.15);
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  .otp-digit-input {
    width: 42px;
    height: 50px;
    font-size: 20px;
  }
}

/* Quick Dummy Logins Section */
.dummy-logins-box {
  background: var(--surface-alt);
  border: 1px dashed var(--surface-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 22px 0 16px 0;
}

.dummy-logins-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dummy-accounts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.dummy-account-chip {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.dummy-account-chip:hover {
  border-color: var(--primary);
  background: var(--primary-container);
  color: var(--on-primary-container);
  transform: translateY(-1px);
}

.dummy-account-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dummy-account-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--primary-container);
  color: var(--on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}

.dummy-account-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.dummy-account-desc {
  font-size: 11px;
  color: var(--text-subtle);
}

.btn-fill-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--primary);
  color: #FFFFFF;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* User Profile Badge in App Header */
.auth-user-header-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  padding: 4px 12px 4px 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-user-header-pill:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.auth-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.auth-user-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Auth view transitions */
.auth-view-pane {
  display: none;
}

.auth-view-pane.active {
  display: block;
}

/* Floating Toast Notification System (Non-blocking alerts) */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  pointer-events: none;
}

.toast-item {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--surface-border);
  border-left: 5px solid var(--primary);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-item.success {
  border-left-color: #15803D;
  background: #F0FDF4;
  color: #14532D;
}

[data-theme="dark"] .toast-item.success {
  background: #143522;
  color: #86EFAC;
}

.toast-item.error {
  border-left-color: #DC2626;
  background: #FEF2F2;
  color: #7F1D1D;
}

[data-theme="dark"] .toast-item.error {
  background: #3B1414;
  color: #FCA5A5;
}

.toast-item.warning {
  border-left-color: #D97706;
  background: #FFFBEB;
  color: #78350F;
}

[data-theme="dark"] .toast-item.warning {
  background: #3B280B;
  color: #FCD34D;
}

.toast-item.info {
  border-left-color: #0284C7;
  background: #F0F9FF;
  color: #0C4A6E;
}

[data-theme="dark"] .toast-item.info {
  background: #0E2938;
  color: #7DD3FC;
}

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

/* =========================================================================
   DASHBOARD MASTER PAD CONTAINER (MATCHING SCREENSHOT)
   Left: Field Profile & Gold-Bordered Staged Action Box
   Right: Real-Time MapLibre Satellite Map
   ========================================================================= */
.dashboard-pad-container {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 20px;
  margin-bottom: 24px;
  width: 100%;
}

.pad-left-column,
.pad-right-column {
  display: flex;
  flex-direction: column;
}

.pad-inner-card {
  background: #091e16;
  border: 1px solid #143829;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  flex: 1;
  display: flex;
  flex-direction: column;
}

[data-theme="light"] .pad-inner-card {
  background: #ffffff;
  border-color: #d5e2d7;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* Field Profile Header */
.field-profile-card {
  gap: 14px;
}

.field-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.field-profile-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.field-profile-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0e3023;
  border: 1px solid #1c523e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}

.field-profile-subtitle {
  font-size: 10.5px;
  font-weight: 800;
  color: #22c55e;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.field-profile-title {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

[data-theme="light"] .field-profile-title {
  color: #081c15;
}

.field-profile-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-profile-pill {
  background: #0c261c;
  border: 1px solid #184734;
  color: #d2e4d9;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

[data-theme="light"] .btn-profile-pill {
  background: #edf5ee;
  border-color: #c4d7c7;
  color: #142018;
}

.btn-profile-pill:hover {
  background: #143e2e;
  border-color: #22c55e;
  color: #ffffff;
}

.field-profile-meta {
  font-size: 12.5px;
  color: #8ba394;
  padding-bottom: 4px;
}

[data-theme="light"] .field-profile-meta {
  color: #4b5a50;
}

/* Staged Advisory Box (Amber Glowing Border from Screenshot) */
.staged-advisory-box {
  border: 2px solid #d97706;
  background: rgba(13, 31, 23, 0.85);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 0 24px rgba(217, 119, 6, 0.15);
}

[data-theme="light"] .staged-advisory-box {
  background: #fffbeb;
  border-color: #d97706;
}

.staged-tag-chip {
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fef3c7;
  background: rgba(180, 83, 9, 0.4);
  border: 1px solid #b45309;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  text-transform: uppercase;
}

.tag-sep {
  opacity: 0.5;
}

.staged-main-headline {
  font-size: 23px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

[data-theme="light"] .staged-main-headline {
  color: #78350f;
}

.staged-onset-probability {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: #7dd3fc;
  font-weight: 600;
}

.prob-highlight {
  color: #38bdf8;
  font-weight: 800;
}

/* Uncertainty / Post-Sowing Dry Spell Box */
.staged-uncertainty-box {
  background: #0f1c16;
  border-left: 3.5px solid #f59e0b;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

[data-theme="light"] .staged-uncertainty-box {
  background: #ffffff;
  border-left-color: #d97706;
}

.uncertainty-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.uncertainty-body {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.45;
}

[data-theme="light"] .uncertainty-body {
  color: #334155;
}

.uncertainty-loss-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  width: fit-content;
  margin-top: 4px;
}

[data-theme="light"] .uncertainty-loss-pill {
  background: #fee2e2;
  color: #991b1b;
}

/* Mitigation Action Box */
.staged-mitigation-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.45;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
}

[data-theme="light"] .staged-mitigation-box {
  background: #f0fdf4;
  color: #166534;
  border-color: #86efac;
}

.shield-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* Recheck Schedule Footer */
.staged-recheck-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: #8ba394;
  border-top: 1px solid #1a3b2b;
  padding-top: 10px;
  margin-top: 2px;
  flex-wrap: wrap;
  gap: 8px;
}

[data-theme="light"] .staged-recheck-footer {
  border-top-color: #fde68a;
  color: #78350f;
}

.highlight-date {
  color: #22c55e;
  font-weight: 700;
}

/* Action Buttons Row */
.staged-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.btn-primary-action {
  background: #15803d;
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary-action:hover {
  background: #16a34a;
  box-shadow: 0 2px 10px rgba(22, 163, 74, 0.35);
}

.btn-secondary-action {
  background: #0f2c1f;
  color: #d2e4d9;
  border: 1px solid #1c523e;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-action:hover {
  background: #153c2b;
  border-color: #22c55e;
  color: #ffffff;
}

.btn-select-action {
  background: #0f2c1f;
  color: #d2e4d9;
  border: 1px solid #1c523e;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  cursor: pointer;
  outline: none;
}

/* =========================================================================
   REAL-TIME SATELLITE MAP CONTAINER & VIEWPORT
   ========================================================================= */
.realtime-map-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
}

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

.map-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.04em;
}

[data-theme="light"] .map-title-row {
  color: #081c15;
}

.map-update-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #8ba394;
  font-weight: 600;
}

.radar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  display: inline-block;
  animation: radarPulse 1.8s infinite;
}

@keyframes radarPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.map-viewport-wrapper {
  position: relative;
  width: 100%;
  height: 460px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #184734;
  background: #04100b;
}

.realtime-map-viewport {
  width: 100%;
  height: 100%;
}

/* Floating Overlays */
.map-overlay-top-left {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
}

.map-overlay-top-right {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
}

.map-glass-btn {
  background: rgba(9, 28, 20, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #ffffff;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.map-glass-btn.btn-round {
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
}

.map-glass-btn:hover {
  background: #143e2e;
  border-color: #22c55e;
}

/* Layers Dropdown Menu */
.map-dropdown-container {
  position: relative;
}

.map-layers-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: rgba(7, 22, 16, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid #1e4b38;
  border-radius: 12px;
  padding: 12px 14px;
  width: 230px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
}

.map-layers-dropdown.active {
  display: flex;
}

.dropdown-header {
  font-size: 10.5px;
  font-weight: 800;
  color: #22c55e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dropdown-divider {
  height: 1px;
  background: #163829;
  margin: 4px 0;
}

.dropdown-item {
  display: flex;
  gap: 6px;
}

.btn-basemap-pill {
  background: #0d281e;
  border: 1px solid #1c523e;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  flex: 1;
}

.btn-basemap-pill.active {
  background: #16a34a;
  color: #ffffff;
  border-color: #22c55e;
}

.dropdown-toggle-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #e2e8f0;
  cursor: pointer;
  user-select: none;
}

/* Basemap Quick Toggle Pill */
.map-basemap-toggle-pill {
  display: flex;
  background: rgba(9, 28, 20, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.map-toggle-opt {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #8ba394;
  cursor: pointer;
  transition: all 0.2s ease;
}

.map-toggle-opt.active {
  background: #16a34a;
  color: #ffffff;
}

/* Floating Live Weather Card */
.map-floating-weather-card {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(7, 24, 17, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.farm-plot-pin-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #15803d;
  border: 2px solid #86efac;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.8), 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transform: translate(-50%, -50%);
  animation: pulse-badge 2.5s infinite;
}

@keyframes pulse-badge {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.8);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.12);
    box-shadow: 0 0 22px rgba(74, 222, 128, 1);
  }
}

.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right,
.maplibregl-ctrl-attrib,
.maplibregl-compact {
  display: none !important;
}

.map-credit-tag {
  font-size: 10px;
  color: #71887b;
  font-weight: 500;
  margin-right: 4px;
}

.live-weather-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-weather-metrics {
  display: flex;
  gap: 14px;
  align-items: center;
}

.weather-metric {
  display: flex;
  flex-direction: column;
}

.m-label {
  font-size: 9.5px;
  color: #8ba394;
  text-transform: uppercase;
  font-weight: 700;
}

.m-val {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}

.m-val.highlight {
  color: #38bdf8;
  font-size: 15px;
}

/* Map Legend Bar */
.map-legend-bar {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 15;
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(7, 24, 17, 0.9);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(34, 197, 94, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.legend-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
}

.legend-color-box {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.legend-color-box.farm-box {
  background: rgba(34, 197, 94, 0.4);
  border: 1.5px solid #22c55e;
}

.legend-color-box.radar-box {
  background: linear-gradient(90deg, #38bdf8, #4ade80, #fbbf24, #ef4444);
}

.legend-color-box.zone-box {
  border: 1.5px dashed #38bdf8;
  background: transparent;
}

/* Timeline Scrubber Bar */
.map-timeline-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  background: #071b13;
  border: 1px solid #143829;
  border-radius: 12px;
  padding: 10px 14px;
}

[data-theme="light"] .map-timeline-bar {
  background: #edf5ee;
  border-color: #d5e2d7;
}

.btn-timeline-play {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #16a34a;
  border: none;
  color: #ffffff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.4);
  transition: transform 0.15s ease;
}

.btn-timeline-play:hover {
  transform: scale(1.08);
}

.timeline-slider-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-labels-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: #8ba394;
}

.timeline-step-badge {
  font-weight: 800;
  color: #22c55e;
  font-family: var(--font-mono);
}

.timeline-range-slider {
  width: 100%;
  accent-color: #22c55e;
  height: 5px;
  cursor: pointer;
}

.map-insured-toggle {
  display: flex;
  background: #0d281e;
  border: 1px solid #1c523e;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.insured-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #8ba394;
  cursor: pointer;
}

.insured-btn.active {
  background: #16a34a;
  color: #ffffff;
}

/* Selected Property Detail Drawer */
.map-selected-detail-panel {
  margin-top: 12px;
  animation: fadeIn 0.2s ease-out;
}

.selected-detail-card {
  background: #071f16;
  border: 1px solid #22c55e;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.selected-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.selected-detail-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: inline-block;
}

.selected-detail-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.selected-detail-sub {
  font-size: 11px;
  color: #8ba394;
}

.selected-detail-close {
  background: transparent;
  border: none;
  color: #8ba394;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.selected-detail-close:hover {
  color: #ffffff;
}

.selected-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.detail-stat {
  background: #0a251b;
  padding: 8px 10px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 9.5px;
  color: #769684;
  text-transform: uppercase;
  font-weight: 700;
}

.stat-val {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}

/* MapLibre Popup Customization */
.maplibregl-popup-content {
  background: #071f16 !important;
  border: 1px solid #1c523e !important;
  color: #ffffff !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
}

.maplibregl-popup-anchor-top .maplibregl-popup-tip {
  border-bottom-color: #071f16 !important;
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
  border-top-color: #071f16 !important;
}
.maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: #071f16 !important;
}
.maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: #071f16 !important;
}

.map-popup-card {
  font-family: var(--font-body);
  min-width: 170px;
}

.map-popup-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.map-popup-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 11px;
}

.map-popup-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
}

.map-popup-stats {
  font-size: 11px;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid #163d2d;
  padding-top: 4px;
}

/* =========================================================================
   APP FOOTER (MATCHING SCREENSHOT)
   ========================================================================= */
.app-footer {
  background: #061710;
  border-top: 1px solid #113123;
  padding: 18px 24px;
  color: #8ba394;
  margin-top: auto;
}

[data-theme="light"] .app-footer {
  background: #edf5ee;
  border-top-color: #d5e2d7;
}

.footer-inner {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #0a291d;
  border: 1px solid #1c523e;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #22c55e;
}

.footer-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}

[data-theme="light"] .footer-title {
  color: #081c15;
}

.footer-subtitle {
  font-size: 10.5px;
  color: #22c55e;
  font-weight: 600;
}

.footer-links-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  flex-wrap: wrap;
}

.footer-nav-link {
  color: #8ba394;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-nav-link:hover {
  color: #22c55e;
}

.footer-link-divider {
  color: #1a4231;
}

.footer-status-column {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.footer-status-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #22c55e;
}

.footer-copyright {
  font-size: 10.5px;
  color: #5f7a6a;
}

/* Responsiveness for Pad */
@media (max-width: 1100px) {
  .dashboard-pad-container {
    grid-template-columns: 1fr;
  }
  .map-viewport-wrapper {
    height: 420px;
  }
}

/* =====================================================================
   TAB 2: MARKET INTELLIGENCE & CROP PRICES COMPLETE STYLES
   ===================================================================== */
.market-hero-banner {
  background: linear-gradient(135deg, rgba(20, 36, 26, 0.95) 0%, rgba(13, 27, 19, 0.98) 100%);
  border: 1px solid rgba(45, 106, 79, 0.4);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.market-hero-banner::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.market-hero-content {
  flex: 1;
  min-width: 280px;
}

.market-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.live-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #4ade80;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 9999px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseDotAnim 1.8s infinite;
}

@keyframes pulseDotAnim {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #22c55e; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.market-meta-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 9999px;
}

.market-meta-tag strong {
  color: #e2e8f0;
}

.market-hero-title {
  font-size: 26px;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.market-hero-subtitle {
  font-size: 14px;
  color: #94a3b8;
  max-width: 680px;
  line-height: 1.5;
  margin: 0;
}

.kamis-sync-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(45, 106, 79, 0.4);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.ksab-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #94a3b8;
}

.ksab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.ksab-status strong {
  color: #f1f5f9;
}

.ksab-time, .ksab-vol {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.btn-refresh-kamis {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-refresh-kamis:hover {
  background: rgba(34, 197, 94, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-refresh-kamis.spinning {
  pointer-events: none;
  opacity: 0.7;
}

.market-hero-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.market-quick-stat {
  background: rgba(20, 36, 26, 0.8);
  border: 1px solid rgba(45, 106, 79, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  min-width: 120px;
}

.market-quick-stat .stat-lbl {
  font-size: 11px;
  color: #8ba394;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.market-quick-stat .stat-val {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  font-family: 'Outfit', sans-serif;
}

/* Market Selector Toolbar */
.market-controls-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.market-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
}

.selector-title {
  font-weight: 700;
  color: var(--text-main);
}

.selector-distance-hint {
  color: var(--text-muted);
  font-size: 12px;
}

.market-tabs-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.market-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.market-tab-btn:hover {
  background: var(--surface-hover);
  color: var(--text-main);
  border-color: var(--primary-light);
  transform: translateY(-1px);
}

.market-tab-btn.active {
  background: var(--primary);
  border-color: #22c55e;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(34, 197, 94, 0.25);
}

.market-tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
}

.market-tab-btn.active .market-tab-dot {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.market-tab-tag {
  font-size: 10px;
  opacity: 0.8;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 9999px;
}

.market-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--surface-border-subtle);
  flex-wrap: wrap;
}

.market-search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 14px;
}

.market-search-input {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  padding: 9px 38px 9px 38px;
  font-size: 13.5px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.market-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.clear-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
}

.market-category-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cat-pill {
  background: transparent;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.cat-pill:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.cat-pill.active {
  background: var(--surface-alt);
  border-color: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

[data-theme="dark"] .cat-pill.active {
  color: #4ade80;
}

/* Section Header */
.market-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-market-name {
  font-size: 13px;
  font-weight: 700;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.section-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0;
  max-width: 680px;
}

.market-timestamp-badge {
  font-size: 12px;
  color: var(--text-subtle);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

/* Commodity Cards Grid */
.commodity-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.commodity-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.commodity-card:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.commodity-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.commodity-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.commodity-title-box {
  flex: 1;
  min-width: 0;
}

.commodity-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.commodity-variety {
  font-size: 11.5px;
  color: var(--text-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.commodity-unit-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Price Hero in Card */
.commodity-price-hero {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.price-val-container {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.currency-tag {
  font-size: 14px;
  font-weight: 700;
  color: #22c55e;
}

.price-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  font-family: 'Outfit', sans-serif;
}

.per-unit-tag {
  font-size: 11.5px;
  color: var(--text-muted);
}

.change-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.change-up {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.change-down {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.change-stable {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

/* Price Range Meter */
.price-range-meter-box {
  background: var(--surface-alt);
  border: 1px solid var(--surface-border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 14px;
}

.meter-labels-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.meter-labels-row strong {
  color: var(--text-main);
}

.meter-bar-track {
  height: 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 9999px;
  position: relative;
  overflow: visible;
}

[data-theme="dark"] .meter-bar-track {
  background: rgba(255, 255, 255, 0.1);
}

.meter-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #22c55e 100%);
  border-radius: 9999px;
}

.meter-marker-pin {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #22c55e;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

/* Sparkline Container */
.sparkline-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--surface-border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: 16px;
}

[data-theme="dark"] .sparkline-container {
  background: rgba(0, 0, 0, 0.2);
}

.sparkline-info {
  display: flex;
  flex-direction: column;
}

.sparkline-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
}

.sparkline-note {
  font-size: 10.5px;
  color: var(--text-subtle);
}

.sparkline-render {
  display: flex;
  align-items: center;
}

/* Commodity Actions */
.commodity-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.btn-card-action {
  flex: 1;
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
}

.btn-card-action:hover {
  background: var(--surface-hover);
  border-color: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-card-action:hover {
  color: #4ade80;
}

/* 30-Day Trend Drawer */
.trend-detail-drawer {
  margin-bottom: 30px;
}

.trend-drawer-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-alt) 100%);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.drawer-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.drawer-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #22c55e;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.drawer-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

.drawer-submarket {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
}

.drawer-unit-tag {
  font-size: 12px;
  color: var(--text-muted);
}

.drawer-header-right {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.drawer-stat-pill {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
}

.dsp-lbl {
  font-size: 10.5px;
  color: var(--text-subtle);
  font-weight: 700;
  text-transform: uppercase;
}

.dsp-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
}

.drawer-chart-wrapper {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--surface-border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.drawer-note-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

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

.note-text {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Calculators Section */
.market-calculators-section {
  margin-bottom: 34px;
}

.calculators-header {
  margin-bottom: 18px;
}

.calculators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 24px;
}

@media (max-width: 600px) {
  .calculators-grid {
    grid-template-columns: 1fr;
  }
}

.calc-panel-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.calc-panel-header {
  margin-bottom: 18px;
}

.calc-panel-badge {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #eab308;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.calc-panel-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.calc-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.calc-input-group.full-width {
  grid-column: 1 / -1;
}

.calc-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.calc-select, .calc-number-input {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
}

.calc-select:focus, .calc-number-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.calc-num-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.calc-input-unit {
  position: absolute;
  right: 12px;
  font-size: 11px;
  color: var(--text-muted);
  pointer-events: none;
}

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

.slider-display-val {
  font-size: 12.5px;
  color: #22c55e;
}

.calc-slider {
  width: 100%;
  accent-color: #22c55e;
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-subtle);
  margin-top: 4px;
}

/* Comparison Boxes */
.calc-comparison-boxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.comparison-box {
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.comp-box-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.comp-box-header h4 {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.comp-price-stat {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.comp-price-stat .comp-num {
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.comp-total-stat {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--surface-border);
  display: flex;
  flex-direction: column;
}

.comp-total-lbl {
  font-size: 10.5px;
  color: var(--text-subtle);
  text-transform: uppercase;
  font-weight: 700;
}

.comp-total-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  margin-top: 2px;
}

/* Verdict Banners */
.calc-verdict-banner {
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: auto;
}

.verdict-store {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.verdict-sell {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.4);
}

.verdict-top-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.verdict-icon {
  font-size: 20px;
}

.verdict-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

.verdict-rationale {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

.verdict-chips-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.v-chip {
  font-size: 11.5px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.1);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

/* Waterfall Transport Card */
.waterfall-breakdown-card {
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}

.waterfall-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.waterfall-row small {
  display: block;
  font-size: 10.5px;
  color: var(--text-subtle);
}

.waterfall-row.deduction .wf-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

.waterfall-divider {
  height: 1px;
  background: var(--surface-border);
  margin: 10px 0;
}

.waterfall-row.highlight-net {
  font-size: 15px;
  color: var(--text-main);
  margin-bottom: 0;
}

.text-success-huge {
  font-size: 22px;
  font-weight: 800;
  color: #22c55e;
  font-family: 'Outfit', sans-serif;
}

/* Middleman comparison card */
.middleman-comparison-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: auto;
}

.mm-header-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.mm-icon {
  font-size: 20px;
}

.mm-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 2px 0;
}

.mm-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.mm-advantage-callout {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.adv-badge {
  font-size: 10px;
  font-weight: 800;
  color: #22c55e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 4px;
}

.adv-text {
  font-size: 12px;
  color: var(--text-main);
  margin: 0;
  line-height: 1.45;
}

/* Alerts Section */
.market-alerts-section {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.alerts-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.create-alert-card {
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 14px 0;
}

.alert-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.alert-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.active-alerts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.alert-item-card {
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.alert-item-card.status-met {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.08);
}

.alert-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-crop-icon {
  font-size: 24px;
}

.alert-crop-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 2px 0;
}

.alert-condition-text {
  font-size: 12px;
  color: var(--text-muted);
}

.alert-card-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-current-status {
  text-align: right;
}

.cur-price-lbl {
  font-size: 10px;
  color: var(--text-subtle);
  display: block;
}

.cur-price-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
}

.alert-status-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pill-met {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.pill-watching {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.btn-delete-alert {
  background: transparent;
  border: none;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease, transform 0.15s ease;
  padding: 4px;
}

.btn-delete-alert:hover {
  opacity: 1;
  transform: scale(1.15);
}

.alerts-test-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.1);
  border: 1px dashed var(--surface-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Floating Toast Notification */
.market-toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #14241a;
  border: 1px solid #22c55e;
  color: #f1f5f9;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(34, 197, 94, 0.2);
  font-size: 13.5px;
  font-weight: 600;
  max-width: 420px;
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.market-toast-notification.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.no-crops-found-card, .no-alerts-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  background: var(--surface-alt);
  border: 1px dashed var(--surface-border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}

/* =====================================================================
   TAB 3: CROP DIAGNOSIS & 2060 AGROECOLOGY COMPLETE STYLES
   ===================================================================== */
.diagnosis-hero-banner {
  background: linear-gradient(135deg, rgba(20, 36, 26, 0.95) 0%, rgba(13, 27, 19, 0.98) 100%);
  border: 1px solid rgba(45, 106, 79, 0.4);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.diagnosis-hero-content {
  flex: 1;
  min-width: 280px;
}

.diagnosis-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.vision-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #4ade80;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 9999px;
}

.vision-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseDotAnim 1.8s infinite;
}

.vision-meta-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 9999px;
}

.diagnosis-hero-title {
  font-size: 26px;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.diagnosis-hero-subtitle {
  font-size: 14px;
  color: #94a3b8;
  max-width: 680px;
  line-height: 1.5;
  margin: 0;
}

.diagnosis-hero-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.diag-stat-box {
  background: rgba(20, 36, 26, 0.8);
  border: 1px solid rgba(45, 106, 79, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  min-width: 120px;
}

.diag-stat-box .ds-lbl {
  font-size: 11px;
  color: #8ba394;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.diag-stat-box .ds-val {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  font-family: 'Outfit', sans-serif;
}

/* Workspace Grid */
.diagnosis-workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 30px;
}

@media (max-width: 900px) {
  .diagnosis-workspace-grid {
    grid-template-columns: 1fr;
  }
}

.scanner-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

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

.sch-badge {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #22c55e;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.sch-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.scanner-actions-row {
  display: flex;
  gap: 8px;
}

.btn-scanner-toggle {
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-scanner-toggle.active {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
}

.btn-upload-leaf {
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

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

/* Viewport & Reticle */
.scanner-viewport-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  background: #08110b;
  border: 1px solid rgba(45, 106, 79, 0.4);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

#camera-video-stream {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.viewport-preview-layer {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(20, 36, 26, 0.6) 0%, rgba(8, 17, 11, 0.95) 100%);
}

.sample-specimen-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.3);
}

.specimen-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.specimen-title {
  font-size: 18px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 2px;
}

.specimen-sci {
  font-size: 12px;
  font-style: italic;
  color: #94a3b8;
  margin-bottom: 8px;
}

.specimen-crop-tag {
  font-size: 11px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
  padding: 2px 10px;
  border-radius: 9999px;
  font-weight: 700;
}

/* Neural Scanner Overlay */
.scanner-reticle-overlay {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  border: 1px dashed rgba(34, 197, 94, 0.4);
  pointer-events: none;
}

.reticle-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: #22c55e;
}

.reticle-corner.top-left { top: -2px; left: -2px; border-top: 3px solid #22c55e; border-left: 3px solid #22c55e; }
.reticle-corner.top-right { top: -2px; right: -2px; border-top: 3px solid #22c55e; border-right: 3px solid #22c55e; }
.reticle-corner.bottom-left { bottom: -2px; left: -2px; border-bottom: 3px solid #22c55e; border-left: 3px solid #22c55e; }
.reticle-corner.bottom-right { bottom: -2px; right: -2px; border-bottom: 3px solid #22c55e; border-right: 3px solid #22c55e; }

.laser-scanner-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #22c55e, transparent);
  box-shadow: 0 0 12px #22c55e;
  opacity: 0;
}

.scanner-reticle-overlay.scanning-active .laser-scanner-line {
  opacity: 1;
  animation: laserSweep 1.2s infinite ease-in-out alternate;
}

@keyframes laserSweep {
  0% { top: 0%; }
  100% { top: 98%; }
}

.reticle-status-text {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #22c55e;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

/* Specimen Presets */
.field-specimen-presets {
  margin-bottom: 16px;
}

.fsp-title {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.specimen-pills-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.specimen-pill-btn {
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.specimen-pill-btn:hover {
  background: var(--surface-hover);
  color: var(--text-main);
  border-color: var(--primary-light);
}

.specimen-pill-btn.active {
  background: var(--primary);
  border-color: #22c55e;
  color: #ffffff;
  font-weight: 700;
}

.btn-run-scan {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 800;
}

/* Diagnosis Report Card */
.diagnosis-report-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.report-header {
  margin-bottom: 18px;
}

.rh-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.diagnosis-code-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.confidence-badge {
  font-size: 12px;
  color: var(--text-main);
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  padding: 3px 10px;
  border-radius: 9999px;
}

.confidence-badge strong {
  color: #22c55e;
}

.report-disease-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

.report-scientific-name {
  font-size: 13px;
  color: var(--text-muted);
}

/* Threat Severity Box */
.threat-severity-box {
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.ts-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.ts-track {
  height: 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 9999px;
  margin-bottom: 8px;
  overflow: hidden;
}

[data-theme="dark"] .ts-track {
  background: rgba(255, 255, 255, 0.1);
}

.ts-fill {
  height: 100%;
  border-radius: 9999px;
}

.ts-description {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: block;
}

/* Report Section Boxes */
.report-section-box {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--surface-border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
}

[data-theme="dark"] .report-section-box {
  background: rgba(0, 0, 0, 0.2);
}

.report-section-box.regional-box {
  border-left: 3px solid #3b82f6;
}

.rs-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

.rs-text {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.escalate-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-top: auto;
  font-size: 12px;
  color: var(--text-muted);
}

/* 2060 Sustainable Prescriptions Grid */
.sustainable-prescriptions-container {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 30px;
}

.sp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.sp-badge-eco {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #22c55e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 9999px;
}

.prescriptions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.prescription-card {
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.prescription-card.tier-bio {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.prescription-card.tier-pushpull {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.prescription-card.tier-soil {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.prescription-card.tier-chemical {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.pc-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #22c55e;
  margin-bottom: 6px;
}

.tier-pushpull .pc-badge { color: #eab308; }
.tier-soil .pc-badge { color: #3b82f6; }

.pc-badge-warn {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ef4444;
  margin-bottom: 6px;
}

.pc-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 8px 0;
}

.pc-body {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 14px 0;
}

.pc-footer-meta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pc-meta-tag {
  font-size: 11px;
  color: var(--text-subtle);
}

.pc-carbon-tag {
  font-size: 11px;
  font-weight: 700;
  color: #22c55e;
}

.pc-meta-warn {
  font-size: 11px;
  font-weight: 700;
  color: #ef4444;
}

/* Crop Photo Assessment Interface enhancements */
.photo-capture-dropzone:hover {
  border-color: #22c55e !important;
  background: rgba(16, 36, 26, 0.95) !important;
}

.pest-check-card:hover {
  transform: translateY(-2px);
  background: rgba(20, 40, 30, 0.95) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.pest-check-card.active-pest-card {
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.25);
}

@media (max-width: 860px) {
  .pest-checklist-grid-responsive {
    grid-template-columns: 1fr !important;
  }
}

/* =========================================================================
   WINGU AI - HANGING FLOATING CLOUD VOICE ASSISTANT STYLES
   ========================================================================= */

/* Floating Cloud Hanger Container */
.juakilimo-cloud-hanger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  animation: cloudHangFloat 4.2s ease-in-out infinite;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.juakilimo-cloud-hanger:hover {
  transform: scale(1.06) translateY(-4px);
}

.juakilimo-cloud-hanger.chat-is-open {
  animation: none;
  transform: scale(0.92);
}

/* Hanging Physics Animation */
@keyframes cloudHangFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1.2deg);
  }
}

/* Subtle hanging string/tether from above */
.cloud-hang-tether {
  width: 2px;
  height: 14px;
  background: linear-gradient(to bottom, rgba(16, 185, 129, 0), rgba(16, 185, 129, 0.45));
  margin-bottom: -2px;
  border-radius: 2px;
}

/* Concentric Radar Pulse Rings for Listening State */
.cloud-radar-pulse {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.6);
  pointer-events: none;
  opacity: 0;
}

.juakilimo-cloud-hanger.voice-active .cloud-radar-pulse {
  animation: voiceRadarRing 1.8s ease-out infinite;
}

.juakilimo-cloud-hanger.voice-active .cloud-radar-pulse.pulse-delay {
  animation-delay: 0.9s;
}

@keyframes voiceRadarRing {
  0% {
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.4);
    opacity: 0;
  }
}

/* Cloud Button Base */
.cloud-avatar-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  outline: none;
  filter: drop-shadow(0 10px 22px rgba(16, 185, 129, 0.35));
  transition: filter 0.25s ease;
}

.cloud-avatar-btn:hover {
  filter: drop-shadow(0 14px 28px rgba(16, 185, 129, 0.5));
}

.cloud-svg-icon {
  display: block;
  overflow: visible;
}

/* Dangling Tassels / Drops Underneath Cloud */
.cloud-hanging-tassels {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: -6px;
  animation: tasselsSway 3s ease-in-out infinite alternate;
}

@keyframes tasselsSway {
  0% {
    transform: rotate(-3deg);
  }
  100% {
    transform: rotate(3deg);
  }
}

.cloud-dangle-drop {
  font-size: 11px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  animation: dropBob 2s ease-in-out infinite alternate;
}

.cloud-dangle-drop.drop-left { animation-delay: 0.1s; }
.cloud-dangle-drop.drop-mid { animation-delay: 0.4s; }
.cloud-dangle-drop.drop-right { animation-delay: 0.7s; }

@keyframes dropBob {
  0% { transform: translateY(0px); }
  100% { transform: translateY(3px); }
}

/* Floating Callout Pill */
.cloud-callout-pill {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(13, 27, 20, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #d1fae5;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  white-space: nowrap;
}

[data-theme="light"] .cloud-callout-pill {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(16, 185, 129, 0.45);
  color: #065f46;
}

.cloud-live-beacon {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
  animation: liveBlink 1.4s ease-in-out infinite;
}

@keyframes liveBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* =========================================================================
   GLASSMORPHIC AI CHAT CARD (Wingu AI Window)
   ========================================================================= */
.cloud-chat-card {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 410px;
  max-width: calc(100vw - 32px);
  height: 610px;
  max-height: calc(100vh - 120px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  background: rgba(11, 22, 16, 0.94);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 32px rgba(16, 185, 129, 0.22);
  overflow: hidden;
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  animation: cardSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[data-theme="light"] .cloud-chat-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 20px 50px rgba(16, 185, 129, 0.18), 0 8px 24px rgba(0, 0, 0, 0.08);
}

@keyframes cardSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Card Header */
.cloud-chat-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.85), rgba(15, 23, 42, 0.85));
  border-bottom: 1px solid rgba(16, 185, 129, 0.25);
  color: #ffffff;
}

[data-theme="light"] .cloud-chat-header {
  background: linear-gradient(135deg, #10b981, #059669);
}

.cloud-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cloud-header-logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.cloud-header-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cloud-header-title {
  font-family: var(--font-display, 'Outfit', sans-serif);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.3px;
}

.cloud-header-status-dot {
  width: 7px;
  height: 7px;
  background: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 6px #34d399;
}

.cloud-header-status-text {
  font-size: 11px;
  color: #a7f3d0;
  font-weight: 600;
}

.cloud-header-subtitle {
  font-size: 11px;
  opacity: 0.85;
}

.cloud-header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cloud-lang-toggle {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cloud-lang-toggle:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.cloud-icon-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cloud-icon-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.cloud-icon-btn.muted {
  opacity: 0.55;
}

/* Audio Wave Equalizer Bar */
.cloud-equalizer-bar {
  padding: 8px 16px;
  background: rgba(16, 185, 129, 0.08);
  border-bottom: 1px solid rgba(16, 185, 129, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.equalizer-status-text {
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 270px;
}

.equalizer-waves {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 16px;
}

.eq-wave-bar {
  width: 3px;
  height: 4px;
  background: #10b981;
  border-radius: 3px;
  transition: height 0.15s ease;
}

.equalizer-waves.active .eq-wave-bar:nth-child(1) { animation: eqBounce 0.4s ease-in-out infinite alternate; }
.equalizer-waves.active .eq-wave-bar:nth-child(2) { animation: eqBounce 0.6s ease-in-out infinite alternate 0.1s; }
.equalizer-waves.active .eq-wave-bar:nth-child(3) { animation: eqBounce 0.35s ease-in-out infinite alternate 0.2s; }
.equalizer-waves.active .eq-wave-bar:nth-child(4) { animation: eqBounce 0.55s ease-in-out infinite alternate 0.05s; }
.equalizer-waves.active .eq-wave-bar:nth-child(5) { animation: eqBounce 0.45s ease-in-out infinite alternate 0.15s; }

@keyframes eqBounce {
  0% { height: 4px; }
  100% { height: 16px; }
}

/* Quick Chips Scroll */
.cloud-chips-scroll {
  display: flex;
  gap: 8px;
  padding: 8px 14px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(16, 185, 129, 0.12);
  scrollbar-width: none;
  background: rgba(0, 0, 0, 0.1);
}

.cloud-chips-scroll::-webkit-scrollbar {
  display: none;
}

.cloud-chip-btn {
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 5px 11px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="light"] .cloud-chip-btn {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.cloud-chip-btn:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
  transform: translateY(-1px);
}

/* Scrollable Messages Viewport */
.cloud-messages-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

/* Chat Bubbles */
.cloud-chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: bubblePop 0.25s ease-out forwards;
}

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

.cloud-chat-msg.user-bubble {
  align-self: flex-end;
}

.cloud-chat-msg.bot-bubble {
  align-self: flex-start;
}

.cloud-msg-content {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
}

.user-bubble .cloud-msg-content {
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.3);
}

.bot-bubble .cloud-msg-content {
  background: rgba(16, 36, 26, 0.85);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--text-main, #f1f5f9);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .bot-bubble .cloud-msg-content {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #1e293b;
}

.cloud-msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  margin-bottom: 4px;
  opacity: 0.85;
}

.cloud-msg-speech-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
}

.cloud-msg-speech-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

.cloud-msg-action-bar {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.cloud-msg-action-btn {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  color: #34d399;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

[data-theme="light"] .cloud-msg-action-btn {
  background: #dcfce7;
  color: #065f46;
  border-color: #059669;
}

.cloud-msg-action-btn:hover {
  background: #10b981;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Input Dock with Big Push-to-Talk Mic */
.cloud-input-dock {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(16, 185, 129, 0.2);
  background: rgba(6, 18, 12, 0.9);
}

[data-theme="light"] .cloud-input-dock {
  background: #ffffff;
  border-color: #e2e8f0;
}

.cloud-mic-trigger-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  border: 2px solid #34d399;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.cloud-mic-trigger-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
}

.cloud-mic-trigger-btn.listening {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: #fca5a5;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
  animation: micListenPulse 1.2s infinite;
}

@keyframes micListenPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.cloud-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 22px;
  padding: 3px 6px 3px 14px;
}

[data-theme="light"] .cloud-input-wrap {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.cloud-chat-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-main, #f1f5f9);
  font-size: 13px;
  outline: none;
  padding: 8px 0;
  font-family: inherit;
}

[data-theme="light"] .cloud-chat-input {
  color: #0f172a;
}

.cloud-chat-input::placeholder {
  color: var(--text-subtle, #64748b);
  font-size: 12px;
}

.cloud-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #10b981;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 6px;
}

.cloud-send-btn:hover {
  background: #059669;
  transform: scale(1.08);
}

/* Voice Samples Tray Toggle & Grid */
.cloud-voice-tray-toggle {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.06);
  border-top: 1px solid rgba(16, 185, 129, 0.12);
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.cloud-voice-tray-toggle:hover {
  background: rgba(16, 185, 129, 0.14);
}

.cloud-voice-samples-tray {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  border-top: 1px solid rgba(16, 185, 129, 0.12);
}

[data-theme="light"] .cloud-voice-samples-tray {
  background: #f8fafc;
}

.cloud-sample-voice-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--text-main, #e2e8f0);
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="light"] .cloud-sample-voice-card {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

.cloud-sample-voice-card:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
  transform: translateX(3px);
}

.sample-voice-icon {
  font-size: 14px;
  color: #10b981;
}

.sample-voice-title {
  font-weight: 600;
  line-height: 1.3;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .cloud-chat-card {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 84px;
    height: calc(100vh - 100px);
  }
  .juakilimo-cloud-hanger {
    bottom: 16px;
    right: 16px;
  }
}

