/* ============================================================================
   LIBYA NATIONAL ROADMAP - MASTER IMPLEMENTATION SCHEDULE
   Professional Dashboard Styling
   ============================================================================ */

:root {
    --primary: #0A1628;
    --primary-light: #1B2D4A;
    --accent: #2E86C1;
    --accent-light: #5DADE2;
    --gold: #F4D03F;
    --gold-dark: #D4AC0D;
    --green: #28B463;
    --green-light: #58D68D;
    --red: #E74C3C;
    --orange: #E67E22;
    --purple: #8E44AD;
    --teal: #17A2B8;
    --bg: #F0F2F5;
    --card-bg: #FFFFFF;
    --text: #2C3E50;
    --text-light: #7F8C8D;
    --border: #E5E8EC;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-en: 'Inter', 'Segoe UI', sans-serif;
    --font-ar: 'Noto Sans Arabic', 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font-en);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

body[dir="rtl"] {
    font-family: var(--font-ar);
}

/* ============================================================================
   HEADER
   ============================================================================ */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #1a3a5c 100%);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

.brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), var(--green));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 12px rgba(46,134,193,0.4);
}

.brand-text h1 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.brand-text p {
    font-size: 11px;
    opacity: 0.7;
    letter-spacing: 0.3px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-toggle {
    display: flex;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
}

.lang-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.lang-btn.active {
    background: var(--accent);
    color: white;
}

.confidential-badge {
    padding: 4px 12px;
    background: rgba(231,76,60,0.2);
    border: 1px solid rgba(231,76,60,0.4);
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #E74C3C;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Navigation */
.header-nav {
    display: flex;
    padding: 0 30px;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.header-nav::-webkit-scrollbar { display: none; }

.nav-tab {
    padding: 12px 18px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    position: relative;
}

.nav-tab:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.05);
}

.nav-tab.active {
    color: white;
    border-bottom-color: var(--accent);
    background: rgba(255,255,255,0.05);
}

.nav-tab .tab-icon {
    margin-right: 6px;
}

body[dir="rtl"] .nav-tab .tab-icon {
    margin-right: 0;
    margin-left: 6px;
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */
.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   CARDS
   ============================================================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #FAFBFC, #F5F7FA);
}

.card-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h2 .icon {
    font-size: 18px;
}

.card-body {
    padding: 20px;
}

.card-body.no-pad {
    padding: 0;
}

/* ============================================================================
   KPI STRIP
   ============================================================================ */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.kpi-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.kpi-card.blue::before { background: var(--accent); }
.kpi-card.green::before { background: var(--green); }
.kpi-card.gold::before { background: var(--gold-dark); }
.kpi-card.red::before { background: var(--red); }
.kpi-card.purple::before { background: var(--purple); }
.kpi-card.teal::before { background: var(--teal); }
.kpi-card.orange::before { background: var(--orange); }

.kpi-card .kpi-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.kpi-card .kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.kpi-card .kpi-sub {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ============================================================================
   TABLES
   ============================================================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

thead th {
    background: var(--primary);
    color: white;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}

body[dir="rtl"] thead th {
    text-align: right;
}

tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

tbody tr:hover {
    background: #F8FAFC;
}

tbody tr.critical-row {
    background: #FFF5F5;
}

tbody tr.critical-row:hover {
    background: #FFEBEE;
}

/* ============================================================================
   BADGES & TAGS
   ============================================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-wave1 { background: #E8F4FD; color: #1565C0; }
.badge-wave2 { background: #E8F5E9; color: #2E7D32; }
.badge-wave3 { background: #FFF3E0; color: #E65100; }
.badge-ai { background: #F3E5F5; color: #6A1B9A; }
.badge-dt { background: #E3F2FD; color: #1565C0; }
.badge-critical { background: #FFEBEE; color: #C62828; border: 1px solid #EF9A9A; }
.badge-high { background: #FFF3E0; color: #E65100; }
.badge-medium { background: #FFF8E1; color: #F57F17; }
.badge-low { background: #E8F5E9; color: #2E7D32; }

/* ============================================================================
   GANTT CHART
   ============================================================================ */
.gantt-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 80vh;
    position: relative;
}

.gantt-table {
    min-width: 1400px;
}

.gantt-header-row {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--primary);
}

.gantt-label-col {
    min-width: 280px;
    max-width: 280px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    border-right: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
}

.gantt-timeline-col {
    flex: 1;
    display: flex;
}

