:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --secondary: #3b82f6;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --white: #ffffff;
    --bg: #f8fafc;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 60px;
    flex: 1;
}

/* Navbar */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 0 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    height: 64px;
}

.navbar h1 {
    font-size: 20px;
    font-weight: 700;
}

.navbar h1 span {
    color: var(--primary);
}

.navbar nav {
    display: flex;
    gap: 8px;
}

.navbar nav a {
    padding: 8px 16px;
    color: var(--gray);
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.navbar nav a:hover {
    background: var(--gray-light);
    color: var(--dark);
}

.navbar nav a.active {
    background: var(--primary);
    color: white;
}

/* Header Admin */
.header-admin {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 0 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-admin-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    height: 64px;
}

.header-admin h1 {
    font-size: 18px;
    font-weight: 600;
}

.header-admin h1 span {
    color: var(--primary);
}

.header-admin .actions {
    display: flex;
    gap: 12px;
}

.header-admin .btn {
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.header-admin .btn-home {
    color: var(--gray);
}

.header-admin .btn-logout {
    background: var(--danger);
    color: white;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 12px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-card .icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.stat-card h3 {
    color: var(--gray);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-card .amount {
    font-size: 24px;
    font-weight: 700;
}

.stat-card.income .amount {
    color: var(--primary);
}

.stat-card.expense .amount {
    color: var(--danger);
}

.stat-card.balance .amount {
    color: var(--secondary);
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
    text-align: center !important;
}

.page-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center !important;
}

.page-header p {
    color: var(--gray);
    text-align: center !important;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

th {
    background: var(--dark);
    color: white;
    font-weight: 600;
    font-size: 13px;
}

td {
    font-size: 14px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f9fafb;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge.income {
    background: #d1fae5;
    color: var(--primary-dark);
}

.badge.expense {
    background: #fee2e2;
    color: var(--danger);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

.form-row .form-group:first-child {
    flex: 0 0 150px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray);
}

.btn-danger {
    background: var(--danger);
}

/* Filter */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-bar .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

.filter-bar .form-group:first-child {
    flex: 2;
}

.filter-bar .btn {
    padding: 10px 16px;
}

/* Balance account card hover & selected state */
.balance-account-card {
    transition: transform 0.15s, box-shadow 0.15s;
}
.balance-account-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.balance-account-card.selected {
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.18);
}

/* Period Cards */
.period-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.period-card {
    padding: 20px 24px;
}

/* Account Balance Layout */
.account-balance-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.account-group {
    border-radius: 14px;
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
}

.account-group--pakai {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid rgba(16,185,129,0.25);
}

.account-group--ambil {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid rgba(59,130,246,0.25);
}

.account-group-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: 0.2px;
}

.account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.07);
    font-size: 13px;
}

.account-item:last-of-type {
    border-bottom: none;
}

.account-item-name {
    color: var(--gray);
}

.account-item-amount {
    font-weight: 700;
    font-size: 14px;
}

.account-subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid currentColor;
    font-size: 13px;
    font-weight: 700;
    opacity: 0.9;
}

.total-dana-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    border-radius: 14px;
    padding: 22px 28px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}

.total-dana-label {
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.total-dana-amount {
    font-size: 28px;
    font-weight: 800;
    color: #34d399;
    letter-spacing: -0.5px;
}

/* Section Title */
.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 16px;
}

/* Statistics Page */
.stats-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-progress {
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: #e5e7eb;
    margin-top: 6px;
    overflow: hidden;
}

.stat-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #10b981, #3b82f6);
}

.stat-5-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-mini-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
}

.stat-mini-card h4 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--dark);
}

.stat-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-list li {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
}

.stat-list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.stat-list-head strong {
    color: var(--dark);
    white-space: nowrap;
}

.stat-list-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.stat-list-foot small {
    width: 56px;
    text-align: right;
    color: var(--gray);
    font-weight: 600;
}

