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

/* --- Theme Variables (Light Green/Orange AgriTheme) --- */
:root {
  --primary: #2e7d32;         /* Emerald Green */
  --primary-dark: #1b5e20;
  --primary-light: #e8f5e9;
  
  --secondary: #e0f2f1;
  --accent: #ff9800;          /* Harvest Orange */
  
  --bg-main: #f4f6f8;         /* Desktop frame bg */
  --bg-screen: #ffffff;       /* Mobile screen bg */
  --bg-card: #f9f9f9;
  --bg-input: #f0f2f5;
  
  --border-color: #e0e0e0;
  --border-color-light: #f1f1f1;
  
  --text-main: #212121;
  --text-secondary: #666666;
  --text-muted: #9e9e9e;
  
  --color-buy: #2e7d32;
  --color-buy-bg: rgba(46, 125, 50, 0.1);
  --color-sell: #d32f2f;
  --color-sell-bg: rgba(211, 47, 47, 0.1);
  --color-info: #0288d1;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --border-radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* --- Global Reset & Outer Frame --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Custom Scrollbar for inner components */
::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

/* --- Smartphone Mockup Wrapper --- */
.phone-mockup {
  position: relative;
  width: 375px;
  height: 812px;
  background-color: #000;
  border-radius: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 
              0 0 0 12px #111;
  border: 4px solid #333;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Speaker slot on top mockup */
.phone-speaker {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background-color: #222;
  border-radius: 2px;
  z-index: 100;
}

/* Bottom home bar mockup */
.phone-home-button {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background-color: #555;
  border-radius: 2px;
  z-index: 100;
  cursor: pointer;
}

/* Device screen viewport container */
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: var(--bg-screen);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-top: 24px;   /* space for status notch */
  padding-bottom: 20px; /* space for home bar notch */
}

/* Responsive adjustment for actual mobile screens */
@media (max-width: 480px) {
  body {
    background-color: var(--bg-screen);
  }
  .phone-mockup {
    width: 100vw;
    height: 100vh;
    border: none;
    box-shadow: none;
    border-radius: 0;
  }
  .phone-speaker, .phone-home-button {
    display: none;
  }
  .phone-screen {
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* --- View Switching and Shell Animations --- */
.subview, .shell-view {
  position: absolute;
  top: 24px;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-screen);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal) ease;
  z-index: 10;
}

.subview.active, .shell-view.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 20;
}

.hidden {
  display: none !important;
}

/* --- View 1: Onboarding Intro styles --- */
#view-intro {
  top: 0;
  background: linear-gradient(180deg, #f1f8e9 0%, var(--bg-screen) 60%);
  padding: 24px;
  justify-content: space-between;
}

.intro-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
  position: relative;
  width: 100%;
}

.en-badge {
  align-self: flex-end;
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
}

.intro-logo {
  text-align: center;
  margin-top: 20px;
}

.intro-logo-icon {
  font-size: 40px;
  display: inline-block;
  margin-bottom: 10px;
}

.intro-logo h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-dark);
}

.intro-logo p {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.intro-illustration {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

.tractor-scene {
  font-size: 70px;
  animation: bounce-tractor 3s infinite alternate;
}

@keyframes bounce-tractor {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

.intro-card {
  background-color: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 25px rgba(46, 125, 50, 0.08);
  text-align: center;
  border: 1px solid var(--border-color-light);
}

.intro-card h2 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--text-main);
}

.intro-card p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.4;
}

.dots-indicator {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}

.dot {
  width: 6px;
  height: 6px;
  background-color: #e0e0e0;
  border-radius: 3px;
}

.dot.active {
  width: 16px;
  background-color: var(--primary);
}

/* --- Common UI Buttons & Forms --- */
.btn {
  display: block;
  width: 100%;
  height: 44px;
  border-radius: var(--border-radius);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
}

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

.btn-secondary {
  background-color: #fff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  margin-top: 10px;
}

.btn-secondary:hover {
  background-color: var(--bg-card);
}

.btn-buy {
  background-color: var(--color-buy);
  color: #fff;
}

.btn-sell {
  background-color: var(--color-sell);
  color: #fff;
}

/* --- App Shell (Layout Frame with Header & Navigation) --- */
#app-shell {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header bar */
.app-header {
  height: 52px;
  background-color: #fff;
  border-bottom: 1px solid var(--border-color-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 50;
}

.header-action-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-main);
}

