/* Users Screen Styles */

/* Keep consistent spacing between header and table (even when filters are collapsed) */
#screen-users #users-screen {
    margin-top: 2rem;
}

#screen-users .users-quota-banner {
    margin-bottom: 1rem;
    padding: 14px 16px;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: var(--bg-app);
    color: var(--text1);
    font-size: 14px;
    line-height: 1.6;
}

#screen-users .users-quota-banner strong {
    color: var(--black);
    font-weight: 800;
}

#screen-users .users-quota-banner[data-state="reached"] {
    background: var(--lbl9);
    border-color: var(--lbl12);
    color: var(--delete);
}

#screen-users .users-quota-banner[data-state="reached"] strong {
    color: inherit;
}

#screen-users .table.users-table {
    padding: 0;
}

#screen-users .table.users-table .table-head {
    border-radius: var(--table-radius) var(--table-radius) 0 0;
}

/* When filters are open, they already add vertical spacing */
#screen-users .users-filters.is-open + #users-screen {
    margin-top: 2rem;
}

#screen-users #btn-new-user span {
    font-weight: 400;
}

#screen-users .users-mobile-actions {
    display: none;
}

#screen-users .users-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}

#screen-users .users-filters.is-open {
    max-height: 260px;
    opacity: 1;
    margin: 1rem 0;
}

