/* app.css - Updated Orange Theme */

:root {
    /* Blue color palette from CasiouOne */
    --blue-50: #E3F2FD;
    --blue-100: #BBDEFB;
    --blue-200: #90CAF9;
    --blue-300: #64B5F6;
    --blue-400: #42A5F5;
    --blue-500: #2196F3;
    --blue-600: #1E88E5;
    --blue-700: #1976D2;
    --blue-800: #1565C0;
    --blue-900: #0D47A1;
}

/*:root {
    
    --orange-50: #FE8012; 
    --orange-100: #F96E1A;
    --orange-200: #F45C22;
    --orange-300: #EF4A2A;
    --orange-400: #EA382F;
    --orange-500: #E44419; 
    --orange-600: #D83C1A;
    --orange-700: #CC341B;
    --orange-800: #C02C1C;
    --orange-900: #C41900; 
}
*/
/*
:root {
    
    --orange-50: #fff8f0;
    --orange-100: #ffe8cc;
    --orange-200: #ffd6a8;
    --orange-300: #ffba75;
    --orange-400: #ff9d42;
    --orange-500: #ff8000; 
    --orange-600: #ff6a00;
    --orange-700: #e05000;
    --orange-800: #cc3d00;
    --orange-900: #a62e00;
}
*/


html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: white /*var(--orange-50)*/;
}

.btn-primary {
    color: #fff;
    background-color: var(--blue-600);
    border-color: var(--blue-700);
}

    .btn-primary:hover {
        background-color: var(--blue-700);
        border-color: var(--blue-800);
    }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--blue-500);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--blue-400);
}

.invalid {
    outline: 1px solid var(--blue-700);
}

.validation-message {
    color: var(--blue-700);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1zbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MCLjY1NiA9Mi45OTZDMjkwLjg3NyA5My41MTMgMjkxIDk0LjA4MTUgMjkxIDk0LjY3MiAyOTEgOTcuMDY1MSAyODkuMDM4IDk5IDI4Ni42MTcgOTlMMjQwLjM4MyA5OUMyMzcuOTYzIDk5IDIzNiA9Mi45OTZDMjkwLjg3NyA5My41MTMgMjkxIDk0LjA4MTUgMjkxIDk0LjY3MiAyOTEgOTcuMDY1MSAyODkuMDM4IDk5IDI4Ni42MTcgOTlMMjQwLjM4MyA5OUMyMzcuOTYzIDk5IDIzNiA9Mi45OTZDMjkwLjg3NyA5My41MTMgMjYzLjU0IDEwMS4yODMgMjYzLjU1NyAxMDEuMTY2IDIzNi4zNjM5IDI2Ni42MjYgMjQwLjQzMSA2Mi42NTggMjQwLjA3MSA2Mi44MzYgMjM2LjMzOCA5My4wMTYyIDIzNi44NTggOTIuMTMxNCAyNTkuNDczIDUzLjYyOTQgMjU5Ljk2MSA1Mi43OTg1IDI2MC40MDcgNTIuMjY1OEMyNjEuMiA1MS40ODM3IDI2Mi4yOTYgNTEgMjYzLjUwSiA1MVpNMjYzLjU4NiA2Ni4wMTgzQzI2MC43MzcgNjYuMDE4MyAyNTkuMzEzIDY3LjEyNDUgMjU5LjMxMyA2OS4zMzcgMjU5LjMxMyA2OS42MTAyIDI1OS4zMzIgNjkuODYwOCAyNTkuMzcxIDcwLjA4ODdMMjYxLjc5NSA4NC4wMTYxIDI2NS4zOCA4NC4wMTYxIDI2Ny44MjEgNjkuNzQ3NUMyNjcuODYgNjkuNzMwOSAyNjcuODc5IDY5LjU4NzcgMjY3Ljg3OSA2OS4zMTc5IDI2Ny44NzkgNjcuMTE4MiAyNjYuNDQ4IDY2LjAxODMgMjYzLjU4NiA2Ni4wMTgzWk0yNjMuNTc2IDg2LjA1NDdDMjYxLjA0OSA4Ni4wNTQ3IDI1OS43ODYgODcuMzAwNSAyNTkuNzg2IDg5Ljc5MjEgMjU5Ljc4NiA5Mi4yODM3IDI2MS4wNDkgOTMuNTI5NSAyNjMuNTc2IDkzLjUyOTUgMjY2LjExNiA5My41Mjk1IDI2Ny4zODcgOTIuMjgzNyAyNjcuMzg3IDg5Ljc5MjEgMjY3LjM4NyA4Ny4zMDA1IDI2Ni4xMTYgODYuMDU0NyAyNjMuNTc2IDg2LjA1NDdaIiBmaWxsPSIjRkZFNTAwIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L2c+PC9zdmc+) no-repeat 1rem/1.8rem, var(--orange-800);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Navigation */
