@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@300;400;500;600;700&family=Google+Sans+Flex:wght@300;400;500;600;700&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

:root {
    /* Color Palette (Default: Light Mode Theme) */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent-red: #b91c1c;
    --accent-red-hover: #991b1b;
    --accent-red-bg: rgba(185, 28, 28, 0.08);
    --accent-red-border-soft: rgba(185, 28, 28, 0.2);
    --accent-red-bg-hover: rgba(185, 28, 28, 0.12);
    --accent-red-shadow: rgba(185, 28, 28, 0.1);
    --accent-red-focus: rgba(185, 28, 28, 0.12);
    --accent-red-glow: rgba(185, 28, 28, 0.15);
    
    --status-green: #10b981;
    --status-green-bg: rgba(16, 185, 129, 0.1);
    --status-green-border: rgba(16, 185, 129, 0.3);
    
    --status-blue: #3b82f6;
    --status-blue-bg: rgba(59, 130, 246, 0.1);
    --status-blue-border: rgba(59, 130, 246, 0.3);
    
    --status-blocked: #ef4444;
    --status-blocked-bg: rgba(239, 68, 68, 0.1);
    --status-blocked-border: rgba(239, 68, 68, 0.3);
    
    --status-warning: #f59e0b;
    --status-warning-bg: rgba(245, 158, 11, 0.1);
    --status-warning-border: rgba(245, 158, 11, 0.3);
    
    --border-color: rgba(148, 163, 184, 0.22);
    
    /* Layout & Shadow constants */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Theme Variable Backups for Light mode by default */
    --bg-sidebar: #f1f5f9;
    --bg-header: rgba(248, 250, 252, 0.85);
    --bg-table-header: rgba(226, 232, 240, 0.5);
    --bg-table-hover: rgba(148, 163, 184, 0.06);
    --bg-table-selected: rgba(185, 28, 28, 0.05);
    --bg-panel: #ffffff;
    --bg-panel-placeholder: #ffffff;
    --shadow-panel: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --bg-intervention: rgba(245, 158, 11, 0.06);
    --bg-form-input: #ffffff;

    /* Primary Red Button Colors - Pale Red style (Light Mode default) */
    --btn-primary-bg: #fee2e2;
    --btn-primary-border: #fcd3d3;
    --btn-primary-text: #991b1b;
    --btn-primary-hover-bg: #fca5a5;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Google Sans Flex', 'Google Sans', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5 {
    font-family: 'Google Sans Flex', 'Google Sans', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Layout Grid */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-container.admin-no-sidebar {
    grid-template-columns: 1fr !important;
}

/* Sidebar Styling */
.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-right-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-section {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    font-size: 2.8rem;
    color: var(--accent-red);
    background-color: var(--accent-red-bg);
    padding: 10px;
    border-radius: 50%;
    margin-bottom: 10px;
    display: inline-block;
}

.brand-title {
    font-size: 1.35rem;
    margin-top: 8px;
}

.brand-subtitle {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    font-weight: 600;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.05em;
}

.filter-select, .search-input {
    width: 100%;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.filter-select:focus, .search-input:focus {
    border-color: var(--accent-red);
}

/* Main Content Panel */
.main-panel {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.header {
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px 0 32px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
    transition: padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-title-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.header-logo-link:hover {
    opacity: 0.9;
}

.header-logo-link:active {
    transform: scale(0.98);
}

.header-icon {
    font-size: 2.8rem;
    color: var(--accent-red);
    background-color: var(--accent-red-bg);
    padding: 10px;
    border-radius: var(--radius-md);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.header-logo-link:hover .header-icon {
    transform: scale(1.04);
    background-color: var(--accent-red-bg-hover);
    box-shadow: 0 4px 10px var(--accent-red-shadow);
}

.header-title {
    font-size: 2rem;
    color: var(--accent-red);
    transition: color 0.2s ease;
}

.header-logo-link:hover .header-title {
    color: #000000;
}

body.dark-theme .header-logo-link:hover .header-title {
    color: #ffffff;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 2px;
}

.header-role-badge {
    background-color: rgba(148, 163, 184, 0.08);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Content Area Layout */
.content-area {
    padding: 32px;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
    min-width: 0;
}

.content-area.full-width {
    grid-template-columns: 1fr;
}

#project-detail-container {
    align-self: stretch;
}

.content-area.full-width #project-detail-container {
    display: none;
}


/* KPI Section */
.kpi-section-title {
    font-size: 1.1rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
    min-width: 0;
}

.kpi-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, border-color 0.2s;
    min-width: 0;
    overflow: hidden;
}

.kpi-card.clickable {
    cursor: pointer;
}

.kpi-card.clickable:hover {
    transform: translateY(-3px);
    border-color: var(--accent-red);
    box-shadow: var(--shadow-md);
}

.kpi-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 8px 0;
    font-family: 'Google Sans Flex', 'Google Sans', sans-serif;
}

.kpi-subtext {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.kpi-split-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin: 6px 0;
}

.kpi-split-col {
    flex: 1;
}

.kpi-split-col:not(:first-child) {
    border-left: 1px solid var(--border-color);
    padding-left: 10px;
}

.kpi-split-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.kpi-split-value {
    font-size: 0.95rem;
    font-weight: 700;
}

/* Tabs Navigation styling */
.tabs-navigation {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.header .tabs-navigation {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 6px;
    margin-top: 4px;
    overflow: visible;
}

.tab-button {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 8px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-button:hover {
    color: var(--text-primary);
    background-color: rgba(148, 163, 184, 0.06);
}

.tab-button.active {
    color: var(--text-primary);
    background-color: var(--bg-table-selected);
    border-color: var(--accent-red-border-soft);
}

.tab-content {
    display: none;
}

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

/* Data Table Styles */
.table-wrapper {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow-x: auto;
    box-shadow: var(--shadow-md);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.78rem;
}

.data-table th {
    background-color: var(--bg-table-header);
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
    font-weight: 400;
}

.data-table tr {
    cursor: pointer;
    transition: background-color 0.15s;
}

.data-table tr:hover {
    background-color: var(--bg-table-hover);
}

.data-table tr.selected {
    background-color: var(--bg-table-selected);
}

.data-table tr.completed-row {
    background-color: rgba(16, 185, 129, 0.04);
}

.data-table tr.completed-row:hover {
    background-color: rgba(16, 185, 129, 0.08);
}

.data-table tr.completed-row.selected {
    background-color: rgba(16, 185, 129, 0.15) !important;
}

@keyframes kpi-row-glow {
    0%   { background-color: rgba(234, 179, 8, 0.0); }
    25%  { background-color: rgba(234, 179, 8, 0.18); }
    75%  { background-color: rgba(234, 179, 8, 0.18); }
    100% { background-color: rgba(234, 179, 8, 0.0); }
}

.data-table tr.kpi-highlight {
    animation: kpi-row-glow 2.5s ease-in-out forwards;
    outline: 1px solid rgba(234, 179, 8, 0.4);
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-green {
    background-color: var(--status-green-bg);
    color: var(--status-green);
    border: 1px solid var(--status-green-border);
}

.badge-blue {
    background-color: var(--status-blue-bg);
    color: var(--status-blue);
    border: 1px solid var(--status-blue-border);
}

.badge-blocked {
    background-color: var(--status-blocked-bg);
    color: var(--status-blocked);
    border: 1px solid var(--status-blocked-border);
    animation: pulse-blocker 2s infinite;
}

.badge-completed {
    background-color: var(--status-green-bg);
    color: var(--status-green);
    border: 1px solid var(--status-green-border);
}

@keyframes pulse-blocker {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Detail & Intervention Panel */
.detail-panel {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    position: sticky;
    top: 155px;
    box-shadow: var(--shadow-panel);

    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-panel-placeholder {
    background-color: var(--bg-panel-placeholder);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
}

.detail-section-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    margin-bottom: 8px;
}

.detail-lbl {
    color: var(--text-secondary);
}

.detail-val {
    font-weight: 600;
    text-align: right;
}

/* Intervention Box Styling */
.intervention-box {
    background-color: var(--bg-intervention);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 10px;
}

.intervention-title {
    font-family: 'Google Sans Flex', 'Google Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--status-warning);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.intervention-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
}

/* Button & Form Elements */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.btn:hover {
    background-color: var(--text-muted);
}

.btn-primary {
    background-color: var(--btn-primary-bg);
    border-color: var(--btn-primary-border);
    color: var(--btn-primary-text) !important;
}

.btn-primary:hover {
    background-color: var(--btn-primary-hover-bg);
    border-color: var(--btn-primary-hover-bg);
    color: var(--btn-primary-text) !important;
}

.btn-success {
    background-color: var(--status-green);
    border-color: var(--status-green);
}

.btn-success:hover {
    background-color: #059669;
}

.form-select, .form-textarea {
    width: 100%;
    background-color: var(--bg-form-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px;
    font-size: 0.82rem;
    outline: none;
    margin-bottom: 10px;
}

.form-textarea {
    resize: none;
    height: 60px;
}

/* Audit Log Timeline */
.timeline-container {
    position: relative;
    padding-left: 24px;
    margin-top: 12px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background-color: var(--border-color);
}

.timeline-entry {
    position: relative;
    margin-bottom: 16px;
}

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--text-muted);
    border: 2px solid var(--bg-secondary);
}

.timeline-dot.blocked { background-color: var(--status-blocked); }
.timeline-dot.green { background-color: var(--status-green); }
.timeline-dot.completed { background-color: var(--accent-red); }

.timeline-time {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.timeline-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Document Hub & RAG Agent */
.sharepoint-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    margin-top: 10px;
}

.sharepoint-table th, .sharepoint-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-color);
}

.sharepoint-table th {
    color: var(--text-muted);
    text-align: left;
}

/* Toast System */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.toast {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--text-primary);
    transform: translateY(100px);
    opacity: 0;
    animation: slide-in-toast 4s forwards;
}

.toast.success {
    border-left: 4px solid var(--status-green);
}

.toast.error {
    border-left: 4px solid var(--status-blocked);
}

.toast.warning {
    border-left: 4px solid var(--status-warning);
}

/* Bundle Collapsible styles */
.bundle-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    overflow: hidden;
}

.bundle-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(148, 163, 184, 0.4);
}