#screen-users .users-filters .field {
    flex: 1 1 220px;
    min-width: 220px;
}

    #user-modal-overlay.modal-overlay {
        position: fixed;
        inset: 0;
        z-index: 11050;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px;
        background: rgba(15, 23, 42, 0.46);
        backdrop-filter: blur(10px);
        isolation: isolate;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.24s ease, visibility 0.24s ease;
    }

    #user-modal .modal-header::before,
    #user-modal .modal-header::after,
    #user-modal .halo-icon::before,
    #user-modal .halo-icon::after,
    #user-modal .modal-title::before,
    #user-modal .modal-title::after,
    #user-modal .modal-desc::before,
    #user-modal .modal-desc::after {
        content: none !important;
        display: none !important;
    }

    #user-modal-overlay.modal-overlay.is-active {
        opacity: 1;
        visibility: visible;
    }

    #user-modal.modal-card {
        position: relative;
        z-index: 1;
        width: min(1180px, calc(100vw - 32px));
        max-width: 1180px;
        max-height: calc(100vh - 32px);
        background: #fff;
        border-radius: 28px;
        box-shadow: 0 32px 80px rgba(15, 23, 42, 0.26);
        overflow-y: auto;
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
        text-align: right;
        transform: translateY(18px) scale(0.98);
        transition: transform 0.24s ease;
    }

    #user-modal.modal-card.is-open {
        transform: translateY(0) scale(1);
    }

    #user-modal .btn-close {
        position: absolute;
        top: 22px;
        left: 22px;
        width: 40px;
        height: 40px;
        border: 1px solid rgba(148, 163, 184, 0.25);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.92);
        color: var(--black);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 2;
    }

    #user-modal .modal-header {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-areas: 'icon title';
        gap: 18px;
        align-items: center;
        padding: 32px 40px 24px;
        border-bottom: 1px solid rgba(148, 163, 184, 0.2);
        background: linear-gradient(135deg, rgba(20, 90, 160, 0.1), rgba(255, 255, 255, 0.98) 58%);
    }

    #user-modal .halo-icon {
        grid-area: icon;
        width: 64px;
        height: 64px;
        margin: 0;
        border-radius: 20px;
        background: var(--primary-4);
        color: var(--primary);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 26px;
        box-shadow: 0 14px 30px rgba(20, 90, 160, 0.12);
    }

    #user-modal .modal-title {
        grid-area: title;
        margin: 0;
        font-size: 28px;
        font-weight: 800;
        color: var(--primary);
        text-align: right;
    }

    #user-modal .modal-desc {
        grid-area: desc;
        margin: 0;
        font-size: 14px;
        line-height: 1.6;
        color: var(--text1);
        text-align: right;
    }

    #user-modal .modal-form {
        display: block;
    }

    #user-modal .modal-body {
        display: flex;
        flex-direction: column;
        gap: 18px;
        padding: 24px 40px 32px;
        background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), #fff 18%);
    }

    #user-modal .input-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    #user-modal .input-group {
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 8px;
        min-width: 0;
        margin: 0;
        padding: 14px 16px 16px;
        border: 1px solid var(--border-soft);
        border-radius: 18px;
        background: #fff;
    }

    #user-modal .notes-group {
        grid-column: span 2;
    }

    #user-modal .profile-section {
        justify-content: space-between;
        background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), #fff);
    }

    #user-modal .profile-group {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 16px;
        align-items: center;
    }

    #user-modal .modal-body > .permissions-group {
        padding: 18px 20px 20px;
        border-radius: 20px;
        gap: 12px;
    }

    #user-modal .form-label {
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 0;
        font-size: 13px;
        font-weight: 700;
        color: var(--black);
    }

    #user-modal .required {
        color: var(--red);
    }

    #user-modal .info-icon {
        color: var(--primary);
        font-size: 12px;
    }

    #user-modal .form-input {
        width: 100%;
        min-height: 48px;
        padding: 12px 14px;
        border: 1px solid var(--border-soft);
        border-radius: 12px;
        box-sizing: border-box;
        font-family: inherit;
        font-size: 15px;
        background: #f8fafc;
        color: var(--black);
        outline: none;
        transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    }

    #user-modal .form-input:focus {
        background: #fff;
        border-color: var(--primary);
        box-shadow: 0 0 0 4px var(--primary-4);
    }

    #user-modal .form-input.is-ltr {
        direction: ltr;
        text-align: left;
    }

    #user-modal .form-input.is-readonly {
        background: #f1f5f9;
    }

    #user-modal textarea.form-input {
        min-height: 132px;
        resize: vertical;
    }

    #user-modal #user-password {
        direction: ltr !important;
        text-align: left !important;
        padding-left: 44px;
    }

    #user-modal .toggle-password {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        border: none;
        background: none;
        color: var(--text1);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    #user-modal .profile-avatar {
        width: 92px;
        height: 92px;
        border-radius: 24px;
        background: linear-gradient(135deg, var(--primary), var(--primary-dark));
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 32px;
        color: #fff;
        overflow: hidden;
        box-shadow: 0 18px 36px rgba(20, 90, 160, 0.18);
    }

    #user-modal .profile-avatar-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    #user-modal .profile-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
    }

    #user-modal .btn-small-outline {
        min-height: 40px;
        padding: 8px 14px;
        border: 1px solid var(--border-soft);
        border-radius: 12px;
        background: #fff;
        color: var(--black);
        font-size: 13px;
        font-weight: 600;
    }

    #user-modal .permissions-help {
        margin: 0;
        font-size: 13px;
        line-height: 1.6;
        color: var(--text1);
    }

    #user-modal .permissions-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    #user-modal .permissions-actions .btn-small-outline.btn-tiny {
        min-width: 112px;
    }

    #user-modal .permissions-actions .btn-small-outline.btn-tiny:disabled {
        opacity: 0.6;
    }

    #user-modal .user-permissions-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
    }

    #user-modal .user-permission-option {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        min-height: 84px;
        padding: 12px 14px;
        border: 1px solid var(--border-soft);
        border-radius: 14px;
        background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), #fff);
    }

    #user-modal .user-permission-option input[type="checkbox"] {
        margin-top: 3px;
        flex: 0 0 auto;
    }

    #user-modal .user-permission-option-text {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
    }

    #user-modal .user-permission-label {
        font-size: 14px;
        font-weight: 700;
        color: var(--black);
    }

    #user-modal .user-permission-desc {
        font-size: 12px;
        line-height: 1.5;
        color: var(--text1);
    }

    #user-modal .user-permissions-empty {
        padding: 14px;
        border: 1px dashed var(--border-soft);
        border-radius: 14px;
        background: #fff;
        color: var(--text1);
        font-size: 13px;
        text-align: center;
    }

    #user-modal .modal-footer {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 14px;
        padding: 18px 40px 24px;
        border-top: 1px solid rgba(148, 163, 184, 0.2);
        background: #fff;
    }

    #user-modal .btn-main {
        min-width: 180px;
        min-height: 48px;
        padding: 12px 20px;
        border-radius: 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 15px;
        font-weight: 700;
    }

    #user-modal .btn-save {
        border: none;
        background: var(--primary);
        color: #fff;
        box-shadow: 0 14px 28px rgba(20, 90, 160, 0.18);
    }

    #user-modal .btn-cancel {
        border: 1px solid var(--border-soft);
        background: #fff;
        color: var(--black);
    }

    #user-modal .icon-picker,
    #user-modal .profile-image-cropper {
        position: absolute;
        left: 32px;
        right: 32px;
        bottom: 88px;
        max-height: 46vh;
        overflow: auto;
        background: #fff;
        border: 1px solid var(--border-soft);
        border-radius: 18px;
        padding: 14px;
        box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
        z-index: 3;
    }

    @media (max-width: 767px) {
        #screen-users #users-table-body {
            margin-top: 30px;
        }

        #screen-users #users-screen {
            margin-top: 30px;
        }

        #screen-users .users-filters.is-open + #users-screen {
            margin-top: 30px;
        }

        #screen-users.container.screen {
            margin-top: -70px;
        }

        #screen-users .users-filters.is-open {
            max-height: 600px;
        }

        #screen-users .users-filters .field {
            max-width: 100%;
            gap: .5rem;
        }

        #user-modal-overlay.modal-overlay {
            padding: 0;
            align-items: flex-end;
        }

        #user-modal.modal-card {
            width: 100%;
            max-width: none;
            max-height: calc(100vh - 8px);
            border-radius: 26px 26px 0 0;
        }

        #user-modal .btn-close {
            top: 18px;
            left: 18px;
        }

        #user-modal .modal-header {
            padding: 22px 20px 18px;
            grid-template-columns: 52px 1fr;
            gap: 14px;
        }

        #user-modal .halo-icon {
            width: 52px;
            height: 52px;
            font-size: 22px;
            box-shadow: none;
        }

        #user-modal .modal-title {
            font-size: 22px;
        }

        #user-modal .modal-desc {
            font-size: 13px;
        }

        #user-modal .modal-body {
            padding: 16px 20px 24px;
            gap: 14px;
        }

        #user-modal .input-row {
            grid-template-columns: 1fr;
            gap: 12px;
        }

        #user-modal .notes-group {
            grid-column: auto;
        }

        #user-modal .profile-group {
            grid-template-columns: 1fr;
            justify-items: center;
            text-align: center;
        }

        #user-modal .profile-actions {
            justify-content: center;
        }

        #user-modal .permissions-actions {
            flex-direction: column;
            align-items: stretch;
        }

        #user-modal .permissions-actions .btn-small-outline.btn-tiny {
            width: 100%;
            min-width: 0;
        }

        #user-modal .user-permissions-grid {
            grid-template-columns: 1fr;
        }

        #user-modal .modal-footer {
            padding: 14px 20px 20px;
            flex-direction: column-reverse;
        }

        #user-modal .btn-main {
            width: 100%;
            min-width: 0;
        }

        #user-modal .icon-picker,
        #user-modal .profile-image-cropper {
            left: 20px;
            right: 20px;
            bottom: 92px;
        }
    }

