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

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --dark-color: #1e293b;
    --light-color: #f1f5f9;
    --border-radius: 8px;
    --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--dark-color);
}

/* Navbar */
.navbar {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-brand h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.nav-brand p {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.nav-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-info {
    padding: 0.5rem 1rem;
    background: var(--light-color);
    border-radius: var(--border-radius);
    font-weight: 500;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.card .amount {
    font-size: 2rem;
    font-weight: bold;
}

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

.card-income .amount {
    color: var(--success-color);
}

.card-expense .amount {
    color: var(--danger-color);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #0891b2;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Action Section */
.action-section {
    margin-bottom: 2rem;
    text-align: center;
}

/* Transactions Section */
.transactions-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
}

.transactions-section h2 {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.table-responsive {
    overflow-x: auto;
}

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

.transactions-table thead {
    background: var(--light-color);
}

.transactions-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
}

.transactions-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

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

.transaction-id {
    font-family: monospace;
    background: var(--light-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-income {
    background: #d1fae5;
    color: #065f46;
}

.badge-expense {
    background: #fee2e2;
    color: #991b1b;
}

.amount-income {
    color: var(--success-color);
    font-weight: 600;
}

.amount-expense {
    color: var(--danger-color);
    font-weight: 600;
}

.text-muted {
    color: var(--secondary-color);
}

/* Filter Section */
.filter-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
}

.filter-section h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-controls select,
.filter-controls input {
    padding: 0.5rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    flex: 1;
    min-width: 200px;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.logo-section {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-section h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.logo-section p {
    color: var(--secondary-color);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

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

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Public Link */
.public-link {
    text-align: center;
    margin-top: 1.5rem;
}

.public-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.public-link a:hover {
    text-decoration: underline;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 2rem auto;
    padding: 0;
    border-radius: var(--border-radius);
    max-width: 600px;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    margin: 0;
}

.close {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
    cursor: pointer;
    line-height: 1;
}

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

.modal form {
    padding: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Footer Info */
.footer-info {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 2rem;
    text-align: center;
    box-shadow: var(--box-shadow);
}

.footer-info p {
    color: var(--secondary-color);
    margin: 0.5rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .nav-container {
        flex-direction: column;
        text-align: center;
    }

    .nav-menu {
        flex-direction: column;
        width: 100%;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .transactions-table {
        font-size: 0.75rem;
    }

    .transactions-table th,
    .transactions-table td {
        padding: 0.5rem;
    }

    .filter-controls {
        flex-direction: column;
    }

    .filter-controls select,
    .filter-controls input {
        min-width: 100%;
    }
}

@media print {
    body {
        background: white;
        padding: 0;
    }

    .navbar,
    .action-section,
    .filter-section,
    .footer-info {
        display: none;
    }

    .transactions-section {
        box-shadow: none;
    }
}
