/**
 * Settings Modal - Default Values Editor Styles
 * Tabbed interface for editing passenger and device defaults
 */

/* ===== BOX SIZING RESET ===== */

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

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

#settings-modal.modal {
    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);
}

#settings-modal.modal.show {
    display: flex;
    animation: settingsModalFadeIn 0.25s ease-out;
}

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

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

/* ===== MODAL CONTENT ===== */

.settings-modal-content {
    width: 90vw;
    max-width: 900px;
    max-height: 85vh;
    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;
    animation: settingsModalSlideIn 0.3s ease-out;
}

/* ===== MODAL HEADER ===== */

#settings-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%);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#settings-modal .modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
}

#settings-modal .modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #a8b3cf;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#settings-modal .modal-close:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

/* ===== TABS ===== */

.settings-tabs {
    display: flex;
    gap: 0;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.settings-tab {
    flex: 1;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: #a8b3cf;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.settings-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.settings-tab.active {
    background: rgba(79, 116, 229, 0.1);
    color: #4f74e5;
    border-bottom-color: #4f74e5;
}

.settings-tab i {
    font-size: 1rem;
}

/* ===== MODAL BODY ===== */

.settings-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

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

.settings-description {
    color: #a8b3cf;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* ===== PASSENGER SETTINGS GRID ===== */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.settings-passenger-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.settings-passenger-card:hover {
    border-color: rgba(79, 116, 229, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.settings-passenger-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-passenger-color-preview {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.settings-passenger-name {
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    flex: 1;
}

.settings-passenger-type-id {
    font-size: 0.75rem;
    color: #6b7891;
    text-transform: uppercase;
}

.settings-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.settings-field-row:last-child {
    margin-bottom: 0;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.settings-field.full-width {
    grid-column: 1 / -1;
}

.settings-field label {
    font-size: 0.75rem;
    color: #a8b3cf;
    font-weight: 500;
}

.settings-field input[type="text"],
.settings-field input[type="number"],
.settings-field input[type="color"] {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: #fff;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.settings-field input:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.5);
    box-shadow: 0 0 0 2px rgba(79, 116, 229, 0.15);
}

.settings-field input[type="color"] {
    width: 100%;
    height: 36px;
    padding: 2px;
    cursor: pointer;
}

/* ===== DEVICE SETTINGS LIST ===== */

.settings-device-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.settings-device-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.settings-device-item:hover {
    border-color: rgba(79, 116, 229, 0.3);
}

.settings-device-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.settings-device-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.settings-device-color-bar {
    width: 4px;
    height: 40px;
    border-radius: 2px;
}

.settings-device-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.settings-device-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.settings-device-info {
    flex: 1;
}

.settings-device-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

.settings-device-category {
    font-size: 0.75rem;
    color: #6b7891;
}

.settings-device-summary {
    font-size: 0.8rem;
    color: #a8b3cf;
    text-align: right;
}

.settings-device-expand {
    color: #6b7891;
    transition: transform 0.2s ease;
}

.settings-device-item.expanded .settings-device-expand {
    transform: rotate(180deg);
}

.settings-device-body {
    display: none;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.settings-device-item.expanded .settings-device-body {
    display: block;
    animation: fadeIn 0.2s ease;
}

.settings-device-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

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

.settings-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.settings-footer-left {
    display: flex;
    gap: 0.5rem;
}

.settings-footer-right {
    display: flex;
    gap: 0.75rem;
}

/* ===== BUTTONS ===== */

#settings-modal .btn-primary,
#settings-modal .btn-secondary,
#settings-modal .btn-danger {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border: none;
}

#settings-modal .btn-primary {
    background: linear-gradient(135deg, #4f74e5 0%, #3d5dc9 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 116, 229, 0.3);
}

#settings-modal .btn-primary:hover {
    background: linear-gradient(135deg, #5a7fe8 0%, #4866d1 100%);
    box-shadow: 0 6px 16px rgba(79, 116, 229, 0.4);
    transform: translateY(-1px);
}

#settings-modal .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #a8b3cf;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#settings-modal .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

#settings-modal .btn-danger {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

#settings-modal .btn-danger:hover {
    background: rgba(231, 76, 60, 0.25);
    border-color: rgba(231, 76, 60, 0.5);
}

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

.settings-modal-body::-webkit-scrollbar {
    width: 8px;
}

.settings-modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.settings-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.settings-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ===== DEVICE PROCESS EDITOR ===== */

.process-editor-layout {
    display: flex;
    gap: 1rem;
    height: 100%;
    min-height: 450px;
}

/* Device Sidebar */
.process-device-sidebar {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.process-device-search {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.process-device-search input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: #fff;
    font-size: 0.8rem;
}

.process-device-search input:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.5);
}

.process-device-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.process-device-category {
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7891;
    letter-spacing: 0.5px;
}

.process-device-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.8rem;
    color: #a8b3cf;
}

.process-device-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.process-device-item.active {
    background: rgba(79, 116, 229, 0.2);
    color: #4f74e5;
}

.process-device-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.process-device-item-icon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.process-device-item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Editor Area */
.process-editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.process-editor-header {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.process-editor-no-selection {
    text-align: center;
    padding: 2rem;
    color: #6b7891;
}

.process-editor-no-selection i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.process-editor-no-selection p {
    font-size: 0.875rem;
}

.process-editor-device-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.process-device-icon-large {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.process-device-icon-large img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.process-device-details {
    flex: 1;
}

.process-device-details h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.process-device-details .process-device-category {
    padding: 0;
    font-size: 0.75rem;
    color: #6b7891;
}

.process-time-summary {
    text-align: right;
}

.process-time-label {
    font-size: 0.75rem;
    color: #6b7891;
    display: block;
}

.process-time-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #4bc0ba;
}

/* Steps Container */
.process-steps-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    overflow: hidden;
}

.process-steps-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.process-steps-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}

.add-step-select {
    background: rgba(79, 116, 229, 0.2);
    border: 1px solid rgba(79, 116, 229, 0.3);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    color: #4f74e5;
    font-size: 0.8rem;
    cursor: pointer;
}

.add-step-select:hover {
    background: rgba(79, 116, 229, 0.3);
}

.process-steps-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.process-steps-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7891;
}

