/* =========================
   RESET
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f7fbff;
  --border: #e3ebf3;
  --border-soft: #edf2f7;

  --text: #17324d;
  --text-soft: #5f7388;
  --text-muted: #7f92a6;

  --primary: #17324d;
  --primary-hover: #12283d;
  --secondary: #0f766e;
  --secondary-soft: #e8f7f2;

  --success-bg: #eaf8ef;
  --success-text: #18794e;

  --warning-bg: #fff4df;
  --warning-text: #9a6700;

  --danger-bg: #fdecec;
  --danger-text: #b42318;

  --shadow-sm: 0 6px 18px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 12px 32px rgba(16, 24, 40, 0.08);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;

  --container: 1180px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* =========================
   LAYOUT
========================= */
.container {
  width: min(var(--container), 92%);
  margin: 0 auto;
}

.page-wrap {
  padding: 30px 0 46px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

/* =========================
   TOPBAR
========================= */
.topbar {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f766e, #22c55e);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 2px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.top-nav a {
  text-decoration: none;
  color: var(--text);
  padding: 10px 15px;
  border-radius: 999px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.top-nav a:hover,
.top-nav a.active {
  background: var(--primary);
  color: #fff;
}

/* MOBILE NAV: toggle button */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.mobile-menu-toggle:hover {
  background: #f6f9fc;
}

.mobile-menu-toggle-icon {
  font-size: 18px;
  line-height: 1;
}

.mobile-menu-toggle-text {
  font-size: 14px;
  line-height: 1;
}

/* =========================
   CARD BASE
========================= */
.hero-card,
.section-card,
.overview-card,
.highlight-card,
.alert-box,
.note-panel,
.timeline-card,
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.hero-card,
.section-card,
.overview-card,
.highlight-card,
.alert-box {
  padding: 24px;
  margin-bottom: 22px;
}

.section-card {
  border: 1px solid var(--border-soft);
}

.overview-card {
  border: 1px solid var(--border-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.overview-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* =========================
   SECTION HEAD
========================= */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}

.section-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 6px;
}

.section-title {
  font-size: 26px;
  line-height: 1.25;
  color: var(--text);
}

.section-desc {
  max-width: 480px;
  color: var(--text-soft);
  font-size: 15px;
}

/* =========================
   HERO HOME
========================= */
.hero-home {
  padding: 30px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.10), transparent 28%),
    radial-gradient(circle at bottom left, rgba(15, 118, 110, 0.10), transparent 26%),
    #ffffff;
  border: 1px solid var(--border-soft);
}

