﻿/* ==========================================================================
   vablet modal  (.vm)
   Drop-in restyle for Bootstrap 3 modals. Keeps Bootstrap's modal JS
   (data-toggle="modal", $('#x').modal('show')) but owns every visual rule,
   so lightbox / Metronic rules can't leak in.

   Usage: add "vm" to the .modal element, and data-backdrop="false"
   (the .vm element draws its own dimmed, blurred backdrop).

   <div class="modal fade vm" id="shareModal" tabindex="-1" data-backdrop="false">
     <div class="modal-dialog vm-dialog">
       <div class="vm-panel">
         <div class="vm-header">
           <h4 class="vm-title">Share</h4>
           <button type="button" class="vm-close" data-dismiss="modal" aria-label="Close">…</button>
         </div>
         <div class="vm-body">…</div>
         <div class="vm-footer">…</div>   (optional)
       </div>
     </div>
   </div>
   ========================================================================== */

.modal.vm {
    --vm-bg: rgba(250, 250, 252, 0.78);
    --vm-border: rgba(255, 255, 255, 0.6);
    --vm-text: #1c1c1e;
    --vm-text-2: #6e6e73;
    --vm-group: rgba(255, 255, 255, 0.7);
    --vm-divider: rgba(60, 60, 67, 0.14);
    --vm-hover: rgba(0, 0, 0, 0.04);
    --vm-active: rgba(0, 0, 0, 0.08);
    --vm-close-bg: rgba(120, 120, 128, 0.16);
    --vm-accent: #0a64ff;
    --vm-scrim: rgba(10, 10, 14, 0.38);
    --vm-bg-solid: #fbfbfd;
    --vm-seg-active: #ffffff;
    --vm-radius: 22px;
    --vm-radius-sm: 14px;
    --vm-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

    /* Dark variant: add .vm-dark, or let it follow the OS */
    .modal.vm.vm-dark {
        --vm-bg: rgba(36, 36, 40, 0.78);
        --vm-border: rgba(255, 255, 255, 0.12);
        --vm-text: #f5f5f7;
        --vm-text-2: #a1a1a6;
        --vm-group: rgba(255, 255, 255, 0.07);
        --vm-divider: rgba(255, 255, 255, 0.1);
        --vm-hover: rgba(255, 255, 255, 0.06);
        --vm-active: rgba(255, 255, 255, 0.12);
        --vm-close-bg: rgba(255, 255, 255, 0.12);
        --vm-accent: #3d8bff;
        --vm-scrim: rgba(0, 0, 0, 0.5);
        --vm-bg-solid: #2a2a2e;
        --vm-seg-active: rgba(255, 255, 255, 0.2);
    }

    /* --------------------------------------------------------------------------
   Containment: neutralize anything inherited or leaked from ancestors.
   Specificity (0,2,1) beats lightbox rules like ".vlb div" (0,1,1).
   Component rules below are (0,3,0)+ so they win over this reset.
   Put .vm-raw on a wrapper around third-party widgets that bring their own
   CSS (rich-text editor, nestable lists, legacy .btn icon buttons): the
   wrapper itself is still reset, everything inside it is left alone.
   :where() keeps the :not() from adding specificity.
   -------------------------------------------------------------------------- */
    .modal.vm div:not(:where(.vm-raw *)),
    .modal.vm button:not(:where(.vm-raw *)),
    .modal.vm a:not(:where(.vm-raw *)),
    .modal.vm h4:not(:where(.vm-raw *)),
    .modal.vm span:not(:where(.vm-raw *)),
    .modal.vm label:not(:where(.vm-raw *)),
    .modal.vm input:not(:where(.vm-raw *)),
    .modal.vm textarea:not(:where(.vm-raw *)),
    .modal.vm select:not(:where(.vm-raw *)),
    .modal.vm ul:not(:where(.vm-raw *)),
    .modal.vm ol:not(:where(.vm-raw *)),
    .modal.vm li:not(:where(.vm-raw *)) {
        margin: 0;
        padding: 0;
        background: none;
        border: 0;
        border-radius: 0 !important;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        width: auto;
        min-width: 0;
        height: auto;
        transform: none;
        filter: none;
    }

.modal.vm {
    font-family: var(--vm-font);
    font-size: 15px;
    line-height: 1.4;
    color: var(--vm-text);
    text-align: left;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    user-select: text;
}

    .modal.vm *,
    .modal.vm *::before,
    .modal.vm *::after {
        box-sizing: border-box;
    }

/* --------------------------------------------------------------------------
   Scrim + positioning
   -------------------------------------------------------------------------- */
.modal.vm {
    background: transparent;
    transition: background-color .25s ease, backdrop-filter .25s ease;
}

    .modal.vm.in {
        background: var(--vm-scrim);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }

    .modal.vm .modal-dialog.vm-dialog {
        display: flex;
        align-items: center;
        min-height: calc(100% - 40px);
        width: auto;
        max-width: 360px;
        margin: 20px auto;
        padding: 0 16px;
    }

    .modal.vm .vm-dialog.vm-wide {
        max-width: 520px;
    }

    .modal.vm .vm-dialog.vm-xwide {
        max-width: 760px;
    }

    /* Entrance: scale + fade instead of Bootstrap's slide-down */
    .modal.vm.fade .modal-dialog.vm-dialog {
        transform: scale(.94);
        opacity: 0;
        transition: transform .28s cubic-bezier(.2, .9, .3, 1.2), opacity .2s ease;
    }

    .modal.vm.fade.in .modal-dialog.vm-dialog {
        transform: scale(1);
        opacity: 1;
    }

    /* --------------------------------------------------------------------------
   Panel (glass)
   -------------------------------------------------------------------------- */
    .modal.vm .vm-dialog .vm-panel {
        position: relative;
        width: 100%;
        background: var(--vm-bg);
        backdrop-filter: blur(40px) saturate(180%);
        -webkit-backdrop-filter: blur(40px) saturate(180%);
        border: 1px solid var(--vm-border);
        border-radius: var(--vm-radius) !important;
        box-shadow: 0 24px 60px rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .08), inset 0 1px 0 rgba(255, 255, 255, .35);
        overflow: hidden;
    }

    /* Header */
    .modal.vm .vm-panel .vm-header {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 18px 52px 10px;
        min-height: 52px;
    }

    .modal.vm .vm-header .vm-title {
        font-size: 17px;
        font-weight: 600;
        line-height: 1.3;
        color: var(--vm-text);
        text-align: center;
        margin: 0;
    }

    .modal.vm .vm-header .vm-close {
        position: absolute;
        top: 14px;
        right: 14px;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--vm-close-bg);
        color: var(--vm-text-2);
        border-radius: 50% !important;
        cursor: pointer;
        opacity: 1;
        text-shadow: none;
        transition: background-color .15s ease;
    }

        .modal.vm .vm-header .vm-close:hover {
            background: var(--vm-active);
        }

        .modal.vm .vm-header .vm-close svg {
            width: 12px;
            height: 12px;
            display: block;
        }

    /* Body / footer */
    .modal.vm .vm-panel .vm-body {
        padding: 8px 16px 16px;
    }

    .modal.vm .vm-panel .vm-footer {
        display: flex;
        gap: 10px;
        padding: 0 16px 16px;
    }

    .modal.vm .vm-panel .vm-text {
        color: var(--vm-text-2);
        font-size: 14px;
        text-align: center;
        padding: 0 4px 12px;
    }

    /* --------------------------------------------------------------------------
   Action list (inset grouped rows, e.g. Share)
   -------------------------------------------------------------------------- */
    .modal.vm .vm-body .vm-list {
        display: flex;
        flex-direction: column;
        background: var(--vm-group);
        border-radius: var(--vm-radius-sm) !important;
        overflow: hidden;
    }

    .modal.vm .vm-list .vm-row {
        position: relative;
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        min-height: 52px;
        padding: 10px 14px;
        background: transparent;
        color: var(--vm-text);
        font: inherit;
        font-size: 16px;
        text-align: left;
        text-decoration: none;
        cursor: pointer;
        transition: background-color .12s ease;
    }

        .modal.vm .vm-list .vm-row:hover {
            background: var(--vm-hover);
            text-decoration: none;
            color: var(--vm-text);
        }

        .modal.vm .vm-list .vm-row:active {
            background: var(--vm-active);
        }

        .modal.vm .vm-list .vm-row:focus-visible {
            outline: 2px solid var(--vm-accent);
            outline-offset: -2px;
        }

        /* inset divider that starts after the icon, iOS-style */
        .modal.vm .vm-list .vm-row + .vm-row::before {
            content: "";
            position: absolute;
            top: 0;
            left: 58px;
            right: 0;
            height: 1px;
            background: var(--vm-divider);
        }

    .modal.vm .vm-row .vm-icon {
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px !important;
        background: var(--vm-accent);
        color: #fff;
        font-size: 16px;
    }

        .modal.vm .vm-row .vm-icon svg {
            width: 18px;
            height: 18px;
            display: block;
        }

        .modal.vm .vm-row .vm-icon .fa {
            font-size: 17px;
            line-height: 1;
            width: auto;
            margin: 0;
            color: #fff;
        }

        .modal.vm .vm-row .vm-icon .fa-mobile {
            font-size: 22px;
        }

        .modal.vm .vm-row .vm-icon.vm-green {
            background: #30c158;
        }

        .modal.vm .vm-row .vm-icon.vm-gray {
            background: #8e8e93;
        }

        .modal.vm .vm-row .vm-icon.vm-orange {
            background: #ff9500;
        }

        .modal.vm .vm-row .vm-icon.vm-red {
            background: #ff3b30;
        }

    .modal.vm .vm-row .vm-label {
        flex: 1 1 auto;
    }

    .modal.vm .vm-row .vm-chevron {
        flex: 0 0 auto;
        color: var(--vm-text-2);
        opacity: .5;
    }

        .modal.vm .vm-row .vm-chevron svg {
            width: 8px;
            height: 14px;
            display: block;
        }

    /* Inline result area (e.g. generated link). Hidden until it has content. */
    .modal.vm .vm-body .vm-result:empty {
        display: none;
    }

    .modal.vm .vm-body .vm-result {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 12px;
        padding: 10px 12px;
        background: var(--vm-group);
        border-radius: var(--vm-radius-sm) !important;
        font-size: 14px;
        color: var(--vm-text-2);
        word-break: break-all;
    }

    /* --------------------------------------------------------------------------
   Buttons (for confirm / form modals)
   -------------------------------------------------------------------------- */
    .modal.vm .vm-panel .vm-btn {
        flex: 1 1 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 44px;
        padding: 10px 18px;
        font: inherit;
        font-size: 16px;
        font-weight: 600;
        color: #fff;
        background: var(--vm-accent);
        border-radius: var(--vm-radius-sm) !important;
        cursor: pointer;
        text-decoration: none;
        transition: filter .12s ease, transform .08s ease;
    }

        .modal.vm .vm-panel .vm-btn:hover {
            filter: brightness(1.08);
            color: #fff;
            text-decoration: none;
        }

        .modal.vm .vm-panel .vm-btn:active {
            transform: scale(.98);
        }

        .modal.vm .vm-panel .vm-btn.vm-btn-secondary {
            background: var(--vm-close-bg);
            color: var(--vm-text);
        }

        .modal.vm .vm-panel .vm-btn.vm-btn-danger {
            background: #ff3b30;
        }

        .modal.vm .vm-panel .vm-btn:focus-visible {
            outline: 2px solid var(--vm-accent);
            outline-offset: 2px;
        }

        .modal.vm .vm-panel .vm-btn.vm-btn-block {
            display: flex;
            width: 100%;
            text-align: center;
        }

        .modal.vm .vm-panel .vm-btn.vm-btn-sm {
            flex: 0 0 auto;
            min-height: 36px;
            padding: 6px 14px;
            font-size: 14px;
            border-radius: 10px !important;
        }

        .modal.vm .vm-panel .vm-btn.disabled,
        .modal.vm .vm-panel .vm-btn[disabled] {
            opacity: .55;
            pointer-events: none;
        }

        .modal.vm .vm-panel .vm-btn .fa {
            margin: 0;
        }

    /* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
    /* vertical rhythm without setting display, so .display-none / .show() still work */
    .modal.vm .vm-body .vm-stack > * + * {
        margin-top: 14px;
    }

    .modal.vm .vm-body .vm-section-label {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        padding: 0 14px 6px;
        font-size: 13px;
        font-weight: 500;
        color: var(--vm-text-2);
    }

        .modal.vm .vm-body .vm-section-label + * {
            margin-top: 0;
        }

    .modal.vm .vm-section-label .vm-hint {
        font-weight: 400;
        font-size: 12px;
        opacity: .8;
    }

    /* grouped fields */
    .modal.vm .vm-body .vm-fields {
        display: flex;
        flex-direction: column;
        background: var(--vm-group);
        border-radius: var(--vm-radius-sm) !important;
        overflow: hidden;
    }

    .modal.vm .vm-fields .vm-field {
        position: relative;
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 0 14px;
        cursor: text;
        transition: background-color .12s ease;
    }

        .modal.vm .vm-fields .vm-field:focus-within {
            background: var(--vm-hover);
        }

        .modal.vm .vm-fields .vm-field + .vm-field::before {
            content: "";
            position: absolute;
            top: 0;
            left: 44px;
            right: 0;
            height: 1px;
            background: var(--vm-divider);
        }

    .modal.vm .vm-field .vm-field-icon {
        flex: 0 0 18px;
        width: 18px;
        padding-top: 16px;
        font-size: 16px;
        line-height: 1;
        text-align: center;
        color: var(--vm-text-2);
    }

    .modal.vm .vm-body .vm-input {
        flex: 1 1 auto;
        display: block;
        width: 100%;
        min-height: 48px;
        padding: 14px 0;
        background: transparent;
        border: 0;
        outline: none;
        box-shadow: none;
        font: inherit;
        font-size: 16px; /* 16px stops iOS zooming on focus */
        line-height: 1.25;
        color: var(--vm-text);
    }

    .modal.vm .vm-body textarea.vm-input {
        resize: vertical;
        min-height: 96px;
    }

    .modal.vm .vm-body .vm-input::placeholder {
        color: var(--vm-text-2);
        opacity: .8;
    }

    /* select */
    .modal.vm .vm-body .vm-select {
        display: block;
        width: 100%;
        min-height: 48px;
        padding: 12px 40px 12px 14px;
        appearance: none;
        -webkit-appearance: none;
        background-color: var(--vm-group);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 16px center;
        border: 0;
        border-radius: var(--vm-radius-sm) !important;
        font: inherit;
        font-size: 16px;
        color: var(--vm-text);
        cursor: pointer;
        outline: none;
    }

        .modal.vm .vm-body .vm-select:focus-visible {
            box-shadow: 0 0 0 2px var(--vm-accent);
        }

    /* sortable list (jQuery UI sortable) */
    .modal.vm .vm-body .vm-sortable {
        list-style: none;
        max-height: 240px;
        overflow-y: auto;
        background: var(--vm-group);
        border-radius: var(--vm-radius-sm) !important;
    }

    .modal.vm .vm-sortable li {
        position: relative;
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 44px;
        padding: 10px 14px 10px 40px;
        list-style: none;
        background: transparent;
        border: 0;
        font-size: 15px;
        font-weight: 400;
        color: var(--vm-text);
        cursor: grab;
    }

        .modal.vm .vm-sortable li + li {
            box-shadow: inset 0 1px 0 var(--vm-divider);
        }

        .modal.vm .vm-sortable li::before {
            content: "\2261";
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-52%);
            font-size: 18px;
            color: var(--vm-text-2);
            opacity: .6;
        }

        .modal.vm .vm-sortable li.ui-sortable-helper {
            background: var(--vm-bg);
            border-radius: 10px !important;
            box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
            cursor: grabbing;
        }

        .modal.vm .vm-sortable li.ui-sortable-placeholder {
            visibility: visible !important;
            background: var(--vm-hover);
            box-shadow: inset 0 0 0 1px var(--vm-divider);
        }

    /* read-only value + action, e.g. generated link + Copy */
    .modal.vm .vm-body .vm-copy-field {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 4px 6px 4px 14px;
        background: var(--vm-group);
        border-radius: var(--vm-radius-sm) !important;
    }

    .modal.vm .vm-copy-field .vm-input {
        min-height: 40px;
        padding: 8px 0;
        font-size: 15px;
        text-overflow: ellipsis;
    }

    /* style-metronic.css paints input[readonly] #F9F9F9 !important with a not-allowed cursor,
       which hides the light text of a dark modal. A more specific !important wins. */
    .modal.vm .vm-body .vm-input[readonly] {
        background-color: transparent !important;
        cursor: text;
    }

    /* loading */
    .modal.vm .vm-body .vm-loading {
        padding: 36px 0;
    }

    .modal.vm .vm-loading .vm-spinner {
        display: block;
        width: 30px;
        height: 30px;
        margin: 0 auto;
        border: 3px solid var(--vm-divider);
        border-top-color: var(--vm-accent);
        border-radius: 50% !important;
        animation: vm-spin .8s linear infinite;
    }

