/* ==========================================================================
   KRISHORA - AI Agricultural Assistant Design System
   ========================================================================== */

:root {
  /* Color Palette - Nature & Earth */
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-dark: #047857;
  --primary-light: #d1fae5;
  --primary-glow: rgba(16, 185, 129, 0.25);
  
  --secondary: #f59e0b;
  --secondary-hover: #d97706;
  --secondary-light: #fef3c7;
  
  --accent-earth: #8b5cf6;
  --accent-soil: #92400e;
  --accent-water: #0ea5e9;
  --accent-pest: #ef4444;
  --accent-sun: #eab308;
  
  /* Neutral Dark (Default Theme) */
  --bg-main: #0b130e;
  --bg-sidebar: #060c08;
  --bg-card: rgba(18, 30, 22, 0.75);
  --bg-card-hover: rgba(26, 42, 32, 0.85);
  --bg-input: rgba(12, 22, 16, 0.8);
  --border-color: rgba(52, 211, 153, 0.15);
  --border-color-strong: rgba(52, 211, 153, 0.35);
  
  --text-primary: #f0fdf4;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-emerald: #34d399;
  
  --glass-bg: rgba(15, 23, 18, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --font-sans: 'Hind Siliguri', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="light"] {
  --bg-main: #f4fbf7;
  --bg-sidebar: #e6f4ed;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-input: #ffffff;
  --border-color: rgba(16, 185, 129, 0.2);
  --border-color-strong: rgba(16, 185, 129, 0.4);
  
  --text-primary: #064e3b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-emerald: #059669;
  
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(16, 185, 129, 0.15);
  --glass-shadow: 0 8px 30px 0 rgba(16, 185, 129, 0.08);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Layout */
.app-container {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* Sidebar */
.app-sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--transition-normal), width var(--transition-normal);
  z-index: 50;
  backdrop-filter: blur(16px);
}

.sidebar-brand {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.brand-info h1 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #34d399, #10b981, #a7f3d0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-info p {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item .icon {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.15);
}

.nav-item.active {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  font-weight: 600;
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-weight: 700;
}

.nav-badge.amber {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

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

.voice-status-widget {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.voice-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Main Area */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Topbar */
.app-topbar {
  height: 70px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 40;
}

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

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.3rem;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.live-location-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-emerald);
}

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

.lang-selector-wrapper select {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.action-icon-btn {
  width: 40px;
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.action-icon-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-color-strong);
}

/* View Content Container */
.views-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}

.view-panel {
  display: none;
  animation: fadeIn 0.3s ease forwards;
  max-width: 1350px;
  margin: 0 auto;
}

.view-panel.active-view {
  display: block;
}

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

/* Common Card Styles */
.agri-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(14px);
  box-shadow: var(--glass-shadow);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
  margin-bottom: 24px;
}

.agri-card:hover {
  border-color: var(--border-color-strong);
}

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

.card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-title-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.15);
  color: var(--text-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.card-title-text h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.card-title-text p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   VIEW 1: VOICE AI ASSISTANT
   ========================================================================== */
.assistant-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 24px;
  min-height: calc(100vh - 140px);
}

.voice-command-center {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: 30px 24px;
  background: radial-gradient(circle at center, rgba(16, 185, 129, 0.12) 0%, var(--bg-card) 70%);
}

.voice-ai-avatar-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 10px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-mic-main-btn {
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  border: 4px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.voice-mic-main-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 35px rgba(16, 185, 129, 0.6);
}

.voice-mic-main-btn.listening {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  animation: pulse-red 1.2s infinite alternate;
}

@keyframes pulse-red {
  0% { transform: scale(1); box-shadow: 0 0 15px rgba(239, 68, 68, 0.5); }
  100% { transform: scale(1.1); box-shadow: 0 0 40px rgba(239, 68, 68, 0.8); }
}

.voice-wave-canvas {
  width: 100%;
  height: 55px;
  margin: 10px 0;
  border-radius: var(--radius-sm);
}

.voice-status-feedback {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  min-height: 28px;
}

.suggested-prompts-bar {
  width: 100%;
  text-align: left;
}

.prompt-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.prompt-chip {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--text-emerald);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.prompt-chip:hover {
  background: rgba(16, 185, 129, 0.25);
  transform: translateY(-1px);
}