.bundle-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(to right, rgba(148, 163, 184, 0.03), transparent);
}

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

.bundle-header-title {
    font-size: 1.05rem;
    font-weight: 600;
    font-family: 'Google Sans Flex', 'Google Sans', sans-serif;
    color: var(--text-primary);
}

.bundle-header-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.bundle-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bundle-caret {
    transition: transform 0.25s ease;
    color: var(--text-muted);
}

.bundle-card.expanded .bundle-caret {
    transform: rotate(180deg);
}

.bundle-content {
    display: none;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(148, 163, 184, 0.01);
}

.bundle-card.expanded .bundle-content {
    display: block;
}

/* Flowchart layout */
.flow-container {
    display: flex;
    gap: 16px;
    align-items: stretch;
    overflow-x: auto;
    padding: 24px 12px;
    min-height: 280px; /* Ensures spacious vertical area for dragging */
    margin-bottom: 24px;
    background: rgba(148, 163, 184, 0.02);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.flow-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: center;
    min-width: 220px;
    max-width: 280px;
    flex: 1;
}

.flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 24px;
    padding: 0 4px;
    user-select: none;
}

/* Node card styling */
.node-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    cursor: grab;
    position: relative;
    user-select: none;
}

.node-card:active {
    cursor: grabbing;
}

