/* ===== Wizard ===== */
.wizard-modal {
    display: flex;
    flex-direction: column;
    max-height: 92vh;
}
.wizard-header {
    padding: 22px 26px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
}
.wizard-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #111827;
}

/* Stepper */
.wizard-stepper {
    display: flex;
    padding: 22px 26px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e5e7eb;
    gap: 8px;
    flex-shrink: 0;
}
.wizard-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    opacity: 0.5;
    transition: opacity .25s;
}
.wizard-step.active,
.wizard-step.completed { opacity: 1; }
.wizard-step::after {
    content: "";
    position: absolute;
    top: 16px;
    inset-inline-start: calc(50% + 22px);
    width: calc(100% - 44px);
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}
.wizard-step:last-child::after { display: none; }
.wizard-step.completed::after { background: #6366f1; }
.wizard-step .step-number {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    z-index: 1;
    transition: all .25s;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.wizard-step.active .step-number {
    background: #6366f1;
    color: #fff;
    transform: scale(1.15);
    box-shadow: 0 4px 14px rgba(99,102,241,.4);
}
.wizard-step.completed .step-number {
    background: #10b981;
    color: #fff;
}
.wizard-step .step-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-align: center;
}
.wizard-step.active .step-label { color: #4f46e5; }
.wizard-step.completed .step-label { color: #059669; }

/* Body */
.wizard-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 26px;
}
.form-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 18px;
}
.form-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 800;
    color: #4f46e5;
    margin-bottom: 14px;
}
.form-section-header i { font-size: 18px; }

/* Toggles */
.owner-mode-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.owner-mode-toggle button {
    flex: 1;
    min-width: 140px;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    background: #fff;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}
.owner-mode-toggle button:hover {
    border-color: #c7d2fe;
    color: #4f46e5;
    transform: translateY(-1px);
}
.owner-mode-toggle button.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(99,102,241,.35);
}

