/* ===========================================================
   Seed & Sow — Garden Board (TV display)
   Direkonstruksi high-fidelity dari design handoff.
   Kanvas tetap 1920×1080, scale-to-fit (lihat app.js: fit()).
   =========================================================== */
:root {
  --cream: #FBF6EA;
  --ink: #2D3A2E;
  --ink-soft: #5E6B58;
  --ok: #2FA36B;     /* aksen / "aman" — dapat dikonfigurasi via CONFIG.accent */
  --warn: #E89823;   /* warning (≤ threshold) — semantik, tidak ikut aksen */
  --crit: #E1503B;   /* critical (≤ 5 mnt) — semantik */
  --card: #FFFFFF;
  --line: #ECE3CF;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; background: #1c2a1f; overflow: hidden; }
body { display: flex; align-items: center; justify-content: center; font-family: "Nunito", sans-serif; }

#stage {
  width: 1920px; height: 1080px; flex: 0 0 auto; position: relative; transform-origin: center center;
  background:
    radial-gradient(1200px 700px at 82% -10%, #FFF4D6 0%, rgba(255,244,214,0) 60%),
    radial-gradient(1100px 650px at 8% 110%, #DDF0D6 0%, rgba(221,240,214,0) 55%),
    linear-gradient(180deg, #FBF6EA 0%, #F4EEDC 100%);
  overflow: hidden;
}
#stage::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background:
    radial-gradient(circle at 40px 80px, rgba(47,163,107,.14) 0 7px, transparent 8px),
    radial-gradient(circle at 120px 60px, rgba(47,163,107,.10) 0 5px, transparent 6px);
  background-size: 160px 90px; opacity: .8; pointer-events: none;
}

.wrap { position: absolute; inset: 0; padding: 46px 52px 40px; display: flex; flex-direction: column; }

header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.brand { display: flex; align-items: center; gap: 18px; }
.mark { width: 74px; height: 74px; border-radius: 22px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 22px rgba(154,154,30,.30); }
.mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-txt { display: flex; flex-direction: column; line-height: 1; }
.brand-txt .name { font-family: "Fredoka"; font-weight: 700; font-size: 40px; color: var(--ink); letter-spacing: .2px; }
.brand-txt .tag { font-weight: 800; font-size: 17px; color: var(--ok); letter-spacing: 3px; text-transform: uppercase; margin-top: 5px; }

.head-right { display: flex; align-items: center; gap: 22px; }
.clock { text-align: right; line-height: 1; }
.clock .time { font-family: "Fredoka"; font-weight: 600; font-size: 46px; color: var(--ink); font-variant-numeric: tabular-nums; }
.clock .date { font-weight: 700; font-size: 18px; color: var(--ink-soft); margin-top: 6px; }
.sound-btn { width: 60px; height: 60px; border-radius: 18px; border: 2px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-soft); transition: .2s; }
.sound-btn:hover { border-color: var(--ok); color: var(--ok); }
.sound-btn.on { background: var(--ok); border-color: var(--ok); color: #fff; }

/* Tombol uji coba suara (sementara, hapus saat produksi) */
.test-btn { height: 60px; padding: 0 22px; border-radius: 18px; border: 2px solid var(--line);
  background: #fff; cursor: pointer; color: var(--ink); font-family: "Nunito", sans-serif;
  font-weight: 800; font-size: 17px; transition: .2s; white-space: nowrap; }
.test-btn:hover { border-color: var(--ok); color: var(--ok); }
.test-btn:active { transform: scale(.96); }

/* Indikator koneksi data */
.conn { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; color: var(--ink-soft); }
.conn-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ink-soft); }
.conn.live .conn-dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.conn.demo .conn-dot { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.conn.down .conn-dot { background: var(--crit); box-shadow: 0 0 10px var(--crit); }

.cols { flex: 1; display: grid; grid-template-columns: 1fr 470px; gap: 30px; min-height: 0; }
.panel { display: flex; flex-direction: column; min-height: 0; }
.panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: nowrap; white-space: nowrap; }
.panel-head h2 { font-family: "Fredoka"; font-weight: 600; font-size: 34px; color: var(--ink); }
.count-badge { background: var(--ink); color: #fff; font-weight: 900; font-size: 20px; min-width: 44px; height: 44px;
  border-radius: 13px; display: flex; align-items: center; justify-content: center; padding: 0 12px; }

.grid { display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(2, 1fr); gap: 22px; flex: 1; min-height: 0; }
.card { background: var(--card); border-radius: 26px; padding: 26px 18px 22px; box-shadow: 0 8px 20px rgba(45,58,46,.07);
  border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 14px; position: relative; overflow: hidden; }
