/**
 * Process Builder V2 - Enterprise Modal Styles
 * Two-tab layout with Device Processes and Journey Builder tabs
 * Enhanced for better UX and larger display
 */

/* ===== BOX SIZING RESET FOR MODAL ===== */

#process-builder-modal,
#process-builder-modal *,
#process-builder-modal *::before,
#process-builder-modal *::after {
    box-sizing: border-box;
}

/* ===== GLOBAL SELECT STYLING FOR DARK THEME ===== */

#process-builder-modal select {
    background-color: #1a1a2e !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#process-builder-modal select option {
    background-color: #1a1a2e !important;
    color: #ffffff !important;
    padding: 8px;
}

#process-builder-modal select:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.6);
    box-shadow: 0 0 0 2px rgba(79, 116, 229, 0.15);
}

/* ===== FORCE FULL WIDTH ON ALL CONTAINERS ===== */

#process-builder-modal .modal-dialog,
#process-builder-modal .modal-content,
#process-builder-modal .modal-body,
#process-builder-modal .pb-tabs,
#process-builder-modal .pb-tab-content,
#process-builder-modal .pb-tab-pane,
#process-builder-modal .pb-tab-pane.active,
#process-builder-modal .pb-device-layout,
#process-builder-modal .pb-main,
#process-builder-modal .pb-main-header,
#process-builder-modal .pb-step-container,
#process-builder-modal .pb-footer {
    width: 100% !important;
    max-width: 100% !important;
}

/* Ensure proper flex behavior */
#process-builder-modal .pb-device-layout {
    display: flex !important;
    flex-direction: row !important;
}

#process-builder-modal .pb-sidebar {
    flex: 0 0 280px !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
}

#process-builder-modal .pb-main {
    flex: 1 1 0% !important;
    min-width: 0 !important;
}

/* ===== MODAL OVERLAY ===== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: modalFadeIn 0.25s ease-out;
}

.modal-overlay.show {
    display: flex;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { 
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== MODAL BASE - LARGER & MORE PROMINENT ===== */

#process-builder-modal.modal-overlay .modal-dialog {
    max-width: 1400px !important;
    width: 96vw !important;
    margin: 0 auto;
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

#process-builder-modal .modal-content {
    width: 100%;
    height: calc(100vh - 40px);
    max-height: 950px;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #1a1a2e 0%, #141422 100%);
    border: 1px solid rgba(79, 116, 229, 0.3);
    border-radius: 16px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 60px rgba(79, 116, 229, 0.15);
    overflow: hidden;
}

#process-builder-modal .modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(15, 15, 26, 0.95) 0%, rgba(15, 15, 26, 0.8) 100%);
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#process-builder-modal .modal-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.02em;
}

#process-builder-modal .modal-title i {
    color: #4f74e5;
    font-size: 1.25rem;
}

#process-builder-modal .close-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0a0b0;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

#process-builder-modal .close-btn:hover {
    background: rgba(231, 76, 60, 0.15);
    border-color: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

#process-builder-modal .modal-body {
    flex: 1 1 auto;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 1fr;
    padding: 0;
    overflow: hidden;
    width: 100%;
    min-width: 0;
    min-height: 0;
}

/* ===== TAB NAVIGATION ===== */

.pb-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    background: rgba(15, 15, 26, 1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.5rem 1rem 0;
    width: 100%;
    grid-row: 1;
    position: relative;
    z-index: 100;
}

.pb-tab-btn {
    padding: 0.6rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px 8px 0 0;
    color: #808090;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.pb-tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.03);
}

.pb-tab-btn.active {
    color: #ffffff;
    background: rgba(79, 116, 229, 0.12);
}

.pb-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4f74e5, #6b8cff);
    border-radius: 3px 3px 0 0;
}

.pb-tab-btn i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.pb-tab-btn.active i {
    opacity: 1;
    color: #4f74e5;
}

/* ===== TAB CONTENT ===== */

.pb-tab-content {
    overflow: hidden;
    background: #141422;
    width: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    grid-row: 2;
    z-index: 1;
}

.pb-tab-pane {
    display: none;
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.pb-tab-pane.active {
    display: flex !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: auto !important;
}

/* ===== DEVICE PROCESSES TAB LAYOUT ===== */

.pb-device-layout {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    overflow: hidden;
    flex: 1 1 auto !important;
    min-width: 0;
    min-height: 0;
}

/* ===== LEFT SIDEBAR - DEVICE LIST ===== */

.pb-sidebar {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    flex: 0 0 280px;
    background: linear-gradient(180deg, #0f0f1a 0%, #0a0a14 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pb-sidebar-header {
    padding: 1rem 1rem 0.875rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pb-sidebar-header h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: #808090;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.pb-search-input {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.pb-search-input:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.5);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(79, 116, 229, 0.1);
}

.pb-search-input::placeholder {
    color: #606070;
}

.pb-search-wrapper {
    position: relative;
}

.pb-search-wrapper i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #606070;
    font-size: 0.8125rem;
}

.pb-device-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.pb-device-list::-webkit-scrollbar {
    width: 6px;
}

.pb-device-list::-webkit-scrollbar-track {
    background: transparent;
}

.pb-device-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.pb-device-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pb-category {
    margin-bottom: 1.25rem;
}

.pb-category-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    color: #707080;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.375rem;
}

.pb-category-header i {
    font-size: 0.75rem;
    width: 16px;
    text-align: center;
}

.pb-device-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.pb-device-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

.pb-device-item.active {
    background: linear-gradient(135deg, rgba(79, 116, 229, 0.2) 0%, rgba(79, 116, 229, 0.1) 100%);
    border-color: rgba(79, 116, 229, 0.4);
    color: white;
}

.pb-device-item.active .pb-device-icon {
    background: rgba(79, 116, 229, 0.3);
    color: #ffffff;
}

.pb-device-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9375rem;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.15s ease;
}

.pb-device-name {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #c0c0d0;
}

.pb-device-item.active .pb-device-name {
    color: #ffffff;
}

.pb-device-time {
    margin-left: auto;
    font-size: 0.75rem;
    color: #606070;
    font-weight: 500;
}

/* ===== MAIN CONTENT - STEP EDITOR ===== */

.pb-main {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden;
    background: #181828;
}

.pb-main-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(180deg, #1a1a2e 0%, #181828 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
}

.pb-device-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pb-device-title i {
    font-size: 1.25rem;
    color: #4f74e5;
}

.pb-device-title span {
    flex: 1;
}

.pb-device-subtitle {
    font-size: 0.8125rem;
    color: #707080;
    font-weight: 400;
    margin-left: 0.75rem;
}

.pb-config-row {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    width: 100%;
}

.pb-config-group {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.pb-config-label {
    font-size: 0.8125rem;
    color: #909090;
    font-weight: 500;
}

.pb-config-input {
    width: 80px;
    padding: 0.5rem 0.625rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.875rem;
    text-align: center;
    transition: all 0.2s ease;
}

.pb-config-input:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.5);
    box-shadow: 0 0 0 3px rgba(79, 116, 229, 0.1);
}

.pb-config-select {
    padding: 0.5rem 0.75rem;
    padding-right: 2rem;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.pb-config-select:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.5);
}

.pb-config-select option {
    background: #1a1a2e;
    color: #ffffff;
    padding: 0.5rem;
}

.pb-capabilities {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    padding-left: 1.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.pb-capability-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-dark, #0f0f1a);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pb-capability-toggle:hover {
    border-color: var(--accent-blue, #4f74e5);
}

.pb-capability-toggle.active {
    background: rgba(79, 116, 229, 0.15);
    border-color: var(--accent-blue, #4f74e5);
}

.pb-capability-toggle input[type="checkbox"] {
    display: none;
}

.pb-capability-check {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color, #2d2d44);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pb-capability-toggle.active .pb-capability-check {
    background: var(--accent-blue, #4f74e5);
    border-color: var(--accent-blue, #4f74e5);
}

.pb-capability-check i {
    font-size: 0.625rem;
    color: white;
    opacity: 0;
}

.pb-capability-toggle.active .pb-capability-check i {
    opacity: 1;
}

.pb-capability-label {
    font-size: 0.8125rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-capability-toggle.active .pb-capability-label {
    color: var(--accent-blue, #4f74e5);
}

/* ===== STEP LIST ===== */

.pb-step-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    width: 100%;
}

.pb-step-container::-webkit-scrollbar {
    width: 8px;
}

.pb-step-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.pb-step-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.pb-step-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pb-step-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    width: 100%;
}

.pb-step-list-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #606070;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pb-step-list-header span {
    flex: 1;
}

.pb-step-list-header .header-duration {
    width: 100px;
    text-align: center;
}

.pb-step-list-header .header-enabled {
    width: 60px;
    text-align: center;
}

.pb-step-list-header .header-actions {
    width: 80px;
}

.pb-step-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.125rem;
    background: linear-gradient(135deg, rgba(15, 15, 26, 0.8) 0%, rgba(10, 10, 20, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    transition: all 0.2s ease;
    position: relative;
    width: 100%;
}

.pb-step-item:hover {
    border-color: rgba(79, 116, 229, 0.4);
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.9) 0%, rgba(15, 15, 28, 1) 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.pb-step-item.from-overlay {
    border-left: 4px solid #4bc0ba;
    background: linear-gradient(135deg, rgba(75, 192, 186, 0.05) 0%, rgba(10, 10, 20, 0.9) 100%);
}

.pb-step-item.from-overlay::before {
    content: 'CAPABILITY';
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #4bc0ba;
    background: rgba(75, 192, 186, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: 0 12px 0 6px;
}

.pb-step-item.disabled {
    opacity: 0.45;
}

.pb-step-item.disabled .pb-step-icon {
    filter: grayscale(1);
}

.pb-step-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #606070;
    flex-shrink: 0;
}

.pb-step-drag {
    cursor: grab;
    color: #505060;
    padding: 0.375rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.pb-step-drag:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #909090;
}

.pb-step-drag:active {
    cursor: grabbing;
    color: #4f74e5;
}

.pb-step-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(79, 116, 229, 0.15) 0%, rgba(79, 116, 229, 0.05) 100%);
    border: 1px solid rgba(79, 116, 229, 0.2);
    border-radius: 10px;
    font-size: 1rem;
    color: #4f74e5;
    flex-shrink: 0;
}

.pb-step-info {
    flex: 1;
    min-width: 0;
}

.pb-step-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-step-type {
    font-size: 0.75rem;
    color: #707080;
}

.pb-step-condition-badge {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 3px 8px;
    background: rgba(254, 190, 16, 0.12);
    color: #febe10;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pb-step-overlay-badge {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 3px 8px;
    background: rgba(75, 192, 186, 0.12);
    color: #4bc0ba;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pb-step-duration {
    width: 100px;
    flex-shrink: 0;
}

.pb-step-duration input {
    width: 100%;
    padding: 0.5rem 0.625rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: right;
    transition: all 0.2s ease;
}

.pb-step-duration input:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.5);
    box-shadow: 0 0 0 3px rgba(79, 116, 229, 0.1);
}

.pb-step-duration-unit {
    font-size: 0.75rem;
    color: #606070;
    margin-left: 0.375rem;
    font-weight: 500;
}

.pb-step-toggle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
}

.pb-step-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4f74e5;
}

.pb-step-actions {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
}

.pb-step-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #606070;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pb-step-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.pb-step-action-btn.delete:hover {
    background: rgba(231, 76, 60, 0.12);
    border-color: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.pb-step-action-btn.duplicate:hover {
    background: rgba(79, 116, 229, 0.12);
    border-color: rgba(79, 116, 229, 0.3);
    color: #4f74e5;
}

/* ===== EMPTY STATE ===== */

.pb-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: #606070;
    width: 100%;
    height: 100%;
}

.pb-empty-state i {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    opacity: 0.4;
}

.pb-empty-state p {
    font-size: 1rem;
    max-width: 300px;
    line-height: 1.6;
}

.pb-empty-state .pb-empty-hint {
    font-size: 0.8125rem;
    color: #505060;
    margin-top: 0.75rem;
}

/* ===== ADD STEP BUTTON ===== */

.pb-add-step-wrapper {
    margin-top: 1rem;
    position: relative;
    width: 100%;
}

.pb-add-step-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 2px dashed rgba(79, 116, 229, 0.3);
    border-radius: 12px;
    color: #4f74e5;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pb-add-step-btn:hover {
    border-color: #4f74e5;
    background: rgba(79, 116, 229, 0.08);
    box-shadow: 0 4px 20px rgba(79, 116, 229, 0.15);
}

.pb-add-step-btn i {
    font-size: 0.875rem;
}

/* ===== ADD STEP DROPDOWN ===== */

.pb-add-step-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    max-height: 400px;
    overflow-y: auto;
    background: linear-gradient(180deg, #1a1a2e 0%, #141422 100%);
    border: 1px solid rgba(79, 116, 229, 0.3);
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    padding: 0.75rem;
    display: none;
}

.pb-add-step-dropdown.show {
    display: block;
    animation: dropdownSlideIn 0.2s ease-out;
}

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

/* Add Step Dropdown Options */
.pb-add-step-category {
    padding: 0.625rem 0.75rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #606070;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 0.5rem;
}

.pb-add-step-category:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0.375rem;
}

.pb-add-step-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 0.875rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.pb-add-step-option:hover {
    background: rgba(79, 116, 229, 0.15);
}

.pb-add-step-option i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 116, 229, 0.1);
    border-radius: 6px;
    font-size: 0.875rem;
    color: #4f74e5;
}

.pb-add-step-option span {
    flex: 1;
}

.pb-dropdown-category {
    padding: 0.5rem 0.75rem 0.375rem;
    font-size: 0.625rem;
    font-weight: 700;
    color: #505060;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.pb-step-type-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 0.875rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.pb-step-type-item:hover {
    background: rgba(79, 116, 229, 0.12);
}

.pb-step-type-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 116, 229, 0.1);
    border-radius: 8px;
    font-size: 0.875rem;
    color: #4f74e5;
}

.pb-step-type-info {
    flex: 1;
}

.pb-step-type-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 2px;
}

.pb-step-type-desc {
    font-size: 0.75rem;
    color: #707080;
}

.pb-step-type-time {
    font-size: 0.75rem;
    font-weight: 500;
    color: #606070;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* ===== FOOTER ===== */

.pb-footer {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(180deg, rgba(15, 15, 26, 0.95) 0%, #0a0a14 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-shrink: 0;
    width: 100%;
    grid-row: 3;
}

.pb-summary {
    display: flex;
    gap: 2.5rem;
    flex: 1;
}

.pb-summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pb-summary-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #606070;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pb-summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.pb-summary-value.highlight {
    color: #4f74e5;
}

.pb-preview-select {
    padding: 0.5rem 0.75rem;
    padding-right: 2rem;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.8125rem;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.pb-preview-select:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.5);
}

.pb-preview-select option {
    background: #1a1a2e;
    color: #ffffff;
    padding: 0.5rem;
}