.node-card.dragging {
    opacity: 0.35;
    border: 2px dashed var(--text-muted) !important;
}

/* Valid drop targets */
.node-card.valid-drop-target {
    border: 2px dashed rgba(16, 185, 129, 0.45) !important;
    background-color: rgba(16, 185, 129, 0.03) !important;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.1);
}

/* Valid drop target hover / drag-over */
.node-card.valid-drop-target.drag-over {
    border: 2px solid var(--status-green) !important;
    background-color: rgba(16, 185, 129, 0.15) !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.35) !important;
    transform: scale(1.02);
}

/* Invalid drop targets */
.node-card.invalid-drop-target {
    opacity: 0.45;
    cursor: not-allowed;
}

.node-card.drag-over {
    border: 2px solid var(--status-warning) !important;
    background-color: var(--status-warning-bg) !important;
    transform: scale(1.02);
}

/* Node Card States */
.node-card.status-completed {
    border-left: 4px solid var(--status-green);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(16, 185, 129, 0.02));
}

.node-card.status-active {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(135deg, var(--bg-secondary), rgba(59, 130, 246, 0.02));
}

.node-card.status-paused {
    border-left: 4px solid var(--status-warning);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(245, 158, 11, 0.02));
}

.node-card.status-blocked {
    border-left: 4px solid var(--status-blocked);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(239, 68, 68, 0.02));
}

.node-id {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.node-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.25;
}

.node-meta {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.node-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

.node-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.node-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.node-btn.btn-play {
    color: var(--status-green);
}

.node-btn.btn-pause {
    color: var(--status-warning);
}

.node-btn.btn-complete {
    color: #3b82f6;
}

.node-btn.btn-unlink {
    color: var(--text-muted);
}

.node-btn.btn-unlink:hover {
    color: var(--status-blocked);
    background-color: var(--status-blocked-bg);
}

@keyframes slide-in-toast {
    0% { transform: translateY(100px); opacity: 0; }
    10% { transform: translateY(0); opacity: 1; }
    90% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(100px); opacity: 0; }
}

