/* PV Accountant - Dark Theme matching UI Mocks */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0f;
    color: #e2e8f0;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - Exact match to mock */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1e 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.app-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.app-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.nav-menu {
    padding: 24px 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 4px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #94a3b8;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #e2e8f0;
}

.nav-item.active {
    background: rgba(102, 126, 234, 0.15);
    color: #fff;
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

/* Main Content - Exact match to mock */
.main-content {
    margin-left: 280px;
    flex: 1;
    background: #0a0a0f;
}

.top-header {
    background: #12121a;
    padding: 24px 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-info h1 {
    font-size: 48px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 16px;
    color: #64748b;
    font-weight: 400;
}

.top-right {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    font-size: 15px;
}

.content-area {
    padding: 40px;
}

/* KPI Cards Grid - Exact match to mock */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    background: #16161f;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.kpi-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.kpi-icon {
    font-size: 20px;
}

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

.kpi-value {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.kpi-value.negative {
    color: #ef4444;
}

.kpi-sparkline {
    height: 50px;
    margin-top: 12px;
}

.kpi-sparkline svg {
    width: 100%;
    height: 100%;
}

/* Weekly Summary Card */
.summary-card {
    background: #16161f;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
}

.summary-title {
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.summary-label {
    font-size: 14px;
    color: #64748b;
}

.summary-value {
    font-size: 14px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Dashboard Grid - Two column layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

/* AI Insights Section - Left column */
.insights-section {
    background: #16161f;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 32px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.insight-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.insight-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.insight-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.insight-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.insight-icon.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.insight-text {
    font-size: 15px;
    color: #e2e8f0;
    line-height: 1.5;
}

/* Weekly Summary Chart - Right column */
.chart-section {
    background: #16161f;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 32px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: #e2e8f0;
}

.chart-tabs {
    display: flex;
    gap: 8px;
}

.tab-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    border-color: #667eea;
}

/* Bar Chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 240px;
    gap: 12px;
    margin-bottom: 20px;
}

.bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 200px;
    width: 100%;
    justify-content: center;
}

.bar {
    width: 12px;
    border-radius: 4px 4px 0 0;
}

.bar.income {
    background: #10b981;
}

.bar.expense {
    background: #3b82f6;
}

.bar.variance {
    background: #94a3b8;
}

.bar-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.chart-legend {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #94a3b8;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Table Section */
.table-section {
    background: #16161f;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
}

.table-header {
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

thead {
    background: #1a1a24;
}

th {
    text-align: left;
    padding: 16px 32px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

td {
    padding: 20px 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
    color: #e2e8f0;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.code-cell {
    color: #64748b;
    font-size: 13px;
}

.amount-positive {
    color: #10b981;
    font-weight: 600;
}

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

.confidence-high {
    color: #10b981;
    font-weight: 600;
}

.confidence-medium {
    color: #f59e0b;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
    }
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}