.header-title {
  text-align: center;
}

.header-title h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.1;
}

.header-title span {
  font-size: 9px;
  color: var(--text-secondary);
}

.header-profile {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background-color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
}

/* Main inner viewport container */
.app-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Layout view frames */
.shell-view {
  top: 0;
  padding: 16px;
  overflow-y: auto;
}

/* Bottom Navigation Bar */
.app-nav {
  height: 56px;
  background-color: #fff;
  border-top: 1px solid var(--border-color-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 50;
  position: relative;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

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

.nav-icon {
  font-size: 18px;
  margin-bottom: 2px;
}

.nav-label {
  font-size: 9px;
  font-weight: 500;
}

.nav-plus {
  position: relative;
  z-index: 60;
  margin-top: -20px; /* pull button up */
}

.nav-icon-plus {
  width: 46px;
  height: 46px;
  border-radius: 23px;
  background-color: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(46, 125, 50, 0.3);
  transition: transform var(--transition-fast);
}

.nav-plus:hover .nav-icon-plus {
  transform: scale(1.05);
}

/* --- TAB VIEW: HOME SCREEN COMPONENTS --- */
.farmer-greeting-card {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  border-radius: 12px;
  padding: 16px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.greeting-text h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.greeting-text p {
  font-size: 11px;
  opacity: 0.85;
}

.greeting-deco {
  font-size: 26px;
}

/* Weather Widget card */
.weather-widget {
  background-color: #fff;
  border: 1px solid var(--border-color-light);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.weather-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.weather-icon {
  font-size: 26px;
}

.weather-main h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.weather-main p {
  font-size: 10px;
  color: var(--text-secondary);
}

.weather-location {
  text-align: right;
}

.weather-location h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.weather-location span {
  font-size: 10px;
  color: var(--text-secondary);
}

/* Generic Section styling */
.widget-section {
  margin-bottom: 18px;
}

.widget-section h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-main);
}

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

.section-header h3 {
  margin-bottom: 0;
}

.link-label {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

/* Quick Actions layout */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.action-icon {
  width: 46px;
  height: 46px;
  border-radius: 23px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.action-card:hover .action-icon {
  transform: translateY(-2px);
}

.action-card span:last-child {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.2;
}

.sell-color { background-color: #fff3e0; }
.buy-color { background-color: #e8f5e9; }
.booking-color { background-color: #e0f2f1; }
.doctor-color { background-color: #ede7f6; }

/* Lists of Mandi Prices */
.mandi-price-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mandi-price-row {
  background-color: #fff;
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.mandi-price-row:hover {
  background-color: var(--border-color-light);
}

.mandi-crop-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mandi-crop-icon {
  font-size: 20px;
}

.mandi-crop-info h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.mandi-crop-price {
  text-align: right;
}

.mandi-crop-price h4 {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.mandi-crop-price span {
  font-size: 9px;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Text status colors */
.text-up { color: #2e7d32; }
.text-down { color: #d32f2f; }

/* --- TAB VIEW: MARKET PRICES LIST --- */
.view-header {
  margin-bottom: 12px;
}

.view-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color-light);
  margin-bottom: 12px;
}

.cat-tab {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 4px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.cat-tab.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.market-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
}

/* --- SUB VIEW: ORDER BOOK --- */
.subview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.back-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-main);
}

.subview-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.orderbook-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background-color: var(--bg-card);
  border-radius: 6px;
  padding: 3px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color-light);
}

.toggle-tab {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 0;
  cursor: pointer;
  border-radius: 4px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.toggle-tab.active {
  background-color: #fff;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.ob-table-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 4px 12px;
  border-bottom: 1px solid var(--border-color-light);
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 600;
}

.ob-table-header span:nth-child(2), .ob-table-header span:nth-child(3) {
  text-align: right;
}

.ob-rows-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  margin-bottom: 8px;
}

.ob-item-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  position: relative;
  height: 24px;
  align-items: center;
}

.ob-item-row span {
  position: relative;
  z-index: 5;
}

.ob-item-row span:nth-child(2), .ob-item-row span:nth-child(3) {
  text-align: right;
}

.ob-item-row.buy-row span:first-child { color: var(--color-buy); }
.ob-item-row.sell-row span:first-child { color: var(--color-sell); }

.ob-depth-fill {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.ob-item-row.buy-row .ob-depth-fill { background-color: var(--color-buy-bg); }
.ob-item-row.sell-row .ob-depth-fill { background-color: var(--color-sell-bg); }

.ob-market-price-bar {
  height: 32px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color-light);
  border-bottom: 1px solid var(--border-color-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 12px;
}

.ob-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* --- SUB VIEW: BUY farmer products list --- */
.search-box {
  margin-bottom: 10px;
}

.search-input {
  width: 100%;
  height: 38px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  padding: 0 12px;
  font-size: 12px;
  outline: none;
}

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

.category-chips {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chip {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 600;
  border-radius: 12px;
  padding: 3px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background-color: var(--primary);
  color: #fff;
}

.store-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
}

.store-card {
  background-color: #fff;
  border: 1px solid var(--border-color-light);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.store-img {
  width: 60px;
  height: 60px;
  background-color: var(--bg-card);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.store-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.store-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.store-title-row h4 {
  font-size: 12px;
  font-weight: 700;
}

.store-tag {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  background-color: #e3f2fd;
  color: #0d47a1;
  border-radius: 4px;
}

.store-tag.organic {
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.store-details p {
  font-size: 10px;
  color: var(--text-secondary);
}

.store-seller {
  font-size: 9px !important;
  color: var(--text-muted) !important;
  margin-top: 1px;
}

.store-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.store-price {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.store-price span {
  font-size: 9px;
  font-weight: 500;
}

.btn-buy-now {
  background-color: var(--primary);
  color: #fff;
  border: none;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* --- FORM LAYOUTS (Sell crop, future bookings) --- */
.form-banner {
  background-color: #f1f8e9;
  border: 1px solid var(--primary-light);
  border-radius: var(--border-radius);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.booking-banner {
  background-color: #fff3e0;
  border-color: #ffe0b2;
}

.banner-icon {
  font-size: 24px;
}

.form-banner h4 {
  font-size: 13px;
  font-weight: 700;
}

.form-banner p {
  font-size: 10px;
  color: var(--text-secondary);
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0 10px;
  font-size: 12px;
  outline: none;
  background-color: #fff;
}

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

.grade-toggle-row {
  display: flex;
  gap: 8px;
}

.grade-btn {
  flex: 1;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-secondary);
}

.grade-btn.active {
  border-color: var(--primary);
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.escrow-notice {
  font-size: 9px;
  color: var(--text-secondary);
  background-color: #f5f5f5;
  border-left: 2px solid var(--accent);
  padding: 6px 10px;
  margin-top: 4px;
}

/* --- TAB VIEW: MY ORDERS & DISPATCH LOGS --- */
.order-tabs {
  margin-bottom: 12px;
}

.order-tab {
  font-size: 10px !important;
  padding: 3px 10px !important;
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
}

.order-card {
  background-color: #fff;
  border: 1px solid var(--border-color-light);
  border-radius: 10px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color-light);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.order-id {
  font-size: 11px;
  font-weight: 700;
}

.status-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.status-badge.active { background-color: #fff3e0; color: #ff9800; }
.status-badge.completed { background-color: #e8f5e9; color: #2e7d32; }
.status-badge.cancelled { background-color: #ffebee; color: #d32f2f; }

.order-body-grid {
  display: flex;
  gap: 10px;
  align-items: center;
}

.order-crop-img {
  width: 44px;
  height: 44px;
  background-color: var(--bg-card);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.order-info {
  flex: 1;
}

.order-info h4 {
  font-size: 12px;
  font-weight: 700;
}

.order-info p {
  font-size: 10px;
  color: var(--text-secondary);
}

.order-price-summary {
  text-align: right;
}

.order-price-summary h4 {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.order-action-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color-light);
  padding-top: 8px;
  margin-top: 8px;
}

.order-date {
  font-size: 9px;
  color: var(--text-muted);
}

.btn-track {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 9px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-track:hover {
  background-color: var(--border-color-light);
}

/* --- SUB VIEW: TRACK ACTIVE DISPATCH ORDER --- */
.track-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.map-container {
  height: 150px;
  background-color: #e0f2f1;
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
  margin-bottom: 14px;
  border: 1px solid var(--border-color);
}

#map-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Vertical Timeline */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 10px;
}

.timeline-node {
  display: flex;
  gap: 16px;
  position: relative;
}

.timeline-node::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 18px;
  bottom: -18px;
  width: 2px;
  background-color: var(--border-color);
  z-index: 1;
}

.timeline-node:last-child::after {
  display: none;
}

.timeline-marker {
  width: 16px;
  height: 16px;
  border-radius: 8px;
  background-color: #fff;
  border: 3px solid var(--border-color);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-node.passed .timeline-marker {
  border-color: var(--primary);
  background-color: var(--primary);
}

.timeline-node.passed::after {
  background-color: var(--primary);
}

.timeline-node.active .timeline-marker {
  border-color: var(--primary);
  background-color: #fff;
  animation: pulse-node 1.5s infinite;
}

@keyframes pulse-node {
  0% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(46, 125, 50, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

.timeline-details h5 {
  font-size: 11px;
  font-weight: 700;
}

.timeline-details span {
  font-size: 9px;
  color: var(--text-secondary);
}

/* --- SUB VIEW: AI CROP DOCTOR DIAGNOSTIC --- */
.doctor-viewport {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}

.camera-lens {
  width: 100%;
  height: 200px;
  background-color: #e8f5e9;
  border: 2px dashed var(--primary);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}

.scanner-laser {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--accent);
  z-index: 20;
  display: none;
  opacity: 0.8;
}

.camera-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--primary-dark);
}

.cam-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.camera-placeholder p {
  font-size: 11px;
  font-weight: 600;
}

#leaf-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 10;
}

.diagnose-insights {
  background-color: #efebe9;
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 8px 12px;
  margin-bottom: 12px;
  animation: slide-up-diagnose 0.3s ease-out;
}

@keyframes slide-up-diagnose {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.diagnose-insights h3 {
  font-size: 13px;
  font-weight: 700;
}

.diagnose-insights p {
  font-size: 10px;
}

/* --- SUB VIEW: PRICE PREDICTIONS & CHART FORECASTS --- */
.forecast-card {
  background-color: #fff;
  border: 1px solid var(--border-color-light);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.forecast-card h4 {
  font-size: 12px;
  font-weight: 700;
}

.forecast-chart-container {
  height: 150px;
  position: relative;
  width: 100%;
}

#prediction-chart {
  width: 100%;
  height: 100%;
  display: block;
}

.insights-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.insight-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  padding: 10px;
}

.insight-box .lbl {
  font-size: 9px;
  color: var(--text-secondary);
}

.insight-box h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 2px 0;
}

.insight-box .sub {
  font-size: 9px;
}

/* --- TAB VIEW: MY WALLET TRANSACTIONS --- */
.wallet-balance-card {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #ff8c00 100%);
  border-radius: 12px;
  padding: 16px;
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 140, 0, 0.2);
  margin-bottom: 12px;
}

.wallet-balance-card .lbl {
  font-size: 10px;
  opacity: 0.85;
}

.wallet-balance-card h2 {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-mono);
  margin: 2px 0 10px 0;
  line-height: 1.1;
}

.balance-breakdown {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 10px;
}

.balance-breakdown div {
  flex: 1;
}

.balance-breakdown .val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  display: block;
}

.wallet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.wallet-actions .btn {
  height: 34px;
  font-size: 12px;
  margin-top: 0;
}

/* --- Toast Notifications styling --- */
.toast-container {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 320px;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(12, 43, 34, 0.85); /* glassmorphism dark emerald */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid var(--primary-color, #2ecc71);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  width: 100%;
  box-sizing: border-box;
  transform: translateY(-30px);
  opacity: 0;
  animation: toast-slide-down 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

.toast.success { border-left-color: #2ecc71; }
.toast.error { border-left-color: #e74c3c; }
.toast.warning { border-left-color: #f1c40f; }
.toast.info { border-left-color: #3498db; }

.toast-message {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
}

@keyframes toast-slide-down {
  0% { transform: translateY(-30px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes fade-out {
  to { opacity: 0; transform: translateY(-20px); }
}

/* --- Authentication View Styles --- */
#view-auth {
  top: 0;
  background: linear-gradient(135deg, #e8f5e9 0%, #ffffff 50%, #fff3e0 100%);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  z-index: 100;
}

.auth-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 20px 16px;
  box-shadow: 0 8px 32px rgba(46, 125, 50, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background-color: var(--bg-card);
  border-radius: 8px;
  padding: 3px;
  border: 1px solid var(--border-color-light);
}

.auth-toggle-tab {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 0;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.auth-toggle-tab.active {
  background-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.auth-form-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-error {
  background-color: #ffebee;
  color: #c62828;
  font-size: 10px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid #d32f2f;
  margin-bottom: 4px;
  text-align: center;
}

/* --- Star Watchlist Button Styles --- */
.mandi-fav-star {
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
  user-select: none;
  width: 20px;
  height: 20px;
  text-align: center;
  line-height: 20px;
}

.mandi-fav-star:hover {
  transform: scale(1.25);
}

.mandi-fav-star:active {
  transform: scale(0.9);
}

.star-filled {
  color: var(--accent) !important;
  text-shadow: 0 0 2px rgba(255, 152, 0, 0.4);
}

.star-empty {
  color: var(--text-muted) !important;
}

/* --- Farmer Profile View Styles --- */
#view-profile {
  top: 0;
  background-color: var(--bg-screen);
  padding: 16px;
  overflow-y: auto;
}

.splash-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #1b4d3e, #0c2b22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  border-radius: inherit; /* Matches mockup phone screen curvature */
  animation: css-dismiss-splash 3.2s forwards;
}

@keyframes css-dismiss-splash {
  0% { opacity: 1; visibility: visible; }
  90% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; pointer-events: none; }
}
.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-logo {
  font-size: 80px;
  animation: float 3s ease-in-out infinite;
}
.splash-title {
  color: #ffffff;
  font-size: 28px;
  font-weight: 700;
  margin-top: 20px;
  letter-spacing: 1px;
  font-family: 'Outfit', 'Inter', sans-serif;
}
.splash-subtitle {
  color: #a8d5c4;
  font-size: 14px;
  margin-top: 8px;
  font-family: 'Inter', sans-serif;
}
.splash-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid #2ecc71;
  border-radius: 50%;
  margin-top: 45px;
  animation: spin 1s linear infinite;
}

/* Sidebar Drawer Styles */
.sidebar-drawer {
  position: absolute;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background: #ffffff;
  z-index: 1001;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: inherit; /* keeps it in bounds of phonescreen curves */
  overflow: hidden;
}
.sidebar-drawer.open {
  transform: translateX(280px);
}
.sidebar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}
.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}
.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f7fafc;
}
.sidebar-logo {
  font-size: 20px;
  font-weight: 700;
  color: #2ecc71;
}
.sidebar-close-btn {
  font-size: 24px;
  background: none;
  border: none;
  color: #718096;
  cursor: pointer;
  line-height: 1;
}
.sidebar-user-section {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.sidebar-avatar {
  font-size: 32px;
  background: rgba(46, 204, 113, 0.1);
  padding: 6px;
  border-radius: 50%;
}
.sidebar-user-info h4 {
  margin: 0;
  font-size: 15px;
  color: #2d3748;
}
.sidebar-user-info p {
  margin: 4px 0 0 0;
  font-size: 11px;
  color: #718096;
}
.sidebar-menu {
  flex: 1;
  padding: 15px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  color: #4a5568;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.sidebar-menu-item:hover, .sidebar-menu-item.active {
  background: rgba(46, 204, 113, 0.08);
  color: #2ecc71;
  font-weight: 600;
}
.sidebar-footer {
  padding: 15px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f7fafc;
}

/* Shimmer Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f4f2 25%, #e2e8f0 50%, #f0f4f2 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-row {
  height: 60px;
  border-radius: 12px;
  margin-bottom: 12px;
  opacity: 0.8;
}
.skeleton-card {
  height: 140px;
  border-radius: 16px;
  margin-bottom: 16px;
  opacity: 0.8;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ==================================================== */
/* Cyber AgriTheme & Super App Styles Additions         */
/* ==================================================== */

/* Cyberpunk variables overrides */
body.cyber-theme {
  --primary: #00ff66;         /* Neon Green */
  --primary-dark: #00aa44;
  --primary-light: #0d2616;
  --secondary: #1a1e1b;
  --accent: #ffb300;          /* Glowing Amber */
  --bg-main: #060907;
  --bg-screen: #0b0f0c;       /* Cyber Dark background */
  --bg-card: #111813;         /* Glassmorphism dark green card */
  --bg-input: #17221b;
  --border-color: #1e3325;
  --border-color-light: #16261b;
  --text-main: #e2f0e8;
  --text-secondary: #9fbaa9;
  --text-muted: #5e7d6b;
  
  --shadow-sm: 0 0 8px rgba(0, 255, 102, 0.15);
  --shadow-md: 0 0 16px rgba(0, 255, 102, 0.25);
}

body.cyber-theme .phone-mockup {
  border-color: #00ff66;
  box-shadow: 0 0 30px rgba(0, 255, 102, 0.2), 0 20px 40px rgba(0,0,0,0.5);
}

body.cyber-theme .app-header {
  border-bottom: 1px solid #1e3325;
  background: #0f1712;
  box-shadow: 0 4px 10px rgba(0, 255, 102, 0.05);
}

body.cyber-theme .app-nav {
  border-top: 1px solid #1e3325;
  background: #0f1712;
}

body.cyber-theme .sidebar-drawer {
  background: #0d120e;
  border-right: 1px solid #1e3325;
  color: #e2f0e8;
}

body.cyber-theme .sidebar-header {
  background: #111813;
  border-bottom: 1px solid #1e3325;
}

body.cyber-theme .sidebar-user-section {
  background: #141d17;
  border-bottom: 1px solid #1e3325;
}

body.cyber-theme .sidebar-menu-item {
  color: #9fbaa9;
}
body.cyber-theme .sidebar-menu-item:hover, body.cyber-theme .sidebar-menu-item.active {
  background: rgba(0, 255, 102, 0.1);
  color: #00ff66;
  box-shadow: inset 3px 0 0 #00ff66;
}

body.cyber-theme .btn-primary {
  background: #00ff66;
  color: #050a06;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 255, 102, 0.3);
  border: none;
}
body.cyber-theme .btn-primary:hover {
  background: #00dd55;
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.5);
}

body.cyber-theme .btn-secondary {
  background: transparent;
  border: 1px solid #00ff66;
  color: #00ff66;
  box-shadow: 0 0 5px rgba(0, 255, 102, 0.1);
}
body.cyber-theme .btn-secondary:hover {
  background: rgba(0, 255, 102, 0.05);
  box-shadow: 0 0 10px rgba(0, 255, 102, 0.2);
}

/* Quick Actions Extra Colors */
.auction-color {
  background: rgba(156, 39, 176, 0.15) !important;
  color: #e040fb !important;
}
.nearby-color {
  background: rgba(3, 169, 244, 0.15) !important;
  color: #00b0ff !important;
}
.contract-color {
  background: rgba(233, 30, 99, 0.15) !important;
  color: #ff4081 !important;
}
.transport-color {
  background: rgba(255, 152, 0, 0.15) !important;
  color: #ffab40 !important;
}

/* Quick Actions Cards Cyber overrides */
body.cyber-theme .action-card {
  background: #111813;
  border: 1px solid #1e3325;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
body.cyber-theme .action-card:hover {
  border-color: #00ff66;
  box-shadow: 0 0 8px rgba(0, 255, 102, 0.2);
}

/* Store & Order Cards Cyber overrides */
body.cyber-theme .store-card, 
body.cyber-theme .order-card,
body.cyber-theme .mandi-price-row,
body.cyber-theme .form-container,
body.cyber-theme .farmer-greeting-card,
body.cyber-theme .weather-widget,
body.cyber-theme .forecast-card,
body.cyber-theme .wallet-balance-card,
body.cyber-theme .insight-box,
body.cyber-theme .diagnose-insights {
  background: #111813;
  border: 1px solid #1e3325;
  box-shadow: var(--shadow-sm);
}

body.cyber-theme .mandi-price-row:hover,
body.cyber-theme .store-card:hover {
  border-color: #00ff66;
  box-shadow: 0 0 10px rgba(0, 255, 102, 0.15);
}

/* Auction Timer UI & Bidding cards */
.auction-timer-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #1e2922;
  border: 1px solid #2ecc71;
  color: #2ecc71;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}
.auction-timer-badge.urgent {
  border-color: #ff3d00;
  color: #ff3d00;
  animation: pulse-border 1s infinite alternate;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 2px rgba(255, 61, 0, 0.2); }
  100% { box-shadow: 0 0 8px rgba(255, 61, 0, 0.6); }
}

.bid-history-container {
  margin-top: 10px;
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
}
.bid-history-title {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.bid-row-item {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  padding: 2px 0;
  color: var(--text-secondary);
}
.bid-row-item:first-child {
  color: var(--primary);
  font-weight: 700;
}

/* Nearby trader demand indicators */
.demand-indicator {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}
.demand-indicator.high {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
  border: 1px solid #2ecc71;
}
.demand-indicator.medium {
  background: rgba(255, 152, 0, 0.15);
  color: #ff9800;
  border: 1px solid #ff9800;
}

/* Contract layout styling */
.contract-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.contract-score-badge {
  background: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #2ecc71;
}
.contract-desc-body {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
}

/* Transport progress tracking bar styles */
.shipment-tracker-card {
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shipment-progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  margin-top: 4px;
}
.shipment-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #00e5ff 100%);
  width: 0%;
  transition: width 0.5s ease-in-out;
  border-radius: 4px;
}
.driver-avatar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}
.driver-call-btn {
  background: none;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 12px;
  padding: 1px 8px;
  font-size: 10px;
  cursor: pointer;
}

/* --- Checkout Modal & Admin dashboard Styles --- */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  animation: modal-scale 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modal-scale {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.admin-table-container th, .admin-table-container td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-color-light);
  white-space: nowrap;
}

.admin-btn-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.admin-btn {
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 700;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: opacity 0.15s;
}

.admin-btn:hover {
  opacity: 0.9;
}

.admin-btn.release {
  background-color: var(--primary);
  color: #fff;
}

.admin-btn.refund {
  background-color: #d32f2f;
  color: #fff;
}

.admin-btn.verify {
  background-color: #0288d1;
  color: #fff;
}

.admin-btn.secondary {
  background-color: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.audit-badge {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 4px;
  display: inline-block;
}

.audit-badge.dispute {
  background-color: rgba(211, 47, 47, 0.1);
  color: #d32f2f;
  border: 1px solid #d32f2f;
}

.audit-badge.escrow {
  background-color: rgba(46, 125, 50, 0.1);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.audit-badge.verified {
  background-color: rgba(2, 136, 209, 0.1);
  color: #0288d1;
  border: 1px solid #0288d1;
}

.audit-badge.pending {
  background-color: rgba(255, 152, 0, 0.1);
  color: #ff9800;
  border: 1px solid #ff9800;
}

/* --- Mandi Integration Premium Additions --- */
.refresh-btn {
  display: inline-block;
  cursor: pointer;
  transition: transform 0.25s ease, opacity var(--transition-fast);
  user-select: none;
}

.refresh-btn:hover {
  transform: scale(1.15);
  opacity: 0.85;
}

.refresh-btn.spinning {
  animation: spin 1.0s infinite linear;
  pointer-events: none;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.text-stable {
  color: var(--text-muted);
}

/* Input placeholder details */
#profile-api-key::placeholder {
  font-size: 11px;
  color: var(--text-muted);
}

/* Ensure chart container preserves perfect mobile sizing */
.forecast-chart-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 180px;
}

/* --- PWA Install Promotion Banner --- */
.install-banner {
  position: absolute;
  bottom: 75px;
  left: 12px;
  right: 12px;
  z-index: 1000;
  background: linear-gradient(135deg, rgba(27, 77, 62, 0.95), rgba(12, 43, 34, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  transform: translateY(150px);
  opacity: 0;
}

.install-banner.visible {
  transform: translateY(0);
  opacity: 1;
}

.install-banner.hidden {
  transform: translateY(150px);
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

.banner-close-btn {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.banner-close-btn:hover {
  color: #ffffff;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.banner-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.banner-text {
  flex: 1;
}

.banner-text h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
}

.banner-text p {
  margin: 2px 0 0 0;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.3;
}

.banner-action-btn {
  font-size: 11px;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

/* --- iOS Install Instruction Bottom Sheet --- */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10001;
  display: flex;
  align-items: flex-end;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

.ios-install-sheet {
  background: #0f3026;
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  width: 100%;
  padding: 24px 20px;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.ios-install-sheet.active {
  transform: translateY(0);
}

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

.ios-sheet-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.ios-sheet-close {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  line-height: 1;
}

.ios-sheet-close:hover {
  color: #ffffff;
}

.ios-install-sheet p {
  margin: 0 0 16px 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
}

.ios-steps-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.ios-step-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ios-step-number {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  color: #000000;
  flex-shrink: 0;
}

.ios-step-row p {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
}

.ios-icon {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  margin: 0 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}


