/* Detail editor modal shell */
.detail-editor-modal .modal-dialog {
    max-height: calc(100vh - 2rem);
    margin: 1rem auto;
}

.detail-editor-modal .modal-content {
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-editor-modal .modal-content form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.detail-editor-modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.detail-editor-modal .modal-header,
.detail-editor-modal .modal-footer {
    flex-shrink: 0;
}

.detail-editor-modal .modal-header {
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
    padding-bottom: 1rem;
}

.detail-editor-header-title {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.detail-editor-header-subtitle {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

/* Layout grid */
.detail-editor-layout {
    display: grid;
    grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    min-height: 0;
}

.detail-editor-layout.detail-editor-layout-wizard {
    grid-template-columns: 1fr;
}

.detail-editor-layout.detail-editor-layout-wizard .detail-editor-content-panel {
    width: 100%;
    min-width: 0;
}

.detail-editor-layout.detail-editor-layout-wizard .detail-editor-content-panel-inner {
    border: 0;
    padding-left: 0;
    padding-right: 0;
}

.detail-editor-layout.detail-editor-layout-wizard .detail-editor-panel-lead {
    max-width: none;
}

/* Side navigation */
.detail-editor-nav-panel {
    position: sticky;
    top: 0;
}

.detail-editor-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    border: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
    border-radius: 0.875rem;
    background: var(--bs-body-bg, #fff);
}

.detail-editor-nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-radius: 0.625rem;
    background: transparent;
    color: var(--bs-body-color, #212529);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.detail-editor-nav-item:hover:not(:disabled) {
    background: var(--bs-light, #f8f9fa);
}

.detail-editor-nav-item.active {
    background: var(--bs-primary-bg-subtle, #cfe2ff);
    color: var(--bs-primary);
    opacity: 1;
}

.detail-editor-nav-item.coming-soon {
    opacity: 0.65;
}

.detail-editor-nav-item.active.coming-soon {
    opacity: 1;
    color: var(--bs-primary);
}

.detail-editor-nav-item i {
    width: 1rem;
    flex-shrink: 0;
    text-align: center;
}

.detail-editor-nav-divider {
    margin: 0.5rem 0 0.35rem;
    padding: 0.5rem 0.65rem 0.15rem;
    border-top: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bs-secondary-color, #6c757d);
}

/* Content panel */
.detail-editor-content-panel {
    min-width: 0;
}

.detail-editor-content-panel-inner {
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
    border-radius: 0.875rem;
    background: var(--bs-body-bg, #fff);
}

.detail-editor-panel-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.detail-editor-panel-lead {
    margin-bottom: 1rem;
    max-width: 40rem;
}

/* Add wizard progress */
.add-wizard-progress {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
    border-radius: 0.875rem;
    background: var(--bs-light, #f8f9fa);
}

.add-wizard-progress-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-bottom: 0.65rem;
}

.add-wizard-progress-step {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color, #6c757d);
}

.add-wizard-progress-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--bs-body-color, #212529);
}

.add-wizard-progress-track {
    height: 0.35rem;
    border-radius: 999px;
    background: var(--bs-border-color-translucent, rgba(0, 0, 0, 0.1));
    overflow: hidden;
    margin-bottom: 0.85rem;
}

.add-wizard-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--bs-primary);
    transition: width 0.2s ease;
}

.add-wizard-steps {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.add-wizard-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 0;
    min-width: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--bs-secondary-color, #6c757d);
}

.add-wizard-step.active {
    color: var(--bs-primary);
    font-weight: 600;
}

.add-wizard-step.completed {
    color: var(--bs-body-color, #212529);
}

.add-wizard-step-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    border: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.12));
    background: var(--bs-body-bg, #fff);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.add-wizard-step.active .add-wizard-step-marker {
    border-color: var(--bs-primary);
    background: var(--bs-primary);
    color: #fff;
}

.add-wizard-step.completed .add-wizard-step-marker {
    border-color: var(--bs-success, #198754);
    background: var(--bs-success, #198754);
    color: #fff;
}

@media (max-width: 767.98px) {
    .detail-editor-modal .modal-dialog {
        max-height: calc(100vh - 1rem);
        margin: 0.5rem;
    }

    .detail-editor-layout {
        grid-template-columns: 1fr;
    }

    .detail-editor-nav-panel {
        position: static;
    }

    .detail-editor-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .detail-editor-nav-divider {
        display: none;
    }

    .detail-editor-nav-item {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .detail-editor-content-panel-inner {
        padding: 1rem;
    }
}
