/* =============================================
   APLIKASI KEUANGAN PRIBADI - CARTOON STYLE
   ============================================= */

/* =============================================
   GOOGLE FONTS
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Fredoka+One&display=swap');

/* =============================================
   CSS CUSTOM PROPERTIES
   ============================================= */
:root {
    /* Cartoon Color Palette */
    --primary: #6C5CE7;
    --primary-light: #A29BFE;
    --primary-dark: #5A4BD1;
    --secondary: #FF6B9D;
    --secondary-light: #FF85B1;
    --accent-yellow: #FECA57;
    --accent-orange: #FF9F43;
    --accent-green: #00D2D3;
    --accent-green-light: #55E6C1;
    --accent-blue: #54A0FF;
    --accent-pink: #FF6B9D;
    --accent-red: #FF6B6B;
    
    /* Background Colors */
    --bg-main: #F8F0FF;
    --bg-card: #FFFFFF;
    --bg-sidebar: linear-gradient(180deg, #6C5CE7 0%, #A29BFE 100%);
    --bg-auth: linear-gradient(135deg, #6C5CE7 0%, #FF6B9D 50%, #FECA57 100%);
    
    /* Text Colors */
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --text-light: #B2BEC3;
    --text-white: #FFFFFF;
    
    /* Cartoon Borders */
    --border-color: #DDD6FE;
    --border-thick: 3px solid #2D3436;
    --border-cartoon: 3px solid #2D3436;
    
    /* Shadows - Cartoon Style (offset, no blur) */
    --shadow-cartoon: 4px 4px 0px #2D3436;
    --shadow-cartoon-sm: 3px 3px 0px #2D3436;
    --shadow-cartoon-lg: 6px 6px 0px #2D3436;
    --shadow-cartoon-color: 4px 4px 0px var(--primary);
    --shadow-soft: 0 8px 32px rgba(108, 92, 231, 0.15);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 50%;
    
    /* Font */
    --font-main: 'Nunito', sans-serif;
    --font-title: 'Fredoka One', cursive;
    
    /* Transitions */
    --transition-bounce: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-smooth: all 0.3s ease;
    
    /* Sidebar */
    --sidebar-width: 260px;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

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

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

@keyframes slideInLeft {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes confetti {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

@keyframes blob {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
    border: 2px solid var(--bg-main);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* =============================================
   AUTH PAGES (LOGIN / REGISTER)
   ============================================= */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-auth);
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -50px;
    right: -50px;
    animation: blob 8s infinite;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    bottom: -30px;
    left: -30px;
    animation: blob 10s infinite reverse;
}

/* Floating decorations */
.auth-deco {
    position: absolute;
    font-size: 40px;
    opacity: 0.3;
    animation: float 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.auth-deco:nth-child(1) { top: 10%; left: 5%; animation-delay: 0s; }
.auth-deco:nth-child(2) { top: 20%; right: 10%; animation-delay: 1s; font-size: 50px; }
.auth-deco:nth-child(3) { bottom: 15%; left: 10%; animation-delay: 2s; }
.auth-deco:nth-child(4) { bottom: 25%; right: 5%; animation-delay: 0.5s; font-size: 35px; }
.auth-deco:nth-child(5) { top: 50%; left: 3%; animation-delay: 1.5s; font-size: 30px; }

.auth-container {
    background: var(--bg-card);
    border: var(--border-cartoon);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-cartoon-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: bounceIn 0.6s ease-out;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-icon {
    font-size: 64px;
    display: block;
    animation: wiggle 2s infinite;
    margin-bottom: 8px;
}

.auth-logo h1 {
    font-family: var(--font-title);
    font-size: 28px;
    color: var(--primary);
    letter-spacing: 1px;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
    font-weight: 600;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    padding: 4px;
    border: 2px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 15px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-bounce);
}

.auth-tab.active {
    background: var(--primary);
    color: var(--text-white);
    box-shadow: var(--shadow-cartoon-sm);
    border: 2px solid #2D3436;
    transform: scale(1.02);
}

.auth-tab:hover:not(.active) {
    color: var(--primary);
    background: rgba(108, 92, 231, 0.08);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: slideUp 0.4s ease-out;
}

/* =============================================
   FORM ELEMENTS
   ============================================= */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group label .label-icon {
    margin-right: 6px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    z-index: 1;
}

.form-control {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: var(--border-cartoon);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: var(--transition-bounce);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-cartoon-color);
    transform: translateY(-2px);
}

.form-control::placeholder {
    color: var(--text-light);
    font-weight: 400;
}

.form-control.no-icon {
    padding-left: 16px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232D3436' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

textarea.form-control {
    padding: 14px 16px;
    min-height: 80px;
    resize: vertical;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: var(--border-cartoon);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-bounce);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-cartoon-lg);
}

.btn:active {
    transform: translateY(0px);
    box-shadow: 2px 2px 0px #2D3436;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-white);
    box-shadow: var(--shadow-cartoon);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text-white);
    box-shadow: var(--shadow-cartoon);
}

.btn-success {
    background: var(--accent-green);
    color: var(--text-white);
    box-shadow: var(--shadow-cartoon);
}

.btn-warning {
    background: var(--accent-yellow);
    color: var(--text-primary);
    box-shadow: var(--shadow-cartoon);
}

.btn-danger {
    background: var(--accent-red);
    color: var(--text-white);
    box-shadow: var(--shadow-cartoon);
}

.btn-outline {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-cartoon-sm);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--text-white);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-icon.btn-sm {
    width: 34px;
    height: 34px;
}

/* =============================================
   LAYOUT - SIDEBAR + MAIN
   ============================================= */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: var(--border-cartoon);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition-smooth);
    overflow-y: auto;
}