/* Chart Canvas Wrapper */
.chart-wrapper {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

/* Grid for cost/revenue charts */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (min-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* DARK MODE THEME OVERRIDES */
body.dark-theme {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: rgba(148, 163, 184, 0.12);

    --accent-red: #ef4444;
    --accent-red-hover: #f87171;
    --accent-red-bg: rgba(239, 68, 68, 0.1);
    --accent-red-border-soft: rgba(239, 68, 68, 0.25);
    --accent-red-bg-hover: rgba(239, 68, 68, 0.15);
    --accent-red-shadow: rgba(239, 68, 68, 0.15);
    --accent-red-focus: rgba(239, 68, 68, 0.2);
    --accent-red-glow: rgba(239, 68, 68, 0.25);

    --bg-sidebar: #0b0f19;
    --bg-header: rgba(15, 23, 42, 0.85);
    --bg-table-header: rgba(15, 23, 42, 0.4);
    --bg-table-hover: rgba(148, 163, 184, 0.04);
    --bg-table-selected: rgba(239, 68, 68, 0.06);
    --bg-panel: var(--bg-secondary);
    --bg-panel-placeholder: var(--bg-secondary);
    --shadow-panel: var(--shadow-lg);
    --bg-intervention: rgba(245, 158, 11, 0.04);
    --bg-form-input: rgba(15, 23, 42, 0.4);

    /* Primary Red Button Colors - Pale Red overrides (Dark Mode) */
    --btn-primary-bg: #7f1d1d;
    --btn-primary-border: #991b1b;
    --btn-primary-text: #fecdd3;
    --btn-primary-hover-bg: #991b1b;
}

/* Theme toggle button styling (transparent default, red active) */
.theme-toggle-btn {
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--text-secondary) !important;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: none !important;
}

.theme-toggle-btn:hover {
    background-color: rgba(148, 163, 184, 0.08) !important;
    color: var(--text-primary) !important;
}

.theme-toggle-btn.active, .lang-toggle-btn.active {
    background-color: var(--btn-primary-bg) !important;
    color: var(--btn-primary-text) !important;
    border-color: var(--btn-primary-border) !important;
    box-shadow: none !important;
}

/* Sidebar Toggle Button Styles (Burger Menu, visible only on mobile) */
.sidebar-toggle-btn {
    display: none !important; /* Hidden on desktop */
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-sm);
    margin-right: 12px;
    transition: background-color 0.2s;
}

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

/* Collapse/Expand Chevron Buttons for Desktop Sidebar */
.sidebar-collapse-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background-color 0.2s;
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
}

.sidebar-collapse-btn:hover {
    color: var(--text-primary);
    background-color: var(--border-color);
}

.sidebar-expand-btn {
    display: none; /* Hidden by default */
    position: fixed;
    top: 32px; /* Vertically centered relative to the header icon content */
    left: 16px;
    z-index: 80;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full); /* Circular sleek button */
    box-shadow: var(--shadow-md);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-expand-btn span {
    font-size: 1.2rem;
}

.sidebar-expand-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    transform: scale(1.05);
}

/* Show expand button when sidebar is collapsed on desktop */
.app-container.sidebar-collapsed .sidebar-expand-btn {
    display: flex;
}

/* Shift the header padding to the left when collapsed to prevent overlap with floating expand button */
.app-container.sidebar-collapsed .header {
    padding-left: 68px;
}

/* Collapsed Sidebar on Desktop */
.app-container.sidebar-collapsed {
    grid-template-columns: 0px 1fr;
}

.app-container.sidebar-collapsed .sidebar {
    transform: translateX(-260px);
    width: 0 !important;
    padding: 24px 0 !important; /* collapse width, reduce padding */
    overflow: hidden;
    border-right-color: transparent;
}

/* Global Backdrop Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 90;
}

/* RESPONSIVE DESIGN - TABLET & PHONE */

@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 240px 1fr;
    }
    
    .app-container.sidebar-collapsed {
        grid-template-columns: 0px 1fr;
    }
    
    .content-area {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
    }
    
    .detail-panel {
        position: static;
        margin-top: 10px;
    }
}

/* Responsive Utility Helpers */
.show-on-mobile {
    display: none !important;
}

.show-on-mobile-flex {
    display: none !important;
}

