/**
 * Dashboard Enhanced Widgets Styles
 * Unified Design System
 */

/* ============================================
   DESIGN SYSTEM - CSS Variables
   ============================================ */
:root {
    /* Primary Colors */
    --ds-primary: #6366f1;
    --ds-primary-light: #818cf8;
    --ds-primary-dark: #4f46e5;
    --ds-primary-bg: rgba(99, 102, 241, 0.1);

    /* Semantic Colors */
    --ds-success: #10b981;
    --ds-success-light: #34d399;
    --ds-success-bg: rgba(16, 185, 129, 0.1);

    --ds-warning: #f59e0b;
    --ds-warning-light: #fbbf24;
    --ds-warning-bg: rgba(245, 158, 11, 0.1);

    --ds-danger: #ef4444;
    --ds-danger-light: #f87171;
    --ds-danger-bg: rgba(239, 68, 68, 0.1);

    --ds-info: #06b6d4;
    --ds-info-light: #22d3ee;
    --ds-info-bg: rgba(6, 182, 212, 0.1);

    /* Neutral Colors */
    --ds-text-primary: #0f172a;
    --ds-text-secondary: #64748b;
    --ds-text-muted: #94a3b8;
    --ds-border: #e2e8f0;
    --ds-border-light: #f1f5f9;
    --ds-bg-page: #f8fafc;
    --ds-bg-card: #ffffff;

    /* Spacing */
    --ds-spacing-xs: 0.5rem;
    --ds-spacing-sm: 0.75rem;
    --ds-spacing-md: 1rem;
    --ds-spacing-lg: 1.5rem;
    --ds-spacing-xl: 2rem;

    /* Border Radius */
    --ds-radius-sm: 8px;
    --ds-radius-md: 12px;
    --ds-radius-lg: 16px;
    --ds-radius-full: 9999px;

    /* Shadows */
    --ds-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --ds-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --ds-shadow-lg: 0 10px 25px -5px rgba(99, 102, 241, 0.1), 0 6px 10px -5px rgba(0, 0, 0, 0.04);
    --ds-shadow-xl: 0 20px 40px -10px rgba(99, 102, 241, 0.15);
}

/* ============================================
   UNIFIED CARD COMPONENT
   ============================================ */
.unified-card {
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    border: 1px solid var(--ds-border);
    box-shadow: var(--ds-shadow-md);
    overflow: hidden;
    transition: all 0.3s ease;
}

.unified-card:hover {
    box-shadow: var(--ds-shadow-lg);
    transform: translateY(-2px);
}

.unified-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--ds-spacing-md) var(--ds-spacing-lg);
    border-bottom: 1px solid var(--ds-border-light);
    background: linear-gradient(135deg, #fafafa, var(--ds-bg-card));
}

.unified-card-title {
    display: flex;
    align-items: center;
    gap: var(--ds-spacing-sm);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ds-text-primary);
    margin: 0;
}

.unified-card-title .icon-box {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ds-primary), var(--ds-primary-light));
    color: white;
    border-radius: var(--ds-radius-sm);
    font-size: 0.875rem;
}

.unified-card-body {
    padding: var(--ds-spacing-lg);
}

.unified-card-footer {
    padding: var(--ds-spacing-md) var(--ds-spacing-lg);
    border-top: 1px solid var(--ds-border-light);
    background: var(--ds-bg-page);
}

/* ============================================
   UNIFIED STAT CARD (KPI)
   ============================================ */
.stat-card {
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    border: 1px solid var(--ds-border);
    padding: var(--ds-spacing-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ds-primary), var(--ds-primary-light));
}

.stat-card:hover {
    box-shadow: var(--ds-shadow-lg);
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--ds-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: var(--ds-spacing-sm);
    flex-shrink: 0;
}

.stat-card-icon.primary {
    background: var(--ds-primary-bg);
    color: var(--ds-primary);
}

.stat-card-icon.success {
    background: var(--ds-success-bg);
    color: var(--ds-success);
}

.stat-card-icon.warning {
    background: var(--ds-warning-bg);
    color: var(--ds-warning);
}

