:root {
    --primary: #0d6efd;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
}
body {
    background-color: #f8f9fa;
}
.navbar-brand img {
    margin-right: 10px;
}
.notifications-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 9999;
    max-width: 350px;
}
.notification {
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease;
}
.notification.success { background-color: var(--success); }
.notification.error { background-color: var(--danger); }
.notification.info { background-color: var(--primary); }
.notification.warning { background-color: var(--warning); color: #000; }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.section { display: none; }
.section.active { display: block; }
.modal-body .row { margin-bottom: 10px; }

/* Responsive Machine List */
#machineListContainer {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
}

@media (max-width: 768px) {
    #machineListContainer {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    #machineListContainer {
        max-height: 250px;
    }
}

/* Machine item styling */
.machine-item {
    transition: all 0.2s ease;
}

.machine-item.active {
    background-color: #e3f2fd !important;
    border-left: 3px solid var(--primary);
}

.machine-item.active .fw-bold {
    color: var(--primary) !important;
}

.machine-item.active .text-muted {
    color: var(--primary-dark) !important;
}

/* Checkbox dropdown styles */
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.border.rounded {
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
}

/* Modal responsive adjustments */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    .modal-body {
        padding: 1rem;
    }
}
.device-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.device-card:hover {
    transform: translateY(-2px);
}

.device-card .badge {
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
    text-align: center;
}

.device-card .badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Task Hazard Items */
.task-hazard-item {
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.task-hazard-item:hover {
    background-color: var(--bg-secondary);
    transform: translateX(5px);
}

/* Risk Level Badge Colors */
.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
}
/* Task Hazard Badges */
.task-hazard-badge {
    transition: transform 0.2s, box-shadow 0.2s;
}

.task-hazard-badge:hover {
    transform: translateY(-2px);
}

.task-hazard-badge .badge {
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    padding: 8px 12px;
}

.task-hazard-badge .badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Multi-select dropdown styling */
select[multiple] {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
}

select[multiple] option {
    padding: 8px;
    margin: 2px 0;
    border-radius: 4px;
}

select[multiple] option:checked {
    background-color: var(--primary) linear-gradient(0deg, var(--primary) 0%, var(--primary) 100%);
    color: white;
}

select[multiple] option:hover {
    background-color: var(--bg-secondary);
}
/* ===================================================
   MultiComboBox Component — append to style.css
   =================================================== */

.mcb-wrapper {
    position: relative;
    width: 100%;
}

.mcb-pillbox {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-height: 42px;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    cursor: text;
    transition: border-color 0.15s;
}

.mcb-pillbox:focus-within {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,.25);
    outline: none;
}

.mcb-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #0d6efd;
    color: #fff;
    border-radius: 20px;
    padding: 2px 10px 2px 10px;
    font-size: 13px;
    font-weight: 500;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mcb-pill-other {
    background: #6610f2;
}

.mcb-pill-remove {
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    opacity: 0.8;
    flex-shrink: 0;
}

.mcb-pill-remove:hover { opacity: 1; }

.mcb-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 120px;
    font-size: 14px;
    background: transparent;
    padding: 0;
}

.mcb-dropdown {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    z-index: 1055;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    max-height: 220px;
    overflow-y: auto;
}

.mcb-dropdown-item {
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.1s;
}

.mcb-dropdown-item:hover {
    background: #e9f0ff;
}

.mcb-other-option {
    color: #6610f2;
    font-style: italic;
    border-top: 1px solid #dee2e6;
    margin-top: 4px;
}

.mcb-dropdown-empty {
    padding: 10px 12px;
    color: #6c757d;
    font-size: 13px;
    font-style: italic;
}

.mcb-other-input {
    font-size: 13px;
}

/* Dark-mode compatibility */
[data-bs-theme="dark"] .mcb-pillbox {
    background: #212529;
    border-color: #495057;
    color: #fff;
}

[data-bs-theme="dark"] .mcb-dropdown {
    background: #2b2f33;
    border-color: #495057;
}

[data-bs-theme="dark"] .mcb-dropdown-item:hover {
    background: #343a40;
}

