* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ===== LOGIN ===== */
#loginPage, #registerPage {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-container {
    background: white;
    padding: 40px 28px;
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
    max-width: 420px;
    width: 100%;
    border: 2px solid #e8e0f0;
}

.login-container .logo {
    text-align: center;
    margin-bottom: 6px;
}
.login-container .logo i {
    font-size: 56px;
    background: linear-gradient(135deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff, #9b59b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-container h2 {
    text-align: center;
    color: #1a237e;
    font-size: 26px;
    font-weight: 800;
}
.login-container .subtitle {
    text-align: center;
    color: #777;
    font-size: 14px;
    margin-bottom: 24px;
}

.login-container .form-group {
    margin-bottom: 18px;
}
.login-container label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: #333;
    margin-bottom: 5px;
}
.login-container input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 14px;
    font-size: 15px;
    transition: all 0.25s;
    background: #fafafa;
}
.login-container input:focus {
    border-color: #6a1b9a;
    outline: none;
    box-shadow: 0 0 0 4px rgba(106,27,154,0.08);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #6a1b9a, #8e24aa);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 6px 20px rgba(106,27,154,0.25);
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(106,27,154,0.35);
}

.error-msg {
    background: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 18px;
    border-left: 4px solid #c62828;
}
.success-msg {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 18px;
    border-left: 4px solid #2e7d32;
}

.register-link {
    text-align: center;
    margin-top: 18px;
    color: #666;
    font-size: 14px;
}
.register-link a {
    color: #6a1b9a;
    font-weight: 700;
    text-decoration: none;
}
.register-link a:hover {
    text-decoration: underline;
}

/* ===== DASHBOARD ===== */
.header {
    background: linear-gradient(135deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff, #9b59b6);
    background-size: 300% 300%;
    animation: gradientMove 6s ease infinite;
    color: white;
    padding: 24px 22px;
    border-radius: 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(255,107,107,0.25);
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.header h1 {
    font-size: 26px;
    font-weight: 800;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-badge {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    padding: 10px 18px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-logout:hover {
    background: rgba(255,255,255,0.35);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-info .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* ===== SUMMARY CARDS ===== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: white;
    padding: 20px 18px;
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}
.card .label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.card .amount {
    font-size: 28px;
    font-weight: 800;
    margin-top: 4px;
}
.card .icon {
    position: absolute;
    right: 12px;
    bottom: 12px;
    font-size: 44px;
    opacity: 0.10;
}

.card.income { border-color: #2e7d32; background: #e8f5e9; }
.card.income::before { background: #43a047; }
.card.income .label { color: #1b5e20; }
.card.income .amount { color: #2e7d32; }

.card.expense { border-color: #c62828; background: #ffebee; }
.card.expense::before { background: #e53935; }
.card.expense .label { color: #b71c1c; }
.card.expense .amount { color: #c62828; }

.card.balance { border-color: #1a237e; background: #e8eaf6; }
.card.balance::before { background: #3949ab; }
.card.balance .label { color: #1a237e; }
.card.balance .amount { color: #1a237e; }

.card.count { border-color: #e65100; background: #fff3e0; }
.card.count::before { background: #f57c00; }
.card.count .label { color: #bf360c; }
.card.count .amount { color: #e65100; }

/* ===== FORM ===== */
.form-section {
    background: white;
    padding: 24px 20px;
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    margin-bottom: 24px;
    border: 2px solid #ce93d8;
}
.form-section h2 {
    font-size: 18px;
    margin-bottom: 18px;
    color: #6a1b9a;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.form-group label {
    font-size: 12px;
    font-weight: 700;
    color: #4a148c;
}
.form-group input, .form-group select {
    padding: 10px 14px;
    border: 2px solid #e1bee7;
    border-radius: 14px;
    font-size: 14px;
    background: white;
    width: 100%;
}
.form-group input:focus, .form-group select:focus {
    border-color: #8e24aa;
    outline: none;
    box-shadow: 0 0 0 4px rgba(142,36,170,0.10);
}

.btn-primary {
    background: linear-gradient(135deg, #6a1b9a, #8e24aa);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(106,27,154,0.25);
    width: 100%;
    justify-content: center;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(106,27,154,0.35);
}

/* ===== FILTER BAR ===== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: white;
    padding: 16px 18px;
    border-radius: 18px;
    border: 2px solid #b2dfdb;
    margin-bottom: 20px;
}
.filter-bar select, .filter-bar input {
    padding: 8px 12px;
    border: 2px solid #b2dfdb;
    border-radius: 12px;
    font-size: 13px;
    background: white;
    flex: 1 0 120px;
}
.filter-bar select:focus, .filter-bar input:focus {
    border-color: #00897b;
    outline: none;
}

.btn-filter, .btn-reset, .btn-export {
    padding: 8px 16px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.btn-filter { background: #00695c; color: white; }
.btn-reset { background: #e65100; color: white; }
.btn-export { background: #1b5e20; color: white; }

/* ===== TABLE ===== */
.table-wrapper {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid #e8e0f0;
}
.table-scroll {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 600px;
}
th {
    background: linear-gradient(135deg, #1a237e, #3949ab);
    padding: 14px;
    text-align: left;
    font-weight: 700;
    color: white;
    font-size: 12px;
}
td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
}
tr:hover td {
    background: #f3e5f5 !important;
}

.badge {
    display: inline-block;
    padding: 3px 14px;
    border-radius: 40px;
    font-size: 11px;
    font-weight: 700;
}
.badge-income { background: #a5d6a7; color: #1b5e20; }
.badge-expense { background: #ef9a9a; color: #b71c1c; }

.btn-danger {
    background: #c62828;
    color: white;
    padding: 4px 12px;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.btn-danger:hover {
    transform: scale(1.08);
}

.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: #999;
}
.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.export-bar {
    display: flex;
    justify-content: flex-end;
    padding: 12px 18px;
    background: #f5f5f5;
    border-top: 2px solid #e0e0e0;
    font-weight: 600;
    color: #1a237e;
}

/* ===== TABS ===== */
.nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    background: white;
    padding: 8px;
    border-radius: 16px;
    border: 2px solid #e8e0f0;
}
.nav-tabs a {
    padding: 10px 20px;
    border-radius: 12px;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-tabs a:hover { background: #f3e5f5; }
.nav-tabs a.active {
    background: linear-gradient(135deg, #6a1b9a, #8e24aa);
    color: white;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}
.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.quarter-summary {
    background: white;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 24px;
    border: 2px solid #e8e0f0;
}
.quarter-summary h3 { margin-bottom: 16px; color: #1a237e; }
.quarter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.quarter-card {
    background: #f5f5f5;
    padding: 14px;
    border-radius: 14px;
    border-left: 4px solid #6a1b9a;
}
.quarter-label { font-weight: 700; color: #1a237e; }
.quarter-income { color: #2e7d32; font-size: 13px; }
.quarter-expense { color: #c62828; font-size: 13px; }

.flash-message {
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.flash-message.success { background: #e8f5e9; color: #2e7d32; border: 2px solid #a5d6a7; }
.flash-message.error { background: #ffebee; color: #c62828; border: 2px solid #ef9a9a; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    body { padding: 10px; }
    .header { flex-direction: column; text-align: center; }
    .date-badge { justify-content: center; width: 100%; }
    .summary-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .card .amount { font-size: 18px; }
    .form-row { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; }
    .nav-tabs a { font-size: 12px; padding: 8px 12px; }
    .quarter-grid { grid-template-columns: 1fr 1fr; }
}