/* === NextGen ERP Program Planner - Styles === */
/* Vattenfall-inspired clean corporate design */

:root {
    /* Primary palette */
    --vf-blue: #0064A3;
    --vf-blue-dark: #004B7A;
    --vf-blue-light: #E8F2F9;
    --vf-yellow: #FFD200;
    --vf-yellow-light: #FFF8D6;

    /* Status colors */
    --status-on-track: #2E8B57;
    --status-on-track-bg: #E8F5ED;
    --status-at-risk: #E67E22;
    --status-at-risk-bg: #FDF0E3;
    --status-off-track: #C0392B;
    --status-off-track-bg: #FDECEA;
    --status-completed: #1A7A4C;
    --status-completed-bg: #D5F0E2;
    --status-not-started: #7F8C8D;
    --status-not-started-bg: #F0F0F0;

    /* Neutral palette */
    --gray-50: #FAFBFC;
    --gray-100: #F4F5F7;
    --gray-200: #E8EAED;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Critical path */
    --critical-red: #DC2626;
    --critical-bg: #FEF2F2;

    /* Cutover plan */
    --cutover-color: #7C3AED;
    --cutover-bg: #F5F3FF;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-md: 13px;
    --font-size-lg: 14px;
    --font-size-xl: 16px;
    --font-size-2xl: 20px;

    /* Borders & Shadows */
    --border-radius: 6px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
}

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
}

/* === Navbar === */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    height: 56px;
    background: var(--vf-blue);
    color: white;
    flex-shrink: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.navbar-logo {
    display: flex;
    align-items: center;
}

.navbar-title {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    white-space: nowrap;
}

.navbar-title-main {
    font-weight: 700;
    font-size: var(--font-size-xl);
    letter-spacing: -0.3px;
}

.navbar-title-sub {
    font-size: var(--font-size-xs);
    opacity: 0.8;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.navbar-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Main navigation tabs */
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.65);
    font-size: var(--font-size-sm);
    font-weight: 600;
    padding: 8px 22px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    font-family: var(--font-family);
}

.nav-tab svg {
    flex-shrink: 0;
}

.nav-tab:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.nav-tab.active {
    color: var(--vf-blue);
    background: #fff;
}

.nav-tab.active svg {
    color: var(--vf-blue);
}

/* User profile area */
.navbar-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
    padding: 4px 8px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background 0.15s;
}

.navbar-user:hover {
    background: rgba(255, 255, 255, 0.12);
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--vf-yellow);
    color: var(--vf-blue-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
    letter-spacing: -0.5px;
}

.user-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: white;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-toggle {
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.navbar-user.open .user-menu-toggle {
    transform: rotate(180deg);
}

/* User dropdown menu */
.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 200;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.navbar-user.open .user-dropdown {
    display: block;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    color: var(--gray-700);
    font-size: var(--font-size-md);
    font-family: var(--font-family);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.1s;
}

.user-dropdown-item:hover {
    background: var(--gray-50);
}

.user-dropdown-item svg {
    color: var(--gray-400);
    flex-shrink: 0;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 4px 0;
}

.user-dropdown-logout {
    color: var(--status-off-track);
}

.user-dropdown-logout:hover {
    background: var(--status-off-track-bg);
}

.user-dropdown-logout svg {
    color: var(--status-off-track);
}

/* Search */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-box input {
    padding: 6px 12px 6px 32px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--border-radius);
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: var(--font-size-sm);
    width: 220px;
    transition: all 0.2s;
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.6);
}

.search-box input:focus {
    outline: none;
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    width: 280px;
}

/* Search box inside toolbar (light background) */
.planning-toolbar .search-box input {
    background: white;
    border: 1px solid var(--gray-300);
    color: var(--gray-800);
    width: 240px;
}

.planning-toolbar .search-box input::placeholder {
    color: var(--gray-400);
}

.planning-toolbar .search-icon {
    color: var(--gray-400);
}

.planning-toolbar .search-box input:focus {
    background: white;
    border-color: var(--vf-blue);
    box-shadow: 0 0 0 2px rgba(0,100,163,0.12);
    width: 280px;
}

/* === View Containers === */
.view-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* === Planning Toolbar === */
.planning-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px var(--space-xl);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
    gap: var(--space-md);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Toolbar buttons (light background context) */
.btn-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: var(--border-radius);
    font-size: var(--font-size-xs);
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    background: white;
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
}

.btn-toolbar:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-800);
}

.btn-toolbar svg {
    flex-shrink: 0;
}

/* Primary toolbar button (Critical Path) */
.btn-toolbar-primary {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: var(--border-radius);
    font-size: var(--font-size-xs);
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    background: var(--vf-blue);
    color: white;
    border: 1px solid var(--vf-blue);
}

.btn-toolbar-primary:hover {
    opacity: 0.9;
}

.btn-toolbar-primary.active {
    background: var(--critical-red);
    border-color: var(--critical-red);
    color: white;
}

.btn-toolbar-primary svg {
    flex-shrink: 0;
}

/* Cutover toolbar button */
.btn-toolbar-cutover {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: var(--border-radius);
    font-size: var(--font-size-xs);
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    background: var(--gray-100);
    color: var(--cutover-color);
    border: 1px solid var(--cutover-color);
}

.btn-toolbar-cutover:hover {
    background: var(--cutover-bg);
}

.btn-toolbar-cutover.active {
    background: var(--cutover-color);
    border-color: var(--cutover-color);
    color: white;
}

.btn-toolbar-cutover svg {
    flex-shrink: 0;
}

/* === Status View === */
.status-area-tabs {
    display: flex;
    padding: var(--space-sm) var(--space-xl);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.status-area-tabs .tabs-scroll {
    display: flex;
    gap: 4px;
    overflow-x: auto;
}

.status-area-tabs .tab {
    white-space: nowrap;
}

.status-report-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl);
    background: var(--gray-100);
}

/* === Analysis View === */
.analysis-tabs {
    display: flex;
    align-items: center;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 var(--space-lg);
    height: 48px;
    flex-shrink: 0;
}

.analysis-tabs .tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-500);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
}

.analysis-tabs .tab:hover {
    color: var(--vf-blue);
}

.analysis-tabs .tab.active {
    color: var(--vf-blue);
    border-bottom-color: var(--vf-blue);
}

.analysis-tabs .tab svg {
    flex-shrink: 0;
}

.analysis-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    background: var(--gray-100);
}

.analysis-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    color: var(--gray-400);
}

.analysis-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--gray-400);
    gap: var(--space-md);
    padding: var(--space-2xl);
    text-align: center;
    min-height: 300px;
}

.analysis-empty svg {
    opacity: 0.4;
}

.analysis-empty p {
    font-size: var(--font-size-md);
    color: var(--gray-400);
    margin: 0;
}

/* Toolbar: summary + actions */
.analysis-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    flex-wrap: nowrap;
}

.analysis-actions {
    display: flex;
    gap: var(--space-xs);
    flex-shrink: 0;
}

/* Summary bar */
.analysis-summary-bar {
    display: flex;
    gap: var(--space-md);
    flex-shrink: 0;
}

.analysis-summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: var(--space-sm) var(--space-xl);
    white-space: nowrap;
}

.analysis-summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--vf-blue);
    line-height: 1.2;
}

.analysis-summary-label {
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 2px;
}

.analysis-since-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--space-md);
}
.analysis-since-bar label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    white-space: nowrap;
}
.analysis-date-input {
    padding: 5px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 13px;
    color: var(--gray-700);
    background: white;
    cursor: pointer;
}
.analysis-date-input:focus {
    outline: none;
    border-color: var(--vf-blue);
    box-shadow: 0 0 0 2px rgba(0, 87, 158, 0.15);
}

/* Workstream group */
.analysis-ws-group {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    margin-bottom: var(--space-md);
    overflow: hidden;
}

.analysis-ws-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--vf-blue);
    color: white;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.analysis-ws-header:hover {
    background: var(--vf-blue-dark);
}

.analysis-ws-chevron {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.analysis-ws-group:not(.collapsed) .analysis-ws-chevron {
    transform: rotate(90deg);
}

.analysis-ws-name {
    font-weight: 700;
    font-size: var(--font-size-md);
    flex: 1;
}

.analysis-ws-count {
    font-size: var(--font-size-xs);
    opacity: 0.8;
    font-weight: 500;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

.analysis-ws-body {
    padding: var(--space-md) var(--space-lg);
}

.analysis-ws-group.collapsed .analysis-ws-body {
    display: none;
}

/* Task group within workstream */
.analysis-task-group {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--gray-100);
}

.analysis-task-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.analysis-task-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
}

.analysis-task-wbs {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.analysis-task-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--gray-800);
}

.analysis-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.analysis-badge-critical {
    background: #FEE2E2;
    color: #DC2626;
}

.analysis-badge-cutover {
    background: var(--cutover-bg);
    color: var(--cutover-color);
}

.analysis-badge-milestone {
    background: #DBEAFE;
    color: #2563EB;
}

.analysis-task-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding-left: var(--space-md);
    border-left: 2px solid var(--gray-200);
    margin-left: var(--space-sm);
}

.analysis-task-timeline .changelog-entry {
    border-left: none;
    font-size: var(--font-size-sm);
}

/* Critical changes view container */
.analysis-critical-changes {
    max-width: 1000px;
}

/* === Simulation Mode === */
.btn-simulation {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: #92400E;
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    margin-right: var(--space-sm);
}

.btn-simulation:hover {
    background: #FDE68A;
    border-color: #D97706;
}

.btn-simulation svg {
    flex-shrink: 0;
}

/* Simulation mode (uses view-mode-banner) */
.view-mode-banner.simulation-mode {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: #92400E;
    border-color: #F59E0B;
}

.view-mode-banner.simulation-mode .view-mode-icon {
    color: #D97706;
}

.simulation-badge-count {
    font-size: var(--font-size-xs);
    font-weight: 700;
    background: #D97706;
    color: white;
    padding: 2px 10px;
    border-radius: 10px;
    white-space: nowrap;
}