.stat-card-icon.danger {
    background: var(--ds-danger-bg);
    color: var(--ds-danger);
}

.stat-card-icon.info {
    background: var(--ds-info-bg);
    color: var(--ds-info);
}

.stat-card-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ds-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.stat-card-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ds-text-primary);
    line-height: 1.3;
    word-break: break-word;
}

.stat-card-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: var(--ds-spacing-xs);
    padding: 2px 8px;
    border-radius: var(--ds-radius-full);
}

.stat-card-change.positive {
    background: var(--ds-success-bg);
    color: var(--ds-success);
}

.stat-card-change.negative {
    background: var(--ds-danger-bg);
    color: var(--ds-danger);
}

/* ============================================
   UNIFIED SECTION HEADERS
   ============================================ */
.section-header-unified {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: var(--ds-spacing-xl) 0 var(--ds-spacing-md);
}

.section-header-unified h2 {
    display: flex;
    align-items: center;
    gap: var(--ds-spacing-sm);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ds-text-primary);
    margin: 0;
}

.section-header-unified h2 i {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ds-primary-bg);
    color: var(--ds-primary);
    border-radius: var(--ds-radius-sm);
    font-size: 0.85rem;
}

/* ============================================
   UNIFIED GRID LAYOUTS
   ============================================ */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--ds-spacing-lg);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--ds-spacing-lg);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--ds-spacing-lg);
}

.grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--ds-spacing-lg);
}

.grid-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--ds-spacing-lg);
}

@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-4,
    .grid-3,
    .grid-2,
    .grid-2-1,
    .grid-1-2 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   QUICK STATS CARDS - Additional Row
   ============================================ */
.stats-row-extra {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

/* ============================================
   CHART CONTAINERS - Modern ApexCharts Styling
   ============================================ */
.chart-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
}

.chart-card:hover {
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.1), 0 6px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.chart-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chart-card-title i {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-radius: 10px;
    font-size: 1rem;
}

.chart-card-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #6366f1;
}

.chart-container {
    position: relative;
    min-height: 320px;
}

.chart-container canvas,
.chart-container>div {
    width: 100% !important;
}

.chart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 280px;
    color: #94a3b8;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

.chart-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.chart-empty-state p {
    font-size: 0.95rem;
    font-weight: 500;
}

.chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 200px;
    color: #ef4444;
    background: #fef2f2;
    border-radius: 12px;
}

/* ApexCharts Custom Overrides */
.apexcharts-toolbar {
    top: -10px !important;
}