[data-bs-theme="dark"] .mcb-input {
    color: #fff;
}

/* New */

/* RA Report Cards */
#raReportModal .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1) !important;
}

#raReportModal .risk-high {
    background-color: #dc3545 !important;
    color: white !important;
}

#raReportModal .risk-medium {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

#raReportModal .risk-low {
    background-color: #28a745 !important;
    color: white !important;
}

#raReportModal .risk-negligible {
    background-color: #6c757d !important;
    color: white !important;
}

#raReportModal .stat-card {
    transition: transform 0.2s;
}

#raReportModal .stat-card:hover {
    transform: translateY(-2px);
}

/* Duplication Loading Overlay */
.duplication-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.duplication-modal {
    background: linear-gradient(135deg, #0f1724, #0a0e17);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    padding: 2rem 2.5rem;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.duplication-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.duplication-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.duplication-message {
    font-size: 0.85rem;
    color: #9bb7d0;
    margin-bottom: 1rem;
}

.duplication-progress {
    margin-top: 1rem;
}

.duplication-progress-text {
    font-size: 0.75rem;
    color: #6b8fa8;
    font-family: monospace;
}

.duplication-success {
    color: #22c55e;
}

.duplication-error {
    color: #ef4444;
}
/* Duplication Name Modal Styles */
.duplication-name-modal.modal {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.7);
}

.duplication-name-modal .modal-content {
    background: linear-gradient(135deg, #0f1724, #0a0e17);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #eef4ff;
    box-shadow: 0 24px 64px rgba(0,0,0,0.8), 0 0 0 1px rgba(59,130,246,0.1);
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.duplication-name-modal .modal-header {
    background: linear-gradient(135deg, #0f1724, #0a0e17);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    padding: 1.25rem 1.5rem;
    border-radius: 20px 20px 0 0;
}

.duplication-name-modal .modal-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #3b82f6;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.duplication-name-modal .modal-title i {
    font-size: 1.2rem;
    background: rgba(59, 130, 246, 0.15);
    padding: 8px;
    border-radius: 12px;
}

.duplication-name-modal .btn-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 1;
    filter: none;
}

.duplication-name-modal .btn-close::before {
    content: '✕';
    color: #9bb7d0;
    font-size: 0.85rem;
}

.duplication-name-modal .btn-close:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.duplication-name-modal .btn-close:hover::before {
    color: #3b82f6;
}

.duplication-name-modal .modal-body {
    padding: 1.5rem;
    background: #0c1924;
}

.duplication-info-box {
    background: #0f202d;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.duplication-info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.duplication-info-row:last-child {
    border-bottom: none;
}

.duplication-info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9bb7d0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.duplication-info-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: #eef4ff;
    font-family: monospace;
}

.duplication-input-group {
    margin-bottom: 1rem;
}

.duplication-input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9bb7d0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.duplication-input-group label i {
    margin-right: 0.5rem;
    color: #3b82f6;
}

.duplication-input-field {
    width: 100%;
    background: #0f202d;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: #eef4ff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.duplication-input-field:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: #0a1822;
}

.duplication-input-field::placeholder {
    color: #5f7f99;
}

.duplication-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 10px;
    padding: 0.75rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #fbbf24;
}

.duplication-warning i {
    font-size: 0.9rem;
}

.duplication-name-modal .modal-footer {
    background: #0a1724;
    border-top: 1px solid rgba(59, 130, 246, 0.2);
    padding: 1rem 1.5rem;
    border-radius: 0 0 20px 20px;
    gap: 0.75rem;
}

.btn-duplicate-cancel {
    background: transparent;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    color: #9bb7d0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-duplicate-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #eef4ff;
    border-color: rgba(59, 130, 246, 0.5);
}

.btn-duplicate-confirm {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

.btn-duplicate-confirm:hover:not(:disabled) {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    box-shadow: 0 4px 18px rgba(59, 130, 246, 0.55);
    transform: translateY(-1px);
}

.btn-duplicate-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Validation styles */
.duplication-input-field.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
    color: #ef4444;
    font-size: 0.7rem;
    margin-top: 0.25rem;
    display: block;
}
/* Reusable Delete Confirmation Modal */
.delete-confirm-modal.modal {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.7);
}

