/* ============================================================================
   DigitalManager AgriERP™ - Management Analytics Dashboard
   Theme: Corporate AgriTech Light Theme with Vibrant Tangerine/Orange Accents
   Specification: Digitalsofts (Pvt.) Ltd. • DS-PROP-2026-AGRI-1200
   1,200-Acre Agricultural Estate, Mirpurkhas, Sindh
   ============================================================================ */

:root {
  /* Brand Tangerine & Orange Accents */
  --primary-orange: #ea580c;
  --primary-orange-hover: #c2410c;
  --orange-light: #fff7ed;
  --orange-subtle: #ffedd5;
  --orange-border: #fed7aa;
  --orange-accent: #f97316;
  --orange-glow: rgba(234, 88, 12, 0.15);

  /* Secondary & Semantic Colors */
  --blue-primary: #0284c7;
  --blue-subtle: #f0f9ff;
  --blue-border: #bae6fd;
  
  --emerald-success: #059669;
  --emerald-subtle: #ecfdf5;
  --emerald-border: #a7f3d0;

  --violet-accent: #7c3aed;
  --violet-subtle: #f5f3ff;
  --violet-border: #ddd6fe;

  --rose-danger: #e11d48;
  --rose-subtle: #fff1f2;
  --rose-border: #fecdd3;

  --amber-warning: #d97706;
  --amber-subtle: #fffbeb;
  --amber-border: #fde68a;

  /* Surfaces & Backgrounds */
  --bg-page: #f4f6fa;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-input: #ffffff;
  --border-card: #e2e8f0;
  --border-light: #edf2f7;

  /* Typography */
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Elevation */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.03);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 9999px;

  /* Layout */
  --container-max: 1540px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Top System Announcement Banner */
.system-top-banner {
  background: linear-gradient(90deg, #1e293b 0%, #0f172a 100%);
  color: #f8fafc;
  padding: 6px 20px;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 100;
}

.system-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.system-badge-tag {
  background: var(--primary-orange);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.system-banner-right {
  display: none; /* Hidden per user request; accessible directly via URLs */
  align-items: center;
  gap: 14px;
}

.banner-link {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color var(--transition-fast);
}

.banner-link:hover {
  color: #ffffff;
}

.banner-link-primary {
  background: rgba(255, 255, 255, 0.15);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  color: #ffffff;
}

.banner-link-primary:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Main Dashboard Header */
.dash-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-card);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 10px var(--orange-glow);
  flex-shrink: 0;
}

.brand-meta h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.brand-meta-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-status-strip {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-indicator-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-card);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.status-dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-dot-pulse.green {
  background: #10b981;
}

.status-dot-pulse.green::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  border: 1.5px solid #10b981;
  animation: pulse-ring 2s infinite ease-out;
}

.status-dot-pulse.orange {
  background: #f97316;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

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

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  background: #ffffff;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.btn-icon:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: #cbd5e1;
}

.icon-badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--primary-orange);
  border-radius: 50%;
  border: 1.5px solid #ffffff;
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border-card);
  cursor: pointer;
}

.user-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-text-info {
  display: flex;
  flex-direction: column;
}