.avatar { width: 88px; height: 88px; border-radius: 50%; flex: none; color: #fff; font-family: "Fredoka";
  font-weight: 700; font-size: 44px; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 -4px 10px rgba(0,0,0,.12); }
.who { text-align: center; }
.who .nm { font-family: "Fredoka"; font-weight: 600; font-size: 32px; color: var(--ink); line-height: 1; white-space: nowrap; }
.chips { display: flex; gap: 8px; justify-content: center; margin-top: 11px; }
.chip { font-weight: 800; font-size: 15px; padding: 5px 11px; border-radius: 9px; white-space: nowrap; }
.chip.gate { background: #EAF3FB; color: #3E8FD0; }
.chip.dur { background: #F0EAF7; color: #8A5BC0; }
.cd { font-family: "Fredoka"; font-weight: 600; font-size: 52px; font-variant-numeric: tabular-nums; color: var(--ok); line-height: 1; margin-top: auto; }
.cdlbl { font-weight: 800; font-size: 13px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 2px; margin-top: -6px; }
.bar { width: 100%; height: 11px; border-radius: 6px; background: #EFEAD9; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--ok); transition: width 1s linear; }

.card[data-state="warning"] { border-color: #F4C97A; background: #FFFBF0; }
.card[data-state="warning"] .cd { color: var(--warn); }
.card[data-state="warning"] .bar > i { background: var(--warn); }
.card[data-state="critical"] { border-color: var(--crit); background: #FFF4F1; animation: pulseCard 1.6s ease-in-out infinite; }
.card[data-state="critical"] .cd { color: var(--crit); }
.card[data-state="critical"] .bar > i { background: var(--crit); }
@keyframes pulseCard { 0%,100% { box-shadow: 0 8px 20px rgba(225,80,59,.12); } 50% { box-shadow: 0 0 0 5px rgba(225,80,59,.18); } }

.akan { background: linear-gradient(180deg,#FFF3DD 0%, #FFE9D6 100%); border-radius: 28px; border: 2px solid #F6D79B;
  padding: 26px 24px; display: flex; flex-direction: column; min-height: 0; }
.akan .panel-head h2 { font-size: 30px; }
.akan .sub { font-weight: 800; font-size: 16px; color: var(--warn); margin: -8px 0 18px 2px; }
.akan .count-badge { background: var(--crit); }
.akList { display: flex; flex-direction: column; gap: 16px; overflow: hidden; flex: 1; }
.akRow { background: #fff; border-radius: 20px; padding: 18px 20px; display: flex; align-items: center; gap: 16px;
  border: 2px solid #F4C97A; box-shadow: 0 6px 14px rgba(232,152,35,.10); }
.akRow .avatar { width: 54px; height: 54px; font-size: 26px; }
.akRow .who2 { flex: 1; min-width: 0; }
.akRow .who2 .nm { font-family: "Fredoka"; font-weight: 600; font-size: 28px; color: var(--ink); line-height: 1; }
.akRow .who2 .meta { font-weight: 800; font-size: 15px; color: var(--ink-soft); margin-top: 5px; }
.akRow .cd { font-size: 38px; }
.bell { color: var(--warn); flex: none; display: inline-flex; }
.akRow[data-state="warning"] { border-color: var(--warn); }
.akRow[data-state="warning"] .cd { color: var(--warn); }
.akRow[data-state="critical"] { border-color: var(--crit); background: #FFF4F1; animation: softGlow 1.6s ease-in-out infinite; }
.akRow[data-state="critical"] .cd, .akRow[data-state="critical"] .bell { color: var(--crit); }
/* Denyut halus (bukan kedip keras) — menarik perhatian tanpa melelahkan mata. */
@keyframes softGlow { 0%,100% { box-shadow: 0 0 0 0 rgba(225,80,59,0); } 50% { box-shadow: 0 0 0 5px rgba(225,80,59,.28); } }
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--ok); text-align: center; }
.empty .big { font-family: "Fredoka"; font-weight: 600; font-size: 28px; }
.empty .sm { font-weight: 700; font-size: 17px; color: var(--ink-soft); }

/* Hero brand saat belum ada anak bermain — wordmark asli Seed & Sow. */
.brand-hero { grid-column: 1 / -1; grid-row: 1 / -1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 26px; }
.brand-hero img { width: min(60%, 720px); height: auto; border-radius: 28px;
  box-shadow: 0 18px 44px rgba(154,154,30,.28); }
.brand-hero .sm { font-weight: 800; font-size: 20px; color: var(--ink-soft); letter-spacing: .3px; }

/* Aksesibilitas: nonaktifkan animasi bila user/sistem minta reduced-motion
   (direkomendasikan README untuk produksi). */
@media (prefers-reduced-motion: reduce) {
  .card[data-state="critical"], .akRow[data-state="critical"] { animation: none; }
}