.stat-empty {
    color: var(--gray);
    font-size: 13px;
}

/* Public Proofs Page */
.proof-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.proof-card {
    border: 1px solid var(--gray-light);
    border-radius: 12px;
    background: var(--white);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.proof-media {
    background: #f1f5f9;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.proof-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.proof-file-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

.proof-content {
    padding: 12px;
}

.proof-content h4 {
    font-size: 14px;
    margin-bottom: 6px;
}

.proof-content p {
    font-size: 12px;
    color: var(--gray);
    min-height: 34px;
}

.proof-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 10px;
    margin-bottom: 8px;
}

.proof-badge.nota {
    background: #dcfce7;
    color: #166534;
}

.proof-badge.transfer {
    background: #dbeafe;
    color: #1d4ed8;
}

.proof-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    font-size: 12px;
}

.proof-meta span {
    color: var(--gray);
}

.proof-meta a {
    color: var(--secondary);
    font-weight: 600;
    text-decoration: none;
}

.proof-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.9);
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.proof-modal img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 14px;
    }

    .table-wrap {
        margin: 0 -18px;
        padding: 0 18px 8px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .table-wrap::after {
        content: '';
        display: block;
        text-align: right;
        color: var(--gray);
        font-size: 11px;
        padding-top: 6px;
    }

    .table-wrap table {
        width: max-content;
        min-width: 100%;
    }

    .table-wrap th,
    .table-wrap td {
        white-space: nowrap;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .stats-grid .stat-card:nth-child(3) {
        grid-column: span 2;
    }
    .period-grid {
        grid-template-columns: 1fr;
    }
    .account-balance-layout {
        grid-template-columns: 1fr;
    }
    .stats-split-grid {
        grid-template-columns: 1fr;
    }
    .stat-5-grid {
        grid-template-columns: 1fr;
    }
    .proof-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 18px;
    }

    th,
    td {
        padding: 10px 12px;
        font-size: 12px;
    }

    .table-wrap td:last-child,
    .table-wrap td:nth-last-child(2) {
        white-space: normal;
        min-width: 160px;
    }
}

/* Pagination */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 24px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    background: var(--white);
    color: var(--gray);
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    box-shadow: var(--shadow);
    min-width: 40px;
    text-align: center;
}

.pagination a:hover {
    background: var(--primary);
    color: white;
}

.pagination a.active {
    background: var(--primary);
    color: white;
}

.pagination span.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pagination span.ellipsis,
.pagination .pg-ellipsis {
    box-shadow: none;
    background: transparent;
    min-width: auto;
    padding: 8px 4px;
    cursor: default;
}

.pagination .pg-nav {
    font-weight: 700;
    min-width: 40px;
    text-align: center;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    background: var(--dark);
    color: white;
    box-shadow: var(--shadow);
    transition: background 0.2s;
}

.pagination .pg-nav:hover {
    background: var(--primary);
}