.process-steps-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Step Card */
.process-step-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.15s ease;
}

.process-step-card:hover {
    border-color: rgba(79, 116, 229, 0.3);
}

.process-step-card.sortable-ghost {
    opacity: 0.4;
}

.process-step-card.sortable-drag {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.process-step-card.disabled {
    opacity: 0.5;
}

.process-step-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
}

.process-step-drag {
    color: #6b7891;
    cursor: grab;
    padding: 0.25rem;
}

.process-step-drag:active {
    cursor: grabbing;
}

.process-step-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 116, 229, 0.2);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    color: #4f74e5;
}

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

.process-step-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.process-step-type {
    font-size: 0.7rem;
    color: #6b7891;
}

.process-step-duration {
    font-size: 0.875rem;
    color: #4bc0ba;
    font-weight: 500;
}

.process-step-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.process-step-action {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #6b7891;
    cursor: pointer;
    transition: all 0.15s ease;
}

.process-step-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.process-step-action.delete:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.process-step-expand {
    transition: transform 0.2s ease;
}

.process-step-card.expanded .process-step-expand {
    transform: rotate(180deg);
}

/* Step Body (Expanded) */
.process-step-body {
    display: none;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.process-step-card.expanded .process-step-body {
    display: block;
    animation: fadeIn 0.2s ease;
}

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

.process-step-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.process-step-field.full-width {
    grid-column: 1 / -1;
}

.process-step-field label {
    font-size: 0.7rem;
    color: #a8b3cf;
    font-weight: 500;
}

.process-step-field input,
.process-step-field select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: #fff;
    font-size: 0.8rem;
}

.process-step-field input:focus,
.process-step-field select:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.5);
}

