/* ==========================================================================
   JalaBill — lapisan desain di atas Bootstrap 5.3
   Padat (13px), responsif (sidebar ↔ drawer + bottom nav), mode terang/gelap.
   ========================================================================== */

:root,
[data-bs-theme="light"] {
    --jb-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-family: var(--jb-font);
    --bs-body-font-size: .8125rem;
    --bs-body-line-height: 1.45;
    --bs-body-bg: #f3f5f9;
    --bs-body-color: #1c2433;
    --bs-secondary-color: #667085;
    --bs-border-color: #e4e8ef;
    --bs-border-radius: .5rem;
    --bs-border-radius-lg: .75rem;
    --bs-link-color-rgb: 37, 99, 235;
    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;

    --jb-surface: #ffffff;
    --jb-surface-2: #f8fafc;
    --jb-hover: #f5f7fb;
    --jb-sidebar-bg: #0f1b2d;
    --jb-sidebar-text: #aebacb;
    --jb-sidebar-muted: #6b7a90;
    --jb-sidebar-active: rgba(255, 255, 255, .08);
    --jb-accent: #3b82f6;
    --jb-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    --jb-topbar-h: 52px;
    --jb-sidebar-w: 216px;
    --jb-bottomnav-h: 58px;
    --jb-footer-h: 26px;

    /* Grafik (dataviz reference palette, slot 1) */
    --jb-series-1: #2a78d6;
    --jb-grid: #e9edf3;
}

[data-bs-theme="dark"] {
    --bs-body-bg: #0b1220;
    --bs-body-color: #e3e8f0;
    --bs-secondary-color: #93a0b4;
    --bs-border-color: #1f2a3d;
    --jb-surface: #111a2b;
    --jb-surface-2: #0f1727;
    --jb-hover: #16213a;
    --jb-sidebar-bg: #0a1322;
    --jb-shadow: none;
    --jb-series-1: #3987e5;
    --jb-grid: #1c2638;
}

html { -webkit-text-size-adjust: 100%; }
body { font-feature-settings: "cv11", "ss01"; background: var(--bs-body-bg); }
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 { font-weight: 600; letter-spacing: -.01em; }
.font-monospace { font-size: .92em; }
.text-2xs { font-size: .6875rem; }
.text-xs { font-size: .75rem; }
.fw-medium { font-weight: 500 !important; }
a { text-decoration: none; }

/* ---------- Kontrol padat ---------- */
.btn { --bs-btn-font-size: .8125rem; --bs-btn-padding-y: .375rem; --bs-btn-padding-x: .75rem; --bs-btn-font-weight: 500; }
.btn-sm { --bs-btn-font-size: .75rem; --bs-btn-padding-y: .25rem; --bs-btn-padding-x: .5rem; }
.btn-primary { --bs-btn-bg: #2563eb; --bs-btn-border-color: #2563eb; --bs-btn-hover-bg: #1d4fd8; --bs-btn-hover-border-color: #1d4fd8; --bs-btn-active-bg: #1b46c0; --bs-btn-disabled-bg: #2563eb; --bs-btn-disabled-border-color: #2563eb; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; gap: .375rem; }
.form-control, .form-select, .input-group-text { font-size: .8125rem; padding: .375rem .625rem; }
.form-select { padding-right: 2rem; }
.form-control-sm, .form-select-sm { font-size: .75rem; }
.form-label { font-size: .75rem; font-weight: 500; color: var(--bs-secondary-color); margin-bottom: .25rem; }
.form-text { font-size: .6875rem; margin-top: .2rem; }
.invalid-feedback { font-size: .6875rem; }
.badge { font-weight: 500; font-size: .6875rem; padding: .3em .55em; }
.dropdown-menu { font-size: .8125rem; --bs-dropdown-item-padding-y: .375rem; }

/* ---------- Kerangka: sidebar + konten ---------- */
.jb-shell { display: flex; min-height: 100vh; }
.jb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.jb-sidebar {
    --bs-offcanvas-width: 264px;
    --bs-offcanvas-bg: var(--jb-sidebar-bg);
    --bs-offcanvas-color: var(--jb-sidebar-text);
    background: var(--jb-sidebar-bg);
    color: var(--jb-sidebar-text);
}
@media (min-width: 992px) {
    /* Bootstrap memaksa .offcanvas-lg transparan di layar besar; kembalikan warna sidebar. */
    /* Tinggi sidebar dikurangi bar bawah agar isinya tidak tertutup. */
    .jb-sidebar { position: sticky; top: 0; width: var(--jb-sidebar-w); height: calc(100vh - var(--jb-footer-h)); flex-shrink: 0; background-color: var(--jb-sidebar-bg) !important; }
    .jb-sidebar .offcanvas-body { overflow-y: auto; }
}
.jb-sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 0; height: 100%; }
/* Isi sidebar tidak boleh dimampatkan: kalau menunya lebih panjang dari layar,
   yang digulir adalah daftar kelompoknya, bukan jarak antar menu yang mengerut. */