.gantt-month {
    flex: 1;
    min-width: 18px;
    text-align: center;
    padding: 8px 2px;
    font-size: 9px;
    font-weight: 600;
    color: white;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.gantt-month.year-start {
    border-left: 2px solid var(--gold);
}

.gantt-row {
    display: flex;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.gantt-row:hover {
    background: #F8FAFC;
}

.gantt-row.critical {
    background: #FFF8F8;
}

.gantt-row .gantt-label-col {
    color: var(--text);
    font-weight: 500;
    font-size: 11.5px;
    border-right: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
}

.gantt-row .gantt-label-col .init-id {
    font-weight: 700;
    font-size: 10px;
    color: var(--accent);
    min-width: 42px;
}

.gantt-row .gantt-label-col .init-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-row .gantt-timeline-col {
    position: relative;
}

.gantt-bar-container {
    flex: 1;
    min-width: 18px;
    position: relative;
    border-right: 1px solid #F0F0F0;
}

.gantt-bar-container.year-start {
    border-left: 2px solid #E0E0E0;
}

.gantt-bar {
    position: absolute;
    top: 6px;
    bottom: 6px;
    border-radius: 4px;
    min-height: 18px;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2;
}

.gantt-bar:hover {
    filter: brightness(1.1);
    transform: scaleY(1.2);
    z-index: 5;
}

.gantt-bar.wave1 { background: linear-gradient(90deg, #2196F3, #42A5F5); }
.gantt-bar.wave2 { background: linear-gradient(90deg, #4CAF50, #66BB6A); }
.gantt-bar.wave3 { background: linear-gradient(90deg, #FF9800, #FFB74D); }
.gantt-bar.critical-bar { 
    box-shadow: 0 0 0 2px #E74C3C, 0 2px 8px rgba(231,76,60,0.3);
}

.gantt-milestone {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: var(--red);
    z-index: 3;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Gantt Wave Separator */
.gantt-wave-header {
    display: flex;
    background: linear-gradient(90deg, #1a2332, #1f3044);
    border-bottom: 2px solid var(--accent);
}

.gantt-wave-header .gantt-label-col {
    color: var(--gold);
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================================================
   DEPENDENCY MAP
   ============================================================================ */
.dep-map {
    padding: 20px;
}

.dep-node {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #F0F4F8;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    margin: 3px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.dep-node:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.dep-node.critical-node {
    border-color: var(--red);
    background: #FFF5F5;
}

.dep-arrow {
    display: inline-block;
    color: var(--accent);
    font-weight: 700;
    margin: 0 4px;
}

/* ============================================================================
   RESOURCE MATRIX
   ============================================================================ */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.agency-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
}

.agency-card:hover {
    box-shadow: var(--shadow-hover);
}

.agency-card-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.agency-card-header h3 {
    font-size: 13px;
    font-weight: 700;
}

.agency-card-header .count {
    background: var(--accent);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.agency-initiatives {
    padding: 12px 16px;
}

.agency-init-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #F5F5F5;
    font-size: 12px;
}

.agency-init-item:last-child {
    border-bottom: none;
}

.agency-init-item .init-badge {
    min-width: 48px;
    text-align: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    background: #EBF5FB;
    color: var(--accent);
}

/* ============================================================================
   RISK MATRIX
   ============================================================================ */
.risk-matrix-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    background: var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    max-width: 500px;
    margin: 0 auto 20px;
}

.risk-cell {
    padding: 16px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.risk-cell.header {
    background: var(--primary);
    color: white;
    font-size: 10px;
    text-transform: uppercase;
}

.risk-cell.label {
    background: #F0F4F8;
    color: var(--text);
    font-size: 10px;
}

.risk-cell.critical { background: #FFCDD2; color: #B71C1C; }
.risk-cell.high { background: #FFE0B2; color: #E65100; }
.risk-cell.medium { background: #FFF9C4; color: #F57F17; }
.risk-cell.low { background: #C8E6C9; color: #1B5E20; }

.risk-card {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 16px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.risk-card:hover {
    box-shadow: var(--shadow);
}

.risk-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.risk-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}

.risk-impact {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

/* ============================================================================
   MERMAID CONTAINER
   ============================================================================ */
.mermaid-container {
    overflow-x: auto;
    padding: 20px;
    background: #FAFBFC;
    border-radius: var(--radius-sm);
}

.mermaid {
    min-width: 100%;
}

/* ============================================================================
   PILLAR CARDS
   ============================================================================ */
.pillar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.pillar-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    border-top: 4px solid;
    transition: var(--transition);
}

.pillar-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.pillar-card .pillar-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.pillar-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.pillar-card p {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.5;
}

.pillar-count {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
}

/* ============================================================================
   WAVE TIMELINE
   ============================================================================ */
.wave-timeline {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.wave-block {
    padding: 16px 20px;
    color: white;
    flex: 1;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.wave-block::after {
    content: '▶';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    z-index: 2;
}

.wave-block:last-child::after { display: none; }

.wave-block h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.wave-block p {
    font-size: 11px;
    opacity: 0.9;
}

.wave-block .wave-count {
    font-size: 24px;
    font-weight: 800;
    margin-top: 4px;
}

/* ============================================================================
   FILTERS
   ============================================================================ */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.filter-bar select,
.filter-bar input {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: white;
    color: var(--text);
    outline: none;
    transition: var(--transition);
}

.filter-bar select:focus,
.filter-bar input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(46,134,193,0.1);
}

/* ============================================================================
   TOOLTIP
   ============================================================================ */
.tooltip {
    position: fixed;
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    max-width: 350px;
    z-index: 10000;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    line-height: 1.5;
}

.tooltip.visible {
    opacity: 1;
}

.tooltip .tt-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--accent-light);
}

.tooltip .tt-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 3px;
}

.tooltip .tt-label {
    opacity: 0.7;
    font-size: 11px;
}

.tooltip .tt-value {
    font-weight: 600;
    font-size: 11px;
}

/* ============================================================================
   PROGRESS BAR
   ============================================================================ */
.progress-bar {
    height: 6px;
    background: #E8E8E8;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

/* ============================================================================
   GRID LAYOUTS
   ============================================================================ */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ============================================================================
   GOVERNANCE DIAGRAM
   ============================================================================ */
.gov-layer {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 12px;
    overflow: hidden;
}

.gov-layer-header {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.gov-layer-header h3 {
    font-size: 14px;
    font-weight: 700;
}

.gov-layer-body {
    padding: 12px 20px 16px;
    border-top: 1px solid var(--border);
}

.gov-layer-body p {
    font-size: 12px;
    margin-bottom: 8px;
    color: var(--text-light);
}

.gov-members {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gov-member {
    padding: 4px 10px;
    background: #EBF5FB;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
}

/* Decision Gates */
.gate-timeline {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 20px 0;
}

.gate-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    position: relative;
}

.gate-item::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--accent);
}

.gate-item:last-child::after { display: none; }

.gate-diamond {
    width: 32px;
    height: 32px;
    background: var(--accent);
    transform: rotate(45deg);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(46,134,193,0.3);
}

.gate-diamond span {
    transform: rotate(-45deg);
    color: white;
    font-size: 10px;
    font-weight: 800;
}

.gate-label {
    margin-top: 10px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text);
    max-width: 100px;
}

.gate-date {
    font-size: 9px;
    color: var(--text-light);
    margin-top: 2px;
}

/* ============================================================================
   MERMAID CODE BLOCK
   ============================================================================ */
.code-block {
    background: #1E1E1E;
    border-radius: var(--radius-sm);
    padding: 20px;
    overflow-x: auto;
    position: relative;
}

.code-block code {
    color: #D4D4D4;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.copy-btn:hover {
    background: #2471A3;
}

body[dir="rtl"] .copy-btn {
    right: auto;
    left: 10px;
}

/* ============================================================================
   SEARCH / INITIATIVE DETAIL MODAL
   ============================================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius);
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: white;
    z-index: 2;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #F0F0F0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--red);
    color: white;
}

.modal-body {
    padding: 24px;
}

.detail-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 13px;
}

.detail-label {
    min-width: 140px;
    font-weight: 600;
    color: var(--text-light);
}

.detail-value {
    color: var(--text);
    font-weight: 500;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 1024px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    .kpi-strip {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 12px;
    }
    .header-top {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 16px;
    }
    .brand-text h1 {
        font-size: 13px;
    }
    .wave-timeline {
        flex-direction: column;
    }
    .pillar-grid {
        grid-template-columns: 1fr;
    }
    .kpi-strip {
        grid-template-columns: repeat(2, 1fr);
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */
@media print {
    .header { position: static; }
    .header-nav { display: none; }
    .header-controls { display: none; }
    .tab-content { display: block !important; page-break-before: always; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    .gantt-container { max-height: none; overflow: visible; }
}

/* Critical Path Highlight Animation */
@keyframes criticalPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0.4); }
    50% { box-shadow: 0 0 0 4px rgba(231,76,60,0.1); }
}

.critical-highlight {
    animation: criticalPulse 2s infinite;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #F0F0F0; }
::-webkit-scrollbar-thumb { background: #C0C0C0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #A0A0A0; }
