/* Lean Planning - Custom Styles */

/* Beta version ribbon */
.beta-ribbon {
    position: fixed;
    top: 25px;
    right: -35px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    padding: 6px 40px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transform: rotate(45deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.beta-ribbon.hidden {
    opacity: 0;
}

/* MudDataGrid toolbars — enough height for button row + search row */
.mud-table-toolbar {
    min-height: 120px !important;
}

/* Override MudBlazor's secondary text to use theme colors */
.mud-secondary-text {
    color: #64748b !important; /* Light theme - matches theme's TextSecondary */
}

.mud-theme-dark .mud-secondary-text {
    color: #94a3b8 !important; /* Dark theme - matches theme's TextSecondary */
}

html,
body {
    font-family: "Inter", "IBM Plex Sans", "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* LAYOUT OVERRIDES                                                          */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* App Bar */
html.theme-light .mud-appbar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

html.theme-dark .mud-appbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* Ensure MudDataGrid toolbars have proper top spacing */
.mud-table-toolbar {
    padding-top: 20px !important;
}

/* Sentence case for toolbar buttons (workspace rule: sentence case, not uppercase) */
.mud-table-toolbar .mud-button .mud-button-label {
    text-transform: none !important;
}

/* App Bar Styles */
.app-bar {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.app-title {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.title-lean {
    color: var(--mud-palette-primary);
}

.title-planning {
    opacity: 0.8;
}

/* Tree View Styles */
.planning-tree {
    font-size: 0.875rem;
}

.tree-item {
    border-radius: 6px;
    margin: 1px 0;
    transition: background-color 0.15s ease;
    overflow: hidden;
    max-width: 100%;
}

.tree-item:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.01);
}

.tree-item-selected {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.1);
}

/* Phase card — the only visible "card" in the hierarchy */
.phase-card {
    background: var(--mud-palette-surface);
    border-radius: 8px;
}

/* Subphase row — flat with a subtle bottom divider */
.subphase-row {
    /* border-bottom: 1px solid var(--mud-palette-divider); */
}

/* Work package row — fully transparent, no container */
.wp-row {
    background: transparent;
}

/* Activity Row Styles */
.activity-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 55px 55px 85px 60px 90px 32px;
    gap: 4px;
    align-items: center;
    padding: 6px 8px;
    padding-left: 16px;
    border-radius: 6px;
    margin: 2px 0;
    background-color: var(--mud-palette-surface);
    border: 1px solid transparent;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}

.activity-row:hover {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.activity-row.dragging {
    opacity: 0.5;
}

.progress-click-area {
    cursor: pointer;
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    padding: 4px 0;
    flex-shrink: 0;
}

.progress-click-area:hover .mud-progress-linear {
    transform: scaleY(1.5);
}

.activity-row.is-critical {
    border-left: 3px solid var(--mud-palette-error);
}

.activity-row.is-milestone {
    background-color: rgba(var(--mud-palette-warning-rgb), 0.1);
}

/* Progress bar track - always visible light gray line */
.activity-progress-track {
    width: 40px;
    min-width: 40px;
    min-height: 6px;
    cursor: pointer;
    position: relative;
}

.activity-progress-track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    transform: translateY(-50%);
    background: var(--mud-palette-text-disabled);
    border-radius: 4px;
    pointer-events: none;
    z-index: 0;
}

.activity-progress-track .mud-progress-linear {
    position: relative;
    z-index: 1;
}

/* Activity highlight animation for navigation */
.activity-highlight,
.item-highlight {
    animation: activity-pulse 2s ease-out;
}

@keyframes activity-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--mud-palette-primary-rgb), 0.7);
        background-color: rgba(var(--mud-palette-primary-rgb), 0.2);
    }
    30% {
        box-shadow: 0 0 0 12px rgba(var(--mud-palette-primary-rgb), 0);
        background-color: rgba(var(--mud-palette-primary-rgb), 0.3);
    }
    60% {
        box-shadow: 0 0 0 0 rgba(var(--mud-palette-primary-rgb), 0);
        background-color: rgba(var(--mud-palette-primary-rgb), 0.15);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--mud-palette-primary-rgb), 0);
        background-color: transparent;
    }
}

