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

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

.navigation {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav-brand {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

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

.nav-link {
    text-decoration: none;
    color: #7f8c8d;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #2c3e50;
    background: rgba(102, 126, 234, 0.1);
}

.nav-link.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.15);
    font-weight: 600;
}

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dashboard-header h1 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
}

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

.filters label {
    font-weight: 500;
    color: #555;
}

.filters select {
    padding: 10px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filters select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.metrics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card-header h3 {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.card-value {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.card-change {
    font-size: 14px;
    font-weight: 500;
    color: #27ae60;
}

.card-change.negative {
    color: #e74c3c;
}

.charts-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: 350px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chart-card h3 {
    flex-shrink: 0;
    margin-bottom: 15px;
}

.chart-card canvas {
    flex: 1;
    max-height: 280px !important;
    min-height: 200px !important;
    width: 100% !important;
    object-fit: contain;
}

.chart-card h3 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.data-table {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.data-table h3 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e1e8ed;
}

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

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    color: #333;
    font-size: 14px;
}

tr:hover {
    background: #f8f9fa;
}

.amount-positive {
    color: #27ae60;
    font-weight: 600;
}

.amount-negative {
    color: #e74c3c;
    font-weight: 600;
}

/* PnL Report Styles */
.pnl-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.summary-card.revenue {
    border-left: 4px solid #27ae60;
}

.summary-card.expenses {
    border-left: 4px solid #e74c3c;
}

.summary-card.profit {
    border-left: 4px solid #3498db;
}

.summary-card.margin {
    border-left: 4px solid #f39c12;
}

.summary-header h3 {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.summary-value {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.summary-change {
    font-size: 14px;
    font-weight: 500;
}

.summary-card.revenue .summary-change {
    color: #27ae60;
}

.summary-card.expenses .summary-change {
    color: #e74c3c;
}

.summary-card.profit .summary-change {
    color: #3498db;
}

.summary-card.margin .summary-change {
    color: #f39c12;
}

.pnl-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.pnl-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pnl-section h2 {
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.pnl-table-container {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e1e8ed;
}

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

.pnl-table th,
.pnl-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

.pnl-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pnl-table td {
    color: #333;
    font-size: 14px;
}

.pnl-table tr:hover {
    background: #f8f9fa;
}

.pnl-table .highlight-row {
    background: rgba(102, 126, 234, 0.1);
    font-weight: 600;
}

.pnl-table .highlight-row td {
    border-top: 2px solid #667eea;
    border-bottom: 2px solid #667eea;
}

.pnl-table .variance-positive {
    color: #27ae60;
    font-weight: 600;
}

.pnl-table .variance-negative {
    color: #e74c3c;
    font-weight: 600;
}

.pnl-table .variance-neutral {
    color: #7f8c8d;
}

.pnl-metrics {
    margin-bottom: 30px;
}

.metric-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.metric-card h3 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.kpi-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.kpi-label {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 500;
}

.kpi-value {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 700;
}

/* Responsive design */
@media (max-width: 768px) {
    .dashboard {
        padding: 15px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .chart-card {
        height: 300px;
        padding: 20px;
    }
    
    .chart-card canvas {
        max-height: 220px !important;
        min-height: 150px !important;
    }
    
    .metrics-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .card {
        padding: 20px;
    }
    
    .card-value {
        font-size: 24px;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-links {
        gap: 15px;
    }
    
    .pnl-details {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .pnl-summary {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .summary-card {
        padding: 20px;
    }
    
    .summary-value {
        font-size: 24px;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .metrics-cards {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters select {
        width: 100%;
    }
}
