/* Home screen — dark-green "digital agriculture" theme.
   Inspired by the reference, but tuned for low-literacy Urdu users:
   solid readable cards (not text-over-photo), big icons, big Urdu labels,
   high contrast. Scoped to the home route so tested screens stay untouched. */

:root {
  --hg-deep:   #0B2419;   /* page */
  --hg-1:      #16452F;   /* hero top */
  --hg-2:      #0C2C1D;   /* hero bottom */
  --hg-card:   rgba(255,255,255,0.06);
  --hg-card-2: rgba(255,255,255,0.10);
  --hg-border: rgba(255,255,255,0.14);
  --hg-text:   #F2F7F3;
  --hg-muted:  #9FBCAC;
  --hg-accent: #46E08A;   /* bright leaf green */
}

/* Theme the shared shell only while on the home route */
body[data-route="/dashboard"] { background: var(--hg-deep); }
body[data-route="/dashboard"] #app-header {
  background: transparent;
  position: absolute; left: 0; right: 0; top: 0; z-index: 20;
  box-shadow: none;
}
body[data-route="/dashboard"] #app-header #page-title { opacity: 0; }
body[data-route="/dashboard"] #app-main { padding: 0 0 92px 0; max-width: 640px; }
body[data-route="/dashboard"] #app-nav {
  background: #0E2E20; border-top: 1px solid rgba(255,255,255,0.08);
}
body[data-route="/dashboard"] #app-nav .nav-item { color: #7FA592; }
body[data-route="/dashboard"] #app-nav .nav-item.active { color: var(--hg-accent); }

.home {
  color: var(--hg-text);
  min-height: 100vh;
}

/* ---------- HERO ---------- */
.home-hero {
  position: relative;
  padding: calc(env(safe-area-inset-top) + 64px) 20px 26px;
  background: linear-gradient(165deg, var(--hg-1) 0%, var(--hg-2) 78%);
  border-radius: 0 0 28px 28px;
  overflow: hidden;
}
.home-hero .hills {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 120px;
  opacity: 0.5; pointer-events: none;
}
.home-hero-greeting { font-size: 15px; color: var(--hg-muted); margin-bottom: 2px; }
.home-hero-farm {
  font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -0.3px;
}
.home-hero-date { font-size: 14px; color: var(--hg-muted); margin-top: 4px; }

/* Health strip pill */
.home-strip {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 10px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600; position: relative; z-index: 2;
  backdrop-filter: blur(6px);
}
.home-strip.green  { background: rgba(70,224,138,0.16); color: #8AF0B4; border: 1px solid rgba(70,224,138,0.35); }
.home-strip.amber  { background: rgba(245,180,20,0.16); color: #FFD37A; border: 1px solid rgba(245,180,20,0.4); }
.home-strip.red    { background: rgba(239,68,68,0.18);  color: #FF9B9B; border: 1px solid rgba(239,68,68,0.45); }

/* ---------- GLANCE STATS ---------- */
.home-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 18px 16px 4px;
}
.home-stat {
  background: var(--hg-card); border: 1px solid var(--hg-border);
  border-radius: 18px; padding: 14px 12px; text-align: center;
  backdrop-filter: blur(8px);
}
.home-stat .st-icon { font-size: 22px; line-height: 1; }
.home-stat .st-value { font-size: 24px; font-weight: 700; margin-top: 6px; }
.home-stat .st-label { font-size: 11.5px; color: var(--hg-muted); margin-top: 2px; }
.home-stat.warn .st-value { color: #FFD37A; }
.home-stat.danger .st-value { color: #FF9B9B; }

/* ---------- SECTION TITLES ---------- */
.home-section-title {
  font-size: 15px; font-weight: 700; color: var(--hg-text);
  padding: 22px 20px 10px; letter-spacing: 0.2px;
}
html[dir="rtl"] .home-section-title { letter-spacing: 0; }

/* ---------- BIG ACTION TILES ---------- */
.home-actions {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  padding: 0 16px;
}
.home-tile {
  background: linear-gradient(160deg, var(--hg-card-2), var(--hg-card));
  border: 1px solid var(--hg-border);
  border-radius: 22px; padding: 18px 16px;
  min-height: 108px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  text-decoration: none; color: var(--hg-text);
  transition: transform .06s ease;
  position: relative; overflow: hidden;
}
.home-tile:active { transform: scale(0.975); }
.home-tile .tile-icon {
  width: 52px; height: 52px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  font-size: 27px; margin-bottom: 12px;
}
.home-tile .tile-label { font-size: 17px; font-weight: 700; line-height: 1.25; }
.home-tile .tile-sub { font-size: 12px; color: var(--hg-muted); margin-top: 2px; }

/* per-pillar accent colours (soft, on dark) */
.tile-animals .tile-icon { background: rgba(70,224,138,0.18);  color: #7CF0AE; }
.tile-health  .tile-icon { background: rgba(255,120,120,0.18); color: #FF9B9B; }
.tile-fodder  .tile-icon { background: rgba(180,220,90,0.18);  color: #CDE87A; }
.tile-money   .tile-icon { background: rgba(255,205,90,0.18);  color: #FFD37A; }
.tile-tasks   .tile-icon { background: rgba(110,170,255,0.18); color: #9CC2FF; }
.tile-weigh   .tile-icon { background: rgba(150,200,190,0.18); color: #A7E0D2; }

/* badge on a tile (e.g. overdue count) */
.home-tile .tile-badge {
  position: absolute; top: 14px; inset-inline-end: 14px;
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px;
  background: #EF4444; color: white; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- TODAY'S TASKS ---------- */
.home-today { padding: 0 16px; }
.home-today-card {
  background: var(--hg-card); border: 1px solid var(--hg-border);
  border-radius: 20px; padding: 6px 16px; backdrop-filter: blur(8px);
}
.home-task-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.home-task-row:last-child { border-bottom: none; }
.home-task-check {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--hg-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: transparent;
}
.home-task-row.done .home-task-check { background: var(--hg-accent); border-color: var(--hg-accent); color: #06301B; }
.home-task-row.done .home-task-title { color: var(--hg-muted); text-decoration: line-through; }
.home-task-info { flex: 1; min-width: 0; }
.home-task-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-task-meta { font-size: 12px; color: var(--hg-muted); }
.home-task-meta.overdue { color: #FF9B9B; }
.home-empty { padding: 26px; text-align: center; color: var(--hg-muted); }

/* View-all link */
.home-viewall {
  display: block; text-align: center; padding: 14px; margin: 4px 16px 0;
  color: var(--hg-accent); font-weight: 600; text-decoration: none; font-size: 14px;
}