.pagination .pg-nav.disabled {
    background: var(--gray-light);
    color: var(--gray);
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Alert */
.alert {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert.success {
    background: #d1fae5;
    color: var(--primary-dark);
}

.alert.error {
    background: #fee2e2;
    color: var(--danger);
}

/* Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 24px;
}

.login-card p {
    text-align: center;
    color: var(--gray);
    margin-bottom: 24px;
}

.login-card .form-group input {
    padding: 14px;
}

.login-card .btn {
    width: 100%;
    padding: 14px;
}

.login-card .back-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: var(--gray);
    text-decoration: none;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--gray);
    font-size: 14px;
    border-top: 1px solid var(--gray-light);
    background: var(--white);
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Section titles */
.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-only {
    display: none !important;
}

.desktop-only {
    display: block !important;
}

/* Mobile transaction cards */
.transaction-mobile-list {
    display: none;
    flex-direction: column;
    gap: 14px;
}

.transaction-mobile-card {
    border: 1px solid var(--gray-light);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 14px;
    box-shadow: var(--shadow);
}

.transaction-mobile-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.transaction-mobile-date {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 4px;
}

.transaction-mobile-desc {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.4;
}

.transaction-mobile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.transaction-mobile-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
}

.transaction-mobile-item span {
    display: block;
    color: var(--gray);
    font-size: 11px;
    margin-bottom: 4px;
}

.transaction-mobile-item strong {
    display: block;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.transaction-mobile-item strong.income {
    color: var(--primary);
}

.transaction-mobile-item strong.expense {
    color: var(--danger);
}

.transaction-mobile-balance {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    background: #e0f2fe;
}

.transaction-mobile-balance span {
    color: var(--gray);
    font-size: 12px;
}

.transaction-mobile-balance strong {
    color: var(--secondary);
    font-size: 16px;
}

.admin-mobile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.admin-mobile-actions .btn,
.admin-mobile-actions .btn-danger {
    padding: 8px 14px;
    font-size: 13px;
    text-decoration: none;
    border: none;
    border-radius: 8px;
}

/* Grid layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Actions */
.actions {
    display: flex;
    gap: 8px;
}

.actions button,
.actions a {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.actions .edit {
    background: var(--secondary);
    color: white;
}

.actions .delete {
    background: var(--danger);
    color: white;
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 14px;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .mobile-only.transaction-mobile-list {
        display: flex !important;
    }

    /* Statistics page mobile responsiveness */
    #statisticsCaptureArea .table-wrap {
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
    }

    #statisticsCaptureArea .table-wrap::after {
        content: '' !important;
        display: block !important;
        text-align: right;
        color: var(--gray);
        font-size: 10px !important;
        padding-top: 6px;
    }

    #statisticsCaptureArea table {
        width: 100% !important;
        min-width: 100% !important;
        table-layout: fixed;
        border-collapse: collapse;
    }

    #statisticsCaptureArea table th,
    #statisticsCaptureArea table td {
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 11px !important;
        padding: 6px 5px !important;
        word-break: break-word;
    }

    #statisticsCaptureArea table th {
        background: var(--dark);
        color: white;
    }

    #statisticsCaptureArea table th:first-child,
    #statisticsCaptureArea table td:first-child {
        min-width: 80px;
    }

    #statisticsCaptureArea .stats-group-card {
        padding: 8px;
    }

    #statisticsCaptureArea .stats-group-card h4 {
        font-size: 12px !important;
        margin-bottom: 6px;
    }

    #statisticsCaptureArea .stat-progress {
        height: 5px;
        margin-top: 4px;
    }

    .navbar {
        padding: 0 12px;
    }

    .navbar-inner {
        flex-direction: column;
        gap: 12px;
        height: auto;
        padding: 16px 0;
    }

    .navbar nav {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .navbar nav a {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    .header-admin-inner {
        flex-direction: column;
        gap: 12px;
        height: auto;
        padding: 16px 0;
    }

    .header-admin {
        padding: 0 12px;
    }

    .header-admin .actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .transaction-mobile-grid {
        grid-template-columns: 1fr;
    }

    /* Index dashboard mobile refinements (scoped) */
    .dashboard-page .page-header {
        margin-bottom: 18px !important;
    }

    .dashboard-page .page-header h2 {
        font-size: 21px;
        line-height: 1.35;
    }

    .dashboard-page .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 16px !important;
    }

    .dashboard-page .stat-card {
        padding: 16px;
        border-radius: 12px;
    }

    .dashboard-page .stat-card .amount {
        font-size: 20px;
        line-height: 1.25;
        word-break: break-word;
    }

    .dashboard-page .stat-card.balance {
        grid-column: auto !important;
    }

    .dashboard-page .period-grid {
        gap: 12px;
        margin-bottom: 16px !important;
    }

    .dashboard-page .period-card {
        padding: 16px;
    }

    .dashboard-page .period-line {
        align-items: flex-start;
        gap: 8px;
        flex-wrap: wrap;
    }

    .dashboard-page .period-line strong {
        max-width: 100%;
        word-break: break-word;
        text-align: left;
    }

    .dashboard-page .dashboard-chart-wrap {
        height: 250px !important;
    }

    .dashboard-page .account-balance-layout {
        gap: 12px;
        margin-bottom: 14px;
    }

    .dashboard-page .account-group {
        padding: 14px;
    }

    .dashboard-page .account-item {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .dashboard-page .account-item-amount {
        font-size: 15px;
    }

    .dashboard-page .total-dana-box {
        padding: 16px;
    }

    .dashboard-page .total-dana-amount {
        font-size: 22px;
        line-height: 1.2;
        word-break: break-word;
    }

    .dashboard-page .section-title {
        justify-content: center;
        text-align: center;
        line-height: 1.35;
        margin-bottom: 12px;
    }

    .dashboard-page .card {
        margin-bottom: 14px !important;
    }

    .dashboard-page .btn.btn-secondary {
        width: 100%;
        max-width: 260px;
    }

    /* Transactions page */
    .page-transactions .page-header h2 {
        font-size: 21px;
        line-height: 1.3;
    }

    .page-transactions .card {
        padding: 14px;
    }

    .page-transactions .filter-bar {
        gap: 8px;
    }

    .page-transactions .filter-bar .form-group {
        min-width: 100%;
    }

    .page-transactions .filter-bar .btn {
        width: 100%;
    }

    .page-transactions .card > div[style*="justify-content: flex-end"] .btn {
        width: 100%;
    }

    .page-transactions .trans-overview {
        gap: 10px;
        margin-top: 12px !important;
    }

    .page-transactions .trans-overview-card {
        width: 100%;
        padding: 10px 12px !important;
        border-radius: 10px !important;
    }

    .page-transactions .trans-shot-actions {
        margin-bottom: 10px !important;
    }

    .page-transactions .trans-start-wrap,
    .page-transactions .trans-subtotal-wrap {
        justify-content: stretch !important;
    }

    .page-transactions .trans-start-card,
    .page-transactions .trans-subtotal-card {
        width: 100%;
        text-align: left !important;
        padding: 10px 12px !important;
        border-radius: 10px !important;
    }

    .page-transactions .trans-subtotal-cards {
        width: 100%;
        gap: 10px !important;
    }

    .page-transactions .pagination a,
    .page-transactions .pagination span {
        min-width: 42px;
        padding: 9px 10px;
    }

    /* Balance page */
    .page-balance .page-header h2 {
        font-size: 21px;
    }

    .page-balance .card {
        padding: 14px;
    }

    .page-balance .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .page-balance .stat-card {
        padding: 16px;
    }

    .page-balance .section-title {
        flex-wrap: wrap;
    }

    .page-balance .balance-shot-actions .btn {
        width: 100%;
    }

    .page-balance .balance-detail-head {
        gap: 8px !important;
    }

    .page-balance .balance-detail-meta {
        width: 100%;
        justify-content: space-between;
    }

    .page-balance .balance-detail-meta .btn {
        width: auto;
        min-width: 108px;
        text-align: center;
    }

    /* Projects page */
    .page-projects .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .page-projects .stat-card {
        text-align: center;
        padding: 16px;
    }

    .page-projects .section-title {
        flex-wrap: wrap;
    }

    /* Statistics page */
    .page-statistics .page-header {
        margin-bottom: 16px !important;
    }

    .page-statistics .page-header h2 {
        font-size: 20px;
        line-height: 1.3;
    }

    .page-statistics .page-header p {
        font-size: 13px;
    }

    .page-statistics .card {
        padding: 12px;
    }

    .page-statistics .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 14px !important;
    }

    .page-statistics .stat-card {
        padding: 12px;
        border-radius: 10px;
    }

    .page-statistics .stat-card .icon {
        font-size: 22px;
        margin-bottom: 6px;
    }

    .page-statistics .stat-card .amount {
        font-size: 19px;
        line-height: 1.25;
        word-break: break-word;
    }

    .page-statistics .stat-card.balance {
        grid-column: auto !important;
    }

    .page-statistics .section-title {
        font-size: 15px;
        line-height: 1.35;
        margin-bottom: 12px;
        flex-wrap: wrap;
    }

    .page-statistics .stats-split-grid {
        gap: 10px;
    }

    .page-statistics .table-wrap {
        margin: 0;
        padding: 0 0 8px;
    }

    .page-statistics th,
    .page-statistics td {
        font-size: 12px;
        padding: 9px 10px;
    }

    .page-statistics .stat-progress {
        height: 6px;
    }

    .page-statistics .stat-mini-card {
        padding: 10px;
        border-radius: 10px;
    }

    .page-statistics .stat-mini-card h4 {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .page-statistics .stat-list {
        gap: 8px;
    }

    .page-statistics .stat-list li {
        padding: 8px;
    }

    .page-statistics .stat-list-head {
        font-size: 12px;
    }

    .page-statistics .stat-list-foot small {
        width: 50px;
        font-size: 11px;
    }

    /* Proofs page */
    .page-proofs .filter-bar .form-group {
        min-width: 100%;
    }

    .page-proofs .proof-card {
        border-radius: 10px;
    }

    .page-proofs .proof-content {
        padding: 10px;
    }

    /* Gallery page */
    .page-gallery .card {
        padding: 16px;
    }

    .page-gallery .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .page-gallery .gallery-item img {
        height: 210px;
    }

    /* Neraca page */
    .page-neraca .form-row .form-group {
        min-width: 100%;
    }

    .page-neraca .form-row .btn {
        width: 100%;
    }

    .page-neraca .card > div[style*="justify-content: space-between"] > div {
        width: 100%;
    }

    /* Admin generic */
    .admin-page .card {
        padding: 16px;
    }

    .admin-page nav {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        white-space: nowrap;
        padding-bottom: 4px;
    }

    .admin-page nav .btn {
        flex: 0 0 auto;
    }

    .admin-page .form-row .form-group {
        min-width: 100%;
    }

    .admin-page .form-row .btn,
    .admin-page form .btn {
        width: 100%;
    }

    /* Admin data page: make every table safely swipeable without markup changes */
    .admin-data table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .admin-data table thead,
    .admin-data table tbody,
    .admin-data table tr {
        display: table;
        width: max-content;
        min-width: 100%;
    }

    .admin-data .grid-2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Admin proofs page */
    .admin-proofs .table-wrap {
        margin: 0 -16px;
        padding: 0 16px 8px;
    }

    .admin-proofs .table-wrap::after {
        content: '';
        display: block;
        text-align: right;
        color: var(--gray);
        font-size: 11px;
        padding-top: 6px;
    }
}

/* Extra small devices (max 480px) */
@media (max-width: 480px) {
    #statisticsCaptureArea table th,
    #statisticsCaptureArea table td {
        font-size: 10px !important;
        padding: 5px 4px !important;
    }

    #statisticsCaptureArea table th:first-child,
    #statisticsCaptureArea table td:first-child {
        min-width: 70px;
    }

    #statisticsCaptureArea .stats-group-card {
        padding: 6px;
        border-radius: 6px;
    }

    #statisticsCaptureArea .stats-group-card h4 {
        font-size: 11px !important;
        margin-bottom: 4px;
    }

    #statisticsCaptureArea .stat-progress {
        height: 4px;
        margin-top: 2px;
    }

    #statisticsCaptureArea .page-header h2 {
        font-size: 18px !important;
    }

    #statisticsCaptureArea .section-title {
        font-size: 13px !important;
    }

    #statisticsCaptureArea .card {
        padding: 8px !important;
    }
}