/* ============================================================
   Bejox Panel — tema terang klasik ala panel SMM
   Primary: #2c7a7b (dark teal)
   ============================================================ */
:root {
  --primary: #2c7a7b;
  --primary-hover: #235f60;
  --bg: #f3f6f9;
  --card: #ffffff;
  --card-border: #e5eaf0;
  --heading: #1e293b;
  --text: #334155;
  --muted: #64748b;
  --shadow: 0 1px 3px rgba(15, 35, 45, 0.08);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  min-height: 100vh;
}
h1, h2, h3, h4 { color: var(--heading); line-height: 1.3; }
h1 { font-size: 1.5rem; margin-bottom: 4px; }
h2 { font-size: 1.15rem; margin-bottom: 12px; }
h3 { font-size: 1rem; margin-bottom: 10px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.section { padding: 22px 0 60px; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--card-border);
  position: sticky; top: 0; z-index: 100;
}
.topbar-in { display: flex; align-items: center; gap: 12px; height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.15rem; color: var(--heading); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem;
}
.topbar-title { font-weight: 700; color: var(--heading); font-size: 1.05rem; margin-left: 4px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.balance-badge {
  background: #e6f2f2; color: var(--primary); border: 1px solid #cde3e3;
  font-weight: 700; font-size: .85rem; padding: 6px 12px; border-radius: 999px;
  white-space: nowrap;
}
.user-chip { font-size: .88rem; color: var(--muted); white-space: nowrap; }
.user-chip b { color: var(--heading); }
.link-btn { background: none; border: none; color: var(--primary); font-size: .88rem; cursor: pointer; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Layout: sidebar + konten ---------- */
.layout { display: flex; gap: 20px; align-items: flex-start; }
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px; position: sticky; top: 78px;
}
.side-link {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: 10px;
  color: var(--text); font-weight: 600; font-size: .93rem;
}
.side-link:hover { background: #eef4f4; text-decoration: none; color: var(--primary); }
.side-link.on { background: var(--primary); color: #fff; }
.side-link .ico { font-size: 1.1rem; width: 22px; text-align: center; }
.content { flex: 1; min-width: 0; }

/* ---------- Bottom nav (mobile) ---------- */
#bottomNav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--card); border-top: 1px solid var(--card-border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
#bottomNav .bn-row { display: flex; }
#bottomNav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .68rem; color: var(--muted); padding: 4px 2px; font-weight: 600;
}
#bottomNav a:hover { text-decoration: none; }
#bottomNav a .ico { font-size: 1.25rem; }
#bottomNav a.active { color: var(--primary); }

/* ---------- Card ---------- */
.card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 16px;
}
.card h2 { margin-bottom: 6px; }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px;
}
.stat .s-label { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.stat .s-val { font-size: 1.35rem; font-weight: 800; color: var(--heading); }
.stat .s-ico { font-size: 1.4rem; margin-bottom: 6px; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
  text-align: left; padding: 11px 13px; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); background: #f8fafc;
  border-bottom: 1px solid var(--card-border); white-space: nowrap;
}
tbody td { padding: 11px 13px; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* ---------- Badge status ---------- */
.badge {
  display: inline-block; font-size: .75rem; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; border: 1px solid transparent;
  white-space: nowrap;
}
.b-baru { background: #e8f1fd; color: #1d6fd1; border-color: #c4dcf7; }
.b-diproses, .b-menunggu { background: #fdf3e3; color: #b45309; border-color: #f5dfae; }
.b-selesai, .b-disetujui, .b-aktif { background: #e6f6ec; color: #15803d; border-color: #bfe6cc; }
.b-gagal, .b-ditolak, .b-kedaluwarsa, .b-nonaktif { background: #fdecec; color: #b91c1c; border-color: #f6c9c9; }

/* ---------- Form ---------- */
label { display: block; margin: 12px 0 5px; font-size: .87rem; font-weight: 600; color: var(--heading); }
input, select, textarea {
  width: 100%; padding: 10px 13px; font-size: .94rem; font-family: inherit;
  border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(44, 122, 123, 0.15);
}
input::placeholder, textarea::placeholder { color: #94a3b8; }
textarea { resize: vertical; min-height: 70px; }
input[type="checkbox"] { width: auto; margin-right: 8px; }
.checkline { display: flex; align-items: center; margin-top: 12px; font-size: .9rem; }
.checkline input { width: auto; }

/* ---------- Button ---------- */
.btn {
  display: inline-block; border: none; cursor: pointer; font-family: inherit;
  background: var(--primary); color: #fff; font-weight: 700; font-size: .94rem;
  padding: 11px 22px; border-radius: 10px; text-align: center;
}
.btn:hover { background: var(--primary-hover); text-decoration: none; color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { display: block; width: 100%; }
.btn.small { padding: 7px 14px; font-size: .84rem; border-radius: 8px; }
.btn.ghost { background: #eef2f6; color: var(--heading); }
.btn.ghost:hover { background: #e2e8f0; color: var(--heading); }
.btn.warn { background: #b45309; }
.btn.warn:hover { background: #92400e; }
.btn.danger { background: #b91c1c; }
.btn.danger:hover { background: #991b1b; }
.btn.ok { background: #15803d; }
.btn.ok:hover { background: #166534; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 2px solid var(--card-border); }
.tab-btn {
  border: none; background: none; font-family: inherit; cursor: pointer;
  font-size: .95rem; font-weight: 700; color: var(--muted);
  padding: 10px 16px; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.on { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Chips & search ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chip {
  border: 1px solid #cbd5e1; background: #fff; color: var(--text);
  padding: 7px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.search-wrap { position: relative; margin-bottom: 4px; }
.search-wrap .s-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-wrap input { padding-left: 40px; }

/* ---------- Info / notice / error ---------- */
.info {
  background: #e8f4f4; border: 1px solid #c9e2e2; color: #1f5c5d;
  border-radius: 10px; padding: 12px 14px; font-size: .9rem; margin: 10px 0;
}
.notice {
  background: #fff8e6; border: 1px solid #f0dfae; color: #8a6d1b;
  border-radius: 10px; padding: 12px 14px; font-size: .9rem; margin: 12px 0;
}
.error-box {
  background: #fdecec; border: 1px solid #f6c9c9; color: #991b1b;
  border-radius: 10px; padding: 12px 14px; font-size: .9rem; margin: 10px 0;
}
.total-box {
  background: #f1f5f9; border: 1px dashed #cbd5e1; border-radius: 10px;
  padding: 12px 14px; font-size: 1rem; margin: 12px 0; color: var(--heading);
}
.total-box span { font-weight: 800; color: var(--primary); font-size: 1.15rem; }

/* ---------- Toast ---------- */
#toasts { position: fixed; top: 70px; right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: min(92vw, 360px); }
.toast {
  background: #fff; border: 1px solid var(--card-border); border-left: 4px solid var(--primary);
  border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.12);
  padding: 11px 14px; font-size: .88rem; color: var(--heading);
  display: flex; gap: 9px; align-items: flex-start;
}
.toast.success { border-left-color: #15803d; }
.toast.error { border-left-color: #b91c1c; }
.toast .t-ico { flex-shrink: 0; }

/* ---------- Modal window ---------- */
.modal-ov {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 35, 45, 0.5);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity 0.22s ease;
}
.modal-ov.show { opacity: 1; }
.modal {
  width: 100%; max-width: 520px; max-height: 92vh;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 48px rgba(15, 35, 45, 0.25);
  display: flex; flex-direction: column;
  transform: translateY(40px); transition: transform 0.25s ease;
  overflow: hidden;
}
.modal-ov.show .modal { transform: translateY(0); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px 12px; border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
}
.modal-head h3 { margin: 0; font-size: 1.05rem; }
.modal-x {
  border: none; background: #eef2f6; color: var(--heading);
  width: 34px; height: 34px; border-radius: 50%; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.modal-x:hover { background: #e2e8f0; }
.modal-body { padding: 14px 18px 22px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-body label { display: block; margin: 12px 0 5px; font-size: .87rem; font-weight: 600; color: var(--heading); }
.modal-body input, .modal-body select, .modal-body textarea { width: 100%; }
.m-prod {
  background: #f8fafc; border: 1px solid var(--card-border);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 4px; font-size: .92rem;
}
@media (min-width: 760px) {
  .modal-ov { align-items: center; padding: 20px; }
  .modal { border-radius: 18px; transform: scale(.96); }
  .modal-ov.show .modal { transform: scale(1); }
}

/* ---------- Empty / skeleton ---------- */
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .e-ico { font-size: 2.2rem; display: block; margin-bottom: 8px; }
.skel {
  background: linear-gradient(90deg, #e8edf2, #f4f7fa, #e8edf2);
  background-size: 200% 100%; animation: skel 1.2s infinite;
  border-radius: 12px; min-height: 90px;
}
@keyframes skel { to { background-position: -200% 0; } }

/* ---------- Login split screen ---------- */
.login-page { min-height: 100vh; display: flex; flex-direction: column; }
.login-nav { background: var(--card); border-bottom: 1px solid var(--card-border); }
.login-nav .topbar-in { height: 60px; }
.login-links { display: flex; gap: 20px; margin-left: 28px; font-weight: 600; font-size: .93rem; }
.login-links a { color: var(--text); }
.login-links a:hover { color: var(--primary); text-decoration: none; }
.login-main { flex: 1; display: flex; }
.login-left { flex: 0 0 55%; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 420px; }
.login-right {
  flex: 0 0 45%; background: var(--primary); color: #fff;
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px 44px;
}
.login-right h2 { color: #fff; font-size: 1.7rem; margin-bottom: 10px; }
.login-right p { color: #d7e9e9; margin-bottom: 26px; }
.lstat { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.lstat .n { font-size: 1.5rem; font-weight: 800; min-width: 110px; }
.lstat .d { font-size: .9rem; color: #d7e9e9; }
.login-foot { background: var(--card); border-top: 1px solid var(--card-border); padding: 16px; font-size: .85rem; color: var(--muted); }
.login-foot .wrap { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- QRIS box ---------- */
.qris-box {
  border: 2px dashed #cbd5e1; border-radius: var(--radius);
  padding: 20px; text-align: center; margin: 14px 0; background: #fbfdff;
}
.qris-box img { max-width: 230px; width: 100%; border-radius: 8px; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--card-border); padding: 24px 0; margin-top: 30px; font-size: .86rem; color: var(--muted); background: var(--card); }
footer .f-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- Mobile ---------- */
.m-cards { display: none; }
@media (max-width: 860px) {
  .sidebar { display: none; }
  #bottomNav { display: block; }
  .section { padding-bottom: 90px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .login-main { flex-direction: column; }
  .login-left { flex: none; padding: 28px 18px; }
  .login-right { flex: none; padding: 32px 24px; }
  .login-links { display: none; }
  .user-chip { display: none; }
  .table-wrap table { display: none; }
  .m-cards { display: block; }
  .m-card {
    background: var(--card); border: 1px solid var(--card-border);
    border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; font-size: .88rem;
  }
  .m-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid #f1f5f9; }
  .m-row:last-child { border-bottom: none; }
  .m-row > span:first-child { color: var(--muted); flex-shrink: 0; }
  .m-row > span:last-child { text-align: right; }
}
.spin {
  display: inline-block; width: 15px; height: 15px; margin-right: 7px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Service cards ala panel SMM (grup kategori + kartu) === */
.svc-group { margin: 0 0 26px; }
.svc-group-head { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; color: #1e293b; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid #e5eaf0; }
.plat-badge { width: 34px; height: 34px; border-radius: 10px; background: #e6f2f2; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.svc-card { background: #fff; border: 1px solid #e5eaf0; border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(15,40,40,.05); }
.svc-card:hover { border-color: #2c7a7b; box-shadow: 0 3px 10px rgba(44,122,123,.12); }
.svc-id { display: inline-block; font-size: 12px; font-weight: 700; color: #2c7a7b; background: #e6f2f2; border-radius: 6px; padding: 2px 8px; margin-bottom: 8px; }
.svc-name { font-size: 14px; font-weight: 600; color: #1e293b; line-height: 1.45; margin-bottom: 10px; }
.svc-meta { display: flex; gap: 24px; border-top: 1px dashed #e5eaf0; padding-top: 10px; }
.svc-meta > div { display: flex; flex-direction: column; gap: 2px; }
.svc-meta .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #94a3b8; font-weight: 600; }
.svc-meta .val { font-size: 14px; font-weight: 700; color: #1e293b; }
@media (max-width: 640px) { .svc-grid { grid-template-columns: 1fr; } }