/* Dependency item hover effect */
.dependency-item:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.08) !important;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-not-started {
    background-color: #e5e7eb;
    color: #374151;
}
.status-in-progress {
    background-color: #dbeafe;
    color: #1d4ed8;
}
.status-completed {
    background-color: #d1fae5;
    color: #047857;
}
.status-on-hold {
    background-color: #fef3c7;
    color: #b45309;
}
.status-cancelled {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* Gantt two-panel layout */
.gantt-wrapper {
    --gantt-task-panel-width: 280px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 300px);
    overflow: hidden;
}

.gantt-header-row {
    display: flex;
    flex-shrink: 0;
    background-color: var(--mud-palette-surface);
    z-index: 10;
}

.gantt-task-panel-header {
    width: var(--gantt-task-panel-width);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.75rem;
    border-right: 1px solid var(--mud-palette-divider);
    border-bottom: 1px solid var(--mud-palette-divider);
}

.gantt-timeline-header-scroll {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.gantt-body-row {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.gantt-task-panel-body {
    width: var(--gantt-task-panel-width);
    flex-shrink: 0;
    overflow: hidden;
    border-right: 1px solid var(--mud-palette-divider);
}

.gantt-task-row {
    display: flex;
    align-items: center;
    height: 36px;
    cursor: pointer;
    border-bottom: 1px solid var(--mud-palette-divider);
    transition: background-color 0.15s ease;
}

.gantt-task-row:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.018);
}

.mud-dark .gantt-task-row:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.025);
}

.gantt-task-row:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.06);
}

.gantt-task-row.selected {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.12);
}

.gantt-task-id-col {
    width: 40px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    flex-shrink: 0;
}

.gantt-task-name-col {
    flex: 1;
    font-size: 0.8125rem;
    padding: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.gantt-swimlane-row {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 8px;
    font-weight: 600;
    font-size: 0.8125rem;
    background: rgba(var(--mud-palette-primary-rgb), 0.08);
}

.gantt-splitter {
    width: 6px;
    cursor: col-resize;
    background-color: transparent;
    flex-shrink: 0;
    transition: background-color 0.15s ease;
    z-index: 5;
}

.gantt-splitter:hover,
.gantt-splitter.active {
    background-color: var(--mud-palette-primary);
}

.gantt-timeline-panel {
    flex: 1;
    overflow: auto;
    min-width: 0;
}

/* Alternating row stripes behind the absolutely-positioned bars.
   36px rows → stripes of 0/36/72px repeat perfectly aligned with the task panel. */
.gantt-timeline-rows {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 36px,
        rgba(0, 0, 0, 0.018) 36px,
        rgba(0, 0, 0, 0.018) 72px
    );
}

.mud-dark .gantt-timeline-rows {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 36px,
        rgba(255, 255, 255, 0.025) 36px,
        rgba(255, 255, 255, 0.025) 72px
    );
}

/* Fine horizontal grid lines at every row boundary */
.gantt-timeline-rows::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 35px,
        var(--mud-palette-divider) 35px,
        var(--mud-palette-divider) 36px
    );
    z-index: 0;
}

/* Gantt-like Timeline */
.timeline-container {
    position: relative;
}

.timeline-header {
    display: flex;
    flex-direction: column;
    background-color: var(--mud-palette-surface);
    position: sticky;
    top: 0;
    z-index: 10;
}

.timeline-month-row {
    display: flex;
    border-bottom: 1px solid var(--mud-palette-divider);
    height: 20px;
}