.delete-confirm-modal .modal-content {
    background: linear-gradient(135deg, #0f1724, #0a0e17);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 20px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #eef4ff;
    box-shadow: 0 24px 64px rgba(0,0,0,0.8), 0 0 0 1px rgba(239,68,68,0.2);
    animation: deleteModalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.delete-confirm-modal .modal-header {
    background: linear-gradient(135deg, #1a0f0f, #2a1212);
    border-bottom: 1px solid rgba(239, 68, 68, 0.25);
    padding: 1.25rem 1.5rem;
    border-radius: 20px 20px 0 0;
}

.delete-confirm-modal .modal-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.delete-confirm-modal .modal-title i {
    font-size: 1.2rem;
}

.delete-confirm-modal .btn-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 1;
    filter: none;
}

.delete-confirm-modal .btn-close::before {
    content: '✕';
    color: #9bb7d0;
    font-size: 0.85rem;
}

.delete-confirm-modal .btn-close:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
}

.delete-confirm-modal .btn-close:hover::before {
    color: #ef4444;
}

.delete-confirm-modal .modal-body {
    padding: 1.5rem;
    background: #0c1924;
}

.delete-warning-icon {
    width: 56px;
    height: 56px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: #ef4444;
}

.delete-heading {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.delete-subtext {
    text-align: center;
    font-size: 0.8rem;
    color: #9bb7d0;
    margin-bottom: 1.25rem;
}

.delete-record-info {
    background: #0f202d;
    border: 1px solid rgba(56, 139, 180, 0.2);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 0;
}

.delete-record-info .info-row {
    display: flex;
    gap: 0.75rem;
    padding: 0.35rem 0;
    color: #eef4ff;
}

.delete-record-info .info-label {
    font-weight: 700;
    color: #9bb7d0;
    min-width: 85px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.delete-record-info .info-value {
    color: #eef4ff;
    font-weight: 500;
    word-break: break-word;
}

.delete-warning-text {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    padding: 0.75rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #f87171;
}

.delete-warning-text i {
    font-size: 0.85rem;
}

.delete-confirm-modal .modal-footer {
    background: #0a1724;
    border-top: 1px solid rgba(56, 139, 180, 0.2);
    padding: 1rem 1.5rem;
    border-radius: 0 0 20px 20px;
    gap: 0.75rem;
}

.btn-cancel-delete-item {
    background: transparent;
    border: 1px solid rgba(56, 139, 180, 0.3);
    border-radius: 10px;
    color: #9bb7d0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-delete-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #eef4ff;
    border-color: rgba(56, 139, 180, 0.5);
}

.confirm-delete-item-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

.confirm-delete-item-btn:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.55);
    transform: translateY(-1px);
}

.confirm-delete-item-btn:active {
    transform: translateY(0);
}

/* Delete modal button styles */
.btn-cancel-delete {
    background: transparent;
    border: 1px solid rgba(56, 139, 180, 0.3);
    border-radius: 10px;
    color: #9bb7d0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-delete:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #eef4ff;
    border-color: rgba(56, 139, 180, 0.5);
}

.confirm-delete-machine-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

.confirm-delete-machine-btn:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.55);
    transform: translateY(-1px);
}
/* Collaboration Floating Panel */
#collabPanel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background: var(--c-surface, #0d1a26);
    border: 1px solid var(--c-border, rgba(56,139,180,0.18));
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 1050;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}
#collabPanel .collab-header {
    padding: 8px 12px;
    background: linear-gradient(135deg, #0f1724, #0a0e17);
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: #eef4ff;
}
#collabPanel .collab-toggle {
    background: none;
    border: none;
    color: #9bb7d0;
    cursor: pointer;
}
#collabPanel .collab-body {
    padding: 8px 12px;
    max-height: 400px;
    overflow-y: auto;
}
#collabPanel .collab-body.collapsed {
    display: none;
}
#collabPanel .collab-section {
    margin-bottom: 12px;
}
#collabPanel .collab-label {
    font-size: 10px;
    text-transform: uppercase;
    color: #9bb7d0;
    margin-bottom: 6px;
    font-weight: 600;
}
#collabPanel .collab-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#collabPanel .collab-user, .collab-session {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 6px 8px;
}
#collabPanel .collab-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    color: white;
    flex-shrink: 0;
}
#collabPanel .collab-session-detail {
    line-height: 1.3;
    color: #eef4ff;
}
#collabPanel .collab-empty {
    color: #6b8fa8;
    font-style: italic;
    padding: 4px 0;
    text-align: center;
}


