* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #fafafa;
    color: #1a1a1a;
    line-height: 1.5;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #e5e7eb;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    max-width: 1440px;
    margin: 0 auto;
}

.nav-brand {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-brand i {
    color: #3b82f6;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover,
.nav-link.active {
    color: #3b82f6;
    background: #eff6ff;
}

.pages {
    padding: 32px 0;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stats-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.stats-section h2 {
    margin-bottom: 20px;
    color: #111827;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
}

.period-selector {
    margin-bottom: 20px;
    text-align: left;
}

.period-selector label {
    font-weight: 500;
    margin-right: 10px;
    color: #374151;
    font-size: 14px;
}

.period-selector select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #374151;
    font-size: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #111827;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
}

.stat-item .stat-label {
    color: #374151;
    font-weight: 500;
}

.stat-item .stat-value {
    font-weight: 600;
    color: #111827;
}

.chart-container {
    height: 300px;
    margin-top: 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h2 {
    color: #111827;
    font-size: 24px;
    font-weight: 600;
}

.search-box {
    position: relative;
    width: 300px;
    max-width: 100%;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 24px;
    max-height: 500px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

thead {
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

th:hover {
    background: #f3f4f6;
}

th i {
    margin-left: 4px;
    color: #9ca3af;
}

td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

tr:hover {
    background: #f9fafb;
}

.btn {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    color: #374151;
    text-decoration: none;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 11px;
}

.btn-primary {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.btn-secondary {
    background: #6b7280;
    color: #ffffff;
    border-color: #6b7280;
}

.btn-secondary:hover {
    background: #4b5563;
    border-color: #4b5563;
}

.btn-info {
    background: #0ea5e9;
    color: #ffffff;
    border-color: #0ea5e9;
}

.btn-info:hover {
    background: #0284c7;
    border-color: #0284c7;
}

.btn-edit {
    background: #f59e0b;
    color: #ffffff;
    border-color: #f59e0b;
}

.btn-edit:hover {
    background: #d97706;
    border-color: #d97706;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.pagination-btn {
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: #2563eb;
}

.pagination-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

#page-info {
    font-size: 14px;
    color: #6b7280;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: #ffffff;
    margin: 5% auto;
    border-radius: 12px;
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.wide-modal {
    width: 90%;
    max-width: 1000px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    color: #111827;
    font-size: 20px;
    font-weight: 600;
}

.close {
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #374151;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
    transition: all 0.2s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.tab-button {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-button.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        gap: 16px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid, .breakdown-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}