* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #f5b301; --brand-d: #e0a200; --ink: #1f2430; --muted: #6b7280;
  --line: #e9ebef; --bg: #f3f4f6; --side: #20222e; --side-2: #2a2d3b; --side-ink: #c7cbd6;
}
html, body { height: 100%; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #272b3a, #3b4256); padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.login-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.login-head h1 { font-size: 20px; }
.field { margin-bottom: 14px; }
.field input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; }
.captcha-row { display: flex; gap: 10px; }
.captcha-row input { flex: 1; }
.captcha-img { width: 120px; height: 44px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: #fafafa; object-fit: contain; }
.err { color: #c0392b; font-size: 13px; min-height: 18px; margin-bottom: 10px; }

/* ---------- Buttons ---------- */
.btn { padding: 10px 16px; border: none; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--brand-d); }
.btn.block { width: 100%; padding: 12px; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.lang { display: inline-flex; gap: 3px; }
.lang button { border: 1px solid var(--line); background: #fff; padding: 4px 9px; border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--muted); }
.lang button.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 212px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; }
.logo { display: flex; align-items: center; gap: 8px; padding: 18px 18px 14px; color: #fff; font-weight: 700; }
.logo .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; color: #20222e; font-size: 13px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 0; }
.nav-item, .nav-sub a { display: flex; align-items: center; gap: 10px; padding: 11px 18px; color: var(--side-ink); cursor: pointer; text-decoration: none; font-size: 14px; border: none; background: none; width: 100%; text-align: left; }
.nav-item:hover, .nav-sub a:hover { background: var(--side-2); color: #fff; }
.nav-item.active, .nav-sub a.active { background: var(--brand); color: #20222e; border-radius: 22px; margin: 0 10px; width: auto; padding: 11px 16px; font-weight: 600; }
.nav-ico { width: 18px; text-align: center; opacity: .9; }
.nav-sub a { padding-left: 46px; font-size: 13px; }
.nav-caret { margin-left: auto; font-size: 11px; opacity: .6; }
.side-foot { padding: 14px 18px; }
.logout { width: 100%; border: 1px solid var(--brand); color: var(--brand); background: none; padding: 9px; border-radius: 20px; cursor: pointer; font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: var(--brand); color: #20222e; height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; position: sticky; top: 0; z-index: 20; }
.crumb { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.hamb { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: #20222e; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #20222e; color: #fff; display: grid; place-items: center; font-size: 13px; }
.content { padding: 22px; }

/* ---------- Cards / dashboard ---------- */
.section-title { font-size: 18px; font-weight: 700; margin: 4px 0 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: #fff; border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.stat h4 { font-size: 14px; margin-bottom: 12px; }
.stat .split { display: flex; gap: 12px; }
.stat .cell { flex: 1; background: #f6f7f9; border-radius: 8px; padding: 12px; text-align: center; }
.stat .cell .n { font-size: 24px; font-weight: 700; }
.stat .cell .l { color: var(--muted); font-size: 12px; margin-top: 2px; }

.panel { background: #fff; border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.panel h3 { font-size: 15px; margin-bottom: 14px; }
.panel .legend { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.panel .legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); margin-right: 5px; vertical-align: middle; }
.chart-box { width: 100%; overflow-x: auto; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 18px; }
.form-row > label { display: block; font-weight: 600; margin-bottom: 7px; }
.form-row .req { color: #e4572e; }
.form-row input[type=text], .form-row textarea, .form-row select { width: 100%; max-width: 560px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.form-row textarea { min-height: 84px; resize: vertical; }
.radio-row { display: flex; gap: 20px; flex-wrap: wrap; }
.radio-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.upload-box { width: 120px; height: 120px; border: 1px dashed #cfd3da; border-radius: 10px; display: grid; place-items: center; color: #b4b9c2; font-size: 30px; cursor: pointer; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.badge { padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.done { background: #e6f6ec; color: #1f9254; }
.badge.failed { background: #fdeaea; color: #c0392b; }
.badge.queued, .badge.building, .badge.sending { background: #fff5e0; color: #b7791f; }

/* ---------- Progress + tabs ---------- */
.progress { display: inline-block; width: 120px; height: 8px; background: #edeff2; border-radius: 6px; overflow: hidden; vertical-align: middle; }
.progress > i { display: block; height: 100%; background: var(--brand); transition: width .4s; }
.pct { font-size: 12px; color: var(--muted); margin-left: 8px; }
.tabbar { border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { display: inline-block; padding: 8px 16px; border: 1px solid var(--line); border-bottom: none; border-radius: 8px 8px 0 0; background: #fff; font-weight: 600; font-size: 13px; }
.tab.active { color: var(--brand-d); border-top: 2px solid var(--brand); }
.nav-ico i { width: 16px; }
/* PWA Config sub-tabs — tidy pill nav */
.subtabbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.subtab { display: inline-block; padding: 8px 16px; border-radius: 999px; background: #f1f3f7; color: #475569; font-weight: 600; font-size: 13px; cursor: pointer; border: 1px solid transparent; transition: all .15s; }
.subtab:hover { background: #e7ebf3; }
.subtab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Responsive ---------- */
.overlay { display: none; }
@media (max-width: 820px) {
  .side { position: fixed; z-index: 40; transform: translateX(-100%); transition: transform .25s; height: 100vh; }
  .shell.open .side { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .shell.open .overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .hamb { display: block; }
  .content { padding: 16px; }
  .section-title { font-size: 16px; }
}
@media (max-width: 420px) {
  .content { padding: 12px; }
  .stat .cell .n { font-size: 20px; }
  .cards { gap: 12px; }
  .crumb { font-size: 13px; }
}


/* ---------- Customer contacts ---------- */
.customer-panel { padding: 20px; }
.customer-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.customer-toolbar input { height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 7px; background: #f7f8fa; color: var(--ink); min-width: 150px; }
.customer-toolbar input[type="search"] { flex: 1 1 190px; }
.customer-toolbar input[type="date"] { flex: 0 1 190px; }
.customer-toolbar .btn { height: 42px; }
.date-separator { color: var(--muted); }
.customer-actions { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 14px; }
.customer-table { min-width: 650px; border-collapse: separate; border-spacing: 0; }
.customer-table thead th { background: #202328; color: #fff; font-size: 14px; padding: 15px 12px; }
.customer-table thead th:first-child { border-radius: 9px 0 0 9px; }
.customer-table thead th:last-child { border-radius: 0 9px 9px 0; }
.customer-table td { padding: 14px 12px; border: 1px solid #e7eaf0; border-top: 0; color: #4b5563; }
.customer-table td + td { border-left: 0; }
.empty-cell { text-align: center !important; color: #9aa0aa !important; padding: 30px !important; }
.customer-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 4px 0; }
.muted { color: var(--muted); font-size: 13px; }
.pagination-controls { display: flex; align-items: center; gap: 12px; }
.pagination-controls select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.page-btn { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font-size: 20px; }
.page-btn:disabled { opacity: .35; cursor: not-allowed; }
@media (max-width: 600px) {
  .customer-toolbar { align-items: stretch; }
  .customer-toolbar input, .customer-toolbar input[type="date"] { flex: 1 1 100%; width: 100%; }
  .date-separator { display: none; }
  .customer-toolbar .btn { flex: 1; }
  .customer-pagination { align-items: flex-start; }
}

/* Platform-split download metric on Home */
.download-split{display:grid;grid-template-columns:1fr 1fr;gap:10px}.download-platform{background:#f6f7f9;border-radius:8px;padding:10px;min-width:0}.download-platform>b{display:block;font-size:13px;margin-bottom:8px}.download-numbers{display:flex;gap:12px}.download-numbers>span{font-size:19px;font-weight:700}.download-numbers small{display:block;font-size:11px;font-weight:400;color:var(--muted)}.chart-legend{display:flex;gap:18px;justify-content:center;margin:8px 0;color:var(--muted);font-size:12px}
@media(max-width:700px){.download-split{grid-template-columns:1fr}.download-numbers{justify-content:space-between}}

/* ---- Upload gambar (Push / Inbox) ---- */
.upload-box { margin-top: 8px; position: relative; flex-direction: column; gap: 2px; background: #fafbfc center/cover no-repeat; transition: border-color .15s, background-color .15s; }
.upload-box span { font-size: 30px; line-height: 1; }
.upload-box small { font-size: 12px; color: #9aa1ad; }
.upload-box:hover, .upload-box.drag { border-color: #f5b500; background-color: #fffaf0; }
.upload-box.has-image { border-style: solid; border-color: #e3e6eb; }
.upload-box.uploading { cursor: progress; }
.upload-clear { position: absolute; top: -9px; right: -9px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: #1f2430; color: #fff; font-size: 16px; line-height: 24px; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.upload-box .spin { width: 22px; height: 22px; border: 3px solid #e3e6eb; border-top-color: #f5b500; border-radius: 50%; animation: upspin .8s linear infinite; }
@keyframes upspin { to { transform: rotate(360deg); } }
.pr-thumb { display: block; margin-top: 6px; width: 96px; height: 54px; object-fit: cover; border-radius: 6px; border: 1px solid #e3e6eb; }

/* ---- Template Push: mod edit ---- */
.tpl-editbar { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 8px; background: #fff8e1; border: 1px solid #ffe08a; color: #7a5a00; font-size: 13px; }
.tpl-editbar-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tpl-row-editing td { background: #fffbea; }
.tpl-body { max-width: 360px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Scheduled push ---- */
.tpl-row-off td { opacity: .6; }
.badge { display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; }
.badge-on { background:#e6f7ed; color:#137a3e; }
.badge-off { background:#f1f1f1; color:#777; }
#p-weekdays label { margin-right:10px; white-space:nowrap; }
/* ---- PWA config ---- */
.pwa-stat { display:flex; gap:16px; flex-wrap:wrap; margin:8px 0 16px; }
.pwa-stat .cell { background:#fafbfc; border:1px solid #eef0f3; border-radius:10px; padding:10px 14px; min-width:120px; }
.pwa-stat .cell b { display:block; font-size:22px; }
.pwa-stat .cell span { font-size:12px; color:#8a8a8a; }
.pwa-link { word-break:break-all; background:#fafbfc; border:1px solid #eef0f3; border-radius:8px; padding:8px 10px; font-family:monospace; font-size:13px; }

/* ---- Integration Guide ---- */
.guide h2 { font-size:20px; margin:4px 0 6px; }
.guide h3 { font-size:15px; margin:20px 0 6px; color:#1f3a8a; }
.guide p { margin:4px 0; line-height:1.5; }
.guide .guide-list { margin:4px 0 4px 18px; line-height:1.6; }
.guide-code { background:#0f1726; color:#d6e2ff; border-radius:8px; padding:12px 14px; font-size:13px; overflow:auto; white-space:pre; margin:8px 0; }
.guide-note { margin-top:18px; background:#fff8e1; border:1px solid #ffe08a; color:#7a5a00; border-radius:8px; padding:10px 14px; font-size:13px; }

/* ---- Popup style selector ---- */
.style-cards { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:8px 0; }
.style-card { border:2px solid #e3e6eb; border-radius:12px; padding:10px; cursor:pointer; text-align:center; transition:border-color .15s, background .15s; }
.style-card:hover { border-color:#cdd3db; }
.style-card.sel { border-color:#f5b500; background:#fffaf0; }
.style-name { font-weight:600; font-size:14px; margin-top:8px; }
.style-sub { font-size:12px; color:#8a8a8a; }
.style-prev { display:flex; justify-content:center; }
.sp-phone { width:92px; height:150px; border-radius:12px; background:linear-gradient(145deg,#e8e8ed,#d1d1d6); position:relative; overflow:hidden; border:1px solid #d7d7dd; }
.sp-card { position:absolute; background:#fff; border-radius:10px; padding:8px; box-shadow:0 4px 12px rgba(0,0,0,.12); }
.sp-ic { width:16px; height:16px; border-radius:5px; background:#f5b500; margin:0 auto 5px; }
.sp-line { height:4px; border-radius:2px; background:#c9ccd2; margin:3px 0; }
.sp-line.short { width:60%; margin-left:auto; margin-right:auto; }
.sp-btns { display:flex; gap:4px; margin-top:6px; }
.sp-btns span { flex:1; height:8px; border-radius:3px; }
.sp-b1 { background:#1e40af; } .sp-b2 { background:#e5e7eb; }
/* style 1: centered card */
.style-prev-1 .sp-card { left:12px; right:12px; top:50%; transform:translateY(-50%); }
/* style 2: bottom drawer */
.style-prev-2 .sp-card { left:8px; right:8px; bottom:0; border-radius:12px 12px 0 0; }
.style-prev-2 .sp-btns span { border-radius:4px; }
/* style 3: material sheet, pill buttons */
.style-prev-3 .sp-card { left:8px; right:8px; bottom:0; border-radius:14px 14px 0 0; }
.style-prev-3 .sp-b1 { background:#6750a4; border-radius:999px; } .style-prev-3 .sp-b2 { background:#e7e0ec; border-radius:999px; }

/* ---- Guide code copy ---- */
.guide-codewrap { position:relative; }
.guide-copy { position:absolute; top:8px; right:8px; font-size:12px; padding:3px 10px; border:1px solid #3a4560; border-radius:6px; background:#1b2538; color:#d6e2ff; cursor:pointer; }
.guide-copy:hover { background:#24324c; }
.guide-code { white-space:pre; }

/* App Logo upload: square, show whole logo */
.upload-box.logo-box { background-size: contain; background-color: #fff; }

.report-day { font-size: 13px; font-weight: 500; color: #6b7280; margin-left: 10px; }