/* Condition Editor */
.process-step-condition {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.process-step-condition select {
    flex: 1;
}

.process-step-condition input[type="number"] {
    width: 70px;
}

/* Step Params Section */
.process-step-params {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.process-step-params-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7891;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* Enabled Toggle */
.process-step-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.process-step-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4f74e5;
}

/* ===== CAPABILITY OVERLAY EDITOR ===== */

.overlay-editor-layout {
    display: flex;
    gap: 1rem;
    height: 100%;
    min-height: 450px;
}

/* Overlay Sidebar */
.overlay-sidebar {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.overlay-sidebar-title {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7891;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.overlay-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.overlay-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 0.25rem;
}

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

.overlay-item.active {
    background: rgba(79, 116, 229, 0.2);
}

.overlay-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(155, 89, 182, 0.2);
    border-radius: 8px;
    color: #9b59b6;
    font-size: 0.9rem;
}

.overlay-item.active .overlay-item-icon {
    background: rgba(79, 116, 229, 0.3);
    color: #4f74e5;
}

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

.overlay-item-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overlay-item-steps {
    font-size: 0.7rem;
    color: #6b7891;
}

/* Main Overlay Editor */
.overlay-editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.overlay-editor-header {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.overlay-editor-no-selection {
    text-align: center;
    padding: 2rem;
    color: #6b7891;
}

.overlay-editor-no-selection i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.overlay-editor-no-selection p {
    font-size: 0.875rem;
}

.overlay-editor-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.overlay-icon-large {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(155, 89, 182, 0.2);
    border-radius: 10px;
    color: #9b59b6;
    font-size: 1.25rem;
}

.overlay-details {
    flex: 1;
}

.overlay-details h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.overlay-description {
    font-size: 0.75rem;
    color: #6b7891;
}

.overlay-time-summary {
    text-align: right;
}

.overlay-time-label {
    font-size: 0.75rem;
    color: #6b7891;
    display: block;
}

.overlay-time-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #9b59b6;
}

/* Overlay Steps Container - reuse process step styles */
.overlay-steps-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    overflow: hidden;
}

.overlay-steps-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.overlay-steps-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}

.overlay-steps-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.overlay-steps-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7891;
}

.overlay-steps-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Overlay steps use the same step card styles as process steps */

/* ===== DEFAULT JOURNEY EDITOR ===== */

.journey-editor-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
}

/* Journey Info Section */
.journey-info-section {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.journey-info-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.journey-info-field label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7891;
}

.journey-info-field input[type="text"] {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: #fff;
    font-size: 0.875rem;
}

.journey-info-field input[type="text"]:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.5);
}

.journey-enabled-field {
    display: flex;
    align-items: flex-end;
}

.journey-enabled-field label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: #a8b3cf;
}

.journey-enabled-field input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4f74e5;
}

/* Journey Steps Section */
.journey-steps-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    overflow: hidden;
}

.journey-steps-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.journey-steps-header h4 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.journey-steps-header h4 i {
    color: #4bc0ba;
}

.journey-steps-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    min-height: 200px;
}

.journey-steps-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7891;
}

.journey-steps-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Journey Step Card */
.journey-step-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.15s ease;
}

.journey-step-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

.journey-step-card.disabled {
    opacity: 0.5;
}

.journey-step-drag {
    cursor: grab;
    color: #6b7891;
    font-size: 0.9rem;
}

.journey-step-drag:hover {
    color: #fff;
}

.journey-step-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 116, 229, 0.2);
    color: #4f74e5;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
}

.journey-step-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

.journey-step-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

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

.journey-step-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.journey-step-label input {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    width: 120px;
}

.journey-step-label input:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.journey-step-label input:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.5);
    background: rgba(0, 0, 0, 0.2);
}

.journey-step-device {
    font-size: 0.7rem;
    color: #6b7891;
}

.journey-step-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.journey-step-count label {
    font-size: 0.7rem;
    color: #6b7891;
}

.journey-step-count input {
    width: 50px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    color: #fff;
    font-size: 0.8rem;
    text-align: center;
}

.journey-step-required {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: #6b7891;
}

.journey-step-required input {
    width: 14px;
    height: 14px;
    accent-color: #4f74e5;
}

.journey-step-actions button {
    background: none;
    border: none;
    color: #6b7891;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.875rem;
    transition: color 0.15s ease;
}

.journey-step-actions button:hover {
    color: #e74c3c;
}

