/* AINet Customer Portal Mobile */

.app-logo {
    width: 200px;
    max-width: 72%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.app-logo.login-logo {
    width: min(260px, 78%);
    max-width: 280px;
    height: auto;
    border-radius: 12px;
    object-fit: contain;
}

.login-brand {
    text-align: center;
    margin-bottom: 16px;
}

.company-name {
    text-align: center;
    color: var(--muted);
    font-size: .72rem;
    margin: 0 0 20px;
    letter-spacing: .02em;
}

.login-submit {
    padding: 14px;
    margin-top: 8px;
}

.header-btn {
    border-color: rgba(255,255,255,.85) !important;
    color: #fff !important;
    background: transparent !important;
}
.header-btn i { color: #fff !important; }
.header-btn:active {
    background: rgba(255,255,255,.15) !important;
}

:root {
    --brand: #edfc02;
    --brand-ink: #111827;
    --primary: #edfc02;
    --primary-dark: #c9d600;
    --primary-light: #f5ff66;
    --primary-soft: #f7fec4;
    --primary-text: #111827;
    --accent: #fe0000;
    --accent-dark: #c40000;
    --accent-soft: #fff1f1;
    --success: #edfc02;
    --warning: #fe0000;
    --danger: #fe0000;
    --info: #111827;
    --dark: #0f172a;
    --muted: #64748b;
    --text-secondary: #475569;
    --border: #e5e7eb;
    --border-soft: #f3f4f6;
    --text: #0f172a;
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --input-bg: #ffffff;
    --overlay: rgba(255, 255, 255, .72);
    --overlay-strong: rgba(255, 255, 255, .88);
    --shadow: 0 1px 4px rgba(15, 23, 42, .06);
    --shadow-lg: 0 14px 30px rgba(15, 23, 42, .18);
    --header-bg: transparent;
    --header-fg: #0f172a;
    --nav-inactive: #8a949c;
    --badge-secondary-bg: #e8eef3;
    --badge-secondary-fg: #4a5a68;
    --focus-ring: rgba(237, 252, 2, .35);
    --ssid-border: #d4e000;
    --ssid5-border: #d4e000;
    --ssid1-border: #ffb3b3;
    --alert-info-border: #d4e000;
    --alert-danger-border: #ffb3b3;
    --bottom-nav-h: 84px;
    --header-h: 60px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --member-grad: linear-gradient(145deg, #111827 0%, #1f2937 48%, #334155 100%);
    --member-pay-bg: #edfc02;
    --member-pay-fg: #111827;
    --member-meta-bg: rgba(0, 0, 0, .28);
    --member-bill-bg: #edfc02;
    --member-bill-border: rgba(17, 24, 39, .14);
    --member-bill-due-bg: rgba(17, 24, 39, .12);
    --swal-bg: #ffffff;
    --swal-text: #0f172a;
    --on-primary: #111827;
}

html[data-theme="dark"] {
    --brand: #edfc02;
    --brand-ink: #111827;
    --primary: #edfc02;
    --primary-dark: #f5ff66;
    --primary-light: #edfc02;
    --primary-soft: #2a2f14;
    --primary-text: #edfc02;
    --accent: #f87171;
    --accent-dark: #fca5a5;
    --accent-soft: #3f1d1d;
    --success: #edfc02;
    --warning: #f87171;
    --danger: #f87171;
    --info: #edfc02;
    --dark: #f8fafc;
    --muted: #94a3b8;
    --text-secondary: #cbd5e1;
    --border: #334155;
    --border-soft: #1e293b;
    --text: #f1f5f9;
    --bg: #0b1220;
    --surface: #111827;
    --surface-2: #1e293b;
    --input-bg: #0f172a;
    --overlay: rgba(15, 23, 42, .72);
    --overlay-strong: rgba(15, 23, 42, .88);
    --shadow: 0 1px 4px rgba(0, 0, 0, .35);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, .45);
    --header-fg: #f8fafc;
    --nav-inactive: #64748b;
    --badge-secondary-bg: #334155;
    --badge-secondary-fg: #cbd5e1;
    --focus-ring: rgba(237, 252, 2, .28);
    --ssid-border: #6b7500;
    --ssid5-border: #6b7500;
    --ssid1-border: #7f1d1d;
    --alert-info-border: #6b7500;
    --alert-danger-border: #7f1d1d;
    --member-grad: #edfc02;
    --member-pay-bg: #edfc02;
    --member-pay-fg: #111827;
    --member-meta-bg: rgba(17, 24, 39, .90);
    --member-bill-bg: #2c323f;
    --member-bill-border: rgba(255, 255, 255, .14);
    --member-bill-due-bg: rgba(0, 0, 0, .38);
    --swal-bg: #1e293b;
    --swal-text: #f1f5f9;
    --on-primary: #111827;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    transition: background .2s, color .2s;
    color-scheme: light;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
    color-scheme: dark;
}

.hidden { display: none !important; }

#loginScreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(145deg, #0b1220 0%, #111827 55%, #1f2937 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Login card tetap kuning di light & dark mode */
.login-card {
    background: #edfc02;
    color: #111827;
    border-radius: 16px;
    padding: 28px 24px;
    width: 100%;
    max-width: 380px;
    border: 1px solid rgba(17, 24, 39, .12);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .35);
}

.login-card h1 {
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 4px;
    color: #111827;
    font-weight: 700;
    letter-spacing: .02em;
}

.login-card .subtitle {
    text-align: center;
    color: #111827;
    font-size: .85rem;
    margin-bottom: 24px;
}

.login-card .subtitle.login-title {
    color: #111827;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.login-card .company-name {
    color: #111827;
    opacity: .78;
}

.login-card .form-group label {
    color: #111827;
}

.login-card .form-group input {
    background: #fff;
    color: #111827;
    border-color: rgba(17, 24, 39, .18);
}

.login-card .form-group input::placeholder {
    color: rgba(17, 24, 39, .45);
}

.login-card .form-group input:focus {
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, .12);
}

.login-hint {
    font-size: .75rem;
    color: #111827;
    text-align: center;
    margin-top: 16px;
    opacity: .78;
}

.login-hint i {
    color: #111827;
    margin-right: 4px;
}

.login-copyright {
    margin-top: 10px;
    font-size: .62rem;
    line-height: 1.4;
    text-align: center;
    color: #111827;
    opacity: .78;
}

.login-card .login-submit {
    background: #111827;
    color: #edfc02;
    border: none;
}

.login-card .login-submit i {
    color: #edfc02;
}

.login-logo,
.app-logo.login-logo {
    filter: none;
}

.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-group label .req { color: var(--danger); }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: .92rem;
    outline: none;
    background: var(--input-bg);
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--muted);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
}

.modal-sheet {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    background: var(--surface);
    color: var(--text);
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -8px 32px rgba(0,0,0,.2);
    animation: slideUp .25s ease;
}

.modal-sheet-tall { max-height: 92vh; }

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-header h2 { font-size: 1rem; color: var(--primary-text); }