@keyframes vm-spin {
    to {
        transform: rotate(360deg);
    }
}

/* QR code */
.modal.vm .vm-body .vm-qr {
    display: flex;
    justify-content: center;
}

    .modal.vm .vm-body .vm-qr:empty {
        display: none;
    }

.modal.vm .vm-qr > img,
.modal.vm .vm-qr > canvas,
.modal.vm .vm-qr > table {
    background: #fff;
    padding: 12px;
    border-radius: 14px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

.modal.vm .vm-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Tall modals: header and footer stay put, body scrolls
   -------------------------------------------------------------------------- */
.modal.vm .vm-dialog .vm-panel.vm-panel-scroll {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
}

.modal.vm .vm-panel-scroll .vm-header {
    flex: 0 0 auto;
}

.modal.vm .vm-panel-scroll .vm-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.modal.vm .vm-panel.vm-panel-scroll .vm-footer {
    flex: 0 0 auto;
    padding: 12px 16px 16px;
    box-shadow: inset 0 1px 0 var(--vm-divider);
}

.modal.vm .vm-panel .vm-footer.vm-footer-end {
    justify-content: flex-end;
}

.modal.vm .vm-footer-end .vm-btn {
    flex: 0 0 auto;
    min-width: 110px;
}

/* --------------------------------------------------------------------------
   Links, toolbar, notes
   -------------------------------------------------------------------------- */
.modal.vm .vm-panel .vm-link {
    display: inline;
    background: none;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--vm-accent);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

    .modal.vm .vm-panel .vm-link:hover {
        text-decoration: underline;
        color: var(--vm-accent);
    }

.modal.vm .vm-body .vm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 36px;
    padding: 0 4px;
}