.apexcharts-menu {
    border-radius: 8px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

.apexcharts-tooltip {
    border-radius: 8px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.apexcharts-xaxistooltip,
.apexcharts-yaxistooltip {
    border-radius: 6px !important;
}

/* ============================================
   RISK CONCENTRATION GAUGE
   ============================================ */
.risk-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

.risk-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--color, #6366f1) calc(var(--progress, 0%) * 3.6deg),
            #e2e8f0 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.risk-circle::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: white;
}

.risk-value {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.risk-label {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #64748b;
}

.risk-developer {
    font-weight: 600;
    color: #334155;
    margin-top: 0.25rem;
}

.risk-badge {
    margin-top: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================
   PAYMENT HEALTH SCORE
   ============================================ */
.health-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

.health-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(var(--color, #10b981) calc(var(--progress, 0%) * 3.6deg),
            #e2e8f0 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.health-circle::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
}

.health-value {
    position: relative;
    z-index: 1;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
}

.health-label {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}

.health-details {
    margin-top: 0.5rem;
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #64748b;
}

/* ============================================
   DEVELOPER RANKING
   ============================================ */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    transition: background 0.2s;
}

.ranking-item:hover {
    background: #f1f5f9;
}

.ranking-position {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: #64748b;
}

.ranking-item:first-child .ranking-position {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.ranking-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ranking-name {
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
}

.ranking-units {
    font-size: 0.75rem;
    color: #94a3b8;
}

.ranking-roi {
    font-weight: 700;
    font-size: 0.9rem;
}

.ranking-roi.positive {
    color: #10b981;
}

.ranking-roi.negative {
    color: #ef4444;
}

/* ============================================
   EQUITY SHARE BLOCKS
   ============================================ */
.equity-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.equity-block {
    padding: 0.75rem;
    border-radius: 8px;
}

.equity-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #334155;
    margin-bottom: 0.25rem;
}

.equity-value {
    font-size: 0.9rem;
    color: #64748b;
}

.equity-pct {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
}

/* ============================================
   OVERDUE ALERTS
   ============================================ */
.alert-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.alert-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    color: #991b1b;
    font-size: 0.9rem;
}

.alert-meta {
    font-size: 0.75rem;
    color: #dc2626;
}

.no-alerts {
    text-align: center;
    padding: 2rem;
    color: #10b981;
    font-size: 0.9rem;
}

.no-alerts i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* ============================================
   HANDOVER TIMELINE
   ============================================ */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    position: relative;
    padding-bottom: 1rem;
}

.timeline-marker {
    position: absolute;
    left: -1.5rem;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #e2e8f0;
}

.timeline-content {
    padding-left: 0.5rem;
}

.timeline-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

.timeline-unit {
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
}

.timeline-days {
    font-size: 0.8rem;
    color: #6366f1;
}

.timeline-empty {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}

/* ============================================
   MILESTONES MINI CALENDAR
   ============================================ */
.calendar-mini {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
}

.calendar-header {
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.calendar-entries {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calendar-entry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
}

.calendar-date {
    width: 40px;
    text-align: center;
}

.date-day {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #6366f1;
}

.date-month {
    display: block;
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
}

.calendar-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.calendar-count {
    font-size: 0.8rem;
    color: #64748b;
}

.calendar-amount {
    font-weight: 600;
    color: #334155;
    font-size: 0.85rem;
}

/* ============================================
   DASHBOARD GRID LAYOUT
   ============================================ */
.dashboard-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.dashboard-charts-grid .chart-card.full-width {
    grid-column: span 2;
}

.dashboard-insights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (max-width: 1200px) {
    .dashboard-charts-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-charts-grid .chart-card.full-width {
        grid-column: span 1;
    }

    .dashboard-insights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-row-extra {
        grid-template-columns: 1fr;
    }

    .dashboard-insights-grid {
        grid-template-columns: 1fr;
    }

    .equity-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   IMPROVED RISK DISTRIBUTION
   ============================================ */
.risk-distribution {
    padding: 0.5rem;
}

.risk-header {
    text-align: center;
    margin-bottom: 1rem;
}

.risk-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
}

.risk-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.75rem;
}

.risk-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.risk-dev-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.risk-dev-pct {
    font-weight: 700;
    font-size: 0.85rem;
    color: #1e293b;
}

.risk-bar-bg {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.risk-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.risk-dev-value {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* ============================================
   RANKING SOURCE NOTE
   ============================================ */
.ranking-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ranking-container .ranking-list {
    flex: 1;
    max-height: 280px;
    overflow-y: auto;
}

.ranking-source {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ranking-source i {
    color: #6366f1;
}

/* ============================================
   DETAILED PAYMENT LIST
   ============================================ */
.payment-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.payment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.payment-item:hover {
    background: #f1f5f9;
    border-color: #6366f1;
    transform: translateX(4px);
}

.payment-date {
    min-width: 45px;
    text-align: center;
    padding: 0.25rem;
    background: #6366f1;
    border-radius: 6px;
}

.payment-day {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.payment-month {
    display: block;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    margin-top: 2px;
}

.payment-details {
    flex: 1;
    min-width: 0;
}

.payment-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payment-desc {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payment-amount {
    font-weight: 700;
    font-size: 0.9rem;
    color: #10b981;
    white-space: nowrap;
}

.payment-arrow {
    color: #cbd5e1;
    font-size: 0.8rem;
}

.payment-item:hover .payment-arrow {
    color: #6366f1;
}

/* Row highlight animation for navigation */
.highlight-row {
    animation: highlightPulse 2s ease-out;
}

@keyframes highlightPulse {

    0%,
    100% {
        background: inherit;
    }

    50% {
        background: rgba(99, 102, 241, 0.2);
    }
}

/* ============================================
   ENHANCED NOTIFICATIONS PAGE
   ============================================ */

/* Notifications Summary Stats */
.notifications-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.notification-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.65rem 1rem;
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-sm);
    border: 1px solid var(--ds-border);
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 140px;
}

.notification-stat:hover {
    box-shadow: var(--ds-shadow-md);
    transform: translateY(-2px);
    border-color: var(--ds-primary-light);
}

.notification-stat.urgent {
    border-left: 4px solid var(--ds-danger);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), transparent);
}

.notification-stat.warning {
    border-left: 4px solid var(--ds-warning);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), transparent);
}