.jb-sidebar .offcanvas-body > * { flex-shrink: 0; }
.jb-sidebar #jbNavGroups { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.jb-sidebar #jbNavGroups::-webkit-scrollbar { width: 6px; }
.jb-sidebar #jbNavGroups::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 99px; }
.jb-sidebar #jbNavGroups { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.jb-nav a { flex-shrink: 0; }
.jb-brand { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem .5rem; color: #fff; font-weight: 600; font-size: .95rem; }
.jb-brand-mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; font-size: 1rem; }
.jb-brand small { display: block; font-weight: 400; font-size: .6875rem; color: var(--jb-sidebar-muted); }
.jb-nav-section { padding: .65rem 1rem .2rem; font-size: .625rem; letter-spacing: .08em; text-transform: uppercase; color: var(--jb-sidebar-muted); }
.jb-nav { list-style: none; margin: 0; padding: 0 .5rem; }
.jb-nav a {
    display: flex; align-items: center; gap: .6rem; padding: .34rem .65rem; margin-bottom: 1px;
    color: var(--jb-sidebar-text); border-radius: .45rem; font-weight: 500; position: relative;
}
.jb-nav a i { font-size: 1rem; width: 1.1rem; text-align: center; opacity: .85; }
.jb-nav a:hover { background: var(--jb-sidebar-active); color: #fff; }
.jb-nav a.active { background: var(--jb-sidebar-active); color: #fff; }
.jb-nav a.active::before { content: ""; position: absolute; left: -.5rem; top: .3rem; bottom: .3rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--jb-accent); }
.jb-nav .jb-nav-count { margin-left: auto; font-size: .625rem; background: rgba(255, 255, 255, .1); color: #fff; padding: .1rem .4rem; border-radius: 99px; }
.jb-nav .jb-nav-count.danger { background: #dc2626; }
.jb-sidebar-footer { margin-top: auto; padding: .75rem; border-top: 1px solid rgba(255, 255, 255, .06); }
.jb-user { display: flex; align-items: center; gap: .6rem; padding: .4rem; border-radius: .45rem; color: var(--jb-sidebar-text); }
.jb-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #1e3a8a; color: #dbeafe; font-weight: 600; font-size: .75rem; flex-shrink: 0; }
.jb-user-name { color: #fff; font-weight: 500; line-height: 1.2; }
.jb-sidebar .btn-sidebar { --bs-btn-color: var(--jb-sidebar-text); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--jb-sidebar-active); --bs-btn-border-color: transparent; --bs-btn-hover-border-color: transparent; }

/* ---------- Topbar ---------- */
.jb-topbar {
    position: sticky; top: 0; z-index: 1020; height: var(--jb-topbar-h);
    display: flex; align-items: center; gap: .75rem; padding: 0 1.25rem;
    background: color-mix(in srgb, var(--bs-body-bg) 85%, transparent);
    backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--bs-border-color);
}
.jb-topbar-title { min-width: 0; flex: 1; }
.jb-topbar-title h1 { font-size: 1rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jb-topbar-title .jb-crumb { font-size: .6875rem; color: var(--bs-secondary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jb-topbar-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.jb-content { padding: 1rem 1.25rem calc(2rem + var(--jb-footer-h)); }

@media (max-width: 991.98px) {
    .jb-topbar { padding: 0 .75rem; }
    .jb-content { padding: .75rem .75rem calc(var(--jb-bottomnav-h) + var(--jb-footer-h) + 1.25rem + env(safe-area-inset-bottom)); }
    .jb-topbar-actions .btn-label { display: none; }
}

/* ---------- Bottom nav (HP) ---------- */
.jb-bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    height: calc(var(--jb-bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: var(--jb-surface); border-top: 1px solid var(--bs-border-color);
    box-shadow: 0 -4px 16px rgba(16, 24, 40, .06);
}
.jb-bottomnav a, .jb-bottomnav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    font-size: .625rem; font-weight: 500; color: var(--bs-secondary-color); background: none; border: 0; position: relative;
}
.jb-bottomnav i { font-size: 1.2rem; line-height: 1; }
.jb-bottomnav .active { color: var(--bs-primary); }
.jb-bottomnav .active::after { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--bs-primary); }
.jb-bottomnav .jb-dot { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: #dc2626; color: #fff; font-size: .5625rem; display: grid; place-items: center; }

/* ---------- Kartu, statistik, bagian ---------- */
.card { --bs-card-bg: var(--jb-surface); --bs-card-border-color: var(--bs-border-color); --bs-card-cap-bg: transparent; --bs-card-spacer-y: .875rem; --bs-card-spacer-x: 1rem; box-shadow: var(--jb-shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem 1rem; font-weight: 600; font-size: .8125rem; }
.card-header .card-sub { font-weight: 400; color: var(--bs-secondary-color); font-size: .75rem; }

.jb-stat { padding: .6rem .75rem; height: 100%; display: flex; flex-direction: row; gap: .6rem; align-items: flex-start; }
.jb-stat-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: .85rem; flex-shrink: 0; }
.jb-stat-label { font-size: .625rem; color: var(--bs-secondary-color); font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.jb-stat-value { font-size: 1rem; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; white-space: nowrap; }
.jb-stat-sub { font-size: .625rem; color: var(--bs-secondary-color); line-height: 1.3; }
a.jb-stat-link { color: inherit; display: block; height: 100%; }
a.jb-stat-link:hover .card { border-color: color-mix(in srgb, var(--bs-primary) 35%, var(--bs-border-color)); }
@media (max-width: 575.98px) { .jb-stat { padding: .5rem .6rem; gap: .5rem; } .jb-stat-icon { width: 24px; height: 24px; font-size: .75rem; } .jb-stat-value { font-size: .9rem; } }

.tone-blue { background: #e8f0fe; color: #2563eb; }
.tone-green { background: #e7f6ee; color: #16803c; }
.tone-amber { background: #fff4e0; color: #b45309; }
.tone-red { background: #fdecec; color: #c42b2b; }
.tone-slate { background: #eef1f5; color: #4b5565; }
.tone-violet { background: #efebfd; color: #5b3fd1; }
[data-bs-theme="dark"] .tone-blue { background: rgba(59, 130, 246, .15); color: #8ab4ff; }
[data-bs-theme="dark"] .tone-green { background: rgba(34, 197, 94, .14); color: #6ee7a0; }
[data-bs-theme="dark"] .tone-amber { background: rgba(245, 158, 11, .15); color: #fbbf57; }
[data-bs-theme="dark"] .tone-red { background: rgba(239, 68, 68, .15); color: #fca5a5; }
[data-bs-theme="dark"] .tone-slate { background: rgba(148, 163, 184, .12); color: #cbd5e1; }
[data-bs-theme="dark"] .tone-violet { background: rgba(139, 92, 246, .16); color: #c4b5fd; }

/* Badge status lembut */
.badge-soft { border: 1px solid transparent; }
.badge-soft.text-bg-success, .st-aktif, .st-lunas, .st-online { background: #e7f6ee !important; color: #16803c !important; }
.badge-soft.text-bg-warning, .st-isolir, .st-belum { background: #fff4e0 !important; color: #b45309 !important; }
.badge-soft.text-bg-danger, .st-menunggak { background: #fdecec !important; color: #c42b2b !important; }
.badge-soft.text-bg-secondary, .st-nonaktif, .st-offline { background: #eef1f5 !important; color: #4b5565 !important; }
.badge-soft.text-bg-info, .st-statis { background: #e8f0fe !important; color: #2563eb !important; }
[data-bs-theme="dark"] .st-aktif, [data-bs-theme="dark"] .st-lunas, [data-bs-theme="dark"] .st-online { background: rgba(34, 197, 94, .14) !important; color: #6ee7a0 !important; }
[data-bs-theme="dark"] .st-isolir, [data-bs-theme="dark"] .st-belum { background: rgba(245, 158, 11, .15) !important; color: #fbbf57 !important; }
[data-bs-theme="dark"] .st-menunggak { background: rgba(239, 68, 68, .15) !important; color: #fca5a5 !important; }
[data-bs-theme="dark"] .st-nonaktif, [data-bs-theme="dark"] .st-offline { background: rgba(148, 163, 184, .12) !important; color: #cbd5e1 !important; }
[data-bs-theme="dark"] .st-statis { background: rgba(59, 130, 246, .15) !important; color: #8ab4ff !important; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: .3rem; vertical-align: 1px; }
.dot-pulse { animation: jb-pulse 1.8s infinite; }
@keyframes jb-pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 128, 60, .5); } 70% { box-shadow: 0 0 0 6px rgba(22, 128, 60, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 128, 60, 0); } }

/* ---------- Tabel padat → kartu di HP ---------- */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--jb-hover); margin-bottom: 0; font-size: .8125rem; }
.table > :not(caption) > * > * { padding: .55rem .75rem; border-bottom-color: var(--bs-border-color); }
.table thead th { font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color); background: var(--jb-surface-2); white-space: nowrap; }
.table tbody tr:last-child > * { border-bottom: 0; }
tr[data-href] { cursor: pointer; }
.td-sub { font-size: .6875rem; color: var(--bs-secondary-color); }

@media (max-width: 767.98px) {
    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards tr { padding: .6rem .8rem; border-bottom: 1px solid var(--bs-border-color); }
    .table-cards tbody tr:last-child { border-bottom: 0; }
    .table-cards > :not(caption) > * > * { border: 0; padding: .1rem 0; }
    .table-cards td { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; text-align: right !important; }
    .table-cards td[data-label]::before { content: attr(data-label); color: var(--bs-secondary-color); font-size: .6875rem; font-family: var(--jb-font); font-weight: 400; text-align: left; flex-shrink: 0; }
    .table-cards td.td-main { display: flex; justify-content: space-between; align-items: flex-start; text-align: left !important; padding-bottom: .3rem; }
    .table-cards td.td-actions { justify-content: flex-end; padding-top: .45rem; }
    .table-cards td.td-actions:empty, .table-cards td.td-hide-sm { display: none; }
}

/* ---------- Tab / chip yang bisa digeser ---------- */
.jb-scroll-x { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.jb-scroll-x::-webkit-scrollbar { display: none; }
.jb-chip {
    flex-shrink: 0; scroll-snap-align: start; display: inline-flex; align-items: center; gap: .35rem;
    padding: .3rem .7rem; border-radius: 99px; border: 1px solid var(--bs-border-color); background: var(--jb-surface);
    color: var(--bs-body-color); font-size: .75rem; font-weight: 500; white-space: nowrap;
}
.jb-chip:hover { border-color: color-mix(in srgb, var(--bs-primary) 40%, var(--bs-border-color)); color: var(--bs-body-color); }
.jb-chip.active { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }
.jb-chip .jb-chip-count { font-size: .625rem; padding: 0 .35rem; border-radius: 99px; background: rgba(127, 127, 127, .15); }
.jb-chip.active .jb-chip-count { background: rgba(255, 255, 255, .25); }

.jb-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.jb-search { position: relative; flex: 1 1 220px; max-width: 340px; }
.jb-search i { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); font-size: .8rem; }
.jb-search .form-control { padding-left: 1.85rem; }
@media (max-width: 575.98px) { .jb-search { max-width: none; flex-basis: 100%; } }

/* ---------- Daftar definisi padat ---------- */
.jb-dl { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: .45rem .75rem; margin: 0; }
.jb-dl dt { font-weight: 400; color: var(--bs-secondary-color); font-size: .75rem; }
.jb-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Daftar ringkas (dashboard) ---------- */
.jb-list { list-style: none; margin: 0; padding: 0; }
.jb-list > li { display: flex; align-items: center; gap: .65rem; padding: .55rem 1rem; border-bottom: 1px solid var(--bs-border-color); }
.jb-list > li:last-child { border-bottom: 0; }
.jb-list .jb-list-main { flex: 1; min-width: 0; }
.jb-list .jb-list-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jb-empty { padding: 1.75rem 1rem; text-align: center; color: var(--bs-secondary-color); }
.jb-empty i { font-size: 1.6rem; display: block; margin-bottom: .35rem; opacity: .6; }

/* ---------- Grafik kolom ---------- */
.jb-chart { position: relative; height: 180px; margin: .25rem 0 0 2.6rem; }
.jb-chart-grid { position: absolute; inset: 0 0 20px 0; display: flex; flex-direction: column-reverse; justify-content: space-between; pointer-events: none; }
.jb-chart-grid > div { border-top: 1px solid var(--jb-grid); position: relative; }
.jb-chart-grid > div:first-child { border-top-color: color-mix(in srgb, var(--bs-secondary-color) 45%, transparent); }
.jb-chart-grid span { position: absolute; right: calc(100% + .45rem); top: -.5rem; font-size: .625rem; color: var(--bs-secondary-color); white-space: nowrap; }
.jb-chart-cols { position: absolute; inset: 0; display: flex; }
.jb-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; cursor: default; }
.jb-col-plot { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 0; }
.jb-col-bar { width: min(24px, 60%); background: var(--jb-series-1); border-radius: 4px 4px 0 0; min-height: 0; transition: opacity .15s; }
.jb-col-value { font-size: .625rem; color: var(--bs-body-color); font-weight: 600; margin-bottom: 2px; white-space: nowrap; }
.jb-col-label { height: 20px; line-height: 20px; font-size: .6875rem; color: var(--bs-secondary-color); }
.jb-col:hover .jb-col-bar { opacity: .8; }
.jb-col.is-current .jb-col-label { color: var(--bs-body-color); font-weight: 600; }

/* ---------- Skeleton ---------- */
.skeleton { display: inline-block; min-width: 3rem; height: .9em; border-radius: 4px; background: linear-gradient(90deg, var(--jb-grid) 25%, var(--jb-hover) 50%, var(--jb-grid) 75%); background-size: 200% 100%; animation: jb-shimmer 1.2s infinite; vertical-align: middle; }
@keyframes jb-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Toast & modal ---------- */
.jb-toasts { position: fixed; top: calc(var(--jb-topbar-h) + .5rem); right: 1rem; z-index: 1090; width: min(380px, calc(100vw - 1.5rem)); }
@media (max-width: 575.98px) { .jb-toasts { right: .75rem; left: .75rem; width: auto; } }
.toast { --bs-toast-font-size: .8125rem; --bs-toast-bg: var(--jb-surface); border: 1px solid var(--bs-border-color); box-shadow: 0 8px 24px rgba(16, 24, 40, .12); }
.toast .toast-icon { font-size: 1.05rem; }
.modal-content { border: 0; border-radius: .9rem; }
.modal { --bs-modal-bg: var(--jb-surface); }

/* ---------- Form bagian ---------- */
.jb-form-section { padding: .9rem 1rem; border-bottom: 1px solid var(--bs-border-color); }
.jb-form-section:last-of-type { border-bottom: 0; }
.jb-form-section-title { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color); margin-bottom: .65rem; display: flex; align-items: center; gap: .4rem; }
.jb-form-footer { position: sticky; bottom: 0; display: flex; gap: .5rem; padding: .75rem 1rem; background: var(--jb-surface); border-top: 1px solid var(--bs-border-color); border-radius: 0 0 var(--bs-border-radius-lg) var(--bs-border-radius-lg); z-index: 5; }
@media (max-width: 991.98px) { .jb-form-footer { bottom: calc(var(--jb-bottomnav-h) + env(safe-area-inset-bottom)); } }
.btn-check + .btn { font-size: .75rem; }

/* ---------- Halaman tamu ---------- */
.jb-guest { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; background: radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, .18), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(29, 78, 216, .14), transparent 60%), var(--bs-body-bg); }
.jb-guest-card { width: 100%; max-width: 380px; }

/* Utilitas kecil */
.min-w-0 { min-width: 0; }
.gap-2xs { gap: .25rem; }
.cursor-pointer { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.text-none { text-transform: none !important; letter-spacing: normal !important; }
.jb-form-section-title .btn { text-transform: none; letter-spacing: normal; }

/* Input berlatar permukaan kartu (bukan abu-abu halaman). */
.form-control, .form-select { background-color: var(--jb-surface); }
.form-control:disabled, .form-select:disabled { background-color: var(--jb-surface-2); }

/* Tombol "light" di mode gelap: redup, tidak putih mencolok. */
[data-bs-theme="dark"] .btn-light {
    --bs-btn-color: #e3e8f0; --bs-btn-bg: #1a2438; --bs-btn-border-color: #243049;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #223050; --bs-btn-hover-border-color: #2c3b5c;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #26365a; --bs-btn-active-border-color: #2c3b5c;
    --bs-btn-disabled-color: #7b879b; --bs-btn-disabled-bg: #1a2438; --bs-btn-disabled-border-color: #243049;
}

/* ---------- Blok perintah (halaman Panduan) ---------- */
.jb-cmd {
    background: var(--jb-surface-2); border: 1px solid var(--bs-border-color); border-radius: .5rem;
    padding: .6rem 2.4rem .6rem .75rem; font-size: .75rem; line-height: 1.5; white-space: pre-wrap;
    word-break: break-word; color: var(--bs-body-color); margin: 0;
}
.jb-cmd-copy { position: absolute; top: .35rem; right: .35rem; padding: .15rem .4rem; }
.jb-guide-nav { position: sticky; top: calc(var(--jb-topbar-h) + .5rem); }
@media (max-width: 991.98px) { .jb-guide-nav { position: static; margin-bottom: .75rem; } }

/* ---------- Bar identitas di dasar layar (tetap, tidak ikut tergulir) ---------- */
.jb-footer {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
    height: var(--jb-footer-h); display: flex; align-items: center; justify-content: center; gap: .4rem;
    background: var(--jb-sidebar-bg); color: rgba(255, 255, 255, .7);
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .625rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
    padding: 0 .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.jb-footer i { font-size: .75rem; opacity: .8; }
/* Di HP bar ini berada tepat di atas navigasi bawah. */
@media (max-width: 991.98px) {
    .jb-footer { bottom: calc(var(--jb-bottomnav-h) + env(safe-area-inset-bottom)); }
}
.jb-guest { padding-bottom: calc(1.25rem + var(--jb-footer-h)); }

/* Pilih banyak pelanggan (kirim ke router sekaligus) */
.td-check { width: 32px }
.jb-bulkbar { display: flex; position: sticky; top: .5rem; z-index: 3; box-shadow: var(--jb-shadow) }
.jb-bulkbar.d-none { display: none !important }

/* Tabel rapat (daftar pelanggan): baris lebih pendek tanpa mengubah tabel lain */
.jb-table-tight > :not(caption) > * > * { padding: .3rem .6rem; }
.jb-table-tight .td-sub { line-height: 1.2; }
.jb-table-tight .jb-avatar { width: 24px !important; height: 24px !important; font-size: .625rem !important; }
@media (max-width: 767.98px) {
    .jb-table-tight tr { padding: .45rem .7rem; }
    .jb-table-tight > :not(caption) > * > * { padding: .05rem 0; }
}

/* Tabel padat berhuruf kecil (daftar ONU di menu OLT) */
.jb-table-xs { font-size: .75rem; }
.jb-table-xs .badge { font-size: .6875rem; padding: .2em .5em; }
.jb-table-xs .td-sub { font-size: .625rem; }
.jb-table-xs .btn-sm { padding: .1rem .4rem; font-size: .75rem; }

/* Kepala kolom yang bisa diurutkan */
.jb-th-sort { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.jb-th-sort i { opacity: .35; font-size: .7rem; }
.jb-th-sort:hover { color: var(--bs-primary); }
.jb-th-sort:hover i, .jb-th-sort.active i { opacity: 1; }
.jb-th-sort.active { color: var(--bs-primary); }

/* Kelompok menu di sidebar yang bisa dibuka-tutup */
.jb-nav-group {
    display: flex; align-items: center; gap: .55rem; width: 100%;
    padding: .38rem .6rem; margin-top: .35rem;
    background: transparent; border: 0; border-radius: 8px;
    color: var(--jb-sidebar-muted); font-size: .6875rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em;
}
.jb-nav-group:hover { color: #fff; background: rgba(255,255,255,.06); }
.jb-nav-group.active { color: #fff; }
.jb-nav-group i:first-child { font-size: .85rem; }
.jb-nav-caret { margin-left: auto; font-size: .7rem; transition: transform .15s ease; }
.jb-nav-group[aria-expanded="true"] .jb-nav-caret { transform: rotate(180deg); }
.jb-nav-group + .jb-nav { margin-left: .35rem; padding-left: .35rem; border-left: 1px solid rgba(255,255,255,.08); }

/* Pratinjau logo usaha di halaman WhatsApp */
.jb-logo-preview {
    width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center;
    background: var(--jb-surface-2); border: 1px solid var(--bs-border-color); flex: 0 0 auto; overflow: hidden;
}
.jb-logo-preview img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }

/* ==========================================================================
   Portal pelanggan (tampilan aplikasi)
   ========================================================================== */

.portal-body {
    background:
        radial-gradient(1200px 380px at 50% -220px, rgba(37, 99, 235, .16), transparent 70%),
        var(--bs-body-bg);
    min-height: 100vh;
}

/* Logo usaha di kepala halaman & layar pembuka */
.jb-brand-logo {
    width: 40px; height: 40px; border-radius: 12px; overflow: hidden;
    display: grid; place-items: center; font-size: 1.15rem;
}
.jb-brand-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

/* Layar pembuka aplikasi */
.jb-splash {
    position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center;
    background: linear-gradient(160deg, #3b82f6, #1d4ed8 65%, #1e3a8a);
    color: #fff; transition: opacity .35s ease, transform .35s ease;
}
.jb-splash.selesai { opacity: 0; transform: scale(1.04); }
.jb-splash-inner { display: grid; justify-items: center; gap: .85rem; }
.jb-splash-logo {
    width: 104px; height: 104px; border-radius: 28px; display: grid; place-items: center;
    background: #fff; color: var(--bs-primary); font-size: 2.5rem; box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .6);
    animation: jb-pop .5s cubic-bezier(.2, .9, .3, 1.2) both;
}
.jb-splash-logo img { width: 78%; height: 78%; object-fit: contain; }
.jb-splash-name { font-weight: 600; letter-spacing: .01em; animation: jb-rise .45s .12s ease both; }
.jb-splash-bar { width: 96px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.jb-splash-bar span { display: block; height: 100%; width: 40%; border-radius: 3px; background: #fff; animation: jb-slide 1s ease-in-out infinite; }

@keyframes jb-pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
@keyframes jb-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes jb-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

/* Kartu portal muncul berurutan, bukan sekaligus */
.portal .card, .portal .jb-hero { animation: jb-rise .45s ease both; }
.portal .card:nth-of-type(2) { animation-delay: .06s; }
.portal .card:nth-of-type(3) { animation-delay: .12s; }
.portal .card:nth-of-type(4) { animation-delay: .18s; }

/* Kartu ringkasan tagihan */
.jb-hero {
    border-radius: 18px; padding: 1.1rem 1.15rem; color: #fff; position: relative; overflow: hidden;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    box-shadow: 0 12px 28px -18px rgba(29, 78, 216, .9);
}
.jb-hero::after {
    content: ""; position: absolute; width: 190px; height: 190px; right: -60px; top: -80px;
    background: rgba(255, 255, 255, .12); border-radius: 50%;
}
.jb-hero.lunas { background: linear-gradient(145deg, #10b981, #047857); box-shadow: 0 12px 28px -18px rgba(4, 120, 87, .9); }
.jb-hero.isolir { background: linear-gradient(145deg, #f97316, #b91c1c); box-shadow: 0 12px 28px -18px rgba(185, 28, 28, .9); }
.jb-hero-label { font-size: .75rem; opacity: .85; }
.jb-hero-amount { font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.jb-hero-meta { font-size: .78rem; opacity: .9; }

/* Titik status berdenyut untuk pelanggan terisolir */
.jb-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }
.jb-dot.denyut { animation: jb-denyut 1.6s ease-out infinite; }
@keyframes jb-denyut {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); }
    70% { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* Tombol terasa "ditekan" */
.portal .btn { transition: transform .12s ease, box-shadow .2s ease; }
.portal .btn:active { transform: scale(.97); }

/* Baris menu portal */
.jb-tile {
    display: flex; align-items: center; gap: .85rem; padding: .8rem .95rem; border-radius: 14px;
    background: var(--jb-surface); border: 1px solid var(--bs-border-color); text-decoration: none;
    color: inherit; transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.jb-tile:hover, .jb-tile:focus { transform: translateY(-1px); border-color: rgba(37, 99, 235, .45); box-shadow: 0 10px 22px -18px rgba(15, 23, 42, .8); }
.jb-tile-ikon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(37, 99, 235, .1); color: var(--bs-primary); font-size: 1.05rem; flex: 0 0 auto; }

@media (prefers-reduced-motion: reduce) {
    .portal .card, .portal .jb-hero, .jb-splash-logo, .jb-splash-name, .jb-dot.denyut { animation: none !important; }
    .portal .btn:active { transform: none; }
}

/* Permintaan izin notifikasi di portal */
.jb-notif-ikon {
    width: 62px; height: 62px; border-radius: 20px; display: inline-grid; place-items: center;
    background: rgba(37, 99, 235, .1); color: var(--bs-primary); font-size: 1.6rem;
    animation: jb-lonceng 2.4s ease-in-out infinite;
}
@keyframes jb-lonceng {
    0%, 60%, 100% { transform: rotate(0); }
    65% { transform: rotate(12deg); }
    72% { transform: rotate(-10deg); }
    79% { transform: rotate(6deg); }
    86% { transform: rotate(-4deg); }
}

/* Menu ikon di bawah layar portal */
.jb-bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: color-mix(in srgb, var(--jb-surface) 92%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--bs-border-color);
    padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
}
.jb-bottomnav a {
    display: grid; justify-items: center; gap: .15rem; padding: .35rem .25rem;
    font-size: .68rem; color: var(--bs-secondary-color); text-decoration: none;
    transition: color .2s ease;
}
.jb-bottomnav a.aktif { color: var(--bs-primary); font-weight: 600; }
.jb-bottomnav-ikon { position: relative; font-size: 1.2rem; line-height: 1; padding: .2rem .7rem; border-radius: 12px; transition: background .2s ease; }
.jb-bottomnav a.aktif .jb-bottomnav-ikon { background: rgba(37, 99, 235, .12); }
.jb-bottomnav-titik {
    position: absolute; top: -2px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 999px; background: var(--bs-danger); color: #fff; font-size: .6rem; font-weight: 600;
    display: grid; place-items: center;
}

/* ==========================================================================
   Halaman masuk portal (gaya aplikasi)
   ========================================================================== */

.portal-auth { background: linear-gradient(170deg, #3b82f6 0%, #1d4ed8 46%, #0f172a 100%); }
.portal-auth .portal { padding-bottom: 2rem; }

.jb-auth { display: grid; gap: 1.25rem; padding-top: 1.5rem; }
.jb-auth-head { text-align: center; color: #fff; animation: jb-rise .5s ease both; }
.jb-auth-logo {
    width: 84px; height: 84px; border-radius: 24px; display: inline-grid; place-items: center;
    background: #fff; color: var(--bs-primary); font-size: 2.1rem; margin-bottom: .85rem;
    box-shadow: 0 20px 45px -22px rgba(0, 0, 0, .75);
    animation: jb-pop .55s cubic-bezier(.2, .9, .3, 1.25) both;
}
.jb-auth-logo img { width: 74%; height: 74%; object-fit: contain; }
.jb-auth-title { font-size: 1.1rem; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.jb-auth-sub { font-size: .8rem; opacity: .82; margin: .25rem 0 0; }

.jb-auth-card {
    background: var(--jb-surface); border-radius: 22px; padding: 1.35rem 1.25rem 1.1rem;
    box-shadow: 0 26px 60px -30px rgba(2, 6, 23, .85);
    animation: jb-rise .5s .1s ease both;
}
.jb-auth-card-title { font-size: .98rem; font-weight: 600; margin: 0 0 1.1rem; }

.jb-auth-warn {
    display: flex; gap: .6rem; align-items: flex-start; font-size: .78rem; line-height: 1.5;
    background: rgba(245, 158, 11, .12); color: #92400e; border-radius: 14px; padding: .7rem .8rem; margin-bottom: 1rem;
}
.jb-auth-warn i { font-size: 1.05rem; }

/* Kotak isian dengan label mengambang */
.jb-field { position: relative; }
.jb-field-ikon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--bs-secondary-color); font-size: 1rem; pointer-events: none; transition: color .2s ease;
}
.jb-input {
    width: 100%; height: 58px; padding: 1.35rem 2.9rem .45rem 2.75rem;
    border: 1.5px solid var(--bs-border-color); border-radius: 14px; background: var(--jb-surface-2);
    font-size: .95rem; color: inherit; transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.jb-input:focus { outline: 0; border-color: var(--bs-primary); background: var(--jb-surface); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.jb-field label {
    position: absolute; left: 2.75rem; top: 50%; transform: translateY(-50%);
    color: var(--bs-secondary-color); font-size: .9rem; pointer-events: none;
    transition: transform .16s ease, font-size .16s ease, color .16s ease;
}
.jb-input:focus + label,
.jb-input:not(:placeholder-shown) + label {
    transform: translateY(-165%); font-size: .7rem; color: var(--bs-primary); font-weight: 500;
}
.jb-field:focus-within .jb-field-ikon { color: var(--bs-primary); }
.jb-field.salah .jb-input { border-color: var(--bs-danger); }
.jb-field-pesan { color: var(--bs-danger); font-size: .75rem; margin-top: .35rem; }
.jb-field-mata {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: 0; color: var(--bs-secondary-color); padding: .5rem .7rem; font-size: 1rem;
}

.jb-auth-btn {
    width: 100%; height: 52px; border: 0; border-radius: 14px; color: #fff; font-weight: 600; font-size: .95rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 16px 30px -18px rgba(29, 78, 216, 1);
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    transition: transform .12s ease, box-shadow .2s ease;
}
.jb-auth-btn:active { transform: scale(.98); }
.jb-auth-bantuan { font-size: .74rem; color: var(--bs-secondary-color); text-align: center; margin: 1rem 0 0; line-height: 1.6; }

.jb-auth-wa {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    color: #fff; text-decoration: none; font-size: .8rem; opacity: .9; padding: .5rem;
}
.jb-auth-wa:hover { color: #fff; opacity: 1; }

/* Halaman masuk tidak memakai kepala halaman portal biasa */
.portal-auth .portal-head { display: none; }

/* Pengumuman di Beranda portal */
.jb-pengumuman { display: grid; gap: .5rem; }
.jb-umum {
    background: var(--jb-surface); border: 1px solid var(--bs-border-color); border-left: 3px solid var(--bs-primary);
    border-radius: 14px; overflow: hidden; animation: jb-rise .4s ease both;
}
.jb-umum.tone-amber { border-left-color: #f59e0b; }
.jb-umum.tone-green { border-left-color: #10b981; }
.jb-umum.tone-slate { border-left-color: #64748b; }
.jb-umum > summary { display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem; cursor: pointer; list-style: none; }
.jb-umum > summary::-webkit-details-marker { display: none; }
.jb-umum-ikon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(37, 99, 235, .1); color: var(--bs-primary); flex: 0 0 auto; }
.jb-umum.tone-amber .jb-umum-ikon { background: rgba(245, 158, 11, .12); color: #d97706; }
.jb-umum.tone-green .jb-umum-ikon { background: rgba(16, 185, 129, .12); color: #059669; }
.jb-umum.tone-slate .jb-umum-ikon { background: rgba(100, 116, 139, .12); color: #475569; }
.jb-umum-judul { display: block; font-weight: 500; font-size: .88rem; line-height: 1.3; }
.jb-umum-waktu { display: block; font-size: .7rem; color: var(--bs-secondary-color); }
.jb-umum-baru { background: var(--bs-danger); color: #fff; font-size: .58rem; font-weight: 600; border-radius: 999px; padding: .05rem .4rem; margin-left: .35rem; vertical-align: middle; }
.jb-umum-panah { margin-left: auto; color: var(--bs-secondary-color); font-size: .8rem; transition: transform .2s ease; }
.jb-umum[open] .jb-umum-panah { transform: rotate(180deg); }
.jb-umum-isi { padding: 0 .85rem .8rem 4.15rem; font-size: .82rem; line-height: 1.6; color: var(--bs-body-color); white-space: pre-line; }

/* Penilaian bintang di portal (urutan terbalik supaya hover mengisi ke kiri) */
.jb-bintang { display: inline-flex; flex-direction: row-reverse; gap: .15rem; font-size: 1.35rem; }
.jb-bintang input { position: absolute; opacity: 0; width: 0; height: 0; }
.jb-bintang label { color: var(--bs-border-color); cursor: pointer; transition: color .15s ease, transform .15s ease; }
.jb-bintang label:hover, .jb-bintang label:hover ~ label,
.jb-bintang input:checked ~ label { color: #f59e0b; }
.jb-bintang label:hover { transform: scale(1.12); }
.jb-bintang input:focus-visible + label { outline: 2px solid var(--bs-primary); border-radius: 4px; }

/* Penyesuaian mode gelap untuk portal */
[data-bs-theme="dark"] .portal-body {
    background:
        radial-gradient(1200px 380px at 50% -220px, rgba(37, 99, 235, .22), transparent 70%),
        var(--bs-body-bg);
}
[data-bs-theme="dark"] .portal-auth { background: linear-gradient(170deg, #1e3a8a 0%, #172554 50%, #020617 100%); }
[data-bs-theme="dark"] .jb-auth-logo { background: var(--jb-surface); color: #93c5fd; }
[data-bs-theme="dark"] .jb-auth-warn { background: rgba(245, 158, 11, .14); color: #fcd34d; }
[data-bs-theme="dark"] .jb-splash-logo { background: var(--jb-surface); color: #93c5fd; }
[data-bs-theme="dark"] .jb-bottomnav { background: color-mix(in srgb, var(--jb-surface) 88%, transparent); }
[data-bs-theme="dark"] .jb-tile-ikon { background: rgba(59, 130, 246, .16); color: #8ab4ff; }
[data-bs-theme="dark"] .jb-notif-ikon { background: rgba(59, 130, 246, .16); color: #8ab4ff; }
[data-bs-theme="dark"] .jb-input { background: var(--jb-surface-2); }

/* Jarak antar kartu di portal dirapatkan agar muat lebih banyak di satu layar */
.portal .card + .card, .portal .jb-tile + .jb-tile { margin-top: .5rem; }
.portal .card-body { padding: .8rem .9rem; }
.portal .card-header { padding: .6rem .9rem; }
.portal .jb-tile { padding: .7rem .85rem; }
.portal .jb-dl { row-gap: .35rem; }
.portal-head { margin-bottom: .75rem !important; }

/* Logo besar di halaman Tentang */
.jb-tentang-logo {
    width: 72px; height: 72px; border-radius: 20px; display: inline-grid; place-items: center;
    background: var(--jb-surface-2); font-size: 1.9rem; color: var(--bs-primary); overflow: hidden;
}
.jb-tentang-logo img { width: 78%; height: 78%; object-fit: contain; }

/* Aksi cepat di Beranda portal */
.jb-aksi { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.jb-aksi-item {
    display: grid; justify-items: center; gap: .35rem; padding: .7rem .25rem; text-decoration: none;
    background: var(--jb-surface); border: 1px solid var(--bs-border-color); border-radius: 14px;
    color: inherit; font-size: .7rem; text-align: center;
    transition: transform .15s ease, border-color .2s ease;
}
.jb-aksi-item:hover, .jb-aksi-item:active { transform: translateY(-1px); border-color: rgba(37, 99, 235, .45); color: inherit; }
.jb-aksi-item .jb-stat-icon { width: 34px; height: 34px; font-size: 1rem; }

/* Tips singkat */
.jb-tips details { border-top: 1px solid var(--bs-border-color); }
.jb-tips details:first-child { border-top: 0; }
.jb-tips summary {
    padding: .6rem .9rem; font-size: .82rem; font-weight: 500; cursor: pointer; list-style: none;
    display: flex; align-items: center; justify-content: space-between;
}
.jb-tips summary::-webkit-details-marker { display: none; }
.jb-tips summary::after { content: "\f282"; font-family: bootstrap-icons; font-size: .75rem; color: var(--bs-secondary-color); transition: transform .2s ease; }
.jb-tips details[open] summary::after { transform: rotate(180deg); }
.jb-tips details > div { padding: 0 .9rem .75rem; font-size: .78rem; line-height: 1.7; color: var(--bs-secondary-color); white-space: pre-line; }

/* ==========================================================================
   Halaman masuk operator: dua panel (ilustrasi + form)
   ========================================================================== */

.jb-auth-body { margin: 0; }

.jb-split { display: grid; grid-template-columns: 1fr; min-height: 100vh; }

.jb-split-art {
    display: none;
    position: relative;
    background: linear-gradient(140deg, #5b7cf7 0%, #3b5fe6 45%, #2b4fc7 100%);
    color: #fff;
    overflow: hidden;
}
.jb-split-art::before,
.jb-split-art::after {
    content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .08);
}
.jb-split-art::before { width: 460px; height: 460px; top: -150px; left: -140px; }
.jb-split-art::after { width: 300px; height: 300px; bottom: -110px; right: -80px; }
.jb-split-art-isi { position: relative; padding: 3rem 3rem 2rem; display: grid; align-content: center; gap: .5rem; height: 100%; }
.jb-split-art-isi h1 { font-size: 1.6rem; font-weight: 700; margin: .75rem 0 0; letter-spacing: -.02em; }
.jb-split-art-isi p { font-size: .9rem; opacity: .85; margin: 0; max-width: 34ch; line-height: 1.6; }
.jb-split-art .jb-brand-mark { background: rgba(255, 255, 255, .16); color: #fff; }
.jb-split-gambar { width: 100%; max-width: 480px; margin: 1.5rem auto 0; display: block; }

.jb-split-form { display: grid; place-items: center; padding: 2rem 1.25rem; background: var(--jb-surface); }
.jb-split-form-isi { width: 100%; max-width: 380px; }
.jb-split-mark { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.75rem; }
.jb-split-judul { font-size: 1.5rem; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.jb-split-sub { font-size: .85rem; color: var(--bs-secondary-color); margin: .35rem 0 0; }

/* Isian bergaya garis bawah */
.jb-garis { position: relative; }
.jb-garis label {
    display: block; font-size: .68rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
    color: var(--bs-secondary-color); margin-bottom: .35rem;
}
.jb-garis input {
    width: 100%; border: 0; border-bottom: 2px solid var(--bs-border-color); background: transparent;
    padding: .5rem 2rem .55rem 0; font-size: 1rem; color: inherit; transition: border-color .2s ease;
}
.jb-garis input:focus { outline: 0; border-bottom-color: var(--bs-primary); }
.jb-garis input::placeholder { color: var(--bs-secondary-color); opacity: .45; }
.jb-garis.salah input { border-bottom-color: var(--bs-danger); }
.jb-garis-mata {
    position: absolute; right: 0; bottom: .3rem; background: none; border: 0; padding: .25rem .35rem;
    color: var(--bs-secondary-color);
}

/* Tombol pil bergradasi */
.jb-pil {
    width: 100%; height: 50px; border: 0; border-radius: 999px; color: #fff; font-weight: 600; font-size: .95rem;
    background: linear-gradient(135deg, #5b7cf7, #2b4fc7);
    box-shadow: 0 14px 28px -14px rgba(43, 79, 199, .9);
    transition: transform .12s ease, box-shadow .2s ease;
}
.jb-pil:active { transform: scale(.985); }
.jb-pil:disabled { opacity: .7; }

@media (min-width: 992px) {
    .jb-split { grid-template-columns: 1.05fr .95fr; }
    .jb-split-art { display: block; }
    /* Tepi miring seperti contoh: panel form "menusuk" ke panel ilustrasi. */
    .jb-split-form {
        clip-path: polygon(14% 0, 100% 0, 100% 100%, 14% 100%, 0 50%);
        margin-left: -7%;
        padding-left: 12%;
        z-index: 1;
    }
}

[data-bs-theme="dark"] .jb-split-art { background: linear-gradient(140deg, #2b4fc7 0%, #1e3a8a 50%, #0f172a 100%); }

/* Logo usaha di panel kiri halaman masuk: latar putih agar logo gelap tetap terbaca */
.jb-split-art .jb-brand-logo { background: #fff; }
.jb-split-art .jb-brand-logo img { padding: 5px; }

/* Pengaman lebar: isi halaman tidak boleh mendesak lebar sidebar.
   (Tabel/teks panjang pernah membuat sidebar terlihat mengerut.) */
.jb-sidebar { flex-shrink: 0; }
.jb-main { min-width: 0; max-width: 100%; }
.jb-main > * { min-width: 0; }
.jb-main table { max-width: 100%; }
.jb-main td, .jb-main th { overflow-wrap: anywhere; }

/* Tinggi baris menu dikunci.
   Sebelumnya tinggi baris ikut metrik ikon (kotak ikon bisa 16px atau 23px
   tergantung ikonnya), sehingga jarak menu tampak berbeda antar halaman. */
.jb-nav a { min-height: 34px; align-items: center; }
.jb-nav-group { min-height: 32px; }
.jb-nav a > i, .jb-nav-group > i {
    display: inline-flex; align-items: center; justify-content: center;
    height: 20px; line-height: 1; flex: 0 0 auto;
}

/* ==========================================================================
   Halaman masuk portal pelanggan — kartu dua panel (web) / bertumpuk (HP)
   ========================================================================== */

.portal-auth {
    background: linear-gradient(160deg, #eef2ff 0%, #f6f1fb 45%, #fdf2f6 100%);
    /* Halaman masuk sengaja tidak bisa digulir agar terasa seperti aplikasi. */
    height: 100dvh; overflow: hidden; overscroll-behavior: none;
}
.portal-auth .portal {
    max-width: 1020px; padding: .85rem; display: grid; place-items: center;
    height: 100dvh; overflow: hidden;
}
.portal-auth .portal-head { display: none; }
/* Baris identitas usaha di dasar halaman tidak dipakai di halaman masuk. */
.portal-auth .portal > .text-center { display: none; }

.jb-pa { width: 100%; }
.jb-pa-kartu {
    display: grid; grid-template-columns: 1fr; overflow: hidden;
    background: var(--jb-surface); border-radius: 26px;
    box-shadow: 0 32px 70px -34px rgba(49, 46, 129, .55);
    animation: jb-rise .5s ease both;
}

/* ---------- Panel ilustrasi ---------- */
.jb-pa-art { position: relative; min-height: 34vh; max-height: 330px; overflow: hidden; }
/* Latar ungu: penuh di HP, lingkaran besar di layar lebar (seperti contoh). */
.jb-pa-art-isi { background: linear-gradient(150deg, #6366f1 0%, #4f46e5 45%, #3730a3 100%); }
.jb-pa-art::before, .jb-pa-art::after {
    content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .08);
}
.jb-pa-art::before { width: 260px; height: 260px; top: -90px; right: -70px; }
.jb-pa-art::after { width: 180px; height: 180px; bottom: -70px; left: -50px; }
.jb-pa-art-isi { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
/* Logo dan teks satu kelompok yang mengalir, supaya tidak saling menimpa. */
.jb-pa-inti { display: grid; justify-items: center; gap: .7rem; text-align: center; padding: 0 1.25rem; z-index: 1; }

.jb-pa-logo {
    width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center;
    background: #fff; color: #4f46e5; font-size: 2.1rem; overflow: hidden;
    box-shadow: 0 18px 38px -16px rgba(15, 23, 42, .7);
    animation: jb-pop .55s cubic-bezier(.2, .9, .3, 1.25) both;
}
.jb-pa-logo img { width: 76%; height: 76%; object-fit: contain; }

/* Lingkaran ikon mengambang */
.jb-pa-bulat {
    position: absolute; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
    background: rgba(255, 255, 255, .16); color: #fff; font-size: 1.05rem;
    border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(4px);
    animation: jb-apung 5s ease-in-out infinite;
}
.jb-pa-bulat.pos-a { top: 10%; left: 8%; animation-delay: 0s; }
.jb-pa-bulat.pos-b { top: 10%; right: 8%; animation-delay: .7s; }
.jb-pa-bulat.pos-c { bottom: 10%; left: 8%; animation-delay: 1.4s; }
.jb-pa-bulat.pos-d { bottom: 10%; right: 8%; animation-delay: 2.1s; }
.jb-pa-bulat.pos-e { top: 46%; right: 2%; animation-delay: 2.8s; }
@media (max-width: 767.98px) {
    .jb-pa-bulat { width: 40px; height: 40px; font-size: .95rem; }
    .jb-pa-bulat.pos-e { display: none; }
}
@keyframes jb-apung {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
}

.jb-pa-art-teks { color: #fff; max-width: 30ch; }
.jb-pa-art-judul { font-weight: 600; font-size: .9rem; line-height: 1.35; }
.jb-pa-art-sub { font-size: .72rem; opacity: .82; margin-top: .2rem; line-height: 1.45; }

/* ---------- Panel form ---------- */
.jb-pa-form { padding: 1.35rem 1.25rem 1.5rem; overflow-y: auto; }
.jb-pa-judul { font-size: 1.15rem; font-weight: 700; text-align: center; margin: 0 0 1.25rem; letter-spacing: -.01em; }

.jb-pa-label { display: block; font-size: .78rem; font-weight: 600; margin-bottom: .3rem; }
.jb-pa-label-baris { display: flex; align-items: baseline; justify-content: space-between; margin-top: 1rem; }
.jb-pa-label-baris .jb-pa-label { margin-bottom: .3rem; }
.jb-pa-lupa { font-size: .74rem; color: var(--bs-primary); text-decoration: none; }

.jb-pa-input {
    width: 100%; border: 1.5px solid transparent; border-radius: 12px; background: var(--jb-surface-2);
    padding: .7rem .85rem; font-size: .92rem; color: inherit;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.jb-pa-input:focus { outline: 0; border-color: #6366f1; background: var(--jb-surface); box-shadow: 0 0 0 4px rgba(99, 102, 241, .14); }
.jb-pa-input::placeholder { color: var(--bs-secondary-color); opacity: .55; }
.jb-pa-input.salah { border-color: var(--bs-danger); }

.jb-pa-kotak-sandi { position: relative; }
.jb-pa-kotak-sandi .jb-pa-input { padding-right: 2.6rem; }
.jb-pa-mata {
    position: absolute; right: .3rem; top: 50%; transform: translateY(-50%);
    background: none; border: 0; padding: .4rem .55rem; color: var(--bs-secondary-color);
}

.jb-pa-tombol {
    width: 100%; height: 48px; margin-top: 1.35rem; border: 0; border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff; font-weight: 600; font-size: .92rem;
    letter-spacing: .02em; box-shadow: 0 14px 26px -14px rgba(67, 56, 202, .95);
    transition: transform .12s ease;
}
.jb-pa-tombol:active { transform: scale(.985); }

.jb-pa-bantuan { font-size: .74rem; color: var(--bs-secondary-color); text-align: center; margin: 1.1rem 0 0; line-height: 1.6; }

.jb-pa-pesan {
    display: flex; gap: .5rem; align-items: center; font-size: .78rem; line-height: 1.45;
    border-radius: 12px; padding: .55rem .7rem; margin-bottom: .9rem;
}
.jb-pa-pesan.sukses { background: rgba(16, 185, 129, .12); color: #047857; }
.jb-pa-pesan.gagal { background: rgba(220, 53, 69, .1); color: #b91c1c; }
[data-bs-theme="dark"] .jb-pa-pesan.sukses { color: #6ee7a0; }
[data-bs-theme="dark"] .jb-pa-pesan.gagal { color: #fca5a5; }

.jb-pa-warn {
    display: flex; gap: .6rem; align-items: flex-start; font-size: .78rem; line-height: 1.5;
    background: rgba(245, 158, 11, .12); color: #92400e; border-radius: 14px; padding: .7rem .8rem; margin-bottom: 1.1rem;
}
.jb-pa-warn i { font-size: 1.05rem; }

/* ---------- Layar lebar: dua kolom, tepi ilustrasi melengkung ---------- */
@media (min-width: 768px) {
    .jb-pa-kartu { grid-template-columns: 1fr 1fr; min-height: 520px; }
    .jb-pa-art { order: 2; min-height: auto; background: var(--jb-surface); }
    /* Panel ungu memenuhi tinggi kartu; tepi kirinya melengkung seperti sisi lingkaran. */
    .jb-pa-art { min-height: 100%; max-height: none; }
    .jb-pa-art-isi { inset: 0; border-radius: 46% 0 0 46% / 50% 0 0 50%; }
    .jb-pa-inti { gap: 1rem; padding: 0 14% 0 20%; }
    .jb-pa-bulat.pos-a { top: 13%; left: 26%; }
    .jb-pa-bulat.pos-b { top: 11%; right: 12%; }
    .jb-pa-bulat.pos-c { bottom: 16%; left: 24%; }
    .jb-pa-bulat.pos-d { bottom: 14%; right: 12%; }
    .jb-pa-bulat.pos-e { top: 50%; right: 4%; margin-top: -27px; }
    .jb-pa-form { order: 1; padding: 3rem 2.75rem; align-self: center; }
    .jb-pa-judul { text-align: left; font-size: 1.3rem; }
    .jb-pa-logo { width: 104px; height: 104px; border-radius: 30px; font-size: 2.6rem; }
    .jb-pa-bulat { width: 54px; height: 54px; font-size: 1.25rem; }
    .jb-pa-art-teks { bottom: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
    .jb-pa-bulat, .jb-pa-logo, .jb-pa-kartu { animation: none !important; }
}

[data-bs-theme="dark"] .portal-auth { background: linear-gradient(160deg, #0f172a 0%, #111827 50%, #0b1220 100%); }
[data-bs-theme="dark"] .jb-pa-warn { background: rgba(245, 158, 11, .14); color: #fcd34d; }

/* Aplikasi lapangan teknisi */
.teknisi-body {
    background:
        radial-gradient(1200px 380px at 50% -220px, rgba(13, 148, 136, .14), transparent 70%),
        var(--bs-body-bg);
}
.jb-tek-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.teknisi-body .jb-bottomnav a.aktif { color: #0d9488; }
.teknisi-body .jb-bottomnav a.aktif .jb-bottomnav-ikon { background: rgba(13, 148, 136, .14); }
.teknisi-body .jb-tile-ikon { background: rgba(13, 148, 136, .12); color: #0f766e; }

/* Tabulasi di aplikasi teknisi */
.jb-tab { background: var(--jb-surface-2); border-radius: 12px; padding: .25rem; gap: .25rem; }
.jb-tab .nav-link {
    border-radius: 9px; font-size: .82rem; font-weight: 500; color: var(--bs-secondary-color);
    padding: .45rem .6rem;
}
.jb-tab .nav-link.active { background: var(--jb-surface); color: #0f766e; box-shadow: 0 2px 6px -3px rgba(15, 23, 42, .5); }