.modal.vm .vm-body .vm-note {
    padding: 12px 14px;
    background: color-mix(in srgb, var(--vm-accent) 10%, transparent);
    border-radius: var(--vm-radius-sm) !important;
    font-size: 14px;
    line-height: 1.45;
    color: var(--vm-text);
}

.modal.vm .vm-note a {
    color: var(--vm-accent);
    font-weight: 600;
}

/* two fields side by side inside one group, e.g. first / last name */
.modal.vm .vm-fields .vm-field-split {
    display: flex;
    position: relative;
}

.modal.vm .vm-field-split > .vm-field {
    flex: 1 1 0;
    min-width: 0;
}

    .modal.vm .vm-field-split > .vm-field + .vm-field::before {
        top: 10px;
        bottom: 10px;
        left: 0;
        right: auto;
        width: 1px;
        height: auto;
    }

.modal.vm .vm-fields .vm-field-split + .vm-field::before,
.modal.vm .vm-fields .vm-field + .vm-field-split::before {
    content: "";
    position: absolute;
    top: 0;
    left: 44px;
    right: 0;
    height: 1px;
    background: var(--vm-divider);
}

/* things inside a field row: trailing button or link */
.modal.vm .vm-field .vm-field-btn {
    flex: 0 0 auto;
    align-self: center;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--vm-accent);
    color: #fff;
    border-radius: 50% !important;
    font-size: 13px;
    cursor: pointer;
    transition: filter .12s ease;
}

    .modal.vm .vm-field .vm-field-btn:hover {
        filter: brightness(1.08);
    }

    .modal.vm .vm-field .vm-field-btn .fa {
        margin: 0;
        padding: 0;
        font-size: 13px;
    }

