:root {
    /* Accessibility Variables */
    --focus-ring: 3px solid #0078D4;
    --focus-ring-offset: 2px;

    /* KPI Colors - Phase 2 Enhanced */
    --kpi-green: #107C10;
    --kpi-green-bg: #DFF6DD;
    --kpi-green-gradient: linear-gradient(135deg, #2ECC71, #28B463);

    --kpi-yellow: #F7A200;
    --kpi-yellow-bg: #FFF4D8;
    --kpi-yellow-gradient: linear-gradient(135deg, #F39C12, #E67E22);

    --kpi-red: #D13438;
    --kpi-red-bg: #FDE7E9;
    --kpi-red-gradient: linear-gradient(135deg, #E74C3C, #C0392B);

    --kpi-blue: #0078D4;
    --kpi-blue-bg: #DFF6DD;
    --kpi-blue-gradient: linear-gradient(135deg, #3498DB, #2980B9);

    --kpi-purple: #5C2D91;
    --kpi-purple-gradient: linear-gradient(135deg, #9B59B6, #8E44AD);

    --kpi-teal: #008272;
    --kpi-teal-gradient: linear-gradient(135deg, #1ABC9C, #16A085);

    --color-profit: #107C10;
    --color-risk: #F7A200;
    --color-supply: #D13438;
    --color-cashflow: #0078D4;
    --color-danger: #D13438;
    --color-warning: #F7A200;
    --color-info: #0078D4;
    --color-success-bg: #DFF6DD;
    --color-danger-bg: #FDE7E9;
    --color-warning-bg: #FFF4D8;

    /* FluentUI Theme Variables */
    /* --neutral-layer-floating: #FFFFFF;
    --neutral-layer-2: #F7F7F7;
    --neutral-layer-3: #ECECEC;
    --neutral-stroke-divider-rest: #E1E1E1;
    --accent-fill-rest: #0078D4; */
    
    /* --neutral-card-background: var(--neutral-layer-floating); */
}

/* =========================================
   Executive Dashboard V1.1 Styles
   ========================================= */

:root {
    --primary: #0078d4;
    --bg-dark: #111111;
    --card-dark: #1b1b1b;
    --border-dark: #323130;
    --text-secondary: #a1a1a1;
    --text-primary: #f1f5f9;
}

.dashboard-container {
    font-family: 'Segoe UI', 'Inter', sans-serif;
    color: var(--text-primary);
    padding: 2rem;
    background-color: var(--bg-dark);
    min-height: 100%;
}


/* Grid System */
.d-grid { display: grid; gap: 1.5rem; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 1024px) {
    .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .grid-cols-4 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .grid-cols-2 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .dashboard-container { padding: 1rem; }
}

/* Typography & Utilities */
.text-2xl { font-size: 1.5rem; line-height: 2rem; margin-top: -18px;}
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-tight { letter-spacing: -0.025em; }

.text-slate-500 { color: #64748b; }
.text-slate-400 { color: #94a3b8; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-200 { color: #e2e8f0; }
.text-slate-100 { color: #f1f5f9; }

.text-emerald-500 { color: #10b981; }
.bg-emerald-500 { background-color: #10b981; }
.bg-emerald-500-10 { background-color: rgba(16, 185, 129, 0.1); }
.bg-emerald-500-30 { background-color: rgba(16, 185, 129, 0.3); }

.text-amber-500 { color: #f59e0b; }
.bg-amber-500 { background-color: #f59e0b; }
.bg-amber-500-10 { background-color: rgba(245, 158, 11, 0.1); }
.bg-amber-500-30 { background-color: rgba(245, 158, 11, 0.3); }

.text-red-500 { color: #ef4444; }
.bg-red-500 { background-color: #ef4444; }
.bg-red-500-10 { background-color: rgba(239, 68, 68, 0.1); }

.text-primary { color: var(--primary); }
.bg-primary { background-color: var(--primary); }

.bg-white-5 { background-color: rgba(255, 255, 255, 0.05); }
.hover-bg-white-5:hover { background-color: rgba(255, 255, 255, 0.05); }

.rounded { border-radius: 0.25rem; }
.rounded-sm { border-radius: 0.125rem; }
.rounded-full { border-radius: 9999px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.p-0-5 { padding: 0.125rem; }
.p-1 { padding: 0.25rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-0-5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.pb-3 { padding-bottom: 0.75rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-0-5 { margin-left: 0.125rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-2-5 { width: 0.625rem; }
.h-2-5 { height: 0.625rem; }

.relative { position: relative; }
.absolute { position: absolute; }
.z-10 { z-index: 10; }
.overflow-hidden { overflow: hidden; }

/* Custom Scrollbar for internal overflow */
.overflow-x-auto { overflow-x: auto; }
.overflow-x-auto::-webkit-scrollbar { height: 6px; }
.overflow-x-auto::-webkit-scrollbar-thumb { background: #323130; border-radius: 3px; }

/* =========================================
   Milestone Timeline Styles
   ========================================= */

.milestone-timeline {
    position: relative;
}

/* Timeline vertical line */
.milestone-timeline::before {
    content: '';
    position: absolute;
    left: 32px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(
        to bottom,
        var(--timeline-line-start, rgba(255, 255, 255, 0.15)),
        var(--timeline-line-end, rgba(255, 255, 0.05))
    );
}

.milestone-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-left: 1.5rem;
    padding-bottom: 1.5rem;
}

.milestone-item:last-child {
    padding-bottom: 0;
}

/* Timeline icon node */
.milestone-icon {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: var(--milestone-icon-bg);
    color: var(--milestone-icon-color);
    box-shadow: 0 0 0 4px var(--milestone-icon-ring);
}

.milestone-item.milestone-completed .milestone-icon {
    --milestone-icon-bg: #10b981;
    --milestone-icon-color: #ffffff;
    --milestone-icon-ring: rgba(16, 185, 129, 0.2);
}

.milestone-item.milestone-overdue .milestone-icon {
    --milestone-icon-bg: #f59e0b;
    --milestone-icon-color: #ffffff;
    --milestone-icon-ring: rgba(245, 158, 11, 0.2);
}

/* Icon styling */
.milestone-icon ::deep svg {
    width: 10px;
    height: 10px;
    color: var(--milestone-icon-color);
}

.milestone-content {
    flex: 1;
    padding-top: 0.125rem;
}

.milestone-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--milestone-title-color);
    line-height: 1.25rem;
    margin: 0;
}

.milestone-subtitle {
    font-size: 0.75rem;
    color: var(--milestone-subtitle-color);
    margin-top: 0.25rem;
    line-height: 1rem;
}

.milestone-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 0.25rem;
    margin-top: 0.5rem;
    letter-spacing: 0.025em;
}

.milestone-badge-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.milestone-badge-warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

/* Dark Mode (Default) */
:root {
    --timeline-line-start: rgba(255, 255, 255, 0.2);
    --timeline-line-end: rgba(255, 255, 255, 0.08);
    --milestone-title-color: #f1f5f9;
    --milestone-subtitle-color: #94a3b8;
}

/* Light Mode */
@media (prefers-color-scheme: light) {
    :root {
        --timeline-line-start: rgba(0, 0, 0, 0.15);
        --timeline-line-end: rgba(0, 0, 0, 0.05);
        --milestone-title-color: #1e293b;
        --milestone-subtitle-color: #64748b;
    }

    .milestone-item.milestone-completed .milestone-icon {
        --milestone-icon-ring: rgba(16, 185, 129, 0.15);
    }

    .milestone-item.milestone-overdue .milestone-icon {
        --milestone-icon-ring: rgba(245, 158, 11, 0.15);
    }
}

/* Theme-aware support for when ThemeService is active */
[data-theme="light"] {
    --timeline-line-start: rgba(0, 0, 0, 0.15);
    --timeline-line-end: rgba(0, 0, 0, 0.05);
    --milestone-title-color: #1e293b;
    --milestone-subtitle-color: #64748b;
}

[data-theme="light"] .milestone-item.milestone-completed .milestone-icon {
    --milestone-icon-ring: rgba(16, 185, 129, 0.15);
}

[data-theme="light"] .milestone-item.milestone-overdue .milestone-icon {
    --milestone-icon-ring: rgba(245, 158, 11, 0.15);
}

/* Animation for milestone items */
.milestone-item {
    animation: milestoneFadeIn 0.3s ease-out;
}

@keyframes milestoneFadeIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =========================================
   Progress Bar Chart Styles
   ========================================= */

.progress-chart-section {
    padding: 16px 0;
}

.overall-progress-bar {
    height: 12px;
    background-color: var(--neutral-fill-secondary, #f3f3f3);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 16px;
    transition: width 0.5s ease-in-out;
    min-width: 4px;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