/* Journey Layout Section */
.journey-layout-section {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.journey-layout-section h4 {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.journey-layout-section h4 i {
    color: #febe10;
}

.journey-layout-fields {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.journey-layout-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.journey-layout-field label {
    font-size: 0.7rem;
    font-weight: 500;
    color: #6b7891;
}

.journey-layout-field input,
.journey-layout-field select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: #fff;
    font-size: 0.8rem;
}

.journey-layout-field input:focus,
.journey-layout-field select:focus {
    outline: none;
    border-color: rgba(79, 116, 229, 0.5);
}

/* ===== SCHEDULE IMPORT TAB ===== */

.schedule-import-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Upload Area */
.schedule-upload-section {
    width: 100%;
}

.schedule-upload-area {
    border: 2px dashed rgba(79, 116, 229, 0.4);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    text-align: center;
    background: rgba(79, 116, 229, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.schedule-upload-area:hover {
    border-color: rgba(79, 116, 229, 0.7);
    background: rgba(79, 116, 229, 0.1);
}

.schedule-upload-area.drag-over {
    border-color: var(--primary-blue);
    background: rgba(79, 116, 229, 0.15);
    transform: scale(1.02);
}

.schedule-upload-area i {
    font-size: 3rem;
    color: rgba(79, 116, 229, 0.6);
    margin-bottom: 1rem;
    display: block;
}

.schedule-upload-area p {
    margin: 0;
    font-size: 1rem;
    color: #a8b3cf;
}

.schedule-upload-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6b7891;
}

/* File Info */
.schedule-file-info {
    padding: 1rem;
    background: rgba(79, 116, 229, 0.1);
    border: 1px solid rgba(79, 116, 229, 0.3);
    border-radius: 8px;
}

.schedule-file-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.schedule-file-name i {
    font-size: 1.5rem;
    color: #27ae60;
}

.schedule-file-name span {
    flex: 1;
    font-weight: 500;
    color: #fff;
}

.schedule-clear-file {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #a8b3cf;
    transition: all 0.2s;
}

.schedule-clear-file:hover {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

/* Options Section */
.schedule-options {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.schedule-options h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.schedule-options h4 i {
    color: var(--primary-blue);
}

.schedule-option {
    margin-bottom: 0.5rem;
}

.schedule-option:last-child {
    margin-bottom: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: #a8b3cf;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-blue);
}

/* Preview Section */
.schedule-preview {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.schedule-preview h4 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.schedule-preview h4 i {
    color: var(--primary-teal);
}

/* Summary Grid */
.schedule-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.schedule-summary-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.schedule-summary-label {
    display: block;
    font-size: 0.7rem;
    color: #6b7891;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.schedule-summary-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

/* Flights Table */
.schedule-flights-table-container {
    max-height: 300px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.schedule-flights-table thead {
    position: sticky;
    top: 0;
    background: rgba(15, 15, 26, 0.98);
}

.schedule-flights-table th {
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 500;
    color: #a8b3cf;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.schedule-flights-table td {
    padding: 0.5rem;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.schedule-flights-table tbody tr:hover {
    background: rgba(79, 116, 229, 0.1);
}

.schedule-flights-table .flight-number {
    font-weight: 600;
    color: var(--primary-blue);
}

.schedule-flights-table .destination {
    color: #a8b3cf;
}

.schedule-flights-table .check-in-window {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.75rem;
}

.schedule-flights-table .passengers {
    text-align: right;
    font-weight: 500;
}

/* Parse Errors */
.schedule-errors {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
}

.schedule-errors h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: #e74c3c;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.schedule-errors ul {
    margin: 0;
    padding-left: 1.5rem;
    font-size: 0.8rem;
    color: #e8a8a8;
}

.schedule-errors li {
    margin-bottom: 0.25rem;
}

/* Import Actions */
.schedule-import-actions {
    display: flex;
    justify-content: center;
    padding-top: 0.5rem;
}

.schedule-import-actions .btn-primary {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

/* Import Result */
.schedule-import-result {
    padding: 1rem;
    border-radius: 8px;
}

.schedule-import-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(39, 174, 96, 0.15);
    border: 1px solid rgba(39, 174, 96, 0.4);
    border-radius: 8px;
    color: #27ae60;
    font-weight: 500;
}

.schedule-import-success i {
    font-size: 1.5rem;
}

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

@media (max-width: 768px) {
    .settings-modal-content {
        width: 95vw;
        max-height: 90vh;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-device-fields {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .settings-modal-footer {
        flex-direction: column;
        gap: 1rem;
    }
    
    .settings-footer-left,
    .settings-footer-right {
        width: 100%;
        justify-content: center;
    }
    
    .process-editor-layout {
        flex-direction: column;
    }
    
    .process-device-sidebar {
        width: 100%;
        max-height: 150px;
    }
    
    .process-step-fields {
        grid-template-columns: 1fr 1fr;
    }
    
    .overlay-editor-layout {
        flex-direction: column;
    }
    
    .overlay-sidebar {
        width: 100%;
        max-height: 120px;
    }
    
    .journey-info-section {
        grid-template-columns: 1fr;
    }
    
    .journey-layout-fields {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .journey-step-card {
        flex-wrap: wrap;
    }
    
    .schedule-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== IDEMIA BIOMETRICS MODAL ===== */
/* Matches Operations Center (process-builder-modal) styling with purple accent */

#idemia-biometrics-modal,
#idemia-biometrics-modal *,
#idemia-biometrics-modal *::before,
#idemia-biometrics-modal *::after {
    box-sizing: border-box;
}

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

#idemia-biometrics-modal.ib-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);
}

#idemia-biometrics-modal.ib-modal-overlay.show {
    display: flex;
    animation: ibModalFadeIn 0.25s ease-out;
}

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

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

/* ===== MODAL DIALOG & CONTENT ===== */

#idemia-biometrics-modal .ib-modal-dialog {
    max-width: 1400px;
    width: 96vw;
    margin: 0 auto;
    animation: ibModalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

#idemia-biometrics-modal .ib-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(155, 89, 182, 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(155, 89, 182, 0.15);
    overflow: hidden;
}

/* ===== MODAL HEADER ===== */

#idemia-biometrics-modal .ib-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;
}

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

#idemia-biometrics-modal .ib-modal-title img {
    height: 28px;
    width: auto;
}

#idemia-biometrics-modal .ib-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;
}

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

/* ===== MODAL BODY ===== */

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

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

.ib-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;
    z-index: 100;
}

.ib-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;
}

.ib-tab-btn:hover {
    color: #ffffff;
    background: rgba(155, 89, 182, 0.06);
}

.ib-tab-btn.active {
    color: #ffffff;
    background: rgba(155, 89, 182, 0.12);
}

.ib-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #9b59b6, #c39bd3);
    border-radius: 3px 3px 0 0;
}

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

.ib-tab-btn.active i {
    opacity: 1;
    color: #9b59b6;
}

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

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

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

.ib-tab-pane.active {
    display: flex;
    width: 100%;
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

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

#idemia-biometrics-modal .ib-modal-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(15, 15, 26, 0.8) 0%, rgba(15, 15, 26, 0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ib-footer-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ib-footer-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== BUTTONS ===== */

#idemia-biometrics-modal .ib-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border: none;
}

#idemia-biometrics-modal .ib-btn-primary {
    background: linear-gradient(135deg, #9b59b6 0%, #7d3c98 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

#idemia-biometrics-modal .ib-btn-primary:hover {
    background: linear-gradient(135deg, #a569bd 0%, #884ea0 100%);
    box-shadow: 0 6px 16px rgba(155, 89, 182, 0.4);
    transform: translateY(-1px);
}

#idemia-biometrics-modal .ib-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #a8b3cf;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#idemia-biometrics-modal .ib-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

#idemia-biometrics-modal .ib-btn-danger {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

#idemia-biometrics-modal .ib-btn-danger:hover {
    background: rgba(231, 76, 60, 0.25);
    border-color: rgba(231, 76, 60, 0.5);
}

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

#idemia-biometrics-modal ::-webkit-scrollbar {
    width: 8px;
}

#idemia-biometrics-modal ::-webkit-scrollbar-track {
    background: transparent;
}