.user-name-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.user-role-label {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Dashboard Container */
.dash-content-wrapper {
  max-width: var(--container-max);
  margin: 18px auto 60px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Interactive Filter & Date Horizon Toolbar (Matches attached screenshot style) */
.filter-toolbar-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.horizon-pills-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.horizon-pill-btn {
  background: transparent;
  border: none;
  padding: 6px 14px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.horizon-pill-btn:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.03);
}

.horizon-pill-btn.active {
  background: var(--primary-orange);
  color: #ffffff;
  box-shadow: 0 2px 6px var(--orange-glow);
}

.filter-controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-custom {
  appearance: none;
  background: #ffffff;
  border: 1px solid var(--border-card);
  padding: 6px 32px 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
}

.select-custom:focus {
  border-color: var(--primary-orange);
}

.select-icon-chevron {
  position: absolute;
  right: 10px;
  pointer-events: none;
  color: var(--text-muted);
}

.btn-primary-orange {
  background: var(--primary-orange);
  color: #ffffff;
  border: none;
  padding: 7px 16px;
  border-radius: var(--radius-md);
  font-size: 0.76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 6px var(--orange-glow);
}

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

.btn-outline {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-card);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 0.76rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

/* ============================================================================
   TOP HERO PERFORMANCE CARD (Matches large focal score in reference image)
   ============================================================================ */
.hero-efficiency-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-top: 4px solid var(--primary-orange);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.hero-efficiency-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.hero-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.hero-badge-pill {
  background: var(--orange-light);
  color: var(--primary-orange);
  border: 1px solid var(--orange-border);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hero-date-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.hero-focal-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 0 20px 0;
}

.hero-focal-number {
  font-size: 4.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
  letter-spacing: -1.5px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.hero-focal-unit {
  font-size: 2.2rem;
  color: var(--primary-orange);
  font-weight: 700;
}

.hero-focal-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-orange);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-focal-caption {
  font-size: 0.76rem;
  color: var(--text-muted);
  max-width: 580px;
  margin-top: 4px;
}

.hero-metrics-substrip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  border-top: 1px solid var(--border-light);
  padding-top: 18px;
  margin-top: 6px;
}

.hero-submetric-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.submetric-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.submetric-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.submetric-trend {
  font-size: 0.7rem;
  font-weight: 700;
}

.submetric-trend.positive { color: var(--emerald-success); }
.submetric-trend.neutral { color: var(--blue-primary); }
.submetric-trend.warning { color: var(--amber-warning); }

/* ============================================================================
   ACTIONABLE ALERT RIBBONS (Matches 4 callouts with orange buttons in image)
   ============================================================================ */
.alert-ribbons-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert-callout-row {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--primary-orange);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.alert-callout-row:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.alert-callout-row.alert-blue {
  border-left-color: var(--blue-primary);
}

.alert-callout-row.alert-violet {
  border-left-color: var(--violet-accent);
}

.alert-callout-row.alert-emerald {
  border-left-color: var(--emerald-success);
}

.alert-content-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.alert-tag-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  margin-top: 2px;
}

.alert-tag-badge.orange {
  background: var(--orange-subtle);
  color: var(--primary-orange);
  border: 1px solid var(--orange-border);
}

.alert-tag-badge.blue {
  background: var(--blue-subtle);
  color: var(--blue-primary);
  border: 1px solid var(--blue-border);
}

.alert-tag-badge.violet {
  background: var(--violet-subtle);
  color: var(--violet-accent);
  border: 1px solid var(--violet-border);
}

.alert-text-block {
  display: flex;
  flex-direction: column;
}

.alert-headline {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.alert-details {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 1px;
}

.alert-action-btn {
  background: var(--primary-orange);
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 4px var(--orange-glow);
  flex-shrink: 0;
}

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

/* ============================================================================
   MANAGEMENT FINANCIAL PERFORMANCE CARDS (PKR Figures)
   ============================================================================ */
.financial-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.fin-kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  transition: all var(--transition-fast);
}

.fin-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.fin-kpi-card.highlight-orange {
  border-top: 3px solid var(--primary-orange);
}