.top-row {
    height: 5rem;
    background-color: var(--blue-600) !important;
    color: white !important;
}

.nav-logo {
    height: 120px; /* Adjust the height as needed */
    margin-right: 10px; /* Space between the logo and the text */
    margin-top: -20px;
}

.navbar {
    background-color: var(--blue-900);
    color: white !important;
}

.nav-link {
    color: white !important;
}

    .nav-link:hover {
        font-weight: bolder;
        background-color: var(--blue-800);
    }

    .nav-link.active {
        color: white !important;
        font-weight: bolder;
        background-color: var(--blue-700);
    }

.nav-scrollable {
    overflow-y: auto;
    max-height: 150vh;
    background-color: var(--blue-900);
}

.navbar-toggler {
    display: none;
    color: white;
    border-color: var(--blue-300);
}

.navbar-brand {
    color: white !important;
    font-weight: bold;
}

/* Nested Menu Styles */
.nav-item {
    position: relative;
    color: white;
}

/* First level dropdown */
.dropdown-menu {
    display: none;
    position: absolute;
    background-color: var(--blue-100);
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 8px 0;
    margin: 0;
    border-radius: 4px;
    border: 1px solid var(--blue-300);
    left: 0;
    top: 100%;
}

/* Show dropdown on hover */
.nav-item:hover > .dropdown-menu {
    display: block;
}

/* Second level (nested) dropdown */
.dropdown-submenu {
    position: relative;
}

    .dropdown-submenu > .dropdown-menu {
        top: 0;
        left: 100%;
        margin-top: -8px;
        margin-left: 1px;
    }

    /* Show second level dropdown on hover */
    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
    }

/* Dropdown item styling */
.dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    clear: both;
    font-weight: 400;
    color: var(--blue-900);
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    text-decoration: none;
}

    .dropdown-item:hover, .dropdown-item:focus {
        color: var(--blue-900);
        text-decoration: none;
        background-color: var(--blue-300);
    }

/* Add dropdown indicators */
.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid var(--blue-300);
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.dropdown-submenu > a::after {
    display: inline-block;
    float: right;
    margin-top: 8px;
    content: "";
    border-left: 0.3em solid var(--blue-500);
    border-top: 0.3em solid transparent;
    border-right: 0;
    border-bottom: 0.3em solid transparent;
}

/* Add custom indicator for parent menu items and left Icon */
.nav-item.has-submenu > a {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

    .nav-item.has-submenu > a::before {
        content: "\25CF";
        font-size: 0.8em;
        margin-right: 5px;
        color: white /*var(--orange-400)*/;
    }

    .nav-item.has-submenu > a::after {
        content: "\25BE";
        font-size: 0.8em;
        margin-left: auto;
        color: white /* var(--orange-400) */;
    }

.row-default {
    background-color: transparent;
}

.row-amber {
    background-color: #FFC107 !important; /* Amber */
    color: var(--bs-body-color); /* Adjust text color for themes */
}

.row-red {
    background-color: #FF5722 !important; /* Red */
    color: var(--bs-body-color); /* Adjust text color for themes */
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }

    .navbar-toggler {
        display: block;
        background-color: var(--orange-700);
    }

    .nav-scrollable {
        display: none;
        width: 100%;
    }

    .navbar-toggler:checked + .nav-scrollable {
        display: block;
    }

    /* Responsive nested menu */
    .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        box-shadow: none;
        border: none;
        padding-left: 15px;
        background-color: var(--blue-800);
    }

    .dropdown-submenu > .dropdown-menu {
        position: static;
        left: 0;
        margin: 0;
        padding-left: 15px;
        background-color: var(--orange-700);
    }

    .dropdown-item {
        color: var(--orange-100);
    }

        .dropdown-item:hover, .dropdown-item:focus {
            color: white;
            background-color: var(--orange-600);
        }

    .dropdown-submenu > a::after {
        transform: rotate(90deg);
    }

    /* Toggle visibility using JavaScript classes */
    .nav-scrollable.mobile-open {
        display: block;
    }

    .dropdown-menu.mobile-open {
        display: block;
    }

    .nav-item.has-submenu > a::after {
        transform: rotate(90deg);
    }

    @media (prefers-color-scheme: dark) {
        .row-amber {
            background-color: #FFB300; /* Darker Amber for dark mode */
        }

        .row-red {
            background-color: #E64A19; /* Darker Red for dark mode */
        }
    }

    @media (max-width: 768px) {
        .results-table-container table {
            font-size: 0.9rem; /* Adjust font size for mobile */
        }
    }
}