.notification-stat.info {
    border-left: 4px solid var(--ds-primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), transparent);
}

.notification-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.notification-stat.urgent .notification-stat-icon {
    background: var(--ds-danger-bg);
    color: var(--ds-danger);
}

.notification-stat.warning .notification-stat-icon {
    background: var(--ds-warning-bg);
    color: var(--ds-warning);
}

.notification-stat.info .notification-stat-icon {
    background: var(--ds-primary-bg);
    color: var(--ds-primary);
}

.notification-stat-content {
    flex: 1;
}

.notification-stat-label {
    font-size: 0.65rem;
    color: var(--ds-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
    line-height: 1.2;
}

.notification-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ds-text-primary);
    line-height: 1.2;
}

.notification-stat.urgent .notification-stat-value {
    color: var(--ds-danger);
}

.notification-stat.warning .notification-stat-value {
    color: var(--ds-warning);
}

/* Enhanced Filter Tabs */
.notification-filters-enhanced {
    display: flex;
    gap: 8px;
    margin-bottom: 1.5rem;
    padding: 6px;
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-md);
    border: 1px solid var(--ds-border);
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: var(--ds-radius-sm);
    color: var(--ds-text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    background: var(--ds-border-light);
    color: var(--ds-text-primary);
}

.filter-tab.active {
    background: var(--ds-primary);
    color: white;
}

.filter-tab .badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--ds-radius-full);
    background: rgba(0, 0, 0, 0.1);
}

.filter-tab.active .badge-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Time-Based Groups */
.notification-group {
    margin-bottom: 1.5rem;
}

.notification-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ds-text-muted);
}

.notification-group-header i {
    font-size: 0.9rem;
}

.notification-group-header.urgent {
    color: var(--ds-danger);
}

.notification-group-header.today {
    color: var(--ds-primary);
}

/* Compact Notification Row Design */
.notification-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--ds-bg-card);
    border-radius: 8px;
    border: 1px solid var(--ds-border);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.notification-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 3px 0 0 3px;
    background: var(--ds-primary);
}

.notification-row:hover {
    background: var(--ds-border-light);
    transform: translateX(2px);
}

.notification-row.unread {
    background: rgba(99, 102, 241, 0.04);
    font-weight: 500;
}

.notification-row.priority-urgent::before {
    background: var(--ds-danger);
}

.notification-row.priority-high::before {
    background: var(--ds-warning);
}

.notification-row.priority-medium::before {
    background: var(--ds-info);
}

.notification-row.priority-low::before {
    background: var(--ds-success);
}

.notification-row-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.notification-row-icon.danger {
    background: var(--ds-danger-bg);
    color: var(--ds-danger);
}

.notification-row-icon.warning {
    background: var(--ds-warning-bg);
    color: var(--ds-warning);
}

.notification-row-icon.primary {
    background: var(--ds-primary-bg);
    color: var(--ds-primary);
}

.notification-row-icon.success {
    background: var(--ds-success-bg);
    color: var(--ds-success);
}

.notification-row-icon.info {
    background: var(--ds-info-bg);
    color: var(--ds-info);
}

.notification-row-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-row-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ds-text-primary);
    white-space: nowrap;
    min-width: 140px;
}