.modal.vm .vm-field .vm-field-action {
    align-self: center;
    flex: 0 0 auto;
}

/* row under a field group, e.g. "Expand" */
.modal.vm .vm-body .vm-field-meta {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 6px 14px 0;
}

/* field groups that host a dropdown must not clip it */
.modal.vm .vm-body .vm-fields.vm-fields-open {
    overflow: visible;
}

/* --------------------------------------------------------------------------
   Typeahead (twitter typeahead.js or bootstrap3-typeahead)
   -------------------------------------------------------------------------- */
.modal.vm .vm-field .twitter-typeahead {
    flex: 1 1 auto;
    display: block !important;
    position: relative;
}

    .modal.vm .vm-field .twitter-typeahead .vm-input {
        width: 100%;
    }

.modal.vm .vm-field .tt-hint {
    color: var(--vm-text-2);
    opacity: .45;
}

.modal.vm .vm-field .tt-menu,
.modal.vm .vm-field .typeahead.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    min-width: 220px;
    max-height: 260px;
    overflow-y: auto;
    margin-top: 6px;
    padding: 6px;
    list-style: none;
    background: var(--vm-bg-solid);
    border: 1px solid var(--vm-border);
    border-radius: 12px !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, .2);
}

    .modal.vm .vm-field .tt-suggestion,
    .modal.vm .vm-field .typeahead.dropdown-menu > li > a {
        display: block;
        padding: 9px 10px;
        font-size: 15px;
        color: var(--vm-text);
        text-decoration: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        border-radius: 8px !important;
        cursor: pointer;
    }

        .modal.vm .vm-field .tt-suggestion:hover,
        .modal.vm .vm-field .tt-suggestion.tt-cursor,
        .modal.vm .vm-field .typeahead.dropdown-menu > li > a:hover,
        .modal.vm .vm-field .typeahead.dropdown-menu > li.active > a {
            background: var(--vm-accent);
            color: #fff;
        }