.hero-home-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 26px;
  align-items: stretch;
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary);
  background: var(--secondary-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero-card h2,
.page-hero h2,
.highlight-card h2 {
  font-size: 36px;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 14px;
}

.hero-text {
  font-size: 16px;
  color: var(--text-soft);
  max-width: 760px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-point {
  background: #f1f6fb;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 14px;
  font-weight: 600;
}

.hero-side-card {
  background: linear-gradient(180deg, #17324d 0%, #1d4365 100%);
  color: #fff;
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.hero-side-card h3 {
  font-size: 22px;
  margin-bottom: 18px;
  color: #fff;
}

.side-stat-list {
  display: grid;
  gap: 12px;
}

.side-stat-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.side-stat-item span {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
}

.side-stat-item strong {
  font-size: 22px;
  color: #fff;
}

/* =========================
   BUTTONS
========================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: #f6f9fc;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: #f6f9fc;
}

/* =========================
   PILLS
========================= */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  background: #eef5fb;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

/* =========================
   DASHBOARD ENTRY CARDS
========================= */
.dashboard-entry-grid {
  align-items: stretch;
}

.dashboard-entry-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
}

.entry-top {
  margin-bottom: 10px;
}

.entry-badge {
  display: inline-block;
  margin-bottom: 10px;
  background: #e8f7f2;
  color: #0f766e;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.entry-badge-factory {
  background: #edf4ff;
  color: #2563eb;
}

.dashboard-entry-card h3 {
  font-size: 24px;
  margin-bottom: 10px;
}

.dashboard-entry-card p {
  color: var(--text-soft);
  margin-bottom: 16px;
}

.feature-list {
  list-style: none;
  margin-bottom: 20px;
}

.feature-list li {
  position: relative;
  padding-left: 20px;
  color: var(--text);
  margin-bottom: 8px;
}

.feature-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary);
  position: absolute;
  left: 0;
  top: 10px;
}

/* =========================
   STAT CARDS
========================= */
.stat-card {
  padding: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.stat-card h4 {
  color: var(--text-soft);
  font-size: 14px;
  margin-bottom: 8px;
  font-weight: 600;
}

.stat-card h3 {
  font-size: 30px;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 8px;
}

.stat-card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.stat-grid-home {
  margin-bottom: 18px;
}

/* =========================
   HIGHLIGHT + NOTE
========================= */
.home-highlight-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  align-items: stretch;
}

.highlight-card {
  background: linear-gradient(135deg, #0f766e 0%, #0ea5a4 100%);
  color: #fff;
  border: none;
}

.highlight-card h2 {
  color: #fff;
  margin-bottom: 8px;
}

.highlight-card p,
.highlight-card small {
  color: rgba(255, 255, 255, 0.9);
}

.highlight-label {
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.note-panel {
  border: 1px solid #dbe8f5;
  padding: 22px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #f8fbfe 0%, #ffffff 100%);
}

.note-panel h4 {
  font-size: 20px;
  margin-bottom: 10px;
  color: var(--text);
}

.note-panel p {
  color: var(--text-soft);
}

/* =========================
   TIMELINE / ROADMAP
========================= */
.timeline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.timeline-card {
  padding: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
}

.timeline-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #e8f7f2;
  color: #0f766e;
  font-weight: 700;
  margin-bottom: 12px;
}

.timeline-card h4 {
  font-size: 18px;
  margin-bottom: 8px;
}

.timeline-card p {
  color: var(--text-soft);
  font-size: 14px;
}

/* =========================
   PAGE HERO
========================= */
.page-hero {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}

.page-hero p {
  color: var(--text-soft);
  font-size: 15px;
}

/* =========================
   FARMER / FACTORY BLOCKS
========================= */
.farmer-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.farmer-top h3 {
  font-size: 22px;
  margin-bottom: 4px;
}

.farmer-top p {
  color: var(--text-soft);
}

.alert-box {
  background: #fff8ec;
  border: 1px solid #f7d9a4;
}

.alert-box h3 {
  margin-bottom: 8px;
  color: #8a4b00;
}

.alert-box p {
  color: #6e5328;
}

/* =========================
   TABLE
========================= */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

table th,
table td {
  text-align: left;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
}

table th {
  background: #f8fbfd;
  color: var(--text);
  font-weight: 700;
}

table tr:last-child td {
  border-bottom: none;
}

/* =========================
   BADGES
========================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: #eef5fb;
  color: var(--text);
}

.badge-high {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge-medium {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.badge-low {
  background: var(--danger-bg);
  color: var(--danger-text);
}

/* =========================
   CHART PLACEHOLDER
========================= */
.chart-box {
  overflow: hidden;
}

.trend-placeholder {
  height: 240px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding-top: 18px;
}

.trend-bar {
  flex: 0 0 auto;
  min-width: 24px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, #22c55e 0%, #0f766e 100%);
  box-shadow: inset 0 -8px 16px rgba(255, 255, 255, 0.08);
}

/* =========================
   EMPTY STATE
========================= */
.empty-state {
  padding: 18px;
  border-radius: 16px;
  background: #f8fbfd;
  border: 1px dashed #cdd9e5;
}

.empty-state p {
  color: var(--text-soft);
}

/* =========================
   FOOTER
========================= */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 18px 0;
  color: var(--text-soft);
  text-align: center;
  font-size: 14px;
}



/* =========================
   FARMER DASHBOARD EXTENSIONS
========================= */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.farmer-profile-card {
  padding: 26px;
}

.farmer-profile-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.25fr;
  gap: 24px;
  align-items: start;
}