.fin-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.fin-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.fin-card-chip {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.fin-card-chip.green {
  background: var(--emerald-subtle);
  color: var(--emerald-success);
}

.fin-card-chip.blue {
  background: var(--blue-subtle);
  color: var(--blue-primary);
}

.fin-card-chip.orange {
  background: var(--orange-subtle);
  color: var(--primary-orange);
}

.fin-amount-large {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.fin-amount-currency {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 3px;
}

.fin-card-footer {
  font-size: 0.7rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-light);
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================================================
   ALLOCATION & BREAKDOWN SECTION (Donut + Multi-tier Horizontal Bars)
   ============================================================================ */
.breakdown-row-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 16px;
}

@media (max-width: 1024px) {
  .breakdown-row-grid {
    grid-template-columns: 1fr;
  }
}

.card-panel {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.panel-title-block h3 {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title-block p {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Donut Layout */
.donut-center-layout {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
  padding: 10px 0;
}

.donut-chart-container {
  width: 190px;
  height: 190px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-center-info {
  position: absolute;
  text-align: center;
  pointer-events: none;
}

.donut-center-total {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.donut-center-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 2px;
}

.donut-legend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 180px;
}

.legend-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.73rem;
}

.legend-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-bullet {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-val-num {
  font-weight: 700;
  color: var(--text-main);
}

/* Cost Progress Bars (Section 3 Formal Equations) */
.cost-bars-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cost-bar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cost-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
}

.cost-bar-title {
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.cost-bar-amount {
  color: var(--text-secondary);
  font-weight: 600;
}

.cost-bar-track {
  height: 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.cost-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Quick Metrics Row (5 compact cards) */
.quick-indicators-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.quick-ind-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: transform var(--transition-fast);
}

.quick-ind-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.quick-ind-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.quick-ind-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.quick-ind-note {
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================================================
   SECTOR & CROP BLOCK STATUS CARDS (4 interactive sector cards)
   ============================================================================ */
.sector-blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.sector-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--transition-fast);
  position: relative;
}

.sector-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.sector-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.sector-name-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
}

.sector-acre-crop {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.status-badge-chip {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.status-badge-chip.optimal {
  background: var(--emerald-subtle);
  color: var(--emerald-success);
  border: 1px solid var(--emerald-border);
}

.status-badge-chip.active-pump {
  background: var(--orange-subtle);
  color: var(--primary-orange);
  border: 1px solid var(--orange-border);
  animation: pulse-border 2s infinite;
}

.status-badge-chip.locked-phi {
  background: var(--rose-subtle);
  color: var(--rose-danger);
  border: 1px solid var(--rose-border);
}

.status-badge-chip.normal {
  background: var(--blue-subtle);
  color: var(--blue-primary);
  border: 1px solid var(--blue-border);
}

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(234, 88, 12, 0); }
}

.sector-kpi-subgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.sector-sub-stat {
  display: flex;
  flex-direction: column;
}

.sector-sub-stat .stat-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sector-sub-stat .stat-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 1px;
}

.sector-progress-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sector-prog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
}

.sector-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
  font-size: 0.72rem;
}

/* ============================================================================
   ANALYTICAL CHARTS GRID (4 responsive high-impact charts)
   ============================================================================ */
.analytics-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 1024px) {
  .analytics-charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-panel-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chart-canvas-wrapper {
  position: relative;
  height: 250px;
  width: 100%;
}

/* ============================================================================
   COMPLETE 18-SENSOR IOT ENVIRONMENTAL TELEMETRY & ACTUATION CENTER
   (Proposal Section 7 - Complete 18-Sensor Agriculture Catalog)
   ============================================================================ */
.iot-telemetry-section {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.iot-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 14px;
}

.iot-title-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.iot-beacon-ring {
  width: 36px;
  height: 36px;
  background: var(--orange-light);
  color: var(--primary-orange);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--orange-border);
}

.iot-actuation-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 8px 12px;
  border-radius: var(--radius-md);
}

.relay-switch-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* Switch Toggle Component */
.toggle-switch-wrapper {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.toggle-switch-wrapper input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 20px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--primary-orange);
}

input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

/* 18 Sensors Grid */
.sensors-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 12px;
}

.sensor-cell-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: all var(--transition-fast);
  position: relative;
}

.sensor-cell-card:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.sensor-cell-card.alert-state {
  border-color: var(--orange-border);
  background: var(--orange-light);
}

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

.sensor-num-badge {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
}

.sensor-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.sensor-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.sensor-reading {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.sensor-unit {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 2px;
}

.sensor-param-tag {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.sensor-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.sensor-status-dot.active { background: var(--emerald-success); }
.sensor-status-dot.warning { background: var(--primary-orange); animation: pulse-ring 2s infinite; }
.sensor-status-dot.alert { background: var(--rose-danger); }

/* ============================================================================
   MANAGEMENT TABULAR LEDGER (5 Tabs matching ERP Modules)
   ============================================================================ */
.management-table-section {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.table-tabs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
}

.table-tabs-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  max-width: 100%;
}

.table-tab-btn {
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-tab-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.table-tab-btn.active {
  background: var(--orange-light);
  color: var(--primary-orange);
  border: 1px solid var(--orange-border);
}

.table-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-search-input {
  background: var(--bg-subtle);
  border: 1px solid var(--border-card);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.74rem;
  color: var(--text-main);
  outline: none;
  min-width: 200px;
  transition: border-color var(--transition-fast);
}

.table-search-input:focus {
  border-color: var(--primary-orange);
  background: #ffffff;
}

/* Data Table Styling */
.table-responsive-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.erp-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.76rem;
}

.erp-data-table th {
  background: var(--bg-subtle);
  padding: 10px 14px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-card);
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.erp-data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  white-space: nowrap;
}