@media (max-width: 768px) {
    .app-container {
        display: block !important;
    }

    /* Responsive Utility Helpers for Mobile */
    .show-on-mobile {
        display: inline-block !important;
    }
    .show-on-mobile-flex {
        display: flex !important;
    }
    .hide-on-mobile {
        display: none !important;
    }
    
    .sidebar {
        display: flex !important;
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 260px !important;
        transform: none !important;
        padding: 24px !important;
        border-right: 1px solid var(--border-color) !important;
        z-index: 100;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-lg);
        background-color: var(--bg-sidebar) !important;
    }

    .tabs-navigation {
        display: none !important;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar-overlay.active {
        display: block;
    }

    .sidebar-toggle-btn {
        display: flex !important;
        margin-right: 4px !important;
        padding: 4px !important;
    }

    .sidebar-collapse-btn {
        display: none !important;
    }

    .sidebar-expand-btn {
        display: none !important;
    }
    
    .header {
        padding: 12px 20px 0 20px;
        gap: 8px;
    }
    
    .header-title-container {
        gap: 6px !important;
    }
    
    .header-title {
        font-size: 0.95rem !important;
        white-space: nowrap;
    }
    
    .header-subtitle {
        font-size: 0.8rem;
    }
    
    .header-icon {
        font-size: 1.6rem !important;
        padding: 4px !important;
        border-radius: var(--radius-sm) !important;
    }
    
    .header-role-badge {
        padding: 4px 10px;
        font-size: 0.72rem;
    }
    
    .header-role-badge-select-container {
        padding: 4px 10px;
    }
    
    .header-role-select {
        font-size: 0.72rem;
    }
    
    .content-area {
        padding: 16px !important;
        gap: 16px !important;
    }

    .main-panel {
        width: 100vw;
        max-width: 100%;
    }

    /* Tables must remain horizontally scrollable on mobile */
    .table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        max-width: calc(100vw - 32px);
    }

    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .kpi-card {
        padding: 14px 16px !important;
        min-height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    .kpi-split-row {
        gap: 4px !important;
        flex-wrap: wrap !important;
    }
    
    .kpi-split-col {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }
    
    .kpi-split-col:not(:first-child) {
        padding-left: 6px !important;
    }
    
    .kpi-split-value {
        font-size: 0.78rem !important;
        white-space: nowrap;
    }
    
    .kpi-split-title {
        font-size: 0.58rem !important;
        white-space: nowrap;
    }
    
    .tab-button {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .data-table th, .data-table td {
        padding: 10px 12px;
        font-size: 0.74rem;
    }
    
    .detail-panel {
        padding: 16px;
    }

    .header-customer-logo-container {
        height: 40px !important;
        padding: 4px 10px !important;
    }

    .header-customer-logo {
        max-height: 32px !important;
        max-width: 100px !important;
    }
}

/* Very small screens (narrow phones) */
@media (max-width: 420px) {
    .content-area {
        padding: 12px !important;
    }

    .kpi-split-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px 12px !important;
    }

    .kpi-split-col {
        flex: none !important;
    }

    .kpi-split-col:not(:first-child) {
        border-left: none !important;
        padding-left: 0 !important;
    }

    /* Re-add border only for 2nd column items */
    .kpi-split-col:nth-child(2n) {
        border-left: 1px solid var(--border-color) !important;
        padding-left: 10px !important;
    }

    .kpi-split-value {
        font-size: 0.75rem !important;
    }

    .header-title {
        font-size: 0.82rem !important;
    }
}

/* Segmented Control for YTD Toggle */
.segmented-control {
    display: inline-flex;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px;
}
.segmented-control .toggle-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: calc(var(--radius-sm) - 2px);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}
.segmented-control .toggle-btn:hover:not(:disabled) {
    color: var(--text-primary);
    background-color: var(--bg-table-hover);
}
.segmented-control .toggle-btn.active {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    box-shadow: var(--shadow-sm);
}
.segmented-control .toggle-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    color: var(--text-muted);
}

/* Column Filters & Action Toolbar Styling */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-table-header);
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
    position: sticky;
    left: 0;
    z-index: 5;
    gap: 12px;
}

.table-limit-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-limit-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.table-action-btn {
    font-family: 'Google Sans Flex', 'Google Sans', sans-serif;
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.2s ease;
    user-select: none;
    outline: none;
    margin-left: auto;
}

.table-action-btn:hover {
    border-color: var(--accent-red);
    color: var(--text-primary);
    background-color: var(--bg-table-hover);
}

.table-action-btn.active {
    background-color: var(--accent-red-bg);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.filter-row th {
    padding: 6px 12px 10px 12px !important;
    background-color: var(--bg-table-header) !important;
    border-bottom: 2px solid var(--border-color) !important;
}

.table-filter-input, .table-filter-select {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.75rem;
    font-family: 'Google Sans Flex', 'Google Sans', sans-serif;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.table-filter-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.table-filter-input:focus, .table-filter-select:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 2px var(--accent-red-focus);
}

body.dark-theme .table-filter-input, body.dark-theme .table-filter-select {
    background-color: var(--bg-primary);
}

/* Drag and Drop Zone styling */
.drag-drop-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    background-color: rgba(0, 0, 0, 0.02);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
    user-select: none;
}

body.dark-theme .drag-drop-area {
    background-color: rgba(255, 255, 255, 0.02);
}

.drag-drop-area:hover {
    border-color: var(--status-green);
    background-color: rgba(16, 185, 129, 0.02);
}

.drag-drop-area.drag-over {
    border-color: var(--status-green);
    background-color: rgba(16, 185, 129, 0.08);
    transform: scale(0.99);
}