.sidebar-logo {
    text-align: center;
    padding: 16px 0 24px;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.3);
    margin-bottom: 24px;
}

.sidebar-logo .logo-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
    animation: float 3s ease-in-out infinite;
}

.sidebar-logo h2 {
    font-family: var(--font-title);
    color: var(--text-white);
    font-size: 18px;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: var(--transition-bounce);
    cursor: pointer;
    border: 2px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-white);
    transform: translateX(4px);
}

.nav-link.active {
    background: var(--bg-card);
    color: var(--primary);
    border: var(--border-cartoon);
    box-shadow: var(--shadow-cartoon-sm);
    transform: translateX(4px);
}

.nav-link .nav-icon {
    font-size: 22px;
    width: 28px;
    text-align: center;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 2px dashed rgba(255, 255, 255, 0.3);
    margin-top: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.sidebar-user .user-avatar {
    font-size: 36px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    border: 2px solid rgba(255,255,255,0.4);
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    color: var(--text-white);
    font-weight: 800;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-email {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-white);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    box-shadow: none;
}

.btn-logout:hover {
    background: var(--accent-red);
    border-style: solid;
    border-color: #2D3436;
    box-shadow: var(--shadow-cartoon-sm);
}

.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-sm);
    color: var(--text-white);
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition-bounce);
    z-index: 10;
}

.sidebar-close-btn:hover {
    background: var(--accent-red);
    border-color: #2D3436;
    transform: rotate(90deg);
}