#idemia-biometrics-modal ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

#idemia-biometrics-modal ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== TAB 1: DEVICE CONFIG ===== */

.ib-device-config-pane {
    flex-direction: column;
    padding: 1.25rem;
    gap: 1.25rem;
    overflow-y: auto !important;
    overflow-x: hidden;
}

.ib-config-section {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: visible;
    flex-shrink: 0;
}

.ib-config-section-header {
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ib-config-section-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.ib-config-section-header h4 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    flex: 1;
}

.ib-config-section-header i {
    color: #9b59b6;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.ib-config-section-body {
    padding: 0 1rem 1rem;
}

/* Constrain overlay editor inside the Idemia modal collapsible sections */
#idemia-biometrics-modal .overlay-editor-layout {
    height: auto;
    min-height: 320px;
    max-height: 420px;
}

#idemia-biometrics-modal .overlay-sidebar {
    max-height: 420px;
}

#idemia-biometrics-modal .overlay-editor-main {
    max-height: 420px;
    overflow: hidden;
}

#idemia-biometrics-modal .overlay-steps-container {
    overflow: hidden;
    min-height: 0;
}

#idemia-biometrics-modal .overlay-steps-list {
    overflow-y: auto;
    max-height: 280px;
}

/* Per-device behavior table in Idemia modal should scroll if many rows */
#idemia-biometrics-modal .ib-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
}

