/* ============================================================================
   EcoBank Sampah Digital v2 — Premium Eco-Fintech Design System
   Responsif Otomatis: PC Desktop Grid & Mobile-First Android App Shell + Landing
   ============================================================================ */

:root {
    --eco-primary: #059669;
    --eco-primary-hover: #047857;
    --eco-dark: #064e3b;
    --eco-accent: #10b981;
    --eco-soft: #ecfdf5;
    --eco-soft-strong: #d1fae5;
    --eco-bg: #f3f7f5;
    --eco-surface: #ffffff;
    --eco-border: #e2ece7;
    --eco-text: #0f172a;
    --eco-muted: #64748b;
    --sidebar-width: 266px;
    --sidebar-collapsed: 76px;
    --navbar-height: 66px;
    --mobile-nav-height: 68px;
    --radius-card: 18px;
    --shadow-card: 0 4px 20px rgba(6, 78, 59, 0.055);
    --shadow-hover: 0 10px 28px rgba(6, 78, 59, 0.11);
}

[data-theme="dark"] {
    --eco-bg: #0b1411;
    --eco-surface: #12201b;
    --eco-border: #1e332b;
    --eco-text: #f1f5f9;
    --eco-muted: #94a3b8;
    --eco-soft: rgba(16, 185, 129, 0.14);
    --eco-soft-strong: rgba(16, 185, 129, 0.24);
    --shadow-card: 0 6px 20px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--eco-bg);
    color: var(--eco-text);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

.fw-extrabold { font-weight: 800 !important; }