@media (max-width: 767px) {
    #screen-users .users-mobile-actions {
        display: flex;
        width: 100%;
        justify-content: flex-end;
        margin-bottom: 1rem;
    }

    #screen-users #btn-new-user-mobile {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: .22rem;
    }

    #screen-users #btn-new-user-mobile svg {
        width: 16.32px;
        height: 16.32px;
    }

    #screen-users #btn-new-user-mobile span {
        font-weight: 400;
    }

    #screen-users .screen-header-actions #btn-new-user {
        display: none;
    }

    #screen-users .table {
        border: none;
    }

    #screen-users .table-head,
    #screen-users .table-row {
        display: flex;
        flex-direction: column;
        gap: .5rem;
        background: var(--white);
    }

    #screen-users .table-row {
        border: 1px solid var(--border-soft);
        margin-bottom: 1rem;
        border-radius: 1rem;
        padding: .75rem;
    }

    #screen-users .table-row > div::before {
        content: attr(data-label);
        display: block;
        color: var(--primary);
        font-size: 15px;
        font-weight: 500;
        margin-bottom: .25rem;
        border-radius: 0;
        width: 110px;
    }

    #screen-users .table-head > div,
    #screen-users .table-row > div {
        padding: 0;
        border: none;
        margin: auto;
        text-align: right;
        width: 100%;
        display: flex;
        align-items: baseline;
        gap: .5rem;
        border-bottom: 1px solid var(--border-soft);
        padding-bottom: .25rem;
        justify-content: flex-start;
    }

    #screen-users .table-row > div:last-of-type {
        border: none;
    }

    #screen-users .table-head {
        display: none;
    }
}