/* Mobile toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: var(--text-white);
    border: var(--border-cartoon);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-cartoon-sm);
    font-size: 24px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition-bounce);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 90;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 28px;
    animation: slideDown 0.4s ease-out;
}

.page-header h1 {
    font-family: var(--font-title);
    font-size: 28px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header p {
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 4px;
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--bg-card);
    border: var(--border-cartoon);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-cartoon);
    padding: 24px;
    transition: var(--transition-bounce);
    animation: slideUp 0.4s ease-out;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-cartoon-lg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 3px dashed var(--border-color);
}

.card-header h3 {
    font-family: var(--font-title);
    font-size: 18px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* STAT CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: var(--border-cartoon);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-cartoon);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-bounce);
    animation: slideUp 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 0 0 0 100%;
    opacity: 0.1;
}

.stat-card:hover {
    transform: translateY(-4px) rotate(-1deg);
    box-shadow: var(--shadow-cartoon-lg);
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 28px;
    border: var(--border-cartoon);
    flex-shrink: 0;
}

.stat-card.saldo .stat-icon {
    background: var(--accent-blue);
    box-shadow: 3px 3px 0px #2980B9;
}

.stat-card.pemasukan .stat-icon {
    background: var(--accent-green);
    box-shadow: 3px 3px 0px #019191;
}

.stat-card.pengeluaran .stat-icon {
    background: var(--accent-red);
    box-shadow: 3px 3px 0px #C0392B;
}

.stat-card .stat-info h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-info .stat-value {
    font-family: var(--font-title);
    font-size: 22px;
    color: var(--text-primary);
    margin-top: 4px;
}

.stat-card.saldo .stat-value { color: var(--accent-blue); }
.stat-card.pemasukan .stat-value { color: var(--accent-green); }
.stat-card.pengeluaran .stat-value { color: var(--accent-red); }

/* =============================================
   DASHBOARD GRID
   ============================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

.dashboard-grid .card {
    animation-delay: 0.1s;
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

/* =============================================
   TABLES
   ============================================= */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead th {
    background: var(--primary);
    color: var(--text-white);
    padding: 14px 16px;
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: var(--border-cartoon);
}

thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

tbody tr {
    transition: var(--transition-smooth);
}

tbody tr:hover {
    background: rgba(108, 92, 231, 0.05);
    transform: scale(1.01);
}

tbody td {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px dashed var(--border-color);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-xl);
    font-size: 12px;
    font-weight: 800;
    border: 2px solid #2D3436;
}

.badge-pemasukan {
    background: var(--accent-green-light);
    color: #006666;
}

.badge-pengeluaran {
    background: #FFA0A0;
    color: #8B0000;
}

.amount-positive {
    color: var(--accent-green);
    font-weight: 800;
    font-family: var(--font-title);
}

.amount-negative {
    color: var(--accent-red);
    font-weight: 800;
    font-family: var(--font-title);
}

.trx-kat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-main);
    padding: 4px 10px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    font-weight: 700;
    font-size: 13px;
}

.text-muted {
    color: var(--text-light);
    font-style: italic;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-card);
    border: var(--border-cartoon);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-cartoon-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.8) translateY(20px);
    transition: var(--transition-bounce);
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 16px;
    border-bottom: 3px dashed var(--border-color);
}

.modal-header h3 {
    font-family: var(--font-title);
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition-bounce);
}

.modal-close:hover {
    background: var(--accent-red);
    color: var(--text-white);
    border-color: #2D3436;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px 28px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 28px 24px;
    border-top: 3px dashed var(--border-color);
}

/* =============================================
   TRANSAKSI PAGE
   ============================================= */
.transaksi-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group .form-control {
    padding: 10px 14px 10px 40px;
    font-size: 14px;
    min-width: 150px;
}

.filter-group select.form-control {
    min-width: 160px;
}

/* Tipe filter pills */
.tipe-filter {
    display: flex;
    gap: 6px;
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px;
}

.tipe-btn {
    padding: 8px 16px;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-bounce);
    color: var(--text-secondary);
}

.tipe-btn.active {
    border-color: #2D3436;
    box-shadow: var(--shadow-cartoon-sm);
    color: var(--text-white);
}

.tipe-btn[data-tipe=""] .active,
.tipe-btn.active[data-tipe=""] {
    background: var(--primary);
}

.tipe-btn.active[data-tipe="pemasukan"] {
    background: var(--accent-green);
}

.tipe-btn.active[data-tipe="pengeluaran"] {
    background: var(--accent-red);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    animation: bounceIn 0.6s ease-out;
}

.empty-state .empty-icon {
    font-size: 80px;
    display: block;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

.empty-state h3 {
    font-family: var(--font-title);
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-weight: 600;
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: var(--border-cartoon);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    font-family: var(--font-main);
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-bounce);
    box-shadow: var(--shadow-cartoon-sm);
}

.pagination button:hover {
    background: var(--primary-light);
    color: var(--text-white);
    transform: translateY(-2px);
}