.modal-body {
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-hint {
    font-size: .78rem;
    color: var(--muted);
    margin: 4px 0 12px;
    padding: 0 2px;
}

.filter-hint i { color: var(--primary-text); margin-right: 4px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    text-decoration: none;
}

.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-success { background: var(--brand); color: var(--brand-ink); font-weight: 800; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-info { background: var(--brand-ink); color: var(--brand); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-sm { padding: 8px 10px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; flex-shrink: 0; }

#appShell {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg);
    color: var(--text);
}

.app-header {
    min-height: var(--header-h);
    height: auto;
    background: var(--bg);
    color: var(--header-fg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    gap: 12px;
    flex-shrink: 0;
    z-index: 100;
}

.header-brand {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--header-fg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: .95rem;
    padding: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    -webkit-tap-highlight-color: transparent;
    transition: transform .12s ease, background .18s ease, border-color .18s ease;
}

.header-icon-btn:active {
    transform: scale(.96);
    background: var(--primary-soft);
    border-color: var(--brand);
}

.header-icon-logout:active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-dark);
}

.header-notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #fe0000;
    color: #fff;
    font-size: .58rem;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
    border: 2px solid var(--bg);
}

html[data-theme="dark"] .header-icon-btn {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--header-fg);
}

html[data-theme="dark"] .header-notif-badge {
    border-color: var(--bg);
}

.header-logo {
    display: block;
    height: 34px;
    width: auto;
    max-width: min(220px, 62vw);
    object-fit: contain;
    object-position: left center;
}

.header-tab-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--header-fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header h1 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--header-fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header .user-name {
    display: none;
}

.theme-toggle {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.theme-toggle-track {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.theme-opt {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: .85rem;
    transition: background .2s, color .2s;
}

.theme-toggle:not(.is-dark) .theme-opt-light,
.theme-toggle.is-dark .theme-opt-dark {
    background: var(--brand);
    color: var(--brand-ink);
}

.app-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 16px calc(var(--bottom-nav-h) + var(--safe-bottom) + 16px);
    background: var(--bg);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== BERANDA ===== */
.home-layout {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2.8vw, 16px);
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

/* Member / hero card — mirror design */
.member-card {
    background: var(--member-grad);
    color: #fff;
    border-radius: 24px;
    padding: 18px 18px 16px;
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, .10),
        0 8px 24px rgba(255, 255, 255, .08),
        0 12px 32px rgba(15, 23, 42, .35);
    min-width: 0;
}

/* Dark mode: kotak member besar kuning + teks gelap */
html[data-theme="dark"] .member-card {
    color: #111827;
    border-color: rgba(17, 24, 39, .12);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}

html[data-theme="dark"] .member-kicker,
html[data-theme="dark"] .member-area-label,
html[data-theme="dark"] .member-name,
html[data-theme="dark"] .member-sub {
    color: #111827;
}

html[data-theme="dark"] .member-sub {
    opacity: .78;
}

html[data-theme="dark"] .member-badge-ok {
    background: #111827 !important;
    color: #edfc02 !important;
    border-color: #111827 !important;
}

html[data-theme="dark"] .member-badge-muted {
    background: rgba(17, 24, 39, .12);
    color: #111827;
    border-color: rgba(17, 24, 39, .18);
}

html[data-theme="dark"] .member-meta-box {
    color: #fff;
    border-color: rgba(255, 255, 255, .14);
}

.member-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.member-card-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.member-kicker {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .85;
}

.member-area-label {
    font-size: .78rem;
    font-weight: 500;
    opacity: .92;
}

.member-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    background: rgba(237, 252, 2, .92);
    color: #111827;
    border: 1px solid rgba(237, 252, 2, .95);
    backdrop-filter: blur(6px);
    white-space: nowrap;
}

.member-badge-ok { background: rgba(237, 252, 2, .92); color: #111827; }
.member-badge-danger {
    background: rgba(254, 0, 0, .88);
    color: #fff;
    border-color: rgba(255, 255, 255, .35);
}
.member-badge-muted {
    background: rgba(255, 255, 255, .18);
    color: #fff;
    opacity: .9;
}

.member-name {
    font-size: clamp(1.35rem, 6vw, 1.7rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: .01em;
    overflow-wrap: anywhere;
}

.member-sub {
    margin-top: 4px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    opacity: .88;
    overflow-wrap: anywhere;
}

.member-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.member-meta-box {
    background: var(--member-meta-bg);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    padding: 12px 12px 11px;
    min-width: 0;
}

.member-meta-label {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .8;
    margin-bottom: 4px;
}

.member-meta-value {
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.member-bill {
    position: relative;
    margin-top: 14px;
    overflow: hidden;
    isolation: isolate;
    background: var(--member-bill-bg);
    color: #fff;
    border: 1px solid var(--member-bill-border);
    border-radius: 20px;
    padding: 16px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, .04),
        0 10px 28px rgba(15, 23, 42, .28);
}

/* Light: kartu tagihan kuning + teks gelap */
html:not([data-theme="dark"]) .member-bill {
    color: #111827;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
}

html:not([data-theme="dark"]) .member-bill-glow {
    background: radial-gradient(circle, rgba(255,255,255,.35) 0%, rgba(255,255,255,0) 70%);
}

html:not([data-theme="dark"]) .member-bill-label,
html:not([data-theme="dark"]) .member-bill-label i,
html:not([data-theme="dark"]) .member-bill-amount {
    color: #111827;
}

html:not([data-theme="dark"]) .member-bill-due {
    background: rgba(17, 24, 39, .12);
    border-color: rgba(17, 24, 39, .18);
    color: #111827;
}

html:not([data-theme="dark"]) .member-bill-due i {
    color: #111827;
}

html:not([data-theme="dark"]) .member-bill-ornament {
    background: rgba(17, 24, 39, .08);
    border-color: rgba(17, 24, 39, .28);
    color: #111827;
}

html:not([data-theme="dark"]) .member-bill-paid {
    background: rgba(17, 24, 39, .10);
    border-color: rgba(17, 24, 39, .18);
    color: #111827;
}

html:not([data-theme="dark"]) .member-bill.is-paid .member-bill-ornament {
    background: rgba(17, 24, 39, .10);
    border-color: rgba(17, 24, 39, .35);
    color: #111827;
}

.member-bill-glow {
    position: absolute;
    right: -18%;
    top: -40%;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
    z-index: 0;
}

.member-bill-main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.member-bill-copy {
    min-width: 0;
    flex: 1;
}

.member-bill-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .66rem;
    font-weight: 750;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #fff;
    opacity: .95;
}

.member-bill-label i {
    font-size: .75rem;
    opacity: .95;
}

.member-bill-amount {
    margin-top: 8px;
    font-size: clamp(1.55rem, 6.5vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.1;
    color: #fff;
}

.member-bill-due {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--member-bill-due-bg);
    border: 1px solid rgba(255,255,255,.10);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    opacity: .95;
    max-width: 100%;
}

.member-bill-due i {
    font-size: .7rem;
    opacity: .9;
    flex-shrink: 0;
}

.member-bill-due span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-bill-ornament {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .28);
    box-shadow: none;
    font-size: 1.2rem;
    color: #fff;
}

.member-pay-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
    min-height: 46px;
    padding: 12px 18px;
    border: 2px solid #111827;
    border-radius: 999px;
    background: #edfc02;
    color: #111827;
    font-family: inherit;
    font-size: .92rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(237, 252, 2, .22);
    transition: transform .14s ease, box-shadow .14s ease;
}

.member-pay-btn i {
    font-size: .78rem;
    color: #111827;
    transition: transform .14s ease;
}

.member-pay-btn:active {
    transform: scale(.985);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .14);
}

.member-pay-btn:active i {
    transform: translateX(2px);
}

.member-bill-paid {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.16);
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
}

.member-bill.is-paid .member-bill-ornament {
    background: rgba(237, 252, 2, .12);
    border-color: rgba(237, 252, 2, .35);
    color: #edfc02;
}

