/* =========================================================
   AL ABJAL AUTH - USERS COMMON UI
========================================================= */

.users-admin-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 38px 24px 60px;
}

.users-main-header {
    position: relative;
    z-index: 10;
}

.users-header-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.users-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 15px;
    border-radius: 11px;
    border: 1px solid #dfe5ee;
    background: #f7f9fc;
    color: #092a52;
    font-size: 13px;
    font-weight: 800;
    transition: .18s ease;
}

.users-nav-btn:hover {
    background: #edf3fb;
    border-color: #c6d3e4;
}

.users-nav-btn.danger {
    color: #8d1e2b;
    background: #fff2f3;
    border-color: #f2d5d9;
}

.users-alert {
    margin-bottom: 18px;
    padding: 15px 18px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.8;
}

.users-alert.success {
    background: #eaf8ef;
    color: #15733a;
    border: 1px solid #caebd5;
}

.users-alert.error {
    background: #fff0f2;
    color: #8d1e2b;
    border: 1px solid #f0ccd1;
}

.users-alert strong {
    display: block;
    margin-bottom: 5px;
}

.users-alert ul {
    margin: 5px 0 0;
    padding-right: 20px;
}


/* =========================================================
   USER ADD / EDIT FORM
========================================================= */

.users-form-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.form-page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    flex-wrap: wrap;
}

.form-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: #8d1e2b;
    font-size: 12px;
    font-weight: 900;
}

.form-page-heading h1 {
    margin: 0;
    color: #092a52;
    font-size: 32px;
    font-weight: 900;
}

.form-page-heading p {
    margin: 10px 0 0;
    max-width: 720px;
    color: #6f7c91;
    font-size: 14px;
    line-height: 1.9;
}

.users-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 11px;
    border: 1px solid #dfe5ee;
    background: #fff;
    color: #092a52;
    font-size: 13px;
    font-weight: 800;
}

.user-editor-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.editor-section {
    background: #fff;
    border: 1px solid #dde5ef;
    border-radius: 19px;
    padding: 24px;
    box-shadow: 0 10px 28px rgba(19, 43, 75, .055);
}

.editor-section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #edf1f6;
}

.editor-section-head h2 {
    margin: 0;
    color: #092a52;
    font-size: 19px;
    font-weight: 900;
}

.editor-section-head p {
    margin: 6px 0 0;
    color: #8190a5;
    font-size: 12px;
    line-height: 1.7;
}

.section-number,
.system-badge {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 900;
}

.section-number {
    background: #edf3fa;
    color: #092a52;
}

.system-badge {
    color: #fff;
    box-shadow: 0 10px 22px rgba(9, 42, 82, .13);
}

.system-badge.crm {
    background: linear-gradient(145deg, #0b315e, #7f1623);
}

.system-badge.factory {
    background: linear-gradient(145deg, #263c59, #8c2636);
}

.editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.editor-field {
    min-width: 0;
}

.editor-field label {
    display: block;
    margin-bottom: 8px;
    color: #34425a;
    font-size: 13px;
    font-weight: 800;
}

.required-mark {
    color: #9b1e2c;
}

.editor-field input,
.editor-field select {
    display: block;
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid #d8e1ec;
    border-radius: 12px;
    background: #fff;
    color: #1f2e46;
    font-size: 14px;
    outline: none;
    transition: .18s ease;
}

.editor-field input:focus,
.editor-field select:focus {
    border-color: #7692b5;
    box-shadow: 0 0 0 4px rgba(9, 42, 82, .065);
}

.editor-field input::placeholder {
    color: #a5afbd;
}

.editor-field small {
    display: block;
    margin-top: 7px;
    color: #8b96a8;
    font-size: 11px;
    line-height: 1.7;
}

.editor-field .roles-multiple {
    height: 150px;
    padding: 8px;
}

.editor-field .roles-multiple option {
    padding: 8px 9px;
}


/* =========================================================
   MODERN CHECKBOX
========================================================= */

.modern-check-row {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 20px;
    padding: 15px 16px;
    border: 1px solid #e0e7f0;
    border-radius: 13px;
    background: #f8fafc;
    cursor: pointer;
    transition: .18s ease;
}

.modern-check-row:hover {
    border-color: #c9d6e6;
    background: #f5f8fc;
}

.modern-check-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.modern-check-box {
    position: relative;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    margin-top: 1px;
    border: 2px solid #b8c4d2;
    border-radius: 6px;
    background: #fff;
    transition: .18s ease;
}

.modern-check-row input:checked + .modern-check-box {
    border-color: #0b3d72;
    background: #0b3d72;
}

.modern-check-row input:checked + .modern-check-box::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 6px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 0 2px 2px;
    transform: rotate(-45deg);
}

.modern-check-content {
    display: block;
}

.modern-check-content strong {
    display: block;
    color: #20314a;
    font-size: 13px;
}

.modern-check-content small {
    display: block;
    margin-top: 4px;
    color: #7e8da1;
    font-size: 11px;
    line-height: 1.65;
}

.system-toggle {
    margin-top: 0;
    margin-bottom: 20px;
}


/* =========================================================
   ACTIONS
========================================================= */

.editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.editor-btn {
    min-width: 145px;
    height: 48px;
    border-radius: 12px;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    transition: .18s ease;
}

.editor-btn.primary {
    color: #fff;
    background: linear-gradient(135deg, #0b3a70, #092a52);
    box-shadow: 0 10px 20px rgba(9, 42, 82, .17);
}

.editor-btn.primary:hover {
    transform: translateY(-1px);
}

.editor-btn.secondary {
    color: #40506a;
    background: #fff;
    border: 1px solid #dbe3ed;
}


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

@media (max-width: 850px) {
    .users-admin-container {
        padding: 26px 16px 45px;
    }

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

    .form-page-heading h1 {
        font-size: 27px;
    }

    .editor-section {
        padding: 19px;
    }
}

@media (max-width: 650px) {
    .users-main-header {
        height: auto;
        padding-top: 15px;
        padding-bottom: 15px;
        align-items: flex-start;
    }

    .users-header-nav {
        justify-content: flex-end;
    }

    .users-nav-btn {
        min-height: 38px;
        padding: 0 11px;
        font-size: 11px;
    }

    .editor-actions {
        flex-direction: column-reverse;
    }

    .editor-btn {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .users-header-nav {
        width: 100%;
    }

    .users-nav-btn {
        flex: 1;
    }

    .editor-section-head {
        align-items: flex-start;
    }

    .form-page-heading {
        flex-direction: column;
    }

    .users-back-btn {
        width: 100%;
    }
}
