@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* ===================== AUTH PAGES ===================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 40px 35px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card .logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-card .logo .icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.auth-card .logo h1 {
    font-size: 1.5rem;
    color: #333;
    font-weight: 700;
}

.auth-card .logo p {
    color: #888;
    font-size: 0.9rem;
    margin-top: 5px;
}

.auth-card .form-group {
    margin-bottom: 20px;
    position: relative;
}

.auth-card .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.auth-card .form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s;
    background: #f8f9fa;
}

.auth-card .form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.auth-card .form-group .input-icon {
    position: absolute;
    right: 16px;
    top: 42px;
    color: #aaa;
    font-size: 1.2rem;
}

.remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.remember-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
}

.remember-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.btn-auth {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-auth:active {
    transform: translateY(0);
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9rem;
    color: #888;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ===================== HEADER ===================== */
/* Header styles are now self-contained in header.php */

/* ===================== CARDS ===================== */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.card h3 {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.card .amount {
    font-size: 1.6rem;
    font-weight: 700;
}

.card .card-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    opacity: 0.3;
}

.card.income::before { background: linear-gradient(90deg, #27ae60, #2ecc71); }
.card.income .amount { color: #27ae60; }

.card.expense::before { background: linear-gradient(90deg, #e74c3c, #ec7063); }
.card.expense .amount { color: #e74c3c; }

.card.balance::before { background: linear-gradient(90deg, #667eea, #764ba2); }
.card.balance .amount { color: #2980b9; }

/* ===================== FORMS ===================== */
.form-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin: 25px 0;
}

.form-container h2 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.3rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s;
    background: #f8f9fa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #ec7063);
    color: white;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* ===================== TABLE ===================== */
.table-container {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin: 25px 0;
    overflow-x: auto;
}

.table-container h2,
.table-container h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 13px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tr {
    transition: background 0.2s;
}

table tr:hover {
    background: #f8f9fa;
}

.type-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-badge.income {
    background: #d4edda;
    color: #155724;
}

.type-badge.expense {
    background: #f8d7da;
    color: #721c24;
}

/* ===================== FILTER ===================== */
.filter-bar {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin: 25px 0;
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-bar .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

/* ===================== MESSAGES ===================== */
.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin: 20px 0;
    font-weight: 500;
    font-size: 0.9rem;
    animation: slideUp 0.3s ease;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===================== SETTINGS TABS ===================== */
.settings-tabs {
    display: flex;
    gap: 8px;
    margin: 25px 0 0 0;
    flex-wrap: wrap;
}

.settings-tabs .tab {
    padding: 10px 20px;
    background: white;
    border-radius: 10px 10px 0 0;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.settings-tabs .tab:hover {
    color: #667eea;
    background: #f8f9fa;
}

.settings-tabs .tab.active {
    color: #667eea;
    background: white;
    font-weight: 600;
    box-shadow: 0 -4px 15px rgba(102, 126, 234, 0.15);
    border-bottom: 3px solid #667eea;
}

.settings-tabs .tab.tab-danger {
    color: #e74c3c;
}

.settings-tabs .tab.tab-danger.active {
    border-bottom-color: #e74c3c;
}

/* ===================== FOOTER ===================== */
footer {
    text-align: center;
    padding: 25px 20px;
    color: #888;
    font-size: 0.85rem;
    margin-top: 40px;
}

/* ===================== PAGE TITLE ===================== */
.page-title {
    margin-top: 25px;
    margin-bottom: 5px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
}

.page-subtitle {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* ===================== RESPONSIVE ===================== */

/* Tablets */
@media (max-width: 768px) {
    .container, .page-container {
        padding: 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .summary-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card {
        padding: 20px;
    }

    .card .amount {
        font-size: 1.4rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-group {
        min-width: unset;
    }

    table {
        font-size: 0.85rem;
    }

    table th, table td {
        padding: 10px 8px;
    }

    .btn-sm {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .auth-card {
        padding: 30px 25px;
    }

    .form-container {
        padding: 20px;
    }

    .table-container {
        padding: 15px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .card .amount {
        font-size: 1.2rem;
    }

    .page-title {
        font-size: 1.2rem;
    }
}