.btn-simulation-exit {
    background: #92400E;
    color: white;
    border: none;
    padding: 6px 16px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn-simulation-exit:hover {
    background: #78350F;
}

/* Visual indicators when simulation is active */
body.simulation-active .navbar-nav {
    opacity: 0.35;
    pointer-events: none;
}

body.simulation-active .view-container {
    background: #FFFBEB;
}

body.simulation-active .task-table thead th {
    background: #FEF3C7;
}

body.simulation-active .workstream-tabs {
    background: #FEF3C7;
}

body.simulation-active .planning-toolbar {
    background: #FFFBEB;
}

body.simulation-active .btn-simulation {
    display: none;
}

/* Simulation mode persistent toast on left */
.simulation-toast {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 450;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    background: linear-gradient(180deg, #F59E0B 0%, #D97706 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    padding: 0 5px;
    width: 28px;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 2px 0 12px rgba(217, 119, 6, 0.3);
}
body.simulation-active .simulation-toast {
    display: flex;
}

/* Simulation edit badge in detail panel */
.simulation-edit-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
    background: #FEF3C7;
    color: #D97706;
    border: 1px solid #F59E0B;
    vertical-align: middle;
    margin-left: 6px;
}

/* Simulation exit modal */
.simulation-exit-header {
    background: #FEF3C7;
    border-bottom: 1px solid #F59E0B;
}

.simulation-exit-header h3 {
    color: #92400E;
}

.sim-change-summary {
    max-height: 200px;
    overflow-y: auto;
    margin: var(--space-md) 0;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    background: var(--gray-50);
}

.sim-change-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px var(--space-md);
    border-bottom: 1px solid var(--gray-100);
    font-size: var(--font-size-sm);
}

.sim-change-item:last-child {
    border-bottom: none;
}

.sim-change-wbs {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
}

.sim-change-name {
    color: var(--gray-700);
    font-weight: 500;
}

/* ── Snapshot / Plan Version Styles ── */

.snapshot-banner {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px var(--space-xl);
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    border-bottom: 2px solid #3B82F6;
    color: #1E40AF;
    font-size: var(--font-size-sm);
    z-index: 90;
    flex-shrink: 0;
}

.snapshot-banner-icon {
    flex-shrink: 0;
    color: #2563EB;
}

.snapshot-banner-text {
    font-weight: 700;
    letter-spacing: 0.03em;
    flex: 1;
}

.snapshot-banner-date {
    font-weight: 800;
    margin: 0 4px;
}

.snapshot-banner-sub {
    font-weight: 500;
    opacity: 0.8;
    margin-left: 6px;
    font-size: var(--font-size-xs);
}

.btn-snapshot-exit {
    background: #1E40AF;
    color: white;
    border: none;
    padding: 6px 16px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn-snapshot-exit:hover {
    background: #1E3A8A;
}

/* Visual indicators when snapshot is active */
body.snapshot-active .navbar-nav {
    opacity: 0.35;
    pointer-events: none;
}

body.snapshot-active .view-container {
    background: #EFF6FF;
}

body.snapshot-active .task-table thead th {
    background: #DBEAFE;
}

body.snapshot-active .workstream-tabs {
    background: #DBEAFE;
}

body.snapshot-active .planning-toolbar {
    background: #EFF6FF;
}

body.snapshot-active .btn-simulation {
    display: none;
}

body.snapshot-active .btn-toolbar-primary {
    display: none;
}

body.snapshot-active #btnAddTask {
    display: none !important;
}

body.snapshot-active #btnExportPoap {
    display: none;
}

body.snapshot-active .tab-add-ws {
    display: none;
}

/* Snapshot modal styles */
.snapshot-modal-header {
    background: #EFF6FF;
    border-bottom: 1px solid #BFDBFE;
}

.snapshot-modal-header h3 {
    color: #1E40AF;
}

.snapshot-description {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-lg);
}

.snapshot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.snapshot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    transition: border-color 0.15s, background 0.15s;
}

.snapshot-item:hover {
    background: #EFF6FF;
    border-color: #93C5FD;
}

.snapshot-item-info {
    flex: 1;
}

.snapshot-item-date {
    font-weight: 700;
    font-size: var(--font-size-md);
    color: var(--gray-900);
}

.snapshot-item-meta {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    margin-top: 2px;
}

.snapshot-item-label {
    font-size: var(--font-size-xs);
    color: #2563EB;
    margin-top: 2px;
    font-style: italic;
}

.snapshot-empty {
    text-align: center;
    color: var(--gray-500);
    padding: var(--space-xl);
    font-size: var(--font-size-sm);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    white-space: nowrap;
}

.btn-outline {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.2);
}

/* Override for btn-outline inside light-background containers (modals, panels, forms) */
.modal-body .btn-outline,
.detail-panel .btn-outline,
.detail-body .btn-outline,
.dep-modal-card .btn-outline {
    background: white;
    color: var(--vf-blue);
    border: 1px solid var(--gray-300);
}

.modal-body .btn-outline:hover,
.detail-panel .btn-outline:hover,
.detail-body .btn-outline:hover,
.dep-modal-card .btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--vf-blue);
}

.btn-primary {
    background: var(--vf-yellow);
    color: var(--gray-900);
}

.btn-primary:hover {
    background: #FFE033;
}

.btn-primary.active {
    background: var(--critical-red);
    color: white;
}

/* === Workstream Tabs === */
.workstream-tabs {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
    z-index: 90;
}

.tabs-scroll {
    display: flex;
    flex-wrap: wrap;
    padding: 0 var(--space-xl);
    gap: 2px;
    position: relative;
}

.tabs-scroll::-webkit-scrollbar {
    height: 3px;
}

.tabs-scroll::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 2px;
}

.tab {
    padding: 10px 16px;
    border: none;
    background: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.tab:hover {
    color: var(--vf-blue);
    background: var(--vf-blue-light);
}

.tab.active {
    color: var(--vf-blue);
    border-bottom-color: var(--vf-blue);
    font-weight: 600;
}

.tab.tab-add-ws {
    color: var(--vf-blue);
    border: 1px dashed var(--vf-blue);
    border-radius: 4px;
    background: transparent;
    font-size: 12px;
    padding: 6px 14px;
    margin-left: auto;
    opacity: 0.75;
    transition: all 0.15s;
}
.tab.tab-add-ws:hover {
    background: var(--vf-blue-light);
    opacity: 1;
    border-bottom-color: var(--vf-blue);
}

/* Tab dropdowns */
.tab-dropdown {
    position: relative;
    display: inline-flex;
}

.tab-group-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tab-chevron {
    transition: transform 0.15s;
    margin-left: 2px;
}

.tab-dropdown.open .tab-chevron {
    transform: rotate(180deg);
}

.tab-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    min-width: 260px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    padding: 4px 0;
    max-height: 400px;
    overflow-y: auto;
}

.tab-dropdown.open .tab-dropdown-menu {
    display: block;
}

.tab-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: none;
    font-size: var(--font-size-sm);
    color: var(--gray-700);
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
}

.tab-dropdown-item:hover {
    background: var(--vf-blue-light);
    color: var(--vf-blue);
}

.tab-dropdown-item .tab-count {
    margin-left: 8px;
}

.tab-dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 4px 0;
}

/* === Phase Summary Bar === */
.phase-summary {
    display: flex;
    padding: var(--space-md) var(--space-xl);
    gap: var(--space-md);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
    overflow-x: auto;
}

.phase-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    min-width: 160px;
    cursor: pointer;
    transition: all 0.15s;
}

.phase-card:hover {
    border-color: var(--vf-blue);
    background: var(--vf-blue-light);
}

.phase-card.active {
    border-color: var(--vf-blue);
    background: var(--vf-blue-light);
}

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

.phase-icon.phase-1 { background: #EFF6FF; color: #2563EB; }
.phase-icon.phase-2 { background: #F0FDF4; color: #16A34A; }
.phase-icon.phase-3 { background: #FFF7ED; color: #EA580C; }
.phase-icon.phase-4 { background: #FEF3C7; color: #D97706; }
.phase-icon.phase-5 { background: #F5F3FF; color: #7C3AED; }
.phase-icon.phase-6 { background: #FDF2F8; color: #DB2777; }

.phase-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.phase-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--gray-800);
}

.phase-progress {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

.phase-bar {
    width: 100%;
    height: 3px;
    background: var(--gray-200);
    border-radius: 2px;
    margin-top: 2px;
    overflow: hidden;
}

.phase-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--vf-blue);
    transition: width 0.3s;
}

/* === Main Content === */
.main-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Workstream context header */
.ws-context-header {
    background: var(--vf-blue);
    color: white;
    padding: 8px var(--space-xl);
    flex-shrink: 0;
}

.ws-context-inner {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.ws-context-label {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    font-weight: 500;
}

.ws-context-name {
    font-size: var(--font-size-md);
    font-weight: 700;
}

.ws-context-count {
    font-size: var(--font-size-xs);
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.table-container {
    flex: 1;
    overflow: auto;
}

/* === Task Table === */
.task-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.task-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.task-table th {
    background: var(--gray-100);
    border-bottom: 2px solid var(--gray-200);
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    user-select: none;
}

.col-wbs { width: 8%; }
.col-name { width: 36%; }
.col-start { width: 8%; }
.col-finish { width: 8%; }
.col-duration { width: 5%; }
.col-progress { width: 10%; }
.col-status { width: 9%; }
.col-deps { width: 10%; }

/* Sortable column headers */
.task-table th.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 18px;
    transition: color 0.15s, background 0.15s;
}
.task-table th.sortable:hover {
    color: var(--primary);
    background: var(--gray-200);
}
.task-table th.sortable::after {
    content: "\21C5";
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.3;
}
.task-table th.sortable.sort-asc::after {
    content: "\25B2";
    opacity: 0.8;
    color: var(--primary);
}
.task-table th.sortable.sort-desc::after {
    content: "\25BC";
    opacity: 0.8;
    color: var(--primary);
}

.task-table tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.1s;
    cursor: pointer;
}

.task-table tbody tr:hover {
    background: var(--vf-blue-light);
}

.task-table td {
    padding: 6px var(--space-md);
    font-size: var(--font-size-sm);
    vertical-align: middle;
    white-space: nowrap;
}

/* Row levels */
.task-row.level-1 {
    background: var(--gray-100);
    font-weight: 600;
}

.task-row.level-1 td {
    font-size: var(--font-size-lg);
    padding: var(--space-sm) var(--space-md);
}

.task-row.level-2 {
    background: var(--gray-50);
    font-weight: 600;
}

.task-row.level-2 td {
    font-size: var(--font-size-md);
}

.task-row.level-3 td {
    font-size: var(--font-size-sm);
}

/* Milestone styling */
.task-row.milestone {
    background: var(--vf-yellow-light);
}

.task-row.milestone:hover {
    background: #FFF3B8;
}

.milestone-diamond {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--vf-yellow);
    border: 1.5px solid var(--vf-blue);
    transform: rotate(45deg);
    margin-right: 6px;
    flex-shrink: 0;
}

/* Critical path */
.task-row.critical-path {
    border-left: 3px solid var(--critical-red);
}

.task-row.critical-path td:first-child {
    padding-left: calc(var(--space-md) - 3px);
}

.critical-path-highlight .task-row:not(.critical-path) {
    display: none;
}

.critical-path-highlight .task-row.critical-path {
    opacity: 1;
    background: var(--critical-bg);
}

/* Critical path toggle button in detail panel */
.btn-critical-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border: 1.5px solid var(--gray-300);
    border-radius: 12px;
    background: white;
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    vertical-align: middle;
}

.btn-critical-toggle:hover {
    border-color: var(--critical-red);
    color: var(--critical-red);
    background: var(--critical-bg);
}

.btn-critical-toggle.active {
    border-color: var(--critical-red);
    background: var(--critical-bg);
    color: var(--critical-red);
}

.btn-critical-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* View Mode Banner */
.view-mode-banner {
    margin: 0;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    border-bottom: 2px solid;
}

.view-mode-banner.critical-path-mode {
    background: #FEF2F2;
    color: var(--danger);
    border-color: var(--danger);
}

.view-mode-banner.cutover-mode {
    background: var(--cutover-bg);
    color: var(--cutover-color);
    border-color: var(--cutover-color);
}

.view-mode-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.view-mode-icon {
    display: flex;
    align-items: center;
}

.view-mode-text {
    flex: 1;
}

.view-mode-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.6;
    color: inherit;
}

