/* --- Setup Wizard (scoped — only loads before setup is completed) --- */
.bw-setup-wizard-container[v-cloak],
#bw-setup-wizard-app[v-cloak] {
    display: none !important;
}

.bw-setup-wizard-container {
    --bw-setup-brand: #5700b4;
    --bw-setup-brand-dark: #440093;
    --bw-setup-brand-soft: #f6f0ff;
    --bw-setup-brand-glow: rgba(87, 0, 180, 0.14);
    --bw-setup-text: #1f2937;
    --bw-setup-muted: #6b7280;
    --bw-setup-border: #e8e4f0;
    --bw-setup-surface: #ffffff;
    --bw-setup-radius-lg: 24px;
    --bw-setup-radius-md: 12px;
    --bw-setup-field-radius: 4px;
    --bw-setup-shadow: 0 24px 80px rgba(31, 41, 55, 0.12), 0 8px 24px rgba(87, 0, 180, 0.08);

    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    height: 100vh;
    padding: 24px;
    box-sizing: border-box;
    font-family: var(--bw-admin-font, 'Poppins', Arial, Helvetica, sans-serif);
    --el-font-family: var(--bw-admin-font, 'Poppins', Arial, Helvetica, sans-serif);
    --el-color-primary: var(--bw-setup-brand);
    position: fixed;
    inset: 0;
    z-index: 999999;
    overflow: hidden;
    --el-component-size-large: 36px;
    --el-border-radius-base: var(--bw-setup-field-radius);
    --el-input-border-radius: var(--bw-setup-field-radius);
    background:
        radial-gradient(ellipse 80% 60% at 10% 0%, rgba(87, 0, 180, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% 100%, rgba(87, 0, 180, 0.06) 0%, transparent 50%),
        linear-gradient(160deg, #f9f7fc 0%, #f0edf8 45%, #e9eef5 100%);
}

.bw-setup-wizard-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(87, 0, 180, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    opacity: 0.45;
}

.bw-setup-wizard-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 960px;
    max-height: calc(100vh - 48px);
    background: var(--bw-setup-surface);
    border-radius: var(--bw-setup-radius-lg);
    box-shadow: var(--bw-setup-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.85);
}

.bw-setup-wizard-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--bw-setup-brand) 0%, #8b3dff 50%, var(--bw-setup-brand) 100%);
    z-index: 2;
}

.bw-setup-wizard-header {
    background: linear-gradient(180deg, #fdfbff 0%, #ffffff 100%);
    padding: 28px 40px 22px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 22px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--bw-setup-border);
}

.bw-setup-wizard-header-text {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.bw-setup-logo {
    flex-shrink: 0;
    margin: 0;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--bw-setup-brand-soft);
    border: 1px solid rgba(87, 0, 180, 0.08);
}

.bw-setup-logo svg {
    height: 38px;
    width: auto;
    display: block;
}

.bw-setup-wizard-header h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: var(--bw-setup-text);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.bw-setup-wizard-header p {
    margin: 8px 0 0;
    color: var(--bw-setup-muted);
    font-size: 15px;
    line-height: 1.5;
    max-width: 520px;
}

@media (max-width: 640px) {
    .bw-setup-wizard-container {
        padding: 12px;
    }

    .bw-setup-wizard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px 20px 16px;
    }

    .bw-setup-wizard-steps {
        padding: 12px 16px !important;
    }

    .bw-setup-wizard-body {
        padding: 16px 20px !important;
    }

    .bw-setup-wizard-footer {
        padding: 16px 20px !important;
        flex-wrap: wrap;
    }

    .bw-setup-wizard-footer-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