/* Dark: kartu tagihan gelap + teks putih (sudah default); tombol tetap kuning */
html[data-theme="dark"] .member-bill {
    background: var(--member-bill-bg);
    color: #fff;
    border-color: var(--member-bill-border);
}

html[data-theme="dark"] .member-bill-label,
html[data-theme="dark"] .member-bill-label i,
html[data-theme="dark"] .member-bill-amount,
html[data-theme="dark"] .member-bill-due,
html[data-theme="dark"] .member-bill-due i,
html[data-theme="dark"] .member-bill-ornament {
    color: #fff;
}

html[data-theme="dark"] .member-bill-due {
    background: var(--member-bill-due-bg);
    border-color: rgba(255, 255, 255, .10);
}

html[data-theme="dark"] .member-bill-ornament {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .28);
}

html[data-theme="dark"] .member-bill-paid {
    background: rgba(255, 255, 255, .10);
    border-color: rgba(255, 255, 255, .16);
    color: #fff;
}

html[data-theme="dark"] .member-bill.is-paid .member-bill-ornament {
    background: rgba(237, 252, 2, .12);
    border-color: rgba(237, 252, 2, .35);
    color: #edfc02;
}

/* Tombol Bayar Tagihan: kuning + teks gelap (light & dark) */
.member-pay-btn,
html[data-theme="dark"] .member-pay-btn {
    background: #edfc02 !important;
    color: #111827 !important;
    border: 2px solid #111827;
    box-shadow: 0 8px 18px rgba(237, 252, 2, .22);
}

.member-pay-btn i,
html[data-theme="dark"] .member-pay-btn i {
    color: #111827 !important;
}

/* Legacy hero kept for compatibility */
.hero-card {
    background: var(--member-grad);
    color: #fff;
    border-radius: 24px;
    padding: clamp(14px, 4vw, 20px);
    margin-bottom: 0;
    box-shadow: 0 12px 28px rgba(37, 99, 235, .28);
    min-width: 0;
}
.hero-card-body { min-width: 0; }
.hero-card .greeting {
    font-size: clamp(1rem, 4.2vw, 1.25rem);
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.hero-card .code {
    font-family: monospace;
    font-size: clamp(.75rem, 3vw, .85rem);
    opacity: .9;
    margin-top: 4px;
    word-break: break-all;
}

/* Billing card */
.billing-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background:
        linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(248,250,252,.96) 100%);
    border-radius: 22px;
    padding: 18px 16px 16px;
    margin-bottom: 0;
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .04),
        0 10px 24px rgba(15, 23, 42, .08);
    min-width: 0;
    color: var(--text);
}

.billing-card .bc-glow {
    position: absolute;
    right: -20%;
    top: -35%;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(237,252,2,.28) 0%, rgba(237,252,2,0) 70%);
    pointer-events: none;
    z-index: 0;
}

.billing-card.status-warning { border-color: rgba(248, 113, 113, .35); }
.billing-card.status-danger { border-color: rgba(254, 0, 0, .35); }
.billing-card.status-success { border-color: rgba(237, 252, 2, .55); }