.notification-row-message {
    font-size: 0.8rem;
    color: var(--ds-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.notification-row-time {
    font-size: 0.7rem;
    color: var(--ds-text-muted);
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
}

.notification-row-dismiss {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--ds-text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
    font-size: 0.7rem;
}

.notification-row:hover .notification-row-dismiss {
    opacity: 1;
}

.notification-row-dismiss:hover {
    background: var(--ds-danger-bg);
    color: var(--ds-danger);
}

/* Notification List Container - Fixed Height, No Scroll */
.notification-list-compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: none;
}

/* Notification Modal */
.notification-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.notification-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.notification-modal {
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.notification-modal-overlay.active .notification-modal {
    transform: scale(1) translateY(0);
}

.notification-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--ds-border);
}

.notification-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.notification-modal-icon.danger {
    background: var(--ds-danger-bg);
    color: var(--ds-danger);
}

.notification-modal-icon.warning {
    background: var(--ds-warning-bg);
    color: var(--ds-warning);
}

.notification-modal-icon.primary {
    background: var(--ds-primary-bg);
    color: var(--ds-primary);
}

.notification-modal-icon.success {
    background: var(--ds-success-bg);
    color: var(--ds-success);
}

.notification-modal-header-content {
    flex: 1;
}

.notification-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ds-text-primary);
    margin-bottom: 2px;
}

.notification-modal-time {
    font-size: 0.8rem;
    color: var(--ds-text-muted);
}

.notification-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ds-border-light);
    border: none;
    color: var(--ds-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.notification-modal-close:hover {
    background: var(--ds-danger-bg);
    color: var(--ds-danger);
}

.notification-modal-body {
    padding: 20px;
}

.notification-modal-message {
    font-size: 0.95rem;
    color: var(--ds-text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.notification-modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.notification-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.notification-modal-btn.primary {
    background: var(--ds-primary);
    color: white;
}

.notification-modal-btn.primary:hover {
    background: var(--ds-primary-dark);
}

.notification-modal-btn.secondary {
    background: var(--ds-border-light);
    color: var(--ds-text-secondary);
}

.notification-modal-btn.secondary:hover {
    background: var(--ds-border);
}

/* Notification Icon */
.notification-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--ds-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.notification-card-icon.danger {
    background: var(--ds-danger-bg);
    color: var(--ds-danger);
}

.notification-card-icon.warning {
    background: var(--ds-warning-bg);
    color: var(--ds-warning);
}

.notification-card-icon.primary {
    background: var(--ds-primary-bg);
    color: var(--ds-primary);
}

.notification-card-icon.success {
    background: var(--ds-success-bg);
    color: var(--ds-success);
}

.notification-card-icon.info {
    background: var(--ds-info-bg);
    color: var(--ds-info);
}

/* Card Content */
.notification-card-body {
    flex: 1;
    min-width: 0;
}

.notification-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 4px;
}

.notification-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ds-text-primary);
}

.notification-card-time {
    font-size: 0.75rem;
    color: var(--ds-text-muted);
    white-space: nowrap;
}

.notification-card-message {
    font-size: 0.85rem;
    color: var(--ds-text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}

/* Action Buttons */
.notification-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.notification-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--ds-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.notification-action-btn.primary {
    background: var(--ds-primary);
    color: white;
}

.notification-action-btn.primary:hover {
    background: var(--ds-primary-dark);
}

.notification-action-btn.secondary {
    background: var(--ds-border-light);
    color: var(--ds-text-secondary);
}

.notification-action-btn.secondary:hover {
    background: var(--ds-border);
    color: var(--ds-text-primary);
}

/* Dismiss Button */
.notification-card-dismiss {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--ds-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
}

.notification-card:hover .notification-card-dismiss {
    opacity: 1;
}

.notification-card-dismiss:hover {
    background: var(--ds-danger-bg);
    color: var(--ds-danger);
}

/* Empty State */
.notifications-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    border: 1px dashed var(--ds-border);
}

.notifications-empty i {
    font-size: 3rem;
    color: var(--ds-text-muted);
    margin-bottom: 16px;
}

.notifications-empty h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ds-text-primary);
    margin-bottom: 8px;
}

.notifications-empty p {
    font-size: 0.85rem;
    color: var(--ds-text-secondary);
}

/* Settings Panel Enhanced */
.notification-settings-card {
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    border: 1px solid var(--ds-border);
    overflow: hidden;
    margin-top: 2rem;
}