/* Summaries */
.manager-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border: 2px solid #10b981;
    border-radius: 12px;
    color: #065f46;
}
.manager-summary.manager-summary-purple {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    border-color: #8b5cf6;
    color: #5b21b6;
}
.manager-summary.manager-summary-blue {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-color: #3b82f6;
    color: #1e40af;
}
.manager-summary > i { font-size: 28px; flex-shrink: 0; }
.manager-summary strong { display: block; font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.manager-summary span { font-size: 12px; font-family: monospace; direction: ltr; }

/* User search */
.user-search-wrap { margin-top: 6px; }
.user-search-box { position: relative; }
.user-search-box input { padding-inline-end: 40px; }
.user-search-box > i {
    position: absolute;
    top: 50%;
    inset-inline-end: 14px;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

/* Wizard message */
.wizard-message {
    margin: 0 26px 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}
.wizard-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.wizard-message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Footer */
.wizard-footer {
    padding: 18px 26px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    background: #fff;
    border-radius: 0 0 20px 20px;
    flex-shrink: 0;
}
.wizard-footer .admin-button {
    min-width: 120px;
}

/* Plan duration */
.plan-duration {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
}


/* ============================================================
   FORCE OVERRIDES — غلبه بر institutes-modern.css
   ============================================================ */

.wizard-modal,
.institute-modal.wizard-modal {
    background: #fff !important;
    border-radius: 20px !important;
    width: 100% !important;
    max-width: 920px !important;
    max-height: 94vh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    margin: auto !important;
    box-shadow: 0 25px 70px rgba(0,0,0,.35) !important;
}

.modal-backdrop {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
}

.wizard-modal .wizard-header {
    padding: 22px 26px !important;
    border-bottom: 1px solid #e5e7eb !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: #fff !important;
    border-radius: 20px 20px 0 0 !important;
    flex-shrink: 0 !important;
}

.wizard-modal .wizard-stepper {
    display: flex !important;
    padding: 22px 26px !important;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9) !important;
    border-bottom: 1px solid #e5e7eb !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    direction: rtl !important;
}

.wizard-modal .wizard-step {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    position: relative !important;
    opacity: 0.45 !important;
    transition: opacity .25s !important;
    cursor: pointer !important;
    padding: 0 !important;
}
.wizard-modal .wizard-step.active,
.wizard-modal .wizard-step.completed { opacity: 1 !important; }

.wizard-modal .wizard-step::after {
    content: "" !important;
    position: absolute !important;
    top: 17px !important;
    inset-inline-start: calc(50% + 22px) !important;
    width: calc(100% - 44px) !important;
    height: 2px !important;
    background: #e2e8f0 !important;
    z-index: 0 !important;
}
.wizard-modal .wizard-step:last-child::after { display: none !important; }
.wizard-modal .wizard-step.completed::after { background: #6366f1 !important; }

.wizard-modal .wizard-step .step-number {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: #e2e8f0 !important;
    color: #64748b !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 800 !important;
    font-size: 14px !important;
    z-index: 1 !important;
    border: 3px solid #fff !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.08) !important;
    transition: all .25s !important;
}
.wizard-modal .wizard-step.active .step-number {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #fff !important;
    transform: scale(1.15) !important;
    box-shadow: 0 6px 18px rgba(99,102,241,.45) !important;
}
.wizard-modal .wizard-step.completed .step-number {
    background: #10b981 !important;
    color: #fff !important;
}
.wizard-modal .wizard-step .step-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-align: center !important;
    line-height: 1.3 !important;
}
.wizard-modal .wizard-step.active .step-label { color: #4f46e5 !important; }
.wizard-modal .wizard-step.completed .step-label { color: #059669 !important; }

.wizard-modal .wizard-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 26px 30px !important;
    background: #fff !important;
}

.wizard-modal .wizard-footer {
    padding: 18px 26px !important;
    border-top: 1px solid #e5e7eb !important;
    display: flex !important;
    justify-content: space-between !important;
    gap: 10px !important;
    background: #fff !important;
    border-radius: 0 0 20px 20px !important;
    flex-shrink: 0 !important;
}
.wizard-modal .wizard-footer .admin-button {
    min-width: 130px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

.wizard-modal .form-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 18px !important;
}
.wizard-modal .form-field.full { grid-column: 1 / -1 !important; }
.wizard-modal .form-field label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #374151 !important;
    margin-bottom: 8px !important;
}
.wizard-modal .form-field .req { color: #ef4444 !important; }
.wizard-modal .form-field small {
    display: block !important;
    margin-top: 6px !important;
    font-size: 12px !important;
    color: #94a3b8 !important;
}
.wizard-modal .admin-input {
    width: 100% !important;
    padding: 12px 14px !important;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    background: #fff !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    color: #111827 !important;
}
.wizard-modal .admin-input:focus {
    outline: 0 !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,.1) !important;
}
.wizard-modal textarea.admin-input {
    resize: vertical !important;
    min-height: 60px !important;
}

/* sections */
.wizard-modal .form-section {
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 14px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
}
.wizard-modal .form-section-header {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #4f46e5 !important;
    margin-bottom: 16px !important;
    padding-bottom: 12px !important;
    border-bottom: 1.5px dashed #c7d2fe !important;
}
.wizard-modal .form-section-header i {
    font-size: 18px !important;
    width: 32px !important;
    height: 32px !important;
    background: #eef2ff !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* toggles */
.wizard-modal .owner-mode-toggle {
    display: flex !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
    flex-wrap: wrap !important;
}
.wizard-modal .owner-mode-toggle button {
    flex: 1 !important;
    min-width: 130px !important;
    padding: 12px 14px !important;
    border: 2px solid #e2e8f0 !important;
    background: #fff !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: all .2s !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    font-family: inherit !important;
}
.wizard-modal .owner-mode-toggle button:hover {
    border-color: #c7d2fe !important;
    color: #4f46e5 !important;
    transform: translateY(-1px) !important;
}
.wizard-modal .owner-mode-toggle button.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 6px 18px rgba(99,102,241,.4) !important;
}

/* summaries */
.wizard-modal .manager-summary {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 16px 18px !important;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important;
    border: 2px solid #10b981 !important;
    border-radius: 12px !important;
    color: #065f46 !important;
}
.wizard-modal .manager-summary.manager-summary-purple {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe) !important;
    border-color: #8b5cf6 !important;
    color: #5b21b6 !important;
}
.wizard-modal .manager-summary.manager-summary-blue {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe) !important;
    border-color: #3b82f6 !important;
    color: #1e40af !important;
}
.wizard-modal .manager-summary > i { font-size: 28px !important; flex-shrink: 0 !important; }
.wizard-modal .manager-summary strong {
    display: block !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    margin-bottom: 4px !important;
}
.wizard-modal .manager-summary span {
    font-size: 12px !important;
    font-family: monospace !important;
    direction: ltr !important;
}