.pagination button.active {
    background: var(--primary);
    color: var(--text-white);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* =============================================
   LAPORAN PAGE
   ============================================= */
.laporan-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.laporan-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.laporan-summary-card {
    background: var(--bg-main);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: var(--transition-bounce);
}

.laporan-summary-card:hover {
    border-style: solid;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.laporan-summary-card .summary-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.laporan-summary-card .summary-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.laporan-summary-card .summary-value {
    font-family: var(--font-title);
    font-size: 20px;
    margin-top: 4px;
}

/* Progress bars for category breakdown */
.kategori-list {
    list-style: none;
}

.kategori-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 2px dashed var(--border-color);
    transition: var(--transition-smooth);
}

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

.kategori-item:hover {
    padding-left: 8px;
}

.kategori-item .kat-icon {
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.kategori-item .kat-info {
    flex: 1;
    min-width: 0;
}

.kategori-item .kat-name {
    font-weight: 700;
    font-size: 14px;
}

.kategori-item .kat-bar {
    height: 8px;
    background: var(--bg-main);
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.kategori-item .kat-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.kategori-item .kat-amount {
    text-align: right;
    min-width: 100px;
}

.kategori-item .kat-amount .amount {
    font-family: var(--font-title);
    font-size: 14px;
}

.kategori-item .kat-amount .persen {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 700;
}

/* =============================================
   PROFIL PAGE
   ============================================= */
.profil-container {
    max-width: 600px;
}

.profil-header {
    text-align: center;
    padding: 32px;
    margin-bottom: 24px;
}

.profil-avatar {
    font-size: 80px;
    margin-bottom: 16px;
    display: block;
    animation: wiggle 3s infinite;
}

.avatar-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

.avatar-option {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    cursor: pointer;
    transition: var(--transition-bounce);
}

.avatar-option:hover {
    transform: scale(1.2) rotate(10deg);
    border-color: var(--primary);
}

.avatar-option.selected {
    border: var(--border-cartoon);
    box-shadow: var(--shadow-cartoon-sm);
    background: var(--bg-main);
    transform: scale(1.1);
}

.profil-section {
    margin-bottom: 24px;
}

.profil-section h3 {
    font-family: var(--font-title);
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =============================================
   ALERTS / TOAST
   ============================================= */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 16px 24px;
    border: var(--border-cartoon);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-cartoon);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    max-width: 420px;
    animation: slideInLeft 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-success {
    background: var(--accent-green-light);
    color: #006666;
}

.toast-error {
    background: #FFA0A0;
    color: #8B0000;
}

.toast-warning {
    background: var(--accent-yellow);
    color: #7D6608;
}

.toast-icon {
    font-size: 22px;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.6;
    transition: var(--transition-smooth);
}

.toast-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

/* =============================================
   LOADING
   ============================================= */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.page-loading {
    position: fixed;
    inset: 0;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    z-index: 9999;
}

.page-loading .loading-icon {
    font-size: 60px;
    animation: wiggle 1s infinite;
}

.page-loading p {
    font-family: var(--font-title);
    font-size: 18px;
    color: var(--primary);
}

/* =============================================
   PAGE SECTIONS (hidden/shown)
   ============================================= */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* =============================================
   TRANSACTION LIST ITEM (for recent transactions)
   ============================================= */
.trx-list {
    list-style: none;
}

.trx-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 2px dashed var(--border-color);
    transition: var(--transition-smooth);
}

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

.trx-item:hover {
    padding-left: 8px;
}

.trx-item .trx-icon {
    font-size: 28px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
}

.trx-item .trx-info {
    flex: 1;
    min-width: 0;
}

.trx-item .trx-name {
    font-weight: 700;
    font-size: 14px;
}

.trx-item .trx-date {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.trx-item .trx-amount {
    font-family: var(--font-title);
    font-size: 15px;
    white-space: nowrap;
}

/* Action buttons in table */
.action-btns {
    display: flex;
    gap: 6px;
}

/* =============================================
   RESPONSIVE STYLES
   ============================================= */

/* TABLET & SMALL LAPTOP (<= 1024px) */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* MOBILE & TABLET (<= 768px) */
@media (max-width: 768px) {
    /* Layout & Navigation */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close-btn {
        display: flex;
    }

    .sidebar-toggle {
        display: flex;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 76px 16px 32px;
        min-height: 100vh;
        width: 100%;
        overflow-x: hidden;
    }

    /* Page Header */
    .page-header {
        margin-bottom: 20px;
    }

    .page-header h1 {
        font-size: 22px;
        gap: 8px;
    }

    .page-header p {
        font-size: 13px;
    }

    /* Cards */
    .card {
        padding: 18px 16px;
        border-radius: var(--radius-md);
        margin-bottom: 20px;
    }

    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .card-header h3 {
        font-size: 16px;
        justify-content: space-between;
    }

    /* Dashboard Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 16px;
        border-radius: var(--radius-md);
    }

    .stat-card .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    .stat-card .stat-info .stat-value {
        font-size: 20px;
    }

    /* =============================================
       TRANSAKSI PAGE RESPONSIVE (<= 768px)
       ============================================= */
    .transaksi-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 18px;
    }

    .transaksi-toolbar .filter-group {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .tipe-filter {
        width: 100%;
        display: flex;
    }

    .tipe-btn {
        flex: 1;
        text-align: center;
        padding: 9px 4px;
        font-size: 13px;
        justify-content: center;
    }

    .filter-month {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        font-size: 14px;
        padding: 10px 14px;
    }

    .btn-add-trx {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 15px;
    }

    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -4px;
        padding: 0 4px;
    }

    /* =============================================
       LAPORAN PAGE RESPONSIVE (<= 768px)
       ============================================= */
    .laporan-card-filters {
        width: 100%;
        display: flex;
        flex-direction: row;
        gap: 8px;
    }

    .laporan-card-filters .filter-input,
    .laporan-card-filters .filter-select {
        flex: 1;
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100%;
        font-size: 13px;
        padding: 8px 10px;
    }

    .filter-select {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 13px;
    }

    .laporan-summary {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }

    .laporan-summary-card {
        padding: 14px 16px;
        display: flex;
        align-items: center;
        text-align: left;
        gap: 14px;
        border-radius: var(--radius-md);
    }

    .laporan-summary-card .summary-icon {
        font-size: 32px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .laporan-summary-card .summary-info {
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .laporan-summary-card .summary-label {
        font-size: 12px;
    }

    .laporan-summary-card .summary-value {
        font-size: 17px;
        margin-top: 0;
        text-align: right;
    }

    .table-laporan {
        min-width: 500px;
    }

    .table-laporan thead th,
    .table-laporan tbody td {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Modal & Dialogs */
    .modal {
        max-width: calc(100vw - 24px);
        margin: 12px;
        border-radius: var(--radius-lg);
        max-height: 88vh;
    }

    .modal-header {
        padding: 18px 20px 14px;
    }

    .modal-header h3 {
        font-size: 17px;
    }

    .modal-body {
        padding: 16px 20px;
    }

    .modal-footer {
        padding: 12px 20px 18px;
        flex-direction: row;
        gap: 10px;
    }

    .modal-footer .btn {
        flex: 1;
        padding: 12px 14px;
        font-size: 14px;
    }

    /* Toast */
    .toast-container {
        top: 14px;
        left: 14px;
        right: 14px;
        align-items: stretch;
    }

    .toast {
        min-width: unset;
        max-width: 100%;
        padding: 12px 16px;
        font-size: 13px;
    }

    /* Auth Page */
    .auth-page {
        padding: 16px;
    }

    .auth-container {
        padding: 32px 20px;
        border-radius: var(--radius-lg);
    }
}

/* SMARTPHONE & NARROW SCREENS (<= 640px) */
@media (max-width: 640px) {
    /* Form inputs touch usability */
    .form-control {
        font-size: 16px; /* Prevents auto-zoom in iOS Safari */
    }

    /* =============================================
       TRANSAKSI: MOBILE CARD VIEW
       Transform table rows into clean cards on mobile
       ============================================= */
    .table-transaksi {
        border-collapse: separate;
        border-spacing: 0;
        width: 100%;
    }

    .table-transaksi thead {
        display: none;
    }

    .table-transaksi,
    .table-transaksi tbody,
    .table-transaksi tr,
    .table-transaksi td {
        display: block;
        width: 100%;
    }

    .table-transaksi tbody tr {
        background: var(--bg-card);
        border: 2px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 14px 14px 12px;
        margin-bottom: 12px;
        box-shadow: var(--shadow-cartoon-sm);
        transition: var(--transition-smooth);
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .table-transaksi tbody tr:hover {
        border-color: var(--primary);
        transform: translateY(-2px);
    }

    .table-transaksi tbody td {
        padding: 0;
        border-bottom: none;
        font-size: 14px;
    }

    /* Row layout inside mobile card */
    .table-transaksi .cell-kategori {
        order: 1;
        margin-bottom: 2px;
    }

    .table-transaksi .cell-kategori .trx-kat-pill {
        background: transparent;
        border: none;
        padding: 0;
        font-size: 15px;
        font-weight: 800;
        color: var(--text-primary);
    }

    .table-transaksi .cell-jumlah {
        order: 2;
        font-size: 18px;
        font-weight: 900;
        margin-bottom: 4px;
    }

    .table-transaksi .cell-keterangan {
        order: 3;
        font-size: 13px;
        color: var(--text-secondary);
        margin-bottom: 4px;
        line-height: 1.4;
    }

    .table-transaksi .cell-tanggal {
        order: 4;
        font-size: 12px;
        color: var(--text-light);
        font-weight: 700;
        padding-bottom: 8px !important;
        margin-bottom: 8px;
        border-bottom: 1px dashed var(--border-color) !important;
    }

    /* Bottom row: Type badge on left, Action buttons on right */
    .table-transaksi .cell-tipe {
        order: 5;
        float: left;
        width: auto;
        display: inline-flex;
    }

    .table-transaksi .cell-aksi {
        order: 6;
        float: right;
        width: auto;
        display: inline-flex;
        justify-content: flex-end;
        margin-top: -28px; /* Align with tipe badge */
    }

    .table-transaksi .action-btns {
        gap: 8px;
    }

    .table-transaksi .action-btns .btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    /* Pagination */
    .pagination {
        gap: 6px;
        flex-wrap: wrap;
    }

    .pagination button {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    /* =============================================
       LAPORAN: CATEGORY BREAKDOWN MOBILE
       ============================================= */
    .laporan-card-filters {
        flex-direction: column;
        gap: 8px;
    }

    .kategori-item {
        flex-wrap: wrap;
        gap: 6px 10px;
        padding: 12px 0;
    }

    .kategori-item .kat-icon {
        width: 38px;
        height: 38px;
        font-size: 22px;
        flex-shrink: 0;
    }

    .kategori-item .kat-info {
        flex: 1 1 calc(100% - 52px);
        min-width: 0;
    }

    .kategori-item .kat-name {
        font-size: 13px;
    }

    .kategori-item .kat-bar {
        margin-top: 4px;
        height: 7px;
    }

    .kategori-item .kat-amount {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-left: 48px;
        text-align: left;
        min-width: unset;
        margin-top: 2px;
    }

    .kategori-item .kat-amount .persen {
        order: 1;
        font-size: 12px;
        color: var(--text-secondary);
    }

    .kategori-item .kat-amount .amount {
        order: 2;
        font-size: 14px;
    }

    .laporan-summary-card .summary-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .laporan-summary-card .summary-value {
        text-align: left;
    }

    /* Auth deco hiding on small phones */
    .auth-deco {
        display: none;
    }

    /* Profile page */
    .profil-header {
        padding: 16px 8px;
    }

    .avatar-selector {
        gap: 6px;
    }

    .avatar-option {
        width: 42px;
        height: 42px;
        font-size: 24px;
    }
}

/* EXTRA SMALL SCREENS (<= 400px) */
@media (max-width: 400px) {
    .main-content {
        padding: 72px 12px 24px;
    }

    .card {
        padding: 14px 12px;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .auth-logo h1 {
        font-size: 22px;
    }

    .auth-logo .logo-icon {
        font-size: 44px;
    }

    .tipe-btn {
        font-size: 12px;
        padding: 8px 2px;
    }

    .stat-card .stat-info .stat-value {
        font-size: 17px;
    }
}