.timeline-month-label {
    flex-shrink: 0;
    box-sizing: border-box;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0 4px;
    border-right: 1px solid var(--mud-palette-divider);
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.timeline-day-row {
    display: flex;
    border-bottom: 1px solid var(--mud-palette-divider);
    height: 20px;
}

.timeline-day {
    text-align: center;
    font-size: 0.7rem;
    line-height: 20px;
    flex-shrink: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.timeline-day.weekend {
    background-color: rgba(0, 0, 0, 0.04);
}

.timeline-day.today {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.1);
    font-weight: 600;
}

.timeline-bar {
    height: 24px;
    border-radius: 4px;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.timeline-bar:hover {
    filter: brightness(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.timeline-bar.clickable {
    cursor: pointer;
}

.timeline-bar.clickable:hover {
    transform: scale(1.02);
}

.timeline-bar.baseline {
    height: 6px;
    bottom: 0;
    opacity: 0.6;
    border: 1px dashed rgba(0, 0, 0, 0.3);
}

.timeline-bar.dragging {
    opacity: 0.6;
    cursor: grabbing;
}

/* Resize handles for timeline bars */
.resize-handle {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 8px;
    cursor: ew-resize;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.timeline-bar:hover .resize-handle {
    opacity: 1;
}

.resize-handle.resize-left {
    left: 0;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.5),
        transparent
    );
    border-radius: 4px 0 0 4px;
}

.resize-handle.resize-right {
    right: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.5), transparent);
    border-radius: 0 4px 4px 0;
}

/* Active resize/drag state */
.timeline-bar.dragging {
    opacity: 0.85;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    transform: scale(1.02);
}

.timeline-bar.dragging .resize-handle {
    opacity: 1;
}

/* Resize handle hover state */
.resize-handle:hover {
    background: rgba(255, 255, 255, 0.8) !important;
    width: 10px !important;
}

/* Progress Bar in Timeline */
.timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px 0 0 4px;
}

/* Dependency Lines */
.dependency-line {
    stroke: var(--mud-palette-text-secondary);
    stroke-width: 1.5;
    fill: none;
    marker-end: url(#arrow);
}

/* S-Curve Chart */
.scurve-chart {
    width: 100%;
    overflow: hidden;
}

.scurve-chart svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 60vh;
    color: var(--mud-palette-text-primary);
}

.scurve-chart .chart-text {
    fill: var(--mud-palette-text-primary);
}

.scurve-chart .chart-text-secondary {
    fill: var(--mud-palette-text-secondary);
}

.scurve-chart .chart-grid {
    stroke: var(--mud-palette-lines-default);
}

.scurve-chart .chart-legend-bg {
    fill: var(--mud-palette-surface);
    stroke: var(--mud-palette-lines-default);
}

.chart-line-planned {
    stroke: var(--mud-palette-primary);
    stroke-width: 2;
    fill: none;
}

.chart-line-actual {
    stroke: var(--mud-palette-success);
    stroke-width: 2;
    fill: none;
}

.chart-line-baseline {
    stroke: var(--mud-palette-text-secondary);
    stroke-width: 1;
    stroke-dasharray: 4 4;
    fill: none;
}

/* Lookahead Grid */
.lookahead-grid {
    display: grid;
    gap: 1px;
    background-color: var(--mud-palette-divider);
}

.lookahead-cell {
    background-color: var(--mud-palette-surface);
    padding: 8px;
    min-height: 60px;
}

.lookahead-cell.header {
    font-weight: 600;
    background-color: var(--mud-palette-background);
}

.lookahead-cell.week-header {
    text-align: center;
}

/* Readiness Indicators */
.readiness-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.readiness-ready {
    background-color: #10b981;
}
.readiness-partial {
    background-color: #f59e0b;
}
.readiness-not-ready {
    background-color: #ef4444;
}
.readiness-blocked {
    background-color: #6b7280;
}

/* Conflict Panel */
.conflict-card {
    border-left: 4px solid;
    margin-bottom: 8px;
}

.conflict-low {
    border-color: #6b7280;
}
.conflict-medium {
    border-color: #f59e0b;
}
.conflict-high {
    border-color: #ef4444;
}
.conflict-critical {
    border-color: #7c3aed;
}