.view-mode-close:hover {
    opacity: 1;
}

/* Cutover plan */
.task-row.cutover-task {
    border-left: 3px solid var(--cutover-color);
}

.task-row.cutover-task td:first-child {
    padding-left: calc(var(--space-md) - 3px);
}

.cutover-plan-highlight .task-row:not(.cutover-task) {
    display: none;
}

.cutover-plan-highlight .task-row.cutover-task {
    opacity: 1;
    background: var(--cutover-bg);
}

/* Cutover toggle button in detail panel */
.btn-cutover-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border: 1.5px solid var(--gray-300);
    border-radius: 12px;
    background: white;
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    vertical-align: middle;
}

.btn-cutover-toggle:hover {
    border-color: var(--cutover-color);
    color: var(--cutover-color);
    background: var(--cutover-bg);
}

.btn-cutover-toggle.active {
    border-color: var(--cutover-color);
    background: var(--cutover-bg);
    color: var(--cutover-color);
}

.btn-cutover-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Hidden rows */
.task-row.hidden {
    display: none;
}

.task-row.filtered-out {
    display: none;
}

.task-row.search-hidden {
    display: none;
}

/* Task name cell */
.task-name-cell {
    display: flex;
    align-items: center;
    gap: 4px;
}

.expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 3px;
    color: var(--gray-500);
    flex-shrink: 0;
    transition: all 0.1s;
}

.expand-btn:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.expand-btn svg {
    transition: transform 0.15s;
}

.expand-btn.collapsed svg {
    transform: rotate(-90deg);
}

.expand-spacer {
    display: inline-block;
    width: 20px;
    flex-shrink: 0;
}

.indent {
    display: inline-block;
    flex-shrink: 0;
}

.task-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Task name truncates, WBS never truncates */
td:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* WBS cell */
.wbs-cell {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    white-space: nowrap;
    overflow: visible;
    text-overflow: unset;
}

/* Date cells */
.date-cell {
    font-variant-numeric: tabular-nums;
    color: var(--gray-600);
}

.date-cell.overdue {
    color: var(--status-off-track);
    font-weight: 600;
}

.date-cell.date-shifted {
    color: #DC2626 !important;
    font-weight: 600;
}
.date-cell.date-shifted::after {
    content: " \2195";
    font-size: 9px;
    opacity: 0.7;
}

/* Date slip indicator (expected date > planned finish) */
.date-cell.date-slip {
    background: var(--status-off-track-bg);
    color: var(--critical-red) !important;
    font-weight: 600;
}

.date-slip-flag {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    color: var(--critical-red);
    font-size: var(--font-size-sm);
    flex-shrink: 0;
    cursor: help;
}

.task-row.date-slip-descendant {
    border-left: 3px solid var(--status-at-risk);
}
.task-row.date-slip-descendant td:first-child {
    padding-left: calc(var(--space-md) - 3px);
}

.task-row.date-slip {
    border-left: 3px solid var(--critical-red);
}
.task-row.date-slip td:first-child {
    padding-left: calc(var(--space-md) - 3px);
}

/* Date slip notice in detail panel */
.date-slip-notice {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 8px 0;
    font-size: 12px;
    color: #991B1B;
}
.date-slip-notice span {
    display: block;
    margin-bottom: 4px;
}
.date-slip-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.btn-accept-slip {
    background: #059669;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.btn-accept-slip:hover {
    background: #047857;
}
.btn-reject-slip {
    background: #DC2626;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.btn-reject-slip:hover {
    background: #B91C1C;
}

/* Date cascade notice in detail panel */
.date-cascade-notice {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 8px 0;
    font-size: 12px;
    color: #991B1B;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.date-cascade-notice button {
    background: #DC2626;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.date-cascade-notice button:hover {
    background: #B91C1C;
}

/* Create Workstream modal — lead selectors */
.lead-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lead-new-fields {
    display: flex;
    gap: 6px;
}
.lead-new-fields input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: var(--font-size-sm);
}
.common-tasks-hint {
    color: var(--gray-400);
    font-size: 12px;
    margin-left: 4px;
}

/* WBS position preview */
.wbs-preview {
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
    font-size: 13px;
    color: #059669;
    font-weight: 600;
    padding: 4px 0;
    margin-top: 4px;
}

/* Duration */
.duration-cell {
    color: var(--gray-500);
    font-variant-numeric: tabular-nums;
}

/* Progress bar */
.progress-cell {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    min-width: 40px;
}

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

.progress-bar-fill.low { background: var(--gray-400); }
.progress-bar-fill.medium { background: var(--vf-blue); }
.progress-bar-fill.high { background: var(--status-on-track); }
.progress-bar-fill.complete { background: var(--status-completed); }

.progress-text {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    width: 32px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    letter-spacing: 0.2px;
}

.status-badge.on-track {
    background: var(--status-on-track-bg);
    color: var(--status-on-track);
}

.status-badge.at-risk {
    background: var(--status-at-risk-bg);
    color: var(--status-at-risk);
}

.status-badge.off-track {
    background: var(--status-off-track-bg);
    color: var(--status-off-track);
}

.status-badge.completed {
    background: var(--status-completed-bg);
    color: var(--status-completed);
}

.status-badge.not-started {
    background: var(--status-not-started-bg);
    color: var(--status-not-started);
}

/* Dependencies */
.deps-cell {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.dep-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: var(--font-size-xs);
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    white-space: nowrap;
}

.dep-tag-pred {
    border-left: 2px solid var(--vf-blue);
}

.dep-tag-succ {
    border-left: 2px solid var(--vf-yellow);
}

.dep-tag:hover {
    background: var(--vf-blue-light);
    border-color: var(--vf-blue);
    color: var(--vf-blue);
}

.dep-more {
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    padding: 1px 4px;
}

/* === Loading === */
.loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--gray-500);
}

.loading.active {
    display: block;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--vf-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Detail Side Panel === */
.detail-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    height: 100vh;
    background: white;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: right 0.25s ease;
}

.detail-panel.open {
    right: 0;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.detail-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    flex: 1;
}

.btn-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--gray-500);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.detail-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-xl);
    word-break: break-word;
}

.detail-section {
    margin-bottom: var(--space-xl);
}

.detail-section-title {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
    margin-bottom: var(--space-sm);
    overflow: hidden;
}

.detail-task-name {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.3;
    margin-bottom: var(--space-xs);
    overflow-wrap: break-word;
    word-break: break-word;
}

.detail-wbs {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: var(--font-size-sm);
    color: var(--gray-400);
    margin-bottom: var(--space-lg);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-field.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    font-weight: 500;
}

.detail-value {
    font-size: var(--font-size-md);
    color: var(--gray-800);
}

.detail-value.empty {
    color: var(--gray-300);
    font-style: italic;
}

.detail-ws-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.detail-ws-tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: #1E40AF;
    background: #DBEAFE;
    border: 1px solid #93C5FD;
    border-radius: 12px;
    white-space: nowrap;
}

.detail-deps-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.detail-dep-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--border-radius);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    font-size: var(--font-size-sm);
    min-width: 0;
    max-width: 100%;
}

.detail-dep-item:hover {
    background: var(--vf-blue-light);
    border-color: var(--vf-blue);
}

.detail-dep-wbs {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    min-width: 50px;
}

.detail-dep-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-sub-title {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: var(--space-xs);
}

.detail-progress {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.detail-progress .progress-bar {
    flex: 1;
    height: 8px;
}

.detail-comments {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--gray-50);
    padding: var(--space-md);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

.detail-comment-meta {
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    margin-top: 6px;
    font-style: italic;
}

/* === Overlay === */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 150;
}

.overlay.active {
    display: block;
}

/* === Summary stats in tabs === */
.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    background: var(--gray-200);
    color: var(--gray-600);
    margin-left: 4px;
}

.tab.active .tab-count {
    background: var(--vf-blue);
    color: white;
}

/* === Scrollbar styling === */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .navbar-controls {
        gap: 4px;
    }

    .search-box input {
        width: 160px;
    }

    .search-box input:focus {
        width: 200px;
    }

    .detail-panel {
        width: 100%;
        right: -100%;
    }

    .col-deps {
        display: none;
    }

    .col-duration {
        display: none;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 var(--space-md);
    }

    .btn span {
        display: none;
    }

    .phase-summary {
        padding: var(--space-sm) var(--space-md);
    }

    .col-start, .col-finish {
        width: 80px;
    }
}