/* user search */
.wizard-modal .user-search-wrap { margin-top: 8px !important; }
.wizard-modal .user-search-box { position: relative !important; }
.wizard-modal .user-search-box input { padding-inline-end: 40px !important; }
.wizard-modal .user-search-box > i {
    position: absolute !important;
    top: 50% !important;
    inset-inline-end: 14px !important;
    transform: translateY(-50%) !important;
    color: #94a3b8 !important;
    pointer-events: none !important;
}

/* wizard message */
.wizard-modal .wizard-message {
    margin: 0 26px 12px !important;
    padding: 12px 16px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-align: center !important;
}
.wizard-modal .wizard-message.error {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border: 1.5px solid #fecaca !important;
}

/* plan */
.wizard-modal .plan-selector {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 12px !important;
}
.wizard-modal .plan-option {
    position: relative !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 14px !important;
    padding: 16px !important;
    cursor: pointer !important;
    background: #fff !important;
    display: block !important;
    transition: all .2s !important;
}
.wizard-modal .plan-option.selected {
    border-color: #6366f1 !important;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff) !important;
    box-shadow: 0 0 0 4px rgba(99,102,241,.15) !important;
}

/* color */
.wizard-modal .theme-preview {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    padding: 36px !important;
    border-radius: 14px !important;
    color: #fff !important;
    font-weight: 800 !important;
    font-size: 22px !important;
    text-shadow: 0 2px 4px rgba(0,0,0,.15) !important;
}
.wizard-modal .theme-preview i { font-size: 36px !important; }

/* auto email */
.wizard-modal .auto-email-box {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 16px !important;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff) !important;
    border: 1.5px dashed #6366f1 !important;
    border-radius: 10px !important;
    font-family: monospace !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #4f46e5 !important;
    direction: ltr !important;
}
.wizard-modal .auto-email-box i { color: #6366f1 !important; font-size: 18px !important; }

/* subdomain */
.wizard-modal .subdomain-input { display: flex !important; align-items: center !important; gap: 8px !important; }
.wizard-modal .subdomain-input input { flex: 1 !important; }
.wizard-modal .subdomain-suffix {
    color: #64748b !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    padding: 12px 14px !important;
    background: #f8fafc !important;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 10px !important;
    direction: ltr !important;
}
.wizard-modal .subdomain-status {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 8px !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}
.wizard-modal .subdomain-status.ok { background: #d1fae5 !important; color: #065f46 !important; }
.wizard-modal .subdomain-status.error { background: #fee2e2 !important; color: #991b1b !important; }

/* modules */
.wizard-modal .modules-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
    gap: 10px !important;
}
.wizard-modal .module-option {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    background: #fff !important;
    transition: all .15s !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    position: relative !important;
}
.wizard-modal .module-option.selected {
    border-color: #6366f1 !important;
    background: #eef2ff !important;
    color: #4f46e5 !important;
}

/* responsive */
@media (max-width: 768px) {
    .wizard-modal .form-grid { grid-template-columns: 1fr !important; }
    .wizard-modal .wizard-step .step-label { font-size: 9px !important; }
    .wizard-modal .wizard-stepper { padding: 14px 12px !important; }
}