/* Chat Log Stream */
.assistant-dialog-hub {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

.dialog-stream {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 520px;
}

.chat-bubble {
  max-width: 88%;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.6;
  position: relative;
  animation: fadeIn 0.25s ease;
}

.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-bubble.ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-bubble .speaker-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-bubble .tts-replay-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--text-emerald);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  cursor: pointer;
  margin-top: 8px;
  transition: all var(--transition-fast);
}

.chat-bubble .tts-replay-btn:hover {
  background: rgba(16, 185, 129, 0.3);
}

.chat-input-bar {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  background: var(--bg-card);
}

.chat-input-bar input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-full);
  outline: none;
  font-size: 0.9rem;
}

.chat-input-bar input:focus {
  border-color: var(--primary);
}

/* ==========================================================================
   VIEW 2: DISEASE DETECTION LAB
   ========================================================================== */
.disease-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr;
  gap: 24px;
}

.scanner-dropzone {
  border: 2px dashed var(--border-color-strong);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  background: rgba(16, 185, 129, 0.03);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.scanner-dropzone:hover, .scanner-dropzone.dragover {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.08);
}

.dropzone-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  color: var(--text-emerald);
}

.scanner-preview-wrapper {
  position: relative;
  width: 100%;
  max-height: 260px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: none;
  margin-top: 12px;
}

.scanner-preview-wrapper img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #34d399;
  box-shadow: 0 0 15px #34d399, 0 0 30px #10b981;
  display: none;
}

.scanning .scanner-laser {
  display: block;
  animation: laser-scan 2s infinite ease-in-out;
}

@keyframes laser-scan {
  0% { top: 0; opacity: 0.8; }
  50% { top: 100%; opacity: 1; }
  100% { top: 0; opacity: 0.8; }
}

.sample-leaves-shelf {
  margin-top: 20px;
}

.sample-leaves-shelf h4 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sample-leaf-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.sample-leaf-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sample-leaf-card:hover {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.12);
  transform: translateY(-2px);
}

.sample-leaf-card img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.sample-leaf-card span {
  font-size: 0.72rem;
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Diagnosis Result Card */
.diagnosis-result-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.diagnosis-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.disease-name-badge {
  font-size: 1.2rem;
  font-weight: 800;
  color: #f87171;
  display: flex;
  align-items: center;
  gap: 8px;
}

.disease-name-badge.healthy {
  color: #34d399;
}

.confidence-meter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}

.confidence-meter.healthy {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.remedy-section {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border-left: 4px solid var(--primary);
}

.remedy-section.chemical {
  border-left-color: var(--secondary);
}

.remedy-section h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.remedy-section ul {
  padding-left: 20px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.remedy-section li {
  margin-bottom: 3px;
}

/* ==========================================================================
   VIEW 3: AGRO-WEATHER ADVISOR
   ========================================================================== */
.weather-hero-card {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(16, 185, 129, 0.1) 100%);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.weather-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.weather-city-input-wrap {
  display: flex;
  gap: 8px;
}

.weather-city-input-wrap input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  outline: none;
}

.weather-main-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.weather-stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon-wrap {
  font-size: 2rem;
}

.stat-content .stat-val {
  font-size: 1.35rem;
  font-weight: 800;
}

.stat-content .stat-lbl {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.agro-advisory-banner {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.agro-advisory-banner .advisory-icon {
  font-size: 1.8rem;
}

.advisory-text h4 {
  font-size: 0.95rem;
  color: var(--text-emerald);
  font-weight: 700;
  margin-bottom: 4px;
}

.advisory-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.forecast-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.forecast-day-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
  transition: all var(--transition-fast);
}

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

.forecast-day-card .day-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.forecast-day-card .day-icon {
  font-size: 1.6rem;
  margin: 6px 0;
}

.forecast-day-card .day-temp {
  font-size: 0.9rem;
  font-weight: 700;
}

.forecast-day-card .day-condition {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==========================================================================
   VIEW 4: MANDI MARKET INTELLIGENCE
   ========================================================================== */
.market-ticker-banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  overflow: hidden;
}

.ticker-marquee {
  display: flex;
  gap: 24px;
  animation: marquee 35s linear infinite;
  white-space: nowrap;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.ticker-item .price-up {
  color: #34d399;
}

.ticker-item .price-down {
  color: #f87171;
}

.market-controls-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.market-controls-row select, .market-controls-row input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 9px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  outline: none;
}

.market-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.market-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.market-table th {
  padding: 12px 14px;
  background: rgba(16, 185, 129, 0.08);
  color: var(--text-emerald);
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
}

.market-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.market-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.msp-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}

.price-trend-canvas {
  width: 100%;
  height: 220px;
  margin-top: 15px;
}

/* Calculator & Profit Estimator */
.profit-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.calc-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calc-input-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.calc-input-group input, .calc-input-group select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
}