.drag-drop-area.has-file {
    border-color: var(--status-green);
    border-style: solid;
    background-color: rgba(16, 185, 129, 0.04);
}

.drag-drop-icon {
    font-size: 1.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    transition: color 0.2s;
}

.drag-drop-area:hover .drag-drop-icon,
.drag-drop-area.drag-over .drag-drop-icon,
.drag-drop-area.has-file .drag-drop-icon {
    color: var(--status-green);
}

.drag-drop-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.drag-drop-subtext {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.drag-drop-filename {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--status-green);
    word-break: break-all;
    margin-top: 4px;
}

/* Header Customer Logo Styles */
.header-customer-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    padding: 8px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    height: 60px;
    transition: all 0.2s ease-in-out;
}

body.dark-theme .header-customer-logo-container {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-lg);
}

.header-customer-logo {
    max-height: 48px;
    max-width: 180px;
    object-fit: contain;
}

/* Header Role & Customer Dropdowns */
.header-role-badge-select-container {
    background-color: rgba(148, 163, 184, 0.08);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.header-role-badge-select-container:hover {
    border-color: var(--accent-red);
    background-color: rgba(148, 163, 184, 0.15);
}

.header-role-select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    padding-right: 18px; /* space for arrow */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 10px;
}

body.dark-theme .header-role-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.header-role-select option {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.header-customer-select-container {
    display: inline-block;
    position: relative;
}

.header-customer-select {
    background: transparent;
    border: none;
    border-bottom: 1px dashed var(--accent-red);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    padding: 0 16px 0 4px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 10px;
    transition: border-bottom-color 0.2s, color 0.2s;
}

.header-customer-select:hover {
    color: var(--accent-red);
    border-bottom-style: solid;
}

body.dark-theme .header-customer-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.header-customer-select option {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.header-dropdown-select {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
    font-family: inherit;
}

.header-dropdown-select:hover {
    border-color: var(--accent-red);
    background-color: rgba(148, 163, 184, 0.05);
}

.header-dropdown-select option {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Custom Dropdown Container */
.custom-dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Trigger Button */
.custom-dropdown .header-role-badge {
    background-color: rgba(148, 163, 184, 0.08);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
}

.custom-dropdown .header-role-badge:hover {
    border-color: var(--accent-red);
    background-color: rgba(148, 163, 184, 0.15);
    color: var(--text-primary);
}

.custom-dropdown .header-role-badge .dropdown-arrow {
    font-size: 1.1rem;
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

.custom-dropdown.active .header-role-badge .dropdown-arrow {
    transform: rotate(180deg);
}

/* Custom Dropdown Menu Card */
.custom-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 340px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 100;
    overflow: hidden;
    padding: 6px;
    animation: dropdownFadeIn 0.2s ease;
}

body.dark-theme .custom-dropdown-menu {
    background-color: var(--bg-secondary);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

.custom-dropdown-menu.show {
    display: block;
}

/* Keyframe animation */
@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown Menu Items */
.dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: background-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
    margin-bottom: 2px;
}

.dropdown-item:last-child {
    margin-bottom: 0;
}

.dropdown-item:hover {
    background-color: rgba(148, 163, 184, 0.08);
}

.dropdown-item.active {
    background-color: var(--bg-table-selected);
}

body.dark-theme .dropdown-item.active {
    background-color: var(--accent-red-bg-hover);
}

/* Item Icon */
.dropdown-item .item-icon {
    font-size: 1.35rem;
    color: var(--text-secondary);
    margin-top: 2px;
    transition: color 0.15s ease;
}

.dropdown-item:hover .item-icon {
    color: var(--accent-red);
}

.dropdown-item.active .item-icon {
    color: var(--accent-red);
}

/* Item Content */
.dropdown-item .item-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-item .item-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: left;
}

.dropdown-item.active .item-title {
    color: var(--accent-red);
}

.dropdown-item .item-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.25;
    text-align: left;
}



/* Customer Cockpit & Progress Circles */
.customer-cockpit-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-panel);
}

.progress-circle-wrapper {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100px;
    height: 100px;
}

.progress-circle {
    transform: rotate(-90deg);
}

.progress-circle-bg {
    fill: none;
    stroke: rgba(148, 163, 184, 0.1);
}

.progress-circle-fg {
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease-in-out;
}

.progress-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.progress-circle-text .value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Google Sans Flex', 'Google Sans', sans-serif;
    color: var(--text-primary);
    line-height: 1.1;
}

.progress-circle-text .label {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
    text-align: center;
}

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

.tooltip-container {
    position: relative;
    cursor: help;
}

.tooltip-container:hover {
    z-index: 150;
}