/* MultiSelectDropdown - modern checkbox dropdown */
.msd-wrapper {
    position: relative;
    width: 100%;
}

.msd-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.msd-button:hover {
    border-color: #86b7fe;
    background: #f8f9fa;
}

.msd-button.active {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,0.25);
}

.msd-button-text {
    flex: 1;
    text-align: left;
    color: #212529;
}

.msd-badge {
    background: #0d6efd;
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0 8px;
}

.msd-arrow {
    color: #6c757d;
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.msd-button.active .msd-arrow {
    transform: rotate(180deg);
}

.msd-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    z-index: 1060;
    max-height: 320px;
    overflow-y: auto;
}

.msd-search {
    width: calc(100% - 20px);
    margin: 10px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #212529;
    background: #fff;
}

.msd-search:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,0.25);
}

.msd-actions {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
}

.msd-action-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 6px;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    color: #0d6efd;
}

.msd-action-btn:hover {
    background: #f1f3f5;
}

.msd-options {
    max-height: 220px;
    overflow-y: auto;
}

.msd-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.1s;
    color: #212529;
}

.msd-option:hover {
    background: #f8f9fa;
}

/* SELECTED ITEM STYLES - NAVY BLUE TEXT */
.msd-option.selected {
    background: #e8f0fe;  /* Light blue background for selected items */
}

.msd-option.selected .msd-option-label {
    color: #000080;  /* Navy blue text color */
    font-weight: 500;  /* Slightly bold for emphasis */
}

.msd-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

/* Style for checked checkboxes to match navy theme */
.msd-option input[type="checkbox"]:checked {
    accent-color: #000080;  /* Navy blue checkbox when checked */
}

.msd-option-label {
    flex: 1;
    font-size: 0.9rem;
    cursor: pointer;
    color: #212529;
    transition: color 0.2s ease;
}

.msd-empty {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
}

.msd-other-input {
    margin: 8px 12px;
    width: calc(100% - 24px);
    color: #212529;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 8px 12px;
}

/* Dark mode support */
[data-bs-theme="dark"] .msd-button {
    background: #2b2f33;
    border-color: #495057;
    color: #e9ecef;
}

[data-bs-theme="dark"] .msd-button-text {
    color: #e9ecef;
}

[data-bs-theme="dark"] .msd-dropdown {
    background: #2b2f33;
    border-color: #495057;
}

[data-bs-theme="dark"] .msd-search {
    background: #212529;
    border-color: #495057;
    color: #e9ecef;
}

[data-bs-theme="dark"] .msd-option {
    color: #e9ecef;
}

[data-bs-theme="dark"] .msd-option:hover {
    background: #343a40;
}

[data-bs-theme="dark"] .msd-option-label {
    color: #e9ecef;
}

/* Dark mode selected items - lighter navy for dark background */
[data-bs-theme="dark"] .msd-option.selected {
    background: #1a2a3a;
}

[data-bs-theme="dark"] .msd-option.selected .msd-option-label {
    color: #6ea8fe;  /* Lighter blue for dark mode visibility */
}

[data-bs-theme="dark"] .msd-option input[type="checkbox"]:checked {
    accent-color: #6ea8fe;
}

[data-bs-theme="dark"] .msd-other-input {
    background: #212529;
    border-color: #495057;
    color: #e9ecef;
}