.flex-column {
    width: 500px;
}

.page-title {
    text-align: center;
    margin-top: 20px;
}

/* Dark Theme */
.dark-theme {
    background-color: #121212;
    color: #e0e0e0;
}

    .dark-theme .mud-paper {
        background-color: #1e1e1e !important;
        color: #e0e0e0 !important;
    }

    .dark-theme .mud-table {
        background-color: rgb(75, 75, 75) !important;
        color: #e0e0e0 !important;
    }

    .dark-theme .mud-table-head {
        background-color: #2d2d2d !important;
        color: #ffffff !important;
    }

    .dark-theme .mud-table-row:hover {
        background-color: #404040 !important;
        color: #ffffff !important;
    }

    .dark-theme .mud-table-row.selected {
        background-color: #1976d2 !important;
        color: #ffffff !important;
    }

    .dark-theme .mud-table-row:active {
        background-color: #505050 !important;
        color: #ffffff !important;
    }

    .dark-theme .mud-text {
        color: #e0e0e0 !important;
    }

        .dark-theme .mud-text.mud-typography-h4,
        .dark-theme .mud-text.mud-typography-h5,
        .dark-theme .mud-text.mud-typography-h6 {
            color: #ffffff !important;
        }

    .dark-theme .mud-chart {
        background-color: #1e1e1e !important;
    }

    .dark-theme .mud-table-cell {
        color: black !important;
        border-color: #404040 !important;
    }

    .dark-theme .mud-table-head .mud-table-cell {
        color: #ffffff !important;
        font-weight: 600;
    }

    .dark-theme .mud-chip {
        color: #ffffff !important;
    }

    /* Dark Theme - Top Menu Improvements */
    .dark-theme .mud-appbar {
        background-color: #1e1e1e !important;
        color: #ffffff !important;
    }

    .dark-theme .mud-menu-item {
        color: #ffffff !important;
    }

        .dark-theme .mud-menu-item:hover {
            background-color: #333333 !important;
            color: #ffffff !important;
        }

        .dark-theme .mud-menu-item .mud-icon {
            color: #ffffff !important;
        }

    .dark-theme .mud-popover-paper {
        background-color: #2d2d2d !important;
        color: #ffffff !important;
    }

/* Make the area around the header in CustomersList dark in dark mode */
.mud-theme-dark .mobile-header,
.mud-theme-dark .mobile-header .responsive-toolbar {
    background: #1e1e1e !important;
    color: #fff !important;
    border-bottom: 1px solid #444 !important;
}

/* Remove white background from .mobile-header in dark mode */
.mud-theme-dark .mobile-header {
    background: #1e1e1e !important;
}

/* Make disabled MudBlazor save buttons more prominent */
.mud-button.mud-disabled, .mud-button[disabled] {
    opacity: 0.7 !important;
    background-color: grey !important; /* Brighter orange */
    color: #fff !important;
    border: 1px solid white !important;
    box-shadow: 0 0 0 2px #ffa72644;
    cursor: not-allowed !important;
    font-weight: bold;
}

/* Support .dark-theme (used by our JS) for MudBlazor components */
.dark-theme .mud-drawer,
.dark-theme .mud-drawer-paper,
.dark-theme .app-drawer {
    background-color: #23272b !important;
    color: #fff !important;
    z-index: 3000 !important;
}

.dark-theme .mud-nav-link,
.dark-theme .mud-nav-link .mud-icon-root,
.dark-theme .mud-nav-link .mud-icon,
.dark-theme .mud-nav-link .mud-nav-link-text {
    color: #fff !important;
}

    .dark-theme .mud-nav-link.mud-nav-link-active {
        background-color: #33384d !important;
        color: #1E88E5 !important;
    }

/* Ensure SVG icons inside the drawer are white */
.dark-theme .app-drawer svg,
.dark-theme .app-drawer .mud-icon {
    color: #fff !important;
    fill: #fff !important;
}

/* Inputs in dark-theme */
.dark-theme input,
.dark-theme textarea,
.dark-theme .mud-input-root input,
.dark-theme .mud-input-root textarea,
.dark-theme .mud-input-slot input,
.dark-theme .mud-picker-input input,
.dark-theme .mud-textfield .mud-input-slot input {
    color: #fff !important;
    background-color: #23272b !important;
    border-color: #444 !important;
    caret-color: #fff !important;
}

.dark-theme .mud-input-label {
    color: #bbb !important;
}

