/* ==========================================================================
   SMART TOKEN - Web Theme (mengikuti desain aplikasi Flutter / lib_android)
   Palet, gradient, kartu, tombol, input, dialog, drawer mengikuti theme.dart
   ========================================================================== */

:root {
  --bg: #F3F6FA;
  --surface: #FFFFFF;
  --text: #1B2733;
  --text2: #6B7785;
  --border: #E1E7EE;
  --grey: #C2C2C2;
  --primary: #017AB1;
  --primary-dark: #015A85;
  --primary-light: #E5F2F9;
  --accent: #015A85;
  --success: #029109;
  --danger: #A30000;
  --success-soft: #E6F6E8;
  --danger-soft: #FCEAEA;
  --warning-soft: #FFF6D1;
  --warning-dark: #8A6D00;
  --warning: #F5DF17;
  --grad: linear-gradient(135deg, #015A85 0%, #017AB1 55%, #2FA3D6 100%);
  --shadow-card: 0 5px 14px rgba(27, 39, 51, .063);
  --shadow-pop: 0 12px 30px rgba(0, 0, 0, .2);
  --input-bg: #FFFFFF;
  --ring: rgba(255, 255, 255, .10);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0F151C;
  --surface: #18212B;
  --text: #E8EEF4;
  --text2: #9AA7B5;
  --border: #2A3643;
  --grey: #56636F;
  --primary: #2B9ED8;
  --primary-dark: #0B3047;
  --primary-light: #15364A;
  --accent: #6CC3EE;
  --success: #3FB950;
  --danger: #E5484D;
  --success-soft: #12301C;
  --danger-soft: #3A1618;
  --warning-soft: #3A3010;
  --warning-dark: #E8C547;
  --grad: linear-gradient(135deg, #0B3047 0%, #145A7E 55%, #1F7FAE 100%);
  --shadow-card: none;
  --shadow-pop: 0 12px 30px rgba(0, 0, 0, .5);
  --input-bg: #0F151C;
  color-scheme: dark;
}

/* ---------- Dasar ---------- */
html, body {
  background: var(--bg) !important;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { font-size: 14px; }
a { color: var(--primary); }
a:hover { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4, h5, h6, label, .control-label { color: var(--text); }
.text-muted { color: var(--text2) !important; }
hr { border-color: var(--border); }

#app, .main-wrapper { background: transparent; }
.navbar-bg { display: none !important; }

/* ---------- Appbar (gradient + judul + nama user) ---------- */
.st-appbar {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 500px; height: 56px; z-index: 30;
  display: flex; align-items: center; gap: 4px; padding: 0 6px;
  background: var(--grad); color: #fff;
  box-shadow: 0 2px 10px rgba(1, 90, 133, .25);
}
.st-appbar .st-title { flex: 1; min-width: 0; padding-left: 4px; line-height: 1.2; }
.st-appbar .st-title b {
  display: block; font-size: 17px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.st-appbar .st-title small {
  display: block; font-size: 11px; color: rgba(255, 255, 255, .8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.st-iconbtn {
  width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: transparent; color: #fff; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; outline: none !important; transition: background .15s;
}
.st-iconbtn:hover, .st-iconbtn:active { background: rgba(255, 255, 255, .16); color: #fff; }

.st-popmenu {
  position: absolute; right: 8px; top: 50px; min-width: 190px; z-index: 40;
  background: var(--surface); border-radius: 14px; padding: 6px;
  box-shadow: var(--shadow-pop); border: 1px solid var(--border);
  display: none; animation: stPop .16s ease-out;
}
.st-popmenu.open { display: block; }
.st-popmenu a, .st-popmenu button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; border: 0; background: transparent; border-radius: 10px;
  color: var(--text); font-size: 14px; text-align: left; cursor: pointer;
}
.st-popmenu a:hover, .st-popmenu button:hover { background: var(--bg); color: var(--text); }
.st-popmenu i { width: 18px; text-align: center; color: var(--text2); }
.st-popmenu .danger, .st-popmenu .danger i { color: var(--danger); }
@keyframes stPop { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- Konten utama ---------- */
.main-content {
  max-width: 500px !important; margin: 0 auto !important;
  padding: 72px 16px 40px !important; background: transparent;
}
.section { padding: 0; }
.section-header {
  background: transparent !important; box-shadow: none !important; border: 0 !important;
  padding: 0 !important; margin: 0 0 14px !important; height: auto !important; display: block !important;
}
/* Judul halaman dibuat seperti kartu "hero" gradient pada aplikasi */
.section-header h1 {
  margin: 0 !important; padding: 18px 20px; font-size: 19px !important; font-weight: 800 !important;
  color: #fff !important; background: var(--grad); border-radius: 22px;
  box-shadow: 0 8px 18px rgba(1, 122, 177, .30); position: relative; overflow: hidden;
}
.section-header h1::after {
  content: ""; position: absolute; right: -28px; top: -34px; width: 120px; height: 120px;
  border-radius: 50%; background: rgba(255, 255, 255, .08);
}

/* ---------- Kartu ---------- */
.card {
  background: var(--surface) !important; border: 1px solid var(--border) !important;
  border-radius: 20px !important; box-shadow: var(--shadow-card) !important;
  margin-bottom: 16px; overflow: hidden;
}
.card .card-header {
  background: transparent !important; border-bottom: 1px solid var(--border) !important;
  padding: 16px 18px !important; min-height: 0;
}
.card .card-header h4 { font-size: 15px !important; font-weight: 800; color: var(--text) !important; margin: 0; }
.card .card-body { padding: 18px !important; color: var(--text); }
.card .card-footer { background: transparent !important; border-top: 1px solid var(--border) !important; }
.card.card-primary { border-top: 1px solid var(--border) !important; }

/* ---------- Form ---------- */
label { font-size: 12.5px; font-weight: 700; color: var(--text2); letter-spacing: .2px; }
.form-control, select.form-control, textarea.form-control {
  background-color: var(--input-bg) !important; color: var(--text) !important;
  border: 1px solid var(--border) !important; border-radius: 12px !important;
  min-height: 52px; padding: 12px 16px !important; font-size: 15px; box-shadow: none !important;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(1, 122, 177, .15) !important;
  background-color: var(--input-bg) !important;
}
.form-control::placeholder { color: var(--text2); opacity: .7; }
.form-control[readonly], .form-control:disabled { background-color: var(--bg) !important; opacity: 1; }
.input-group-text { background: var(--bg); border-color: var(--border); color: var(--text2); border-radius: 12px; }
.invalid-feedback { color: var(--danger); }

/* "Field" bergaya dropdown yang memakai inline style abu-abu (nominal, bank, room, dsb.) */
.form-control[style*="#EFEFEF"], div[style*="background-color:#EFEFEF"], div[style*="background-color: #EFEFEF"] {
  background-color: var(--surface) !important; border: 1px solid var(--border) !important;
  border-radius: 12px !important; color: var(--text) !important;
}
div[style*="background-color:#EFEFEF"] b, div[style*="background-color: #EFEFEF"] b { color: var(--primary); letter-spacing: .5px; }
div[style*="background-color:#EFEFEF"]:empty::after {
  content: "Pilih  \25BE"; color: var(--text2); font-size: 14px;
}
#nominal.form-control, #bank.form-control { cursor: pointer; display: flex; align-items: center; }
#nominal.form-control:empty::after, #bank.form-control:empty::after { content: "Pilih  \25BE"; color: var(--text2); }
#nominal.form-control:not(:empty)::after, #bank.form-control:not(:empty)::after { content: "\25BE"; margin-left: auto; color: var(--text2); }
#nominal.form-control:active, #bank.form-control:active { border-color: var(--primary) !important; }

/* ---------- Tombol ---------- */
.btn {
  border-radius: 12px !important; font-weight: 700 !important; font-size: 14px;
  letter-spacing: .2px; box-shadow: none !important; transition: transform .1s, filter .15s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn-lg, .btn-block.btn-lg { padding: 14px 16px !important; font-size: 14.5px !important; }
.btn-primary, .btn-primary.disabled, .btn-primary:focus {
  background-color: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important;
}
.btn-primary:hover, .btn-primary:active { background-color: var(--primary-dark) !important; border-color: var(--primary-dark) !important; }
html[data-theme="dark"] .btn-primary:hover { filter: brightness(1.1); background-color: var(--primary) !important; }
.btn-success { background-color: var(--success) !important; border-color: var(--success) !important; color: #fff !important; }
.btn-danger  { background-color: var(--danger) !important; border-color: var(--danger) !important; color: #fff !important; }
.btn-warning { background-color: var(--warning) !important; border-color: var(--warning) !important; color: #000 !important; }
.btn-success:hover, .btn-danger:hover { filter: brightness(1.08); }
.btn-light, .btn-secondary {
  background-color: var(--bg) !important; border: 1px solid var(--border) !important; color: var(--text) !important;
}
.btn-light:hover, .btn-secondary:hover { border-color: var(--primary) !important; color: var(--primary) !important; }
.btn-outline-primary { color: var(--primary) !important; border: 1px solid var(--primary) !important; background: transparent !important; }
.btn[disabled], .btn.disabled { background-color: var(--border) !important; border-color: var(--border) !important; color: var(--text2) !important; }

/* ---------- Alert (kartu notifikasi dengan garis aksen) ---------- */
.alert {
  border: 1px solid var(--border) !important; border-left: 4px solid var(--primary) !important;
  border-radius: 14px !important; background: var(--surface) !important; color: var(--text) !important;
  box-shadow: var(--shadow-card); padding: 13px 16px !important; font-size: 13.5px; line-height: 1.45;
}
.alert-danger  { border-left-color: var(--danger) !important;  background: var(--danger-soft) !important; }
.alert-success { border-left-color: var(--success) !important; background: var(--success-soft) !important; }
.alert-warning { border-left-color: #E0A100 !important; background: var(--warning-soft) !important; }
.alert-info    { border-left-color: var(--primary) !important; background: var(--primary-light) !important; }

/* ---------- Tabel ---------- */
.table { color: var(--text); }
.table th, .table td { border-color: var(--border) !important; }
.table thead th { background: var(--primary-light); color: var(--accent); font-size: 12px; font-weight: 800; border-bottom: 0 !important; }
.table-striped tbody tr:nth-of-type(odd) { background: var(--bg); }

/* ---------- Popup / modal -> bottom sheet ---------- */
.popup {
  background: rgba(10, 18, 26, .55) !important; z-index: 60 !important; padding: 0 !important;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.popup[style*="display: block"] .popup-content, .popup[style*="display:block"] .popup-content { animation: stSheet .24s cubic-bezier(.2, .8, .2, 1); }
.popup .popup-content {
  background: var(--surface) !important; color: var(--text);
  border: 0 !important; border-radius: 24px 24px 0 0 !important;
  width: 100% !important; max-width: 500px !important; margin: 0 !important;
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  max-height: 88% !important; overflow-y: auto; padding: 22px 20px 26px !important;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .18);
}
.popup .popup-content::before {
  content: ""; display: block; width: 44px; height: 5px; border-radius: 10px;
  background: var(--border); margin: -10px auto 14px;
}
@keyframes stSheet { from { transform: translate(-50%, 40px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.popup .header { color: var(--text) !important; font-size: 19px !important; font-weight: 800 !important; }
.popup .close {
  color: var(--text2) !important; float: right; width: 32px; height: 32px; line-height: 30px; text-align: center;
  border-radius: 50%; font-size: 24px !important; font-weight: 400 !important; background: var(--bg);
}
.popup .close:hover { color: var(--text) !important; }
.popup div[style*="color:#999"], .popup div[style*="color: #999"] { color: var(--text2) !important; }
.popup div[style*="color:#333"], .popup div[style*="color: #333"] { color: var(--text) !important; }
.popup div[style*="background-color:#FFF"] { background: transparent !important; }
.popup div[style*="border-bottom:solid 1px #e3eaef"] { border-bottom-color: var(--border) !important; }

/* Pilihan nominal / bank (radio) */
.box label {
  background: var(--bg) !important; border: 1px solid var(--border) !important; border-radius: 14px !important;
  margin: 5px 0 !important; padding: 14px 12px !important; cursor: pointer !important;
}
.box label .text { color: var(--text) !important; font-weight: 700; font-size: 16px; }
.box label .text img { background: #fff; padding: 4px 8px; border-radius: 8px; max-height: 40px; width: auto; margin-bottom: 6px; }
.box input[type="radio"]:checked + label { background: var(--primary) !important; border-color: var(--primary) !important; }
.box input[type="radio"]:checked + label .text { color: #fff !important; }

/* ---------- Tombol aksi menempel di bawah (Beli / Bayar / Cek status) ---------- */
div[style*="position:fixed"][style*="bottom:50px"] {
  bottom: 0 !important; left: 50% !important; transform: translateX(-50%); width: 100% !important; max-width: 500px;
  background: var(--surface) !important; border-top: 1px solid var(--border);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, .08); padding: 12px 8px 12px !important; z-index: 20;
}
div[style*="position:fixed"][style*="bottom:50px"] .form-group { margin-bottom: 0; }

/* ---------- Kartu meter (Meter Listrik / Meter Air) ---------- */
.meter-button {
  background: var(--primary-light) !important; border: 0 !important; border-radius: 16px !important;
  padding: 12px !important; box-shadow: none !important; display: block; width: 100%;
}
.meter-button:hover { filter: brightness(.97); background: var(--primary-light) !important; }
.meter-button .icon-circle {
  width: 46px !important; height: 46px !important; border-radius: 14px !important;
  background: var(--surface) !important; color: var(--primary) !important; font-size: 22px !important;
}
.meter-button .text-primary { color: var(--accent) !important; font-weight: 800; font-size: 15px; }
.meter-button .text-dark { color: var(--text2) !important; font-size: 13px; }

/* ---------- Hitung mundur / status ---------- */
#countdown .div { background: var(--primary-dark) !important; border-radius: 14px !important; padding: 10px !important; }
#countdown .div-exp { background: var(--danger) !important; border-radius: 14px !important; font-weight: 800; }
#countdown .div-paid { background: var(--success) !important; border-radius: 14px !important; font-weight: 800; letter-spacing: 1px; }

/* Teks kecil abu-abu bawaan halaman */
div[style*="color:#999"], td[style*="color:#999"], table[style*="color:#999"] { color: var(--text2) !important; }
div[style*="color:#333"] { color: var(--text) !important; }
div[style*="border-bottom:solid 1px #e3eaef"] { border-bottom-color: var(--border) !important; }

/* ---------- Drawer / menu samping ---------- */
.st-scrim {
  position: fixed; inset: 0; background: rgba(10, 18, 26, .5); z-index: 70;
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.st-scrim.open { opacity: 1; pointer-events: auto; }
.st-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 304px; max-width: 86%; z-index: 80;
  background: var(--surface); border-radius: 0 28px 28px 0; display: flex; flex-direction: column;
  transform: translateX(-102%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
  overflow: hidden;
}
.st-drawer.open { transform: none; box-shadow: 8px 0 30px rgba(0, 0, 0, .25); }
.st-drawer-head { background: var(--grad); padding: 26px 20px 22px; position: relative; overflow: hidden; color: #fff; }
.st-drawer-head::after {
  content: ""; position: absolute; right: -30px; top: -20px; width: 120px; height: 120px;
  border-radius: 50%; background: rgba(255, 255, 255, .08);
}
.st-logo {
  width: 74px; height: 74px; border-radius: 22px; background: #fff; padding: 9px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 14px rgba(0, 0, 0, .2);
  color: var(--primary); font-size: 34px; position: relative; z-index: 1;
}
.st-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.st-drawer-head h3 { margin: 16px 0 2px; font-size: 18px; font-weight: 800; color: #fff; position: relative; z-index: 1; }
.st-drawer-head p { margin: 0; font-size: 12px; color: rgba(255, 255, 255, .8); position: relative; z-index: 1; }
.st-userchip {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; max-width: 100%;
  padding: 7px 12px; border-radius: 20px; background: rgba(255, 255, 255, .18);
  font-size: 12.5px; font-weight: 600; position: relative; z-index: 1;
}
.st-userchip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.st-drawer-body { flex: 1; overflow-y: auto; padding-bottom: 10px; }
.st-section {
  padding: 16px 26px 6px; font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
  color: var(--text2); text-transform: uppercase;
}
.st-tile {
  display: flex; align-items: center; gap: 12px; margin: 2px 12px; padding: 9px 10px;
  border-radius: 16px; color: var(--text); text-decoration: none !important; cursor: pointer;
  background: transparent; border: 0; width: calc(100% - 24px); text-align: left;
  opacity: 0; transform: translateX(-24px);
}
.st-drawer.open .st-tile { animation: stTile .38s cubic-bezier(.2, .8, .2, 1) forwards; }
.st-drawer.open .st-tile:nth-of-type(2) { animation-delay: .05s; }
.st-drawer.open .st-tile:nth-of-type(3) { animation-delay: .10s; }
.st-drawer.open .st-tile:nth-of-type(4) { animation-delay: .15s; }
.st-drawer.open .st-tile:nth-of-type(5) { animation-delay: .20s; }
@keyframes stTile { to { opacity: 1; transform: none; } }
.st-tile .ico {
  width: 40px; height: 40px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: rgba(1, 122, 177, .10); color: var(--primary); font-size: 17px; transition: background .2s;
}
html[data-theme="dark"] .st-tile .ico { background: rgba(43, 158, 216, .14); }
.st-tile .lbl { flex: 1; min-width: 0; }
.st-tile .lbl b { display: block; font-size: 14.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tile .lbl small { display: block; font-size: 11.5px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tile .chev { color: var(--grey); font-size: 13px; }
.st-tile:hover { background: rgba(1, 122, 177, .06); color: var(--text); }
.st-tile.active { background: rgba(1, 122, 177, .10); }
.st-tile.active .ico, html[data-theme="dark"] .st-tile.active .ico { background: var(--primary); color: #fff; }
.st-tile.active .lbl b { color: var(--primary); font-weight: 800; }
.st-tile.active .chev { display: none; }
.st-tile.active::after { content: ""; width: 6px; height: 22px; border-radius: 6px; background: var(--primary); }
.st-tile.danger .ico { background: rgba(163, 0, 0, .10); color: var(--danger); }
.st-tile.danger .lbl b { color: var(--danger); }
.st-drawer-foot { border-top: 1px solid var(--border); padding: 12px 16px 4px; }
.st-drawer-foot .st-section { padding: 0 0 8px; }
.st-version { padding: 2px 20px 14px; font-size: 12px; color: var(--text2); }

/* Pilihan tema: Terang | Gelap | Sistem */
.st-seg { display: flex; padding: 4px; gap: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; }
.st-seg button {
  flex: 1; border: 0; background: transparent; color: var(--text2); border-radius: 10px;
  padding: 10px 0; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .18s, color .18s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.st-seg button.on { background: var(--primary); color: #fff; }

/* ---------- Loader (spinner kartu seperti FullScreenLoading) ---------- */
#loader {
  position: fixed !important; left: 0 !important; top: 0 !important; right: 0; bottom: 0;
  width: auto !important; height: auto !important; margin: 0 !important; border: 0 !important;
  border-radius: 0 !important; animation: none !important; z-index: 999 !important;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
#loader::before {
  content: "Harap tunggu sampai proses selesai"; box-sizing: border-box; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%); width: 230px; padding: 74px 24px 22px; text-align: center;
  font-size: 13px; font-weight: 500; line-height: 1.4;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-pop);
}
#loader::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -62px 0 0 -17px;
  border-radius: 50%; border: 3.5px solid var(--border); border-top-color: var(--primary);
  animation: stSpin .9s linear infinite;
}
@keyframes stSpin { to { transform: rotate(360deg); } }
.animate-bottom { animation: stUp .45s cubic-bezier(.2, .8, .2, 1) !important; }
@keyframes stUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ---------- Banner info (seperti _noticeCard) ---------- */
.st-notice {
  display: flex; gap: 10px; padding: 14px; border-radius: 16px; background: var(--warning-soft);
  color: var(--text); font-size: 13px; line-height: 1.45; margin-bottom: 16px;
}
.st-notice i { color: var(--warning-dark); font-size: 18px; margin-top: 1px; }

/* ---------- Halaman Login / Kategori (tanpa appbar) ---------- */
body.st-auth { background: var(--primary-dark) !important; min-height: 100vh; position: relative; overflow-x: hidden; }
html[data-theme="dark"] body.st-auth { background: #0B3047 !important; }
body.st-auth::before, body.st-auth::after {
  content: ""; position: fixed; border-radius: 50%; pointer-events: none;
  border: 1px solid var(--ring); box-shadow:
    0 0 0 50px transparent, 0 0 0 51px var(--ring), 0 0 0 105px transparent, 0 0 0 106px var(--ring),
    0 0 0 165px transparent, 0 0 0 166px var(--ring), 0 0 0 230px transparent, 0 0 0 231px var(--ring);
}
body.st-auth::before { width: 140px; height: 140px; right: calc(8% - 70px); top: calc(8% - 70px); }
body.st-auth .st-wrap { position: relative; z-index: 1; max-width: 420px; margin: 0 auto; padding: 18px 24px 30px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.st-tag { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 800; letter-spacing: 2px; color: #fff; margin-top: 20px; }
.st-tag::before { content: ""; width: 3px; height: 14px; background: #fff; }
.st-auth h1.st-h { font-size: 28px; font-weight: 800; color: #fff; margin: 14px 0 6px; line-height: 1.2; }
.st-auth p.st-sub { font-size: 13.5px; color: rgba(255, 255, 255, .8); margin: 0 0 26px; }
.st-auth .st-card { background: var(--bg); border-radius: 24px; padding: 24px 20px; box-shadow: 0 10px 24px rgba(0, 0, 0, .2); }
.st-auth .st-card .form-group { margin-bottom: 14px; }
.st-auth .st-card .btn-block { margin-top: 8px; }
.st-auth .alert { margin-bottom: 14px; }
.st-back {
  width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff !important;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
}
.st-chip-theme {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 20px; border: 0;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 12px; font-weight: 600; cursor: pointer;
}
.st-topline { display: flex; align-items: center; justify-content: space-between; }

/* Halaman Kategori: panel atas + kartu pilihan */
body.st-cat { background: var(--bg) !important; }
body.st-cat::before, body.st-cat::after { display: none; }
.st-cat-top {
  background: var(--primary-dark); color: #fff; border-radius: 0 0 32px 32px; position: relative; overflow: hidden;
}
html[data-theme="dark"] .st-cat-top { background: #0B3047; }
.st-cat-top::before {
  content: ""; position: absolute; width: 140px; height: 140px; border-radius: 50%; right: calc(8% - 70px); top: calc(8% - 70px);
  box-shadow: 0 0 0 50px transparent, 0 0 0 51px var(--ring), 0 0 0 105px transparent, 0 0 0 106px var(--ring),
    0 0 0 165px transparent, 0 0 0 166px var(--ring), 0 0 0 230px transparent, 0 0 0 231px var(--ring);
  border: 1px solid var(--ring);
}
.st-cat-top .in { position: relative; max-width: 480px; margin: 0 auto; padding: 28px 28px 44px; }
.st-brand { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 800; letter-spacing: 2.4px; color: #fff; }
.st-brand::before { content: ""; width: 3px; height: 18px; background: #fff; }
.st-cat-top h1 { font-size: 34px; line-height: 1.15; font-weight: 700; color: #fff; margin: 44px 0 12px; }
.st-cat-top p { font-size: 14.5px; color: rgba(255, 255, 255, .8); margin: 0; }
.st-cat-list { max-width: 480px; margin: 0 auto; padding: 28px 24px 24px; }
.st-opt {
  display: flex; width: 100%; padding: 0; margin-bottom: 14px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  box-shadow: 0 5px 14px rgba(27, 39, 51, .06); transition: transform .11s, border-color .15s;
  animation: stUp .5s cubic-bezier(.2, .8, .2, 1) both;
}
html[data-theme="dark"] .st-opt { box-shadow: none; }
.st-opt:nth-of-type(2) { animation-delay: .12s; }
.st-opt:active { transform: scale(.98); border-color: var(--primary); }
.st-opt .bar { width: 4px; background: var(--primary); flex: none; }
.st-opt .tx { flex: 1; padding: 18px 14px 18px 18px; }
.st-opt .tg { font-size: 10.5px; font-weight: 800; letter-spacing: 1.4px; color: var(--primary); }
.st-opt .tt { font-size: 18px; font-weight: 800; color: var(--text); margin: 6px 0 4px; }
.st-opt .sb { font-size: 13px; color: var(--text2); line-height: 1.4; }
.st-opt .go { display: flex; align-items: center; padding-right: 16px; color: var(--primary); }
.st-cat-note { text-align: center; font-size: 12.5px; line-height: 1.5; color: var(--text2); padding: 8px 4px 0; }
.st-cat-note b { color: var(--text); }

/* ---------- Info pelanggan / ringkasan (kartu primaryLight) ---------- */
.st-cust { background: var(--primary-light); border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.st-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800;
}

/* ---------- Lain-lain ---------- */
.badge { border-radius: 20px; padding: 5px 10px; font-weight: 700; font-size: 11px; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning-dark); }
.bg-primary { background-color: var(--primary) !important; }
.text-primary { color: var(--primary) !important; }
.login-brand { display: none; }
.dropdown-menu { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-pop); }
.dropdown-item { color: var(--text); }
.dropdown-item:hover { background: var(--bg); }
.dataTables_wrapper, .dataTables_wrapper * { color: var(--text); }
::selection { background: rgba(1, 122, 177, .25); }

/* ---------- Input dengan ikon (halaman login) ---------- */
.st-field { position: relative; }
.st-field > i.lead { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text2); font-size: 16px; pointer-events: none; z-index: 2; }
.st-field .form-control { padding-left: 46px !important; }
.st-field .eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: transparent;
  color: var(--text2); border-radius: 50%; cursor: pointer; z-index: 2;
}
.st-field .eye:hover { color: var(--primary); }
.st-field.has-eye .form-control { padding-right: 48px !important; }
.st-auth .st-wrap .card { background: var(--surface); }
.st-auth .st-card label { display: block; margin-bottom: 6px; }

/* ---------- Keterbacaan teks inline lama (mode terang & gelap) ---------- */
div[style*="color:#000"], td[style*="color:#000"], b[style*="color:#000"], span[style*="color:#000"], p[style*="color:#000"],
div[style*="color: #000"], div[style*="color:black"], b[style*="color:black"], span[style*="color:black"] { color: var(--text) !important; }
div[style*="color:#666"], span[style*="color:#666"], td[style*="color:#666"] { color: var(--text2) !important; }
td[style*="color:#999"], div[style*="color:#999"], span[style*="color:#999"] { color: var(--text2) !important; }
table[style*="color:#999"] { color: var(--text2) !important; }
.card-body table td { padding-top: 6px; padding-bottom: 6px; }
.card-body table td > div { margin-top: 1px; font-weight: 700; }
div[style*="background-color:#FFF"][style*="margin-bottom"] { background: transparent !important; }
a[href*="javascript"], a[onclick*="mynova"] { color: var(--primary); font-weight: 700; }
input[type="submit"].btn, button.btn { cursor: pointer; }

/* Daftar riwayat di dalam sheet -> kartu */
.popup div[style*="background-color:#FFF"][style*="margin-bottom"] {
  background: var(--bg) !important; border: 1px solid var(--border); border-radius: 16px; padding: 14px !important;
  margin-bottom: 12px !important;
}
.popup div[style*="background-color:#FFF"] table { margin-bottom: 12px !important; }
.popup div[style*="background-color:#FFF"] .form-group.row { margin-bottom: 0; }

/* Judul halaman dengan sub-keterangan */
.section-header h1 small { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 400; line-height: 1.3; color: rgba(255, 255, 255, .87); position: relative; z-index: 1; }

/* Tombol unduh aplikasi */
a[href*="play.google.com"], a[href*="apps.apple.com"] { border-radius: 12px !important; box-shadow: 0 4px 10px rgba(0, 0, 0, .12); }

/* Shortcode: tabel menjadi daftar kartu */
.st-short { display: block; width: 100%; }
.st-short .row-i { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.st-short .row-i:last-child { border-bottom: 0; }
.st-short .code { flex: none; min-width: 92px; text-align: center; padding: 7px 10px; border-radius: 10px; background: var(--primary-light); color: var(--accent); font-weight: 800; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.st-short .desc { flex: 1; color: var(--text); font-size: 14px; line-height: 1.35; }


/* ======================================================================
   Sheet riwayat (No Meter & Transaksi), metode bayar, invoice
   ====================================================================== */
.popup .st-sub2 { color: var(--text2); font-size: 12.5px; margin: 2px 0 12px; }
.popup .st-sub2 b { color: var(--primary); }
.st-search { position: relative; margin-bottom: 12px; }
.st-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text2); font-size: 14px; }
.st-search input {
  width: 100%; height: 46px; padding: 0 14px 0 40px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.st-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(1, 122, 177, .15); background: var(--surface); }
.st-chips { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 2px; }
.st-chips button {
  flex: none; border: 1px solid var(--border); background: var(--bg); color: var(--text2); border-radius: 20px;
  padding: 7px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.st-chips button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.st-list { padding-bottom: 6px; }
.st-empty { display: none; text-align: center; padding: 28px 10px; color: var(--text2); font-size: 13px; }
.st-empty .circle { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.st-empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 3px; }

/* Baris nomor meter (satu kartu bisa diketuk) */
.st-item { margin: 0 0 10px; }
.st-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; text-align: left; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); border-radius: 16px; transition: transform .1s, border-color .15s, background .15s;
}
.st-row:hover { border-color: var(--primary); background: var(--primary-light); }
.st-row:active { transform: scale(.98); }
.st-row .ico { width: 44px; height: 44px; flex: none; border-radius: 14px; background: var(--surface); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 19px; }
.st-row .mid { flex: 1; min-width: 0; }
.st-row .mid small { display: block; font-size: 10.5px; letter-spacing: .8px; font-weight: 800; color: var(--text2); text-transform: uppercase; }
.st-row .mid b { display: block; font-size: 17px; color: var(--text); letter-spacing: .3px; }
.st-row .go { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: #fff; background: var(--primary); padding: 8px 12px; border-radius: 12px; }

/* Kartu transaksi (bisa dibuka/tutup) */
.st-trx { background: var(--bg); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; transition: border-color .15s; }
.st-trx.open { border-color: var(--primary); }
.st-trx .head { display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer; }
.st-trx .badge-ico { width: 42px; height: 42px; flex: none; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.st-trx.lunas .badge-ico { background: var(--success-soft); color: var(--success); }
.st-trx.belum .badge-ico { background: var(--warning-soft); color: var(--warning-dark); }
.st-trx .info { flex: 1; min-width: 0; }
.st-trx .amt { font-size: 17px; font-weight: 800; color: var(--text); line-height: 1.2; }
.st-trx .dt { font-size: 12px; color: var(--text2); margin-top: 2px; }
.st-ch { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-top: 5px; line-height: 1.4; }
.st-ch i { font-size: 11px; }
.st-ch.qris { background: #F3E8FF; color: #7B2CBF; }
.st-ch.va { background: #E5F2F9; color: #015A85; }
.st-chip { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 20px; letter-spacing: .3px; }
.st-chip.ok { background: var(--success-soft); color: var(--success); }
.st-chip.wait { background: var(--warning-soft); color: var(--warning-dark); }
.st-trx .chev { color: var(--text2); transition: transform .2s; font-size: 12px; margin-left: 4px; }
.st-trx.open .chev { transform: rotate(180deg); }
.st-trx .body { display: none; padding: 0 14px 14px; }
.st-trx.open .body { display: block; animation: stUp .25s ease-out; }
.st-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 12px; background: var(--surface); border-radius: 14px; border: 1px solid var(--border); margin-bottom: 12px; }
.st-kv .full { grid-column: 1 / -1; }
.st-kv small { display: block; font-size: 10.5px; color: var(--text2); font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.st-kv span { display: block; font-size: 14px; color: var(--text); font-weight: 600; word-break: break-all; }
.st-token { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border-radius: 14px; background: var(--primary-light); }
.st-token .tk { flex: 1; min-width: 0; }
.st-token small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .6px; color: var(--accent); }
.st-token b { display: block; font-size: 13.5px; letter-spacing: .4px; color: var(--text); word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace; }
.st-mini { border: 0; background: var(--surface); color: var(--primary); font-weight: 800; font-size: 12px; padding: 8px 12px; border-radius: 10px; cursor: pointer; flex: none; border: 1px solid var(--border); }
.st-mini.ok { background: var(--success); color: #fff; border-color: var(--success); }
.st-acts { display: flex; gap: 8px; }
.st-acts > * { flex: 1; margin: 0; }
.st-acts form { display: block; }
.st-acts .btn { padding: 11px 6px !important; font-size: 13px !important; width: 100%; }

/* Metode bayar & nominal */
.box.pay label, .box.nom label { transition: border-color .15s, background .15s, transform .1s; }
.box.pay label:active, .box.nom label:active { transform: scale(.98); }
.box.pay label { position: relative; padding: 12px 46px 12px 12px !important; }
.box.pay label .text { display: flex !important; align-items: center; gap: 14px; text-align: left !important; font-size: 14.5px !important; }
.box.pay label .text .pimg { flex: none; width: 70px; height: 40px; background: #fff; border-radius: 10px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; padding: 4px; }
.box.pay label .text .pimg img { max-width: 100%; max-height: 100%; padding: 0; margin: 0; background: transparent; border-radius: 0; width: auto !important; }
.box.pay label .text .pname { flex: 1; font-weight: 700; line-height: 1.25; }
.box.pay label::after {
  content: "\f00c"; font-family: "Font Awesome 5 Free", FontAwesome; font-weight: 900; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); color: transparent; font-size: 11px;
  display: flex; align-items: center; justify-content: center; background: var(--surface);
}
.box.pay input[type="radio"]:checked + label { background: var(--primary-light) !important; border-color: var(--primary) !important; box-shadow: 0 0 0 1px var(--primary); }
.box.pay input[type="radio"]:checked + label .text { color: var(--text) !important; }
.box.pay input[type="radio"]:checked + label::after { background: var(--primary); border-color: var(--primary); color: #fff; }
.box.nom { display: flex; flex-flow: row wrap; gap: 8px; margin-top: 10px; }
.box.nom label { width: calc(50% - 4px) !important; margin: 0 !important; text-align: center; }
.box.nom input[type="radio"]:checked + label { background: var(--primary) !important; box-shadow: 0 6px 14px rgba(1, 122, 177, .3); }
.st-pay-ico { height: 26px; width: 52px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px 5px; margin-right: 10px; border: 1px solid var(--border); vertical-align: middle; }
#bank.form-control, #nominal.form-control { min-height: 56px; }

/* Invoice (halaman web) */
.st-inv-hero { text-align: center; padding: 22px 16px; border-radius: 22px; background: var(--grad); color: #fff; margin-bottom: 14px; position: relative; overflow: hidden; box-shadow: 0 8px 18px rgba(1, 122, 177, .3); }
.st-inv-hero::after { content: ""; position: absolute; right: -30px; top: -36px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.st-inv-hero .ok { width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: flex; align-items: center; justify-content: center; font-size: 24px; position: relative; z-index: 1; }
.st-inv-hero h2 { color: #fff; font-size: 17px; font-weight: 800; margin: 0 0 2px; position: relative; z-index: 1; }
.st-inv-hero p { margin: 0; font-size: 12.5px; color: rgba(255, 255, 255, .85); position: relative; z-index: 1; }
.st-inv-hero .tot { font-size: 26px; font-weight: 800; margin-top: 10px; position: relative; z-index: 1; }
.st-inv-token { background: var(--primary-light); border-radius: 18px; padding: 14px; text-align: center; margin-bottom: 14px; }
.st-inv-token small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px; color: var(--accent); }
.st-inv-token b { display: block; font-size: 22px; letter-spacing: 2px; margin: 6px 0 10px; color: var(--text); font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.btn-dl { display: block; }

/* Dasar popup (agar konsisten di semua halaman) */
.popup { display: none; position: fixed; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; }

/* Teks hitam inline (termasuk input yang disabled) tetap terbaca di mode gelap */
input[style*="color:#000"], input[style*="color: #000"], input[disabled] {
  color: var(--text) !important; -webkit-text-fill-color: var(--text) !important; opacity: 1 !important;
}
td[style*="color:#000"], td[style*="color: #000"], p[style*="color: #000"], b[style*="color: #000"], span[style*="color: #000"] { color: var(--text) !important; }
/* ---------- Scan barcode nomor meter ---------- */
.st-scanwrap { position: relative; }
.st-scanwrap .form-control { padding-right: 60px !important; }
.st-scanbtn {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px;
  border: 0; border-radius: 12px; background: var(--primary-light); color: var(--primary); font-size: 18px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.st-scanbtn:active { filter: brightness(.92); }
.st-scan {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 9999; background: rgba(0, 0, 0, .94);
  display: none; flex-direction: column; align-items: center; justify-content: center; padding: 16px;
}
.st-scan.open { display: flex; }
.st-scan-x {
  position: absolute; top: 14px; right: 14px; width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 18px; cursor: pointer; z-index: 3;
}
.st-scan-view { position: relative; width: min(92vw, 440px); height: min(70vw, 330px); border-radius: 18px; overflow: hidden; background: #000; }
.st-scan-view video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }
.st-scan-view canvas.drawingBuffer { display: none; }
.st-scan-frame { position: absolute; left: 10%; right: 10%; top: 22%; bottom: 22%; border: 2px solid rgba(255, 255, 255, .85); border-radius: 12px; z-index: 2; pointer-events: none; }
.st-scan-frame i { position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; background: #FF5A5F; box-shadow: 0 0 8px #FF5A5F; animation: stScanLine 1.6s ease-in-out infinite alternate; }
@keyframes stScanLine { from { top: 12%; } to { top: 88%; } }
.st-scan-msg { color: #fff; font-size: 14px; text-align: center; margin-top: 18px; max-width: 440px; line-height: 1.45; }
.st-scan-msg.err { color: #FFB4B4; }
/* Tombol scan pada kolom pencarian & login */
.st-search.has-scan input { padding-right: 52px; }
.st-search .st-scanbtn { right: 4px; width: 38px; height: 38px; }
.st-search .st-scanbtn i { position: static; left: auto; top: auto; transform: none; color: inherit; font-size: 17px; }
.st-field.has-scan .form-control { padding-right: 60px !important; }
/* Autofill browser (Chrome/Safari) tidak boleh menimpa warna input */
input:-webkit-autofill, input:-webkit-autofill:focus, input:-webkit-autofill:hover {
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important; -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text); transition: background-color 9999s ease-in-out 0s;
}
/* Wadah pilihan nominal / bank: CSS inline halaman memberi background #fff, ikut tema saja */
.box, .box.nom, .box.pay { background: transparent !important; }
/* Sel tabel dengan background putih inline (mis. nomor Virtual Account) ikut tema */
td[style*="background-color:#FFF"], td[style*="background-color: #FFF"] { background: transparent !important; }