.ib-global-toggle {
    padding: 1rem 1.25rem;
    background: rgba(155, 89, 182, 0.08);
    border: 1px solid rgba(155, 89, 182, 0.25);
    border-radius: 10px;
    flex-shrink: 0;
}

.ib-global-toggle label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.ib-global-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #9b59b6;
}

.ib-global-toggle-text {
    flex: 1;
}

.ib-global-toggle-text .title {
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
}

.ib-global-toggle-text .desc {
    margin: 0.25rem 0 0 0;
    font-size: 0.8rem;
    color: #808090;
}

/* Device behavior table */
.ib-table-wrapper {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.ib-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ib-table thead tr {
    background: rgba(155, 89, 182, 0.15);
}

.ib-table th {
    padding: 0.6rem 0.75rem;
    text-align: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ib-table th:first-child {
    text-align: left;
}

.ib-table td {
    padding: 0.5rem 0.75rem;
    color: #fff;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ib-table td:not(:first-child) {
    text-align: center;
}

.ib-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.ib-table input[type="checkbox"] {
    accent-color: #9b59b6;
    cursor: pointer;
}

.ib-table select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #fff;
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
}

/* ===== TAB 2: VARIATIONS BUILDER ===== */

.ib-variations-pane {
    flex-direction: column;
    overflow: hidden;
}

.ib-variations-layout {
    display: flex;
    flex: 1 1 auto;
    overflow: hidden;
    min-height: 0;
}

/* Left sidebar - variation list */
.ib-var-sidebar {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    flex: 0 0 200px;
    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;
}

.ib-var-sidebar-header {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ib-var-sidebar-header span {
    font-weight: 600;
    color: #fff;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ib-var-add-btn {
    background: #9b59b6;
    color: #fff;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.ib-var-add-btn:hover {
    background: #a569bd;
    transform: scale(1.05);
}

.ib-var-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.375rem;
}

.ib-var-item {
    padding: 0.5rem 0.6rem;
    margin-bottom: 2px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease;
    background: transparent;
}

.ib-var-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ib-var-item.active {
    background: rgba(155, 89, 182, 0.25);
}

.ib-var-item-icon {
    color: #9b59b6;
    font-size: 0.85rem;
    width: 16px;
    text-align: center;
}

.ib-var-item-info {
    flex: 1;
    min-width: 0;
}

.ib-var-item-name {
    color: #fff;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ib-var-item-meta {
    color: #666680;
    font-size: 0.65rem;
}

.ib-var-templates {
    padding: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ib-var-templates h5 {
    font-size: 0.6875rem;
    color: #666680;
    margin: 0 0 0.375rem 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ib-var-template-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.3rem 0.5rem;
    margin-bottom: 2px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: #808090;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.15s ease;
}

.ib-var-template-btn:hover {
    background: rgba(155, 89, 182, 0.15);
    border-color: rgba(155, 89, 182, 0.3);
    color: #fff;
}

/* Center - graph canvas */
.ib-var-graph-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

.ib-var-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #0f0f1a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ib-tool-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: #a0a0b0;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ib-tool-btn:hover {
    background: #0f0f1a;
    color: #ffffff;
}

.ib-tool-btn.active {
    background: #9b59b6;
    border-color: #9b59b6;
    color: white;
}

.ib-toolbar-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0 0.25rem;
}

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