/* --------------------------------------------------------------------------
   Segmented control (Bootstrap 3 data-toggle="buttons" radio group)
   Keep .btn on the labels: Bootstrap's button plugin looks for it.
   -------------------------------------------------------------------------- */
.modal.vm .vm-body .vm-segmented {
    display: inline-flex;
    padding: 2px;
    background: var(--vm-close-bg);
    border-radius: 10px !important;
}

.modal.vm .vm-segmented .vm-seg-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--vm-text);
    background: transparent;
    border: 0;
    border-radius: 8px !important;
    box-shadow: none;
    cursor: pointer;
    transition: background-color .15s ease;
}

    .modal.vm .vm-segmented .vm-seg-btn.active {
        background: var(--vm-seg-active);
        box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
    }

    .modal.vm .vm-segmented .vm-seg-btn input[type="radio"] {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
        pointer-events: none;
    }

/* simple horizontal row */
.modal.vm .vm-body .vm-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.modal.vm .vm-inline .vm-inline-text {
    font-size: 14px;
    color: var(--vm-text-2);
}

/* --------------------------------------------------------------------------
   File upload
   -------------------------------------------------------------------------- */
.modal.vm .vm-body .vm-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 22px 16px;
    background: var(--vm-group);
    border: 1.5px dashed var(--vm-divider);
    border-radius: var(--vm-radius-sm) !important;
    font-size: 14px;
    color: var(--vm-text-2);
    text-align: center;
    cursor: pointer;
}

