/* BISMILLAH SUKSES — versi publik */
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #f1f5f9; color: #0f172a; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 8px; }
h3 { font-size: 14px; margin: 16px 0 6px; }
.muted { color: #64748b; }
.small { font-size: 12px; }
a { color: #2563eb; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 28px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.06); }
.login-card form { text-align: left; margin-top: 16px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.login-card input { width: 100%; margin-top: 4px; }

/* Topbar */
.topbar { background: #0f172a; color: #fff; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; position: sticky; top: 0; z-index: 10; }
.topbar p { margin: 2px 0 0; color: #cbd5e1; font-size: 13px; }
.brand { display: flex; gap: 10px; align-items: center; }
.logo { width: 42px; height: 42px; border-radius: 10px; background: #16a34a; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 22px; flex-shrink: 0; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.live-label { font-size: 12px; color: #cbd5e1; display: flex; gap: 6px; align-items: center; }

/* Layout */
.container { max-width: 1280px; margin: 0 auto; padding: 16px; }
.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.banner { background: #fef3c7; border: 1px solid #f59e0b; border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }
footer { text-align: center; color: #94a3b8; font-size: 12px; padding: 20px; }

/* Stats */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.stat { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; }
.stat.warn { border-color: #f59e0b; background: #fffbeb; }
.stat-label { display: block; font-size: 12px; color: #64748b; }
.stat strong { font-size: 22px; display: block; margin: 2px 0; }

/* Form */
input, select, textarea { padding: 9px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #2563eb55; border-color: #2563eb; }
label.check { display: flex; gap: 6px; align-items: center; font-size: 14px; }
label.check input { width: auto; }
.btn { padding: 9px 14px; border-radius: 8px; border: 1px solid transparent; font-size: 14px; cursor: pointer; background: #e2e8f0; color: #0f172a; white-space: nowrap; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.primary { background: #16a34a; color: #fff; }
.btn.ghost { background: #fff; border-color: #cbd5e1; }
.btn.danger-ghost { background: #fff; border-color: #fca5a5; color: #b91c1c; }
.btn.small { padding: 5px 8px; font-size: 12px; }
.btn.block { width: 100%; margin-top: 6px; }
.api-form, .add-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.api-form input, .add-form input { flex: 1; min-width: 160px; }
.api-form input[type="number"], .add-form input[type="number"] { flex: 0 0 90px; min-width: 90px; }
.bulk { margin-top: 12px; }
.bulk summary { cursor: pointer; font-size: 14px; }
.bulk textarea { margin: 8px 0; }
.msg { padding: 10px 12px; border-radius: 8px; background: #dcfce7; border: 1px solid #86efac; margin-top: 10px; font-size: 14px; white-space: pre-line; }
.msg.error { background: #fee2e2; border-color: #fca5a5; }
.api-status { font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 999px; background: #fee2e2; color: #b91c1c; }
.api-status.on { background: #dcfce7; color: #166534; }

/* Toolbar */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input[type="search"] { flex: 1; min-width: 200px; }
.toolbar select { width: auto; }

/* Table */
.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 10px 8px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: top; white-space: nowrap; }
th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .02em; color: #475569; }
tr:hover td { background: #f8fafc; }
.ch-cell { display: flex; gap: 8px; align-items: center; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.actions { display: flex; gap: 4px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.aman { background: #dcfce7; color: #166534; }
.badge.waspada { background: #fef3c7; color: #92400e; }
.badge.kritis { background: #fee2e2; color: #b91c1c; }
.stock-controls { display: flex; gap: 6px; align-items: center; }
.stock-controls button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid #cbd5e1; background: #fff; cursor: pointer; font-size: 15px; }
.stock-num { font-weight: 700; min-width: 22px; text-align: center; }
.empty { text-align: center; padding: 28px; color: #64748b; }
.mini-table th, .mini-table td { white-space: normal; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 14px; padding: 20px; width: 100%; max-width: 720px; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; top: 10px; right: 10px; border: none; background: #f1f5f9; border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 15px; }
#historyChart { width: 100%; height: auto; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }
#detailVideos { padding-left: 18px; font-size: 14px; }
#detailVideos li { margin-bottom: 6px; }
#top48List { margin: 0; padding-left: 20px; font-size: 14px; }
#top48List li { margin-bottom: 4px; }

@media (max-width: 720px) {
  .topbar { position: static; }
  .container { padding: 10px; }
  .card { padding: 12px; }
}
