       /* Core styling for light and dark modes */
        :root {
            --background-color: #f9f9f9; /* Light background */
            --text-color: #333333; /* Dark text color */
            --container-bg-color: #ffffff; /* White container background */
            --button-bg-color: #0077ff; /* Bright blue button color */
            --button-hover-bg-color: #0056cc; /* Darker blue for hover */
            --table-header-bg-color: #f3f4f6; /* Light gray for table headers */
            --table-header-text-color: #333333; /* Dark text for table headers */
            --table-cell-bg-color: #ffffff; /* White table cell background */
            --table-cell-text-color: #333333; /* Dark text color for table cells */
            --break-bg-color: #ffefc1; /* Soft yellow for breaks */
            --lunch-bg-color: #c1f0c1; /* Soft green for lunch */
            --unassigned-bg-color: #ffc1c1; /* Soft red for unassigned */
            --primary-font: 'Poppins', sans-serif; /* Modern font */
        }

        /* Dark mode overrides */
        body.dark-mode {
            --background-color: #1f2937; /* Dark background */
            --text-color: #f9fafb; /* Light text color */
            --container-bg-color: #374151; /* Dark gray container background */
            --button-bg-color: #2563eb; /* Blue button color */
            --button-hover-bg-color: #1d4ed8; /* Darker blue for hover */
            --table-header-bg-color: #4b5563; /* Darker gray for table headers */
            --table-header-text-color: #f9fafb; /* Light text for table headers */
            --table-cell-bg-color: #4b5563; /* Dark gray table cell background */
            --table-cell-text-color: #f9fafb; /* Light text color for table cells */
            --break-bg-color: #fbbf24; /* Yellow for breaks */
            --lunch-bg-color: #22c55e; /* Green for lunch */
            --unassigned-bg-color: #ef4444; /* Red for unassigned */
        }

        /* General body styling */
        body {
            font-family: var(--primary-font);
            margin: 0;
            padding: 0;
            background-color: var(--background-color);
            color: var(--text-color);
            line-height: 1.8;
            transition: background-color 0.5s ease, color 0.5s ease;
        }
        h1, h2 {
            font-weight: 600;
            color: var(--text-color);
            margin-bottom: 20px;
        }
        h1 {
            font-size: 2.5rem;
            text-align: center;
            margin-top: 20px;
        }
        h2 {
            font-size: 1.8rem;
        }
        .container {
            width: 100%; /* Ensure it takes full width */
            max-width: 1200px; /* Limit the maximum width */
            min-width: 800px; /* Ensure a minimum width for smaller content */
            margin: 0 auto;
            /* padding: 30px; */
            /* background-color: var(--container-bg-color); */
            border-radius: 12px;
            /* box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); */
            overflow-x: auto; /* Allow horizontal scrolling for overflowing content */
            transition: all 0.3s ease;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
        }
        .setup-section {
            background: linear-gradient(145deg, var(--container-bg-color) 0%, rgba(255,255,255,0.05) 100%);
            padding: 24px;
            border-radius: 16px;
            margin-bottom: 24px;
            border: 1px solid rgba(255,255,255,0.1);
            backdrop-filter: blur(10px);
            box-shadow: 
                0 8px 32px rgba(0, 0, 0, 0.1),
                0 1px 3px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
        }

        .setup-section:before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
        }

        .setup-section:hover {
            transform: translateY(-2px);
            box-shadow: 
                0 12px 40px rgba(0, 0, 0, 0.15),
                0 2px 6px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
        }

        body.dark-mode .setup-section {
            background: linear-gradient(145deg, var(--container-bg-color) 0%, rgba(0,0,0,0.2) 100%);
            border: 1px solid rgba(255,255,255,0.05);
        }

        body.dark-mode .setup-section:before {
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
        }
        .setup-section h2 {
            margin-bottom: 10px;
        }
        .staff-inputs, .patient-inputs, .security-staff-inputs {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;

        }
        input, select {
            /* padding: 8px; */
            /* border: 1px solid #dfe4ea; */
            border-radius: 5px;
            width: 150px; /* Shortened width */
            font-size: 14px;
            background-color: #ffffff;
            /* box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); */
            transition: all 0.3s ease;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
        }
        input:focus, select:focus, button:focus {
            outline: 3px solid #4a69bd;
            box-shadow: 0 0 5px rgba(74, 105, 189, 0.5);
        }
        /* Standardized Modern Button Styling */
        button {
            background: linear-gradient(135deg, var(--button-bg-color) 0%, #1e40af 100%);
            color: white;
            border: none;
            border-radius: 8px;
            padding: 14px 28px;
            min-height: 48px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
            position: relative;
            overflow: hidden;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            text-transform: none;
            letter-spacing: 0.5px;
        }

        button:before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            transition: left 0.5s;
        }

        button:hover:before {
            left: 100%;
        }

        button:hover {
            background: linear-gradient(135deg, var(--button-hover-bg-color) 0%, #1d4ed8 100%);
            transform: translateY(-3px) scale(1.02);
            box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
        }

        button:active {
            transform: translateY(-1px) scale(0.98);
            box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
        }

        button:disabled {
            background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        button:disabled:hover {
            transform: none;
            box-shadow: none;
        }
        
        /* Specialized Button Categories */
        
        /* Primary Action Buttons */
        #generateBtn, #handoverSetupBtn {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
        }

        #generateBtn:hover, #handoverSetupBtn:hover {
            background: linear-gradient(135deg, #059669 0%, #047857 100%);
            box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
        }

        /* Secondary Action Buttons */
        #addStaffBtn, #addPatientBtn, #individualBreakBtn {
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
        }

        #addStaffBtn:hover, #addPatientBtn:hover, #individualBreakBtn:hover {
            background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
            box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
        }

        /* Warning/Remove Buttons */
        #removeStaffBtn, #removePatientBtn, #resetBtn {
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
        }

        #removeStaffBtn:hover, #removePatientBtn:hover, #resetBtn:hover {
            background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
            box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
        }

        /* Utility Buttons */
        #compactModeBtn, #toggleBreakAdjustment, #resetRotationBtn {
            background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
            box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
        }

        #compactModeBtn:hover, #toggleBreakAdjustment:hover, #resetRotationBtn:hover {
            background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
            box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
        }

        /* Debug Button */
        #debugFillBtn {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
            box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
        }

        #debugFillBtn:hover {
            background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
            box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4) !important;
        }
        /* Special Toggle and Mode Buttons */
        #toggleModeBtn {
            background: linear-gradient(135deg, #6b7280 0%, #374151 100%);
            font-size: 20px;
            line-height: 1;
            font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
            min-width: 48px;
            height: 48px;
            padding: 8px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
        }

        #toggleModeBtn:hover {
            background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
            box-shadow: 0 8px 25px rgba(107, 114, 128, 0.4);
        }

        #toggleShiftBtn {
            background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
            box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
        }

        #toggleShiftBtn:hover {
            background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
            box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
        }

        /* Action Button Styling */
        .action-button {
            background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
            color: white;
            border: none;
            border-radius: 8px;
            padding: 12px 24px;
            min-height: 44px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .action-button:hover {
            background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
            transform: translateY(-2px) scale(1.02);
            box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
        }

        .action-button:active {
            transform: translateY(0) scale(0.98);
            box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
        }
        #toggleDebugBtn {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
            color: white;
            border: none;
            border-radius: 50%;
            width: 56px;
            height: 56px;
            font-size: 24px;
            cursor: pointer;
            z-index: 999;
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
            font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
        }

        #toggleDebugBtn:hover {
            transform: translateY(-3px) scale(1.1);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
        }
        table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            margin-top: 20px;
            background: linear-gradient(145deg, var(--table-cell-bg-color) 0%, rgba(255,255,255,0.8) 100%);
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 
                0 10px 30px rgba(0, 0, 0, 0.1),
                0 1px 8px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.6);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
        }

        table:before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 2px;
            background: linear-gradient(90deg, 
                transparent 0%,
                var(--button-bg-color) 20%,
                #10b981 40%,
                #8b5cf6 60%,
                var(--button-bg-color) 80%,
                transparent 100%
            );
        }

        body.dark-mode table {
            background: linear-gradient(145deg, var(--table-cell-bg-color) 0%, rgba(0,0,0,0.3) 100%);
            box-shadow: 
                0 10px 30px rgba(0, 0, 0, 0.3),
                0 1px 8px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
        }
        th, td {
            border: 1px solid #e5e7eb;
            padding: 15px;
            text-align: center;
            font-size: 14px;
            background-color: var(--table-cell-bg-color);
            color: var(--table-cell-text-color);
            transition: all 0.3s ease;
            border-radius: 4px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
        }

        /* Compact mode styles */
        body.compact-mode th, 
        body.compact-mode td {
            padding: 8px;
            font-size: 12px;
            border: none;
        }
        th {
            background-color: var(--table-header-bg-color);
            color: var(--table-header-text-color);
            font-weight: 600;
        }
        tr:nth-child(even) td {
            background-color: #f9fafb;
            color: var(--table-cell-text-color); /* Explicitly set text color */
        }
        tr:nth-child(odd) td {
            background-color: var(--table-cell-bg-color);
            color: var(--table-cell-text-color); /* Explicitly set text color */
        }
        .row-header {
            background-color: var(--table-header-bg-color);
            color: var(--table-header-text-color);
            font-weight: bold;
            text-align: left;
        }
        .staff-break {
            background-color: var(--break-bg-color);
            color: #000000; /* Ensure black text for contrast with yellow background */
            font-weight: bold;
        }
        .staff-lunch {
            background-color: var(--lunch-bg-color);
            color: #000000; /* Ensure black text for contrast with green background */
            font-weight: bold;
        }
        .schedule-container {
            overflow-x: auto;
            margin-top: 24px;
            background: linear-gradient(145deg, var(--container-bg-color) 0%, rgba(255,255,255,0.05) 100%);
            padding: 20px;
            border-radius: 16px;
            border: 1px solid rgba(255,255,255,0.1);
            backdrop-filter: blur(10px);
            box-shadow: 
                0 8px 32px rgba(0, 0, 0, 0.1),
                0 1px 3px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .schedule-container:hover {
            transform: translateY(-2px);
            box-shadow: 
                0 12px 40px rgba(0, 0, 0, 0.15),
                0 2px 6px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
        }

        body.dark-mode .schedule-container {
            background: linear-gradient(145deg, var(--container-bg-color) 0%, rgba(0,0,0,0.2) 100%);
            border: 1px solid rgba(255,255,255,0.05);
        }
        .stats {
            margin-top: 24px;
            background: linear-gradient(145deg, var(--container-bg-color) 0%, rgba(255,255,255,0.05) 100%);
            padding: 24px;
            border-radius: 16px;
            border: 1px solid rgba(255,255,255,0.1);
            backdrop-filter: blur(10px);
            color: var(--text-color);
            box-shadow: 
                0 8px 32px rgba(0, 0, 0, 0.1),
                0 1px 3px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
        }

        .stats:before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 2px;
            background: linear-gradient(90deg, 
                transparent 0%,
                #10b981 25%,
                #3b82f6 50%,
                #8b5cf6 75%,
                transparent 100%
            );
            border-radius: 16px 16px 0 0;
        }

        .stats:hover {
            transform: translateY(-2px);
            box-shadow: 
                0 12px 40px rgba(0, 0, 0, 0.15),
                0 2px 6px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
        }

        body.dark-mode .stats {
            background: linear-gradient(145deg, var(--container-bg-color) 0%, rgba(0,0,0,0.2) 100%);
            border: 1px solid rgba(255,255,255,0.05);
        }
        .legend {
            display: flex;
            gap: 20px;
            margin: 24px 0;
            justify-content: center;
            flex-wrap: wrap;
            padding: 20px;
            background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
            border-radius: 16px;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,0.1);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        }

        .legend-item {
            display: flex;
            align-items: center;
            font-size: 14px;
            font-weight: 500;
            padding: 8px 12px;
            border-radius: 8px;
            background: rgba(255,255,255,0.1);
            backdrop-filter: blur(5px);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .legend-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        body.dark-mode .legend {
            background: linear-gradient(145deg, rgba(0,0,0,0.2), rgba(0,0,0,0.1));
            border: 1px solid rgba(255,255,255,0.05);
        }

        body.dark-mode .legend-item {
            background: rgba(0,0,0,0.2);
        }
        .legend-color {
            width: 24px;
            height: 24px;
            margin-right: 8px;
            border-radius: 6px;
            border: 2px solid rgba(255,255,255,0.2);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            position: relative;
            overflow: hidden;
        }

        .legend-color:before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
            transition: left 0.5s;
        }

        .legend-item:hover .legend-color:before {
            left: 100%;
        }
        .legend-break {
            background-color: var(--break-bg-color);
        }
        .legend-lunch {
            background-color: var(--lunch-bg-color);
        }
        .legend-unassigned {
            background-color: var(--unassigned-bg-color);
        }
        .legend-security {
            background-color: #ffccbc;
        }
        .legend-night-break {
            background-color: #673ab7;
        }
        .staff-cleaning-duty {
            background-color: #9c27b0; /* Purple color for cleaning duties */
            color: #ffffff; /* White text for contrast */
            font-weight: bold;
        }

        .legend-cleaning-duty {
            background-color: #9c27b0;
        }

        /* Security-only cleaning duties styling */
        .security-only-duty {
            background-color: #dc3545 !important; /* Red background for security-only duties */
            color: #ffffff !important;
            font-weight: bold;
        }

        .security-only-badge {
            background-color: #dc3545;
            color: white;
            padding: 2px 6px;
            border-radius: 3px;
            font-size: 0.8em;
            margin-left: 5px;
            display: inline-block;
        }

        /* Ensure text color is visible for cells with white background in dark mode */
        body.dark-mode td {
            color: var(--text-color); /* Use the light text color defined for dark mode */
        }

        body.dark-mode tr:nth-child(even) td {
            background-color: #374151; /* Dark gray for even rows in dark mode */
            color: var(--table-cell-text-color); /* Ensure text color is visible */
        }

        body.dark-mode tr:nth-child(odd) td {
            background-color: var(--table-cell-bg-color); /* Dark gray for odd rows in dark mode */
            color: var(--table-cell-text-color); /* Ensure text color is visible */
        }

        /* Explicitly set text color for cells with white background */
        body.dark-mode td[style*="background-color: #ffffff"] {
            color: #333333; /* Dark text color for white background */
        }

        /* Ensure headings are clearly visible in dark mode */
        body.dark-mode h1,
        body.dark-mode h2,
        body.dark-mode h3 {
            color: #ffffff !important; /* Force white text for all headings in dark mode */
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); /* Add subtle shadow for better contrast */
        }

        /* Force white text for schedule table in dark mode for better readability */
        body.dark-mode #scheduleTable td,
        body.dark-mode #scheduleTable th,
        body.dark-mode table td,
        body.dark-mode table th {
            color: #ffffff !important; /* Force white text for all table content in dark mode */
        }

        /* Ensure row headers remain visible */
        body.dark-mode .row-header {
            color: #ffffff !important; /* Force white text for row headers */
            font-weight: bold;
        }

        .staff-count {
            padding: 5px; /* Reduce padding */
            border: 1px solid #dfe4ea;
            border-radius: 5px;
            width: 80px; /* Adjust width to save space */
            font-size: 12px; /* Reduce font size */
            background-color: #ffffff;
            box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .staff-count:focus {
            outline: none;
            border-color: #4a69bd;
            box-shadow: 0 0 5px rgba(74, 105, 189, 0.5);
        }

        .error-message {
            position: fixed;
            top: 20px;
            right: 20px;
            background-color: #f44336;
            color: white;
            padding: 15px;
            border-radius: 5px;
            z-index: 1000;
        }

        /* Explicitly set text color for cells when in dark mode */
        body.dark-mode .staff-break {
            background-color: var(--break-bg-color); /* Your dark mode yellow */
            color: #000000; /* Keep black text which contrasts with yellow */
        }

        body.dark-mode .staff-lunch {
            background-color: var(--lunch-bg-color); /* Your dark mode green */
            color: #000000; /* Keep black text which contrasts with green */
        }

        /* Other cells with custom colors in dark mode may need adjustments */
        body.dark-mode td.row-header {
            color: var(--table-header-text-color);
        }

        .rotation-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }

        .rotation-table th, .rotation-table td {
            border: 1px solid #e5e7eb;
            padding: 15px;
            text-align: center;
            font-size: 14px;
        }

        .rotation-table th {
            background-color: var(--table-header-bg-color);
            color: var(--table-header-text-color);
            font-weight: 600;
        }

        /* Universal Floating Label Design for All Inputs */
        .floating-input-container {
            position: relative;
            margin: 10px 0;
            width: 100%;
        }

        .floating-input-field {
            width: 100%;
            padding: 15px 15px 8px 15px;
            border: 2px solid #e1e5e9;
            border-radius: 12px;
            font-size: 16px;
            background: #ffffff;
            color: #333;
            outline: none;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-sizing: border-box;
        }

        .floating-input-field:focus {
            border-color: #4f46e5;
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
            transform: translateY(-2px);
        }

        .floating-input-label {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 16px;
            color: #999;
            pointer-events: none;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            background: #ffffff;
            padding: 0 5px;
            border-radius: 4px;
        }

        .floating-input-field:focus + .floating-input-label,
        .floating-input-field:not(:placeholder-shown) + .floating-input-label {
            top: 0;
            transform: translateY(-50%);
            font-size: 12px;
            color: #4f46e5;
            font-weight: 600;
            background: linear-gradient(to bottom, transparent 50%, #ffffff 50%);
        }

        .floating-input-field::placeholder {
            color: transparent;
        }

        /* Dark mode support for universal floating inputs */
        body.dark-mode .floating-input-field {
            background: #2d3748;
            color: #e2e8f0;
            border-color: #4a5568;
        }

        body.dark-mode .floating-input-field:focus {
            border-color: #6366f1;
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        }

        body.dark-mode .floating-input-label {
            color: #a0aec0;
            background: #2d3748;
        }

        body.dark-mode .floating-input-field:focus + .floating-input-label,
        body.dark-mode .floating-input-field:not(:placeholder-shown) + .floating-input-label {
            color: #6366f1;
            background: linear-gradient(to bottom, transparent 50%, #2d3748 50%);
        }

        /* Modern UIVerse-style input field for security staff */
        .security-input-container {
            position: relative;
            margin: 10px 0;
            width: 100%;
        }

        .security-input-field {
            width: 100%;
            padding: 15px 15px 8px 15px;
            border: 2px solid #e1e5e9;
            border-radius: 12px;
            font-size: 16px;
            background: #ffffff;
            color: #333;
            outline: none;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-sizing: border-box;
        }

        .security-input-field:focus {
            border-color: #4f46e5;
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
            transform: translateY(-2px);
        }

        .security-input-label {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 16px;
            color: #999;
            pointer-events: none;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            background: #ffffff;
            padding: 0 5px;
            border-radius: 4px;
        }

        .security-input-field:focus + .security-input-label,
        .security-input-field:not(:placeholder-shown) + .security-input-label {
            top: 0;
            transform: translateY(-50%);
            font-size: 12px;
            color: #4f46e5;
            font-weight: 600;
            background: linear-gradient(to bottom, transparent 50%, #ffffff 50%);
        }

        .security-input-field::placeholder {
            color: transparent;
        }

        /* Dark mode support for security input */
        body.dark-mode .security-input-field {
            background: #2d3748;
            color: #e2e8f0;
            border-color: #4a5568;
        }

        body.dark-mode .security-input-field:focus {
            border-color: #6366f1;
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        }

        body.dark-mode .security-input-label {
            color: #a0aec0;
            background: #2d3748;
        }

        body.dark-mode .security-input-field:focus + .security-input-label,
        body.dark-mode .security-input-field:not(:placeholder-shown) + .security-input-label {
            color: #6366f1;
            background: linear-gradient(to bottom, transparent 50%, #2d3748 50%);
        }

        /* Enhanced security container with modern styling */
        .security-container {
            display: flex;
            align-items: center;
            gap: 15px;
            /* padding: 20px; */
            /* background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%); */
            /* border: 1px solid #e2e8f0; */
            border-radius: 16px;
            /* margin-bottom: 15px; */
            transition: all 0.3s ease;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
        }

        .security-container:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
            border-color: #cbd5e1;
        }

        body.dark-mode .security-container {
            /* background: linear-gradient(135deg, #1e293b 0%, #334155 100%); */
            border-color: #475569;
        }

        body.dark-mode .security-container:hover {
            border-color: #64748b;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        /* 
        FUTURE DESIGN REFERENCE - NEBULA THEME FOR NURSE INPUTS:
        
        Beautiful space/nebula themed input design with:
        - Dark cosmic background (#00000f)
        - Purple glow effects on focus
        - 6 floating particles per input with color transitions
        - Smooth floating labels
        - Multi-layered shadow effects
        - CSS animations for particle movement
        
        Design components:
        .nebula-input - Main container
        .nebula-input .input - Dark input field with purple glow
        .user-label - Floating label animation
        .nebula-particle - Animated floating particles
        @keyframes nebula-float - Particle animation
        
        Note: This design creates stunning sci-fi aesthetics but was reverted 
        for simplicity. Can be re-implemented when advanced styling is desired.
        
        BRUTALIST THEME REFERENCE:
        
        Bold industrial design with:
        - Thick black borders (4px solid)
        - Dramatic double shadows (black + blue)
        - Glitch animations on focus
        - Monospace typography
        - Angled labels with rotation
        - High contrast styling
        
        Note: This design was too flashy and distracting for healthcare application.
        Reverted for better usability and professional appearance.
        
        ANIMATED BORDER THEME FOR NURSE INPUTS:
        
        Clean underline animation design with:
        - Transparent background with subtle shadow
        - Animated gradient border (red, orange, blue)
        - Smooth cubic-bezier transitions
        - Professional appearance suitable for healthcare
        */
        
        /* Universal Animated Border Design for All Inputs */
        .animated-form-control {
            position: relative;
            margin-bottom: 20px;
        }
        
        .animated-form-control label {
            font-weight: bold;
            color: #2c3e50;
            display: block;
            margin-bottom: 8px;
        }
        
        .animated-input {
            color: #2c3e50;
            font-size: 0.9rem;
            background-color: transparent;
            width: 250px;
            box-sizing: border-box;
            padding-inline: 0.5em;
            padding-block: 0.7em;
            border: none;
            border-bottom: 2px solid #ddd;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        
        .animated-input-border {
            position: absolute;
            background: linear-gradient(90deg, #FF6464 0%, #FFBF59 50%, #47C9FF 100%);
            width: 0%;
            height: 2px;
            bottom: 0;
            left: 0;
            transition: width 0.4s cubic-bezier(0.42, 0, 0.58, 1.00);
        }
        
        .animated-input:focus {
            outline: none;
        }
        
        .animated-input:focus + .animated-input-border {
            width: 100%;
        }
        
        /* Dark mode support for animated inputs */
        body.dark-mode .animated-form-control label {
            color: #f9fafb;
        }
        
        body.dark-mode .animated-input {
            color: #f9fafb;
            border-bottom: 2px solid #6b7280;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        }
        
        body.dark-mode .animated-input::placeholder {
            color: #9ca3af;
        }
        
        /* Nurse inputs using universal floating label design */
        .nurse-form-control {
            position: relative;
            margin-bottom: 20px;
        }
        
        .nurse-input {
            width: 250px;
            padding: 15px 15px 8px 15px;
            border: 2px solid #e1e5e9;
            border-radius: 12px;
            font-size: 16px;
            background: #ffffff;
            color: #333;
            outline: none;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-sizing: border-box;
        }
        
        .nurse-input:focus {
            border-color: #4f46e5;
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
            transform: translateY(-2px);
        }
        
        .nurse-input-label {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 16px;
            color: #999;
            pointer-events: none;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            background: #ffffff;
            padding: 0 5px;
            border-radius: 4px;
        }
        
        .nurse-input:focus + .nurse-input-label,
        .nurse-input:not(:placeholder-shown) + .nurse-input-label {
            top: 0;
            transform: translateY(-50%);
            font-size: 12px;
            color: #4f46e5;
            font-weight: 600;
            background: linear-gradient(to bottom, transparent 50%, #ffffff 50%);
        }
        
        .nurse-input::placeholder {
            color: transparent;
        }
        
        /* Dark mode support for nurse inputs */
        body.dark-mode .nurse-input {
            background: #2d3748;
            color: #e2e8f0;
            border-color: #4a5568;
        }
        
        body.dark-mode .nurse-input:focus {
            border-color: #6366f1;
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        }
        
        body.dark-mode .nurse-input-label {
            color: #a0aec0;
            background: #2d3748;
        }
        
        body.dark-mode .nurse-input:focus + .nurse-input-label,
        body.dark-mode .nurse-input:not(:placeholder-shown) + .nurse-input-label {
            color: #6366f1;
            background: linear-gradient(to bottom, transparent 50%, #2d3748 50%);
        }

        /* Staff selection popup */
        #staffPopup {
            display: none;
            position: fixed;
            top: 30%;
            left: 50%;
            transform: translate(-50%, -30%);
            background-color: var(--container-bg-color);
            color: var(--text-color);
            border: 2px solid var(--button-bg-color);
            border-radius: 8px;
            z-index: 2000;
            padding: 20px;
            min-width: 300px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
        }

        #staffPopup h3 {
            margin-top: 0;
        }

        #staffList {
            max-height: 300px;
            overflow-y: auto;
            margin: 15px 0;
        }

        /* Conflict staff button styling */
        .conflict-staff {
            animation: conflict-pulse 2s infinite;
            border: 2px solid #721c24 !important;
        }

        .conflict-staff:hover {
            background-color: #c82333 !important;
            transform: scale(1.02);
        }

        @keyframes conflict-pulse {
            0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
            70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
            100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
        }

        /* Staff role indicators in popup */
        .select-staff-btn:contains("Nurse in Charge") {
            position: relative;
        }

        .select-staff-btn[data-role="nurse"]:not(.conflict-staff) {
            border-left: 4px solid #2196f3 !important;
            background: linear-gradient(90deg, rgba(33, 150, 243, 0.1) 0%, var(--button-bg-color) 20%) !important;
        }

        .select-staff-btn[data-role="security"]:not(.conflict-staff) {
            border-left: 4px solid #ff9800 !important;
            background: linear-gradient(90deg, rgba(255, 152, 0, 0.1) 0%, var(--button-bg-color) 20%) !important;
        }

        /* Handover Setup Styles */
        .handover-controls {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .handover-controls label {
            font-weight: 500;
            color: var(--table-cell-text-color);
        }

        .handover-controls select {
            padding: 8px 12px;
            border: 2px solid var(--input-border-color);
            border-radius: 6px;
            background-color: var(--input-bg-color);
            color: var(--table-cell-text-color);
        }

        #handoverTable {
            overflow-x: auto;
        }

        .handover-cell {
            cursor: pointer;
            position: relative;
            min-height: 40px;
            padding: 8px;
            text-align: center;
            border: 2px dashed #ddd;
            transition: all 0.3s ease;
        }

        .handover-cell:hover {
            background-color: #f0f8ff;
            border-color: #2196f3;
        }

        .handover-cell.assigned {
            background-color: #e8f5e8;
            border: 2px solid #28a745;
            border-style: solid;
        }

        .handover-cell.locked {
            background-color: #fff3cd;
            border: 2px solid #ffc107;
            position: relative;
        }

        .handover-cell.locked::after {
            content: "🔒";
            position: absolute;
            top: 2px;
            right: 4px;
            font-size: 12px;
        }

        .handover-patient-header {
            background-color: #e3f2fd;
            color: #1976d2;
            font-weight: bold;
            text-align: center;
            padding: 10px;
        }

        /* Locked assignment indicators in main schedule */
        .locked-assignment {
            position: relative;
            background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, transparent 100%) !important;
            border-left: 3px solid #ffc107 !important;
        }

        .locked-assignment::before {
            content: "🔒";
            position: absolute;
            top: 2px;
            right: 2px;
            font-size: 10px;
            z-index: 10;
        }

        /* Responsive handover popup */
        @media (max-width: 768px) {
            #handoverPopup {
                top: 2% !important;
                left: 5% !important;
                right: 5% !important;
                transform: none !important;
                min-width: auto !important;
                max-width: 90% !important;
                width: 90% !important;
                max-height: 95vh !important;
            }
            
            .handover-controls {
                flex-direction: column !important;
                align-items: flex-start !important;
                gap: 10px !important;
            }
            
            .handover-controls select {
                width: 100% !important;
                max-width: 250px !important;
            }
        }

        /* Popup stacking z-index management */
        .popup-level-1 { z-index: 1000; }
        .popup-level-2 { z-index: 2000; }
        .popup-level-3 { z-index: 3000; }

        /* Break adjustment controls */
        .break-adjustment-controls {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .break-adjustment-controls .action-button {
            padding: 8px 16px;
            font-size: 14px;
            margin: 0;
        }

        .action-button {
            background-color: var(--button-bg-color);
            color: white;
            border: none;
            border-radius: 6px;
            padding: 10px 16px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: background-color 0.3s ease;
            margin-right: 10px;
        }

        .action-button:hover {
            background-color: var(--button-hover-bg-color);
        }

        #editableBreakTable {
            width: 100%;
            border-collapse: collapse;
            margin-top: 10px;
        }

        #editableBreakTable th,
        #editableBreakTable td {
            border: 1px solid #e5e7eb;
            padding: 12px;
            text-align: center;
            font-size: 14px;
        }

        #editableBreakTable th {
            background-color: var(--table-header-bg-color);
            color: var(--table-header-text-color);
            font-weight: 600;
        }

        #editableBreakTable td {
            background-color: var(--table-cell-bg-color);
            color: var(--table-cell-text-color);
        }

        .break-time-select {
            padding: 4px 8px;
            border: 1px solid #ccc;
            border-radius: 4px;
            background-color: var(--container-bg-color);
            color: var(--text-color);
            font-size: 13px;
            width: 100%;
            max-width: 120px;
        }

        .staff-break-actions {
            display: flex;
            gap: 5px;
            justify-content: center;
        }

        .staff-break-actions button {
            padding: 4px 8px;
            font-size: 12px;
            border: none;
            border-radius: 3px;
            cursor: pointer;
            color: white;
        }

        .reset-staff-btn {
            background-color: #f59e0b;
        }

        .reset-staff-btn:hover {
            background-color: #d97706;
        }

        /* Dark mode adjustments for break controls */
        body.dark-mode .break-time-select {
            background-color: var(--table-cell-bg-color);
            border-color: #6b7280;
        }

        body.dark-mode #editableBreakTable th {
            border-color: #6b7280;
        }

        body.dark-mode #editableBreakTable td {
            border-color: #6b7280;
        }

        /* Add any additional styles for the popup here */