.modal.vm .vm-file input[type="file"] {
    max-width: 100%;
    font: inherit;
    font-size: 14px;
    color: var(--vm-text-2);
}

    .modal.vm .vm-file input[type="file"]::file-selector-button {
        margin-right: 10px;
        padding: 7px 14px;
        border: 0;
        border-radius: 10px;
        background: var(--vm-accent);
        color: #fff;
        font: inherit;
        font-weight: 600;
        cursor: pointer;
    }

/* --------------------------------------------------------------------------
   Wrappers for widgets that keep their own CSS (use with .vm-raw)
   -------------------------------------------------------------------------- */
.modal.vm .vm-body .vm-editor {
    border: 1px solid var(--vm-divider);
    border-radius: var(--vm-radius-sm) !important;
    overflow: hidden;
    background: #fff;
}

.modal.vm .vm-body .vm-contacts {
    margin-top: 8px;
}

    .modal.vm .vm-body .vm-contacts:has(> .dd-list:empty) {
        display: none;
    }

.modal.vm .vm-body .vm-sortable:empty {
    display: none;
}

/* AI toolbar: legacy icon buttons kept as-is inside .vm-raw */
.modal.vm .vm-body .vm-ai-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.modal.vm .vm-ai-bar > .btn {
    float: none !important;
    margin: 0;
}

