/* ════════════════════════════════════════════════════════════════
   Share report modal (app/views/share.html) — v4 redesign.
   Scoped to .dwi-share-modal so it can ride on the Bootstrap modal shell.
   ════════════════════════════════════════════════════════════════ */
.dwi-share-modal {
    /* Accent = the active brand primary (white-label safe). DealWorthIt's
       --dwi-color-primary IS #0E6E59 / strong #0B5C4A, so DWI is unchanged;
       Mogul & other white-label brands now theme the modal (Enable link
       button, switch, pills, focus rings) with their own primary. The
       literals stay as the no-brand fallback. */
    --shc: var(--dwi-color-primary, #0E6E59);
    --shc-strong: var(--dwi-color-primary-strong, #0B5C4A);
    --shc-soft: var(--dwi-color-primary-soft, #E7F3EE);
    --sh-text: #14211D; --sh-muted: #6B7570; --sh-soft-muted: #9AA39E;
    --sh-line: #E8ECEA; --sh-line-soft: #EEF0F3; --sh-rail: #FBFCFC;
}
.dwi-share-modal .modal-dialog { max-width: 620px; }
.dwi-share-modal .modal-content {
    border: 0; border-radius: 20px; padding: 0;
    box-shadow: 0 30px 80px -20px rgba(16, 32, 28, 0.35);
    overflow: hidden;
}

/* ----- Header ----- */
.dwi-share-modal-header {
    display: flex; align-items: flex-start; gap: 16px;
    padding: 24px 28px 18px; border-bottom: 1px solid var(--sh-line);
}
.dwi-share-modal-title { font-size: 21px; font-weight: 700; color: var(--sh-text); margin: 0; line-height: 1.25; letter-spacing: -.01em; }
.dwi-share-modal-subtitle { font-size: 14px; color: var(--sh-muted); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dwi-share-modal-close {
    background: transparent; border: 0; padding: 6px; color: var(--sh-soft-muted);
    font-size: 17px; line-height: 1; cursor: pointer; border-radius: 8px; align-self: flex-start;
    transition: background .12s, color .12s;
}
.dwi-share-modal-close:hover { color: var(--sh-text); background: var(--sh-line-soft); }

/* ----- Body ----- */
.dwi-share-modal-body { padding: 22px 28px 26px; }

/* ----- Shareable link card ----- */
.dwi-share-link-card { border: 1px solid var(--sh-line); border-radius: 14px; padding: 18px 18px 16px; }
.dwi-share-toggle-row { display: flex; align-items: center; gap: 14px; }
.dwi-share-toggle-icon {
    width: 44px; height: 44px; border-radius: 12px; background: var(--sh-line-soft);
    display: inline-flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.dwi-share-toggle-icon i { color: var(--shc); -webkit-text-stroke: 0.4px var(--shc); }
.dwi-share-toggle-title { font-size: 16px; font-weight: 700; color: var(--sh-text); line-height: 1.3; }
.dwi-share-toggle-sub { font-size: 13.5px; color: var(--sh-muted); margin-top: 2px; }
.dwi-share-card-divider { height: 1px; background: var(--sh-line-soft); margin: 16px 0; }

/* ----- URL row + Copy button ----- */
.dwi-share-url-row { display: flex; align-items: stretch; gap: 12px; }
.dwi-share-url {
    flex: 1 1 auto; min-width: 0; display: flex; align-items: center;
    height: 48px; padding: 0 16px;
    background: var(--sh-rail); border: 1px solid var(--sh-line); border-radius: 11px;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 14px; color: var(--sh-text); text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dwi-share-url:hover { color: var(--sh-text); }
.dwi-share-copy-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 48px; padding: 0 18px; background: #fff; color: var(--sh-text);
    border: 1px solid var(--sh-line); border-radius: 11px;
    font-size: 14px; font-weight: 600; cursor: pointer; flex-shrink: 0; transition: background .12s, border-color .12s, color .12s;
}
.dwi-share-copy-btn i { font-size: 16px; color: var(--sh-muted); }
.dwi-share-copy-btn:hover { background: var(--sh-line-soft); }
.dwi-share-copy-btn.is-copied { background: var(--shc); border-color: var(--shc); color: #fff; }
.dwi-share-copy-btn.is-copied i { color: #fff; }

/* ----- View only row ----- */
.dwi-share-viewonly-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.dwi-share-viewonly {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--shc-soft); color: var(--shc);
    padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
}
.dwi-share-viewonly i { font-size: 12px; }
.dwi-share-viewonly-help { font-size: 13.5px; color: var(--sh-muted); }

/* ----- Scenarios block ----- */
.dwi-share-scn-block { margin-top: 24px; }
.dwi-share-scn-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dwi-share-scn-titlebtn { display: inline-flex; align-items: center; gap: 9px; background: none; border: 0; padding: 0; cursor: pointer; }
.dwi-share-scn-title { font-size: 16px; font-weight: 700; color: var(--sh-text); }
.dwi-share-scn-count { font-size: 13px; font-weight: 500; color: var(--sh-soft-muted); font-family: ui-monospace, Menlo, monospace; margin-left: 6px; }
.dwi-share-scn-chev { font-size: 12px; color: var(--sh-soft-muted); transition: transform .15s ease; }
.dwi-share-scn-block.is-collapsed .dwi-share-scn-chev { transform: rotate(-90deg); }
.dwi-share-scn-block.is-collapsed .dwi-share-scn-list { display: none; }
.dwi-share-scn-block.is-collapsed .dwi-share-scn-head { margin-bottom: 0; }
.dwi-share-selectall { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.dwi-share-selectall-label { font-size: 14px; font-weight: 500; color: var(--sh-muted); }

.dwi-share-scn-list { border: 1px solid var(--sh-line); border-radius: 14px; overflow: hidden; }
.dwi-share-scn-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--sh-line-soft); }
.dwi-share-scn-row:first-child { border-top: 0; }
.dwi-share-scn-ico {
    /* width: 38px; height: 38px; border-radius: 9px; background: var(--sh-line-soft); color: var(--sh-muted);
    display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; */
}
.dwi-share-scn-name { flex: 1 1 auto; min-width: 0; font-size: 13px; font-weight: 600; color: var(--sh-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dwi-share-scn-included { font-size: 13px; font-weight: 600; color: var(--shc); }
.dwi-share-scn-row:has(.scenario_share:not(:checked)) .dwi-share-scn-included { visibility: hidden; }

/* ----- OR divider ----- */
.dwi-share-or { position: relative; text-align: center; margin: 26px 0; font-size: 11.5px; color: var(--sh-soft-muted); letter-spacing: 0.18em; font-weight: 600; }
.dwi-share-or::before, .dwi-share-or::after { content: ''; position: absolute; top: 50%; width: calc(50% - 28px); height: 1px; background: var(--sh-line); }
.dwi-share-or::before { left: 0; } .dwi-share-or::after { right: 0; }

/* ----- Invite by email ----- */
.dwi-share-invite-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.dwi-share-invite-label { font-size: 16px; font-weight: 700; color: var(--sh-text); }
.dwi-share-section-help { font-size: 13.5px; color: var(--sh-muted); margin-bottom: 12px; }
.dwi-share-email-input {
    width: 100%; min-height: 56px; resize: vertical; padding: 16px 18px;
    background: #fff; border: 1px solid var(--sh-line); border-radius: 12px;
    font-size: 15px; color: var(--sh-text); font-family: inherit;
}
.dwi-share-email-input::placeholder { color: var(--sh-soft-muted); }
.dwi-share-email-input:focus { outline: none; border-color: var(--shc); box-shadow: 0 0 0 3px var(--shc-soft); }

/* ----- Footer ----- */
.dwi-share-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 22px 0 4px; margin-top: 22px; border-top: 1px solid var(--sh-line); }
.dwi-share-btn-ghost { padding: 11px 22px; background: #fff; border: 1px solid var(--sh-line); border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--sh-text); cursor: pointer; line-height: 1.2; }
.dwi-share-btn-ghost:hover { background: var(--sh-line-soft); }
.dwi-share-btn-primary {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px;
    background: var(--shc); color: #fff; border: 0; border-radius: 5px;
    font-size: 14px; font-weight: 700; cursor: pointer; line-height: 1.2; transition: background .12s;
}
.dwi-share-btn-primary:hover { background: var(--shc-strong); }
.dwi-share-btn-primary .indicator-progress { align-items: center; gap: 6px; }

/* ----- Toggle switch (emerald) -----
   Self-contained: the modal draws its own track + knob instead of leaning on
   Metronic's .form-switch cascade. The standalone SF/MF report pages don't
   reliably apply that thumb background-image, which left the knob invisible
   (a bare Bootstrap pill). Grey knob when off, white knob when on. */
.dwi-share-modal .form-check-input {
    width: 42px !important; height: 24px !important; cursor: pointer;
    -webkit-appearance: none; appearance: none;
    background-color: #E4E6EF !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3e%3ccircle cx='10' cy='10' r='9' fill='%23b5b5c3'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: 2px center !important;
    background-size: 20px 20px !important;
    border: 0 !important;
    border-radius: 24px !important;
    box-shadow: none;
    transition: background-color .15s ease-in-out, background-position .15s ease-in-out;
}
.dwi-share-modal .form-check-input:checked {
    background-color: var(--shc) !important; border-color: var(--shc) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3e%3ccircle cx='10' cy='10' r='9' fill='%23fff'/%3e%3c/svg%3e") !important;
    background-position: calc(100% - 2px) center !important;
}
.dwi-share-modal .form-check-input:focus { box-shadow: 0 0 0 3px var(--shc-soft) !important; }

/* ----- Report Link Controls (report-scoped share modal) -----
   When the Share modal is opened from the Reports library, the deal-level
   on/off switch is replaced by the report's own public-link state: a live
   "Public" pill (when enabled) or an Enable action + private note (when not). */
.dwi-share-linkstate {
    display: inline-flex; align-items: center; white-space: nowrap;
    padding: 6px 12px; border-radius: 999px;
    font-size: 13px; font-weight: 700; line-height: 1;
}
.dwi-share-linkstate--on { color: var(--shc); background: var(--shc-soft); }
.dwi-share-private-note {
    display: flex; align-items: flex-start; gap: 2px;
    font-size: 13px; color: var(--sh-muted, #6B7570); line-height: 1.4;
}