/* History Modal Styles */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.history-item {
    background: var(--lightblue2);
    border-radius: 8px;
    padding: 16px;
    border-right: 4px solid var(--primary);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
}

.history-action {
    font-weight: 600;
    font-size: 16px;
    color: var(--black);
}

.history-date {
    color: var(--text1);
    font-size: 14px;
}

.history-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-user {
    font-size: 14px;
    color: var(--dark-gray);
}

.history-details {
    font-size: 14px;
    color: var(--black);
    background: var(--white);
    padding: 8px;
    border-radius: 4px;
}

.history-list .no-data {
    text-align: center;
    padding: 40px;
    color: var(--text1);
}

/* User Profile Styles (screen: #user-profile) */
#screen-user-profile #user-profile-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
    padding: 20px 12px 40px;
    box-sizing: border-box;
    font-size: 110%;
}

#screen-user-profile .profile-card {
    background: var(--white);
    width: 100%;
    max-width: 450px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 40px -10px rgba(30, 78, 132, 0.15);
    position: relative;
    text-align: center;
}

#screen-user-profile .profile-cover {
    height: 140px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    position: relative;
}

#screen-user-profile .profile-cover::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

#screen-user-profile .profile-cover::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

#screen-user-profile .btn-close {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    border: none;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    backdrop-filter: blur(5px);
}

#screen-user-profile .btn-close:hover {
    background: rgba(255, 255, 255, 0.38);
}

#screen-user-profile .avatar-container {
    position: relative;
    margin-top: -60px;
    display: inline-block;
}

#screen-user-profile .avatar-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid var(--white);
    background: var(--white);
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    position: relative;
}

#screen-user-profile .profile-avatar-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#screen-user-profile .profile-avatar-emoji {
    font-size: 72px;
    line-height: 1;
}

#screen-user-profile .profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#screen-user-profile .btn-edit-avatar {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: var(--white);
    border: 2px solid var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#screen-user-profile .btn-edit-avatar:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

#screen-user-profile .profile-content {
    padding: 15px 30px 40px;
}

#screen-user-profile .user-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--black);
    margin: 10px 0 5px;
}

#screen-user-profile .user-role {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
    background: var(--lightgray);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 25px;
    border: 1px solid var(--border-soft);
}

#screen-user-profile .info-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: right;
    margin-bottom: 30px;
}

#screen-user-profile .info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: 12px;
    background: var(--lightgray);
    border: 1px solid var(--border-soft);
    transition: 0.2s;
}

#screen-user-profile .info-item:hover {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
}

#screen-user-profile .info-icon {
    width: 36px;
    height: 36px;
    background: var(--white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    border: 1px solid var(--border-soft);
}

#screen-user-profile .info-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#screen-user-profile .info-text .label {
    font-size: 11px;
    color: var(--text1);
    font-weight: 500;
}

#screen-user-profile .info-text .value {
    font-size: 14px;
    color: var(--black);
    font-weight: 600;
    word-break: break-word;
}

#screen-user-profile .profile-actions {
    display: flex;
    gap: 10px;
}

#screen-user-profile .profile-actions .btn {
    flex: 1;
    padding: 12px;
    border-radius: 50px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
    text-decoration: none;
}