.ib-toolbar-status {
    font-size: 0.75rem;
    color: #666680;
    padding: 0 0.5rem;
}

.ib-toolbar-status.active {
    color: #9b59b6;
    font-weight: 500;
}

.ib-var-graph {
    flex: 1;
    min-height: 300px;
    height: 100%;
    background: #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 */
.ib-var-graph > div {
    width: 100% !important;
    height: 100% !important;
}

/* Right sidebar - properties panel */
.ib-var-properties {
    width: 240px;
    min-width: 240px;
    background: #0f0f1a;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.ib-var-properties h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ib-var-no-selection {
    color: #666680;
    font-size: 0.8125rem;
    text-align: center;
    padding: 1.5rem 1rem;
}

.ib-var-no-selection i {
    display: block;
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
    color: #9b59b6;
}

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

.ib-prop-group label {
    display: block;
    font-size: 0.6875rem;
    color: #666680;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ib-prop-input {
    width: 100%;
    padding: 0.5rem 0.625rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 0.8125rem;
    transition: all 0.15s ease;
}

.ib-prop-input:focus {
    outline: none;
    border-color: rgba(155, 89, 182, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.15);
}

.ib-prop-input[readonly] {
    color: #666680;
    background: rgba(255, 255, 255, 0.03);
}

.ib-prop-select {
    width: 100%;
    padding: 0.5rem 0.625rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 0.8125rem;
    cursor: pointer;
    appearance: none;
}

.ib-prop-select:focus {
    outline: none;
    border-color: rgba(155, 89, 182, 0.5);
    box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.15);
}

.ib-prop-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    cursor: pointer;
}

.ib-prop-checkbox input[type="checkbox"] {
    accent-color: #9b59b6;
}

.ib-prop-checkbox span {
    font-size: 0.8125rem;
    color: #fff;
}

.ib-prop-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0.75rem 0;
}

/* Variation flow preview */
.ib-var-flow-preview {
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    min-height: 50px;
}

.ib-flow-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.ib-flow-arrow {
    color: #666680;
    margin: 0 4px;
    font-size: 0.75rem;
}

/* ===== TAB 3: DISTRIBUTION ===== */

.ib-distribution-pane {
    flex-direction: column;
    padding: 1.25rem;
    gap: 1rem;
    overflow-y: auto !important;
    overflow-x: hidden;
}

.ib-dist-description {
    color: #808090;
    font-size: 0.85rem;
    margin: 0;
}

.ib-dist-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ib-dist-action-btn {
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.15s ease;
}

.ib-dist-action-btn.purple {
    background: rgba(155, 89, 182, 0.15);
    border: 1px solid rgba(155, 89, 182, 0.3);
    color: #9b59b6;
}

.ib-dist-action-btn.purple:hover {
    background: rgba(155, 89, 182, 0.25);
    color: #c39bd3;
}

.ib-dist-action-btn.neutral {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #808090;
}

.ib-dist-action-btn.neutral:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* Distribution table inputs */
#ib-dist-table input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

#ib-dist-table input[type="number"]::-webkit-outer-spin-button,
#ib-dist-table input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#ib-dist-table input[type="number"]:focus {
    outline: none;
    border-color: #9b59b6;
    box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.25);
}

.ib-dist-validation {
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* ===== PLACEHOLDER STATES ===== */

.ib-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666680;
    text-align: center;
    padding: 2rem;
}

.ib-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
    color: #9b59b6;
}

.ib-placeholder p {
    font-size: 0.875rem;
    max-width: 300px;
}

/* ===== UTILITY ===== */

#idemia-biometrics-modal select {
    background-color: #1a1a2e;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    appearance: none;
}

#idemia-biometrics-modal select option {
    background-color: #1a1a2e;
    color: #ffffff;
    padding: 8px;
}