.bw-setup-wizard-steps {
    padding: 18px 48px 20px;
    background: linear-gradient(180deg, #faf8fd 0%, #f7f5fb 100%);
    border-bottom: 1px solid var(--bw-setup-border);
    flex-shrink: 0;
}

.bw-setup-wizard-body {
    padding: 28px 40px 32px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    background: #fff;
}

.bw-setup-step-content {
    animation: bw-slide-up 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}

.bw-setup-wizard-footer {
    padding: 20px 40px 24px;
    background: linear-gradient(180deg, #ffffff 0%, #faf9fc 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--bw-setup-border);
    flex-shrink: 0;
}

.bw-setup-wizard-footer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.bw-setup-wizard-container .bw-setup-skip-btn.el-button.is-text {
    margin-right: 0;
    color: var(--bw-setup-muted) !important;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 4px;
}

.bw-setup-wizard-container .bw-setup-skip-btn.el-button.is-text:hover {
    color: var(--bw-setup-brand) !important;
    background: transparent !important;
}

.bw-setup-wizard-container .bw-setup-next-btn.el-button--primary,
.bw-setup-wizard-container .bw-setup-next-btn.el-button--primary:hover,
.bw-setup-wizard-container .bw-setup-next-btn.el-button--primary:focus {
    color: #fff;
    background: linear-gradient(135deg, var(--bw-setup-brand) 0%, #6d1fd4 100%);
    border: none;
    box-shadow: 0 8px 20px var(--bw-setup-brand-glow);
}

.bw-setup-wizard-container .bw-setup-next-btn.el-button--primary:hover {
    background: linear-gradient(135deg, var(--bw-setup-brand-dark) 0%, var(--bw-setup-brand) 100%);
    box-shadow: 0 10px 24px rgba(87, 0, 180, 0.22);
}

.bw-setup-wizard-container .el-button--success {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    border: none;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.2);
    font-weight: 600;
}

.bw-setup-finish-content {
    text-align: center;
    padding: 32px 0 16px;
}

.bw-setup-finish-content h3 {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--bw-setup-text);
    letter-spacing: -0.02em;
}

.bw-setup-finish-content > p {
    margin: 0;
    color: var(--bw-setup-muted);
    font-size: 15px;
}

.bw-finish-icon {
    margin-bottom: 28px;
    background: linear-gradient(145deg, #ecfdf3 0%, #d1fae5 100%);
    width: 112px;
    height: 112px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 12px 32px rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.12);
}

.bw-setup-summary {
    margin-top: 32px;
    background: linear-gradient(180deg, #faf8fd 0%, #f5f2fa 100%);
    padding: 24px 28px;
    border-radius: var(--bw-setup-radius-md);
    display: inline-block;
    text-align: left;
    min-width: min(100%, 380px);
    border: 1px solid var(--bw-setup-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.bw-setup-summary h4 {
    margin: 0 0 15px;
    color: var(--bw-setup-text);
    font-size: 17px;
    font-weight: 700;
}

.bw-setup-summary p {
    margin: 10px 0;
    color: var(--bw-setup-muted);
    font-size: 14px;
    line-height: 1.5;
}

.bw-setup-summary strong {
    color: var(--bw-setup-text);
    margin-right: 6px;
    font-weight: 600;
}

.bw-setup-shifts-section {
    margin-top: 20px;
    border-top: 1px solid var(--bw-setup-border);
    padding-top: 20px;
}

.bw-setup-shifts-section h4 {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
    color: var(--bw-setup-text);
}

.bw-setup-shift-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    padding: 10px 16px;
    border-radius: var(--bw-setup-radius-md);
    background: #faf9fc;
    border: 1px solid var(--bw-setup-border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    flex-wrap: nowrap;
}

.bw-setup-shift-group {
    margin-bottom: 10px;
}

.bw-setup-shift-row:hover {
    box-shadow: 0 4px 16px rgba(87, 0, 180, 0.06);
    border-color: rgba(87, 0, 180, 0.18);
}

.bw-day-label {
    width: 88px;
    flex-shrink: 0;
    font-weight: 600;
    color: var(--bw-setup-text);
    text-transform: capitalize;
    font-size: 13px;
}

.bw-shift-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    flex-wrap: nowrap;
    min-width: 0;
}

.bw-setup-wizard-container .bw-shift-inputs .el-select {
    --el-select-width: 108px;
    width: 108px;
    flex-shrink: 0;
}

.bw-setup-wizard-container .bw-shift-inputs > span {
    flex-shrink: 0;
    color: var(--bw-setup-muted);
    line-height: 1;
}

.bw-setup-wizard-container .bw-shift-inputs .el-button {
    flex-shrink: 0;
    white-space: nowrap;
}

.bw-setup-shift-row .el-switch {
    flex-shrink: 0;
}

.bw-day-off-text {
    flex: 1;
    color: #dc2626;
    font-weight: 500;
    font-size: 13px;
}

.bw-setup-break-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.bw-setup-break-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 16px 8px;
    flex-wrap: nowrap;
}

.bw-setup-wizard-container .bw-setup-break-item .el-select {
    --el-select-width: 108px;
    width: 108px;
    flex-shrink: 0;
}

@keyframes bw-slide-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography — wizard only */
.bw-setup-wizard-container,
.bw-setup-wizard-container .bw-setup-wizard-card,
.bw-setup-wizard-container .bw-setup-wizard-header,
.bw-setup-wizard-container .bw-setup-wizard-header-text,
.bw-setup-wizard-container .bw-setup-wizard-footer,
.bw-setup-wizard-container .bw-setup-summary,
.bw-setup-wizard-container .el-form-item__label,
.bw-setup-wizard-container .el-input__inner,
.bw-setup-wizard-container .el-input__wrapper,
.bw-setup-wizard-container .el-textarea__inner,
.bw-setup-wizard-container .el-select__wrapper,
.bw-setup-wizard-container .el-button,
.bw-setup-wizard-container .el-link,
.bw-setup-wizard-container .el-step__title,
.bw-setup-wizard-container .el-step__head,
.bw-setup-wizard-container .el-checkbox__label {
    font-family: inherit;
}

/* Form controls — wizard only */
.bw-setup-wizard-container .el-form-item {
    margin-bottom: 16px;
}

.bw-setup-wizard-container .el-form-item--label-top .el-form-item__label,
.bw-setup-wizard-container .el-form-item__label {
    font-weight: 600;
    color: var(--bw-setup-text);
    margin-bottom: 4px !important;
    padding-bottom: 0 !important;
    height: auto !important;
    line-height: 1.35 !important;
    font-size: 13px;
    letter-spacing: 0.01em;
}

.bw-setup-wizard-container .el-input__inner {
    padding: 0 !important;
}

.bw-setup-wizard-container .el-textarea__inner {
    padding: 6px 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bw-setup-wizard-container .el-input__wrapper,
.bw-setup-wizard-container .el-select__wrapper {
    padding: 1px 10px !important;
    border-radius: var(--bw-setup-field-radius) !important;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--bw-setup-border) inset !important;
    background: #fff !important;
    transition: box-shadow 0.2s ease;
    min-height: 36px !important;
    height: 36px !important;
}

.bw-setup-wizard-container .el-input--large .el-input__wrapper,
.bw-setup-wizard-container .el-select--large .el-select__wrapper,
.bw-setup-wizard-container .el-time-select .el-input__wrapper {
    border-radius: var(--bw-setup-field-radius) !important;
}

.bw-setup-wizard-container .el-input-group .el-input__wrapper {
    border-radius: 0 !important;
}

.bw-setup-wizard-container .el-input-group > .el-input-group__prepend {
    border-top-left-radius: var(--bw-setup-field-radius) !important;
    border-bottom-left-radius: var(--bw-setup-field-radius) !important;
}

.bw-setup-wizard-container .el-input-group > .el-input__wrapper:first-child {
    border-top-left-radius: var(--bw-setup-field-radius) !important;
    border-bottom-left-radius: var(--bw-setup-field-radius) !important;
}

.bw-setup-wizard-container .el-input-group > .el-input-group__append .el-input__wrapper,
.bw-setup-wizard-container .el-input-group > .el-input-group__append {
    border-top-right-radius: var(--bw-setup-field-radius) !important;
    border-bottom-right-radius: var(--bw-setup-field-radius) !important;
}

.bw-setup-wizard-container .el-input-group__prepend,
.bw-setup-wizard-container .el-input-group__append {
    border-radius: 0;
    overflow: hidden;
}

.bw-setup-wizard-container .el-input__wrapper:hover,
.bw-setup-wizard-container .el-select__wrapper:hover {
    box-shadow: 0 0 0 1px #d8d2e6 inset !important;
}

.bw-setup-wizard-container .el-input__wrapper.is-focus,
.bw-setup-wizard-container .el-select__wrapper.is-focused {
    box-shadow: 0 0 0 2px var(--bw-setup-brand) inset, 0 0 0 4px var(--bw-setup-brand-glow) !important;
}

.bw-setup-wizard-container .el-textarea__inner {
    border-radius: var(--bw-setup-field-radius) !important;
    box-shadow: 0 0 0 1px var(--bw-setup-border) inset;
}

.bw-setup-wizard-container .el-textarea__inner:focus {
    border-color: var(--bw-setup-brand) !important;
    box-shadow: 0 0 0 2px var(--bw-setup-brand) inset, 0 0 0 4px var(--bw-setup-brand-glow) !important;
}

.bw-setup-wizard-container .bw-required-error .el-input__wrapper,
.bw-setup-wizard-container .bw-required-error .el-select__wrapper,
.bw-setup-wizard-container .bw-required-error .el-textarea__inner {
    box-shadow: 0 0 0 2px #f56c6c inset !important;
}

.bw-setup-wizard-container .bw-required-error .el-form-item__label {
    color: #f56c6c !important;
}

.bw-setup-wizard-container .el-input-group__append .el-select__wrapper,
.bw-setup-wizard-container .el-input-group__prepend {
    min-height: 36px !important;
    height: 36px !important;
}

.bw-setup-wizard-container .el-button--large,
.bw-setup-wizard-container .el-button:not(.is-text) {
    padding: 11px 28px;
    border-radius: var(--bw-setup-field-radius);
    font-weight: 600;
    font-size: 15px;
    min-height: 42px;
}

.bw-setup-wizard-container .bw-setup-wizard-footer .el-button {
    border-radius: var(--bw-setup-field-radius) !important;
}

.bw-setup-wizard-container .el-button:not(.is-text):not(.el-button--primary):not(.el-button--success) {
    border-color: var(--bw-setup-border);
    color: var(--bw-setup-text);
    background: #fff;
}

.bw-setup-wizard-container .el-button:not(.is-text):not(.el-button--primary):not(.el-button--success):hover {
    border-color: rgba(87, 0, 180, 0.25);
    color: var(--bw-setup-brand);
    background: var(--bw-setup-brand-soft);
}

/* Step indicator — brand purple */
.bw-setup-wizard-container .el-step__main {
    margin-top: 10px;
}

.bw-setup-wizard-container .el-step__title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.bw-setup-wizard-container .el-step__title.is-process {
    color: var(--bw-setup-brand) !important;
    font-weight: 700;
}

.bw-setup-wizard-container .el-step__title.is-finish,
.bw-setup-wizard-container .el-step__title.is-success {
    color: var(--bw-setup-brand) !important;
}

.bw-setup-wizard-container .el-step__title.is-wait {
    color: #9ca3af !important;
}

.bw-setup-wizard-container .el-step__head.is-finish,
.bw-setup-wizard-container .el-step__head.is-success {
    border-color: var(--bw-setup-brand) !important;
    color: var(--bw-setup-brand) !important;
}

.bw-setup-wizard-container .el-step__head.is-process .el-step__icon {
    background: var(--bw-setup-brand) !important;
    border-color: var(--bw-setup-brand) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px var(--bw-setup-brand-glow);
}

.bw-setup-wizard-container .el-step__head.is-finish .el-step__icon,
.bw-setup-wizard-container .el-step__head.is-success .el-step__icon {
    background: var(--bw-setup-brand) !important;
    border-color: var(--bw-setup-brand) !important;
    color: #fff !important;
}

.bw-setup-wizard-container .el-step__head.is-finish .el-step__line,
.bw-setup-wizard-container .el-step__head.is-success .el-step__line {
    background-color: var(--bw-setup-brand) !important;
}

.bw-setup-wizard-container .el-step__head.is-process .el-step__line {
    background-color: var(--bw-setup-brand) !important;
}

.bw-setup-wizard-container .el-step__head.is-success .el-step__icon-inner,
.bw-setup-wizard-container .el-step__head.is-finish .el-step__icon-inner {
    color: #fff !important;
}

.bw-setup-wizard-container .el-step__icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-width: 2px !important;
}

.bw-setup-wizard-container .el-step.is-horizontal .el-step__line {
    height: 2px !important;
    top: 17px !important;
}

/* Dropdowns while setup wizard is active */
body.bookwellab-setup-wizard-active .el-popper.is-light {
    z-index: 2000000 !important;
    border-radius: var(--bw-setup-field-radius, 4px);
    border-color: var(--bw-setup-border, #e8e4f0);
    box-shadow: 0 12px 40px rgba(31, 41, 55, 0.12);
}
