:root {
    --primary: #10b981;
    /* Emerald 500 */
    --primary-dark: #059669;
    --bg-page: #dcfce6;
    /* Emerald 50 */
    --text-main: #064e3b;
    --text-muted: #64748b;
    --white: #ffffff;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --input-bg: #f8fafc;
    --border-color: #e2e8f0;
    --font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

html {
    scrollbar-gutter: stable;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-page);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 80px;
    scrollbar-gutter: stable;
    /* Space for bottom nav */
}

/* --- MOBILE CONSTRAINT WRAPPER --- */
body>div:not(.modal-overlay, .bottom-nav),
.pwa-container-wrapper,
.bottom-nav-wrapper {
    max-width: 500px;
    margin: 0 auto;
}

/* LOGIN SCREEN */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: var(--bg-page);
}

.login-box {
    background: var(--white);
    padding: 40px 30px;
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    text-align: center;
}

.login-box h2 {
    color: var(--text-main);
    margin-bottom: 5px;
    font-weight: 700;
    font-size: 24px;
}

.login-box p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

.form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 15px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* --- BUTTONS --- */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 8px;
    background: #e2e8f0;
    color: var(--text-main);
}

.btn:hover {
    background: #cbd5e1;
}

.btn-success,
.login-box .btn {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.btn-success:hover,
.login-box .btn:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 6px 8px -1px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: #ef4444;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

input,
textarea,
select {
    font-family: var(--font-family);
}

/* PWA STYLES */
.pwa-header {
    color: var(--text-main);
    line-height: 1em;
    margin-block: 8px;
    font-size: 1.1rem
}

.pwa-content {
    padding: 20px 16px;
    padding-bottom: 90px;
    display: none;
}

.pwa-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* TABS / BOTTOM NAV - FIXED */
.bottom-nav {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    z-index: 200;
}

.bottom-nav-wrapper {
    height: 70px;
    display: flex;
    width: 100%;
    /* justify-content: center; */
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    text-align: center;
}

.nav-item .iconify {
    font-size: 24px;
    margin-bottom: 2px;
}

.nav-item.active {
    color: var(--primary);
    font-weight: 600;
}

.pwa-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.pwa-card .btn,
.login-box .btn {
    width: 100%;
}

/* CHIPS - FIXED */
.chip-container {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 15px;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

.chip-container::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome */
}

.chip {
    padding: 8px 16px;
    white-space: nowrap;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    background: var(--white);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    transition: all 0.2s;
}

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.avatar {
    background: #ecfdf5;
    color: var(--primary);
}

/* Transaction List Items */
.trans-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.trans-item:last-child {
    border-bottom: none;
}

.trans-item div:first-child {
    font-weight: 500;
    font-size: 14px;
}

.trans-item small {
    font-size: 12px;
    display: block;
    margin-top: 2px;
}

/* MODAL - FIXED */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* TOAST */
#toast {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 25px;
    padding: 16px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 80px;
    font-size: 14px;
    transition: opacity 0.5s, bottom 0.5s;
    opacity: 0;
}

#toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 80px;
}

/* Utility Classes */
.flex {
    display: flex;
}

.gap-2 {
    gap: 10px;
}


/* Specific page styles for new content */
.bank-details {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
    margin: 15px 0;
    font-size: 14px;
}

.important-note {
    color: #d97706;
    font-size: 13px;
    font-style: italic;
    margin-bottom: 20px;
}

.popup-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.popup-actions a {
    display: block;
    text-align: center;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
}

/* Berita List */
.news-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-item .image-container {
    width: auto;
    aspect-ratio: 1 /1;
    flex-shrink: 0;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
}

.news-item .image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-item .item-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-item strong {
    font-size: 14px;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-item:hover.news-item strong {
    text-decoration: underline;
}

.news-item span {
    font-size: 11px;
    color: #94a3b8;
}

@media screen and (max-width: 476px) {
    .news-item {
        grid-template-columns: 1fr;
    }
}

/* Modal Backdrop Full Viewport */
.modal-overlay {
    z-index: 9999;
}

/* Mobile Bottom Sheet Modal */
@media screen and (max-width: 500px) {
    .modal-overlay {
        align-items: flex-end;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        margin: 0;
        padding-bottom: 30px;
        /* Safe area */
    }

    /* Stack buttons in modal */
    .modal-content .flex {
        flex-direction: column;
    }

    .modal-content .btn {
        width: 100%;
    }
}