.profile-badge {
  display: inline-block;
  margin-bottom: 12px;
  background: #e8f7f2;
  color: #0f766e;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.farmer-profile-main h3 {
  font-size: 30px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.profile-subtext {
  color: var(--text-soft);
  max-width: 420px;
}

.farmer-profile-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.meta-item {
  background: #f8fbfd;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}

.meta-item span {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.meta-item strong {
  font-size: 16px;
  color: var(--text);
  line-height: 1.4;
}

.stat-date {
  font-size: 22px !important;
}

.irrigation-panel {
  padding: 24px;
}

.alert-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
}

.advisory-grid {
  align-items: stretch;
}

.advisory-card {
  height: 100%;
  position: relative;
}

.advisory-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 14px;
  color: #fff;
  font-size: 16px;
}

.advisory-icon-green {
  background: linear-gradient(135deg, #16a34a, #22c55e);
}

.advisory-icon-orange {
  background: linear-gradient(135deg, #ea580c, #f59e0b);
}

.advisory-icon-blue {
  background: linear-gradient(135deg, #2563eb, #38bdf8);
}

.advisory-title {
  font-size: 22px;
  margin-bottom: 10px;
}

.trend-chart-card {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 20px;
  align-items: end;
}

.labeled-trend {
  height: 270px;
  gap: 12px;
  padding-top: 10px;
}

.trend-col {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-width: 28px;
}

.trend-col span {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 600;
}

.trend-note {
  background: linear-gradient(180deg, #f8fbfd 0%, #ffffff 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.trend-note h4 {
  font-size: 20px;
  margin-bottom: 10px;
  color: var(--text);
}

.trend-note p {
  color: var(--text-soft);
}

.single-info-card {
  background: linear-gradient(180deg, #f8fbfd 0%, #ffffff 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
}

.single-info-card strong {
  font-size: 24px;
  color: var(--text);
}

@media (max-width: 1080px) {
  .grid-3,
  .farmer-profile-grid,
  .trend-chart-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .farmer-profile-main h3 {
    font-size: 26px;
  }

  .farmer-profile-meta {
    grid-template-columns: 1fr;
  }

  .alert-top-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
  
  /* =========================
   FACTORY DASHBOARD EXTENSIONS
========================= */
.factory-stat-grid {
  margin-bottom: 0;
}

.factory-highlight-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  margin-bottom: 22px;
  align-items: stretch;
}

.factory-main-highlight {
  min-height: 100%;
}

.compact-note-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.compact-title {
  font-size: 22px;
  margin-bottom: 10px;
}

.factory-note-grid {
  align-items: stretch;
}

.operational-note-card {
  height: 100%;
}

.note-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.note-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

.note-icon-green {
  background: linear-gradient(135deg, #16a34a, #22c55e);
}

.note-icon-blue {
  background: linear-gradient(135deg, #2563eb, #38bdf8);
}

.production-trend-wrap {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 20px;
  align-items: end;
}

.production-trend-chart {
  height: 280px;
  gap: 12px;
  padding-top: 10px;
}

.production-summary-box {
  background: linear-gradient(180deg, #f8fbfd 0%, #ffffff 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.production-summary-box h4 {
  font-size: 20px;
  margin-bottom: 10px;
  color: var(--text);
}

.production-summary-box p {
  color: var(--text-soft);
}

@media (max-width: 1080px) {
  .factory-highlight-grid,
  .production-trend-wrap {
    grid-template-columns: 1fr;
  }
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1080px) {
  .hero-home-grid,
  .home-highlight-row,
  .timeline-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .topbar-inner,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-inner {
    position: relative;
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .top-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .top-nav.is-open {
    display: flex;
  }

  .top-nav a {
    width: 100%;
    border-radius: 12px;
    padding: 12px 14px;
  }

  .hero-home-grid,
  .grid-2,
  .home-highlight-row,
  .timeline-grid {
    grid-template-columns: 1fr;
  }

  .section-desc {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .page-wrap {
    padding: 22px 0 34px;
  }

  .hero-home,
  .section-card,
  .overview-card,
  .highlight-card,
  .alert-box,
  .page-hero {
    padding: 20px;
  }

  .hero-card h2,
  .page-hero h2,
  .highlight-card h2 {
    font-size: 28px;
  }

  .brand {
    width: 100%;
    align-items: flex-start;
  }

  .brand-title {
    font-size: 18px;
  }

  .brand-subtitle {
    font-size: 12px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .mobile-menu-toggle {
    width: 100%;
    justify-content: center;
  }

  .top-nav a {
    padding: 10px 13px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}