.notification-settings-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fafafa, var(--ds-bg-card));
    border-bottom: 1px solid var(--ds-border);
}

.notification-settings-header i {
    color: var(--ds-primary);
}

.notification-settings-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ds-text-primary);
    margin: 0;
}

.notification-settings-body {
    padding: 16px 20px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--ds-border-light);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ds-text-primary);
    margin: 0 0 2px 0;
}

.setting-info p {
    font-size: 0.8rem;
    color: var(--ds-text-muted);
    margin: 0;
}

/* ============================================
   REPORTS MODAL & EXPORT
   ============================================ */

.report-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.report-modal {
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.report-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--ds-border);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), transparent);
}

.report-modal-header-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ds-text-primary);
    margin: 0 0 4px 0;
}

.report-modal-header-content p {
    font-size: 0.85rem;
    color: var(--ds-text-muted);
    margin: 0;
}

.report-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ds-border-light);
    border: none;
    color: var(--ds-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.report-modal-close:hover {
    background: var(--ds-danger-bg);
    color: var(--ds-danger);
}

.report-modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--ds-border);
    background: var(--ds-bg-secondary);
}

.report-export-buttons {
    display: flex;
    gap: 8px;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--ds-border);
    background: var(--ds-bg-card);
    color: var(--ds-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.export-btn:hover {
    background: var(--ds-primary);
    color: white;
    border-color: var(--ds-primary);
}

.export-btn i {
    font-size: 0.9rem;
}

.report-info {
    font-size: 0.8rem;
    color: var(--ds-text-muted);
}

.report-modal-body {
    flex: 1;
    overflow: auto;
    padding: 0;
    min-height: 300px;
}

.report-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--ds-text-muted);
}

.report-loading i {
    font-size: 2.5rem;
    color: var(--ds-primary);
    margin-bottom: 16px;
}

.report-loading p {
    font-size: 0.9rem;
}

.report-empty,
.report-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.report-empty i,
.report-error i {
    font-size: 3rem;
    color: var(--ds-text-muted);
    margin-bottom: 16px;
}

.report-error i {
    color: var(--ds-danger);
}

.report-empty h3,
.report-error h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ds-text-primary);
    margin-bottom: 8px;
}

.report-empty p,
.report-error p {
    font-size: 0.85rem;
    color: var(--ds-text-muted);
}

.report-table-container {
    overflow: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.report-table th {
    position: sticky;
    top: 0;
    background: var(--ds-bg-secondary);
    font-weight: 600;
    color: var(--ds-text-primary);
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--ds-border);
    white-space: nowrap;
}

.report-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--ds-border-light);
    color: var(--ds-text-secondary);
}

.report-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.03);
}

.report-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

/* Reports Page Styles */
.reports-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ds-text-primary);
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--ds-border);
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.report-card {
    background: var(--ds-bg-card);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.report-card:hover {
    border-color: var(--ds-primary);
    box-shadow: var(--ds-shadow-md);
    transform: translateY(-2px);
}

.report-card .report-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--ds-primary-bg);
    color: var(--ds-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.report-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ds-text-primary);
    margin: 0 0 6px 0;
}

.report-card p {
    font-size: 0.8rem;
    color: var(--ds-text-muted);
    margin: 0;
    line-height: 1.4;
}

/* Dark mode adjustments */
[data-theme="dark"] .report-modal {
    background: var(--ds-bg-card);
}

[data-theme="dark"] .report-table th {
    background: var(--ds-bg-tertiary);
}

[data-theme="dark"] .report-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* ============================================
   CASHFLOW BREAKDOWN TOOLTIPS
   ============================================ */

.cashflow-breakdown-tooltip {
    background: var(--ds-bg-card);
    border: 1px solid var(--ds-border);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 0;
    min-width: 220px;
    max-width: 350px;
    pointer-events: none;
    animation: tooltipFadeIn 0.15s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cashflow-breakdown-tooltip .tooltip-header {
    background: var(--ds-primary);
    color: white;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 7px 7px 0 0;
}

.cashflow-breakdown-tooltip .tooltip-content {
    padding: 8px 12px;
    max-height: 200px;
    overflow-y: auto;
}

.cashflow-breakdown-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--ds-border-light);
    font-size: 0.8rem;
}