/* Quick Add Buttons - Only show on direct header row hover */
.quick-add-btn {
    opacity: 0;
    transition: opacity 0.15s ease;
}

/* Show menu only when hovering on the specific header row */
.tree-item-header:hover .quick-add-btn {
    opacity: 1;
}

/* Dialog Styles */
.add-item-dialog {
    min-width: 400px;
}

/* Date Picker Responsive Styles */
.full-width-picker {
    width: 100%;
}

.mud-picker .mud-picker-content {
    max-width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .activity-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .timeline-container {
        display: none;
    }

    /* Ensure date picker dialog takes appropriate space on mobile */
    .mud-picker-inline-paper {
        max-width: 95vw !important;
    }

    .mud-dialog-content {
        padding: 12px !important;
    }
}

@media (max-width: 400px) {
    /* Extra small screens - make date picker calendar fit */
    .mud-picker-calendar {
        transform: scale(0.9);
        transform-origin: top center;
    }

    .mud-picker-calendar-header {
        padding: 8px !important;
    }
}

/* Print Styles */
@media print {
    .mud-appbar,
    .mud-drawer,
    .mud-snackbar-provider {
        display: none !important;
    }

    .mud-main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Animation for loading states */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 4px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Weekend cell styling in lookahead */
.lookahead-cell.weekend {
    background-color: rgba(0, 0, 0, 0.04);
}

.lookahead-cell.today {
    border: 2px solid var(--mud-palette-primary);
}

/* Zone tree item styles */
.zone-item {
    margin-bottom: 2px;
}

/* Alert notification styles */
.alert-notification-menu .mud-menu-list {
    padding: 0 !important;
}

/* Dependency matrix styles - additional to page styles */
.dependency-cell-hover {
    transition: background-color 0.15s ease;
}

/* Commitment chip animations */
.commitment-chip {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Constraint priority badges */
.constraint-p1 {
    border-left: 4px solid var(--mud-palette-error) !important;
}
.constraint-p2 {
    border-left: 4px solid var(--mud-palette-warning) !important;
}
.constraint-p3 {
    border-left: 4px solid var(--mud-palette-info) !important;
}
.constraint-p4 {
    border-left: 4px solid var(--mud-palette-dark) !important;
}

/* Material requirement delivery status indicators */
.delivery-pending {
    color: var(--mud-palette-info);
}
.delivery-delayed {
    color: var(--mud-palette-error);
}
.delivery-partial {
    color: var(--mud-palette-warning);
}
.delivery-complete {
    color: var(--mud-palette-success);
}

/* Timeline critical path */
.timeline-bar.critical {
    box-shadow: 0 0 0 2px var(--mud-palette-error);
}

.timeline-bar.milestone {
    width: 24px !important;
    height: 24px;
    transform: rotate(45deg);
    border-radius: 0;
}

/* Project card hover effects */
.project-card {
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Drag and drop states */
.tree-item.dragging {
    opacity: 0.5;
}

.tree-item.drag-over {
    border-color: var(--mud-palette-primary) !important;
    background-color: var(--mud-palette-primary-hover) !important;
}

/* Activity drag-and-drop placeholder */
.activity-drop-placeholder {
    height: 36px;
    padding: 6px 8px;
    margin: 2px 0;
    border: 2px dashed var(--mud-palette-primary);
    border-radius: 6px;
    background-color: rgba(var(--mud-palette-primary-rgb), 0.08);
}

.drag-handle {
    cursor: grab;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.activity-row:hover .drag-handle {
    opacity: 0.5;
}

.activity-row:hover .drag-handle:hover {
    opacity: 1;
}

.activity-row.dragging .drag-handle {
    cursor: grabbing;
    opacity: 1;
}

/* Cursor pointer for inline editing */
.cursor-pointer {
    cursor: pointer;
}

.hover-underline:hover {
    text-decoration: underline;
}

.delivery-row .row-action-delete {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.delivery-row:hover .row-action-delete {
    opacity: 1;
}

/* Empty state actionable prompts */
.empty-state-actionable {
    border: 2px dashed var(--mud-palette-divider);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: all 0.2s ease;
}

.empty-state-actionable:hover {
    border-color: var(--mud-palette-primary);
    background-color: rgba(var(--mud-palette-primary-rgb), 0.04);
}

/* Alert severity backgrounds */
.alert-critical {
    background-color: rgba(239, 68, 68, 0.1) !important;
}
.alert-error {
    background-color: rgba(239, 68, 68, 0.08) !important;
}
.alert-warning {
    background-color: rgba(245, 158, 11, 0.08) !important;
}
.alert-info {
    background-color: rgba(59, 130, 246, 0.08) !important;
}

/* Activity Status Strips - Color-coded left border */
.activity-row {
    position: relative;
    padding-left: 20px !important; /* Make room for status strip */
}

.activity-status-strip {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    border-radius: 4px 0 0 4px;
}

.status-strip-not-started {
    background: var(--mud-palette-text-secondary);
}

.status-strip-in-progress {
    background: var(--mud-palette-info);
}

.status-strip-completed {
    background: var(--mud-palette-success);
}

.status-strip-blocked {
    background: var(--mud-palette-warning);
}

.status-strip-critical {
    background: var(--mud-palette-error);
    animation: pulse-critical 2s infinite;
}

@keyframes pulse-critical {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Swipe gesture visual feedback */
.activity-row.swiping-right {
    background-color: rgba(var(--mud-palette-success-rgb), 0.1);
    transform: translateX(10px);
}

.activity-row.swiping-left {
    background-color: rgba(var(--mud-palette-info-rgb), 0.1);
    transform: translateX(-10px);
}

/* Mobile touch feedback */
@media (max-width: 768px) {
    .activity-row {
        touch-action: pan-y;
        transition:
            transform 0.15s ease,
            background-color 0.15s ease;
    }

    .activity-row::after {
        content: "";
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.75rem;
        color: var(--mud-palette-text-secondary);
        opacity: 0;
        transition: opacity 0.15s ease;
    }
}

/* Dependency lines in tree view */
.dependency-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
    padding: 2px 6px;
    background: rgba(var(--mud-palette-primary-rgb), 0.1);
    border-radius: 10px;
}

.dependency-indicator .mud-icon {
    font-size: 0.875rem;
}

/* Health score indicator */
.health-score {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
}

.health-excellent {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #047857;
}
.health-good {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
}
.health-fair {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #b45309;
}
.health-poor {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #b91c1c;
}

/* Sparkline mini-charts */
.sparkline-container {
    display: inline-flex;
    align-items: flex-end;
    height: 24px;
    gap: 1px;
}

.sparkline-bar {
    width: 3px;
    background: var(--mud-palette-primary);
    border-radius: 1px;
    transition: height 0.3s ease;
}

.sparkline-bar.current {
    background: var(--mud-palette-info);
}

/* Resource utilization bars */
.utilization-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--mud-palette-gray-lighter);
    overflow: hidden;
}

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

.utilization-bar-fill.low {
    background: #10b981;
}
.utilization-bar-fill.medium {
    background: #f59e0b;
}
.utilization-bar-fill.high {
    background: #ef4444;
}

/* Quick log floating button */
.quick-log-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Celebration animation for milestones */
@keyframes celebrate {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.milestone-complete {
    animation: celebrate 0.6s ease-in-out;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    z-index: 9999;
    animation: confetti-fall 3s ease-in-out forwards;
}

/* Due this week widget */
.due-this-week-widget {
    border-radius: 12px;
    overflow: hidden;
}

.due-item {
    padding: 8px 12px;
    border-bottom: 1px solid var(--mud-palette-divider);
    transition: background-color 0.15s ease;
}

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

.due-item:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.05);
}

.due-item.overdue {
    background-color: rgba(239, 68, 68, 0.05);
    border-left: 3px solid #ef4444;
}

.due-item.due-today {
    background-color: rgba(245, 158, 11, 0.05);
    border-left: 3px solid #f59e0b;
}

/* Timeline swimlanes */
.swimlane {
    border-bottom: 2px solid var(--mud-palette-divider);
    margin-bottom: 8px;
    padding-bottom: 8px;
}

.swimlane-header {
    font-weight: 600;
    padding: 8px 12px;
    background: rgba(var(--mud-palette-primary-rgb), 0.08);
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Learn more links */
.learn-more-link {
    font-size: 0.75rem;
    color: var(--mud-palette-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.8;
    transition: opacity 0.15s ease;
}

.learn-more-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Weekend warning badge */
.weekend-warning {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* Conflict resolution suggestion cards */
.resolution-card {
    border: 1px solid var(--mud-palette-divider);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.resolution-card:hover {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.resolution-card.recommended {
    border-color: var(--mud-palette-success);
    background: rgba(16, 185, 129, 0.05);
}

/* Resource check-in/out status */
.resource-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.resource-status-badge.checked-in {
    background: #d1fae5;
    color: #047857;
}

.resource-status-badge.checked-out {
    background: #e5e7eb;
    color: #6b7280;
}

/* Photo attachment thumbnail */
.photo-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--mud-palette-divider);
    transition: transform 0.2s ease;
}

.photo-thumbnail:hover {
    transform: scale(1.1);
    z-index: 10;
}

/* Photo upload area */
.photo-upload-area {
    border: 2px dashed var(--mud-palette-divider);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.photo-upload-area:hover {
    border-color: var(--mud-palette-primary);
    background: rgba(var(--mud-palette-primary-rgb), 0.05);
}

/* Daily checklist styles */
.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: var(--mud-palette-surface);
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.checklist-item.checked {
    background: rgba(16, 185, 129, 0.1);
    text-decoration: line-through;
    opacity: 0.7;
}

.checklist-item:hover:not(.checked) {
    background: rgba(var(--mud-palette-primary-rgb), 0.05);
}

/* Drag and Drop Styles for Configuration */
.activity-status-row {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.activity-status-row:hover {
    border-color: var(--mud-palette-primary);
    background: rgba(var(--mud-palette-primary-rgb), 0.05);
}

.activity-status-row:active {
    cursor: grabbing !important;
}

.mud-drop-zone {
    min-height: 100px;
}

.mud-drop-item-preview {
    opacity: 0.6;
    border: 2px dashed var(--mud-palette-primary) !important;
}

/* Attachment drop zone styles */
.drop-zone {
    transition: all 0.2s ease;
}

.drop-zone:hover {
    border-color: var(--mud-palette-primary) !important;
    background-color: rgba(var(--mud-palette-primary-rgb), 0.04) !important;
}

.drop-zone-active {
    border-color: var(--mud-palette-primary) !important;
    background-color: rgba(var(--mud-palette-primary-rgb), 0.08) !important;
    transform: scale(1.01);
}

/* File upload drop zone container */
.file-drop-container {
    position: relative;
    display: block;
    cursor: pointer;
}

.file-drop-container .file-input-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.file-drop-container .mud-paper {
    transition: all 0.2s ease;
    border-color: var(--mud-palette-divider);
}

.file-drop-container:hover .mud-paper {
    border-color: var(--mud-palette-primary);
    background-color: rgba(var(--mud-palette-primary-rgb), 0.04);
}

.file-drop-container.drag-over .mud-paper {
    border-color: var(--mud-palette-primary) !important;
    background-color: rgba(var(--mud-palette-primary-rgb), 0.1) !important;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(var(--mud-palette-primary-rgb), 0.2);
}

/* Planning Page View Toggle - compact list/timeline switcher */
.view-toggle {
    flex-shrink: 0;
}

.view-toggle .mud-toggle-item {
    padding: 4px 10px !important;
    min-width: unset !important;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* BADGE OVERFLOW FIXES - Prevent badges from being clipped                    */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* AppBar - Allow badge to overflow */
.mud-appbar {
    overflow: visible !important;
}

.mud-appbar .mud-toolbar {
    overflow: visible !important;
}

/* Tab panels - Allow badge on tabs to overflow */
.mud-tabs {
    overflow: visible !important;
}

.mud-tabs-header {
    overflow: visible !important;
}

.mud-tabs-tabbar {
    overflow: visible !important;
}

.mud-tab {
    overflow: visible !important;
}

/* Navigation drawer badges - Allow badges to overflow horizontally */
.mud-appbar {
    overflow: visible !important;
}

.mud-appbar .mud-toolbar {
    overflow: visible !important;
}

/* Tab panels - Allow badge on tabs to overflow */
.mud-tabs {
    overflow: visible !important;
}

.mud-tabs-header {
    overflow: visible !important;
}

.mud-tabs-tabbar {
    overflow: visible !important;
}

.mud-tab {
    overflow: visible !important;
}

/* Navigation menu - Remove scrollbar from nested sub-menus */
.mud-nav-group .mud-navmenu {
    max-height: none !important;
}

/* Badge positioning */
.mud-badge {
    overflow: visible !important;
}

.mud-badge-root {
    overflow: visible !important;
} /* ═══════════════════════════════════════════════════════════════════════════ */
/* GOOGLE PLACES AUTOCOMPLETE                                                  */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Take Photo / Camera capture dialog - fit content correctly */
.camera-capture-dialog .mud-dialog-content {
    padding: 16px 24px;
    overflow: visible;
}

.camera-capture-dialog .camera-container {
    min-width: 0;
    max-width: 100%;
}

/* Hide the "powered by Google" attribution in the address autocomplete dropdown */
.pac-container:after {
    background-image: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* HELP CENTER STYLING                                                         */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Help content markdown rendering - uses MudBlazor CSS variables for theming */
.help-content {
    font-size: 0.95rem;
    line-height: 1.6;
}

.help-content h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    margin-top: 0;
    color: var(--mud-palette-text-primary);
}

.help-content h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--mud-palette-text-primary);
    border-bottom: 1px solid var(--mud-palette-divider);
    padding-bottom: 0.5rem;
}

.help-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--mud-palette-text-primary);
}

.help-content p {
    margin-bottom: 1rem;
    color: var(--mud-palette-text-primary);
}

.help-content ul,
.help-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--mud-palette-text-primary);
}

.help-content li {
    margin-bottom: 0.5rem;
}

.help-content strong {
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.help-content a {
    color: var(--mud-palette-primary);
    text-decoration: none;
}

.help-content a:hover {
    text-decoration: underline;
}

/* Code styling */
.help-content code {
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    color: var(--mud-palette-text-primary);
}

.help-content pre {
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.help-content pre code {
    background: none;
    border: none;
    padding: 0;
}

/* Blockquote styling */
.help-content blockquote {
    border-left: 4px solid var(--mud-palette-primary);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--mud-palette-text-secondary);
    font-style: italic;
}

/* Table styling */
.help-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.help-content th,
.help-content td {
    border: 1px solid var(--mud-palette-divider);
    padding: 0.5rem;
    text-align: left;
}

.help-content th {
    background-color: var(--mud-palette-surface);
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.help-content td {
    color: var(--mud-palette-text-primary);
}

/* Image styling */
.help-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Horizontal rule */
.help-content hr {
    border: none;
    border-top: 1px solid var(--mud-palette-divider);
    margin: 1.5rem 0;
}

/* ── Snackbar undo countdown bar ── */
.snackbar-countdown {
    height: 3px;
    margin-top: 8px;
    border-radius: 2px;
    background: rgba(255,255,255,0.25);
    overflow: hidden;
}

.snackbar-countdown-fill {
    height: 100%;
    background: var(--mud-palette-primary);
    border-radius: 2px;
    animation: snackbar-countdown 5s linear forwards;
}

@keyframes snackbar-countdown {
    from { width: 100%; }
    to { width: 0%; }
}