/* === Login Page === */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: auto;
    background: linear-gradient(135deg, var(--vf-blue) 0%, var(--vf-blue-dark) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: var(--space-xl);
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: var(--space-2xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-logo {
    margin-bottom: var(--space-md);
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.login-subtitle {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.login-form .form-group {
    margin-bottom: var(--space-lg);
}

.login-form label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-xs);
}

.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: var(--font-size-lg);
    transition: border-color 0.15s;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 44px;
}

.pwd-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.pwd-toggle:hover {
    color: var(--gray-600);
    background: var(--gray-100);
}

.login-form input:focus {
    outline: none;
    border-color: var(--vf-blue);
    box-shadow: 0 0 0 3px rgba(0, 100, 163, 0.1);
}

.form-error {
    color: var(--status-off-track);
    font-size: var(--font-size-sm);
    min-height: 20px;
    margin-bottom: var(--space-sm);
}

.btn-login {
    width: 100%;
    padding: 12px;
    font-size: var(--font-size-lg);
    font-weight: 600;
    justify-content: center;
    background: var(--vf-blue);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background 0.15s;
}

.btn-login:hover {
    background: var(--vf-blue-dark);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-footer {
    text-align: center;
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.6);
    margin-top: var(--space-xl);
}

/* === Forgot Password === */
.forgot-link-wrapper {
    text-align: center;
    margin-top: var(--space-md);
}
.forgot-link {
    font-size: 13px;
    color: var(--vf-blue);
    text-decoration: none;
    transition: color 0.15s;
}
.forgot-link:hover {
    color: var(--vf-blue-dark);
    text-decoration: underline;
}
.forgot-section {
    padding: 0;
}
.forgot-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--space-md);
}
.forgot-back {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
}
.forgot-back:hover {
    color: var(--vf-blue);
    background: var(--gray-100);
}
.forgot-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}
.forgot-desc {
    font-size: 13px;
    color: var(--gray-500);
    margin: 0 0 var(--space-lg) 0;
    line-height: 1.5;
}
.forgot-section .form-group {
    margin-bottom: var(--space-md);
}
.forgot-section label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-xs);
}
.forgot-section input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-family: inherit;
    color: var(--gray-800);
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.forgot-section input:focus {
    outline: none;
    border-color: var(--vf-blue);
    box-shadow: 0 0 0 3px rgba(0, 100, 163, 0.1);
}
.form-success {
    background: #D5F0E2;
    color: #1A7A4C;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

/* === Password Reset Page === */
.reset-page .login-container {
    max-width: 520px;
}
.reset-page .password-wrapper input {
    padding-right: 48px;
}
.reset-page .login-form input[type="password"],
.reset-page .login-form input[type="text"] {
    font-size: 14px;
}
.pwd-requirements {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}
.pwd-req {
    font-size: 11px;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 4px;
}
.pwd-req::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gray-300);
    transition: background 0.15s;
}
.pwd-req-met {
    color: var(--status-on-track);
}
.pwd-req-met::before {
    background: var(--status-on-track);
}
.reset-success-card {
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
}
.reset-success-card svg {
    margin-bottom: var(--space-md);
}
.reset-success-card h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1A7A4C;
    margin: 0 0 var(--space-sm) 0;
}
.reset-success-card p {
    font-size: 14px;
    color: var(--gray-600);
    margin: 0 0 var(--space-xl) 0;
    line-height: 1.5;
}
.reset-success-card .btn-login {
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

/* === Admin Page === */
.admin-content {
    padding: var(--space-xl);
    overflow: auto;
    flex: 1;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.admin-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.admin-table-container {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    overflow: auto;
    max-height: 50vh;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.admin-table th {
    background: var(--gray-100);
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.admin-table th:nth-child(1) { width: 16%; }  /* Name */
.admin-table th:nth-child(2) { width: 22%; }  /* Email */
.admin-table th:nth-child(3) { width: 12%; }  /* Role */
.admin-table th:nth-child(4) { width: 26%; }  /* Workstreams */
.admin-table th:nth-child(5) { width: 10%; }  /* Status */
.admin-table th:nth-child(6) { width: 14%; }  /* Actions */

.admin-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--gray-100);
    font-size: var(--font-size-sm);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-sm {
    padding: 4px 10px;
    font-size: var(--font-size-xs);
}

/* Admin search & filters */
.admin-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.admin-search-wrapper {
    position: relative;
}

.admin-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

.admin-search-input {
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: var(--font-size-sm);
    width: 260px;
    outline: none;
    transition: border-color 0.2s;
}

.admin-search-input:focus {
    border-color: var(--vattenfall-blue);
    box-shadow: 0 0 0 2px rgba(0, 100, 163, 0.15);
}

.admin-count {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--gray-400);
}

.sortable-th {
    cursor: pointer;
    user-select: none;
}

.sortable-th:hover {
    background: var(--gray-200);
}

.sort-arrow {
    font-size: 10px;
    color: var(--vattenfall-blue);
}

.admin-col-filter {
    display: block;
    margin-top: 4px;
    padding: 2px 4px;
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: white;
    color: var(--gray-700);
    cursor: pointer;
    max-width: 140px;
}

.admin-col-filter:focus {
    outline: none;
    border-color: var(--vattenfall-blue);
}

/* Inline edit pencil */
.btn-inline-edit {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    color: var(--gray-400);
    border-radius: 4px;
    vertical-align: middle;
    transition: color 0.15s, background 0.15s;
}

.btn-inline-edit:hover {
    color: var(--vattenfall-blue);
    background: rgba(0, 100, 163, 0.08);
}

.actions-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* === Modal === */
.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: 500;
    backdrop-filter: blur(2px);
}

.modal-card {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin: 0;
}

.modal-body {
    padding: var(--space-xl);
}

.modal-body .form-group {
    margin-bottom: var(--space-lg);
}

.modal-body label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-xs);
}

.modal-body input[type="text"],
.modal-body input[type="email"],
.modal-body input[type="password"],
.modal-body input[type="number"],
.modal-body select,
.modal-body textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: var(--font-size-md);
    font-family: var(--font-family);
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
    outline: none;
    border-color: var(--vf-blue);
    box-shadow: 0 0 0 3px rgba(0, 100, 163, 0.1);
}

.modal-body select:disabled {
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: not-allowed;
    opacity: 0.8;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--gray-200);
    margin-top: var(--space-lg);
}

/* Workstream assignment rows in modal */
.ws-row {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    align-items: center;
}

.ws-row select {
    flex: 1;
}

.btn-remove-ws {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    cursor: pointer;
    color: var(--gray-400);
    font-size: 16px;
    line-height: 1;
    transition: all 0.15s;
}

.btn-remove-ws:hover {
    color: var(--status-off-track);
    border-color: var(--status-off-track);
    background: var(--status-off-track-bg);
}

/* === Edit Form in Detail Panel === */
.edit-section {
    background: var(--vf-blue-light);
    border: 1px solid rgba(0, 100, 163, 0.2);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
}

.edit-form .form-group {
    margin-bottom: var(--space-md);
}

.required-star {
    color: #DC2626;
    font-weight: 700;
}

.edit-form label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: var(--space-xs);
}

.edit-form select,
.edit-form input,
.edit-form textarea {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    font-family: var(--font-family);
    background: white;
}

.edit-form select:focus,
.edit-form input:focus,
.edit-form textarea:focus {
    outline: none;
    border-color: var(--vf-blue);
}

.edit-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.edit-status {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

.edit-status.success {
    color: var(--status-on-track);
    font-weight: 600;
}

.edit-status.error {
    color: var(--status-off-track);
    font-weight: 600;
}

/* === Dependency Dialog === */
.dep-modal-card {
    max-width: 640px;
}

.dep-dialog-search-section {
    margin-bottom: var(--space-xl);
}

.dep-dialog-search-section label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: var(--space-xs);
}

.dep-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: var(--font-size-md);
    font-family: var(--font-family);
}

.dep-search-input:focus {
    outline: none;
    border-color: var(--vf-blue);
    box-shadow: 0 0 0 3px rgba(0, 100, 163, 0.1);
}

.dep-search-results {
    max-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: var(--space-sm);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
}

.dep-search-results:empty {
    display: none;
}

.dep-search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--gray-100);
    gap: var(--space-sm);
}

.dep-search-result-item:last-child {
    border-bottom: none;
}

.dep-search-result-item:hover {
    background: var(--gray-50);
}

.dep-search-result-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
    flex: 1;
}

.dep-search-result-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--font-size-sm);
    color: var(--gray-800);
}

.dep-search-result-actions {
    display: flex;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.dep-search-no-results {
    padding: var(--space-md);
    text-align: center;
    color: var(--gray-400);
    font-size: var(--font-size-sm);
}

.dep-dialog-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.dep-dialog-list-section {
    min-width: 0;
}

.dep-dialog-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    max-height: 200px;
    overflow-y: auto;
}

.dep-dialog-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--border-radius);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    font-size: var(--font-size-sm);
    min-width: 0;
}

.dep-dialog-item:hover {
    border-color: var(--gray-300);
}

.dep-dialog-item-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
    flex: 1;
}

.dep-dialog-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dep-dialog-empty {
    color: var(--gray-400);
    font-size: var(--font-size-sm);
    font-style: italic;
    padding: var(--space-sm);
}

.dep-dialog-status {
    margin-top: var(--space-md);
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    text-align: center;
    min-height: 20px;
}

.dep-dialog-status.success {
    color: var(--status-on-track);
    font-weight: 600;
}

.dep-dialog-status.error {
    color: var(--status-off-track);
    font-weight: 600;
}

.btn-add-dep {
    color: var(--vf-blue) !important;
    border-color: var(--vf-blue) !important;
    background: rgba(0, 100, 163, 0.06) !important;
    white-space: nowrap;
}

.btn-add-dep:hover:not([disabled]) {
    background: rgba(0, 100, 163, 0.14) !important;
}

.btn-add-dep[disabled] {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
    color: var(--gray-400) !important;
    border-color: var(--gray-300) !important;
    background: var(--gray-50) !important;
}

.btn-dep-remove {
    padding: 2px 6px;
    font-size: 14px;
    line-height: 1;
    color: var(--gray-400);
    flex-shrink: 0;
}

.btn-dep-remove:hover {
    color: var(--status-off-track);
    border-color: var(--status-off-track);
}

.btn-manage-deps {
    float: right;
    margin-top: -4px;
}

.detail-section-title {
    overflow: hidden;
}

/* === Date inputs in edit form === */
.edit-form input[type="date"] {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    font-family: var(--font-family);
    background: white;
}

.edit-form input[type="date"]:focus {
    outline: none;
    border-color: var(--vf-blue);
}

/* === Form row (side-by-side fields) === */
.form-row {
    display: flex;
    gap: var(--space-md);
}

.form-half {
    flex: 1;
    min-width: 0;
}

.form-half label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: var(--space-xs);
}

.form-half input {
    width: 100%;
}

/* === Workstream rows in edit/create forms === */
.edit-form .ws-row {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    align-items: center;
}

.edit-form .ws-row select {
    flex: 1;
}

.edit-form .btn-remove-ws {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--gray-400);
    font-size: 16px;
}

.edit-form .btn-remove-ws:hover {
    color: var(--status-off-track);
    border-color: var(--status-off-track);
}

/* === Edit task action buttons (add sub-task, delete) === */
.edit-task-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(0, 100, 163, 0.15);
}

#btnAddSubtask {
    color: var(--vf-blue) !important;
    border: 1px solid var(--vf-blue) !important;
    background: rgba(0, 100, 163, 0.06) !important;
}

#btnAddSubtask:hover {
    background: rgba(0, 100, 163, 0.14) !important;
}

.btn-danger-outline {
    color: var(--status-off-track) !important;
    border-color: var(--status-off-track) !important;
    background: white !important;
}