.billing-card .bc-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.billing-card .bc-head-text {
    min-width: 0;
    flex: 1;
}
.billing-card .bc-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}
.billing-card .bc-kicker i { color: #111827; opacity: .7; }
.billing-card .bc-plan {
    font-weight: 800;
    font-size: clamp(.95rem, 3.8vw, 1.08rem);
    line-height: 1.25;
    overflow-wrap: anywhere;
    letter-spacing: .01em;
}
.billing-card .bc-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}
.billing-card .bc-badge-success {
    background: #edfc02;
    color: #111827;
    border: 1px solid rgba(17, 24, 39, .12);
}
.billing-card .bc-badge-warning {
    background: rgba(248, 113, 113, .14);
    color: #b91c1c;
    border: 1px solid rgba(248, 113, 113, .28);
}
.billing-card .bc-badge-danger {
    background: #fe0000;
    color: #fff;
    border: 1px solid rgba(254, 0, 0, .4);
}
.billing-card .bc-speed { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.billing-card .bc-amount {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin: 2px 0 12px;
    line-height: 1.15;
}
.billing-card .bc-amount-value {
    font-size: clamp(1.45rem, 6vw, 1.75rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.02em;
}
.billing-card .bc-amount small {
    font-size: clamp(.7rem, 2.8vw, .78rem);
    color: var(--muted);
    font-weight: 600;
}
.billing-card .bc-meta {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 10px;
    align-items: start;
    font-size: clamp(.74rem, 3.1vw, .82rem);
    color: var(--muted);
    border-top: 1px dashed rgba(15, 23, 42, .14);
    padding-top: 12px;
    margin-top: 2px;
}
.billing-card .bc-due-label {
    font-weight: 700;
    white-space: nowrap;
}
.billing-card .bc-due-value {
    text-align: right;
    overflow-wrap: anywhere;
    line-height: 1.35;
    color: var(--text);
    font-weight: 700;
}
.billing-card .bc-remaining {
    display: block;
    margin-top: 3px;
    font-size: .72rem;
    font-weight: 800;
}
.billing-card .bc-remaining.ok { color: #111827; }
.billing-card .bc-remaining.soon { color: #b91c1c; }
.billing-card .bc-remaining.overdue { color: #fe0000; }
.billing-card .bc-pay-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
    min-height: 48px;
    padding: 12px 18px;
    border: 2px solid #111827;
    border-radius: 999px;
    background: #edfc02 !important;
    color: #111827 !important;
    font-family: inherit;
    font-size: .92rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(237, 252, 2, .28);
    transition: transform .14s ease, box-shadow .14s ease;
}
.billing-card .bc-pay-btn:active {
    transform: scale(.985);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .14);
}
.billing-card .bc-pay-btn i { color: #111827 !important; }
.billing-card .bc-pay-btn .fa-arrow-right { font-size: .75rem; }

html[data-theme="dark"] .billing-card {
    background: linear-gradient(145deg, #1e293b 0%, #111827 52%, #0f172a 100%);
    border-color: rgba(255, 255, 255, .12);
    box-shadow:
        0 0 0 1px rgba(237, 252, 2, .05),
        0 12px 28px rgba(0, 0, 0, .35);
    color: #f8fafc;
}

html[data-theme="dark"] .billing-card .bc-glow {
    background: radial-gradient(circle, rgba(237,252,2,.16) 0%, rgba(237,252,2,0) 70%);
}

html[data-theme="dark"] .billing-card.status-success {
    border-color: rgba(237, 252, 2, .28);
}

html[data-theme="dark"] .billing-card .bc-kicker,
html[data-theme="dark"] .billing-card .bc-kicker i {
    color: #94a3b8;
}

html[data-theme="dark"] .billing-card .bc-plan,
html[data-theme="dark"] .billing-card .bc-amount-value,
html[data-theme="dark"] .billing-card .bc-due-value {
    color: #f8fafc;
}

html[data-theme="dark"] .billing-card .bc-meta {
    border-top-color: rgba(255, 255, 255, .12);
    color: #94a3b8;
}

html[data-theme="dark"] .billing-card .bc-remaining.ok { color: #edfc02; }
html[data-theme="dark"] .billing-card .bc-remaining.soon,
html[data-theme="dark"] .billing-card .bc-remaining.overdue { color: #f87171; }

html[data-theme="dark"] .billing-card .bc-badge-success {
    background: transparent;
    color: #edfc02;
    border-color: rgba(237, 252, 2, .55);
}

html[data-theme="dark"] .billing-card .bc-pay-btn {
    box-shadow: 0 8px 18px rgba(237, 252, 2, .18);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(10px, 2.4vw, 14px);
    margin-bottom: 0;
}

.status-card,
.stat-card {
    background:
        linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(248,250,252,.98) 100%);
    border-radius: 18px;
    padding: 14px;
    text-align: left;
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .04),
        0 8px 20px rgba(15, 23, 42, .06);
    min-width: 0;
}

.status-card-action {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.status-card-action:active {
    transform: scale(.985);
    box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
}

.status-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.status-card-ico {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    color: #edfc02;
    font-size: .95rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.status-card.is-online .status-card-ico {
    background: #edfc02;
    color: #111827;
}

.status-card.is-isolated .status-card-ico {
    background: #fe0000;
    color: #fff;
}

.status-card.is-wifi .status-card-ico {
    background: #edfc02;
    color: #111827;
}

.status-card-arrow {
    color: var(--muted);
    font-size: .68rem;
    opacity: .65;
}

.status-card-hint {
    margin-top: 6px;
    font-size: .62rem;
    color: var(--muted);
    font-weight: 600;
}

.status-card-icon {
    color: var(--muted);
    font-size: .95rem;
    margin-bottom: 8px;
}

.status-card-label {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.status-card-value {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.status-card.is-online .status-card-value { color: var(--brand-ink); }
html[data-theme="dark"] .status-card.is-online .status-card-value { color: var(--brand); }
.status-card.is-offline .status-card-value { color: var(--text); }
.status-card.is-isolated .status-card-value { color: var(--danger); }

.stat-card {
    text-align: center;
    padding: clamp(12px, 3.2vw, 16px) clamp(8px, 2vw, 12px);
}

.stat-card .value {
    font-size: clamp(1.15rem, 5vw, 1.4rem);
    font-weight: 700;
    color: var(--primary-text);
    line-height: 1.2;
}
.stat-card .label {
    font-size: clamp(.65rem, 2.8vw, .74rem);
    color: var(--muted);
    margin-top: 3px;
}
.stat-card.warning .value { color: var(--warning); }
.stat-card.danger .value { color: var(--danger); }
.stat-card.success .value { color: var(--brand-ink); }
html[data-theme="dark"] .stat-card.success .value { color: var(--brand); }
.stat-card i {
    font-size: clamp(1rem, 4vw, 1.2rem);
    color: var(--primary-text);
    margin-bottom: 4px;
    display: block;
}

.home-secondary-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.home-action-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    padding: 12px 14px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(248,250,252,.96) 100%);
    color: var(--text);
    font-family: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .04),
        0 8px 20px rgba(15, 23, 42, .06);
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
    -webkit-tap-highlight-color: transparent;
}

.home-action-card:active {
    transform: scale(.985);
    box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
}

.home-action-ico {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #edfc02;
    color: #111827;
    font-size: 1rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}

.home-action-card-cs .home-action-ico {
    background: #111827;
    color: #edfc02;
}

.home-action-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.home-action-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .92rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.home-action-sub {
    font-size: .72rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: .01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-action-arrow {
    color: var(--muted);
    font-size: .72rem;
    opacity: .7;
}

/* Legacy classes kept for badge updates */
.home-msg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: .84rem;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    line-height: 1.25;
}

.home-msg-btn span {
    overflow-wrap: anywhere;
}

.home-msg-btn i { color: var(--primary-text); }
.home-msg-btn-ghost {
    background: transparent;
}
.home-msg-btn:active { opacity: .88; }

/* Quick actions grid */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(8px, 2vw, 12px);
    margin-bottom: 0;
}
.quick-grid-1 { grid-template-columns: 1fr; }
.quick-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.quick-action {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: clamp(10px, 2.5vw, 12px);
    padding: clamp(14px, 3.5vw, 18px) clamp(8px, 2vw, 12px);
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    min-height: 88px;
    width: 100%;
    font-family: inherit;
}
.quick-action:active { background: var(--primary-soft); }
.quick-action i {
    font-size: clamp(1.3rem, 5vw, 1.55rem);
    color: var(--primary-text);
}
.quick-action .qa-label {
    font-size: clamp(.74rem, 3.1vw, .84rem);
    font-weight: 600;
    color: var(--muted);
    line-height: 1.25;
}
.quick-action .qa-badge,
.home-msg-btn .qa-badge,
.home-action-title .qa-badge {
    position: relative;
    top: -1px;
    background: var(--danger);
    color: #fff;
    font-size: .62rem;
    border-radius: 10px;
    padding: 1px 6px;
    margin-left: 4px;
}

#tabHome .section-title {
    margin-top: 2px;
    margin-bottom: 8px;
}

.home-alerts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.home-alert {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid transparent;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    position: relative;
}

.home-alert-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: rgba(254, 0, 0, .10);
    color: var(--accent-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: .78rem;
    padding: 0;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}

.home-alert-close:active {
    transform: scale(.94);
    background: rgba(254, 0, 0, .18);
}

.home-alert-billing .home-alert-top {
    padding-right: 28px;
}

html[data-theme="dark"] .home-alert-close {
    background: rgba(248, 113, 113, .16);
    color: var(--accent-dark);
}

.home-alert-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .95rem;
}

.home-alert-body { min-width: 0; }

.home-alert-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 10px;
    margin-bottom: 4px;
}

.home-alert-type {
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.home-alert-exp {
    font-size: .65rem;
    opacity: .85;
}

.home-alert-title {
    font-size: clamp(.86rem, 3.4vw, .95rem);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.home-alert-text {
    font-size: clamp(.78rem, 3.1vw, .85rem);
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    opacity: .95;
}

.home-alert-info {
    background: var(--primary-soft);
    border-color: var(--alert-info-border);
    color: var(--primary-text);
}
.home-alert-info .home-alert-icon {
    background: var(--brand);
    color: var(--brand-ink);
}

.home-alert-danger {
    background: var(--accent-soft);
    border-color: var(--alert-danger-border);
    color: var(--accent-dark);
}
.home-alert-danger .home-alert-icon {
    background: var(--accent);
    color: #fff;
}

.home-alert-billing .home-alert-pay-btn {
    margin-top: 10px;
}

@media (max-width: 360px) {
    .app-content { padding-left: 10px; padding-right: 10px; }
    .billing-card .bc-meta {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    .billing-card .bc-due-value { text-align: left; }
    .quick-grid-2 { grid-template-columns: 1fr; }
}

@media (min-width: 480px) {
    .home-layout { gap: 14px; }
    .quick-action { min-height: 96px; }
}

@media (min-width: 768px) {
    .app-content { padding-left: 20px; padding-right: 20px; }
    .home-layout { gap: 16px; }
    .stats-row { gap: 14px; }
    .quick-grid { gap: 14px; }
}

.section-title {
    font-size: .9rem;
    color: var(--primary-text);
    margin: 16px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.section-title:first-child { margin-top: 0; }

.item-card {
    background: var(--surface);
    color: var(--text);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.item-card .card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.item-card .card-title { font-weight: 700; font-size: .92rem; }
.item-card .card-code { font-size: .78rem; color: var(--muted); font-family: monospace; }
.item-card .card-subject { font-size: .82rem; color: var(--text-secondary); margin-top: 4px; }
.item-card .card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.item-card .card-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
.item-card .card-actions-duo { grid-template-columns: 1fr 1fr; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: .68rem;
    font-weight: 600;
}

.badge-success { background: var(--primary-soft); color: var(--primary-text); }
.badge-danger { background: var(--accent-soft); color: var(--accent-dark); }
.badge-primary { background: var(--primary-soft); color: var(--primary-text); }
.badge-warning { background: var(--accent-soft); color: var(--accent-dark); }
.badge-info { background: var(--primary-soft); color: var(--primary-text); }
.badge-secondary { background: var(--badge-secondary-bg); color: var(--badge-secondary-fg); }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; opacity: .4; display: block; }

.form-card {
    background: var(--surface);
    color: var(--text);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow);
}

/* Profile */
.detail-profile {
    background: var(--surface);
    color: var(--text);
    border-radius: 14px;
    padding: 20px 16px;
    text-align: center;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}
.detail-profile .avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: var(--brand);
    color: var(--brand-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
}
.detail-profile h2 { font-size: 1.1rem; margin-bottom: 4px; }
.detail-profile .code { font-family: monospace; color: var(--muted); font-size: .85rem; }

.detail-section {
    background: var(--surface);
    color: var(--text);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}
.detail-section h3 { font-size: .85rem; color: var(--primary-text); margin-bottom: 10px; }

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: .85rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .label { color: var(--muted); }
.detail-row .value { font-weight: 600; text-align: right; max-width: 60%; word-break: break-word; }

/* history — metric cards */
.history-metric-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.history-metric {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    color: var(--text);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.history-metric::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--muted);
}

.history-metric-ok::before { background: var(--brand); }
.history-metric-warn::before { background: var(--warning); }
.history-metric-bad::before { background: var(--danger); }

.history-metric-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.history-metric-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--primary-soft);
    color: var(--primary-text);
    font-size: .95rem;
}

.history-metric-ok .history-metric-icon {
    background: rgba(237, 252, 2, .22);
    color: var(--brand-ink);
}
html[data-theme="dark"] .history-metric-ok .history-metric-icon {
    background: rgba(237, 252, 2, .16);
    color: var(--brand);
}
.history-metric-warn .history-metric-icon {
    background: var(--accent-soft);
    color: var(--accent);
}
.history-metric-bad .history-metric-icon {
    background: var(--accent-soft);
    color: var(--danger);
}

.history-metric-head {
    min-width: 0;
    flex: 1;
}

.history-metric-code {
    font-size: .72rem;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .01em;
    overflow-wrap: anywhere;
    line-height: 1.3;
}

.history-metric-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
}

.history-metric-method {
    font-size: .64rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.history-metric-amount {
    margin-top: 8px;
    font-size: .95rem;
    font-weight: 750;
    letter-spacing: -.01em;
    line-height: 1.2;
    color: var(--text);
}

.history-metric-ok .history-metric-amount { color: var(--brand-ink); }
html[data-theme="dark"] .history-metric-ok .history-metric-amount { color: var(--brand); }
.history-metric-warn .history-metric-amount { color: var(--text); }
.history-metric-bad .history-metric-amount { color: var(--danger); }

.history-metric-date {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .68rem;
    color: var(--muted);
}

.history-metric-date i {
    font-size: .7rem;
    opacity: .85;
}

/* legacy list fallback */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: .82rem;
    color: var(--text);
}
.history-item:last-child { border-bottom: none; }
.history-item .h-date { color: var(--muted); font-size: .72rem; }
.history-item .h-amount { font-weight: 700; }
.history-item .h-amount.plus { color: var(--brand-ink); }
html[data-theme="dark"] .history-item .h-amount.plus { color: var(--brand); }
.history-item .h-amount.minus { color: var(--danger); }

.history-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
}
.history-pagination .btn {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    border-radius: 10px;
}
.history-pagination .btn[disabled] {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}
.history-page-info {
    font-size: .75rem;
    color: var(--muted);
    white-space: nowrap;
    font-weight: 600;
}

