* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f6fa;
    color: #2c3e50;
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    background: #2c3e50;
    color: white;
    padding: 0;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: white;
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    background: none;
    width: 100%;
    font-size: 14px;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background-color: rgba(74, 144, 226, 0.3);
    color: white;
    border-right: 3px solid #4a90e2;
}

.nav-item i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    background-color: #f5f6fa;
}

/* Top Header */
.top-header {
    background: white;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e1e8ed;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-box {
    position: relative;
    width: 400px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 45px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background-color: #f8f9fa;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e1e8ed;
}

/* Page Header */
.page-header {
    padding: 32px 32px 24px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.breadcrumb {
    color: #6c757d;
    font-size: 14px;
}

/* Content Sections */
.content-section {
    display: none;
    padding-bottom: 32px;
}

.content-section.active {
    display: block;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 0 32px 24px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-card.orange {
    background: linear-gradient(135deg, #ff9500 0%, #ff7b00 100%);
}

.stat-card.yellow {
    background: linear-gradient(135deg, #ffcc02 0%, #ff9500 100%);
}

.stat-card.red {
    background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.stat-header h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-header i {
    font-size: 20px;
    opacity: 0.8;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}

.stat-sub {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.9;
}

/* Info Row */
.info-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 0 32px 32px;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-icon {
    width: 48px;
    height: 48px;
    background: #e8f4f8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a90e2;
}

.info-icon.overdue {
    background: #fff5f5;
    color: #ff4757;
}

.info-content {
    flex: 1;
}

.info-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}

.info-value {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 2px;
}

.info-sublabel {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}

.info-amount {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.progress-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: #6c757d;
}

.progress-total {
    font-weight: 700;
    color: #2c3e50;
}

.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2, #357abd);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 0 32px 32px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.chart-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.chart-actions select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* Bar Chart */
.bar-chart {
    height: 200px;
    position: relative;
}

.chart-bars {
    display: flex;
    align-items: end;
    height: 100%;
    gap: 8px;
    padding: 20px 0;
}

.bar {
    flex: 1;
    background: linear-gradient(180deg, #4a90e2 0%, #357abd 100%);
    border-radius: 4px 4px 0 0;
    min-height: 20px;
    transition: all 0.3s ease;
}

.bar:hover {
    opacity: 0.8;
}

/* Pie Chart */
.pie-chart-container {
    display: flex;
    align-items: center;
    gap: 40px;
}

.pie-chart {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(
        #4CAF50 0deg 126deg,
        #2196F3 126deg 216deg,
        #FF9800 216deg 288deg,
        #F44336 288deg 331deg,
        #9C27B0 331deg 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.pie-chart::before {
    content: '';
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    position: absolute;
}

.pie-center {
    text-align: center;
    z-index: 1;
}

.pie-value {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
}

.pie-label {
    font-size: 12px;
    color: #6c757d;
}

.pie-legend {
    flex: 1;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 14px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-value {
    margin-left: auto;
    font-weight: 600;
    color: #6c757d;
}

/* Tables Row */
.tables-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 32px;
}

.table-card {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
}

.table-card.blue {
    border-top: 4px solid #4a90e2;
}

.table-card.green {
    border-top: 4px solid #4CAF50;
}

.table-card.red {
    border-top: 4px solid #ff4757;
}

.table-header {
    padding: 24px;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.table-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.table-header p {
    font-size: 14px;
    color: #6c757d;
}

.view-more-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: #4a90e2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.view-more-btn:hover {
    background: #357abd;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 16px 24px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e9ecef;
}

.data-table td {
    padding: 16px 24px;
    font-size: 14px;
    color: #2c3e50;
    border-bottom: 1px solid #f1f3f4;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.success {
    background: #e8f5e8;
    color: #4CAF50;
}

.status-badge.warning {
    background: #fff8e1;
    color: #ff9500;
}

.status-badge.urgent {
    background: #ffebee;
    color: #ff4757;
}

/* Form Styles */
.form-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    margin: 0 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-primary i {
    font-size: 16px;
}

/* Alert Styles */
.alert {
    padding: 16px 24px;
    border-radius: 8px;
    margin: 16px 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.alert.success {
    background: #e8f5e8;
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.alert i {
    font-size: 18px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #2c3e50;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .pie-chart-container {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
        padding: 0 16px 24px;
    }
    
    .info-row {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 16px 32px;
    }
    
    .charts-row,
    .tables-row {
        padding: 0 16px 32px;
    }
    
    .form-card {
        margin: 0 16px;
        padding: 24px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .top-header {
        padding: 16px;
    }
    
    .search-box {
        width: 100%;
        max-width: 300px;
    }
    
    .page-header {
        padding: 24px 16px 16px;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 16px;
    }
    
    .table-header {
        padding: 16px;
    }
    
    .view-more-btn {
        position: static;
        margin-top: 12px;
    }
}

@media (max-width: 480px) {
    .info-row {
        grid-template-columns: 1fr;
    }
    
    .info-card {
        padding: 16px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .chart-card {
        padding: 20px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 12px;
        font-size: 11px;
    }
}

/* Animation for page transitions */
.content-section {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.content-section.active {
    opacity: 1;
    transform: translateY(0);
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Focus styles for accessibility */
.nav-item:focus,
.btn-primary:focus,
.form-group input:focus,
.form-group select:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .sidebar,
    .top-header {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-section {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
    }
}