[data-theme="dark"] .card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .offcanvas {
    background-color: var(--eco-surface);
    color: var(--eco-text);
    border-color: var(--eco-border);
}
[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--eco-text);
    --bs-table-border-color: var(--eco-border);
}
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .input-group-text {
    background-color: #182a23;
    border-color: var(--eco-border);
    color: var(--eco-text);
}
[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-white {
    background-color: #182a23 !important;
    color: var(--eco-text) !important;
}

/* ============================================================================
   Buttons & Utilities
   ============================================================================ */
.btn-eco {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #fff;
    border: none;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.btn-eco:hover, .btn-eco:focus {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(5, 150, 105, 0.30);
}
.shadow-eco { box-shadow: 0 10px 24px rgba(5, 150, 105, 0.25); }

.btn-eco-soft {
    background: var(--eco-soft-strong);
    color: var(--eco-primary-hover);
    border: none;
    font-weight: 600;
}
.btn-eco-soft:hover {
    background: var(--eco-primary);
    color: #fff;
}

.btn-white {
    background: #fff;
    color: #0f172a;
}
.btn-white:hover { background: #f8fafc; }

.btn-white-glass {
    background: rgba(255, 255, 255, 0.88);
    color: #064e3b;
    border: 1px solid #d1fae5;
    backdrop-filter: blur(8px);
}
.btn-white-glass:hover {
    background: #ffffff;
    color: #047857;
    transform: translateY(-1px);
}

.text-gradient-eco {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================================================
   Landing Page Styles
   ============================================================================ */
.landing-body {
    background: #ffffff;
    color: #0f172a;
}

.landing-navbar {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226, 236, 231, 0.9);
    padding: 12px 0;
}

.landing-hero {
    padding: 56px 0 64px;
    background:
        radial-gradient(circle at 85% 15%, rgba(16, 185, 129, 0.18), transparent 42%),
        radial-gradient(circle at 10% 85%, rgba(5, 150, 105, 0.12), transparent 40%),
        linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #bbf7d0;
    color: #047857;
    font-size: 12.5px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.08);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25);
}

.hero-title {
    font-size: clamp(2rem, 4.2vw, 3.1rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #064e3b;
}

.hero-lead {
    font-size: 16px;
    line-height: 1.68;
    color: #475569;
}

.chip-gold {
    width: 34px;
    height: 24px;
    border-radius: 6px;
    background: linear-gradient(135deg, #fde047, #eab308);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45);
}

.feature-card {
    background: #ffffff;
    border: 1px solid #e2ece7;
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: #a7f3d0;
}
.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
}

.bg-eco-tint {
    background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
}

.step-card {
    background: #ffffff;
    border: 1px solid #d1fae5;
    border-radius: 20px;
    padding: 26px;
    box-shadow: var(--shadow-card);
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    font-weight: 800;
    font-size: 16px;
}

.price-tile {
    background: #ffffff;
    border: 1px solid #e2ece7;
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow-card);
    transition: transform .18s ease, border-color .18s ease;
}
.price-tile:hover {
    transform: translateY(-3px);
    border-color: #34d399;
}

.landing-footer {
    background: linear-gradient(135deg, #022c22 0%, #064e3b 100%);
    color: #ffffff;
}

/* ============================================================================
   Split-Screen Auth Pages (Login & Register)
   ============================================================================ */
.auth-split-body {
    min-height: 100vh;
    background: #f3f7f5;
}
.auth-split-container {
    min-height: 100vh;
    display: flex;
}
.auth-visual-panel {
    width: 45%;
    background:
        radial-gradient(circle at top right, rgba(52, 211, 153, 0.25), transparent 45%),
        linear-gradient(145deg, #022c22 0%, #064e3b 48%, #047857 100%);
    padding: 56px 48px;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.auth-perk {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ecfdf5;
    font-size: 13.5px;
    font-weight: 500;
}
.auth-perk i {
    color: #6ee7b7;
    font-size: 16px;
    width: 20px;
    text-align: center;
}
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    background: #ffffff;
}
.auth-form-box {
    width: 100%;
    max-width: 430px;
}

.login-logo {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 10px 24px rgba(5, 150, 105, 0.28);
}
.input-group-eco .input-group-text {
    background: #f8faf9;
    border-right: none;
    color: var(--eco-muted);
}
.input-group-eco .form-control {
    border-left: none;
    padding-top: 10px;
    padding-bottom: 10px;
}
.input-group-eco .form-control:focus {
    box-shadow: none;
    border-color: var(--eco-primary);
}
.demo-box {
    background: #ecfdf5;
    border: 1px dashed #6ee7b7;
}

/* ============================================================================
   App Shell (Authenticated Dashboard)
   ============================================================================ */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #022c22 0%, #064e3b 100%);
    color: #ecfdf5;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    transition: width .22s ease;
    box-shadow: 4px 0 24px rgba(2, 44, 34, 0.14);
}

.sidebar-brand {
    height: var(--navbar-height);
    padding: 0 18px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}
.sidebar-brand .brand-text .fw-bold { color: #ffffff; }
.sidebar-brand .brand-text small { color: #6ee7b7 !important; }

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981, #34d399);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.brand-icon-sm {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.sidebar-nav {
    padding: 14px 12px 24px;
    overflow-y: auto;
    flex: 1;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 4px; }

.nav-section-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(167, 243, 208, 0.65);
    padding: 14px 12px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 13px;
    border-radius: 12px;
    color: rgba(236, 253, 245, 0.82);
    text-decoration: none;
    font-size: 13.8px;
    font-weight: 500;
    margin-bottom: 3px;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}
.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    color: rgba(167, 243, 208, 0.78);
}
.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
}
.sidebar-link:hover i { color: #6ee7b7; }
.sidebar-link.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.32);
}
.sidebar-link.active i { color: #ffffff; }
.sidebar-link.text-danger { color: #fca5a5 !important; }
.sidebar-link.text-danger i { color: #fca5a5 !important; }

body.sidebar-collapsed .app-sidebar { width: var(--sidebar-collapsed); }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .sidebar-link span { display: none; }
body.sidebar-collapsed .sidebar-link { justify-content: center; padding: 11px; }
body.sidebar-collapsed .app-main { margin-left: var(--sidebar-collapsed); }

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: margin-left .22s ease;
}

.app-navbar {
    height: var(--navbar-height);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--eco-border);
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}
[data-theme="dark"] .app-navbar { background: rgba(18, 32, 27, 0.90); }

.navbar-title { font-size: 17px; font-weight: 800; line-height: 1.2; }
.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid var(--eco-border);
    background: var(--eco-surface);
    color: var(--eco-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover { background: var(--eco-soft-strong); color: var(--eco-primary); border-color: transparent; }

.btn-user {
    border: 1px solid var(--eco-border);
    border-radius: 12px;
    padding: 4px 10px 4px 5px;
    background: var(--eco-surface);
    color: var(--eco-text);
}
.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.avatar-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

.app-content { padding: 22px; flex: 1; }

/* Cards & Stats */
.eco-card {
    background: var(--eco-surface);
    border: 1px solid var(--eco-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.stat-card {
    background: var(--eco-surface);
    border: 1px solid var(--eco-border);
    border-radius: var(--radius-card);
    padding: 18px;
    box-shadow: var(--shadow-card);
    height: 100%;
    transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.stat-label { font-size: 12px; color: var(--eco-muted); font-weight: 600; }
.stat-value { font-size: 20px; font-weight: 800; line-height: 1.25; }

/* Digital Wallet Hero Card */
.wallet-hero {
    background: linear-gradient(135deg, #022c22 0%, #065f46 48%, #059669 100%);
    color: #ffffff;
    border-radius: 24px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 36px rgba(5, 150, 105, 0.28);
}
.wallet-hero::before {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.25), transparent 70%);
    top: -90px;
    right: -60px;
}
.wallet-hero::after {
    content: "";
    position: absolute;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    bottom: -70px;
    left: -30px;
}
.wallet-balance { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; }
.wallet-pill {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    padding: 10px 12px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    border-radius: 16px;
    background: var(--eco-surface);
    border: 1px solid var(--eco-border);
    color: var(--eco-text);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    box-shadow: var(--shadow-card);
    transition: transform .15s ease, background .15s ease;
}
.quick-action-btn:hover { transform: translateY(-2px); background: var(--eco-soft); color: var(--eco-primary); }
.quick-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--eco-soft-strong);
    color: var(--eco-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Tables & Lists */
.table-eco thead th {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--eco-muted);
    font-weight: 700;
    background: rgba(5, 150, 105, 0.05);
    border-bottom: 1px solid var(--eco-border);
    white-space: nowrap;
}
.table-eco tbody td { vertical-align: middle; font-size: 13.5px; border-bottom-color: var(--eco-border); }

.tx-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--eco-border);
}
.tx-item:last-child { border-bottom: none; }
.tx-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.empty-state { text-align: center; padding: 40px 16px; color: var(--eco-muted); }
.empty-state i { font-size: 40px; opacity: 0.35; margin-bottom: 10px; }

.global-loader {
    position: fixed;
    inset: 0;
    background: rgba(2, 44, 34, 0.45);
    backdrop-filter: blur(3px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loader-box {
    background: var(--eco-surface);
    padding: 22px 32px;
    border-radius: 18px;
    text-align: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

/* Floating PWA Install Banner */
.pwa-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 18px;
    max-width: 460px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid #a7f3d0;
    border-radius: 18px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 14px 36px rgba(2, 44, 34, 0.22);
    z-index: 1060;
}

/* Mobile Bottom Navigation (Android App Style) */
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--mobile-nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--eco-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 1040;
    box-shadow: 0 -6px 24px rgba(2, 44, 34, 0.08);
}
[data-theme="dark"] .mobile-bottom-nav { background: rgba(18, 32, 27, 0.96); }

.mnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--eco-muted);
    font-size: 11px;
    font-weight: 600;
    gap: 3px;
    padding: 6px 2px;
}
.mnav-item i { font-size: 18px; }
.mnav-item.active { color: var(--eco-primary); font-weight: 700; }
.mnav-center .mnav-fab {
    width: 46px;
    height: 46px;
    margin-top: -24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(5, 150, 105, 0.40);
    border: 3px solid var(--eco-surface);
}
.mnav-center .mnav-fab i { font-size: 17px; }

.more-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 6px;
    border-radius: 16px;
    background: var(--eco-bg);
    color: var(--eco-text);
    text-decoration: none;
    font-size: 11.5px;
    font-weight: 600;
    text-align: center;
}
.more-tile i { font-size: 19px; color: var(--eco-primary); }
.more-tile.text-danger i { color: #dc2626; }

@media (max-width: 991.98px) {
    .app-sidebar { display: none; }
    .app-main { margin-left: 0 !important; padding-bottom: calc(var(--mobile-nav-height) + 18px); }
    .app-navbar { padding: 0 14px; height: 60px; }
    .navbar-title { font-size: 15.5px; }
    .app-content { padding: 14px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 17px; }
    .wallet-balance { font-size: 27px; }
    .landing-hero { padding: 34px 0 46px; }
    body.role-superadmin .pwa-banner,
    body.role-admin .pwa-banner,
    body.role-nasabah .pwa-banner {
        bottom: calc(var(--mobile-nav-height) + 12px);
    }
}
