:root {
    --primary: #4e73df;
    --primary-dark: #224abe;
    --success: #1cc88a;
    --danger: #e74a3b;
    --warning: #f6c23e;
    --info: #36b9cc;
    --light: #f8f9fc;
    --dark: #2d2d2d;
}

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

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f0f2f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar-custom {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-custom .navbar-brand {
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: 0.5px;
}

.navbar-custom .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 600;
    transition: all 0.3s;
    border-radius: 8px;
    padding: 8px 16px !important;
    margin: 0 2px;
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.15);
}

.navbar-custom .user-badge {
    background: rgba(255,255,255,0.2);
    border-radius: 50px;
    padding: 6px 16px;
    color: #fff;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Cards */
.card-summary {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.card-summary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.card-summary .card-body {
    padding: 1.25rem;
}

.card-summary .card-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.card-summary .card-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.card-summary .card-icon {
    font-size: 2rem;
    opacity: 0.3;
}

.card-balance { border-left: 4px solid var(--primary); }
.card-income { border-left: 4px solid var(--success); }
.card-expense { border-left: 4px solid var(--danger); }
.card-final { border-left: 4px solid var(--info); }

/* Table */
.table-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 20px;
    margin-bottom: 24px;
}

.table thead th {
    background: var(--light);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e3e6f0;
    white-space: nowrap;
}

.table tbody td {
    font-size: 0.9rem;
    vertical-align: middle;
}

.badge-masuk {
    background-color: #d1fae5;
    color: #065f46;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 50px;
}

.badge-keluar {
    background-color: #fee2e2;
    color: #991b1b;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 50px;
}

/* Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-primary-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(78,115,223,0.4);
    color: #fff;
}

.btn-action {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

/* Login & Register */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    overflow: hidden;
    width: 100%;
    max-width: 420px;
}

.auth-card .auth-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 30px;
    text-align: center;
    color: #fff;
}

.auth-card .auth-header h2 {
    font-weight: 800;
    margin-bottom: 5px;
}

.auth-card .auth-header p {
    opacity: 0.85;
    margin: 0;
    font-size: 0.9rem;
}

.auth-card .auth-body {
    padding: 30px;
}

.auth-card .form-control {
    border-radius: 10px;
    padding: 12px 16px;
    border: 2px solid #e3e6f0;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.auth-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(78,115,223,0.15);
}

.auth-card .btn-login {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    width: 100%;
    transition: all 0.3s;
}

.auth-card .btn-login:hover {
    box-shadow: 0 4px 15px rgba(78,115,223,0.4);
    transform: translateY(-2px);
}

/* Footer */
.app-footer {
    background: #fff;
    border-top: 1px solid #e3e6f0;
    padding: 16px 0;
    text-align: center;
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: auto;
}

/* Chart Container */
.chart-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
    height: 400px;
}

/* Filter Form */
.filter-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 20px;
    margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-card {
        margin: 16px;
        border-radius: 16px;
    }
    
    .card-summary .card-value {
        font-size: 1.2rem;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .table-container, .filter-card {
        padding: 12px;
    }
}

/* Install PWA Button */
.install-btn {
    display: none;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--primary);
}