.cashflow-breakdown-tooltip .tooltip-row:last-child {
    border-bottom: none;
}

.cashflow-breakdown-tooltip .tooltip-unit {
    color: var(--ds-text-primary);
    font-weight: 500;
}

.cashflow-breakdown-tooltip .tooltip-amount {
    color: var(--ds-primary);
    font-weight: 600;
    font-family: var(--font-mono);
}

/* Cashflow Table Enhancements */
.cashflow-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.cashflow-row:hover {
    background: rgba(99, 102, 241, 0.05);
}

.period-link {
    color: var(--ds-primary);
    text-decoration: none;
}

.period-link:hover {
    text-decoration: underline;
}

.unit-count-badge {
    background: var(--ds-primary-bg);
    color: var(--ds-primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.unit-count-badge:hover {
    background: var(--ds-primary);
    color: white;
}

.amount-cell {
    cursor: help;
}

/* Period Details Modal */
.period-details-modal {
    padding: 0;
}

.period-details-modal h3 {
    padding: 16px 20px;
    margin: 0;
    border-bottom: 1px solid var(--ds-border);
    background: var(--ds-bg-secondary);
}

.period-details-modal .details-table {
    width: 100%;
    border-collapse: collapse;
}

.period-details-modal .details-table th {
    background: var(--ds-bg-secondary);
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--ds-text-muted);
    text-transform: uppercase;
}

.period-details-modal .details-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ds-border-light);
    font-size: 0.85rem;
}

.period-details-modal .modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--ds-border);
    text-align: right;
}