.pb-histogram {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 40px;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.pb-histogram-bar {
    width: 6px;
    min-height: 2px;
    background: linear-gradient(180deg, #4f74e5 0%, #6b8cff 100%);
    border-radius: 3px 3px 0 0;
    transition: height 0.2s ease;
}

.pb-actions {
    display: flex;
    gap: 0.75rem;
}

.pb-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-btn i {
    font-size: 0.8125rem;
}

.pb-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0a0b0;
}

.pb-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.pb-btn-primary {
    background: linear-gradient(135deg, #4f74e5 0%, #6b8cff 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 116, 229, 0.3);
}

.pb-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(79, 116, 229, 0.4);
}

.pb-btn-danger {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.pb-btn-danger:hover {
    background: rgba(231, 76, 60, 0.15);
    border-color: rgba(231, 76, 60, 0.3);
}

/* Keep old primary hover for backwards compat */
.pb-btn-primary:hover:not(:disabled) {
    background: #3d5fc7;
}

.pb-btn-danger {
    background: transparent;
    border: 1px solid var(--border-color, #2d2d44);
    color: var(--text-secondary, #a0a0b0);
}

.pb-btn-danger:hover {
    background: rgba(231, 76, 60, 0.15);
    border-color: var(--accent-red, #e74c3c);
    color: var(--accent-red, #e74c3c);
}

/* ===== JOURNEY BUILDER TAB ===== */

.pb-journey-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 500px;
    overflow: hidden;
    flex: 1 1 auto;
}

.pb-journey-layout > .pb-journey-sidebar,
.pb-journey-layout > .pb-journey-graph-wrapper,
.pb-journey-layout > .pb-journey-properties {
    /* These need to be in a row container */
}

/* Wrapper for the main journey content (sidebar + graph + properties) */
.pb-journey-content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Journey Footer */
.pb-journey-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-dark, #0f0f1a);
    border-top: 1px solid var(--border-color, #2d2d44);
    flex-shrink: 0;
}

.pb-journey-footer-actions {
    display: flex;
    gap: 0.75rem;
}

.pb-journey-status {
    font-size: 0.8125rem;
    color: var(--text-muted, #666680);
}

/* Journey Sidebar */
.pb-journey-sidebar {
    width: 200px;
    min-width: 200px;
    background: var(--bg-dark, #0f0f1a);
    border-right: 1px solid var(--border-color, #2d2d44);
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
}

.pb-journey-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.pb-journey-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin: 0;
}

.pb-journey-list {
    flex: 1;
    overflow-y: auto;
}

.pb-journey-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 4px;
}

.pb-journey-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.pb-journey-item.active {
    background: var(--accent-blue, #4f74e5);
    color: white;
}

.jb-journey-name {
    flex: 1;
    font-size: 0.8125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jb-journey-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.pb-journey-item:hover .jb-journey-actions {
    opacity: 1;
}

.jb-journey-rename,
.jb-journey-delete {
    padding: 0.25rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.jb-journey-rename:hover,
.jb-journey-delete:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.jb-journey-delete:hover {
    color: #e74c3c;
}

.jb-no-journeys {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted, #666680);
    font-size: 0.8125rem;
}

.pb-journey-templates {
    border-top: 1px solid var(--border-color, #2d2d44);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.pb-journey-templates h5 {
    font-size: 0.6875rem;
    text-transform: uppercase;
    color: var(--text-muted, #666680);
    margin-bottom: 0.5rem;
}

.pb-template-btn {
    width: 100%;
    padding: 0.375rem 0.5rem;
    margin-bottom: 4px;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 4px;
    color: var(--text-secondary, #a0a0b0);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.pb-template-btn:hover {
    background: var(--bg-dark, #0f0f1a);
    color: var(--text-primary, #ffffff);
    border-color: var(--accent-blue, #4f74e5);
}

/* Graph Wrapper */
.pb-journey-graph-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

.pb-journey-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-dark, #0f0f1a);
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.jb-tool-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 4px;
    color: var(--text-secondary, #a0a0b0);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.jb-tool-btn:hover {
    background: var(--bg-dark, #0f0f1a);
    color: var(--text-primary, #ffffff);
}

.jb-tool-btn.active {
    background: var(--accent-blue, #4f74e5);
    border-color: var(--accent-blue, #4f74e5);
    color: white;
}

.jb-toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color, #2d2d44);
    margin: 0 0.25rem;
}

.jb-toolbar-spacer {
    flex: 1;
}

.jb-status {
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
    padding: 0 0.5rem;
}

.jb-status.active {
    color: var(--accent-yellow, #febe10);
    font-weight: 500;
}

/* Graph Container */
.pb-journey-graph {
    flex: 1;
    min-height: 400px;
    height: 100%;
    background: var(--bg-secondary, #1a1a2e);
    background-image: 
        linear-gradient(rgba(45, 45, 68, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45, 45, 68, 0.3) 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
}

/* Ensure vis.js canvas fills container */
.pb-journey-graph > div {
    width: 100% !important;
    height: 100% !important;
}

/* Properties Panel */
.pb-journey-properties {
    width: 220px;
    min-width: 220px;
    background: var(--bg-dark, #0f0f1a);
    border-left: 1px solid var(--border-color, #2d2d44);
    padding: 0.75rem;
    overflow-y: auto;
}

.pb-journey-properties h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin: 0 0 0.75rem 0;
}

.jb-no-selection {
    color: var(--text-muted, #666680);
    font-size: 0.8125rem;
    text-align: center;
    padding: 1rem;
}

.jb-prop-group {
    margin-bottom: 0.75rem;
}

.jb-prop-group label {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted, #666680);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Multi-select for devices */
#jb-node-devices {
    min-height: 120px;
    max-height: 200px;
}

#jb-node-devices optgroup {
    font-weight: 600;
    color: var(--text-secondary, #a0a0b0);
    padding: 4px 0;
}

#jb-node-devices option {
    padding: 4px 8px;
    cursor: pointer;
}

#jb-node-devices option:checked {
    background: var(--accent-blue, #4f74e5) !important;
    color: white !important;
}

.jb-prop-group .pb-config-input,
.jb-prop-group .pb-config-select {
    width: 100%;
}

/* Placeholder state */
.pb-journey-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #666680);
    text-align: center;
    padding: 2rem;
}

.pb-journey-placeholder i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.pb-journey-placeholder h3 {
    font-size: 1.25rem;
    color: var(--text-secondary, #a0a0b0);
    margin-bottom: 0.5rem;
}

.pb-journey-placeholder p {
    font-size: 0.875rem;
    max-width: 400px;
}

/* ===== EMPTY STATE ===== */

.pb-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #666680);
    text-align: center;
    padding: 2rem;
}

.pb-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.pb-empty-state p {
    font-size: 0.875rem;
}

/* ===== DRAG AND DROP ===== */

.pb-step-item.sortable-ghost {
    opacity: 0.4;
    background: var(--accent-blue, #4f74e5);
}

.pb-step-item.sortable-chosen {
    box-shadow: 0 4px 12px rgba(79, 116, 229, 0.3);
}

.pb-step-item.sortable-drag {
    opacity: 1;
}

/* ===== SCROLLBAR ===== */

.pb-step-container::-webkit-scrollbar,
.pb-device-list::-webkit-scrollbar,
.pb-add-step-dropdown::-webkit-scrollbar {
    width: 6px;
}

.pb-step-container::-webkit-scrollbar-track,
.pb-device-list::-webkit-scrollbar-track,
.pb-add-step-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.pb-step-container::-webkit-scrollbar-thumb,
.pb-device-list::-webkit-scrollbar-thumb,
.pb-add-step-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-color, #2d2d44);
    border-radius: 3px;
}

.pb-step-container::-webkit-scrollbar-thumb:hover,
.pb-device-list::-webkit-scrollbar-thumb:hover,
.pb-add-step-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted, #666680);
}

/* ===== PASSENGER TYPES TAB ===== */

.pb-pax-layout {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 500px;
    overflow: hidden;
    flex: 1 1 auto;
}

/* Passenger Type Sidebar */
.pb-pax-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--bg-dark, #0f0f1a);
    border-right: 1px solid var(--border-color, #2d2d44);
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    overflow-y: auto;
}

.pb-pax-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-pax-header h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin: 0;
}

.pb-pax-list {
    flex: 1;
    overflow-y: auto;
    min-height: 150px;
    max-height: 300px;
}

.pb-pax-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 4px;
}

.pb-pax-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.pb-pax-item.active {
    background: var(--accent-blue, #4f74e5);
    color: white;
}

.pb-pax-item-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.pb-pax-item-info {
    flex: 1;
    min-width: 0;
}

.pb-pax-item-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pb-pax-item-id {
    font-size: 0.6875rem;
    color: var(--text-muted, #666680);
}

.pb-pax-item.active .pb-pax-item-name,
.pb-pax-item.active .pb-pax-item-id {
    color: white;
}

.pb-pax-item-badge {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted, #666680);
    text-transform: uppercase;
}

.pb-pax-item.active .pb-pax-item-badge {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.pb-pax-actions {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #2d2d44);
    margin-top: 0.75rem;
}

.pb-pax-actions .pb-btn {
    width: 100%;
}

/* Global Passenger Settings */
.pb-pax-global-settings {
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color, #2d2d44);
    margin-top: 0.75rem;
}

.pb-pax-global-settings h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary, #f4f4f5);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-pax-global-settings h4 i {
    color: var(--primary-blue, #4f74e5);
    font-size: 0.7rem;
}

.pb-pax-global-field {
    margin-bottom: 0.5rem;
}

.pb-pax-global-field:last-child {
    margin-bottom: 0;
}

.pb-pax-global-field label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary, #a8b3cf);
    margin-bottom: 0.25rem;
}

.pb-pax-global-field input {
    width: 100%;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    background: var(--bg-dark, #0d0d15);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 4px;
    color: var(--text-primary, #f4f4f5);
}

.pb-pax-global-field input:focus {
    outline: none;
    border-color: var(--primary-blue, #4f74e5);
}

/* Passenger Distribution */
.pb-pax-distribution {
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color, #2d2d44);
    margin-top: 0.75rem;
}

.pb-pax-distribution h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary, #f4f4f5);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-pax-distribution h4 i {
    color: var(--primary-blue, #4f74e5);
    font-size: 0.7rem;
}

.pb-pax-dist-list {
    max-height: 200px;
    overflow-y: auto;
    min-height: 100px;
}

.pb-pax-dist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pb-pax-dist-item:last-child {
    border-bottom: none;
}

.pb-pax-dist-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pb-pax-dist-name {
    flex: 1;
    font-size: 0.7rem;
    color: var(--text-secondary, #a8b3cf);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pb-pax-dist-input-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pb-pax-dist-input-group input {
    width: 50px;
    padding: 0.25rem 0.35rem;
    font-size: 0.7rem;
    text-align: right;
    background: var(--bg-dark, #0d0d15);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 4px;
    color: var(--text-primary, #f4f4f5);
}

.pb-pax-dist-input-group input:focus {
    outline: none;
    border-color: var(--primary-blue, #4f74e5);
}

.pb-pax-dist-input-group span {
    font-size: 0.7rem;
    color: var(--text-muted, #666);
}

.pb-pax-dist-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin-top: 0.5rem;
    background: var(--bg-dark, #0d0d15);
    border-radius: 4px;
    font-size: 0.75rem;
}

.pb-pax-dist-total span:first-child {
    color: var(--text-secondary, #a8b3cf);
}

.pb-pax-dist-total span:last-child {
    color: var(--primary-blue, #4f74e5);
    font-weight: 600;
}

.pb-pax-dist-total.warning span:last-child {
    color: #febe10;
}

.pb-pax-dist-total.error span:last-child {
    color: #e74c3c;
}

.pb-pax-dist-total.valid span:last-child {
    color: #2ecc71;
}

.pb-pax-dist-total.valid::after {
    content: " ✓";
    color: #2ecc71;
}

.pb-pax-dist-desc {
    font-size: 0.75rem;
    color: var(--text-muted, #8892b0);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.pb-pax-dist-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #2d2d44);
}

.pb-pax-dist-actions .pb-btn {
    flex: 1;
    font-size: 0.7rem;
    padding: 0.35rem 0.5rem;
}

/* Main Editor Area */
.pb-pax-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-secondary, #1a1a2e);
}

.pb-pax-editor {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.pb-pax-no-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted, #666680);
    text-align: center;
}

.pb-pax-no-selection i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.pb-pax-no-selection p {
    font-size: 0.9375rem;
}

/* Form */
.pb-pax-form {
    max-width: 800px;
}

.pb-pax-form-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-pax-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-dark, #0f0f1a);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color, #2d2d44);
}

.pb-pax-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s ease;
}

.pb-pax-title-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin: 0 0 0.25rem 0;
}

.pb-pax-id {
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
    font-family: monospace;
}

/* Form Grid */
.pb-pax-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.pb-pax-section {
    background: var(--bg-dark, #0f0f1a);
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-pax-section h5 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #a0a0b0);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-pax-field {
    margin-bottom: 1rem;
}

.pb-pax-field:last-child {
    margin-bottom: 0;
}

.pb-pax-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary, #a0a0b0);
    margin-bottom: 0.375rem;
}

.pb-pax-hint {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted, #666680);
    margin-top: 0.25rem;
}

/* Color Picker */
.pb-pax-color-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pb-pax-color-picker {
    width: 48px;
    height: 36px;
    padding: 0;
    border: 2px solid var(--border-color, #2d2d44);
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
}

.pb-pax-color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.pb-pax-color-picker::-webkit-color-swatch {
    border-radius: 4px;
    border: none;
}

.pb-pax-color-text {
    flex: 1;
    font-family: monospace;
    text-transform: uppercase;
}

/* Checkbox Field */
.pb-pax-checkbox-field {
    margin-bottom: 0.75rem;
}

.pb-pax-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary, #ffffff);
}

.pb-pax-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue, #4f74e5);
    cursor: pointer;
}

.pb-pax-group-fields {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #2d2d44);
}

/* Form Actions */
.pb-pax-form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #2d2d44);
}

/* ===== SPAWN EDITOR TAB ===== */

.pb-spawn-layout {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 500px;
    overflow: hidden;
    flex: 1 1 auto;
}

/* Spawn Point Sidebar */
.pb-spawn-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-dark, #0f0f1a);
    border-right: 1px solid var(--border-color, #2d2d44);
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
}

/* Schedule Toggle Section in Spawn Sidebar */
.pb-schedule-toggle-section {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(79, 116, 229, 0.1), rgba(79, 116, 229, 0.05));
    border-bottom: 1px solid var(--border-color, #2d2d44);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pb-schedule-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-schedule-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue, #4f74e5);
    cursor: pointer;
}

.pb-schedule-toggle span {
    font-weight: 500;
}

#schedule-edit-btn {
    width: 100%;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-blue, #4f74e5), #6b5ce7);
    border: none;
    color: white;
}

#schedule-edit-btn:hover {
    background: linear-gradient(135deg, #5a84f5, #7b6cf7);
    transform: translateY(-1px);
}

#schedule-edit-btn i {
    margin-right: 0.5rem;
}

.pb-spawn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-spawn-header h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin: 0;
}

.pb-spawn-count {
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.pb-spawn-list {
    flex: 1;
    overflow-y: auto;
}

.pb-spawn-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    text-align: center;
    color: var(--text-muted, #666680);
}

.pb-spawn-empty i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.pb-spawn-empty p {
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
}

.pb-spawn-empty small {
    font-size: 0.75rem;
    opacity: 0.7;
}

.pb-spawn-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.pb-spawn-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.pb-spawn-item.active {
    background: var(--accent-blue, #4f74e5);
    color: white;
    border-color: var(--accent-blue, #4f74e5);
}

.pb-spawn-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.pb-spawn-item.active .pb-spawn-item-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.pb-spawn-item.disabled .pb-spawn-item-icon {
    background: rgba(128, 128, 128, 0.15);
    color: #808080;
}

.pb-spawn-item-info {
    flex: 1;
    min-width: 0;
}

.pb-spawn-item-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pb-spawn-item-stats {
    font-size: 0.6875rem;
    color: var(--text-muted, #666680);
    margin-top: 2px;
}

.pb-spawn-item.active .pb-spawn-item-name,
.pb-spawn-item.active .pb-spawn-item-stats {
    color: white;
}

.pb-spawn-item-status {
    font-size: 0.5625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.pb-spawn-item-status.enabled {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

.pb-spawn-item-status.disabled {
    background: rgba(128, 128, 128, 0.15);
    color: #808080;
}

.pb-spawn-item.active .pb-spawn-item-status {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.pb-spawn-actions {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #2d2d44);
    margin-top: 0.75rem;
}

.pb-spawn-actions .pb-btn {
    width: 100%;
}

/* Main Editor Area */
.pb-spawn-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-secondary, #1a1a2e);
    min-height: 0; /* Important for flexbox scrolling */
}

.pb-spawn-editor {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.pb-spawn-no-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted, #666680);
    text-align: center;
}

.pb-spawn-no-selection i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.pb-spawn-no-selection p {
    font-size: 0.9375rem;
}

/* Form */
.pb-spawn-form {
    max-width: 900px;
}

.pb-spawn-form-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-spawn-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.2), rgba(46, 204, 113, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #2ecc71;
    flex-shrink: 0;
}

.pb-spawn-title-section {
    flex: 1;
}

.pb-spawn-name-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--border-color, #2d2d44);
    color: var(--text-primary, #ffffff);
    font-size: 1.25rem;
    font-weight: 600;
    padding: 0.25rem 0;
    width: 100%;
    transition: border-color 0.2s ease;
}

.pb-spawn-name-input:focus {
    outline: none;
    border-color: var(--accent-blue, #4f74e5);
}

.pb-spawn-id {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
    font-family: monospace;
    margin-top: 0.25rem;
}

.pb-spawn-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-spawn-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2ecc71;
    cursor: pointer;
}

/* Form Grid */
.pb-spawn-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.pb-spawn-section {
    background: var(--bg-dark, #0f0f1a);
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-spawn-section-wide {
    grid-column: 1 / -1;
}

.pb-spawn-section h5 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #a0a0b0);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-spawn-section-desc {
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
    margin: -0.5rem 0 1rem 0;
}

.pb-spawn-field {
    margin-bottom: 1rem;
}

.pb-spawn-field:last-child {
    margin-bottom: 0;
}

.pb-spawn-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary, #a0a0b0);
    margin-bottom: 0.375rem;
}

.pb-spawn-hint {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted, #666680);
    margin-top: 0.25rem;
}

/* Checkbox Field */
.pb-spawn-checkbox-field {
    margin-bottom: 0.75rem;
}

.pb-spawn-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary, #ffffff);
}

.pb-spawn-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue, #4f74e5);
    cursor: pointer;
}

/* Distribution Grid */
.pb-spawn-distribution {
    margin-top: 1rem;
}

.pb-spawn-dist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.pb-spawn-dist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-spawn-dist-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pb-spawn-dist-name {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-spawn-dist-input {
    width: 50px;
    text-align: right;
}

.pb-spawn-dist-total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #2d2d44);
    font-size: 0.875rem;
    font-weight: 600;
}

.pb-spawn-dist-total span:last-child {
    color: var(--accent-blue, #4f74e5);
}

/* Routing Grid */
.pb-spawn-route-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.pb-spawn-route-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-spawn-route-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.pb-spawn-route-info {
    flex: 1;
}

.pb-spawn-route-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
}

.pb-spawn-route-desc {
    font-size: 0.6875rem;
    color: var(--text-muted, #666680);
}

.pb-spawn-route-input {
    width: 60px;
    text-align: right;
}

/* Form Actions */
.pb-spawn-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #2d2d44);
}

/* ===== SCHEDULE EDITOR ===== */

/* Schedule Toggle Section in Sidebar */
.pb-schedule-toggle-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, rgba(79, 116, 229, 0.1), rgba(79, 116, 229, 0.05));
    border-radius: 8px;
    border: 1px solid rgba(79, 116, 229, 0.2);
}

.pb-schedule-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
}

.pb-schedule-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue, #4f74e5);
}

.pb-btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
}

/* Schedule Editor Panel */
.pb-schedule-editor {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Important for flexbox scrolling */
}

.pb-schedule-editor .pb-schedule-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.pb-schedule-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-dark, #0f0f1a);
    border-bottom: 1px solid var(--border-color, #2d2d44);
    flex-shrink: 0;
}

.pb-schedule-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.pb-schedule-title i {
    font-size: 1.25rem;
    color: var(--accent-blue, #4f74e5);
}

.pb-schedule-title h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
}

.pb-schedule-summary {
    display: flex;
    gap: 1.5rem;
}

.pb-schedule-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-schedule-stat i {
    font-size: 0.875rem;
    color: var(--text-muted, #666680);
}

.pb-schedule-stat strong {
    color: var(--text-primary, #ffffff);
}

/* Schedule Sections */
.pb-schedule-section {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-schedule-section h5 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #a0a0b0);
}

.pb-schedule-section h5 i {
    font-size: 0.875rem;
}

/* Default Mix Section */
.pb-schedule-mix-section {
    background: rgba(255, 255, 255, 0.02);
}

.pb-schedule-mix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.pb-schedule-mix-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-dark, #0f0f1a);
    border-radius: 6px;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-schedule-mix-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pb-schedule-mix-name {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-schedule-mix-input {
    width: 55px;
    text-align: right;
}

/* Schedule Toolbar */
.pb-schedule-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.pb-schedule-range-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-schedule-range-select label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary, #a0a0b0);
}

.pb-schedule-quick-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Schedule Grid */
.pb-schedule-grid-container {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 6px;
}

.pb-schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.pb-schedule-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-dark, #0f0f1a);
}

.pb-schedule-table th {
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #a0a0b0);
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-schedule-table td {
    padding: 0.375rem 0.75rem;
    border-bottom: 1px solid rgba(45, 45, 68, 0.5);
}

.pb-schedule-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.pb-schedule-table .schedule-time {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
    white-space: nowrap;
}

.pb-schedule-table .schedule-pax-input {
    width: 70px;
}

.pb-schedule-table .schedule-wave-select {
    width: 130px;
}

.pb-schedule-mix-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pb-schedule-mix-badge.default {
    background: rgba(128, 128, 128, 0.15);
    color: var(--text-muted, #666680);
}

.pb-schedule-mix-badge.custom {
    background: rgba(79, 116, 229, 0.15);
    color: var(--accent-blue, #4f74e5);
}

.pb-schedule-mix-badge:hover {
    opacity: 0.8;
}

/* Schedule Footer */
.pb-schedule-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-dark, #0f0f1a);
    border-top: 1px solid var(--border-color, #2d2d44);
    flex-shrink: 0;
}

/* Schedule Allocation Section */
.pb-schedule-allocation-section {
    background: linear-gradient(135deg, rgba(79, 116, 229, 0.08), rgba(79, 116, 229, 0.02));
    border: 1px solid rgba(79, 116, 229, 0.15);
}

.pb-schedule-allocation-fields {
    margin-top: 1rem;
}

.pb-spawn-field-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.pb-spawn-field-row .pb-spawn-field {
    flex: 1;
    min-width: 120px;
}

.pb-active-windows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pb-active-window-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-dark, #0f0f1a);
    border-radius: 6px;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-active-window-row span {
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
}

.pb-active-window-row input[type="time"] {
    width: 100px;
}

/* Legacy Section */
.pb-legacy-spawn-section {
    opacity: 0.6;
    border: 1px dashed var(--border-color, #2d2d44);
}

.pb-legacy-spawn-section.hidden {
    display: none;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 900px) {
    #process-builder-modal .modal-dialog {
        max-width: 100%;
        margin: 0.5rem;
    }

    .pb-sidebar {
        width: 200px;
        min-width: 200px;
    }

    .pb-config-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .pb-capabilities {
        margin-left: 0;
    }

    .pb-footer {
        flex-wrap: wrap;
    }

    .pb-summary {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 700px) {
    .pb-device-layout {
        flex-direction: column;
    }

    .pb-sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-color, #2d2d44);
    }

    .pb-device-list {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .pb-category {
        display: contents;
    }

    .pb-category-header {
        display: none;
    }

    .pb-device-item {
        flex: 0 0 auto;
    }
}

/* ===== GANTT CHART SCHEDULE EDITOR ===== */

.pb-schedule-editor {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    position: relative;
    min-height: 400px;
}

.pb-schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-schedule-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-schedule-title h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary, #e0e0e8);
}

.pb-schedule-title i {
    color: var(--accent-color, #4f74e5);
}

.pb-schedule-summary {
    display: flex;
    gap: 1.5rem;
}

.pb-schedule-stat {
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0b8);
}

.pb-schedule-stat strong {
    color: var(--text-primary, #e0e0e8);
    font-weight: 700;
}

.pb-schedule-section {
    background: var(--bg-secondary, #16162a);
    border-radius: 8px;
    padding: 1rem;
}

.pb-schedule-section h5 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary, #a0a0b8);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-schedule-section h5 i {
    color: var(--accent-color, #4f74e5);
}

.pb-schedule-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pb-schedule-range-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-schedule-range-select label {
    font-size: 0.8rem;
    color: var(--text-muted, #666680);
}

.pb-schedule-quick-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-schedule-quick-actions input {
    width: 100px;
}

.pb-schedule-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #2d2d44);
}

/* Default mix grid */
.pb-schedule-mix-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.pb-schedule-mix-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
}

.pb-schedule-mix-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.pb-schedule-mix-name {
    color: var(--text-secondary, #a0a0b8);
    min-width: 70px;
}

.pb-schedule-mix-input {
    width: 50px !important;
    text-align: center;
}

.schedule-gantt-container {
    width: 100%;
    background: var(--bg-secondary, #16162a);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    overflow-x: auto;
}

/* Hour markers header */
.schedule-gantt-header {
    display: flex;
    align-items: center;
    padding-left: 60px; /* Align with blocks (for time label column) */
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
    padding-bottom: 0.5rem;
}

.schedule-gantt-hour {
    flex: 0 0 50px; /* 2 blocks per hour = 25px each * 2 */
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted, #666680);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.schedule-gantt-hour:nth-child(even) {
    opacity: 0.6;
}

/* Main chart area */
.schedule-gantt-chart {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    min-height: 180px;
    padding-left: 60px; /* Space for time labels */
    position: relative;
}

/* Individual time block */
.schedule-block {
    flex: 0 0 23px;
    min-width: 23px;
    height: 160px;
    background: var(--bg-tertiary, #1e1e38);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 4px;
    display: flex;
    flex-direction: column-reverse; /* Stack from bottom */
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.schedule-block:hover {
    border-color: var(--accent-color, #4f74e5);
    box-shadow: 0 0 8px rgba(79, 116, 229, 0.3);
    transform: translateY(-2px);
}

.schedule-block.active {
    border-color: #f1c40f;
    box-shadow: 0 0 12px rgba(241, 196, 15, 0.4);
}

.schedule-block.empty {
    background: var(--bg-tertiary, #1e1e38);
    opacity: 0.5;
}

/* Global limit indicator on block */
.schedule-block-limit {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: var(--text-muted, #666680);
    background: rgba(0, 0, 0, 0.5);
    padding: 1px 4px;
    border-radius: 2px;
    z-index: 2;
}

/* Duration indicator for blocks > 30min */
.schedule-block-duration {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    color: var(--accent-color, #4f74e5);
    background: rgba(79, 116, 229, 0.2);
    padding: 1px 4px;
    border-radius: 2px;
    z-index: 2;
    font-weight: 600;
}

/* Stacked spawn bar inside block */
.spawn-bar {
    width: 100%;
    min-height: 4px;
    transition: height 0.2s ease;
}

.spawn-bar:hover {
    opacity: 0.85;
    filter: brightness(1.1);
}

/* Spawn bar and legend colors (assigned dynamically) */
.spawn-bar[data-color="1"], .block-spawn-color[data-color="1"], .schedule-legend-color[data-color="1"] { background: linear-gradient(180deg, #e74c3c, #c0392b); }
.spawn-bar[data-color="2"], .block-spawn-color[data-color="2"], .schedule-legend-color[data-color="2"] { background: linear-gradient(180deg, #3498db, #2980b9); }
.spawn-bar[data-color="3"], .block-spawn-color[data-color="3"], .schedule-legend-color[data-color="3"] { background: linear-gradient(180deg, #2ecc71, #27ae60); }
.spawn-bar[data-color="4"], .block-spawn-color[data-color="4"], .schedule-legend-color[data-color="4"] { background: linear-gradient(180deg, #f1c40f, #f39c12); }
.spawn-bar[data-color="5"], .block-spawn-color[data-color="5"], .schedule-legend-color[data-color="5"] { background: linear-gradient(180deg, #9b59b6, #8e44ad); }
.spawn-bar[data-color="6"], .block-spawn-color[data-color="6"], .schedule-legend-color[data-color="6"] { background: linear-gradient(180deg, #1abc9c, #16a085); }
.spawn-bar[data-color="7"], .block-spawn-color[data-color="7"], .schedule-legend-color[data-color="7"] { background: linear-gradient(180deg, #e67e22, #d35400); }
.spawn-bar[data-color="8"], .block-spawn-color[data-color="8"], .schedule-legend-color[data-color="8"] { background: linear-gradient(180deg, #34495e, #2c3e50); }

/* Time label on left edge (every hour) */
.schedule-block-time {
    position: absolute;
    left: -58px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    color: var(--text-muted, #666680);
    width: 50px;
    text-align: right;
    padding-right: 5px;
}

/* Legend */
.schedule-gantt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 0;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border-color, #2d2d44);
}

.schedule-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary, #a0a0b8);
}

.schedule-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.schedule-legend-empty {
    color: var(--text-muted, #666680);
    font-size: 0.8rem;
    font-style: italic;
}

/* Block editor no spawns message */
.block-no-spawns {
    color: var(--text-muted, #666680);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
    font-style: italic;
}

/* ===== BLOCK EDITOR POPUP ===== */

.schedule-block-editor {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 360px;
    max-width: 95%;
    background: var(--bg-primary, #0f0f1a);
    border: 2px solid var(--accent-color, #4f74e5);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(79, 116, 229, 0.2);
    z-index: 1000;
    overflow: hidden;
}

.block-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--accent-color, #4f74e5), var(--accent-secondary, #7b5fe3));
    color: white;
}

.block-editor-time {
    font-weight: 700;
    font-size: 1rem;
}

.block-editor-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.block-editor-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.block-editor-content {
    padding: 1rem;
    max-height: 350px;
    overflow-y: auto;
}

.block-editor-global {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.block-editor-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.block-editor-row label {
    font-size: 0.8rem;
    color: var(--text-secondary, #a0a0b8);
    min-width: 75px;
}

.block-editor-row input {
    flex: 1;
    max-width: 100px;
}

.block-editor-row select {
    flex: 1;
}

/* Per-spawn allocation list */
.block-editor-spawns {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.block-spawn-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary, #16162a);
    border-radius: 6px;
    border: 1px solid var(--border-color, #2d2d44);
}

.block-spawn-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.block-spawn-name {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-primary, #e0e0e8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.block-spawn-input {
    width: 60px;
    text-align: center;
}

.block-spawn-percent {
    font-size: 0.7rem;
    color: var(--text-muted, #666680);
    width: 40px;
    text-align: right;
}

/* Block editor footer */
.block-editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary, #16162a);
    border-top: 1px solid var(--border-color, #2d2d44);
}

.block-editor-total {
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0b8);
}

.block-editor-total strong {
    color: var(--text-primary, #e0e0e8);
    font-size: 1rem;
}

.block-editor-total span {
    color: var(--text-muted, #666680);
}

.block-editor-total.over-limit strong {
    color: #e74c3c;
}

.block-editor-total.under-limit strong {
    color: #f1c40f;
}

.block-editor-actions {
    display: flex;
    gap: 0.5rem;
}

/* Warning style for normalize button */
.pb-btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.pb-btn-warning:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

/* ===== GANTT RESPONSIVE ===== */

@media (max-width: 900px) {
    .schedule-gantt-container {
        padding: 0.5rem;
    }
    
    .schedule-block {
        flex: 0 0 18px;
        min-width: 18px;
        height: 120px;
    }
    
    .schedule-gantt-hour {
        flex: 0 0 36px;
        font-size: 0.6rem;
    }
    
    .schedule-block-limit {
        display: none;
    }
}

/* ===== JOURNEY DISTRIBUTION TAB ===== */

.pb-journey-dist-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
    gap: 1.5rem;
    overflow: hidden;
}

.pb-journey-dist-header {
    flex-shrink: 0;
}

.pb-journey-dist-header h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--text-primary, #e0e0e8);
    font-weight: 600;
}

.pb-journey-dist-header h4 i {
    margin-right: 0.5rem;
    color: var(--accent-blue, #4f74e5);
}

.pb-journey-dist-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-journey-dist-content {
    flex: 1;
    overflow: auto;
    background: var(--bg-dark, #0f0f1a);
    border-radius: 8px;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-journey-dist-matrix {
    padding: 1rem;
    min-height: 300px;
}

.pb-journey-dist-no-journeys {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-muted, #666680);
    gap: 0.75rem;
}

.pb-journey-dist-no-journeys i {
    font-size: 3rem;
    opacity: 0.5;
}

.pb-journey-dist-no-journeys p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary, #a0a0b0);
}

.pb-journey-dist-no-journeys span {
    font-size: 0.875rem;
}

/* Distribution Table */
.pb-journey-dist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.pb-journey-dist-table th,
.pb-journey-dist-table td {
    padding: 0.75rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-journey-dist-table thead th {
    background: var(--bg-secondary, #16162a);
    color: var(--text-primary, #e0e0e8);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.pb-journey-dist-table th.pax-type-col {
    text-align: left;
    min-width: 140px;
}

.pb-journey-dist-table th.journey-col {
    min-width: 100px;
}

.pb-journey-dist-table th.total-col {
    min-width: 80px;
}

.pb-journey-dist-table th.action-col {
    min-width: 80px;
}

.pb-journey-dist-table tbody tr {
    transition: background-color 0.15s ease;
}

.pb-journey-dist-table tbody tr:hover {
    background: rgba(79, 116, 229, 0.05);
}

.pb-journey-dist-table tbody tr:last-child td {
    border-bottom: none;
}

/* Passenger Type Cell */
.jd-pax-type-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

.jd-pax-type-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.jd-pax-type-name {
    font-weight: 500;
    color: var(--text-primary, #e0e0e8);
}

/* Percentage Input Cell */
.jd-percent-cell {
    position: relative;
}

.jd-percent-input {
    width: 60px;
    text-align: center;
    padding: 0.5rem;
    background: var(--bg-secondary, #16162a);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 4px;
    color: var(--text-primary, #e0e0e8);
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.jd-percent-input:focus {
    outline: none;
    border-color: var(--accent-blue, #4f74e5);
    box-shadow: 0 0 0 2px rgba(79, 116, 229, 0.2);
}

.jd-percent-input::-webkit-inner-spin-button,
.jd-percent-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.jd-percent-suffix {
    margin-left: 2px;
    color: var(--text-muted, #666680);
}

/* Total Cell */
.jd-total-cell {
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.jd-total-value {
    color: var(--text-primary, #e0e0e8);
}

.jd-total-value.valid {
    color: #2ecc71;
}

.jd-total-value.invalid {
    color: #e74c3c;
}

.jd-total-icon {
    font-size: 0.875rem;
}

.jd-total-icon.valid {
    color: #2ecc71;
}

.jd-total-icon.invalid {
    color: #e74c3c;
}

/* Action Cell */
.jd-action-cell {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.jd-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary, #a0a0b0);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.jd-action-btn:hover {
    background: rgba(79, 116, 229, 0.1);
    color: var(--accent-blue, #4f74e5);
}

.jd-action-btn[title*="Normalize"]:hover {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.jd-action-btn[title*="Copy"]:hover {
    background: rgba(243, 156, 18, 0.1);
    color: #f39c12;
}

/* Summary Section */
.pb-journey-dist-summary {
    flex-shrink: 0;
    padding: 1rem;
    background: var(--bg-dark, #0f0f1a);
    border-radius: 8px;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-journey-dist-validation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.pb-journey-dist-validation .validation-icon {
    font-size: 1rem;
}

.pb-journey-dist-validation.valid .validation-icon {
    color: #2ecc71;
}

.pb-journey-dist-validation.invalid .validation-icon {
    color: #e74c3c;
}

.pb-journey-dist-validation .validation-text {
    color: var(--text-secondary, #a0a0b0);
}

.pb-journey-dist-validation.valid .validation-text {
    color: #2ecc71;
}

.pb-journey-dist-validation.invalid .validation-text {
    color: #e74c3c;
}

/* Footer */
.pb-journey-dist-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #2d2d44);
}

.pb-journey-dist-actions-left,
.pb-journey-dist-actions-right {
    display: flex;
    gap: 0.75rem;
}

/* Journey Column Header */
.jd-journey-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.jd-journey-name {
    font-weight: 600;
    color: var(--text-primary, #e0e0e8);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jd-journey-icon {
    font-size: 1rem;
    color: var(--accent-blue, #4f74e5);
    margin-bottom: 0.25rem;
}

/* Row-level normalize animation */
.jd-row-normalizing td {
    background: rgba(46, 204, 113, 0.1);
    transition: background-color 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .pb-journey-dist-layout {
        padding: 1rem;
    }
    
    .jd-percent-input {
        width: 50px;
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    
    .pb-journey-dist-table th,
    .pb-journey-dist-table td {
        padding: 0.5rem;
    }
    
    .jd-pax-type-name {
        font-size: 0.8rem;
    }
}

/* ===== JOURNEY BUILDER DEVICE CHECKBOX LIST ===== */

.jb-device-checklist {
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-dark, #0f0f1a);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 6px;
    padding: 0.5rem;
}

.jb-device-checklist::-webkit-scrollbar {
    width: 6px;
}

.jb-device-checklist::-webkit-scrollbar-track {
    background: var(--bg-secondary, #16162a);
    border-radius: 3px;
}

.jb-device-checklist::-webkit-scrollbar-thumb {
    background: var(--border-color, #2d2d44);
    border-radius: 3px;
}

.jb-device-checklist::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue, #4f74e5);
}

/* Category Headers */
.jb-device-category {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted, #666680);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 0.25rem 0.25rem 0.25rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border-color, #2d2d44);
}

.jb-device-category:first-child {
    margin-top: 0;
    border-top: none;
    padding-top: 0.25rem;
}

/* Checkbox Items */
.jb-device-item {
    display: flex;
    align-items: center;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.jb-device-item:hover {
    background: rgba(79, 116, 229, 0.1);
}

.jb-device-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: var(--accent-blue, #4f74e5);
}

.jb-device-item label {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary, #e0e0e8);
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.jb-device-item:has(input:checked) {
    background: rgba(79, 116, 229, 0.15);
}

.jb-device-item:has(input:checked) label {
    color: var(--accent-blue, #4f74e5);
    font-weight: 500;
}

/* Empty state */
.jb-device-checklist-empty {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted, #666680);
    font-size: 0.85rem;
}

/* Schedule Mix Info Section */
.pb-schedule-mix-info {
    padding: 0.75rem;
    background: rgba(79, 116, 229, 0.05);
    border-radius: 6px;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-schedule-mix-info p {
    font-size: 0.8rem;
    color: var(--text-secondary, #a0a0b0);
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.pb-schedule-mix-info p i {
    color: var(--accent-blue, #4f74e5);
    margin-right: 0.35rem;
}

.pb-schedule-mix-info strong {
    color: var(--accent-blue, #4f74e5);
}

.pb-schedule-mix-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pb-schedule-mix-summary .mix-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary, #232338);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-primary, #e0e0e8);
    border-left: 3px solid;
}

.pb-schedule-mix-summary .mix-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pb-schedule-mix-summary .mix-empty {
    color: var(--text-muted, #666680);
    font-style: italic;
    font-size: 0.8rem;
}

 * Two-tab layout with Device Processes and Journey Builder tabs
 * Enhanced for better UX and larger display
 */

/* ===== BOX SIZING RESET FOR MODAL ===== */

#process-builder-modal,
#process-builder-modal *,
#process-builder-modal *::before,
#process-builder-modal *::after {
    box-sizing: border-box;
}

/* ===== GLOBAL SELECT STYLING FOR DARK THEME ===== */

#process-builder-modal select {
    background-color: #1a1a2e !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#process-builder-modal select option {
    background-color: #1a1a2e !important;
    color: #ffffff !important;
    padding: 8px;
}

#process-builder-modal select:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.6);
    box-shadow: 0 0 0 2px rgba(79, 116, 229, 0.15);
}

/* ===== FORCE FULL WIDTH ON ALL CONTAINERS ===== */

#process-builder-modal .modal-dialog,
#process-builder-modal .modal-content,
#process-builder-modal .modal-body,
#process-builder-modal .pb-tabs,
#process-builder-modal .pb-tab-content,
#process-builder-modal .pb-tab-pane,
#process-builder-modal .pb-tab-pane.active,
#process-builder-modal .pb-device-layout,
#process-builder-modal .pb-main,
#process-builder-modal .pb-main-header,
#process-builder-modal .pb-step-container,
#process-builder-modal .pb-footer {
    width: 100% !important;
    max-width: 100% !important;
}

/* Ensure proper flex behavior */
#process-builder-modal .pb-device-layout {
    display: flex !important;
    flex-direction: row !important;
}

#process-builder-modal .pb-sidebar {
    flex: 0 0 280px !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
}

#process-builder-modal .pb-main {
    flex: 1 1 0% !important;
    min-width: 0 !important;
}

/* ===== MODAL OVERLAY ===== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: modalFadeIn 0.25s ease-out;
}

.modal-overlay.show {
    display: flex;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { 
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== MODAL BASE - LARGER & MORE PROMINENT ===== */

#process-builder-modal.modal-overlay .modal-dialog {
    max-width: 1400px !important;
    width: 96vw !important;
    margin: 0 auto;
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

#process-builder-modal .modal-content {
    width: 100%;
    height: calc(100vh - 40px);
    max-height: 950px;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #1a1a2e 0%, #141422 100%);
    border: 1px solid rgba(79, 116, 229, 0.3);
    border-radius: 16px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 60px rgba(79, 116, 229, 0.15);
    overflow: hidden;
}

#process-builder-modal .modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(15, 15, 26, 0.95) 0%, rgba(15, 15, 26, 0.8) 100%);
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#process-builder-modal .modal-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.02em;
}

#process-builder-modal .modal-title i {
    color: #4f74e5;
    font-size: 1.25rem;
}

#process-builder-modal .close-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0a0b0;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

#process-builder-modal .close-btn:hover {
    background: rgba(231, 76, 60, 0.15);
    border-color: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

#process-builder-modal .modal-body {
    flex: 1 1 auto;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 1fr;
    padding: 0;
    overflow: hidden;
    width: 100%;
    min-width: 0;
    min-height: 0;
}

/* ===== TAB NAVIGATION ===== */

.pb-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    background: rgba(15, 15, 26, 1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.5rem 1rem 0;
    width: 100%;
    grid-row: 1;
    position: relative;
    z-index: 100;
}

.pb-tab-btn {
    padding: 0.6rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px 8px 0 0;
    color: #808090;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.pb-tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.03);
}

.pb-tab-btn.active {
    color: #ffffff;
    background: rgba(79, 116, 229, 0.12);
}

.pb-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4f74e5, #6b8cff);
    border-radius: 3px 3px 0 0;
}

.pb-tab-btn i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.pb-tab-btn.active i {
    opacity: 1;
    color: #4f74e5;
}

/* ===== TAB CONTENT ===== */

.pb-tab-content {
    overflow: hidden;
    background: #141422;
    width: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    grid-row: 2;
    z-index: 1;
}

.pb-tab-pane {
    display: none;
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.pb-tab-pane.active {
    display: flex !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: auto !important;
}

/* ===== DEVICE PROCESSES TAB LAYOUT ===== */

.pb-device-layout {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    overflow: hidden;
    flex: 1 1 auto !important;
    min-width: 0;
    min-height: 0;
}

/* ===== LEFT SIDEBAR - DEVICE LIST ===== */

.pb-sidebar {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    flex: 0 0 280px;
    background: linear-gradient(180deg, #0f0f1a 0%, #0a0a14 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pb-sidebar-header {
    padding: 1rem 1rem 0.875rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pb-sidebar-header h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: #808090;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.pb-search-input {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.pb-search-input:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.5);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(79, 116, 229, 0.1);
}

.pb-search-input::placeholder {
    color: #606070;
}

.pb-search-wrapper {
    position: relative;
}

.pb-search-wrapper i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #606070;
    font-size: 0.8125rem;
}

.pb-device-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.pb-device-list::-webkit-scrollbar {
    width: 6px;
}

.pb-device-list::-webkit-scrollbar-track {
    background: transparent;
}

.pb-device-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.pb-device-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pb-category {
    margin-bottom: 1.25rem;
}

.pb-category-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    color: #707080;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.375rem;
}

.pb-category-header i {
    font-size: 0.75rem;
    width: 16px;
    text-align: center;
}

.pb-device-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.pb-device-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

.pb-device-item.active {
    background: linear-gradient(135deg, rgba(79, 116, 229, 0.2) 0%, rgba(79, 116, 229, 0.1) 100%);
    border-color: rgba(79, 116, 229, 0.4);
    color: white;
}

.pb-device-item.active .pb-device-icon {
    background: rgba(79, 116, 229, 0.3);
    color: #ffffff;
}

.pb-device-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9375rem;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.15s ease;
}

.pb-device-name {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #c0c0d0;
}

.pb-device-item.active .pb-device-name {
    color: #ffffff;
}

.pb-device-time {
    margin-left: auto;
    font-size: 0.75rem;
    color: #606070;
    font-weight: 500;
}

/* ===== MAIN CONTENT - STEP EDITOR ===== */

.pb-main {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden;
    background: #181828;
}

.pb-main-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(180deg, #1a1a2e 0%, #181828 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
}

.pb-device-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pb-device-title i {
    font-size: 1.25rem;
    color: #4f74e5;
}

.pb-device-title span {
    flex: 1;
}

.pb-device-subtitle {
    font-size: 0.8125rem;
    color: #707080;
    font-weight: 400;
    margin-left: 0.75rem;
}

.pb-config-row {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    width: 100%;
}

.pb-config-group {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.pb-config-label {
    font-size: 0.8125rem;
    color: #909090;
    font-weight: 500;
}

.pb-config-input {
    width: 80px;
    padding: 0.5rem 0.625rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.875rem;
    text-align: center;
    transition: all 0.2s ease;
}

.pb-config-input:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.5);
    box-shadow: 0 0 0 3px rgba(79, 116, 229, 0.1);
}

.pb-config-select {
    padding: 0.5rem 0.75rem;
    padding-right: 2rem;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.pb-config-select:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.5);
}

.pb-config-select option {
    background: #1a1a2e;
    color: #ffffff;
    padding: 0.5rem;
}

.pb-capabilities {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    padding-left: 1.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.pb-capability-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-dark, #0f0f1a);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pb-capability-toggle:hover {
    border-color: var(--accent-blue, #4f74e5);
}

.pb-capability-toggle.active {
    background: rgba(79, 116, 229, 0.15);
    border-color: var(--accent-blue, #4f74e5);
}

.pb-capability-toggle input[type="checkbox"] {
    display: none;
}

.pb-capability-check {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color, #2d2d44);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pb-capability-toggle.active .pb-capability-check {
    background: var(--accent-blue, #4f74e5);
    border-color: var(--accent-blue, #4f74e5);
}

.pb-capability-check i {
    font-size: 0.625rem;
    color: white;
    opacity: 0;
}

.pb-capability-toggle.active .pb-capability-check i {
    opacity: 1;
}

.pb-capability-label {
    font-size: 0.8125rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-capability-toggle.active .pb-capability-label {
    color: var(--accent-blue, #4f74e5);
}

/* ===== STEP LIST ===== */

.pb-step-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    width: 100%;
}

.pb-step-container::-webkit-scrollbar {
    width: 8px;
}

.pb-step-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.pb-step-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.pb-step-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pb-step-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    width: 100%;
}

.pb-step-list-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #606070;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pb-step-list-header span {
    flex: 1;
}

.pb-step-list-header .header-duration {
    width: 100px;
    text-align: center;
}

.pb-step-list-header .header-enabled {
    width: 60px;
    text-align: center;
}

.pb-step-list-header .header-actions {
    width: 80px;
}

.pb-step-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.125rem;
    background: linear-gradient(135deg, rgba(15, 15, 26, 0.8) 0%, rgba(10, 10, 20, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    transition: all 0.2s ease;
    position: relative;
    width: 100%;
}

.pb-step-item:hover {
    border-color: rgba(79, 116, 229, 0.4);
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.9) 0%, rgba(15, 15, 28, 1) 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.pb-step-item.from-overlay {
    border-left: 4px solid #4bc0ba;
    background: linear-gradient(135deg, rgba(75, 192, 186, 0.05) 0%, rgba(10, 10, 20, 0.9) 100%);
}

.pb-step-item.from-overlay::before {
    content: 'CAPABILITY';
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #4bc0ba;
    background: rgba(75, 192, 186, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: 0 12px 0 6px;
}

.pb-step-item.disabled {
    opacity: 0.45;
}

.pb-step-item.disabled .pb-step-icon {
    filter: grayscale(1);
}

.pb-step-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #606070;
    flex-shrink: 0;
}

.pb-step-drag {
    cursor: grab;
    color: #505060;
    padding: 0.375rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.pb-step-drag:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #909090;
}

.pb-step-drag:active {
    cursor: grabbing;
    color: #4f74e5;
}

.pb-step-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(79, 116, 229, 0.15) 0%, rgba(79, 116, 229, 0.05) 100%);
    border: 1px solid rgba(79, 116, 229, 0.2);
    border-radius: 10px;
    font-size: 1rem;
    color: #4f74e5;
    flex-shrink: 0;
}

.pb-step-info {
    flex: 1;
    min-width: 0;
}

.pb-step-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-step-type {
    font-size: 0.75rem;
    color: #707080;
}

.pb-step-condition-badge {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 3px 8px;
    background: rgba(254, 190, 16, 0.12);
    color: #febe10;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pb-step-overlay-badge {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 3px 8px;
    background: rgba(75, 192, 186, 0.12);
    color: #4bc0ba;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pb-step-duration {
    width: 100px;
    flex-shrink: 0;
}

.pb-step-duration input {
    width: 100%;
    padding: 0.5rem 0.625rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: right;
    transition: all 0.2s ease;
}

.pb-step-duration input:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.5);
    box-shadow: 0 0 0 3px rgba(79, 116, 229, 0.1);
}

.pb-step-duration-unit {
    font-size: 0.75rem;
    color: #606070;
    margin-left: 0.375rem;
    font-weight: 500;
}

.pb-step-toggle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
}

.pb-step-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4f74e5;
}

.pb-step-actions {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
}

.pb-step-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #606070;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pb-step-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.pb-step-action-btn.delete:hover {
    background: rgba(231, 76, 60, 0.12);
    border-color: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.pb-step-action-btn.duplicate:hover {
    background: rgba(79, 116, 229, 0.12);
    border-color: rgba(79, 116, 229, 0.3);
    color: #4f74e5;
}

/* ===== EMPTY STATE ===== */

.pb-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: #606070;
    width: 100%;
    height: 100%;
}

.pb-empty-state i {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    opacity: 0.4;
}

.pb-empty-state p {
    font-size: 1rem;
    max-width: 300px;
    line-height: 1.6;
}

.pb-empty-state .pb-empty-hint {
    font-size: 0.8125rem;
    color: #505060;
    margin-top: 0.75rem;
}

/* ===== ADD STEP BUTTON ===== */

.pb-add-step-wrapper {
    margin-top: 1rem;
    position: relative;
    width: 100%;
}

.pb-add-step-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 2px dashed rgba(79, 116, 229, 0.3);
    border-radius: 12px;
    color: #4f74e5;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pb-add-step-btn:hover {
    border-color: #4f74e5;
    background: rgba(79, 116, 229, 0.08);
    box-shadow: 0 4px 20px rgba(79, 116, 229, 0.15);
}

.pb-add-step-btn i {
    font-size: 0.875rem;
}

/* ===== ADD STEP DROPDOWN ===== */

.pb-add-step-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    max-height: 400px;
    overflow-y: auto;
    background: linear-gradient(180deg, #1a1a2e 0%, #141422 100%);
    border: 1px solid rgba(79, 116, 229, 0.3);
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    padding: 0.75rem;
    display: none;
}

.pb-add-step-dropdown.show {
    display: block;
    animation: dropdownSlideIn 0.2s ease-out;
}

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

/* Add Step Dropdown Options */
.pb-add-step-category {
    padding: 0.625rem 0.75rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #606070;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 0.5rem;
}

.pb-add-step-category:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0.375rem;
}

.pb-add-step-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 0.875rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.pb-add-step-option:hover {
    background: rgba(79, 116, 229, 0.15);
}

.pb-add-step-option i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 116, 229, 0.1);
    border-radius: 6px;
    font-size: 0.875rem;
    color: #4f74e5;
}

.pb-add-step-option span {
    flex: 1;
}

.pb-dropdown-category {
    padding: 0.5rem 0.75rem 0.375rem;
    font-size: 0.625rem;
    font-weight: 700;
    color: #505060;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.pb-step-type-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 0.875rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.pb-step-type-item:hover {
    background: rgba(79, 116, 229, 0.12);
}

.pb-step-type-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 116, 229, 0.1);
    border-radius: 8px;
    font-size: 0.875rem;
    color: #4f74e5;
}

.pb-step-type-info {
    flex: 1;
}

.pb-step-type-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 2px;
}

.pb-step-type-desc {
    font-size: 0.75rem;
    color: #707080;
}

.pb-step-type-time {
    font-size: 0.75rem;
    font-weight: 500;
    color: #606070;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* ===== FOOTER ===== */

.pb-footer {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(180deg, rgba(15, 15, 26, 0.95) 0%, #0a0a14 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-shrink: 0;
    width: 100%;
    grid-row: 3;
}

.pb-summary {
    display: flex;
    gap: 2.5rem;
    flex: 1;
}

.pb-summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pb-summary-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #606070;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pb-summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.pb-summary-value.highlight {
    color: #4f74e5;
}

.pb-preview-select {
    padding: 0.5rem 0.75rem;
    padding-right: 2rem;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.8125rem;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.pb-preview-select:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.5);
}

.pb-preview-select option {
    background: #1a1a2e;
    color: #ffffff;
    padding: 0.5rem;
}

.pb-histogram {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 40px;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.pb-histogram-bar {
    width: 6px;
    min-height: 2px;
    background: linear-gradient(180deg, #4f74e5 0%, #6b8cff 100%);
    border-radius: 3px 3px 0 0;
    transition: height 0.2s ease;
}

.pb-actions {
    display: flex;
    gap: 0.75rem;
}

.pb-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-btn i {
    font-size: 0.8125rem;
}

.pb-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0a0b0;
}

.pb-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.pb-btn-primary {
    background: linear-gradient(135deg, #4f74e5 0%, #6b8cff 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 116, 229, 0.3);
}

.pb-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(79, 116, 229, 0.4);
}

.pb-btn-danger {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.pb-btn-danger:hover {
    background: rgba(231, 76, 60, 0.15);
    border-color: rgba(231, 76, 60, 0.3);
}

/* Keep old primary hover for backwards compat */
.pb-btn-primary:hover:not(:disabled) {
    background: #3d5fc7;
}

.pb-btn-danger {
    background: transparent;
    border: 1px solid var(--border-color, #2d2d44);
    color: var(--text-secondary, #a0a0b0);
}

.pb-btn-danger:hover {
    background: rgba(231, 76, 60, 0.15);
    border-color: var(--accent-red, #e74c3c);
    color: var(--accent-red, #e74c3c);
}

/* ===== JOURNEY BUILDER TAB ===== */

.pb-journey-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 500px;
    overflow: hidden;
    flex: 1 1 auto;
}

.pb-journey-layout > .pb-journey-sidebar,
.pb-journey-layout > .pb-journey-graph-wrapper,
.pb-journey-layout > .pb-journey-properties {
    /* These need to be in a row container */
}

/* Wrapper for the main journey content (sidebar + graph + properties) */
.pb-journey-content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Journey Footer */
.pb-journey-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-dark, #0f0f1a);
    border-top: 1px solid var(--border-color, #2d2d44);
    flex-shrink: 0;
}

.pb-journey-footer-actions {
    display: flex;
    gap: 0.75rem;
}

.pb-journey-status {
    font-size: 0.8125rem;
    color: var(--text-muted, #666680);
}

/* Journey Sidebar */
.pb-journey-sidebar {
    width: 200px;
    min-width: 200px;
    background: var(--bg-dark, #0f0f1a);
    border-right: 1px solid var(--border-color, #2d2d44);
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
}

.pb-journey-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.pb-journey-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin: 0;
}

.pb-journey-list {
    flex: 1;
    overflow-y: auto;
}

.pb-journey-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 4px;
}

.pb-journey-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.pb-journey-item.active {
    background: var(--accent-blue, #4f74e5);
    color: white;
}

.jb-journey-name {
    flex: 1;
    font-size: 0.8125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jb-journey-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.pb-journey-item:hover .jb-journey-actions {
    opacity: 1;
}

.jb-journey-rename,
.jb-journey-delete {
    padding: 0.25rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.jb-journey-rename:hover,
.jb-journey-delete:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.jb-journey-delete:hover {
    color: #e74c3c;
}

.jb-no-journeys {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted, #666680);
    font-size: 0.8125rem;
}

.pb-journey-templates {
    border-top: 1px solid var(--border-color, #2d2d44);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.pb-journey-templates h5 {
    font-size: 0.6875rem;
    text-transform: uppercase;
    color: var(--text-muted, #666680);
    margin-bottom: 0.5rem;
}

.pb-template-btn {
    width: 100%;
    padding: 0.375rem 0.5rem;
    margin-bottom: 4px;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 4px;
    color: var(--text-secondary, #a0a0b0);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.pb-template-btn:hover {
    background: var(--bg-dark, #0f0f1a);
    color: var(--text-primary, #ffffff);
    border-color: var(--accent-blue, #4f74e5);
}

/* Graph Wrapper */
.pb-journey-graph-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

.pb-journey-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-dark, #0f0f1a);
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.jb-tool-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 4px;
    color: var(--text-secondary, #a0a0b0);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.jb-tool-btn:hover {
    background: var(--bg-dark, #0f0f1a);
    color: var(--text-primary, #ffffff);
}

.jb-tool-btn.active {
    background: var(--accent-blue, #4f74e5);
    border-color: var(--accent-blue, #4f74e5);
    color: white;
}

.jb-toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color, #2d2d44);
    margin: 0 0.25rem;
}

.jb-toolbar-spacer {
    flex: 1;
}

.jb-status {
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
    padding: 0 0.5rem;
}

.jb-status.active {
    color: var(--accent-yellow, #febe10);
    font-weight: 500;
}

/* Graph Container */
.pb-journey-graph {
    flex: 1;
    min-height: 400px;
    height: 100%;
    background: var(--bg-secondary, #1a1a2e);
    background-image: 
        linear-gradient(rgba(45, 45, 68, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45, 45, 68, 0.3) 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
}

/* Ensure vis.js canvas fills container */
.pb-journey-graph > div {
    width: 100% !important;
    height: 100% !important;
}

/* Properties Panel */
.pb-journey-properties {
    width: 220px;
    min-width: 220px;
    background: var(--bg-dark, #0f0f1a);
    border-left: 1px solid var(--border-color, #2d2d44);
    padding: 0.75rem;
    overflow-y: auto;
}

.pb-journey-properties h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin: 0 0 0.75rem 0;
}

.jb-no-selection {
    color: var(--text-muted, #666680);
    font-size: 0.8125rem;
    text-align: center;
    padding: 1rem;
}

.jb-prop-group {
    margin-bottom: 0.75rem;
}

.jb-prop-group label {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted, #666680);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Multi-select for devices */
#jb-node-devices {
    min-height: 120px;
    max-height: 200px;
}

#jb-node-devices optgroup {
    font-weight: 600;
    color: var(--text-secondary, #a0a0b0);
    padding: 4px 0;
}

#jb-node-devices option {
    padding: 4px 8px;
    cursor: pointer;
}

#jb-node-devices option:checked {
    background: var(--accent-blue, #4f74e5) !important;
    color: white !important;
}

.jb-prop-group .pb-config-input,
.jb-prop-group .pb-config-select {
    width: 100%;
}

/* Placeholder state */
.pb-journey-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #666680);
    text-align: center;
    padding: 2rem;
}

.pb-journey-placeholder i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.pb-journey-placeholder h3 {
    font-size: 1.25rem;
    color: var(--text-secondary, #a0a0b0);
    margin-bottom: 0.5rem;
}

.pb-journey-placeholder p {
    font-size: 0.875rem;
    max-width: 400px;
}

/* ===== EMPTY STATE ===== */

.pb-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #666680);
    text-align: center;
    padding: 2rem;
}

.pb-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.pb-empty-state p {
    font-size: 0.875rem;
}

/* ===== DRAG AND DROP ===== */

.pb-step-item.sortable-ghost {
    opacity: 0.4;
    background: var(--accent-blue, #4f74e5);
}

.pb-step-item.sortable-chosen {
    box-shadow: 0 4px 12px rgba(79, 116, 229, 0.3);
}

.pb-step-item.sortable-drag {
    opacity: 1;
}

/* ===== SCROLLBAR ===== */

.pb-step-container::-webkit-scrollbar,
.pb-device-list::-webkit-scrollbar,
.pb-add-step-dropdown::-webkit-scrollbar {
    width: 6px;
}

.pb-step-container::-webkit-scrollbar-track,
.pb-device-list::-webkit-scrollbar-track,
.pb-add-step-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.pb-step-container::-webkit-scrollbar-thumb,
.pb-device-list::-webkit-scrollbar-thumb,
.pb-add-step-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-color, #2d2d44);
    border-radius: 3px;
}

.pb-step-container::-webkit-scrollbar-thumb:hover,
.pb-device-list::-webkit-scrollbar-thumb:hover,
.pb-add-step-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted, #666680);
}

/* ===== PASSENGER TYPES TAB ===== */

.pb-pax-layout {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 500px;
    overflow: hidden;
    flex: 1 1 auto;
}

/* Passenger Type Sidebar */
.pb-pax-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--bg-dark, #0f0f1a);
    border-right: 1px solid var(--border-color, #2d2d44);
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    overflow-y: auto;
}

.pb-pax-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-pax-header h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin: 0;
}

.pb-pax-list {
    flex: 1;
    overflow-y: auto;
    min-height: 150px;
    max-height: 300px;
}

.pb-pax-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 4px;
}

.pb-pax-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.pb-pax-item.active {
    background: var(--accent-blue, #4f74e5);
    color: white;
}

.pb-pax-item-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.pb-pax-item-info {
    flex: 1;
    min-width: 0;
}

.pb-pax-item-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pb-pax-item-id {
    font-size: 0.6875rem;
    color: var(--text-muted, #666680);
}

.pb-pax-item.active .pb-pax-item-name,
.pb-pax-item.active .pb-pax-item-id {
    color: white;
}

.pb-pax-item-badge {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted, #666680);
    text-transform: uppercase;
}

.pb-pax-item.active .pb-pax-item-badge {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.pb-pax-actions {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #2d2d44);
    margin-top: 0.75rem;
}

.pb-pax-actions .pb-btn {
    width: 100%;
}

/* Global Passenger Settings */
.pb-pax-global-settings {
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color, #2d2d44);
    margin-top: 0.75rem;
}

.pb-pax-global-settings h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary, #f4f4f5);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-pax-global-settings h4 i {
    color: var(--primary-blue, #4f74e5);
    font-size: 0.7rem;
}

.pb-pax-global-field {
    margin-bottom: 0.5rem;
}

.pb-pax-global-field:last-child {
    margin-bottom: 0;
}

.pb-pax-global-field label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary, #a8b3cf);
    margin-bottom: 0.25rem;
}

.pb-pax-global-field input {
    width: 100%;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    background: var(--bg-dark, #0d0d15);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 4px;
    color: var(--text-primary, #f4f4f5);
}

.pb-pax-global-field input:focus {
    outline: none;
    border-color: var(--primary-blue, #4f74e5);
}

/* Passenger Distribution */
.pb-pax-distribution {
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color, #2d2d44);
    margin-top: 0.75rem;
}

.pb-pax-distribution h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary, #f4f4f5);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-pax-distribution h4 i {
    color: var(--primary-blue, #4f74e5);
    font-size: 0.7rem;
}

.pb-pax-dist-list {
    max-height: 200px;
    overflow-y: auto;
    min-height: 100px;
}

.pb-pax-dist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pb-pax-dist-item:last-child {
    border-bottom: none;
}

.pb-pax-dist-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pb-pax-dist-name {
    flex: 1;
    font-size: 0.7rem;
    color: var(--text-secondary, #a8b3cf);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pb-pax-dist-input-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pb-pax-dist-input-group input {
    width: 50px;
    padding: 0.25rem 0.35rem;
    font-size: 0.7rem;
    text-align: right;
    background: var(--bg-dark, #0d0d15);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 4px;
    color: var(--text-primary, #f4f4f5);
}

.pb-pax-dist-input-group input:focus {
    outline: none;
    border-color: var(--primary-blue, #4f74e5);
}

.pb-pax-dist-input-group span {
    font-size: 0.7rem;
    color: var(--text-muted, #666);
}

.pb-pax-dist-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin-top: 0.5rem;
    background: var(--bg-dark, #0d0d15);
    border-radius: 4px;
    font-size: 0.75rem;
}

.pb-pax-dist-total span:first-child {
    color: var(--text-secondary, #a8b3cf);
}

.pb-pax-dist-total span:last-child {
    color: var(--primary-blue, #4f74e5);
    font-weight: 600;
}

.pb-pax-dist-total.warning span:last-child {
    color: #febe10;
}

.pb-pax-dist-total.error span:last-child {
    color: #e74c3c;
}

.pb-pax-dist-total.valid span:last-child {
    color: #2ecc71;
}

.pb-pax-dist-total.valid::after {
    content: " ✓";
    color: #2ecc71;
}

.pb-pax-dist-desc {
    font-size: 0.75rem;
    color: var(--text-muted, #8892b0);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.pb-pax-dist-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #2d2d44);
}

.pb-pax-dist-actions .pb-btn {
    flex: 1;
    font-size: 0.7rem;
    padding: 0.35rem 0.5rem;
}

/* Main Editor Area */
.pb-pax-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-secondary, #1a1a2e);
}

.pb-pax-editor {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.pb-pax-no-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted, #666680);
    text-align: center;
}

.pb-pax-no-selection i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.pb-pax-no-selection p {
    font-size: 0.9375rem;
}

/* Form */
.pb-pax-form {
    max-width: 800px;
}

.pb-pax-form-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-pax-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-dark, #0f0f1a);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color, #2d2d44);
}

.pb-pax-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s ease;
}

.pb-pax-title-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin: 0 0 0.25rem 0;
}

.pb-pax-id {
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
    font-family: monospace;
}

/* Form Grid */
.pb-pax-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.pb-pax-section {
    background: var(--bg-dark, #0f0f1a);
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-pax-section h5 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #a0a0b0);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-pax-field {
    margin-bottom: 1rem;
}

.pb-pax-field:last-child {
    margin-bottom: 0;
}

.pb-pax-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary, #a0a0b0);
    margin-bottom: 0.375rem;
}

.pb-pax-hint {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted, #666680);
    margin-top: 0.25rem;
}

/* Color Picker */
.pb-pax-color-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pb-pax-color-picker {
    width: 48px;
    height: 36px;
    padding: 0;
    border: 2px solid var(--border-color, #2d2d44);
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
}

.pb-pax-color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.pb-pax-color-picker::-webkit-color-swatch {
    border-radius: 4px;
    border: none;
}

.pb-pax-color-text {
    flex: 1;
    font-family: monospace;
    text-transform: uppercase;
}

/* Checkbox Field */
.pb-pax-checkbox-field {
    margin-bottom: 0.75rem;
}

.pb-pax-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary, #ffffff);
}

.pb-pax-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue, #4f74e5);
    cursor: pointer;
}

.pb-pax-group-fields {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #2d2d44);
}

/* Form Actions */
.pb-pax-form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #2d2d44);
}

/* ===== SPAWN EDITOR TAB ===== */

.pb-spawn-layout {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 500px;
    overflow: hidden;
    flex: 1 1 auto;
}

/* Spawn Point Sidebar */
.pb-spawn-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-dark, #0f0f1a);
    border-right: 1px solid var(--border-color, #2d2d44);
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
}

/* Schedule Toggle Section in Spawn Sidebar */
.pb-schedule-toggle-section {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(79, 116, 229, 0.1), rgba(79, 116, 229, 0.05));
    border-bottom: 1px solid var(--border-color, #2d2d44);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pb-schedule-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-schedule-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue, #4f74e5);
    cursor: pointer;
}

.pb-schedule-toggle span {
    font-weight: 500;
}

#schedule-edit-btn {
    width: 100%;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-blue, #4f74e5), #6b5ce7);
    border: none;
    color: white;
}

#schedule-edit-btn:hover {
    background: linear-gradient(135deg, #5a84f5, #7b6cf7);
    transform: translateY(-1px);
}

#schedule-edit-btn i {
    margin-right: 0.5rem;
}

.pb-spawn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-spawn-header h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin: 0;
}

.pb-spawn-count {
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.pb-spawn-list {
    flex: 1;
    overflow-y: auto;
}

.pb-spawn-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    text-align: center;
    color: var(--text-muted, #666680);
}

.pb-spawn-empty i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.pb-spawn-empty p {
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
}

.pb-spawn-empty small {
    font-size: 0.75rem;
    opacity: 0.7;
}

.pb-spawn-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.pb-spawn-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.pb-spawn-item.active {
    background: var(--accent-blue, #4f74e5);
    color: white;
    border-color: var(--accent-blue, #4f74e5);
}

.pb-spawn-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.pb-spawn-item.active .pb-spawn-item-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.pb-spawn-item.disabled .pb-spawn-item-icon {
    background: rgba(128, 128, 128, 0.15);
    color: #808080;
}

.pb-spawn-item-info {
    flex: 1;
    min-width: 0;
}

.pb-spawn-item-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pb-spawn-item-stats {
    font-size: 0.6875rem;
    color: var(--text-muted, #666680);
    margin-top: 2px;
}

.pb-spawn-item.active .pb-spawn-item-name,
.pb-spawn-item.active .pb-spawn-item-stats {
    color: white;
}

.pb-spawn-item-status {
    font-size: 0.5625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.pb-spawn-item-status.enabled {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

.pb-spawn-item-status.disabled {
    background: rgba(128, 128, 128, 0.15);
    color: #808080;
}

.pb-spawn-item.active .pb-spawn-item-status {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.pb-spawn-actions {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #2d2d44);
    margin-top: 0.75rem;
}

.pb-spawn-actions .pb-btn {
    width: 100%;
}

/* Main Editor Area */
.pb-spawn-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-secondary, #1a1a2e);
    min-height: 0; /* Important for flexbox scrolling */
}

.pb-spawn-editor {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.pb-spawn-no-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted, #666680);
    text-align: center;
}

.pb-spawn-no-selection i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.pb-spawn-no-selection p {
    font-size: 0.9375rem;
}

/* Form */
.pb-spawn-form {
    max-width: 900px;
}

.pb-spawn-form-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-spawn-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.2), rgba(46, 204, 113, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #2ecc71;
    flex-shrink: 0;
}

.pb-spawn-title-section {
    flex: 1;
}

.pb-spawn-name-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--border-color, #2d2d44);
    color: var(--text-primary, #ffffff);
    font-size: 1.25rem;
    font-weight: 600;
    padding: 0.25rem 0;
    width: 100%;
    transition: border-color 0.2s ease;
}

.pb-spawn-name-input:focus {
    outline: none;
    border-color: var(--accent-blue, #4f74e5);
}

.pb-spawn-id {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
    font-family: monospace;
    margin-top: 0.25rem;
}

.pb-spawn-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-spawn-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2ecc71;
    cursor: pointer;
}

/* Form Grid */
.pb-spawn-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.pb-spawn-section {
    background: var(--bg-dark, #0f0f1a);
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-spawn-section-wide {
    grid-column: 1 / -1;
}

.pb-spawn-section h5 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #a0a0b0);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-spawn-section-desc {
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
    margin: -0.5rem 0 1rem 0;
}

.pb-spawn-field {
    margin-bottom: 1rem;
}

.pb-spawn-field:last-child {
    margin-bottom: 0;
}

.pb-spawn-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary, #a0a0b0);
    margin-bottom: 0.375rem;
}

.pb-spawn-hint {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted, #666680);
    margin-top: 0.25rem;
}

/* Checkbox Field */
.pb-spawn-checkbox-field {
    margin-bottom: 0.75rem;
}

.pb-spawn-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary, #ffffff);
}

.pb-spawn-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue, #4f74e5);
    cursor: pointer;
}

/* Distribution Grid */
.pb-spawn-distribution {
    margin-top: 1rem;
}

.pb-spawn-dist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.pb-spawn-dist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-spawn-dist-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pb-spawn-dist-name {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-spawn-dist-input {
    width: 50px;
    text-align: right;
}

.pb-spawn-dist-total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #2d2d44);
    font-size: 0.875rem;
    font-weight: 600;
}

.pb-spawn-dist-total span:last-child {
    color: var(--accent-blue, #4f74e5);
}

/* Routing Grid */
.pb-spawn-route-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.pb-spawn-route-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-spawn-route-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.pb-spawn-route-info {
    flex: 1;
}

.pb-spawn-route-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
}

.pb-spawn-route-desc {
    font-size: 0.6875rem;
    color: var(--text-muted, #666680);
}

.pb-spawn-route-input {
    width: 60px;
    text-align: right;
}

/* Form Actions */
.pb-spawn-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #2d2d44);
}

/* ===== SCHEDULE EDITOR ===== */

/* Schedule Toggle Section in Sidebar */
.pb-schedule-toggle-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, rgba(79, 116, 229, 0.1), rgba(79, 116, 229, 0.05));
    border-radius: 8px;
    border: 1px solid rgba(79, 116, 229, 0.2);
}

.pb-schedule-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
}

.pb-schedule-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue, #4f74e5);
}

.pb-btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
}

/* Schedule Editor Panel */
.pb-schedule-editor {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Important for flexbox scrolling */
}

.pb-schedule-editor .pb-schedule-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.pb-schedule-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-dark, #0f0f1a);
    border-bottom: 1px solid var(--border-color, #2d2d44);
    flex-shrink: 0;
}

.pb-schedule-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.pb-schedule-title i {
    font-size: 1.25rem;
    color: var(--accent-blue, #4f74e5);
}

.pb-schedule-title h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
}

.pb-schedule-summary {
    display: flex;
    gap: 1.5rem;
}

.pb-schedule-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-schedule-stat i {
    font-size: 0.875rem;
    color: var(--text-muted, #666680);
}

.pb-schedule-stat strong {
    color: var(--text-primary, #ffffff);
}

/* Schedule Sections */
.pb-schedule-section {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-schedule-section h5 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #a0a0b0);
}

.pb-schedule-section h5 i {
    font-size: 0.875rem;
}

/* Default Mix Section */
.pb-schedule-mix-section {
    background: rgba(255, 255, 255, 0.02);
}

.pb-schedule-mix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.pb-schedule-mix-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-dark, #0f0f1a);
    border-radius: 6px;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-schedule-mix-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pb-schedule-mix-name {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-schedule-mix-input {
    width: 55px;
    text-align: right;
}

/* Schedule Toolbar */
.pb-schedule-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.pb-schedule-range-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-schedule-range-select label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary, #a0a0b0);
}

.pb-schedule-quick-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Schedule Grid */
.pb-schedule-grid-container {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 6px;
}

.pb-schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.pb-schedule-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-dark, #0f0f1a);
}

.pb-schedule-table th {
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #a0a0b0);
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-schedule-table td {
    padding: 0.375rem 0.75rem;
    border-bottom: 1px solid rgba(45, 45, 68, 0.5);
}

.pb-schedule-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.pb-schedule-table .schedule-time {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
    white-space: nowrap;
}

.pb-schedule-table .schedule-pax-input {
    width: 70px;
}

.pb-schedule-table .schedule-wave-select {
    width: 130px;
}

.pb-schedule-mix-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pb-schedule-mix-badge.default {
    background: rgba(128, 128, 128, 0.15);
    color: var(--text-muted, #666680);
}

.pb-schedule-mix-badge.custom {
    background: rgba(79, 116, 229, 0.15);
    color: var(--accent-blue, #4f74e5);
}

.pb-schedule-mix-badge:hover {
    opacity: 0.8;
}

/* Schedule Footer */
.pb-schedule-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-dark, #0f0f1a);
    border-top: 1px solid var(--border-color, #2d2d44);
    flex-shrink: 0;
}

/* Schedule Allocation Section */
.pb-schedule-allocation-section {
    background: linear-gradient(135deg, rgba(79, 116, 229, 0.08), rgba(79, 116, 229, 0.02));
    border: 1px solid rgba(79, 116, 229, 0.15);
}

.pb-schedule-allocation-fields {
    margin-top: 1rem;
}

.pb-spawn-field-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.pb-spawn-field-row .pb-spawn-field {
    flex: 1;
    min-width: 120px;
}

.pb-active-windows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pb-active-window-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-dark, #0f0f1a);
    border-radius: 6px;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-active-window-row span {
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
}

.pb-active-window-row input[type="time"] {
    width: 100px;
}

/* Legacy Section */
.pb-legacy-spawn-section {
    opacity: 0.6;
    border: 1px dashed var(--border-color, #2d2d44);
}

.pb-legacy-spawn-section.hidden {
    display: none;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 900px) {
    #process-builder-modal .modal-dialog {
        max-width: 100%;
        margin: 0.5rem;
    }

    .pb-sidebar {
        width: 200px;
        min-width: 200px;
    }

    .pb-config-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .pb-capabilities {
        margin-left: 0;
    }

    .pb-footer {
        flex-wrap: wrap;
    }

    .pb-summary {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 700px) {
    .pb-device-layout {
        flex-direction: column;
    }

    .pb-sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-color, #2d2d44);
    }

    .pb-device-list {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .pb-category {
        display: contents;
    }

    .pb-category-header {
        display: none;
    }

    .pb-device-item {
        flex: 0 0 auto;
    }
}

/* ===== GANTT CHART SCHEDULE EDITOR ===== */

.pb-schedule-editor {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    position: relative;
    min-height: 400px;
}

.pb-schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-schedule-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-schedule-title h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary, #e0e0e8);
}

.pb-schedule-title i {
    color: var(--accent-color, #4f74e5);
}

.pb-schedule-summary {
    display: flex;
    gap: 1.5rem;
}

.pb-schedule-stat {
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0b8);
}

.pb-schedule-stat strong {
    color: var(--text-primary, #e0e0e8);
    font-weight: 700;
}

.pb-schedule-section {
    background: var(--bg-secondary, #16162a);
    border-radius: 8px;
    padding: 1rem;
}

.pb-schedule-section h5 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary, #a0a0b8);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-schedule-section h5 i {
    color: var(--accent-color, #4f74e5);
}

.pb-schedule-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pb-schedule-range-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-schedule-range-select label {
    font-size: 0.8rem;
    color: var(--text-muted, #666680);
}

.pb-schedule-quick-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pb-schedule-quick-actions input {
    width: 100px;
}

.pb-schedule-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #2d2d44);
}

/* Default mix grid */
.pb-schedule-mix-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.pb-schedule-mix-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
}

.pb-schedule-mix-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.pb-schedule-mix-name {
    color: var(--text-secondary, #a0a0b8);
    min-width: 70px;
}

.pb-schedule-mix-input {
    width: 50px !important;
    text-align: center;
}

.schedule-gantt-container {
    width: 100%;
    background: var(--bg-secondary, #16162a);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    overflow-x: auto;
}

/* Hour markers header */
.schedule-gantt-header {
    display: flex;
    align-items: center;
    padding-left: 60px; /* Align with blocks (for time label column) */
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
    padding-bottom: 0.5rem;
}

.schedule-gantt-hour {
    flex: 0 0 50px; /* 2 blocks per hour = 25px each * 2 */
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted, #666680);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.schedule-gantt-hour:nth-child(even) {
    opacity: 0.6;
}

/* Main chart area */
.schedule-gantt-chart {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    min-height: 180px;
    padding-left: 60px; /* Space for time labels */
    position: relative;
}

/* Individual time block */
.schedule-block {
    flex: 0 0 23px;
    min-width: 23px;
    height: 160px;
    background: var(--bg-tertiary, #1e1e38);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 4px;
    display: flex;
    flex-direction: column-reverse; /* Stack from bottom */
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.schedule-block:hover {
    border-color: var(--accent-color, #4f74e5);
    box-shadow: 0 0 8px rgba(79, 116, 229, 0.3);
    transform: translateY(-2px);
}

.schedule-block.active {
    border-color: #f1c40f;
    box-shadow: 0 0 12px rgba(241, 196, 15, 0.4);
}

.schedule-block.empty {
    background: var(--bg-tertiary, #1e1e38);
    opacity: 0.5;
}

/* Global limit indicator on block */
.schedule-block-limit {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: var(--text-muted, #666680);
    background: rgba(0, 0, 0, 0.5);
    padding: 1px 4px;
    border-radius: 2px;
    z-index: 2;
}

/* Duration indicator for blocks > 30min */
.schedule-block-duration {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    color: var(--accent-color, #4f74e5);
    background: rgba(79, 116, 229, 0.2);
    padding: 1px 4px;
    border-radius: 2px;
    z-index: 2;
    font-weight: 600;
}

/* Stacked spawn bar inside block */
.spawn-bar {
    width: 100%;
    min-height: 4px;
    transition: height 0.2s ease;
}

.spawn-bar:hover {
    opacity: 0.85;
    filter: brightness(1.1);
}

/* Spawn bar and legend colors (assigned dynamically) */
.spawn-bar[data-color="1"], .block-spawn-color[data-color="1"], .schedule-legend-color[data-color="1"] { background: linear-gradient(180deg, #e74c3c, #c0392b); }
.spawn-bar[data-color="2"], .block-spawn-color[data-color="2"], .schedule-legend-color[data-color="2"] { background: linear-gradient(180deg, #3498db, #2980b9); }
.spawn-bar[data-color="3"], .block-spawn-color[data-color="3"], .schedule-legend-color[data-color="3"] { background: linear-gradient(180deg, #2ecc71, #27ae60); }
.spawn-bar[data-color="4"], .block-spawn-color[data-color="4"], .schedule-legend-color[data-color="4"] { background: linear-gradient(180deg, #f1c40f, #f39c12); }
.spawn-bar[data-color="5"], .block-spawn-color[data-color="5"], .schedule-legend-color[data-color="5"] { background: linear-gradient(180deg, #9b59b6, #8e44ad); }
.spawn-bar[data-color="6"], .block-spawn-color[data-color="6"], .schedule-legend-color[data-color="6"] { background: linear-gradient(180deg, #1abc9c, #16a085); }
.spawn-bar[data-color="7"], .block-spawn-color[data-color="7"], .schedule-legend-color[data-color="7"] { background: linear-gradient(180deg, #e67e22, #d35400); }
.spawn-bar[data-color="8"], .block-spawn-color[data-color="8"], .schedule-legend-color[data-color="8"] { background: linear-gradient(180deg, #34495e, #2c3e50); }

/* Time label on left edge (every hour) */
.schedule-block-time {
    position: absolute;
    left: -58px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    color: var(--text-muted, #666680);
    width: 50px;
    text-align: right;
    padding-right: 5px;
}

/* Legend */
.schedule-gantt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 0;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border-color, #2d2d44);
}

.schedule-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary, #a0a0b8);
}

.schedule-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.schedule-legend-empty {
    color: var(--text-muted, #666680);
    font-size: 0.8rem;
    font-style: italic;
}

/* Block editor no spawns message */
.block-no-spawns {
    color: var(--text-muted, #666680);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
    font-style: italic;
}

/* ===== BLOCK EDITOR POPUP ===== */

.schedule-block-editor {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 360px;
    max-width: 95%;
    background: var(--bg-primary, #0f0f1a);
    border: 2px solid var(--accent-color, #4f74e5);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(79, 116, 229, 0.2);
    z-index: 1000;
    overflow: hidden;
}

.block-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--accent-color, #4f74e5), var(--accent-secondary, #7b5fe3));
    color: white;
}

.block-editor-time {
    font-weight: 700;
    font-size: 1rem;
}

.block-editor-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.block-editor-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.block-editor-content {
    padding: 1rem;
    max-height: 350px;
    overflow-y: auto;
}

.block-editor-global {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.block-editor-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.block-editor-row label {
    font-size: 0.8rem;
    color: var(--text-secondary, #a0a0b8);
    min-width: 75px;
}

.block-editor-row input {
    flex: 1;
    max-width: 100px;
}

.block-editor-row select {
    flex: 1;
}

/* Per-spawn allocation list */
.block-editor-spawns {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.block-spawn-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary, #16162a);
    border-radius: 6px;
    border: 1px solid var(--border-color, #2d2d44);
}

.block-spawn-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.block-spawn-name {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-primary, #e0e0e8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.block-spawn-input {
    width: 60px;
    text-align: center;
}

.block-spawn-percent {
    font-size: 0.7rem;
    color: var(--text-muted, #666680);
    width: 40px;
    text-align: right;
}

/* Block editor footer */
.block-editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary, #16162a);
    border-top: 1px solid var(--border-color, #2d2d44);
}

.block-editor-total {
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0b8);
}

.block-editor-total strong {
    color: var(--text-primary, #e0e0e8);
    font-size: 1rem;
}

.block-editor-total span {
    color: var(--text-muted, #666680);
}

.block-editor-total.over-limit strong {
    color: #e74c3c;
}

.block-editor-total.under-limit strong {
    color: #f1c40f;
}

.block-editor-actions {
    display: flex;
    gap: 0.5rem;
}

/* Warning style for normalize button */
.pb-btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.pb-btn-warning:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

/* ===== GANTT RESPONSIVE ===== */

@media (max-width: 900px) {
    .schedule-gantt-container {
        padding: 0.5rem;
    }
    
    .schedule-block {
        flex: 0 0 18px;
        min-width: 18px;
        height: 120px;
    }
    
    .schedule-gantt-hour {
        flex: 0 0 36px;
        font-size: 0.6rem;
    }
    
    .schedule-block-limit {
        display: none;
    }
}

/* ===== JOURNEY DISTRIBUTION TAB ===== */

.pb-journey-dist-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
    gap: 1.5rem;
    overflow: hidden;
}

.pb-journey-dist-header {
    flex-shrink: 0;
}

.pb-journey-dist-header h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--text-primary, #e0e0e8);
    font-weight: 600;
}

.pb-journey-dist-header h4 i {
    margin-right: 0.5rem;
    color: var(--accent-blue, #4f74e5);
}

.pb-journey-dist-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-journey-dist-content {
    flex: 1;
    overflow: auto;
    background: var(--bg-dark, #0f0f1a);
    border-radius: 8px;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-journey-dist-matrix {
    padding: 1rem;
    min-height: 300px;
}

.pb-journey-dist-no-journeys {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-muted, #666680);
    gap: 0.75rem;
}

.pb-journey-dist-no-journeys i {
    font-size: 3rem;
    opacity: 0.5;
}

.pb-journey-dist-no-journeys p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary, #a0a0b0);
}

.pb-journey-dist-no-journeys span {
    font-size: 0.875rem;
}

/* Distribution Table */
.pb-journey-dist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.pb-journey-dist-table th,
.pb-journey-dist-table td {
    padding: 0.75rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-journey-dist-table thead th {
    background: var(--bg-secondary, #16162a);
    color: var(--text-primary, #e0e0e8);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.pb-journey-dist-table th.pax-type-col {
    text-align: left;
    min-width: 140px;
}

.pb-journey-dist-table th.journey-col {
    min-width: 100px;
}

.pb-journey-dist-table th.total-col {
    min-width: 80px;
}

.pb-journey-dist-table th.action-col {
    min-width: 80px;
}

.pb-journey-dist-table tbody tr {
    transition: background-color 0.15s ease;
}

.pb-journey-dist-table tbody tr:hover {
    background: rgba(79, 116, 229, 0.05);
}

.pb-journey-dist-table tbody tr:last-child td {
    border-bottom: none;
}

/* Passenger Type Cell */
.jd-pax-type-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

.jd-pax-type-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.jd-pax-type-name {
    font-weight: 500;
    color: var(--text-primary, #e0e0e8);
}

/* Percentage Input Cell */
.jd-percent-cell {
    position: relative;
}

.jd-percent-input {
    width: 60px;
    text-align: center;
    padding: 0.5rem;
    background: var(--bg-secondary, #16162a);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 4px;
    color: var(--text-primary, #e0e0e8);
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.jd-percent-input:focus {
    outline: none;
    border-color: var(--accent-blue, #4f74e5);
    box-shadow: 0 0 0 2px rgba(79, 116, 229, 0.2);
}

.jd-percent-input::-webkit-inner-spin-button,
.jd-percent-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.jd-percent-suffix {
    margin-left: 2px;
    color: var(--text-muted, #666680);
}

/* Total Cell */
.jd-total-cell {
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.jd-total-value {
    color: var(--text-primary, #e0e0e8);
}

.jd-total-value.valid {
    color: #2ecc71;
}

.jd-total-value.invalid {
    color: #e74c3c;
}

.jd-total-icon {
    font-size: 0.875rem;
}

.jd-total-icon.valid {
    color: #2ecc71;
}

.jd-total-icon.invalid {
    color: #e74c3c;
}

/* Action Cell */
.jd-action-cell {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.jd-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary, #a0a0b0);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.jd-action-btn:hover {
    background: rgba(79, 116, 229, 0.1);
    color: var(--accent-blue, #4f74e5);
}

.jd-action-btn[title*="Normalize"]:hover {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.jd-action-btn[title*="Copy"]:hover {
    background: rgba(243, 156, 18, 0.1);
    color: #f39c12;
}

/* Summary Section */
.pb-journey-dist-summary {
    flex-shrink: 0;
    padding: 1rem;
    background: var(--bg-dark, #0f0f1a);
    border-radius: 8px;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-journey-dist-validation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.pb-journey-dist-validation .validation-icon {
    font-size: 1rem;
}

.pb-journey-dist-validation.valid .validation-icon {
    color: #2ecc71;
}

.pb-journey-dist-validation.invalid .validation-icon {
    color: #e74c3c;
}

.pb-journey-dist-validation .validation-text {
    color: var(--text-secondary, #a0a0b0);
}

.pb-journey-dist-validation.valid .validation-text {
    color: #2ecc71;
}

.pb-journey-dist-validation.invalid .validation-text {
    color: #e74c3c;
}

/* Footer */
.pb-journey-dist-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #2d2d44);
}

.pb-journey-dist-actions-left,
.pb-journey-dist-actions-right {
    display: flex;
    gap: 0.75rem;
}

/* Journey Column Header */
.jd-journey-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.jd-journey-name {
    font-weight: 600;
    color: var(--text-primary, #e0e0e8);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jd-journey-icon {
    font-size: 1rem;
    color: var(--accent-blue, #4f74e5);
    margin-bottom: 0.25rem;
}

/* Row-level normalize animation */
.jd-row-normalizing td {
    background: rgba(46, 204, 113, 0.1);
    transition: background-color 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .pb-journey-dist-layout {
        padding: 1rem;
    }
    
    .jd-percent-input {
        width: 50px;
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    
    .pb-journey-dist-table th,
    .pb-journey-dist-table td {
        padding: 0.5rem;
    }
    
    .jd-pax-type-name {
        font-size: 0.8rem;
    }
}

/* ===== JOURNEY BUILDER DEVICE CHECKBOX LIST ===== */

.jb-device-checklist {
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-dark, #0f0f1a);
    border: 1px solid var(--border-color, #2d2d44);
    border-radius: 6px;
    padding: 0.5rem;
}

.jb-device-checklist::-webkit-scrollbar {
    width: 6px;
}

.jb-device-checklist::-webkit-scrollbar-track {
    background: var(--bg-secondary, #16162a);
    border-radius: 3px;
}

.jb-device-checklist::-webkit-scrollbar-thumb {
    background: var(--border-color, #2d2d44);
    border-radius: 3px;
}

.jb-device-checklist::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue, #4f74e5);
}

/* Category Headers */
.jb-device-category {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted, #666680);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 0.25rem 0.25rem 0.25rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border-color, #2d2d44);
}

.jb-device-category:first-child {
    margin-top: 0;
    border-top: none;
    padding-top: 0.25rem;
}

/* Checkbox Items */
.jb-device-item {
    display: flex;
    align-items: center;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.jb-device-item:hover {
    background: rgba(79, 116, 229, 0.1);
}

.jb-device-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: var(--accent-blue, #4f74e5);
}

.jb-device-item label {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary, #e0e0e8);
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.jb-device-item:has(input:checked) {
    background: rgba(79, 116, 229, 0.15);
}

.jb-device-item:has(input:checked) label {
    color: var(--accent-blue, #4f74e5);
    font-weight: 500;
}

/* Empty state */
.jb-device-checklist-empty {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted, #666680);
    font-size: 0.85rem;
}

/* Schedule Mix Info Section */
.pb-schedule-mix-info {
    padding: 0.75rem;
    background: rgba(79, 116, 229, 0.05);
    border-radius: 6px;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-schedule-mix-info p {
    font-size: 0.8rem;
    color: var(--text-secondary, #a0a0b0);
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.pb-schedule-mix-info p i {
    color: var(--accent-blue, #4f74e5);
    margin-right: 0.35rem;
}

.pb-schedule-mix-info strong {
    color: var(--accent-blue, #4f74e5);
}

.pb-schedule-mix-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pb-schedule-mix-summary .mix-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary, #232338);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-primary, #e0e0e8);
    border-left: 3px solid;
}

.pb-schedule-mix-summary .mix-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pb-schedule-mix-summary .mix-empty {
    color: var(--text-muted, #666680);
    font-style: italic;
    font-size: 0.8rem;
}

/* ===== SCHEDULE IMPORT SECTION ===== */

.pb-schedule-import-section {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color, #2d2d44);
    background: var(--bg-secondary, #1a1a2e);
}

.pb-schedule-import-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pb-schedule-import-panel {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary, #232338);
    border-radius: 8px;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-schedule-upload-area {
    border: 2px dashed rgba(79, 116, 229, 0.4);
    border-radius: 8px;
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(79, 116, 229, 0.05);
}

.pb-schedule-upload-area:hover {
    border-color: rgba(79, 116, 229, 0.7);
    background: rgba(79, 116, 229, 0.1);
}

.pb-schedule-upload-area.drag-over {
    border-color: var(--accent-blue, #4f74e5);
    background: rgba(79, 116, 229, 0.15);
}

.pb-schedule-upload-area i {
    font-size: 2rem;
    color: rgba(79, 116, 229, 0.6);
    display: block;
    margin-bottom: 0.5rem;
}

.pb-schedule-upload-area p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-schedule-file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.3);
    border-radius: 6px;
}

.pb-schedule-file-info i {
    font-size: 1.25rem;
    color: #27ae60;
}

.pb-schedule-file-info span {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary, #e0e0e8);
    font-size: 0.85rem;
}

.pb-schedule-import-options {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.pb-schedule-import-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.pb-schedule-import-row:last-child {
    margin-bottom: 0;
}

.pb-schedule-import-row label {
    font-size: 0.8rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-schedule-import-row select {
    flex: 1;
    max-width: 200px;
}

.pb-schedule-import-preview {
    margin-top: 0.75rem;
}

.pb-schedule-preview-stats {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.pb-stat {
    flex: 1;
    background: rgba(79, 116, 229, 0.1);
    border-radius: 6px;
    padding: 0.5rem;
    text-align: center;
}

.pb-stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-blue, #4f74e5);
}

.pb-stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary, #a0a0b0);
    text-transform: uppercase;
}

.pb-schedule-preview-table-wrap {
    max-height: 200px;
    overflow-y: auto;
    border-radius: 6px;
    border: 1px solid var(--border-color, #2d2d44);
}

.pb-schedule-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.pb-schedule-preview-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-primary, #0f0f1a);
}

.pb-schedule-preview-table th {
    padding: 0.5rem 0.4rem;
    text-align: left;
    font-weight: 500;
    color: var(--text-secondary, #a0a0b0);
    border-bottom: 1px solid var(--border-color, #2d2d44);
}

.pb-schedule-preview-table td {
    padding: 0.35rem 0.4rem;
    color: var(--text-primary, #e0e0e8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pb-schedule-preview-table tbody tr:hover {
    background: rgba(79, 116, 229, 0.1);
}

.pb-schedule-preview-errors {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 4px;
}

.pb-error-label {
    font-size: 0.75rem;
    color: #e74c3c;
    display: block;
    margin-bottom: 0.25rem;
}

.pb-schedule-preview-errors ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.7rem;
    color: #e8a8a8;
}

.pb-schedule-import-actions {
    margin-top: 0.75rem;
    display: flex;
    justify-content: center;
}

.pb-schedule-import-success {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(39, 174, 96, 0.15);
    border: 1px solid rgba(39, 174, 96, 0.4);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #27ae60;
    font-weight: 500;
    font-size: 0.85rem;
}

.pb-schedule-import-success i {
    font-size: 1.25rem;
}

/* Fix import toggle button text color */
#pb-schedule-import-toggle {
    color: var(--text-primary, #e0e0e8);
    background: rgba(79, 116, 229, 0.15);
    border: 1px solid rgba(79, 116, 229, 0.3);
}

#pb-schedule-import-toggle:hover {
    background: rgba(79, 116, 229, 0.25);
    border-color: rgba(79, 116, 229, 0.5);
    color: #fff;
}

/* Block editor spawn mode selector */
.block-editor-spawn-mode {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.block-editor-spawn-mode label {
    font-size: 0.75rem;
    color: var(--text-secondary, #a0a0b0);
}

.block-editor-spawn-mode select {
    flex: 1;
}

/* Block spawn row percentage mode styling */
.block-spawn-suffix {
    font-size: 0.75rem;
    color: var(--text-secondary, #a0a0b0);
    margin-left: -0.25rem;
}

.block-spawn-count {
    font-size: 0.7rem;
    color: var(--text-muted, #666680);
    margin-left: 0.25rem;
}

/* Spawn allocation section in import options */
.pb-schedule-spawn-allocation {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pb-spawn-alloc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-spawn-alloc-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 150px;
    overflow-y: auto;
}

.pb-spawn-alloc-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.pb-spawn-alloc-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.pb-spawn-alloc-name {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-primary, #e0e0e8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pb-spawn-alloc-input {
    width: 60px;
    text-align: right;
}

.pb-spawn-alloc-suffix {
    font-size: 0.75rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-spawn-alloc-total {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-spawn-alloc-total strong {
    color: var(--text-primary, #e0e0e8);
}

.pb-spawn-alloc-warning {
    color: #e74c3c;
    font-size: 0.75rem;
}

.pb-spawn-alloc-total.valid strong {
    color: #27ae60;
}

.pb-spawn-alloc-empty {
    font-size: 0.8rem;
    color: var(--text-muted, #666680);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.pb-btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Make import panel scrollable */
.pb-schedule-import-panel {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    margin-top: 0.5rem;
}

.pb-schedule-import-section {
    margin-bottom: 1rem;
}

.pb-schedule-import-upload {
    margin-bottom: 0.75rem;
}

.pb-schedule-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.pb-schedule-upload-area:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.pb-schedule-upload-area.drag-over {
    border-color: var(--accent-color, #3b82f6);
    background: rgba(59, 130, 246, 0.1);
}

.pb-schedule-upload-area i {
    font-size: 2rem;
    color: var(--text-secondary, #a0a0b0);
    margin-bottom: 0.5rem;
}

.pb-schedule-upload-area p {
    color: var(--text-secondary, #a0a0b0);
    font-size: 0.85rem;
    margin: 0;
}

.pb-schedule-file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.pb-schedule-file-info i {
    color: #27ae60;
}

.pb-schedule-file-info span {
    flex: 1;
    font-size: 0.85rem;
}

.pb-schedule-import-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.pb-schedule-import-row label {
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-schedule-preview-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.pb-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    flex: 1;
}

.pb-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #e0e0e8);
}

.pb-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted, #666680);
    text-transform: uppercase;
}

.pb-schedule-preview-table-wrap {
    max-height: 120px;
    overflow-y: auto;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
}

.pb-schedule-preview-table {
    width: 100%;
    font-size: 0.75rem;
    border-collapse: collapse;
}

.pb-schedule-preview-table th,
.pb-schedule-preview-table td {
    padding: 0.35rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pb-schedule-preview-table th {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-secondary, #a0a0b0);
    font-weight: 500;
    position: sticky;
    top: 0;
}

.pb-schedule-preview-table td {
    color: var(--text-primary, #e0e0e8);
}

.pb-schedule-preview-errors {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 4px;
}

.pb-error-label {
    font-size: 0.8rem;
    color: #e74c3c;
}

.pb-schedule-preview-errors ul {
    margin: 0.25rem 0 0 1rem;
    padding: 0;
    font-size: 0.75rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-schedule-import-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pb-schedule-import-success {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(39, 174, 96, 0.15);
    border: 1px solid rgba(39, 174, 96, 0.3);
    border-radius: 6px;
    color: #27ae60;
    font-size: 0.85rem;
}

.pb-schedule-import-success i {
    font-size: 1.25rem;
}

/* ===== HYBRID MODE SETTINGS ===== */

.pb-hybrid-mode-section {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(79, 116, 229, 0.1) 0%, rgba(156, 89, 182, 0.08) 100%);
    border: 1px solid rgba(79, 116, 229, 0.25);
    border-radius: 8px;
}

.pb-hybrid-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--accent-color, #4f74e5);
    font-weight: 600;
    font-size: 0.9rem;
}

.pb-hybrid-header i {
    font-size: 1rem;
}

.pb-hybrid-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pb-hybrid-description {
    color: var(--text-secondary, #a0a0b0);
    font-size: 0.8rem;
    line-height: 1.4;
}

.pb-hybrid-slider-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pb-hybrid-slider-row .pb-config-label {
    min-width: 140px;
    font-size: 0.85rem;
}

.pb-hybrid-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.pb-hybrid-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #27ae60 0%, #27ae60 var(--value, 0%), #e74c3c var(--value, 0%), #e74c3c 100%);
    border-radius: 3px;
    cursor: pointer;
}

.pb-hybrid-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #4f74e5;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease;
}

.pb-hybrid-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.pb-hybrid-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #4f74e5;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.pb-hybrid-value {
    min-width: 45px;
    text-align: right;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary, #e0e0e8);
}

.pb-hybrid-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pb-hybrid-bar {
    display: flex;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.pb-hybrid-bar-auto {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pb-hybrid-bar-manual {
    background: linear-gradient(90deg, #e67e22, #e74c3c);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pb-hybrid-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.pb-hybrid-label-auto {
    color: #27ae60;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pb-hybrid-label-manual {
    color: #e74c3c;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pb-hybrid-label-auto i,
.pb-hybrid-label-manual i {
    font-size: 0.75rem;
}

/* ===== DEVICE AVAILABILITY SCHEDULE ===== */

.pb-availability-section {
    margin-top: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.pb-availability-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary, #e0e0e8);
}

.pb-availability-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.pb-availability-header i:first-child {
    color: var(--primary-blue, #4f74e5);
}

.pb-availability-chevron {
    margin-left: auto;
    transition: transform 0.3s;
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
}

.pb-availability-chevron.rotated {
    transform: rotate(180deg);
}

.pb-availability-content {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.15);
}

.pb-availability-description {
    margin-bottom: 1rem;
    color: var(--text-secondary, #a0a0b0);
    font-size: 0.8rem;
    line-height: 1.4;
}

.pb-availability-enable-row {
    margin-bottom: 1rem;
}

.pb-availability-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.pb-availability-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-blue, #4f74e5);
}

/* Presets */
.pb-availability-presets {
    margin-bottom: 1rem;
}

.pb-availability-presets .pb-config-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-availability-preset-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pb-preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: var(--text-primary, #e0e0e8);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pb-preset-btn:hover {
    background: rgba(79, 116, 229, 0.2);
    border-color: rgba(79, 116, 229, 0.4);
}

.pb-preset-btn i {
    font-size: 0.7rem;
}

/* Legend */
.pb-availability-legend {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
}

.pb-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.pb-legend-available {
    background: #10b981;
}

.pb-legend-auto {
    background: #fbbf24;
}

.pb-legend-unavailable {
    background: #ef4444;
}

/* Schedule Grid */
.pb-availability-grid-container {
    margin-bottom: 1rem;
}

.pb-availability-time-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-size: 0.65rem;
    color: var(--text-muted, #666680);
    padding: 0 2px;
}

.pb-availability-grid {
    display: grid;
    grid-template-columns: repeat(48, 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    height: 28px;
}

.pb-availability-grid.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.pb-availability-cell {
    background: #10b981;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.pb-availability-cell:hover {
    filter: brightness(1.2);
    z-index: 1;
}

.pb-availability-cell.drag-hover {
    filter: brightness(1.3);
    outline: 1px solid rgba(255, 255, 255, 0.5);
    z-index: 2;
}

/* Availability states */
.pb-availability-cell.state-available {
    background: #10b981;
}

.pb-availability-cell.state-auto_only {
    background: #fbbf24;
}

.pb-availability-cell.state-unavailable {
    background: #ef4444;
}

/* Stats */
.pb-availability-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.pb-stat-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
}

.pb-stat-label {
    color: var(--text-secondary, #a0a0b0);
}

.pb-stat-value {
    font-weight: 600;
    color: var(--text-primary, #e0e0e8);
}

/* Hint */
.pb-availability-hint {
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
}

.pb-availability-hint i {
    color: var(--primary-blue, #4f74e5);
    margin-right: 0.25rem;
}

/* ===== DEVICE AVAILABILITY TAB ===== */

.pb-availability-layout {
    display: flex;
    width: 100%;
    overflow: hidden;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
}

/* Sidebar */
.pb-avail-sidebar {
    width: 280px;
    min-width: 280px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    background: rgba(15, 15, 26, 0.5);
    min-height: 0;
    overflow: hidden;
}

.pb-avail-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pb-avail-sidebar-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #e0e0e8);
    margin-bottom: 0.75rem;
}

.pb-avail-search-wrapper {
    position: relative;
}

.pb-avail-search-wrapper i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #666680);
    font-size: 0.8rem;
}

.pb-avail-search-wrapper .pb-search-input {
    width: 100%;
    padding-left: 2rem;
}

.pb-avail-device-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    min-height: 0;
}

/* Category sections */
.pb-avail-category {
    margin-bottom: 0.5rem;
}

.pb-avail-category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #a0a0b0);
    transition: all 0.2s;
}

.pb-avail-category-header:hover {
    background: rgba(255, 255, 255, 0.06);
}

.pb-avail-category-header i {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.pb-avail-category-header[data-expanded="false"] i {
    transform: rotate(-90deg);
}

.pb-avail-category-count {
    margin-left: auto;
    background: rgba(79, 116, 229, 0.2);
    color: var(--primary-blue, #4f74e5);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.pb-avail-category-items {
    padding: 0.25rem 0;
}

.pb-avail-category-header[data-expanded="false"] + .pb-avail-category-items {
    display: none;
}

/* Device/Instance items */
.pb-avail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0b0);
}

.pb-avail-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #e0e0e8);
}

.pb-avail-item.active {
    background: linear-gradient(135deg, rgba(79, 116, 229, 0.2) 0%, rgba(79, 116, 229, 0.1) 100%);
    border: 1px solid rgba(79, 116, 229, 0.3);
    color: var(--text-primary, #e0e0e8);
}

.pb-avail-item-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.75rem;
}

.pb-avail-item.active .pb-avail-item-icon {
    background: rgba(79, 116, 229, 0.3);
    color: var(--primary-blue, #4f74e5);
}

.pb-avail-item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pb-avail-item-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

.pb-avail-item-status.has-schedule {
    background: #fbbf24;
}

.pb-avail-item-status.has-override {
    background: #8b5cf6;
}

.pb-avail-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted, #666680);
    font-size: 0.8rem;
}

.pb-avail-empty-state i {
    font-size: 1.5rem;
    opacity: 0.5;
}

/* Main content area */
.pb-avail-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #181828;
    min-height: 0;
    min-width: 0;
}

.pb-avail-main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, #1a1a2e 0%, #181828 100%);
}

.pb-avail-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #e0e0e8);
}

.pb-avail-title i {
    color: var(--primary-blue, #4f74e5);
}

.pb-avail-type-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pb-avail-badge-type {
    background: rgba(79, 116, 229, 0.2);
    color: var(--primary-blue, #4f74e5);
}

.pb-avail-badge-instance {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.pb-avail-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    min-height: 0;
}

/* Empty state in main content */
#pb-avail-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-muted, #666680);
}

#pb-avail-empty-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.3;
    color: var(--primary-blue, #4f74e5);
}

#pb-avail-empty-state p {
    font-size: 1.1rem;
    color: var(--text-secondary, #a0a0b0);
    margin-bottom: 0.5rem;
}

#pb-avail-empty-state .pb-avail-hint {
    font-size: 0.85rem;
    max-width: 400px;
}

/* Schedule editor */
.pb-avail-editor {
    max-width: 800px;
}

.pb-avail-override-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.pb-avail-override-hint {
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
}

.pb-avail-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary, #e0e0e8);
}

.pb-avail-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-blue, #4f74e5);
}

.pb-avail-enable-row {
    margin-bottom: 1rem;
}

.pb-avail-description {
    color: var(--text-muted, #666680);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.pb-avail-presets {
    margin-bottom: 1rem;
}

.pb-avail-preset-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.pb-avail-legend {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #a0a0b0);
}

/* Grid container */
.pb-avail-grid-container {
    margin-bottom: 1rem;
}

.pb-avail-time-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 2px;
    margin-bottom: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted, #666680);
}

.pb-avail-grid {
    display: grid;
    grid-template-columns: repeat(48, 1fr);
    gap: 2px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px;
}

.pb-avail-cell {
    background: #10b981;
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 2px;
}

.pb-avail-cell:hover {
    filter: brightness(1.2);
}

.pb-avail-cell.state-available {
    background: #10b981;
}

.pb-avail-cell.state-auto_only {
    background: #fbbf24;
}

.pb-avail-cell.state-unavailable {
    background: #ef4444;
}

.pb-avail-cell.drag-hover {
    filter: brightness(1.3);
    outline: 1px solid rgba(255, 255, 255, 0.5);
}

/* Stats */
.pb-avail-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Hint */
.pb-avail-hint {
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
}

.pb-avail-hint i {
    color: var(--primary-blue, #4f74e5);
    margin-right: 0.25rem;
}

/* Footer */
.pb-avail-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 15, 26, 0.5);
}

/* ===== DEVICE SCHEDULE IMPORT STYLES ===== */

.pb-avail-import-section {
    padding: 0 1.5rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 0.5rem;
}

.pb-avail-import-header {
    padding: 0.75rem 0;
}

.pb-avail-import-panel {
    background: rgba(15, 15, 26, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.pb-avail-import-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    color: rgba(255, 255, 255, 0.5);
}

.pb-avail-import-dropzone:hover,
.pb-avail-import-dropzone.dragover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

.pb-avail-import-dropzone i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.pb-avail-import-dropzone p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.pb-avail-import-dropzone span {
    color: #3b82f6;
    text-decoration: underline;
}

.pb-avail-import-schema-hint {
    margin-top: 0.5rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
}

.pb-avail-import-preview {
    max-height: 260px;
    overflow-y: auto;
    margin-top: 0.75rem;
}

.pb-avail-import-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Import preview table */
.schedule-import-summary {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0 0.75rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.schedule-import-warn {
    color: #f59e0b;
}

.schedule-import-warnings {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
}

.schedule-import-warn-item {
    color: #f59e0b;
    padding: 0.15rem 0;
}

.schedule-import-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.schedule-import-table th {
    text-align: left;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.schedule-import-table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.8);
}

.schedule-import-row-unmatched td {
    color: rgba(255, 255, 255, 0.4);
}

.schedule-import-status-matched {
    color: #22c55e;
}

.schedule-import-status-unmatched {
    color: #ef4444;
}

/* Toast notification */
.schedule-import-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #fff;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.schedule-import-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.schedule-import-toast-success {
    background: rgba(34, 197, 94, 0.9);
}

.schedule-import-toast-warn {
    background: rgba(245, 158, 11, 0.9);
}

/* ===== BAGGAGE HANDLING TAB STYLES ===== */

.baggage-handling-container {
    padding: 1.5rem;
    max-width: 800px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.baggage-section {
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.baggage-section h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-teal, #00d4aa);
    font-size: 1.1rem;
}

.baggage-section h3 i {
    margin-right: 0.5rem;
}

.baggage-section .section-description {
    color: var(--text-secondary, #888);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.baggage-section .config-row {
    margin-bottom: 1rem;
}

.baggage-section .config-row label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary, #fff);
}

.baggage-section .input-with-unit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.baggage-section .input-with-unit input {
    width: 120px;
    padding: 0.5rem;
    border: 1px solid var(--border-color, #333);
    border-radius: 4px;
    background: var(--bg-primary, #12121a);
    color: var(--text-primary, #fff);
}

.baggage-section .input-with-unit input:focus {
    outline: none;
    border-color: var(--primary-teal, #00d4aa);
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.15);
}

.baggage-section .input-with-unit .unit {
    color: var(--text-secondary, #888);
    font-size: 0.9rem;
}

.baggage-section .help-text {
    font-size: 0.8rem;
    color: var(--text-muted, #666);
    margin-top: 0.25rem;
}

.baggage-section .calculated-value {
    background: var(--bg-primary, #12121a);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.baggage-section .calculated-value label {
    font-weight: 500;
    margin-right: 0.5rem;
    color: var(--text-primary, #fff);
}

.baggage-section .highlight-value {
    color: var(--primary-teal, #00d4aa);
    font-weight: 600;
    font-size: 1.1rem;
}

.baggage-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #333);
}

.baggage-actions .btn-primary,
.baggage-actions .btn-secondary {
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.baggage-actions .btn-primary {
    background: var(--primary-teal, #00d4aa);
    color: #000;
    border: none;
}

.baggage-actions .btn-primary:hover {
    background: #00b894;
}

.baggage-actions .btn-secondary {
    background: transparent;
    color: var(--text-primary, #fff);
    border: 1px solid var(--border-color, #333);
}

.baggage-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary, #888);
}