/* Touch optimisation */
@media (max-width: 768px) {
    .msd-button {
        padding: 12px 14px;
        font-size: 1rem;
    }
    .msd-option {
        padding: 12px 14px;
    }
    .msd-option input[type="checkbox"] {
        width: 22px;
        height: 22px;
    }
}

/* Add to your style.css file */
.editor-modal.modal {
    z-index: 2000 !important;
}

.editor-modal .modal-backdrop {
    z-index: 1999 !important;
}

/* Save All button specific hover */
#saveAllNCBtn:hover:not(:disabled) {
    background: linear-gradient(135deg, #4ade80, #22c55e) !important;
    box-shadow: 0 4px 16px rgba(34,197,94,0.45) !important;
    transform: translateY(-1px);
}
#srsModal input[type="radio"] {
  accent-color: var(--accent);
  margin-right: 5px;
}

.sa-radio-group {
  display: flex;
  gap: 1.5rem;
  margin-top: 4px;
}
.sa-radio-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: .875rem;
  color: var(--sa-ink);
}
.sa-radio-label input[type="radio"] {
  accent-color: var(--sa-primary);
  width: 16px;
  height: 16px;
  margin-right: 6px;
}

/* ==================== ADMIN LOGIN MODAL ==================== */
.admin-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.3s ease-out;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.admin-login-modal {
    background: linear-gradient(135deg, #0f1724, #0a0e17);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    animation: scaleInModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleInModal {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.admin-login-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #1e6f9f, #124e72);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.8rem;
    color: #3daee0;
    box-shadow: 0 0 0 4px rgba(46, 143, 192, 0.2);
}

.admin-login-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.admin-login-subtitle {
    font-size: 0.85rem;
    color: #9bb7d0;
    margin-bottom: 1.5rem;
}

.admin-login-field {
    margin-bottom: 1.2rem;
    text-align: left;
}

.admin-login-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9bb7d0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.admin-login-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #0f202d;
    border: 1px solid rgba(56, 139, 180, 0.3);
    border-radius: 10px;
    color: #eef4ff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    outline: none;
}

.admin-login-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: #0a1822;
}

.admin-login-input::placeholder {
    color: #5f7f99;
}

.admin-login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    color: #f87171;
    font-size: 0.8rem;
    display: none;
    text-align: center;
}

.admin-login-error.show {
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

.admin-login-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.admin-login-btn {
    flex: 1;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.admin-login-btn-cancel {
    background: transparent;
    border: 1px solid rgba(56, 139, 180, 0.3);
    color: #9bb7d0;
}

.admin-login-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #eef4ff;
}

.admin-login-btn-submit {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

.admin-login-btn-submit:hover {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.55);
    transform: translateY(-1px);
}

.admin-login-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.admin-login-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.admin-tab {
    background: none;
    border: none;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: all 0.2s;
}
.admin-tab.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    background: rgba(46, 143, 192, 0.1);
}
/* Ensure task list modal inherits page styles */
#taskListModal .modal-content {
    background: var(--bg-primary, #0d1117);
    color: var(--text-primary, #e6edf3);
}

#taskListModal .form-select,
#taskListModal .form-control {
    background-color: var(--bg-card, #1c2230) !important;
    color: var(--text-primary, #e6edf3) !important;
    border-color: var(--border, rgba(255,255,255,0.07)) !important;
}

/* Fix dark mode compatibility */
[data-bs-theme="light"] #taskListModal .modal-content {
    background: #ffffff;
    color: #212529;
}

[data-bs-theme="light"] #taskListModal .form-select,
[data-bs-theme="light"] #taskListModal .form-control {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-color: #ced4da !important;
}

/* ==================== TASK LIST MODAL OVERRIDES ==================== */
#taskListModal .modal-content {
    background: #0d1117 !important;
    border: 1px solid rgba(255,255,255,0.07) !important;
}

#taskListModal .form-select,
#taskListModal .form-control,
#taskListModal select {
    background-color: #1c2230 !important;
    color: #e6edf3 !important;
    border-color: rgba(255,255,255,0.07) !important;
}