.status-badge.paid {
    background: var(--ds-success-bg);
    color: var(--ds-success);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.pending {
    background: var(--ds-warning-bg);
    color: var(--ds-warning);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Enhanced Tooltip Styles */
.tooltip-unit-block {
    padding: 8px 0;
    border-bottom: 1px solid var(--ds-border-light);
}

.tooltip-unit-block:last-child {
    border-bottom: none;
}

.tooltip-unit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.tooltip-unit-name {
    font-weight: 600;
    color: var(--ds-text-primary);
}

.tooltip-project {
    font-size: 0.7rem;
    color: var(--ds-text-muted);
    margin-bottom: 4px;
}

.tooltip-partners {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.partner-chip {
    background: var(--ds-primary-bg);
    color: var(--ds-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
}

/* Period Summary in Modal */
.period-summary {
    display: flex;
    gap: 24px;
    padding: 12px 20px;
    background: var(--ds-bg-secondary);
    border-bottom: 1px solid var(--ds-border);
    font-size: 0.85rem;
}

.period-summary span {
    color: var(--ds-text-muted);
}

.period-summary strong {
    color: var(--ds-text-primary);
}

/* Partner Shares in Table */
.partner-shares-cell {
    font-size: 0.75rem;
    min-width: 150px;
}

.partner-share-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    border-bottom: 1px solid var(--ds-border-light);
}

.partner-share-row:last-child {
    border-bottom: none;
}

.partner-name {
    font-weight: 500;
    color: var(--ds-text-primary);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.partner-amount {
    color: var(--ds-primary);
    font-weight: 600;
    font-family: var(--font-mono);
}

.partner-pct {
    color: var(--ds-text-muted);
    font-size: 0.7rem;
}

/* ============================================
   DARK MODE THEME
   ============================================ */
[data-theme='dark'] {
    /* Override Design System Variables */
    --ds-text-primary: #f1f5f9;
    --ds-text-secondary: #94a3b8;
    --ds-text-muted: #64748b;
    --ds-border: #334155;
    --ds-border-light: #1e293b;
    --ds-bg-page: #0f172a;
    --ds-bg-card: #1e293b;
}

/* Unified Card */
[data-theme='dark'] .unified-card {
    background: var(--ds-bg-card) !important;
    border-color: var(--ds-border) !important;
}

[data-theme='dark'] .unified-card-header {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-color: var(--ds-border);
}

[data-theme='dark'] .unified-card-title {
    color: var(--ds-text-primary);
}

[data-theme='dark'] .unified-card-footer {
    background: rgba(15, 23, 42, 0.5);
    border-color: var(--ds-border);
}

/* Stat Card */
[data-theme='dark'] .stat-card {
    background: var(--ds-bg-card) !important;
    border-color: var(--ds-border) !important;
}

[data-theme='dark'] .stat-card-label {
    color: var(--ds-text-secondary);
}

[data-theme='dark'] .stat-card-value {
    color: var(--ds-text-primary);
}

/* Chart Card */
[data-theme='dark'] .chart-card {
    background: var(--ds-bg-card) !important;
    border-color: var(--ds-border) !important;
}

[data-theme='dark'] .chart-card-header {
    border-color: var(--ds-border);
}

[data-theme='dark'] .chart-card-title {
    color: var(--ds-text-primary);
}

[data-theme='dark'] .chart-empty-state {
    background: linear-gradient(135deg, #1e293b, #334155);
    border-color: var(--ds-border);
}

/* Risk Gauge */
[data-theme='dark'] .risk-circle::before {
    background: var(--ds-bg-card);
}

[data-theme='dark'] .risk-value {
    color: var(--ds-text-primary);
}

[data-theme='dark'] .risk-developer {
    color: var(--ds-text-secondary);
}

/* Health Score */
[data-theme='dark'] .health-circle::before {
    background: var(--ds-bg-card);
}

[data-theme='dark'] .health-value {
    color: var(--ds-text-primary);
}

[data-theme='dark'] .health-label {
    color: var(--ds-text-secondary);
}

/* Rankings */
[data-theme='dark'] .ranking-item {
    background: rgba(51, 65, 85, 0.5);
}

[data-theme='dark'] .ranking-item:hover {
    background: rgba(71, 85, 105, 0.6);
}

[data-theme='dark'] .ranking-position {
    background: rgba(71, 85, 105, 0.8);
    color: var(--ds-text-secondary);
}

[data-theme='dark'] .ranking-name {
    color: var(--ds-text-primary);
}

[data-theme='dark'] .ranking-units {
    color: var(--ds-text-muted);
}

/* Equity Blocks */
[data-theme='dark'] .equity-name {
    color: var(--ds-text-secondary);
}

[data-theme='dark'] .equity-pct {
    color: var(--ds-text-primary);
}

/* Timeline */
[data-theme='dark'] .timeline::before {
    background: var(--ds-border);
}

[data-theme='dark'] .timeline-marker {
    box-shadow: 0 0 0 2px var(--ds-border);
}

[data-theme='dark'] .timeline-unit {
    color: var(--ds-text-primary);
}

/* Calendar Mini */
[data-theme='dark'] .calendar-mini {
    background: rgba(51, 65, 85, 0.5);
}

[data-theme='dark'] .calendar-header {
    color: var(--ds-text-primary);
}

/* Section Headers */
[data-theme='dark'] .section-header-unified h2 {
    color: var(--ds-text-primary);
}

/* Generic card class */
[data-theme='dark'] .card {
    background: var(--ds-bg-card) !important;
    border-color: var(--ds-border) !important;
}

/* ============================================
   PARTNER SHARES - Milestones Table
   ============================================ */
.partner-shares-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.partner-share-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    cursor: default;
    transition: all 0.2s ease;
}

.partner-share-chip:hover {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.partner-share-chip .chip-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.partner-share-chip .chip-pct {
    font-weight: 600;
    color: #6366f1;
}

.partner-share-chip .chip-amt {
    color: #64748b;
    font-weight: 500;
}

.partner-shares-cell {
    min-width: 180px;
}

/* Dark mode for partner share chips */
[data-theme='dark'] .partner-share-chip {
    background: linear-gradient(135deg, #334155, #475569);
    border-color: #475569;
}

[data-theme='dark'] .partner-share-chip:hover {
    background: linear-gradient(135deg, #475569, #64748b);
}

[data-theme='dark'] .partner-share-chip .chip-pct {
    color: #a5b4fc;
}

[data-theme='dark'] .partner-share-chip .chip-amt {
    color: #94a3b8;
}