html[data-theme="dark"] .history-metric {
    box-shadow: none;
    background: var(--surface);
}

html[data-theme="dark"] .history-metric-ok .history-metric-icon {
    background: rgba(237, 252, 2, .14);
}

html[data-theme="dark"] .history-metric-ok .history-metric-icon {
    color: var(--brand);
}

@media (min-width: 520px) {
    .history-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .history-pagination {
        grid-column: 1 / -1;
    }
}

/* inbox */
.inbox-item {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
}
.inbox-item.unread { border-left: 4px solid var(--primary); background: var(--primary-soft); }
.inbox-item .i-title { font-weight: 700; font-size: .88rem; }
.inbox-item .i-date { font-size: .7rem; color: var(--muted); margin-top: 2px; }
.inbox-item .i-body { font-size: .82rem; color: var(--text-secondary); margin-top: 6px; }

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 0 14px calc(10px + var(--safe-bottom));
    pointer-events: none;
    background: transparent;
    border: none;
    box-shadow: none;
    height: auto;
}

.bottom-nav-inner {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 8px 8px;
    border-radius: 22px;
    background: rgba(255, 255, 255, .86);
    border: 1px solid rgba(226, 232, 240, .95);
    box-shadow:
        0 10px 30px rgba(15, 23, 42, .10),
        0 2px 8px rgba(15, 23, 42, .04);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: none;
    background: transparent;
    color: var(--nav-inactive);
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    padding: 4px 2px;
    min-width: 0;
    border-radius: 16px;
    transition: color .22s ease, transform .18s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.nav-tab:last-child { border-right: none; }

.nav-ico {
    width: 42px;
    height: 32px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .22s ease, box-shadow .22s ease, transform .18s ease;
}

.nav-tab i {
    font-size: 1.05rem;
    line-height: 1;
    transition: transform .22s ease, color .22s ease;
}

.nav-label {
    line-height: 1.1;
    white-space: nowrap;
    transition: color .22s ease, opacity .22s ease;
}

.nav-tab:active {
    transform: scale(.96);
}

.nav-tab.active {
    color: var(--brand-ink);
    font-weight: 700;
    background: transparent;
    border: none;
    box-shadow: none;
}

.nav-tab.active .nav-ico {
    background: var(--brand);
    color: var(--brand-ink);
    box-shadow: 0 6px 14px rgba(237, 252, 2, .38);
}

.nav-tab.active i {
    color: var(--brand-ink);
    transform: translateY(-0.5px) scale(1.02);
}

.nav-tab.active .nav-label {
    color: var(--brand-ink);
}

.nav-tab.active + .nav-tab {
    border-left: none;
}

html[data-theme="dark"] .bottom-nav-inner {
    background: rgba(17, 24, 39, .88);
    border-color: rgba(51, 65, 85, .9);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, .45),
        0 2px 8px rgba(0, 0, 0, .25),
        inset 0 1px 0 rgba(255, 255, 255, .04);
}

html[data-theme="dark"] .nav-tab.active {
    color: var(--brand);
}

html[data-theme="dark"] .nav-tab.active .nav-label {
    color: var(--brand);
}

html[data-theme="dark"] .nav-tab.active .nav-ico {
    background: var(--brand);
    color: var(--brand-ink);
    box-shadow: 0 6px 16px rgba(237, 252, 2, .28);
}

html[data-theme="dark"] .bottom-nav {
    box-shadow: none;
}

html[data-theme="dark"] .nav-tab.active {
    box-shadow: none;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-strong);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Popup iklan Beranda */