#taskListModal .form-select:focus,
#taskListModal .form-control:focus,
#taskListModal select:focus {
    border-color: rgba(59,130,246,0.5) !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.25) !important;
    background-color: #212a3a !important;
}

/* Light theme support for task list */
[data-bs-theme="light"] #taskListModal .modal-content {
    background: #ffffff !important;
    color: #212529 !important;
    border-color: #dee2e6 !important;
}

[data-bs-theme="light"] #taskListModal .form-select,
[data-bs-theme="light"] #taskListModal .form-control,
[data-bs-theme="light"] #taskListModal select {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-color: #ced4da !important;
}

[data-bs-theme="light"] #taskListModal .form-select:focus,
[data-bs-theme="light"] #taskListModal .form-control:focus {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,0.25) !important;
    background-color: #ffffff !important;
}

[data-bs-theme="light"] #taskListModal .modal-header {
    background: linear-gradient(135deg, #f0f4f8, #e8ecf0) !important;
    border-bottom-color: #dee2e6 !important;
}

[data-bs-theme="light"] #taskListModal .modal-title {
    color: #212529 !important;
}

[data-bs-theme="light"] #taskListModal .modal-title .machine-badge {
    color: #0d6efd !important;
    background: rgba(13,110,253,0.1) !important;
    border-color: rgba(13,110,253,0.3) !important;
}

[data-bs-theme="light"] #taskListModal .tl-controls-bar {
    background: #f8f9fa !important;
    border-bottom-color: #dee2e6 !important;
}

[data-bs-theme="light"] #taskListModal .tl-zones-row {
    background: #ffffff !important;
    border-bottom-color: #dee2e6 !important;
}

[data-bs-theme="light"] .zone-tab {
    color: #6c757d !important;
    border-color: #dee2e6 !important;
}

[data-bs-theme="light"] .zone-tab:hover {
    background: rgba(13,110,253,0.1) !important;
    color: #0d6efd !important;
    border-color: #86b7fe !important;
}

[data-bs-theme="light"] .zone-tab.active {
    background: #0d6efd !important;
    color: #fff !important;
}

[data-bs-theme="light"] #taskListModal .modal-footer {
    background: #f8f9fa !important;
    border-top-color: #dee2e6 !important;
}

[data-bs-theme="light"] #taskListModal .tl-label {
    color: #6c757d !important;
}

[data-bs-theme="light"] #taskListModal .tl-zones-label {
    color: #6c757d !important;
}

[data-bs-theme="light"] #taskHazardTable thead th {
    background: #f8f9fa !important;
    color: #6c757d !important;
    border-bottom-color: #dee2e6 !important;
    border-right-color: #dee2e6 !important;
}

[data-bs-theme="light"] #taskHazardTable tbody td {
    color: #212529 !important;
    border-right-color: #dee2e6 !important;
}

[data-bs-theme="light"] #taskHazardTable tbody tr {
    border-bottom-color: #dee2e6 !important;
}

[data-bs-theme="light"] #taskHazardTable tbody tr:hover {
    background: #f8f9fa !important;
}

[data-bs-theme="light"] .tl-btn-ghost {
    color: #6c757d !important;
    border-color: #dee2e6 !important;
}

[data-bs-theme="light"] .tl-btn-ghost:hover {
    background: #f8f9fa !important;
    color: #212529 !important;
}

/* Project Header Row - fixed text (no marquee) */
#projectHeaderRow {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
    background: linear-gradient(135deg, #1a3a5c, #2e6b8f) !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    color: #ffffff !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.project-name-text {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    opacity: 0.9;
}

/* Remove marquee animation */
.project-name-text.marquee {
    animation: none !important;
    padding-left: 0 !important;
}

/* Dark mode support */
body.dark-mode #projectHeaderRow {
    background: linear-gradient(135deg, #0d1f30, #1a3d55) !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #projectHeaderRow {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 16px;
        margin-bottom: 16px;
    }
    
    .project-title {
        font-size: 1.1rem !important;
    }
    
    .project-name-display {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .project-name-text {
        font-size: 0.85rem !important;
    }
}