#screen-user-profile .profile-actions .btn.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(30, 78, 132, 0.2);
}

#screen-user-profile .profile-actions .btn.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

#screen-user-profile .profile-actions .btn.btn-secondary {
    background: var(--white);
    color: var(--black);
    border: 1px solid var(--border-soft);
}

#screen-user-profile .profile-actions .btn.btn-secondary:hover {
    background: var(--lightgray);
    border-color: var(--black);
}

@media (max-width: 767px) {
    #screen-user-profile .profile-content {
        padding: 1rem;
    }

    #screen-user-profile #user-profile-screen {
        margin-top: -70px;
        padding-bottom: 4rem;
    }
}

/* Profile Image Selector */
.profile-image-selector {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.profile-image-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--lightblue2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    overflow: hidden;
    border: 3px solid var(--border);
    position: relative;
}

.profile-image-preview.is-cropping {
    width: 260px;
    height: 260px;
    border-radius: 50%;
}

.profile-image-preview.is-cropping .profile-image-cropper-layer {
    border-radius: 50%;
}

/* Cropper.js: show a circular crop area (visual only) */
.profile-image-cropper-layer .cropper-view-box,
.profile-image-cropper-layer .cropper-face {
    border-radius: 50%;
}

.profile-image-cropper-layer .cropper-view-box {
    outline: 0;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}

.profile-image-preview-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-image-preview-content.hidden {
    display: none;
}

.profile-image-cropper-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 50%;
    background: var(--white);
    touch-action: none;
}

.profile-image-cropper-layer.hidden {
    display: none;
}

.profile-image-cropper-layer img {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: top left;
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
}

.profile-image-preview svg {
    width: 60px;
    height: 60px;
    color: var(--text1);
}

.profile-image-options {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Profile Image Cropper */
.profile-image-cropper {
    background: var(--lightblue2);
    padding: 15px;
    border-radius: 8px;
}

.profile-image-cropper.hidden {
    display: none;
}

.profile-image-cropper-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.profile-image-cropper-zoom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--black);
}

.profile-image-cropper-zoom input[type="range"] {
    width: 180px;
}

.profile-image-cropper-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.icon-picker {
    background: var(--lightblue2);
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.icon-picker.hidden {
    display: none;
}

.icon-picker-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--black);
}

.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.icon-option {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-option:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

.icon-option.selected {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(60, 131, 253, 0.3);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Field Info Tooltips */
.field-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 5px;
    cursor: help;
}

.field-info .info-icon {
    font-size: 18px;
    color: #3c83fd;
    transition: transform 0.2s ease;
    user-select: none;
    display: inline-block;
}

.field-info:hover .info-icon {
    transform: scale(1.2);
}

.field-info .tooltip-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: #fff;
    border: 1px solid #d4d4d8;
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 280px;
    max-width: 350px;
    width: max-content;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    font-size: 14px;
    line-height: 1.6;
    color: #111827;
    direction: rtl;
    text-align: right;
}

.field-info:hover .tooltip-content,
.field-info:focus-within .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(12px);
    pointer-events: auto;
}

.field-info .tooltip-content strong {
    display: block;
    margin-bottom: 6px;
    color: #3c83fd;
    font-size: 15px;
}

.field-info .tooltip-content ul {
    margin: 6px 0;
    padding-right: 20px;
    list-style-type: disc;
}

.field-info .tooltip-content li {
    margin: 4px 0;
}

.field-info .tooltip-content::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid #d4d4d8;
    border-top: 1px solid #d4d4d8;
}

/* עיצוב למובייל */
@media (max-width: 767px) {
    .field-info .tooltip-content {
        position: fixed;
        bottom: auto;
        top: 50%;
        right: 50%;
        transform: translate(50%, -50%);
        min-width: 90vw;
        max-width: 90vw;
    }
    
    .field-info:hover .tooltip-content,
    .field-info:focus-within .tooltip-content {
        transform: translate(50%, -50%);
    }
    
    .field-info .tooltip-content::before {
        display: none;
    }
}