.btn-danger-outline:hover {
    background: var(--status-off-track-bg) !important;
}

/* === Delete button (solid danger) === */
.btn-danger {
    background: var(--status-off-track);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-danger:hover {
    background: #A93226;
}

/* ── Delete Task Modal Styles ── */
.delete-modal-header {
    background: #FEF2F2;
    border-bottom: 1px solid #FECACA;
}
.delete-modal-header h3 {
    color: #991B1B;
}
.delete-modal-header-final {
    background: #DC2626;
    border-bottom: none;
}
.delete-modal-header-final h3 {
    color: white;
}
.delete-task-name {
    font-size: var(--font-size-md);
    color: var(--gray-700);
    line-height: 1.5;
    margin-bottom: var(--space-md);
}
.delete-ws-impact {
    margin-bottom: var(--space-lg);
}
.delete-ws-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-radius: var(--border-radius);
    color: #92400E;
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 8px;
}
.delete-ws-warning svg {
    flex-shrink: 0;
    margin-top: 1px;
}
.delete-ws-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0;
}
.delete-ws-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
    border-radius: 12px;
}
.delete-final-msg {
    font-size: var(--font-size-md);
    color: var(--gray-700);
    line-height: 1.6;
    text-align: center;
    padding: var(--space-md) 0;
}

/* === Add Workstream row button in modals/panels === */
.btn-add-ws-row,
#btnAddEditWsRow {
    margin-top: var(--space-xs);
    font-size: var(--font-size-xs);
    color: var(--vf-blue) !important;
    border: 1px dashed var(--vf-blue) !important;
    background: rgba(0, 100, 163, 0.04) !important;
}

.btn-add-ws-row:hover,
#btnAddEditWsRow:hover {
    background: rgba(0, 100, 163, 0.1) !important;
    border-style: solid !important;
}

/* === Date constraint hint === */
.date-constraint-hint {
    margin-top: calc(-1 * var(--space-sm));
    margin-bottom: var(--space-md);
    padding: 8px 12px;
    background: rgba(0, 100, 163, 0.06);
    border: 1px solid rgba(0, 100, 163, 0.15);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    color: var(--vf-blue);
    line-height: 1.4;
}

/* === Create Task Modal extras === */
.modal-body input[type="date"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: var(--font-size-md);
    font-family: var(--font-family);
}

.modal-body input[type="date"]:focus {
    outline: none;
    border-color: var(--vf-blue);
    box-shadow: 0 0 0 3px rgba(0, 100, 163, 0.1);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 500 !important;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto !important;
    margin: 0;
}

.create-task-status {
    margin-top: var(--space-md);
    font-size: var(--font-size-sm);
    min-height: 20px;
    text-align: center;
}

.create-task-status.error {
    color: var(--status-off-track);
    font-weight: 600;
}

.create-task-status.success {
    color: var(--status-on-track);
    font-weight: 600;
}

/* === Add Task navbar button === */
#btnAddTask {
    background: rgba(255, 210, 0, 0.2);
    border-color: var(--vf-yellow);
    color: var(--vf-yellow);
}

#btnAddTask:hover {
    background: rgba(255, 210, 0, 0.35);
}

/* === Pending Approval Task Styles === */
.task-row.pending-approval {
    background: #FFF5F5 !important;
    border-left: 3px solid #E53E3E;
}

.task-row.pending-approval:hover {
    background: #FED7D7 !important;
}

.status-badge.pending-approval-badge {
    background: #FFF5F5;
    color: #C53030;
    border: 1px solid #FC8181;
    font-weight: 600;
}

/* === Approval Section in Detail Panel === */
.approval-section {
    border: 1px solid #FC8181;
    border-radius: var(--border-radius);
    background: #FFF5F5;
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.approval-banner {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    font-weight: 600;
    color: #C53030;
    font-size: var(--font-size-lg);
}

.approval-banner svg {
    flex-shrink: 0;
}

.approval-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-approve {
    background: var(--status-on-track);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-approve:hover {
    background: #257A4A;
}

.btn-reject {
    background: white;
    color: var(--status-off-track);
    border: 1px solid var(--status-off-track);
    padding: 8px 20px;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-reject:hover {
    background: var(--status-off-track-bg);
}

/* === Reject Task Modal === */
.reject-modal-header {
    border-bottom: 2px solid #FC8181;
}

.reject-modal-header h3 {
    color: #C53030;
}

.reject-task-name {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-50);
    border-radius: var(--border-radius);
    border-left: 3px solid #E53E3E;
}

.reject-description {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

.reject-status {
    margin-top: var(--space-sm);
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    min-height: 20px;
}

.reject-status.error {
    color: var(--status-off-track);
}

/* === Not in PoaP Task Styles === */
.task-row.not-poap {
    background: var(--gray-50) !important;
    border-left: 3px solid var(--gray-400);
    opacity: 0.75;
}

.task-row.not-poap:hover {
    background: var(--gray-100) !important;
    opacity: 1;
}

.status-badge.not-poap-badge {
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1px solid var(--gray-400);
    font-weight: 600;
}

.not-poap-section {
    border-color: var(--gray-400) !important;
    background: var(--gray-50) !important;
}

.not-poap-banner {
    color: var(--gray-600) !important;
}

.not-poap-reason {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    font-style: italic;
    margin: 0;
    padding: var(--space-sm) var(--space-md);
    background: white;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--gray-400);
}

/* === Autocomplete / Assignee Search === */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    border: 1px solid var(--gray-300);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--gray-800);
    transition: background 0.1s;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--vf-blue-light);
    color: var(--vf-blue);
}

.autocomplete-item strong {
    font-weight: 700;
    color: var(--vf-blue);
}

/* === Changelog / Version History === */
.btn-changelog {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--gray-400);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    margin-left: auto;
    margin-right: var(--space-xs);
}

.btn-changelog:hover {
    background: var(--vf-blue-light);
    color: var(--vf-blue);
}

.changelog-back {
    margin-bottom: var(--space-lg);
}

.changelog-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    color: var(--gray-400);
}

.changelog-empty {
    text-align: center;
    color: var(--gray-400);
    font-size: var(--font-size-sm);
    padding: var(--space-2xl);
}

.changelog-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.changelog-entry {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: var(--space-md);
    background: var(--gray-50);
}

.changelog-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
    gap: var(--space-sm);
}

.changelog-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.changelog-user {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-700);
}

.changelog-time {
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.changelog-changes {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.changelog-change-line {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
    line-height: 1.4;
    flex-wrap: wrap;
}

.changelog-field {
    font-weight: 600;
    color: var(--gray-600);
    min-width: 80px;
}

.changelog-old {
    color: var(--status-off-track);
    text-decoration: line-through;
    word-break: break-word;
}

.changelog-arrow {
    color: var(--gray-400);
    flex-shrink: 0;
}

.changelog-new {
    color: var(--status-on-track);
    font-weight: 500;
    word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════
   Status Report Styles
   ═══════════════════════════════════════════════════════════ */

.status-report {
    max-width: 1100px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* Report Header */
.sr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl) var(--space-2xl);
    background: var(--vf-blue);
    color: white;
}

.sr-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.sr-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 0;
}

.sr-cw-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    font-size: var(--font-size-sm);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sr-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.sr-date {
    font-size: var(--font-size-sm);
    opacity: 0.85;
}

.sr-logo {
    display: flex;
    align-items: center;
}

/* Section */
.sr-section {
    padding: var(--space-xl) var(--space-2xl);
    border-bottom: 1px solid var(--gray-200);
}

.sr-section:last-of-type {
    border-bottom: none;
}

.sr-section-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--vf-blue);
    margin: 0 0 var(--space-lg) 0;
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--vf-blue);
    display: inline-block;
}

/* RAG Circles */
.rag-circle {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rag-circle.rag-green {
    background: var(--status-on-track);
    box-shadow: 0 0 0 3px var(--status-on-track-bg);
}

.rag-circle.rag-amber {
    background: var(--status-at-risk);
    box-shadow: 0 0 0 3px var(--status-at-risk-bg);
}

.rag-circle.rag-red {
    background: var(--status-off-track);
    box-shadow: 0 0 0 3px var(--status-off-track-bg);
}

.rag-circle.rag-gray {
    background: var(--status-not-started);
    box-shadow: 0 0 0 3px var(--status-not-started-bg);
}

/* Overall Status Dimensions */
.sr-dimensions {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-md);
}

.sr-dimension {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-sm);
    border-radius: var(--border-radius);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    text-align: center;
}

.sr-dimension .rag-circle {
    width: 32px;
    height: 32px;
}

.sr-dimension-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sr-dimension-status {
    font-size: var(--font-size-xs);
    font-weight: 700;
}

.sr-dimension-status.rag-green { color: var(--status-on-track); }
.sr-dimension-status.rag-amber { color: var(--status-at-risk); }
.sr-dimension-status.rag-red { color: var(--status-off-track); }
.sr-dimension-status.rag-gray { color: var(--status-not-started); }

/* Key Activities / Concerns List */
.sr-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.sr-list-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-50);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

.sr-list-badge {
    display: inline-block;
    flex-shrink: 0;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    background: var(--vf-blue-light);
    color: var(--vf-blue);
    white-space: nowrap;
}

.sr-list-text {
    font-size: var(--font-size-sm);
    color: var(--gray-700);
    line-height: 1.5;
}

.sr-concern-item {
    border-left: 3px solid var(--status-at-risk);
}

.sr-concern-badge {
    background: var(--status-at-risk-bg);
    color: var(--status-at-risk);
}

.sr-empty {
    font-size: var(--font-size-sm);
    color: var(--gray-400);
    font-style: italic;
    padding: var(--space-lg) 0;
    text-align: center;
}

/* Status Report Tables */
.sr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.sr-table thead th {
    background: var(--gray-100);
    color: var(--gray-600);
    font-weight: 600;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 2px solid var(--gray-300);
    white-space: nowrap;
}

.sr-table tbody td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    vertical-align: middle;
}

.sr-table tbody tr:hover {
    background: var(--gray-50);
}

.sr-table tbody tr:last-child td {
    border-bottom: none;
}

.sr-milestone-name {
    font-weight: 600;
    color: var(--gray-800);
}

.sr-comment-cell {
    max-width: 280px;
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    line-height: 1.4;
}

/* Workstream Details Table */
.sr-ws-table .sr-ws-name {
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
}

.sr-ws-rag {
    text-align: center;
    width: 60px;
}

.sr-progress-cell {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 100px;
}

.sr-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.sr-progress-fill {
    height: 100%;
    background: var(--vf-blue);
    border-radius: 3px;
    transition: width 0.3s;
}

.sr-progress-pct {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
    min-width: 32px;
    text-align: right;
}

