/* =====================================================
   SMARTMOP - BERANDA (index.css)
   Khusus halaman index.html
   ===================================================== */

/* ---------- Kartu status ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat { display: flex; align-items: center; gap: 16px; padding: 20px; }
.stat-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 10px; }
.stat-icon .ico { width: 20px; height: 20px; }
.tone-green, .tone-grey, .tone-blue { background: #eef1f5; color: #475467; }
.stat-body { flex: 1; min-width: 0; }
.stat-body > span { display: block; font-size: 13px; color: var(--text-secondary); }
.stat-body strong { display: block; font-size: 22px; font-weight: 600; line-height: 1.3; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat-body small { color: var(--text-secondary); }
.stat-body .good { color: var(--success); }
.stat-body .bad { color: var(--danger); }
.stat-body .progress { margin-top: 8px; }

/* ---------- Grid utama ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; min-width: 0; }

.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.thumbs figure { display: grid; gap: 6px; }
.thumbs figcaption { font-weight: 500; color: var(--navy); }
.thumbs .feed { aspect-ratio: 4 / 3; }

/* ---------- Kontrol robot ---------- */
.control { display: grid; gap: 18px; }
.dpad {
    display: grid; grid-template-columns: repeat(3, 72px); grid-template-rows: repeat(3, 56px);
    justify-content: center; gap: 10px; padding: 10px 0;
    transition: opacity var(--transition);
}
.dpad[data-disabled="true"] { opacity: 0.5; }
.dpad button { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-light); color: #344054; display: grid; place-items: center; transition: background var(--transition), transform 0.1s ease; }
.dpad button:hover { background: #eef1f5; }
.dpad button:active { transform: scale(0.96); }
.dpad button .ico { width: 22px; height: 22px; stroke-width: 2; }
.dpad .up { grid-area: 1 / 2; } .dpad .left { grid-area: 2 / 1; } .dpad .stop { grid-area: 2 / 2; }
.dpad .right { grid-area: 2 / 3; } .dpad .down { grid-area: 3 / 2; }
.dpad .stop { background: var(--danger-bg); border-color: #f7c6c1; color: var(--danger); }
.dpad .stop:hover { background: #fdd0cc; }
.dpad .stop .ico { fill: currentColor; stroke-width: 1; }
.control > * { min-width: 0; }
.control-note { margin-top: 12px; color: var(--text-secondary); font-size: 13px; }
.control .control-note { margin-top: -8px; }
.control-page { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); }
.control-page .dpad { grid-template-columns: repeat(3, 88px); grid-template-rows: repeat(3, 72px); }
.act-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(156px, 1fr)); gap: 12px; }
.act-row .btn { white-space: nowrap; }
.act-row .btn { min-height: 48px; }
.tool-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.tool-tile { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-light); font-weight: 500; }
.tool-tile span { display: flex; align-items: center; gap: 8px; }
.tool-tile .ico { color: var(--text-secondary); width: 18px; height: 18px; }

/* ---------- Deteksi terkini ---------- */
.det-list { display: grid; gap: 12px; }
.det { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.det .feed { aspect-ratio: 4 / 3.3; border-radius: 6px; grid-row: span 2; }
.det h3 { font-size: 14px; font-weight: 500; line-height: 1.3; }
.det h3.bad { color: #c2410c; } .det h3.good { color: var(--navy); }
.det .pct { display: block; font-size: 20px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.det .pct.bad { color: var(--danger); } .det .pct.good { color: var(--success); }
.det time { display: block; color: var(--text-secondary); font-size: 13px; }
.det .badge { justify-self: start; align-self: start; margin-top: 6px; grid-column: 2; }

/* ---------- Log aktivitas ---------- */
.log { list-style: none; display: grid; gap: 10px; }
.log li { display: grid; grid-template-columns: 8px 64px minmax(0, 1fr); gap: 10px; align-items: center; }
.log li:not(:has(time)) { grid-template-columns: 8px minmax(0, 1fr); }
.log i { width: 8px; height: 8px; border-radius: 50%; background: #98a2b3; }
.log .danger i { background: var(--danger); } .log .success i { background: #16a34a; }
.log time { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