.ad-popup {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.ad-popup.hidden { display: none !important; }
.ad-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
}
.ad-popup-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    animation: adPopIn .28s ease;
}
@keyframes adPopIn {
    from { opacity: 0; transform: scale(.92) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.ad-popup-media {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.ad-popup-media img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    vertical-align: middle;
}
.ad-popup-media a {
    display: block;
    cursor: pointer;
}
.ad-popup-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
    padding: 10px 20px;
    border: none;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.ad-popup-close:active {
    transform: scale(.96);
}
.ad-popup-close i {
    font-size: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.swal2-container { z-index: 20002 !important; }
.swal2-popup.swal2-toast { font-size: 0.9rem; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.swal2-confirm {
    background-color: #edfc02 !important;
    color: #111827 !important;
    border: none !important;
    font-weight: 800 !important;
}
.swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(237, 252, 2, .35) !important;
}

.payment-method-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
}
.payment-method-item:active { background: var(--primary-soft); }
.payment-method-item .pm-name { font-weight: 600; font-size: .88rem; }
.payment-method-item .pm-name strong { font-weight: 800; }
.payment-method-item .pm-fee { font-size: .72rem; color: var(--muted); }

.host-list { margin-top: 4px; }
.host-item {
    background: var(--primary-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
}
.host-item:last-child { margin-bottom: 0; }
.host-item .host-name { font-weight: 600; font-size: .88rem; color: var(--text); }
.host-item .host-meta { font-size: .72rem; color: var(--muted); margin-top: 2px; word-break: break-all; }

.wifi-metrics {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.wifi-ssid-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

.wifi-ssid-chip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 8px;
    row-gap: 2px;
    width: 100%;
    min-width: 0;
    background: var(--primary-soft);
    color: var(--primary-text);
    border: 1px solid var(--ssid-border);
    border-radius: 14px;
    padding: 10px 12px;
    font-size: .72rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.25;
    text-align: left;
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.wifi-ssid-chip:active { transform: scale(.98); }
.wifi-ssid-main {
    grid-column: 1;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.wifi-ssid-title {
    font-size: .8rem;
    font-weight: 800;
    white-space: nowrap;
}
.wifi-ssid-name {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    font-size: .68rem;
    font-weight: 600;
    opacity: .85;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wifi-ssid-count {
    grid-column: 2;
    grid-row: 1;
    font-style: normal;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 800;
    color: #fff;
    padding: 0 6px;
    justify-self: end;
}
.wifi-ssid-chip.ssid1 {
    background: #111827;
    color: #edfc02;
    border-color: #111827;
    opacity: .92;
}
.wifi-ssid-chip.ssid5 {
    background: #edfc02;
    color: #111827;
    border-color: #edfc02;
    opacity: .92;
}
.wifi-ssid-chip.ssid1.active {
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(237, 252, 2, .35);
    border-color: #edfc02;
}
.wifi-ssid-chip.ssid5.active {
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(17, 24, 39, .2);
    border-color: #111827;
}
.wifi-ssid-chip.ssid1 .wifi-ssid-count {
    background: #000;
    color: #edfc02;
}
.wifi-ssid-chip.ssid5 .wifi-ssid-count {
    background: #111827;
    color: #edfc02;
}

.wifi-ssid-chip.is-disabled,
.wifi-ssid-chip:disabled {
    opacity: .42;
    cursor: not-allowed;
    box-shadow: none;
    filter: grayscale(.35);
    pointer-events: none;
}
.wifi-ssid-chip.is-disabled .wifi-ssid-count,
.wifi-ssid-chip:disabled .wifi-ssid-count {
    background: var(--muted);
}
.wifi-ssid-hint {
    margin-top: 6px;
    font-size: .68rem;
    color: var(--muted);
}

.wifi-form-section {
    margin: 0 0 8px;
    font-size: .9rem;
}
.wifi-form-section-gap { margin-top: 12px; }

.wifi-edit-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.wifi-edit-card {
    border-radius: 14px;
    padding: 14px;
    border: 1px solid transparent;
}
.wifi-edit-24 + .wifi-edit-5 {
    position: relative;
    margin-top: 4px;
}
.wifi-edit-24 + .wifi-edit-5::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border) 15%, var(--border) 85%, transparent);
}
.wifi-edit-card .form-group:last-child { margin-bottom: 0; }
.wifi-edit-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    font-weight: 800;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,.08);
}
.wifi-edit-24 {
    background: #111827;
    border-color: #000;
    color: #edfc02;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
}
.wifi-edit-24 .wifi-edit-card-head {
    color: #edfc02;
    border-bottom-color: rgba(237, 252, 2, .28);
}
.wifi-edit-24 label { color: #edfc02; }
.wifi-edit-24 input {
    background: #fff;
    border-color: #fff;
    color: #212529;
}
.wifi-edit-24 input:focus {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .35);
}
.wifi-edit-24 input::placeholder { color: #9aa3ab; }
.wifi-edit-5 {
    background: #0092e7;
    border-color: #0092e7;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 146, 231, .28);
}
.wifi-edit-5 .wifi-edit-card-head {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, .28);
}
.wifi-edit-5 label { color: rgba(255, 255, 255, .95); }
.wifi-edit-5 input {
    background: #fff;
    border-color: #fff;
    color: #212529;
}
.wifi-edit-5 input:focus {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .35);
}
.wifi-edit-5 input::placeholder { color: #9aa3ab; }
.wifi-edit-5.is-disabled {
    opacity: .55;
    filter: grayscale(.4);
    pointer-events: none;
    position: relative;
}
.wifi-edit-5.is-disabled::after {
    content: 'WiFi 5G tidak tersedia di modem ini';
    display: block;
    margin-top: 10px;
    font-size: .72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .9);
}

.wifi-host-group-text {
    min-width: 0;
    flex: 1;
}

@media (max-width: 360px) {
    .wifi-ssid-chip { padding: 9px 10px; }
    .wifi-ssid-title { font-size: .74rem; }
    .wifi-ssid-name { font-size: .64rem; }
}

@media (min-width: 480px) {
    .wifi-ssid-chip { padding: 12px 14px; }
    .wifi-ssid-title { font-size: .85rem; }
    .wifi-ssid-name { font-size: .72rem; }
}
.wifi-metric-card {
    border-radius: 14px;
    padding: 14px;
    border: 1px solid transparent;
    text-align: left;
    width: 100%;
}

.wifi-metric-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.wifi-metric-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: .9rem;
}

.wifi-metric-count {
    min-width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
}

.wifi-metric-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.wifi-metric-total-label {
    font-size: .65rem;
    font-weight: 600;
    color: var(--primary-text);
    opacity: .9;
    line-height: 1.1;
    white-space: nowrap;
}