.modal.vm .vm-ai-bar .vm-ai-label {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    background: color-mix(in srgb, var(--vm-accent) 12%, transparent);
    color: var(--vm-accent);
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px !important;
    cursor: pointer;
}

    .modal.vm .vm-ai-bar .vm-ai-label:hover {
        background: color-mix(in srgb, var(--vm-accent) 18%, transparent);
    }

/* --------------------------------------------------------------------------
   Alert-style modal: icon above a centered title (e.g. session expiring)
   -------------------------------------------------------------------------- */
.modal.vm .vm-panel .vm-hero-icon {
    width: 52px;
    height: 52px;
    margin: 22px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, #ff9500 16%, transparent);
    color: #ff9500;
    border-radius: 50% !important;
}

.modal.vm .vm-hero-icon svg {
    width: 26px;
    height: 26px;
    display: block;
}

.modal.vm .vm-hero-icon + .vm-header {
    padding-top: 10px;
    min-height: 0;
}

.modal.vm .vm-panel .vm-text strong {
    color: var(--vm-text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Small screens: bottom sheet */
@media (max-width: 480px) {
    .modal.vm .modal-dialog.vm-dialog {
        align-items: flex-end;
        min-height: calc(100% - 12px);
        margin: 0 auto 12px;
        padding: 0 10px;
        max-width: none;
    }

    .modal.vm.fade .modal-dialog.vm-dialog {
        transform: translateY(40px);
    }

    .modal.vm.fade.in .modal-dialog.vm-dialog {
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal.vm, .modal.vm .modal-dialog.vm-dialog {
        transition: none;
    }

        .modal.vm .vm-loading .vm-spinner {
            animation-duration: 2s;
        }
}

/* --------------------------------------------------------------------------
   Keep Metronic's hide classes working on vm components (which set display).
   Repeated class = higher specificity than any component rule; jQuery
   .show() still wins because it writes an inline style.
   -------------------------------------------------------------------------- */
.modal.vm.vm .vm-panel .display-none.display-none,
.modal.vm.vm .vm-panel .display-hide.display-hide,
.modal.vm.vm .vm-panel [hidden] {
    display: none;
}