.profit-summary-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.1) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.profit-stat h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-emerald);
}

.profit-stat p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   VIEW 5: CROP KNOWLEDGE & NPK CALCULATOR
   ========================================================================== */
.crop-search-bar {
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
}

.crop-search-bar input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-full);
  outline: none;
  font-size: 0.9rem;
}

.crop-category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.crop-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.crop-tab-btn.active, .crop-tab-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  color: var(--text-emerald);
  border-color: var(--primary);
}

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

.crop-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.crop-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.15);
}

.crop-card-img-wrap {
  height: 140px;
  position: relative;
  overflow: hidden;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.crop-card-body {
  padding: 16px;
}

.crop-season-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #34d399;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.crop-card-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.crop-quick-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Fertilizer Calculator Card */
.npk-calculator-wrap {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 30px;
}

.fertilizer-results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.fert-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.fert-result-card .fert-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-emerald);
}

.fert-result-card .fert-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==========================================================================
   VIEW 6: MY SMART FARM & ADVISORY PLAN
   ========================================================================== */
.farm-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 24px;
}

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

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

.farm-form-group input, .farm-form-group select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  outline: none;
}

.task-timeline-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.task-item-card.completed {
  opacity: 0.6;
  text-decoration: line-through;
}

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

.task-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary);
}

.task-details h4 {
  font-size: 0.9rem;
  font-weight: 700;
}

.task-details p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.task-stage-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: var(--text-emerald);
}

/* Modal Styling */
.krishora-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.krishora-modal.open {
  display: flex;
}

.modal-content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color-strong);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 120;
}

.toast-message {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color-strong);
  border-left: 4px solid var(--primary);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Print Styling for Farm Advisory Card */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .app-sidebar, .app-topbar, .chat-input-bar, .voice-mic-main-btn, .action-icon-btn, .btn-primary, .btn-secondary, .crop-category-tabs, .crop-search-bar {
    display: none !important;
  }
  .app-main, .views-viewport {
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
  }
  .view-panel {
    display: block !important;
  }
  .agri-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    background: #fff !important;
    page-break-inside: avoid;
  }
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .assistant-hero-grid, .disease-grid, .farm-profile-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
  .forecast-week-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .fertilizer-results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
  }
  .app-sidebar.mobile-open {
    transform: translateX(0);
  }
  .mobile-menu-toggle {
    display: flex;
  }
  .views-viewport {
    padding: 16px;
  }
  .forecast-week-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sample-leaf-items {
    grid-template-columns: repeat(2, 1fr);
  }
  .desktop-only {
    display: none !important;
  }
}

/* Crop Recommendation & Ribbon Styles */
.recommendation-card {
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

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

.top-match-card {
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(18, 30, 22, 0.85) 100%) !important;
}

.top-match-ribbon {
  position: absolute;
  top: -10px;
  right: 16px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  letter-spacing: 0.02em;
}

/* Spray Window Badges */
.badge-spray-safe {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-spray-warning {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

/* Timeline Task Item */
.timeline-task-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: all var(--transition-fast);
}

.timeline-task-item.task-done {
  opacity: 0.65;
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.2);
}

.timeline-task-icon {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.timeline-task-content {
  flex: 1;
}

/* Toast Notifications */
.krishora-toast {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color-strong);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.krishora-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.krishora-toast.toast-success {
  border-left: 4px solid #10b981;
}

.krishora-toast.toast-warning {
  border-left: 4px solid #f59e0b;
}

.krishora-toast.toast-info {
  border-left: 4px solid #38bdf8;
}

.modal-info-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.modal-info-box strong {
  font-size: 0.8rem;
  color: var(--text-emerald);
  display: block;
  margin-bottom: 4px;
}

.modal-info-box p {
  font-size: 0.85rem;
  color: var(--text-primary);
}

