/* ========================================================
   CatatKas - Handcrafted Pure CSS
   Modern, Clean, Responsive & Fast
   ======================================================== */

:root {
    --primary: #1e3a8a;          /* Deep Navy */
    --primary-hover: #1e40af;
    --primary-light: #dbeafe;
    --accent: #0284c7;           /* Sky Blue */
    --success: #059669;          /* Emerald Green */
    --warning: #d97706;          /* Amber */
    --danger: #dc2626;           /* Crimson Red */
    --bg-page: #f8fafc;          /* Soft Slate White */
    --bg-card: #ffffff;
    --text-main: #0f172a;        /* Slate 900 */
    --text-muted: #64748b;       /* Slate 500 */
    --border: #e2e8f0;           /* Slate 200 */
    --border-focus: #3b82f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------
   Layout & Container
   -------------------------------------------------------- */
.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* --------------------------------------------------------
   Header Bar
   -------------------------------------------------------- */
.app-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff;
    font-weight: 700;
    font-size: 1.2rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.book-tag {
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #f1f5f9;
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-left: 0.25rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* --------------------------------------------------------
   Badges & Tags
   -------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-admin {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.badge-viewer {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.badge-local {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-online {
    background-color: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

/* --------------------------------------------------------
   Buttons
   -------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    line-height: 1.25;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    text-decoration: none;
}

.btn-outline {
    background-color: #ffffff;
    border-color: var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    text-decoration: none;
}

.btn-danger {
    background-color: #ffffff;
    border-color: #fca5a5;
    color: var(--danger);
}

.btn-danger:hover {
    background-color: #fef2f2;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

/* --------------------------------------------------------
   Card & Grid
   -------------------------------------------------------- */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.875rem;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------
   Login Screen
   -------------------------------------------------------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 2.25rem 2rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff;
    font-weight: 800;
    font-size: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-md);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* --------------------------------------------------------
   Form Controls
   -------------------------------------------------------- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 0.925rem;
    color: var(--text-main);
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* --------------------------------------------------------
   Alerts & Notifications
   -------------------------------------------------------- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* --------------------------------------------------------
   Tables
   -------------------------------------------------------- */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.table th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* --------------------------------------------------------
   Footer
   -------------------------------------------------------- */
.app-footer {
    margin-top: auto;
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background-color: #ffffff;
}

/* --------------------------------------------------------
   Transaction Modal & Dynamic Form Styles
   -------------------------------------------------------- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.modal.show {
    display: flex;
}

.modal-dialog {
    width: 100%;
    max-width: 600px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    margin: auto;
    overflow: hidden;
    animation: modalSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background-color: #f8fafc;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background-color: #f8fafc;
}

/* Transaction Type Tabs */
.type-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    background: #f1f5f9;
    padding: 0.35rem;
    border-radius: var(--radius-md);
}

.type-tab-btn {
    border: none;
    background: none;
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s ease;
    text-align: center;
}

.type-tab-btn:hover {
    color: var(--text-main);
}

.type-tab-btn.active {
    background-color: #ffffff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.type-tab-btn[data-type="out"].active {
    color: #b91c1c;
}

.type-tab-btn[data-type="in"].active {
    color: #15803d;
}

.type-tab-btn[data-type="transfer"].active {
    color: #0369a1;
}

.type-tab-btn[data-type="adjustment"].active {
    color: #b45309;
}

/* Amounts & Proofs */
.amount-in {
    color: #15803d;
}

.amount-out {
    color: #b91c1c;
}

.proof-link {
    display: inline-block;
    background: #eff6ff;
    color: var(--accent);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    border: 1px solid #bfdbfe;
    text-decoration: none;
    margin-right: 2px;
}

.proof-link:hover {
    background: #dbeafe;
    text-decoration: none;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 110;
    display: none;
    animation: toastPop 0.25s ease-out;
}

.toast.show {
    display: block;
}

.toast-success {
    background-color: #166534;
    color: #ffffff;
}

.toast-error {
    background-color: #991b1b;
    color: #ffffff;
}

@keyframes toastPop {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --------------------------------------------------------
   Tahap 3: Summary Cards & Filter Bar Layout
   -------------------------------------------------------- */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Summary Card */
.summary-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.summary-card:hover {
    box-shadow: var(--shadow-md);
}

.summary-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.summary-amount {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0.5rem 0 0.25rem 0;
    letter-spacing: -0.02em;
}

.summary-amount.color-balance {
    color: var(--primary);
}

.summary-amount.color-income {
    color: #166534;
}

.summary-amount.color-expense {
    color: #991b1b;
}

.summary-amount.color-net {
    color: #0369a1;
}

.summary-meta {
    font-size: 0.775rem;
    color: var(--text-muted);
}

/* Filter Card & Toolbar */
.filter-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.period-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.period-pill {
    padding: 0.4rem 0.85rem;
    font-size: 0.825rem;
    font-weight: 600;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.period-pill:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.period-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    align-items: end;
}

/* Table Footer Summary Row */
.table tfoot tr {
    background-color: #f8fafc;
    border-top: 2px solid var(--border);
    font-weight: 700;
}

.table tfoot td {
    padding: 0.85rem 1rem;
    color: var(--text-main);
}

/* Pagination Bar */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* --------------------------------------------------------
   Tahap 4: Account Balance Cards, Reconciliation,
   Category Breakdown, Month Locks & Print Styles
   -------------------------------------------------------- */
.account-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.account-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.15rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.account-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.account-card.selected {
    border-color: var(--primary);
    background: #f8fafc;
    box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.15);
}

.account-card.selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
}

.account-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.account-card-name {
    font-size: 0.925rem;
    font-weight: 700;
    color: var(--text-main);
}

.account-card-balance {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.account-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Cross-Check Reconciliation Box */
.reconciliation-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.reconcile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.reconcile-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.reconcile-match {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.reconcile-diff {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.reconcile-methods-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

@media (max-width: 640px) {
    .reconcile-methods-grid {
        grid-template-columns: 1fr;
    }
}

.reconcile-method-box h4 {
    font-size: 0.825rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.reconcile-amount {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Category Breakdown Bars */
.category-bar-item {
    margin-bottom: 0.85rem;
}

.category-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.825rem;
    margin-bottom: 0.3rem;
}

.category-bar-track {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    border-radius: 9999px;
    background: #dc2626;
    transition: width 0.3s ease;
}

.category-bar-fill.fill-income {
    background: #16a34a;
}

/* Month Lock Badge & Warning */
.period-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
}

.period-locked {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.period-unlocked {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.locked-table-notice {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 0.85rem 1.25rem;
    color: #92400e;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ========================================================
   Total Saldo per Transaksi & Wallet Breakdown Popover
   ======================================================== */
.btn-toggle-total-saldo {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.total-saldo-cell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    width: 100%;
}

.total-saldo-val {
    font-weight: 700;
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--primary);
    white-space: nowrap;
}

.btn-wallet-breakdown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: #f1f5f9;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.65rem;
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.btn-wallet-breakdown:hover {
    background: #e2e8f0;
    color: var(--text-main);
    border-color: #94a3b8;
}

.btn-wallet-breakdown.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.wallet-popover {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1050;
    width: 280px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 0.85rem;
    text-align: left;
    color: var(--text-main);
    animation: popoverFadeIn 0.18s ease-out;
}

@keyframes popoverFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wallet-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.45rem;
    margin-bottom: 0.5rem;
}

.wallet-popover-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.wallet-popover-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-muted);
    padding: 0 0.2rem;
}

.wallet-popover-close:hover {
    color: var(--danger);
}

.wallet-popover-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    line-height: 1.3;
}

.wallet-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px dashed #f1f5f9;
    font-size: 0.8rem;
}

.wallet-item-row:last-child {
    border-bottom: none;
}

.wallet-item-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #334155;
}

.wallet-item-val {
    font-family: monospace;
    font-weight: 600;
    color: var(--text-main);
}

.wallet-popover-total {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1.5px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--primary);
}

.popover-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 0.5rem;
    color: var(--text-muted);
    font-size: 0.825rem;
    font-weight: 600;
}

.spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

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

/* ========================================================
   Action Column Icons, Backup Modal & Delete Confirmation
   ======================================================== */
.action-buttons-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.btn-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #ffffff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    padding: 0;
}

.btn-action-icon:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.btn-action-icon.btn-delete-trx:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

.btn-action-icon.btn-edit-trx:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.backup-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
}

.backup-tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

.backup-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.backup-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 1.75rem 1.25rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.backup-dropzone:hover {
    border-color: var(--primary);
    background: #f0f7ff;
}

.delete-preview-card {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

/* Print Styles */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 10pt;
    }

    .app-header,
    .filter-card,
    .header-actions,
    .pagination-wrapper,
    .modal:not(#modal-print-report),
    .toast,
    .app-footer,
    #btn-open-modal,
    .btn-delete-trx,
    .no-print {
        display: none !important;
    }

    #modal-print-report.show {
        display: block !important;
        position: static !important;
        background: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    #modal-print-report.show .modal-dialog {
        max-width: 100% !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        overflow: visible !important;
    }

    #print-sheet-body {
        padding: 0 !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .card,
    .summary-card,
    .reconciliation-card {
        box-shadow: none !important;
        border: 1px solid #cccccc !important;
        page-break-inside: avoid;
    }

    .print-only {
        display: block !important;
    }

    .table th, .table td {
        padding: 4pt 6pt !important;
        font-size: 9pt;
    }
}