/* Report Footer */
.sr-footer {
    display: flex;
    justify-content: space-between;
    padding: var(--space-md) var(--space-2xl);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    font-size: var(--font-size-xs);
    color: var(--gray-400);
}

/* Responsive: Status Report */
@media (max-width: 768px) {
    .sr-dimensions {
        grid-template-columns: repeat(3, 1fr);
    }

    .sr-header {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }

    .sr-header-left, .sr-header-right {
        justify-content: center;
    }

    .sr-title {
        font-size: 18px;
    }

    .sr-section {
        padding: var(--space-lg) var(--space-lg);
    }

    .sr-table {
        font-size: var(--font-size-xs);
    }

    .sr-comment-cell {
        max-width: 120px;
    }

    .status-report-wrapper {
        padding: var(--space-md);
    }

    .sr-footer {
        flex-direction: column;
        gap: var(--space-xs);
        text-align: center;
    }
}

@media (max-width: 480px) {
    .sr-dimensions {
        grid-template-columns: repeat(2, 1fr);
    }

    .sr-list-item {
        flex-direction: column;
    }
}

/* === Workstream Status Detail Modal === */
.ws-detail-modal {
    max-width: 95vw;
    width: 1200px;
}
.ws-detail-modal .modal-body {
    max-height: 80vh;
    overflow-y: auto;
    padding: var(--space-lg);
}

/* Clickable workstream names in status summary table */
.sr-ws-clickable {
    cursor: pointer;
    transition: color 0.15s;
}
.sr-ws-clickable:hover {
    color: var(--vf-blue);
    text-decoration: underline;
}
.sr-ws-arrow {
    font-size: 12px;
    color: var(--gray-300);
    margin-left: 4px;
    transition: color 0.15s;
}
.sr-ws-clickable:hover .sr-ws-arrow {
    color: var(--vf-blue);
}

/* Summary bar */
.ws-detail-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--space-lg);
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-50);
    border-radius: var(--radius-md);
}
.ws-detail-total {
    font-weight: 700;
    font-size: var(--font-size-md);
    color: var(--gray-800);
    margin-right: 8px;
}
.ws-detail-avg {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-right: auto;
}
.ws-detail-stat {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.ws-stat-rag-green { background: #DEF7EC; color: #03543F; }
.ws-stat-rag-amber { background: #FEF3C7; color: #92400E; }
.ws-stat-rag-red { background: #FDE8E8; color: #9B1C1C; }
.ws-stat-rag-gray { background: var(--gray-100); color: var(--gray-600); }

/* Loading & empty states */
.ws-detail-loading,
.ws-detail-empty {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--gray-400);
    font-size: var(--font-size-md);
}

/* L1 group headers */
.ws-detail-group {
    margin-bottom: var(--space-md);
}
.ws-detail-group-header {
    cursor: pointer;
    padding: 8px 12px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    margin-bottom: 4px;
}
.ws-detail-group-header:hover {
    background: var(--gray-200);
}
.ws-detail-chevron {
    font-size: 14px;
    width: 16px;
    text-align: center;
}
.ws-detail-group-count {
    font-weight: 400;
    color: var(--gray-400);
    font-size: var(--font-size-xs);
    margin-left: 4px;
}

/* L2 sub-group headers */
.ws-detail-subgroup {
    padding: 4px 8px 4px 24px;
    font-weight: 600;
    color: var(--gray-500);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: var(--space-sm);
}

/* Detail table */
.ws-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: var(--space-sm);
}
.ws-detail-table thead th {
    background: var(--gray-50);
    padding: 5px 8px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--gray-500);
    font-weight: 600;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}
.ws-detail-table tbody td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
}
.ws-detail-table tbody tr:hover {
    background: var(--gray-50);
}
.ws-detail-uid {
    font-family: monospace;
    font-size: 12px;
    color: var(--gray-400);
}
.ws-detail-task {
    font-weight: 500;
    color: var(--gray-800);
}
.ws-detail-table .comment-cell {
    max-width: 220px;
    font-size: 12px;
    color: var(--gray-600);
    word-wrap: break-word;
    line-height: 1.4;
}
.ws-detail-table .meeting-cell {
    max-width: 180px;
    font-size: 12px;
    color: var(--gray-400);
    font-style: italic;
    word-wrap: break-word;
    line-height: 1.4;
}

/* Status/alignment badges in detail table */
.ws-detail-status-badge,
.ws-detail-align-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* === Extra Sections (Comments, Actions, Risks, Gaps) === */
.ws-extra-section {
    margin-top: 16px;
    border-top: 2px solid var(--gray-200);
    padding-top: 8px;
}

.ws-extra-header {
    cursor: pointer;
    padding: 8px 12px;
    background: var(--gray-100);
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-700);
    user-select: none;
    transition: background 0.15s;
}

.ws-extra-header:hover {
    background: var(--gray-200);
}

.ws-extra-header-risk {
    border-left: 3px solid #EF4444;
}

.ws-extra-header-gap {
    border-left: 3px solid #8B5CF6;
}

.ws-extra-body {
    padding: 4px 0;
}

.ws-extra-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 4px;
}

.ws-extra-table th {
    background: var(--gray-50);
    padding: 6px 8px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
}

.ws-extra-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
    line-height: 1.4;
}

.ws-extra-table tr:hover td {
    background: var(--gray-50);
}

.ws-extra-text {
    max-width: 300px;
    word-wrap: break-word;
    color: var(--gray-600);
    font-size: 12px;
}

.ws-extra-pmt {
    max-width: 250px;
    word-wrap: break-word;
    font-style: italic;
    color: #0369A1;
    font-size: 12px;
}

/* Action Item status badges */
.ws-act-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.ws-act-closed {
    background: #D1FAE5;
    color: #065F46;
}

.ws-act-wip {
    background: #FEF3C7;
    color: #92400E;
}

.ws-act-open {
    background: var(--gray-100);
    color: var(--gray-600);
}

.ws-act-id {
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
}

/* Severity badges */
.ws-sev-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.ws-sev-critical {
    background: #FEE2E2;
    color: #991B1B;
}

.ws-sev-high {
    background: #FEE2E2;
    color: #DC2626;
}

.ws-sev-medium {
    background: #FEF3C7;
    color: #92400E;
}

.ws-sev-low {
    background: #D1FAE5;
    color: #065F46;
}

/* Gap SAB status badges */
.ws-sab-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.ws-sab-approved {
    background: #D1FAE5;
    color: #065F46;
}

.ws-sab-rejected {
    background: #FEE2E2;
    color: #991B1B;
}

.ws-sab-other {
    background: var(--gray-100);
    color: var(--gray-600);
}

.ws-gap-id {
    font-weight: 600;
    font-family: monospace;
    font-size: 12px;
    color: #7C3AED;
    white-space: nowrap;
}

/* === PoaP Preview Modal === */
.poap-preview-card {
    max-width: 95vw !important;
    width: 95vw;
    max-height: 95vh;
    height: 95vh;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
}

.poap-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    flex-shrink: 0;
}

.poap-preview-header h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--vf-blue);
    margin: 0;
}

.poap-preview-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.poap-preview-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    background: var(--vf-blue);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background 0.15s;
}

.poap-preview-actions .btn-primary:hover {
    background: var(--vf-blue-dark);
}

.poap-preview-actions .btn-close {
    font-size: 22px;
    line-height: 1;
    color: var(--gray-500);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.poap-preview-actions .btn-close:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.poap-preview-body {
    flex: 1;
    overflow: hidden;
    background: var(--gray-300);
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

.poap-preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* ── Planning Assumptions Modal ── */
#planningAssumptionsOverlay {
    z-index: 1000;
    background: rgba(0, 0, 0, 0.5);
}

.planning-assumptions-modal {
    max-width: 1100px;
    width: 96vw;
    max-height: 92vh;
    background: #ffffff !important;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.planning-assumptions-body {
    padding: var(--space-lg) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.pa-table-wrapper {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

.pa-meta {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    margin-bottom: var(--space-md);
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.pa-summary {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
    font-size: var(--font-size-xs);
    color: var(--gray-600);
    flex-shrink: 0;
}

.pa-summary-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pa-summary-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pa-summary-dot.holds { background: #16A34A; }
.pa-summary-dot.broken { background: #DC2626; }
.pa-summary-dot.pending { background: var(--gray-300); }

/* Search bar */
.pa-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 8px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    flex-shrink: 0;
    border-radius: 8px;
}

.pa-search-icon {
    color: var(--gray-400);
    flex-shrink: 0;
}

.pa-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--font-size-sm);
    outline: none;
    color: var(--gray-700);
}

.pa-search-input::placeholder {
    color: var(--gray-400);
}

.pa-search-clear {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    display: none;
}

.pa-search-clear.visible {
    display: block;
}

.pa-search-clear:hover {
    color: var(--gray-600);
}

.pa-row-hidden {
    display: none;
}

/* Table */
.pa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.pa-table thead th {
    background: var(--gray-50);
    font-weight: 700;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-600);
    padding: 8px 10px;
    text-align: left;
    border-bottom: 2px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 2;
}

.pa-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
    line-height: 1.45;
    color: var(--gray-700);
}

.pa-table tbody tr:hover {
    background: var(--gray-50);
}

.pa-col-id { width: 42px; }
.pa-col-cat { width: 130px; }
.pa-col-text { }
.pa-col-status { width: 90px; text-align: center !important; }
.pa-col-comment { width: 180px; }
.pa-col-meta { width: 110px; }

/* Category section header rows */
.pa-table .pa-cat-header td {
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 6px 10px;
    border-bottom: none;
}

.pa-table .pa-cat-header:hover td {
    background: var(--primary);
}

/* Status toggle */
.pa-status-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid var(--gray-300);
    background: white;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 16px;
    line-height: 1;
}

.pa-status-toggle:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.pa-status-toggle[data-status="true"] {
    border-color: #16A34A;
    background: #F0FDF4;
    color: #16A34A;
}

.pa-status-toggle[data-status="false"] {
    border-color: #DC2626;
    background: #FEF2F2;
    color: #DC2626;
}

/* Comment input */
.pa-comment-input,
.pa-text-input {
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 4px 6px;
    font-size: var(--font-size-xs);
    color: var(--gray-700);
    resize: vertical;
    font-family: inherit;
    min-height: 28px;
    transition: border-color 0.15s;
}

.pa-text-input {
    min-height: 42px;
    background: var(--gray-50);
}

.pa-comment-input:focus,
.pa-text-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

/* Editable cell: display + pencil pattern */
.pa-editable-cell {
    position: relative;
}

.pa-display-wrap {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-height: 28px;
    cursor: default;
}