.wifi-metric-hosts {
    background: linear-gradient(160deg, #edfc02 0%, #f5ff66 100%);
    border-color: #111827;
    color: #111827;
}

.wifi-metric-hosts .wifi-metric-count {
    background: #111827;
    color: #edfc02;
}
.wifi-metric-hosts.filter-ssid1 {
    border-color: #111827;
    background: linear-gradient(160deg, #111827 0%, #1f2937 100%);
    color: #edfc02;
}
.wifi-metric-hosts.filter-ssid1 .wifi-metric-count {
    background: #000;
    color: #edfc02;
}
.wifi-metric-hosts.filter-ssid1 .wifi-metric-total-label { color: #edfc02; }
.wifi-metric-hosts.filter-ssid1 .wifi-metric-title { color: #edfc02; }
.wifi-metric-hosts.filter-ssid5 .wifi-metric-total-label,
.wifi-metric-hosts.filter-ssid5 .wifi-metric-title {
    color: #111827;
}

.wifi-host-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.wifi-host-group {
    border-radius: 12px;
    padding: 10px;
    border: 1px solid transparent;
}

.wifi-host-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.wifi-host-group-label {
    font-size: .78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wifi-host-group-ssid {
    font-size: .7rem;
    opacity: .85;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.wifi-host-group-count {
    min-width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .85rem;
    color: #fff;
}

.wifi-host-ssid1 {
    background: #111827;
    border-color: #000;
    color: #edfc02;
}

.wifi-host-ssid1 .wifi-host-group-count {
    background: #000;
    color: #edfc02;
}
.wifi-host-ssid1 .host-item {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(237, 252, 2, .2);
    color: #f8fafc;
}
.wifi-host-ssid1 .host-item .host-name { color: #edfc02; }
.wifi-host-ssid1 .host-item .host-meta { color: #cbd5e1; }

.wifi-host-ssid5 {
    background: rgba(17, 24, 39, .08);
    border-color: rgba(17, 24, 39, .22);
    color: #111827;
}

.wifi-host-ssid5 .wifi-host-group-count {
    background: #111827;
    color: #edfc02;
}
.wifi-host-ssid5 .host-item {
    background: #fff;
    border-color: rgba(17, 24, 39, .12);
    color: #111827;
}
.wifi-host-ssid5 .host-item .host-name { color: #111827; }
.wifi-host-ssid5 .host-item .host-meta { color: #64748b; }
.wifi-host-other {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text-secondary);
}

.wifi-host-other .wifi-host-group-count { background: var(--muted); }

.wifi-metric-empty {
    margin-top: 4px;
    font-size: .78rem;
    opacity: .8;
}
.wifi-metric-action {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    border-color: var(--brand);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .22);
}

.wifi-metric-action:active {
    transform: scale(.99);
    opacity: .95;
}

.wifi-metric-action .wifi-metric-title { color: #fff; }
.wifi-metric-chevron { opacity: .85; font-size: .85rem; }
.wifi-metric-hint {
    margin-top: 8px;
    font-size: .72rem;
    color: rgba(255,255,255,.88);
    line-height: 1.35;
}

.va-display {
    background: linear-gradient(135deg, #111827, #1f2937);
    color: #fff;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin: 12px 0;
    border: 1px solid rgba(237, 252, 2, .35);
}
.va-display .va-number {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 8px 0;
}

.payment-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.payment-tab {
    flex: 1;
    min-width: 80px;
    padding: 8px 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.payment-tab.active {
    background: var(--brand);
    color: var(--brand-ink);
    border-color: var(--brand);
}

/* ===== Dark mode polish ===== */
html[data-theme="dark"] .home-msg-btn,
html[data-theme="dark"] .item-card,
html[data-theme="dark"] .detail-profile,
html[data-theme="dark"] .detail-section,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .inbox-item {
    box-shadow: none;
}

html[data-theme="dark"] .status-card {
    background: linear-gradient(180deg, #1a2332 0%, #111827 100%);
    border-color: rgba(255, 255, 255, .10);
}

html[data-theme="dark"] .status-card-arrow {
    color: #94a3b8;
}

/* Dark: action cards premium & ikon konsisten */
html[data-theme="dark"] .home-action-card {
    background: linear-gradient(145deg, #1e293b 0%, #111827 55%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow:
        0 0 0 1px rgba(237, 252, 2, .04),
        0 8px 22px rgba(0, 0, 0, .35);
}

html[data-theme="dark"] .home-action-card:active {
    box-shadow:
        0 0 0 1px rgba(237, 252, 2, .10),
        0 4px 14px rgba(0, 0, 0, .4);
}

html[data-theme="dark"] .home-action-ico,
html[data-theme="dark"] .home-action-card-cs .home-action-ico {
    background: #edfc02;
    color: #111827;
    border: none;
    box-shadow:
        0 4px 12px rgba(237, 252, 2, .22),
        inset 0 1px 0 rgba(255, 255, 255, .45);
}

html[data-theme="dark"] .home-action-title {
    color: #f8fafc;
}

html[data-theme="dark"] .home-action-sub {
    color: #94a3b8;
}

html[data-theme="dark"] .home-action-arrow {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .10);
    color: #edfc02;
    opacity: 1;
    font-size: .65rem;
}

html[data-theme="dark"] .theme-toggle-track {
    background: var(--surface-2);
    border-color: var(--border);
}

html[data-theme="dark"] .bottom-nav {
    box-shadow: none;
}

html[data-theme="dark"] .nav-tab.active {
    box-shadow: none;
}

/* Header: logo hitam → putih hanya di dark mode */
html[data-theme="dark"] .header-logo {
    filter: invert(1) brightness(1.05);
}

html[data-theme="dark"] .home-alert {
    box-shadow: none;
}

html[data-theme="dark"] .skeleton,
html[data-theme="dark"] .sk {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%) !important;
    background-size: 200% 100% !important;
}

html[data-theme="dark"] .swal2-popup {
    background: var(--swal-bg) !important;
    color: var(--swal-text) !important;
}

html[data-theme="dark"] .swal2-title,
html[data-theme="dark"] .swal2-html-container,
html[data-theme="dark"] .swal2-content {
    color: var(--swal-text) !important;
}

html[data-theme="dark"] .swal2-icon.swal2-question {
    border-color: var(--brand) !important;
    color: var(--brand) !important;
}

html[data-theme="dark"] .wifi-edit-24 input,
html[data-theme="dark"] .wifi-edit-5 input {
    background: #fff;
    color: #0f172a;
}

html[data-theme="dark"] .modal-sheet {
    border-top: 1px solid var(--border);
}

html[data-theme="dark"] .payment-method-item:active,
html[data-theme="dark"] .quick-action:active,
html[data-theme="dark"] .home-msg-btn:active {
    background: var(--surface-2);
}

html[data-theme="dark"] .bc-remaining.ok { color: var(--brand); }
html[data-theme="dark"] .bc-remaining.soon,
html[data-theme="dark"] .bc-remaining.overdue { color: var(--accent); }

/* WiFi devices popup (Beranda) */
.wifi-devices-summary {
    text-align: center;
    padding: 12px 10px 16px;
    margin-bottom: 10px;
    border-radius: 14px;
    background: var(--primary-soft);
    border: 1px solid var(--border);
}

.wifi-devices-summary-count {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-text);
    line-height: 1.1;
}

.wifi-devices-summary-label {
    margin-top: 2px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--muted);
}

.wifi-devices-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wifi-device-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.wifi-device-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary-text);
    font-size: 1rem;
}

.wifi-device-name {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
    overflow-wrap: anywhere;
}

.wifi-device-meta {
    margin-top: 3px;
    font-size: .72rem;
    color: var(--muted);
    word-break: break-all;
}

.wifi-device-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

html[data-theme="dark"] .status-card-action:active {
    background: var(--surface-2);
}

/* Modem status / uptime popup */
.modem-status-hero {
    text-align: center;
    padding: 16px 12px;
    border-radius: 16px;
    margin-bottom: 12px;
    background: var(--primary-soft);
    border: 1px solid var(--border);
}
.modem-status-hero.modem-status-online {
    background: rgba(237, 252, 2, .16);
    border-color: rgba(237, 252, 2, .35);
}
.modem-status-hero.modem-status-offline,
.modem-status-hero.modem-status-isolated {
    background: var(--accent-soft);
    border-color: var(--alert-danger-border);
}
.modem-status-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}
.modem-status-value {
    margin-top: 4px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
}
.modem-status-online .modem-status-value { color: var(--brand-ink); }
html[data-theme="dark"] .modem-status-online .modem-status-value { color: var(--brand); }
.modem-status-offline .modem-status-value,
.modem-status-isolated .modem-status-value { color: var(--danger); }

.modem-uptime-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.modem-uptime-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
}
.modem-uptime-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary-text);
}
.modem-uptime-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
}
.modem-uptime-serial {
    margin-top: 2px;
    font-size: .7rem;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-all;
}
.modem-uptime-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    font-size: .78rem;
}
.modem-uptime-key { color: var(--muted); font-weight: 600; }
.modem-uptime-val { color: var(--text); font-weight: 700; text-align: right; }

/* ===== Readability audit: yellow brand contrast ===== */
/* Kuning #edfc02 hanya aman sebagai fill; teks di atasnya harus gelap */
.btn-primary,
.btn-success,
.member-pay-btn,
.billing-card .bc-pay-btn,
.payment-tab.active,
.nav-tab.active .nav-ico,
.nav-tab.active .nav-ico i,
.theme-toggle:not(.is-dark) .theme-opt-light,
.theme-toggle.is-dark .theme-opt-dark,
.detail-profile .avatar,
.member-badge-ok,
.swal2-confirm {
    color: #111827 !important;
}

/* Count badge gelap di area kuning: teks kuning */
.wifi-ssid-chip.ssid5 .wifi-ssid-count,
.wifi-metric-hosts:not(.filter-ssid1) .wifi-metric-count,
.wifi-host-ssid5 .wifi-host-group-count {
    background: #111827 !important;
    color: #edfc02 !important;
}

/* Dark: badge Aktif di kartu kuning = bg gelap + teks kuning */
html[data-theme="dark"] .member-badge.member-badge-ok {
    background: #111827 !important;
    color: #edfc02 !important;
    border-color: #111827 !important;
}

/* Login: kartu kuning → tombol gelap + teks kuning (light & dark) */
.login-card .login-submit.btn-primary,
.login-card .login-submit.btn-primary i {
    background: #111827 !important;
    color: #edfc02 !important;
}

.btn-primary i,
.btn-success i,
.member-pay-btn i,
.billing-card .bc-pay-btn i {
    color: #111827 !important;
}

/* Di mode terang: jangan pakai kuning sebagai warna teks di background putih */
:root:not([data-theme="dark"]) .section-title,
:root:not([data-theme="dark"]) .modal-header h2,
:root:not([data-theme="dark"]) .detail-section h3,
:root:not([data-theme="dark"]) .home-msg-btn i,
:root:not([data-theme="dark"]) .quick-action i,
:root:not([data-theme="dark"]) .login-hint i,
:root:not([data-theme="dark"]) .filter-hint i,
:root:not([data-theme="dark"]) .stat-card .value,
:root:not([data-theme="dark"]) .stat-card i,
:root:not([data-theme="dark"]) .status-card.is-online .status-card-value,
:root:not([data-theme="dark"]) .nav-tab.active,
:root:not([data-theme="dark"]) .nav-tab.active .nav-label {
    color: #111827 !important;
}

/* Mode gelap: teks aksen kuning di surface gelap */
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .modal-header h2,
html[data-theme="dark"] .detail-section h3,
html[data-theme="dark"] .home-msg-btn i,
html[data-theme="dark"] .quick-action i,
html[data-theme="dark"] .status-card.is-online .status-card-value,
html[data-theme="dark"] .nav-tab.active,
html[data-theme="dark"] .nav-tab.active .nav-label,
html[data-theme="dark"] .wifi-devices-summary-count,
html[data-theme="dark"] .modem-status-online .modem-status-value {
    color: #edfc02 !important;
}

html[data-theme="dark"] .wifi-device-icon,
html[data-theme="dark"] .modem-uptime-icon,
html[data-theme="dark"] .history-metric-icon {
    color: #edfc02 !important;
}

html[data-theme="dark"] .badge-success,
html[data-theme="dark"] .badge-primary,
html[data-theme="dark"] .badge-info {
    background: #2a2f14 !important;
    color: #edfc02 !important;
}

/* Soft yellow / brand yellow: teks gelap */
:root:not([data-theme="dark"]) .wifi-ssid-chip.ssid5,
:root:not([data-theme="dark"]) .wifi-metric-hosts:not(.filter-ssid1),
:root:not([data-theme="dark"]) .wifi-host-ssid5,
:root:not([data-theme="dark"]) .home-alert-info,
:root:not([data-theme="dark"]) .badge-success,
:root:not([data-theme="dark"]) .badge-primary,
:root:not([data-theme="dark"]) .badge-info,
:root:not([data-theme="dark"]) .wifi-devices-summary-count {
    color: #111827 !important;
}

html[data-theme="dark"] .wifi-ssid-chip.ssid5,
html[data-theme="dark"] .wifi-metric-hosts:not(.filter-ssid1),
html[data-theme="dark"] .wifi-host-ssid5 {
    color: #111827 !important;
}

html[data-theme="dark"] .wifi-ssid-chip.ssid5,
html[data-theme="dark"] .wifi-metric-hosts:not(.filter-ssid1) {
    background: #edfc02 !important;
    border-color: #111827 !important;
}

html[data-theme="dark"] .wifi-host-ssid5 {
    background: rgba(17, 24, 39, .10) !important;
    border-color: rgba(17, 24, 39, .25) !important;
}

html[data-theme="dark"] .wifi-host-ssid5 .host-item {
    background: #fff !important;
    color: #111827 !important;
}

html[data-theme="dark"] .wifi-metric-hosts:not(.filter-ssid1) .wifi-metric-count,
html[data-theme="dark"] .wifi-host-ssid5 .wifi-host-group-count,
html[data-theme="dark"] .wifi-ssid-chip.ssid5 .wifi-ssid-count {
    background: #111827 !important;
    color: #edfc02 !important;
}

/* WiFi 2.4G: hitam + tulisan kuning */
.wifi-ssid-chip.ssid1,
.wifi-ssid-chip.ssid1 .wifi-ssid-title,
.wifi-ssid-chip.ssid1 .wifi-ssid-name,
.wifi-ssid-chip.ssid1 .wifi-ssid-count,
.wifi-metric-hosts.filter-ssid1,
.wifi-metric-hosts.filter-ssid1 .wifi-metric-title,
.wifi-metric-hosts.filter-ssid1 .wifi-metric-total-label,
.wifi-metric-hosts.filter-ssid1 .wifi-metric-count,
.wifi-host-ssid1,
.wifi-host-ssid1 .wifi-host-group-label,
.wifi-host-ssid1 .wifi-host-group-count,
.wifi-host-ssid1 .host-item .host-name,
.wifi-edit-24,
.wifi-edit-24 .wifi-edit-card-head,
.wifi-edit-24 label {
    color: #edfc02 !important;
}

.wifi-ssid-chip.ssid1 .wifi-ssid-count,
.wifi-metric-hosts.filter-ssid1 .wifi-metric-count,
.wifi-host-ssid1 .wifi-host-group-count {
    background: #000 !important;
}

/* Spinner tetap terbaca */
.spinner {
    border-color: var(--border);
    border-top-color: #111827;
}
html[data-theme="dark"] .spinner {
    border-top-color: #edfc02;
}

/* Empty state & muted text tetap soft tapi cukup kontras */
.empty-state { color: var(--muted); }
