/* BWB Inbox — dark premium (adaptasi mockup v2 varian 002) */
* { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: #0f1420;
  color: #e8ecf4;
  -webkit-font-smoothing: antialiased;
}
.num { font-variant-numeric: tabular-nums; }

/* ---------- LOGIN ---------- */
.login-body {
  display:flex; align-items:center; justify-content:center;
  min-height:100vh; padding:20px;
  background: linear-gradient(160deg, #0b0e14 0%, #0f1420 55%, #0b0d12 100%);
}
.login-card {
  width:100%; max-width:340px;
  background:#121a2b; border:1px solid #232b3a; border-radius:18px;
  padding:30px 26px 24px; text-align:center;
  box-shadow:0 24px 60px rgba(0,0,0,.55);
}
.login-logo { margin-bottom:18px; text-align:center; }
.login-card h1 { font-size:21px; font-weight:800; color:#f3efe4; letter-spacing:.3px; }
.login-sub { font-size:12px; color:#8a92a3; margin:8px 0 18px; line-height:1.5; }
.login-input {
  display:block; width:100%; margin-bottom:10px;
  background:#0f1420; border:1px solid #2a3348; border-radius:12px;
  padding:12px 14px; font-size:14px; color:#e8ecf4; outline:none;
}
.login-input:focus { border-color:#f5a623; }
.login-err {
  background:rgba(229,72,77,.14); border:1px solid rgba(229,72,77,.4);
  color:#ff9a9d; font-size:12.5px; border-radius:10px; padding:8px 10px; margin-bottom:12px;
}
.login-note { font-size:10.5px; color:#667082; margin-top:16px; }

/* ---------- TOMBOL ---------- */
.btn {
  display:block; width:100%; text-align:center; background:#f5a623; color:#191307;
  font-weight:800; font-size:14px; border:none; border-radius:12px;
  padding:12px 0; letter-spacing:.3px; cursor:pointer;
}
.btn:active { opacity:.85; }
.btn.ghost { background:transparent; color:#f5a623; border:1px solid rgba(245,166,35,.4); }

/* ---------- APP BAR ---------- */
.appbar { position:relative;
  
  position:sticky; top:0; z-index:10;
  background:#141a26; border-bottom:1px solid #232b3a;
  padding:12px 14px; display:flex; align-items:center; gap:10px;
}
.appbar .t { font-size:15px; font-weight:700; color:#f0ede3; }
.appbar .sub { font-size:10.5px; color:#7d8494; margin-top:2px; }
.appbar .spacer { flex:1; }
.pill {
  display:inline-flex; align-items:center; gap:4px;
  background:rgba(245,166,35,.12); color:#f5a623;
  border:1px solid rgba(245,166,35,.35);
  border-radius:999px; padding:2px 8px; font-size:10.5px; font-weight:700;
}

/* ---------- NAV BAWAH ---------- */
.tabbar {
  position:fixed; bottom:14px; left:50%; transform:translateX(-50%); z-index:20;
  display:flex; background:#141a26; border:1px solid #232b3a;
  border-radius:22px; box-shadow:0 10px 30px rgba(0,0,0,.45);
  width:min(430px, calc(100% - 28px));
  padding:6px 6px max(6px, env(safe-area-inset-bottom));
}
.tabbar button {
  flex:1; background:none; border:none; color:#667082; border-radius:16px;
  font-size:10.5px; font-weight:700; padding:6px 0 2px; cursor:pointer;
}
.tabbar button svg { display:block; margin:0 auto 2px; }
.tabbar button.on { color:#f5a623; }

/* ---------- HAMBURGER + MENU ---------- */
.burger {
  background:#1a2337; border:1px solid #232b3a; color:#e8ecf4;
  width:38px; height:38px; border-radius:12px; font-size:19px;
  cursor:pointer; line-height:1; display:flex; align-items:center; justify-content:center;
}
.menu {
  position:fixed; top:60px; right:12px; z-index:60;
  background:#1a2337; border:1px solid #232b3a; border-radius:12px;
  width:180px; padding:6px;
  display:none; flex-direction:column;
}
.menu.open { display:flex; }
.menu button {
  background:none; border:none; color:#e8ecf4; text-align:left;
  padding:11px 12px; border-radius:10px; font-size:14px; cursor:pointer;
}
.menu button:hover { background:#232b3a; }
.menu button#mLogout { color:#ff6b6b; }

/* ---------- KARTU ---------- */
.wrap { padding:12px 12px 70px; max-width:640px; margin:0 auto; }
.card {
  background:#1a2337; border:1px solid #232b3a; border-radius:14px;
  padding:12px 14px; margin-bottom:10px;
}
.card-label { font-size:10.5px; color:#7d8494; letter-spacing:.6px; text-transform:uppercase; }
.big { font-size:32px; font-weight:800; color:#f5f1e6; line-height:1.2; padding-top:2px; }
.big.gold { color:#f5a623; }
.kpi-row { display:flex; gap:10px; }
.kpi-row .card { flex:1; }

/* ---------- DASBOR ---------- */
.window-card { display:flex; align-items:center; gap:10px; }
.window-card .ico { font-size:22px; }
.window-card .who { font-size:13px; font-weight:700; color:#f0ede3; }
.window-card .tm { font-size:22px; font-weight:800; color:#ff8a8d; }
.spark { display:flex; align-items:flex-end; gap:7px; height:64px; padding-top:6px; }
.spark .bar { flex:1; background:#2b3547; border-radius:3px 3px 0 0; min-height:3px; }
.spark .bar.peak { background:linear-gradient(180deg,#f5a623,#b5852a); }
.spark .day { font-size:8.5px; color:#667082; text-align:center; margin-top:4px; }
.card-h { display:flex; align-items:center; justify-content:space-between; }

/* ---------- DAFTAR CHAT ---------- */
.chat-item {
  display:flex; align-items:center; gap:10px;
  background:#1a2337; border:1px solid #232b3a; border-radius:14px;
  padding:11px 13px; margin-bottom:8px; cursor:pointer;
}
.chat-item .avatar {
  width:38px; height:38px; flex:none; border-radius:50%;
  background:#1d2432; border:1px solid #28324a;
  display:flex; align-items:center; justify-content:center;
  color:#f5a623; font-weight:800; font-size:15px;
}
.chat-item .mid { flex:1; min-width:0; }
.chat-item .nm { font-size:13px; font-weight:700; color:#f0ede3; }
.chat-item .prev { font-size:11.5px; color:#8a92a3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; }
.chat-item .right { text-align:right; flex:none; }
.chat-item .tm { font-size:10px; color:#667082; }
.badge {
  display:inline-block; background:#f5a623; color:#191307;
  border-radius:999px; font-size:10px; font-weight:800; padding:1px 7px; margin-top:3px;
}
.win-badge { font-size:9.5px; color:#ff8a8d; display:block; margin-top:2px; }
.win-badge.ok { color:#f5a623; }

/* ---------- THREAD ---------- */
.thread-head {
  position:sticky; top:0; z-index:10;
  background:#141a26; border-bottom:1px solid #232b3a;
  padding:10px 12px; display:flex; align-items:center; gap:10px;
}
.thread-head .back { color:#f5a623; font-size:16px; cursor:pointer; padding:4px 6px; border:none; background:none; }
.thread-head .who { flex:1; min-width:0; }
.thread-head .nm { font-size:13.5px; font-weight:700; color:#f0ede3; }
.thread-head .sub { font-size:10.5px; color:#7d8494; margin-top:1px; }
.thread-body {
  padding:12px 11px 90px; display:flex; flex-direction:column; gap:8px;
  background:#0d1118; min-height:60vh;
}
.msg { max-width:82%; border-radius:12px; padding:8px 10px 6px; font-size:12.5px; line-height:1.5; word-wrap:break-word; }
.msg .txt { color:#e8ecf4; white-space:pre-wrap; }
.msg .meta { text-align:right; font-size:9px; color:#8a8677; margin-top:3px; }
.msg.in { align-self:flex-start; background:#1d2432; border:1px solid #28324a; border-bottom-left-radius:4px; }
.msg.out { align-self:flex-end; background:rgba(245,166,35,.14); border:1px solid rgba(245,166,35,.4); border-bottom-right-radius:4px; }
.msg.out .meta { color:#c9a35a; }
.msg .st { font-weight:700; }
.msg .st.read { color:#f5a623; } .msg .st.failed { color:#ff8a8d; }
.composer {
  position:fixed; bottom:0; left:0; right:0;
  display:flex; align-items:flex-end; gap:8px;
  background:#141a26; border-top:1px solid #232b3a;
  padding:9px 11px max(9px, env(safe-area-inset-bottom));
  max-width:640px; margin:0 auto;
}
.composer textarea {
  flex:1; background:#1d2432; border:1px solid #2a3348; border-radius:16px;
  padding:9px 13px; font-size:12.5px; color:#e8ecf4; outline:none;
  resize:none; max-height:110px; font-family:inherit;
}
.composer textarea:focus { border-color:#f5a623; }
.composer .send {
  width:36px; height:36px; flex:none; border-radius:50%; background:#f5a623; border:none;
  color:#191307; font-weight:800; font-size:15px; cursor:pointer;
}
.composer.disabled { pointer-events:none; opacity:.6; }
.composer-lock {
  position:fixed; bottom:0; left:0; right:0; max-width:640px; margin:0 auto;
  background:#1a2337; border-top:1px solid rgba(229,72,77,.4);
  color:#ff9a9d; font-size:11.5px; font-weight:700; text-align:center;
  padding:12px 10px max(12px, env(safe-area-inset-bottom));
}

/* ---------- BLAST ---------- */
.table { width:100%; border-collapse:collapse; }
.table td { padding:6px 2px; font-size:12px; border-bottom:1px solid #1e2534; }
.table td.v { text-align:right; font-weight:800; color:#f5f1e6; font-size:13px; }
.table td.v.gold { color:#f5a623; }
.table td.v.dim { color:#8a92a3; }
.table td.k { color:#9aa3b5; }
.table tr:last-child td { border-bottom:none; }
.roster { display:flex; flex-direction:column; gap:7px; }
.roster .r { display:flex; align-items:center; gap:8px; font-size:12px; }
.roster .nm { flex:1; color:#dfe3ea; font-weight:600; }
.st.read { color:#f5a623; } .st.sent, .st.delivered { color:#8a92a3; } .st.failed, .st.fail { color:#ff8a8d; } .st.queued { color:#667082; }

/* ---------- TEMPLATE META ---------- */
.tpl-badge {
  display:inline-flex; align-items:center;
  border-radius:999px; padding:1px 8px;
  font-size:9.5px; font-weight:800; letter-spacing:.4px;
  flex:none;
}
.tpl-badge.ok   { background:rgba(74,222,128,.14); color:#4ade80; border:1px solid rgba(74,222,128,.35); }
.tpl-badge.pend { background:rgba(245,166,35,.14); color:#f5a623; border:1px solid rgba(245,166,35,.35); }
.tpl-badge.rej  { background:rgba(229,72,77,.14); color:#ff8a8d; border:1px solid rgba(229,72,77,.35); }
.tpl-badge.dis { background:rgba(140,148,165,.14); color:#8a92a3; border:1px solid rgba(140,148,165,.3); }
.tpl-body {
  font-size:11.5px; color:#dfe3ea; line-height:1.55; white-space:pre-wrap; word-wrap:break-word;
  background:#0f1420; border:1px solid #232b3a; border-radius:10px; padding:8px 10px;
}
.tpl-reason {
  margin-top:6px; font-size:11px; color:#ff9a9d;
  background:rgba(229,72,77,.1); border:1px solid rgba(229,72,77,.3);
  border-radius:10px; padding:7px 10px;
}
.tpl-legend .tpl-legend-row { display:flex; align-items:center; gap:8px; font-size:11px; color:#9aa3b5; margin-bottom:5px; }
.tpl-legend .tpl-badge { min-width:58px; justify-content:center; }
.tpl-lab { display:block; font-size:10.5px; font-weight:700; color:#9aa3b5; letter-spacing:.6px; text-transform:uppercase; margin:12px 0 5px; }
.tpl-input {
  display:block; width:100%;
  background:#0f1420; border:1px solid #2a3348; border-radius:10px;
  padding:10px 12px; font-size:12.5px; color:#e8ecf4; outline:none;
  font-family:inherit; resize:vertical;
}
.tpl-input:focus { border-color:#f5a623; }
.tpl-hint { font-size:10.5px; color:#667082; margin-top:4px; line-height:1.5; }
.tpl-btn-edit { display:flex; gap:6px; margin-bottom:6px; align-items:center; }
.tpl-btn-edit .tpl-btn-x {
  background:none; border:none; color:#8a92a3; font-size:14px; cursor:pointer; padding:2px 4px; flex:none;
}
.tpl-btn-row { font-size:11.5px; color:#dfe3ea; margin-bottom:4px; word-break:break-all; }
.tpl-err { margin-top:10px; font-size:11.5px; color:#ff9a9d; line-height:1.5; white-space:pre-wrap; }
.btn.danger {
  background:rgba(229,72,77,.16); color:#ff8a8d; border:1px solid rgba(229,72,77,.45); font-weight:700;
}
.modal-wrap {
  position:fixed; inset:0; z-index:60;
  background:rgba(8,11,17,.72);
  display:flex; align-items:center; justify-content:center; padding:24px;
}
.modal {
  width:100%; max-width:340px;
  background:#1a2337; border:1px solid #2a3348; border-radius:16px;
  padding:18px 16px 16px; box-shadow:0 24px 60px rgba(0,0,0,.6);
}
.modal .t { font-size:15px; font-weight:800; color:#f0ede3; }
.modal .d { font-size:12px; color:#9aa3b5; line-height:1.6; }
.modal .d b { color:#f5d28a; word-break:break-all; }

/* ---------- EMPTY STATE ---------- */
.empty {
  text-align:center; padding:36px 18px; color:#8a92a3;
}
.empty .ico { font-size:38px; margin-bottom:10px; opacity:.8; }
.empty .t { font-size:14px; font-weight:700; color:#c8cdd8; margin-bottom:6px; }
.empty .d { font-size:12px; line-height:1.6; }

/* ---------- MISC ---------- */
.back-link { color:#f5a623; font-size:12.5px; font-weight:700; background:none; border:none; cursor:pointer; padding:4px 0; }
.toast {
  position:fixed; bottom:70px; left:50%; transform:translateX(-50%);
  background:#1a2337; border:1px solid rgba(245,166,35,.5); color:#f5d28a;
  font-size:12px; font-weight:700; border-radius:999px; padding:8px 16px;
  z-index:50; opacity:0; transition:opacity .25s; pointer-events:none; max-width:90vw;
}
.toast.show { opacity:1; }