/* Ensure nav logo at the bottom is visible in dark mode */
.dark-theme .nav-logo,
.mud-theme-dark .nav-logo {
    filter: brightness(2) invert(0) drop-shadow(0 0 2px #fff);
    background: transparent !important;
}

.dark-theme .mud-drawer,
.dark-theme .mud-drawer-paper,
.dark-theme .app-drawer,
.mud-theme-dark .mud-drawer,
.mud-theme-dark .mud-drawer-paper,
.mud-theme-dark .app-drawer {
    background-color: #23272b !important;
    color: #fff !important;
}

    /* If the logo is an <img>, make sure it is not hidden by background */
    .dark-theme .mud-drawer img.nav-logo,
    .mud-theme-dark .mud-drawer img.nav-logo {
        filter: brightness(2) invert(0) drop-shadow(0 0 2px #fff);
        background: transparent !important;
    }

/* Ensure nav link text is visible in dark mode */
.mud-theme-dark .mud-nav-link-text,
.mud-theme-dark .mud-nav-link,
.dark-theme .mud-nav-link-text,
.dark-theme .mud-nav-link {
    color: #fff !important;
    font-weight: 500 !important;
}

    .mud-theme-dark .mud-nav-link.mud-nav-link-active .mud-nav-link-text,
    .dark-theme .mud-nav-link.mud-nav-link-active .mud-nav-link-text {
        color: #fff !important;
        font-weight: 700 !important;
    }

    .mud-theme-dark .mud-nav-link span,
    .dark-theme .mud-nav-link span,
    .mud-theme-dark .mud-nav-link-text,
    .dark-theme .mud-nav-link-text {
        color: #fff !important;
        font-weight: 500 !important;
        opacity: 1 !important;
        display: inline !important;
    }

/* --- FORCE NAV TEXT VISIBLE IN DARK MODE AND MINI DRAWER --- */
.mud-theme-dark .mud-nav-link,
.mud-theme-dark .mud-nav-link .mud-nav-link-text,
.mud-theme-dark .mud-nav-link span,
.dark-theme .mud-nav-link,
.dark-theme .mud-nav-link .mud-nav-link-text,
.dark-theme .mud-nav-link span {
    color: #fff !important;
    font-weight: 500 !important;
    opacity: 1 !important;
    display: inline !important;
}

.mud-theme-dark .mud-nav-link.mud-nav-link-active,
.mud-theme-dark .mud-nav-link.mud-nav-link-active .mud-nav-link-text,
.mud-theme-dark .mud-nav-link.mud-nav-link-active span,
.dark-theme .mud-nav-link.mud-nav-link-active,
.dark-theme .mud-nav-link.mud-nav-link-active .mud-nav-link-text,
.dark-theme .mud-nav-link.mud-nav-link-active span {
    color: #fff !important;
    font-weight: 700 !important;
    opacity: 1 !important;
    display: inline !important;
}

/* Prevent text from being hidden in mini/collapsed drawer */
.mud-nav-link .mud-nav-link-text,
.mud-nav-link span {
    display: inline !important;
    opacity: 1 !important;
}

/* Remove any color: transparent or display: none from nav text */
.mud-theme-dark .mud-nav-link-text[style*="transparent"],
.dark-theme .mud-nav-link-text[style*="transparent"] {
    color: #fff !important;
    display: inline !important;
    opacity: 1 !important;
}

/* Left-align MudNavGroup headers */
.mud-nav-group .mud-nav-link {
    justify-content: flex-start !important;
    text-align: left !important;
}

.mud-nav-group-header {
    justify-content: flex-start !important;
    text-align: left !important;
}

/* Fix MudDatePicker month grid to always show six week rows */
.mud-picker-calendar-container .mud-picker-calendar {
    min-height: 350px !important;
    height: auto !important;
    transform-origin: top center !important;
}

.mud-picker-calendar .mud-picker-calendar-header + div {
    min-height: 350px !important;
    height: auto !important;
}

.mud-picker-calendar-transition {
    min-height: 350px !important;
    height: auto !important;
    overflow: visible !important;
}
/* Enable text selection globally */
* {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* FullCalendar day background colors */
.day-available {
    background-color: #d4edda !important;
}

.day-full {
    background-color: #f8d7da !important;
}

.day-unavailable {
    background-color: #e9ecef !important;
}
/* Fix MudBlazor DatePicker calendar grid to show 7 columns */
/*.mud-picker-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr) !important;

}*/
/* SOP Designer Workflow Styles */

    :root {
      --bg: #0b0d12;
      --surface: #12151d;
      --surface2: #1a1f2b;
      --border: #252b3b;
      --border2: #2e3650;
      --accent: #4f7bff;
      --accent2: #00e5a0;
      --text: #e8eaf0;
      --text2: #8891aa;
      --text3: #555f7a;
      --radius: 12px;
      --radius-sm: 8px;
      --glow: 0 0 24px rgba(79,123,255,.25);
      --glow2: 0 0 24px rgba(0,229,160,.25);
    }

    .diagram-canvas { background: transparent !important; }
    .canvas-wrapper { flex: 1; overflow: hidden; position: relative; height: 100%; z-index: 1; }
    .canvas-wrapper::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(79,123,255,.18) 1px, transparent 1px); background-size: 32px 32px; pointer-events: none; z-index: -1; }
    .diagram-canvas-container { width: 100%; height: 100%; }

    /* Links & Arrow Markers */
    .diagram-link path { stroke: var(--accent) !important; stroke-width: 2 !important; fill: none !important; }
    .diagram-link.selected path, .diagram-link:hover path { stroke: var(--accent2) !important; }
    .diagram-link path + path { stroke: transparent !important; stroke-width: 20 !important; fill: none !important; }
    .diagram-link.selected path + path, .diagram-link:hover path + path { stroke: transparent !important; }
    .diagram-link g path { fill: var(--accent) !important; stroke: none !important; }
    .diagram-link.selected g path, .diagram-link:hover g path { fill: var(--accent2) !important; }

    /* Controls (Selection/Delete handles) */
    .diagram-control.RemoveControl { cursor: pointer !important; pointer-events: all !important; }
    .diagram-control.RemoveControl circle { fill: var(--accent) !important; opacity: .95; r: 12; }
    .diagram-control.RemoveControl path, .diagram-control.RemoveControl line { stroke: #fff !important; fill: none !important; }
    .diagram-html-layer, .controls { overflow: visible !important; }
    .controls .executable { pointer-events: all !important; }

    /* Diagram Ports */
    .diagram-port { position: absolute !important; width: 12px !important; height: 12px !important; background: var(--surface2) !important; border: 2px solid var(--accent) !important; border-radius: 50% !important; pointer-events: all !important; cursor: crosshair !important; z-index: 10; opacity: 0; transition: opacity .15s, transform .15s !important; }
    .diagram-node:hover .diagram-port, .diagram-port:hover { opacity: 1 !important; z-index: 30 !important; }
    .diagram-port:hover { background: var(--accent) !important; transform: scale(1.4) !important; box-shadow: 0 0 8px var(--accent) !important; }

    /* Port Positions (left, right, top, bottom) */
    .diagram-port.top { top: -6px !important; left: 50% !important; transform: translateX(-50%); }
    .diagram-port.right { right: -6px !important; top: 50% !important; transform: translateY(-50%); }
    .diagram-port.bottom { bottom: -6px !important; left: 50% !important; transform: translateX(-50%); }
    .diagram-port.left { left: -6px !important; top: 50% !important; transform: translateY(-50%); }
    
    .navigator-widget { position: absolute !important; top: 16px !important; right: 16px !important; background: rgba(18,21,29,.85) !important; border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; backdrop-filter: blur(8px) !important; box-shadow: 0 4px 20px rgba(0,0,0,.4) !important; z-index: 1200 !important; opacity: 1 !important; visibility: visible !important; }

    .substeps-list { margin-top:8px; list-style:none; padding-left:0; display:flex; flex-direction:column; gap:6px; }
    .substep-item { display:flex; align-items:center; }
    .substep-label { display:flex; gap:8px; align-items:center; color:var(--text3); font-size:12px; }
    .substep-title { color:var(--text3); }

    .step-node {
        position: relative;
        width: 260px;
        min-width: 260px;
        min-height: 220px;
        max-width: 900px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 16px;
        cursor: grab;
        transition: border-color .25s, box-shadow .25s;
        overflow: auto;
        overflow-x: auto;
        overflow-y: auto;
        resize: both;
        color: var(--text);
        scrollbar-width: thin;
        scrollbar-color: transparent transparent;
    }
    .step-node:hover {
        scrollbar-color: var(--border2) transparent;
    }
    .step-node::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    .step-node::-webkit-scrollbar-track {
        background: transparent;
    }
    .step-node::-webkit-scrollbar-thumb {
        background: transparent;
        border-radius: 8px;
    }
    .step-node:hover::-webkit-scrollbar-thumb {
        background: var(--border2);
    }
    .step-node:hover { border-color: var(--border2); box-shadow: 0 8px 32px rgba(0,0,0,.35); }
    .step-node.selected { border-color: var(--accent); box-shadow: var(--glow); }
    .step-node.completed { border-color: rgba(0,229,160,.35); background: linear-gradient(135deg, #12151d 0%, #131e1a 100%); }
    .step-node.completed.selected { box-shadow: var(--glow2); }
    .step-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
    .step-badge { width: 22px; height: 22px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--border2); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--text2); flex-shrink: 0; }
    .step-icon { font-size: 18px; line-height: 1; }
    .step-body { margin-bottom: 16px; }
    .step-title { font-size: 14px; font-weight: 700, color: var(--text); margin-bottom: 4px; }
    .step-desc { font-size: 11px; color: var(--text3); line-height: 1.5; }
    .step-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border); }
    .step-status-label { font-size: 11px; font-weight: 600; color: var(--text3); letter-spacing: .5px; text-transform: uppercase; }
    .toggle-switch { position: relative; display: inline-block; user-select: none; }
    .toggle-switch input[type="range"] { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; z-index: 2; }
    .toggle-track { display: block; width: 48px; height: 26px; border-radius: 100px; background: var(--surface2); border: 1px solid var(--border2); position: relative; transition: background .25s, border-color .25s, box-shadow .25s; }
    .toggle-track.on { background: rgba(0,229,160,.2); border-color: var(--accent2); box-shadow: 0 0 10px rgba(0,229,160,.3); }
    .toggle-thumb { display: block; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text3); transition: left .25s cubic-bezier(.4,0,.2,1), background .25s; }
    .toggle-track.on .toggle-thumb { left: 25px; background: var(--accent2); box-shadow: 0 0 8px var(--accent2); }

    .progress-node { width: 300px; background: linear-gradient(135deg, #14172a 0%, #0f1420 100%); border: 1px solid var(--accent); border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--glow), inset 0 1px 0 rgba(79,123,255,.1); position: relative; overflow: hidden; cursor: grab; color: var(--text); }
    .progress-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
    .progress-title { font-size: 13px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 1px; }
    .progress-pct { font-size: 36px; font-weight: 500; color: var(--accent); line-height: 1; }
    .progress-pct small { font-size: 16px; color: var(--text2); }
    .progress-track-outer { width: 100%; height: 10px; background: var(--surface2); border: 1px solid var(--border2); border-radius: 100px; overflow: hidden; margin-bottom: 14px; }
    .progress-track-fill { height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--accent) 0%, var(--accent2) 100%); position: relative; transition: width .6s cubic-bezier(.4,0,.2,1); }
    .progress-shine { position: absolute; top: 0; left: -60px; width: 40px; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: shine 2.4s ease-in-out infinite; }
    @keyframes shine { 0% { left: -60px; opacity: 0; } 20% { opacity: 1; } 60% { opacity: 0; } 100% { left: 110%; opacity: 0; } }
    .progress-stats { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text3); gap: 8px; }

    .sop-designer-shell {
        --sop-bottom-offset: calc(var(--app-status-bar-height, 0px) + env(safe-area-inset-bottom, 0px));
        height: calc(100dvh - 88px - var(--sop-bottom-offset));
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .sop-designer-layout {
        flex: 1;
        min-height: 0;
        height: 100%;
    }

    .sop-toolbox-column {
        height: 100%;
        max-height: 100%;
        min-height: 0;
        display: block;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .sop-canvas-column {
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .sop-canvas-column .workflow-canvas-host {
        flex: 1;
        min-height: 0;
    }

.workflow-canvas-host {
    padding: 0 !important;
    overflow: hidden !important;
    display: flex;
}

.workflow-canvas-host .canvas-wrapper {
    width: 100%;
    height: 100%;
}

.workflow-canvas-host .diagram-canvas-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.diagram-node {
    transform-origin: top left !important;
}

.step-node {
    box-sizing: border-box;
}

.step-header-spacer {
    flex: 1;
}

.step-collapsed-summary {
    margin-bottom: 8px;
}

    .notes-container { font-size: 11px; color: var(--text3); overflow: visible; }
    .note-text { font-size: 11px; color: var(--text3); line-height: 1.5; }
    .note-title,
    .note-panels .mud-expand-panel-header .mud-typography,
    .note-panels .mud-expand-panel-header-text {
        font-size: 11px !important;
        color: var(--text3) !important;
        line-height: 1.5;
    }
    .note-panel .mud-expand-panel-content {
        font-size: 11px;
        color: var(--text3);
        overflow: visible !important;
    }
    .note-panel .mud-expand-panel-content .mud-expand-panel-content-text {
        overflow: visible !important;
    }
    .note-entry-input {
        width: 240px;
        min-height: 44px;
        max-height: none;
        height: 96px;
        min-width: 180px;
        max-width: none;
        box-sizing: border-box;
        resize: both;
        border: 1px solid var(--border2);
        background: var(--surface2);
        color: var(--text3);
        border-radius: 8px;
        padding: 6px 8px;
        font-size: 11px;
        line-height: 1.5;
        display: block;
        overflow: auto;
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-gutter: auto;
        scrollbar-width: thin;
        scrollbar-color: transparent transparent;
    }
    .note-entry-input:hover,
    .note-entry-input:focus {
        scrollbar-color: var(--border2) transparent;
    }
    .note-entry-input::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    .note-entry-input::-webkit-scrollbar-track {
        background: transparent;
    }
    .note-entry-input::-webkit-scrollbar-thumb {
        background: transparent;
        border-radius: 8px;
    }
    .note-entry-input:hover::-webkit-scrollbar-thumb,
    .note-entry-input:focus::-webkit-scrollbar-thumb {
        background: var(--border2);
    }
    .note-entry-input:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 1px rgba(79,123,255,.25);
    }
    .note-editor-input {
        max-width: none;
        min-width: 220px;
        min-height: 96px;
    }
    .note-editor-input:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 1px rgba(79,123,255,.25);
    }
    .note-editor textarea,
    .note-editor-input {
        resize: both !important;
        min-height: 96px;
        max-height: none;
        font-size: 11px !important;
        line-height: 1.5 !important;
    }

/* Ensure MudBlazor menus and popovers are clickable and visible on mobile devices
   Some mobile layouts can clip or grey-out popover/menu items due to overflow/z-index.
   These overrides make menu items interactive and allow scrolling inside popovers. */
.mud-menu .mud-list-item,
.mud-popover .mud-list-item,
.mud-menu-item {
    pointer-events: auto !important;
    opacity: 1 !important;
}

.mud-popover,
.mud-popover-open {
    pointer-events: auto !important;
    z-index: 2000 !important;
    /* Allow popovers to scroll on small screens so all items are reachable */
    max-height: 60vh;
    overflow: auto;
}

@media (max-width: 700px) {
    .mud-menu .mud-list-item,
    .mud-popover .mud-list-item {
        padding: 10px 14px !important;
        font-size: 15px !important;
    }
}



/* SOP Designer Workflow Styles */
:root {
      --bg: #0b0d12;
      --surface: #12151d;
      --surface2: #1a1f2b;
      --border: #252b3b;
      --border2: #2e3650;
      --accent: #4f7bff;
      --accent2: #00e5a0;
      --text: #e8eaf0;
      --text2: #8891aa;
      --text3: #555f7a;
      --radius: 12px;
      --radius-sm: 8px;
      --glow: 0 0 24px rgba(79,123,255,.25);
      --glow2: 0 0 24px rgba(0,229,160,.25);
    }

    .diagram-canvas { background: transparent !important; }
    .canvas-wrapper { flex: 1; overflow: hidden; position: relative; height: 100%; z-index: 1; }
    .canvas-wrapper::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(79,123,255,.18) 1px, transparent 1px); background-size: 32px 32px; pointer-events: none; z-index: -1; }
    .diagram-canvas-container { width: 100%; height: 100%; }

    /* Links & Arrow Markers */
    .diagram-link path { stroke: var(--accent) !important; stroke-width: 2 !important; fill: none !important; }
    .diagram-link.selected path, .diagram-link:hover path { stroke: var(--accent2) !important; }
    .diagram-link path + path { stroke: transparent !important; stroke-width: 20 !important; fill: none !important; }
    .diagram-link.selected path + path, .diagram-link:hover path + path { stroke: transparent !important; }
    .diagram-link g path { fill: var(--accent) !important; stroke: none !important; }
    .diagram-link.selected g path, .diagram-link:hover g path { fill: var(--accent2) !important; }

    /* Controls (Selection/Delete handles) */
    .diagram-control.RemoveControl { cursor: pointer !important; pointer-events: all !important; }
    .diagram-control.RemoveControl circle { fill: var(--accent) !important; opacity: .95; r: 12; }
    .diagram-control.RemoveControl path, .diagram-control.RemoveControl line { stroke: #fff !important; fill: none !important; }
    .diagram-html-layer, .controls { overflow: visible !important; }
    .controls .executable { pointer-events: all !important; }

    /* Diagram Ports */
    .diagram-port { position: absolute !important; width: 12px !important; height: 12px !important; background: var(--surface2) !important; border: 2px solid var(--accent) !important; border-radius: 50% !important; pointer-events: all !important; cursor: crosshair !important; z-index: 10; opacity: 0; transition: opacity .15s, transform .15s !important; }
    .diagram-node:hover .diagram-port, .diagram-port:hover { opacity: 1 !important; z-index: 30 !important; }
    .diagram-port:hover { background: var(--accent) !important; transform: scale(1.4) !important; box-shadow: 0 0 8px var(--accent) !important; }

    /* Port Positions (left, right, top, bottom) */
    .diagram-port.top { top: -6px !important; left: 50% !important; transform: translateX(-50%); }
    .diagram-port.right { right: -6px !important; top: 50% !important; transform: translateY(-50%); }
    .diagram-port.bottom { bottom: -6px !important; left: 50% !important; transform: translateX(-50%); }
    .diagram-port.left { left: -6px !important; top: 50% !important; transform: translateY(-50%); }
    
    .navigator-widget { position: absolute !important; bottom: 16px !important; right: 16px !important; background: rgba(18,21,29,.85) !important; border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; backdrop-filter: blur(8px) !important; box-shadow: 0 4px 20px rgba(0,0,0,.4) !important; }

    .substeps-list { margin-top:8px; list-style:none; padding-left:0; display:flex; flex-direction:column; gap:6px; }
    .substep-item { display:flex; align-items:center; }
    .substep-label { display:flex; gap:8px; align-items:center; color:var(--text3); font-size:12px; }
    .substep-title { color:var(--text3); }

    .step-node {
        position: relative;
        width: 260px;
        min-width: 260px;
        min-height: 220px;
        max-width: 900px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 16px;
        cursor: grab;
        transition: border-color .25s, box-shadow .25s;
        overflow: auto;
        resize: both;
        color: var(--text);
        scrollbar-width: thin;
        scrollbar-color: transparent transparent;
    }
    .step-node:hover {
        scrollbar-color: var(--border2) transparent;
    }
    .step-node::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    .step-node::-webkit-scrollbar-track {
        background: transparent;
    }
    .step-node::-webkit-scrollbar-thumb {
        background: transparent;
        border-radius: 8px;
    }
    .step-node:hover::-webkit-scrollbar-thumb {
        background: var(--border2);
    }
    .step-node:hover { border-color: var(--border2); box-shadow: 0 8px 32px rgba(0,0,0,.35); }
    .step-node.selected { border-color: var(--accent); box-shadow: var(--glow); }
    .step-node.completed { border-color: rgba(0,229,160,.35); background: linear-gradient(135deg, #12151d 0%, #131e1a 100%); }
    .step-node.completed.selected { box-shadow: var(--glow2); }
    .step-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
    .step-badge { width: 22px; height: 22px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--border2); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--text2); flex-shrink: 0; }
    .step-icon { font-size: 18px; line-height: 1; }
    .step-body { margin-bottom: 16px; }
    .step-title { font-size: 14px; font-weight: 700, color: var(--text); margin-bottom: 4px; }
    .step-desc { font-size: 11px; color: var(--text3); line-height: 1.5; }
    .step-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border); }
    .step-status-label { font-size: 11px; font-weight: 600; color: var(--text3); letter-spacing: .5px; text-transform: uppercase; }
    .toggle-switch { position: relative; display: inline-block; user-select: none; }
    .toggle-switch input[type="range"] { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; z-index: 2; }
    .toggle-track { display: block; width: 48px; height: 26px; border-radius: 100px; background: var(--surface2); border: 1px solid var(--border2); position: relative; transition: background .25s, border-color .25s, box-shadow .25s; }
    .toggle-track.on { background: rgba(0,229,160,.2); border-color: var(--accent2); box-shadow: 0 0 10px rgba(0,229,160,.3); }
    .toggle-thumb { display: block; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text3); transition: left .25s cubic-bezier(.4,0,.2,1), background .25s; }
    .toggle-track.on .toggle-thumb { left: 25px; background: var(--accent2); box-shadow: 0 0 8px var(--accent2); }

    .progress-node { width: 300px; background: linear-gradient(135deg, #14172a 0%, #0f1420 100%); border: 1px solid var(--accent); border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--glow), inset 0 1px 0 rgba(79,123,255,.1); position: relative; overflow: hidden; cursor: grab; color: var(--text); }
    .progress-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
    .progress-title { font-size: 13px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 1px; }
    .progress-pct { font-size: 36px; font-weight: 500; color: var(--accent); line-height: 1; }
    .progress-pct small { font-size: 16px; color: var(--text2); }
    .progress-track-outer { width: 100%; height: 10px; background: var(--surface2); border: 1px solid var(--border2); border-radius: 100px; overflow: hidden; margin-bottom: 14px; }
    .progress-track-fill { height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--accent) 0%, var(--accent2) 100%); position: relative; transition: width .6s cubic-bezier(.4,0,.2,1); }
    .progress-shine { position: absolute; top: 0; left: -60px; width: 40px; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: shine 2.4s ease-in-out infinite; }
    @keyframes shine { 0% { left: -60px; opacity: 0; } 20% { opacity: 1; } 60% { opacity: 0; } 100% { left: 110%; opacity: 0; } }
    .progress-stats { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text3); gap: 8px; }