/* ========================================================
   Tahap 7: Cloud Mirror & Online Sync Styles
   ======================================================== */
.sync-badge-success {
    background: #ecfdf5 !important;
    color: #065f46 !important;
    border: 1px solid #a7f3d0 !important;
}

.sync-badge-failed {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border: 1px solid #fecaca !important;
}

.sync-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
    animation: sync-pulse-anim 1.5s infinite;
}

@keyframes sync-pulse-anim {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.25); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.sync-pulse-green {
    background-color: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.sync-pulse-amber {
    background-color: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.sync-pulse-red {
    background-color: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

/* ----------------------------------------------------
   Between-Row Transaction Insertion Highlight & Button
---------------------------------------------------- */
.trx-insert-spacer {
    height: 4px;
    padding: 0;
    margin: 0;
    background: transparent;
    transition: all 0.15s ease-in-out;
}

.trx-insert-spacer .trx-insert-td {
    padding: 0 !important;
    border: none !important;
    position: relative;
    height: 4px;
    background: transparent;
}

.trx-insert-wrapper {
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 0.85rem;
    opacity: 0;
    pointer-events: none;
    z-index: 15;
    transition: opacity 0.15s ease-in-out;
}

.trx-insert-spacer:hover .trx-insert-wrapper,
.trx-insert-wrapper:hover {
    opacity: 1;
    pointer-events: auto;
}

.trx-insert-line {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 2px dashed #0284c7;
    pointer-events: none;
    z-index: 1;
}

.btn-insert-between {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #0284c7;
    color: #ffffff;
    border: 1px solid #0369a1;
    border-radius: 9999px;
    padding: 0.15rem 0.65rem;
    font-size: 0.725rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
    transition: transform 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}

.btn-insert-between:hover {
    background: #0369a1;
    color: #ffffff;
    transform: scale(1.04);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.55);
}

.btn-insert-between:active {
    transform: scale(0.97);
}

.btn-insert-between .insert-plus-icon {
    font-size: 0.95rem;
    font-weight: 900;
    line-height: 1;
}

.btn-insert-between .insert-text {
    font-size: 0.725rem;
    letter-spacing: 0.01em;
}