.tooltip-container.clickable {
    cursor: pointer;
}


.kpi-card.tooltip-container {
    overflow: visible;
}

.tooltip-bubble {
    position: absolute;
    bottom: 112%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.4), 0 8px 10px -6px rgba(0,0,0,0.4);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
    width: 250px;
    text-align: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 100;
}

.tooltip-bubble::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--border-color) transparent transparent transparent;
}

.tooltip-bubble::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-1px);
    border-width: 6px;
    border-style: solid;
    border-color: var(--bg-panel) transparent transparent transparent;
    z-index: 101;
}

.tooltip-container:hover .tooltip-bubble {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* KPI Card Tooltip Overrides (Positioned below the cards to avoid overlapping header tabs) */
.kpi-card .tooltip-bubble {
    top: 108%;
    bottom: auto;
    transform: translateX(-50%) translateY(-10px);
}

.kpi-card.tooltip-container:hover .tooltip-bubble {
    transform: translateX(-50%) translateY(0);
}

.kpi-card .tooltip-bubble::after {
    top: auto;
    bottom: 100%;
    border-color: transparent transparent var(--border-color) transparent;
}

.kpi-card .tooltip-bubble::before {
    top: auto;
    bottom: 100%;
    border-color: transparent transparent var(--bg-panel) transparent;
}

/* Premium Modal Overlay Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.45); /* Elegant translucent dark overlay */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    transform: scale(0.95) translateY(15px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Beautiful spring animation */
}

.modal-overlay.open .modal-content {
    transform: scale(1) translateY(0);
}

/* Scrollbar styling for modal */
.modal-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-track {
    background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

@media (max-width: 640px) {
    .modal-content {
        padding: 20px;
        width: 95%;
        max-height: 90vh;
    }
}

/* Print optimizations */
@media print {
    /* Set page margins and landscape page size */
    @page {
        size: A4 landscape;
        margin: 12mm 15mm 12mm 15mm;
    }

    /* Force background colors to print */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Hide non-printable UI elements */
    .sidebar,
    .header,
    .no-print,
    .btn,
    button,
    select,
    input,
    form,
    .tabs-navigation,
    .modal-overlay,
    .toast-container,
    #toast-wrapper,
    .sidebar-toggle-btn,
    .detail-panel h2 + div,
    .sharepoint-table td button,
    .data-table td button,
    #role-dropdown,
    #lang-select {
        display: none !important;
    }

    /* Show print header */
    .print-header {
        display: block !important;
        background: transparent !important;
        border-bottom: 2px solid var(--accent-red) !important;
        padding-bottom: 15px !important;
        margin-bottom: 25px !important;
    }

    /* Reset main layout grid and structure for horizontal print layout */
    .app-container {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    .main-panel {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        background: #ffffff !important;
    }

    .content-area {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
    }

    /* Prevent KPI and layout cards from breaking mid-element */
    .kpi-card,
    .chart-wrapper,
    .customer-cockpit-card,
    .table-wrapper,
    tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* Force KPI grid into 3 clean columns on A4 landscape */
    .kpi-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px !important;
        margin-bottom: 20px !important;
    }

    .kpi-card {
        min-height: auto !important;
        padding: 14px 18px !important;
        border: 1px solid #cbd5e1 !important;
        background-color: #f8fafc !important;
        border-radius: 8px !important;
    }

    .kpi-title {
        color: #475569 !important;
        font-weight: 700 !important;
    }

    .kpi-value {
        color: #0f172a !important;
        margin: 4px 0 !important;
    }

    .kpi-subtext {
        color: #475569 !important;
    }

    /* Stack customer cockpit visual columns side-by-side (fits A4 landscape perfectly) */
    .customer-cockpit-card {
        padding: 24px !important;
        border: 1px solid #cbd5e1 !important;
        background-color: #ffffff !important;
        border-radius: 8px !important;
        margin-bottom: 25px !important;
    }

    .customer-cockpit-card > div[style*="display: grid"] {
        display: grid !important;
        grid-template-columns: 1.15fr 0.85fr !important;
        gap: 32px !important;
    }

    /* Hide tables/lists under the dashboards on print */
    .table-wrapper {
        display: none !important;
    }

    .data-table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .data-table th {
        background-color: #f1f5f9 !important;
        color: #0f172a !important;
        font-weight: 700 !important;
        border-bottom: 2px solid #cbd5e1 !important;
        padding: 10px 14px !important;
    }

    .data-table td {
        border-bottom: 1px solid #e2e8f0 !important;
        padding: 10px 14px !important;
        color: #334155 !important;
    }

    /* Zebra striping for table rows in print mode */
    .data-table tr:nth-child(even) {
        background-color: rgba(148, 163, 184, 0.04) !important;
    }

    .data-table tr:hover {
        background: transparent !important;
    }

    /* High-contrast status badges for print */
    .badge-green, .badge-completed {
        background-color: #d1fae5 !important;
        color: #065f46 !important;
        border: 1px solid #a7f3d0 !important;
    }

    .badge-blue {
        background-color: #dbeafe !important;
        color: #1e40af !important;
        border: 1px solid #bfdbfe !important;
    }

    .badge-blocked {
        background-color: #fee2e2 !important;
        color: #991b1b !important;
        border: 1px solid #fca5a5 !important;
        animation: none !important;
    }

    /* Customer report container (right panel) styling on print */
    #project-detail-container,
    .print-only-report {
        display: block !important;
        width: 100% !important;
        margin-top: 35px !important;
        page-break-before: always !important; /* Force customer report to start on a new landscape page */
    }

    /* Hide right panel on print if it's the customer report to avoid duplication,
       since we always append it via print-only-report */
    #project-detail-container:has(.customer-report-panel) {
        display: none !important;
    }

    /* Make sure detail report has clean borders and background on print */
    .detail-panel {
        border: 1px solid #cbd5e1 !important;
        padding: 24px !important;
        background-color: #ffffff !important;
        box-shadow: none !important;
        position: relative !important;
        top: 0 !important;
        border-radius: 8px !important;
    }

    /* Hide the entire detail container if it only contains the placeholder */
    #project-detail-container.has-placeholder,
    #project-detail-container:has(.detail-panel-placeholder),
    .detail-panel-placeholder {
        display: none !important;
    }

    /* Hide tooltip hover bubbles */
    .tooltip-bubble {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}

/* Table pagination footer styles */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 20px 32px; /* Bottom padding 20px, left padding 32px to align with LOC names */
    border-top: 1px solid var(--border-color);
    background-color: rgba(148, 163, 184, 0.02);
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    flex-wrap: wrap;
    gap: 12px;
}