.erp-data-table tr:hover td {
  background: #fafafa;
}

.badge-table {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
}

.badge-table.green { background: var(--emerald-subtle); color: var(--emerald-success); }
.badge-table.orange { background: var(--orange-subtle); color: var(--primary-orange); }
.badge-table.blue { background: var(--blue-subtle); color: var(--blue-primary); }
.badge-table.purple { background: var(--violet-subtle); color: var(--violet-accent); }
.badge-table.red { background: var(--rose-subtle); color: var(--rose-danger); }

.table-footer-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-top: 8px;
}

/* ============================================================================
   MODAL / POPUP DETAILS DIALOG
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

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

.modal-dialog-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-card);
  overflow: hidden;
  animation: modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
}

.modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
  font-size: 0.8rem;
}

/* Executive Footer */
.dash-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-card);
  padding: 20px 24px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-content {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

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

.toast-msg {
  background: #0f172a;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.76rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 4px solid var(--primary-orange);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   TOP IOT TELEMETRY & ACTUATION COMMAND BLOCK (Shown on top per user request)
   ============================================================================ */
.top-iot-command-block {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-top: 4px solid var(--primary-orange);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.top-iot-command-block::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.03));
  pointer-events: none;
}

.top-iot-row-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.top-iot-badge-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-iot-icon-box {
  width: 36px;
  height: 36px;
  background: var(--orange-light);
  color: var(--primary-orange);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--orange-border);
  flex-shrink: 0;
}

.top-iot-title-text h3 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.top-iot-title-text p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.top-iot-metrics-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.top-iot-pill-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.top-iot-pill-chip.alert-chip {
  background: var(--orange-light);
  border-color: var(--orange-border);
  color: var(--primary-orange);
}

.top-iot-pill-val {
  font-weight: 800;
  color: var(--text-main);
}

.top-iot-pill-chip.alert-chip .top-iot-pill-val {
  color: var(--primary-orange);
}

.top-iot-actuators-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
  flex-wrap: wrap;
  gap: 12px;
}

.top-iot-relays-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.top-relay-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
}

.top-relay-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.top-relay-tag.on {
  background: var(--orange-subtle);
  color: var(--primary-orange);
}

.top-relay-tag.photo {
  background: var(--emerald-subtle);
  color: var(--emerald-success);
}

/* ============================================================================
   MAIN MULTI-TAB NAVIGATION BAR
   ============================================================================ */
.main-nav-tabs-bar {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.main-nav-tab-btn {
  background: transparent;
  border: none;
  padding: 9px 18px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
  user-select: none;
}

.main-nav-tab-btn:hover {
  background: var(--orange-light);
  color: var(--primary-orange);
}

.main-nav-tab-btn.active {
  background: var(--primary-orange);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--orange-glow);
}

.main-nav-tab-btn .tab-badge-pill {
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
  font-weight: 800;
}

.main-nav-tab-btn.active .tab-badge-pill {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Tab Content Panels */
.tab-content-panel {
  display: none;
}

.tab-content-panel.active {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: tabFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Print Overrides */
@media print {
  .system-top-banner, .dash-header, .filter-toolbar-card, .btn-icon, .alert-action-btn, .table-toolbar-actions, .toggle-switch-wrapper {
    display: none !important;
  }
  body {
    background: #ffffff;
  }
  .card-panel, .hero-efficiency-card, .chart-panel-card, .iot-telemetry-section {
    border: 1px solid #ccc;
    box-shadow: none;
    page-break-inside: avoid;
  }
}
