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

body {
    font-family: 'Poppins', sans-serif;
    background: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

.auth-body {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.auth-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header i {
    font-size: 2.5rem;
    color: #2563eb;
    margin-bottom: 15px;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.auth-header p {
    color: #64748b;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-group label i {
    color: #2563eb;
    width: 16px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.auth-footer p {
    color: #64748b;
    font-size: 0.9rem;
}

.auth-footer a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

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

/* Header Styles */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 70px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #2563eb;
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: #2563eb;
}

.nav-link.admin {
    color: #dc2626;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #374151;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #64748b;
    transition: color 0.3s ease;
}

.logout-btn:hover {
    color: #dc2626;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

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

.page-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.page-header p {
    color: #64748b;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.income {
    background: #dcfce7;
    color: #166534;
}

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

.stat-icon.net {
    background: #dbeafe;
    color: #1e40af;
}

.stat-icon.total {
    background: #fef3c7;
    color: #92400e;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-amount {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: all 0.3s ease;
}

.action-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    transform: translateY(-1px);
}

.action-btn.admin {
    border-color: #dc2626;
    color: #dc2626;
}

.action-btn.admin:hover {
    background: #dc2626;
    color: white;
}

/* Recent Section */
.recent-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.recent-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
}

.transactions-list {
    space-y: 15px;
}

.transaction-item {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid;
}

.transaction-item.income {
    border-left-color: #166534;
    background: #f0fdf4;
}

.transaction-item.expense {
    border-left-color: #991b1b;
    background: #fef2f2;
}

.transaction-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transaction-info h4 {
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 5px;
}

.transaction-info p {
    font-size: 0.9rem;
    color: #64748b;
}

.amount {
    font-weight: 600;
    font-size: 1.1rem;
}

.amount.income {
    color: #166534;
}

.amount.expense {
    color: #991b1b;
}

.view-all {
    text-align: center;
    margin-top: 20px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #374151;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: #475569;
}

/* Footer */
.footer {
    background: #1e293b;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 50px;
}

/* Form Sections */
.form-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.form-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

/* Transaction Form */
.transaction-form {
    max-width: 600px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row .form-group:nth-child(3) {
    grid-column: 1 / -1;
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* Transactions Section */
.section-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.filters-form {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group select,
.filter-group input {
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
}

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

.summary-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.summary-card.income {
    border-left: 4px solid #166534;
}

.summary-card.expense {
    border-left: 4px solid #991b1b;
}

.summary-card.net {
    border-left: 4px solid #1e40af;
}

.summary-card i {
    font-size: 1.5rem;
}

.summary-card.income i {
    color: #166534;
}

.summary-card.expense i {
    color: #991b1b;
}

.summary-card.net i {
    color: #1e40af;
}

.summary-card h3 {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 5px;
}

.summary-card span {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

/* Transactions Table */
.transactions-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 0.8fr 1fr 0.5fr;
    gap: 15px;
    padding: 20px;
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e2e8f0;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 0.8fr 1fr 0.5fr;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
}

.table-row:hover {
    background: #f8fafc;
}

.product-cell strong {
    display: block;
    margin-bottom: 5px;
}

.product-cell small {
    color: #64748b;
    font-size: 0.8rem;
}

.type-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.type-badge.income {
    background: #dcfce7;
    color: #166534;
}

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

.amount-cell {
    font-weight: 600;
    font-size: 1rem;
}

.amount-cell.income {
    color: #166534;
}

.amount-cell.expense {
    color: #991b1b;
}

.actions-cell {
    display: flex;
    gap: 10px;
}

.delete-btn {
    color: #ef4444;
    text-decoration: none;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.delete-btn:hover {
    background: #fee2e2;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .filters-form {
        justify-content: center;
    }
}

/* Export Forms */
.export-forms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.export-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.export-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.export-header i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.export-header.pdf i {
    color: #dc2626;
}

.export-header.csv i {
    color: #166534;
}

.export-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.export-header p {
    color: #64748b;
    font-size: 0.9rem;
}

.pdf-btn {
    background: #dc2626;
    width: 100%;
}

.pdf-btn:hover {
    background: #b91c1c;
}

.csv-btn {
    background: #166534;
    width: 100%;
}

.csv-btn:hover {
    background: #14532d;
}

/* Form adjustments for export */
.export-card .form-row {
    grid-template-columns: 1fr 1fr;
}

.export-card .form-group {
    margin-bottom: 20px;
}

/* Recent transactions in export page */
.recent-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-top: 40px;
}

.recent-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
}

.transaction-item .transaction-amount small {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .export-forms {
        grid-template-columns: 1fr;
    }
    
    .export-card .form-row {
        grid-template-columns: 1fr;
    }
}

/* Admin Styles */
.admin-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.section-count {
    background: #2563eb;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Admin Tables */
.admin-table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.admin-table th {
    background: #f8fafc;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e2e8f0;
}

.admin-table td {
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
}

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

/* User Info */
.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-info strong {
    color: #1e293b;
}

.user-info small {
    color: #64748b;
    font-size: 0.8rem;
}

/* Badges */
.badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.badge.current {
    background: #dbeafe;
    color: #1e40af;
}

.role-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.role-badge.admin {
    background: #fef3c7;
    color: #92400e;
}

.role-badge.user {
    background: #dbeafe;
    color: #1e40af;
}

.type-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.type-badge.income {
    background: #dcfce7;
    color: #166534;
}

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

/* Actions */
.actions {
    white-space: nowrap;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #dc2626;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.75rem;
}

.text-muted {
    color: #9ca3af;
    font-style: italic;
}

/* Amount Cells */
.amount {
    font-weight: 600;
    font-size: 0.9rem;
}

.amount.income {
    color: #166534;
}

.amount.expense {
    color: #991b1b;
}

.amount small {
    display: block;
    font-weight: normal;
    color: #64748b;
    font-size: 0.75rem;
    margin-top: 4px;
}

/* Summary Cards for Admin */
.admin-section .summary-cards {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Responsive */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .admin-table {
        font-size: 0.8rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 10px 8px;
    }
    
    .actions {
        white-space: normal;
    }
    
    .btn-danger {
        padding: 6px 8px;
        font-size: 0.7rem;
    }
}