body.dark-theme .table-footer {
    background-color: rgba(0, 0, 0, 0.1);
}

.pagination-info {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.table-limit-select {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: pointer;
    outline: none;
    font-family: inherit;
    font-size: 0.75rem;
    transition: border-color 0.2s;
}

.table-limit-select:focus {
    border-color: var(--accent-red);
}

.pagination-buttons {
    margin-left: auto;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.78rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--bg-table-hover);
    color: var(--text-primary);
}

.pagination-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    color: var(--text-muted);
}

.pagination-btn.active {
    background-color: var(--accent-red);
    color: #ffffff !important;
    box-shadow: 0 2px 5px var(--accent-red-glow);
}

.table-wrapper {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-panel);
    overflow: hidden;
    overflow-x: auto;
    margin-bottom: 16px;
}

.table-wrapper .data-table {
    border: none !important;
    margin-bottom: 0 !important;
}

/* Hover styles for interactive metric cards */
.risk-metric-box {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

/* Risk Summary Grid layout */
.risk-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.risk-summary-grid.two-cols {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
    .risk-summary-grid,
    .risk-summary-grid.two-cols {
        grid-template-columns: 1fr !important;
    }
}

.bundle-link {
    transition: all 0.2s ease;
    cursor: pointer;
}
.bundle-link:hover {
    background-color: var(--status-warning) !important;
    color: #0f172a !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(245, 158, 11, 0.3);
}

/* Animated Donut Charts for KPI Cards */
.kpi-card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 8px 0 4px 0;
}

.kpi-chart-wrapper {
    flex-shrink: 0;
    width: 175px;
    height: 175px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.donut-chart circle {
    transition: stroke-dashoffset 0.3s ease;
}

@keyframes donut-draw {
    from {
        stroke-dashoffset: var(--circumference, 100);
    }
    to {
        stroke-dashoffset: var(--target-offset);
    }
}

@media (max-width: 576px) {
    .kpi-card-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .kpi-chart-wrapper {
        align-self: center;
    }
}

/* Interactive Donut Segment Hover Effects */
.donut-segment {
    transition: stroke-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease, filter 0.3s ease;
}

.donut-segment:hover {
    stroke-width: 3.5 !important;
    filter: brightness(1.15) saturate(1.1);
}

/* Interactive Pie Segment Hover Effects */
.pie-segment {
    transition: stroke-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease, filter 0.3s ease;
}

.pie-segment:hover {
    stroke-width: 17.5 !important;
    filter: brightness(1.15) saturate(1.1);
}

/* Sidebar hiding on desktop screen sizes */
@media (min-width: 769px) {
    .sidebar, .admin-sidebar-desktop-hide {
        display: none !important;
    }
    .app-container, .app-container.admin-no-sidebar {
        grid-template-columns: 1fr !important;
    }
}