.pa-display-text {
    flex: 1;
    font-size: var(--font-size-xs);
    color: var(--gray-700);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.pa-display-text.pa-placeholder {
    color: var(--gray-400);
    font-style: italic;
}

.pa-edit-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 3px 4px;
    cursor: pointer;
    color: var(--gray-400);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    line-height: 1;
}

.pa-edit-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--gray-50);
}

.pa-pencil-svg {
    display: block;
}

.pa-hidden {
    display: none !important;
}

/* Updated meta */
.pa-updated-meta {
    font-size: 10px;
    color: var(--gray-400);
    line-height: 1.3;
}

.pa-id-cell {
    font-family: monospace;
    font-size: var(--font-size-xs);
    color: var(--gray-400);
    font-weight: 600;
}

.pa-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.pa-row-edited {
    background: #FFFBEB !important;
}

.pa-edited-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 1px 6px;
    border-radius: 3px;
    background: #FEF3C7;
    color: #D97706;
    border: 1px solid #F59E0B;
    margin-top: 4px;
}

.pa-summary-changes {
    font-weight: 700;
    color: #D97706 !important;
}

/* ── Toast Notifications ── */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: white;
    z-index: 9999;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { background: #16A34A; }
.toast-error { background: #DC2626; }
.toast-info { background: #2563EB; }

/* ── Detail panel badges row ── */
.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    justify-content: flex-start;
}

.detail-badges:empty {
    display: none;
}

/* ── Due Today button ── */
.btn-toolbar-due {
    color: #7C3AED;
}

.btn-toolbar-due:hover {
    background: #EDE9FE;
    color: #6D28D9;
}

.btn-toolbar-due.active {
    background: #7C3AED;
    color: white;
}

/* ── Due Today Modal ── */
/* Confirm reminder popup */
.confirm-reminder-modal {
    max-width: 520px;
    width: 90vw;
    background: white;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}
.confirm-reminder-modal .modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
}
.confirm-reminder-modal .modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: white;
}
.confirm-reminder-modal .btn-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.confirm-reminder-modal .btn-close:hover {
    background: rgba(255,255,255,0.3);
}

.due-today-modal {
    max-width: 1000px;
    width: 95vw;
    height: 80vh;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    position: fixed;
    top: 5vh;
    left: 50%;
    transform: translateX(-50%);
}

.due-today-body {
    overflow: hidden;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.dt-header-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

/* Date selector tabs */
.dt-date-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--space-md);
    padding: 4px;
    background: var(--gray-100);
    border-radius: 8px;
    width: fit-content;
}
.dt-date-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.dt-date-btn:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}
.dt-date-btn.active {
    background: #7C3AED;
    color: white;
    box-shadow: 0 1px 3px rgba(124, 58, 237, 0.3);
}
.dt-custom-date {
    padding: 5px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 13px;
    color: var(--gray-700);
    background: white;
    cursor: pointer;
}
.dt-custom-date:focus {
    outline: none;
    border-color: #7C3AED;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}

.dt-summary {
    margin-bottom: var(--space-md);
}

.dt-summary-bar {
    display: flex;
    gap: var(--space-lg);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.dt-summary-total { color: #7C3AED; }
.dt-summary-done { color: #16A34A; }
.dt-summary-inprogress { color: #2563EB; }
.dt-summary-notstarted { color: var(--gray-500); }

.dt-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: var(--space-md);
}

.dt-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
    z-index: 1;
}

.dt-search-input {
    width: 100%;
    padding: 8px 30px 8px 10px;
    text-indent: 28px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: var(--font-size-sm);
    background: var(--gray-50);
}

.dt-search-input:focus {
    border-color: var(--blue-500);
    background: white;
    outline: none;
}

.dt-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    font-size: 16px;
    color: var(--gray-400);
    cursor: pointer;
    display: none;
}

.dt-search-clear.visible { display: block; }

.dt-table-wrapper {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

.dt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.dt-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    padding: 8px 10px;
    text-align: left;
    font-weight: 700;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    white-space: nowrap;
}

.dt-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.dt-table tbody tr:hover {
    background: var(--gray-50);
}

.dt-col-num { width: 35px; text-align: center; }
.dt-col-wbs { width: 80px; font-family: monospace; font-size: var(--font-size-xs); color: var(--gray-500); }
.dt-col-name { min-width: 250px; }
.dt-col-ws { width: 140px; }
.dt-col-owner { width: 120px; }
.dt-col-progress { width: 100px; }
.dt-col-status { width: 100px; }

.dt-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

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

.dt-progress-text {
    font-size: 10px;
    color: var(--gray-500);
    margin-top: 2px;
}

.dt-row-hidden { display: none; }

.dt-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--gray-400);
    gap: var(--space-md);
}

.dt-empty p {
    font-size: var(--font-size-md);
    font-weight: 600;
}

.due-today-modal .modal-header,
.due-today-modal .btn-close {
    /* inherits shared modal styling below */
}

.dt-col-check { width: 35px; text-align: center; }

.dt-col-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #7C3AED;
}

.dt-row-no-owner {
    background: #FEF2F2;
}

.dt-row-no-owner .dt-col-owner {
    color: #DC2626;
    font-style: italic;
    font-weight: 600;
}

.dt-no-owner-warning {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #DC2626;
    font-weight: 600;
}

/* ── Email Template Modal ── */
.email-template-modal {
    max-width: 700px;
    width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.email-template-body {
    padding: var(--space-lg);
    overflow-y: auto;
}

.et-instructions {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    margin-bottom: var(--space-md);
}

.et-placeholders {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.et-placeholders code {
    background: #EDE9FE;
    color: #7C3AED;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
}

.et-textarea {
    width: 100%;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: var(--font-size-sm);
    padding: var(--space-md);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-50);
    resize: vertical;
    line-height: 1.6;
}

.et-textarea:focus {
    border-color: var(--blue-500);
    background: white;
    outline: none;
}

.et-meta {
    margin-top: var(--space-sm);
    font-size: var(--font-size-xs);
    color: var(--gray-400);
}

.et-header-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

/* ── SMTP Configuration Modal ── */
.smtp-config-modal {
    max-width: 600px;
    width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.smtp-config-body {
    padding: var(--space-lg);
    overflow-y: auto;
}

.smtp-form-group {
    margin-bottom: var(--space-md);
}

.smtp-form-group label {
    display: block;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--gray-700);
    margin-bottom: 4px;
}

.smtp-form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: var(--font-size-sm);
    background: var(--gray-50);
    box-sizing: border-box;
}

.smtp-form-group input:focus {
    border-color: var(--blue-500);
    background: white;
    outline: none;
}

.smtp-password-wrapper {
    position: relative;
}

.smtp-password-wrapper input {
    padding-right: 40px;
}

.smtp-toggle-pw {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smtp-toggle-pw:hover {
    color: var(--gray-600);
}

.smtp-header-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

/* ── Shared fullscreen modal styling (PA + EC + DT + ET) ── */
.planning-assumptions-modal .modal-header,
.entry-criteria-modal .modal-header,
.due-today-modal .modal-header,
.email-template-modal .modal-header,
.smtp-config-modal .modal-header {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    padding: var(--space-lg) var(--space-xl);
    flex-shrink: 0;
}

.planning-assumptions-modal .modal-header h3,
.entry-criteria-modal .modal-header h3,
.due-today-modal .modal-header h3,
.email-template-modal .modal-header h3,
.smtp-config-modal .modal-header h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.planning-assumptions-modal .btn-close,
.entry-criteria-modal .btn-close,
.due-today-modal .btn-close,
.email-template-modal .btn-close,
.smtp-config-modal .btn-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-200);
    background: white;
    font-size: 18px;
    cursor: pointer;
    color: var(--gray-500);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.planning-assumptions-modal .btn-close:hover,
.entry-criteria-modal .btn-close:hover,
.due-today-modal .btn-close:hover,
.email-template-modal .btn-close:hover,
.smtp-config-modal .btn-close:hover {
    background: #FEE2E2;
    border-color: #FECACA;
    color: #DC2626;
}

/* ── Entry Criteria Modal ── */
.entry-criteria-modal {
    max-width: 1100px;
    width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.entry-criteria-body {
    overflow: hidden;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.ec-table-wrapper {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

.ec-summary {
    margin-bottom: var(--space-md);
}

.ec-summary-bar {
    display: flex;
    gap: var(--space-lg);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.ec-summary-met { color: #16A34A; }
.ec-summary-notmet { color: #DC2626; }
.ec-summary-pending { color: #D97706; }
.ec-summary-total { color: var(--gray-500); }

.ec-header-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.ec-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: var(--space-md);
}

.ec-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
    z-index: 1;
}

.ec-search-input {
    width: 100%;
    padding: 8px 30px 8px 10px;
    text-indent: 28px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: var(--font-size-sm);
    background: var(--gray-50);
}

.ec-search-input:focus {
    border-color: var(--blue-500);
    background: white;
    outline: none;
}

.ec-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 16px;
    display: none;
}

.ec-search-clear.visible { display: block; }

.ec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.ec-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    padding: 8px 10px;
    text-align: left;
    font-weight: 700;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    white-space: nowrap;
}

.ec-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
}

.ec-table tbody tr:hover {
    background: var(--gray-50);
}

.ec-row-edited {
    background: #FFF8E1 !important;
}

.ec-row-hidden {
    display: none !important;
}

.ec-col-num { width: 35px; text-align: center; }
.ec-col-text { min-width: 250px; }
.ec-col-resp { width: 120px; }
.ec-col-due { width: 100px; }
.ec-col-status { width: 60px; text-align: center; }
.ec-col-comment { min-width: 150px; }
.ec-col-updated { width: 140px; font-size: var(--font-size-xs); color: var(--gray-500); }

.ec-status-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.15s;
}

.ec-status-toggle.ec-met {
    background: #DCFCE7;
    border-color: #16A34A;
    color: #16A34A;
}

.ec-status-toggle.ec-notmet {
    background: #FEE2E2;
    border-color: #DC2626;
    color: #DC2626;
}

.ec-status-toggle.ec-pending {
    background: #FEF3C7;
    border-color: #D97706;
    color: #D97706;
}

.ec-text-display {
    display: inline;
}

.ec-placeholder {
    color: var(--gray-400);
    font-style: italic;
}

.ec-edit-btn {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    margin-left: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.ec-table tbody tr:hover .ec-edit-btn {
    opacity: 1;
}

.ec-edit-btn:hover {
    color: var(--blue-500);
}

.ec-inline-edit {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--blue-500);
    border-radius: 4px;
    font-size: var(--font-size-sm);
    font-family: inherit;
}

textarea.ec-inline-edit {
    resize: vertical;
    min-height: 40px;
}

.ec-detail-section .detail-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.ec-detail-badge {
    font-size: var(--font-size-xs);
    font-weight: 600;
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 2px 8px;
    border-radius: 10px;
}

.ec-detail-progress {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.ec-detail-progress .progress-bar {
    flex: 1;
}

/* EC inline badge in main table */
.ec-inline-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.ec-inline-badge-done {
    background: #DCFCE7;
    color: #16A34A;
    border: 1px solid #BBF7D0;
}

.ec-inline-badge-partial {
    background: #FEF3C7;
    color: #D97706;
    border: 1px solid #FDE68A;
}

.ec-inline-badge-none {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.ec-detail-progress span {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--gray-500);
}

/* ── Documentation Modal ── */
.documentation-modal {
    max-width: 1200px;
    width: 96vw;
    max-height: 92vh;
    background: #ffffff !important;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.documentation-modal .modal-header {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    padding: var(--space-lg) var(--space-xl);
    flex-shrink: 0;
}

.documentation-modal .modal-header h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.documentation-modal .btn-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-200);
    background: white;
    font-size: 18px;
    cursor: pointer;
    color: var(--gray-500);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.documentation-modal .btn-close:hover {
    background: #FEE2E2;
    border-color: #FECACA;
    color: #DC2626;
}

.documentation-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0 !important;
}

.doc-sidebar {
    width: 250px;
    min-width: 250px;
    background: var(--gray-50);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    padding: var(--space-lg) 0;
    flex-shrink: 0;
}

.doc-sidebar-category {
    padding: var(--space-sm) var(--space-xl) var(--space-xs);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    margin-top: var(--space-sm);
}

.doc-sidebar-category:first-child {
    margin-top: 0;
}

.doc-sidebar-link {
    display: block;
    padding: 6px var(--space-xl) 6px 28px;
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    text-decoration: none;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.15s;
    line-height: 1.5;
}

.doc-sidebar-link:hover {
    color: var(--vf-blue);
    background: var(--vf-blue-light);
}

.doc-sidebar-link.active {
    color: var(--vf-blue);
    border-left-color: var(--vf-blue);
    background: var(--vf-blue-light);
    font-weight: 600;
}

.doc-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl) var(--space-2xl);
    scroll-behavior: smooth;
}

.doc-section {
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--gray-100);
}

.doc-section:last-child {
    border-bottom: none;
}

.doc-section h2 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 var(--space-xs) 0;
    padding-top: var(--space-sm);
}

.doc-section h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--vf-blue);
    margin: var(--space-xl) 0 var(--space-sm) 0;
}

.doc-section h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-700);
    margin: var(--space-lg) 0 var(--space-xs) 0;
}

.doc-section p {
    font-size: var(--font-size-md);
    color: var(--gray-600);
    line-height: 1.7;
    margin: 0 0 var(--space-md) 0;
}

.doc-section ul,
.doc-section ol {
    margin: 0 0 var(--space-md) 0;
    padding-left: 24px;
}

.doc-section li {
    font-size: var(--font-size-md);
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 4px;
}

.doc-section strong {
    color: var(--gray-800);
    font-weight: 600;
}

.doc-section code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: var(--font-size-sm);
    font-family: 'SF Mono', 'Consolas', monospace;
    color: var(--vf-blue-dark);
}

.doc-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    vertical-align: middle;
}

.doc-badge-blue {
    background: var(--vf-blue-light);
    color: var(--vf-blue);
}

.doc-badge-green {
    background: var(--status-on-track-bg);
    color: var(--status-on-track);
}

.doc-badge-red {
    background: var(--status-off-track-bg);
    color: var(--status-off-track);
}

.doc-badge-purple {
    background: var(--cutover-bg);
    color: var(--cutover-color);
}

.doc-badge-yellow {
    background: var(--vf-yellow-light);
    color: #92400E;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-md) 0;
    font-size: var(--font-size-sm);
}

.doc-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    text-align: left;
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
}

.doc-table td {
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
}

.doc-tip {
    background: var(--vf-blue-light);
    border-left: 4px solid var(--vf-blue);
    padding: var(--space-md) var(--space-lg);
    border-radius: 0 6px 6px 0;
    margin: var(--space-md) 0;
    font-size: var(--font-size-sm);
    color: var(--gray-700);
    line-height: 1.6;
}

.doc-tip strong {
    color: var(--vf-blue);
}

@media (max-width: 768px) {
    .doc-sidebar {
        width: 180px;
        min-width: 180px;
    }
    .doc-content {
        padding: var(--space-lg);
    }
}

/* ── My Profile Modal ── */
#myProfileOverlay {
    z-index: 1000;
    background: rgba(0, 0, 0, 0.5);
}

.my-profile-modal {
    max-width: 720px;
    width: 94vw;
    max-height: 90vh;
    background: #ffffff !important;
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.my-profile-modal .modal-header {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    padding: var(--space-lg) var(--space-xl);
    flex-shrink: 0;
}

.my-profile-modal .modal-header h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.my-profile-modal .btn-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-200);
    background: white;
    font-size: 18px;
    color: var(--gray-500);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.my-profile-modal .btn-close:hover {
    background: #FEE2E2;
    border-color: #FECACA;
    color: #DC2626;
}

.my-profile-body {
    padding: var(--space-xl);
    overflow-y: auto;
    flex: 1;
}

.my-profile-loading {
    text-align: center;
    padding: var(--space-xl);
    color: var(--gray-500);
    font-size: var(--font-size-base);
}

/* Profile header card */
.mp-header-card {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border-radius: 12px;
    margin-bottom: var(--space-lg);
}

.mp-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--indigo-600, #4F46E5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 1px;
}

.mp-user-info {
    flex: 1;
    min-width: 0;
}

.mp-display-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 2px 0;
}

.mp-email {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin: 0 0 8px 0;
}

.mp-role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mp-role-superadmin {
    background: #FEE2E2;
    color: #991B1B;
}

.mp-role-pmt {
    background: #DBEAFE;
    color: #1E40AF;
}

.mp-role-ct {
    background: #D1FAE5;
    color: #065F46;
}

.mp-role-stream_lead {
    background: #FEF3C7;
    color: #92400E;
}

.mp-role-viewer {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Workstreams section */
.mp-section-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin: 0 0 var(--space-sm) 0;
}

.mp-workstreams-card {
    padding: var(--space-md) var(--space-lg);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    margin-bottom: var(--space-lg);
}

.mp-ws-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: var(--space-xs);
}

.mp-ws-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #EEF2FF;
    color: #3730A3;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

.mp-no-ws {
    color: var(--gray-400);
    font-size: var(--font-size-sm);
    font-style: italic;
}

/* Activity section */
.mp-activity-section {
    margin-top: var(--space-sm);
}

.mp-activity-table-wrap {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
}

.mp-activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.mp-activity-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.mp-activity-table th {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    padding: 8px 12px;
    text-align: left;
    font-weight: 700;
    color: var(--gray-600);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.mp-activity-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: top;
}

.mp-activity-table tbody tr:last-child td {
    border-bottom: none;
}

.mp-activity-table tbody tr:hover {
    background: var(--gray-50);
}

.mp-action-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: capitalize;
}

.mp-action-create {
    background: #D1FAE5;
    color: #065F46;
}

.mp-action-update {
    background: #DBEAFE;
    color: #1E40AF;
}

.mp-action-delete {
    background: #FEE2E2;
    color: #991B1B;
}

.mp-no-activity {
    text-align: center;
    padding: var(--space-xl);
    color: var(--gray-400);
    font-style: italic;
}

.mp-detail-text {
    max-width: 260px;
    word-break: break-word;
}

.mp-old-val {
    color: #991B1B;
    text-decoration: line-through;
    margin-right: 4px;
}

.mp-new-val {
    color: #065F46;
}

.mp-arrow {
    color: var(--gray-400);
    margin: 0 2px;
}

/* === Status Report Toolbar === */
.sr-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--vf-blue-light) 0%, #f0f7fc 100%);
    border: 1px solid #d0e3f0;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    gap: var(--space-md);
    flex-wrap: wrap;
}
.sr-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sr-toolbar-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
}
.sr-toolbar-date {
    padding: 5px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: inherit;
    color: var(--gray-800);
    background: white;
    cursor: pointer;
    transition: border-color 0.15s;
}
.sr-toolbar-date:focus {
    outline: none;
    border-color: var(--vf-blue);
    box-shadow: 0 0 0 2px rgba(0, 100, 163, 0.15);
}
.sr-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    background: var(--vf-blue);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.sr-toolbar-btn:hover {
    background: var(--vf-blue-dark);
}
.sr-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sr-toolbar-cw {
    display: inline-block;
    padding: 3px 10px;
    background: var(--vf-blue);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.sr-toolbar-datestr {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
}

/* === Critical Tasks Progress Section === */
.sr-critical-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}
.sr-critical-table thead th {
    background: var(--gray-100);
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
    position: sticky;
    top: 0;
}
.sr-critical-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
.sr-critical-table tbody tr:hover {
    background: var(--gray-50);
}
.sr-critical-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.sr-critical-badge-cp {
    background: var(--critical-bg);
    color: var(--critical-red);
}
.sr-critical-badge-milestone {
    background: #EEF2FF;
    color: #4338CA;
}
.sr-task-name-cell {
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sr-task-comment-cell {
    max-width: 200px;
    font-size: 12px;
    color: var(--gray-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sr-task-progress-cell {
    min-width: 100px;
}
.sr-task-progress-bar {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sr-task-progress-track {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}
.sr-task-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}
.sr-task-progress-fill.fill-green { background: var(--status-on-track); }
.sr-task-progress-fill.fill-amber { background: var(--status-at-risk); }
.sr-task-progress-fill.fill-red { background: var(--status-off-track); }
.sr-task-progress-fill.fill-blue { background: var(--vf-blue); }
.sr-task-progress-pct {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-600);
    min-width: 32px;
    text-align: right;
}
.sr-rag-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.sr-rag-dot.dot-green { background: var(--status-on-track); }
.sr-rag-dot.dot-amber { background: var(--status-at-risk); }
.sr-rag-dot.dot-red { background: var(--status-off-track); }
.sr-rag-dot.dot-gray { background: var(--status-not-started); }
.sr-rag-dot.dot-blue { background: var(--status-completed); }
.sr-critical-summary {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
}
.sr-critical-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: var(--gray-700);
}
.sr-critical-stat .stat-val {
    font-size: 16px;
    font-weight: 700;
}

/* ── Commit Hash ── */
.commit-hash {
    position: fixed;
    bottom: 8px;
    left: 12px;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 10px;
    color: var(--gray-400);
    z-index: 10;
    pointer-events: none;
    user-select: all;
    opacity: 0.7;
}
