/* ===== MODALS & FULL-PAGE SCREENS (visual only) ===== */

/* --- Full page beside the side menu (user management, permissions) --- */
.fixed.um-page {
    background: #f7f7f8 !important;
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    animation: um-in 0.16s ease-out;
}
@keyframes um-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (min-width: 769px) {
    .fixed.um-page { right: 248px !important; }
    body:has(.app-sidebar.is-collapsed) .fixed.um-page { right: 76px !important; }
}
/* Users list and store management are in the side menu: no back button there.
   Sub-screens (permissions editor, monthly data) keep theirs. */
.um-page .um-modal .um-header .um-close,
.um-page .sm-card .um-header .um-close { display: none !important; }
/* Phones: full-page screens start under the top bar so the ☰ menu stays reachable */
@media (max-width: 768px) {
    .fixed.um-page:has(.um-modal),
    .fixed.um-page:has(.sm-card),
    .fixed.rw-overlay { top: 56px !important; height: auto !important; }
}
.um-page .um-page__card {
    max-width: none !important;
    max-height: none !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #f7f7f8 !important;
    direction: rtl;
}

/* Header */
.um-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid #ececef;
    flex-shrink: 0;
}
.um-header__titles { display: flex; align-items: center; gap: 12px; min-width: 0; }
.um-title { font-size: 20px; font-weight: 700; color: #18181b; margin: 0; letter-spacing: -0.4px; }
.um-sub { font-size: 12.5px; color: #71717a; margin-top: 2px; }
.um-header__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Buttons */
.um-page .um-btn-primary,
.um-page .um-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.um-page .um-btn-primary { background: #18181b; color: #fff; border: 1px solid #18181b !important; }
.um-page .um-btn-primary:hover { background: #27272a; transform: none; box-shadow: none; }
.um-page .um-btn-ghost { background: #fff; color: #3f3f46; border: 1px solid #e4e4e7 !important; font-weight: 500; }
.um-page .um-btn-ghost:hover { background: #f4f4f5; color: #18181b; transform: none; box-shadow: none; }
.um-page .um-btn--lg { height: 44px; padding: 0 28px; font-size: 14px; }
.um-page .um-close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #fff;
    border: 1px solid #e4e4e7 !important;
    color: #71717a;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.um-page .um-close:hover { background: #f4f4f5; color: #18181b; transform: none; box-shadow: none; }

/* Body */
.um-body { flex: 1; overflow-y: auto; padding: 20px 24px 28px; }

/* --- User list --- */
.um-modal table.um-table {
    box-shadow: 0 1px 2px rgba(16,24,40,0.04);
    border-radius: 12px;
    background: #fff;
    border: 1px solid #ececef;
    overflow: hidden;
}
.um-modal .um-table thead { background: transparent; color: inherit; }
.um-modal .um-thead-row th {
    background: #fafafa;
    color: #71717a !important;
    font-weight: 600 !important;
    text-transform: none;
    letter-spacing: 0;
    padding: 12px 16px !important;
    border-right: none !important;
    border-bottom: 1px solid #ececef !important;
    position: sticky;
    top: 0;
    z-index: 2;
}
.um-modal .um-table tbody td {
    border-right: none !important;
    border-bottom: 1px solid #f1f1f3 !important;
    background: transparent;
    padding: 14px 16px !important;
    vertical-align: middle !important;
}
.um-modal .um-table tbody tr:last-child td { border-bottom: none !important; }
.um-modal .um-row:hover td { background: #fafafa; }
.um-user { display: flex; align-items: center; gap: 10px; }
.um-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f4f4f5;
    border: 1px solid #ececef;
    color: #3f3f46;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.um-avatar--lg { width: 40px; height: 40px; font-size: 16px; }
@media (min-width: 769px) {
    .um-modal .um-table td[data-label="הרשאות"] { width: 55%; }
    .um-modal .um-table td[data-label="הרשאות"] > div { gap: 5px !important; }
}
/* Permission tags & store chips: calmer, uniform look */
.um-modal .um-table td[data-label="הרשאות"] span {
    background: #f4f4f5 !important;
    color: #3f3f46 !important;
    border: 1px solid #ececef !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    padding: 2px 8px !important;
}
.um-modal .um-table td[data-label="חנויות"] span {
    background: #fff !important;
    border: 1px solid #e4e4e7 !important;
    border-radius: 6px !important;
    padding: 2px 8px !important;
}
.um-modal .um-cell-actions button { border-radius: 8px !important; padding: 7px !important; }

/* --- Permissions editor --- */
.pm-body { padding-bottom: 12px; }
.pm-sections { display: flex; flex-direction: column; gap: 16px; }
.pm-section {
    background: #fff;
    border: 1px solid #ececef;
    border-radius: 14px;
    padding: 18px 18px 14px;
    box-shadow: 0 1px 2px rgba(16,24,40,0.04);
}
.pm-section--stores { margin-top: 16px; }
.pm-section__head { margin-bottom: 12px; }
.pm-section__title { font-size: 15px; font-weight: 700; color: #18181b; }
.pm-section__sub { font-size: 12.5px; color: #71717a; margin-top: 2px; }
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }

.pm-perm {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #ececef;
    border-radius: 11px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.pm-perm:hover { background: #fafafa; border-color: #e4e4e7; }
.pm-perm:has(.pm-switch:checked) { border-color: #d4d4d8; background: #fafafa; }
.pm-perm:has(.pm-switch:disabled) { opacity: 0.55; cursor: not-allowed; }
.pm-perm__text { flex: 1; min-width: 0; }
.pm-perm__title { font-size: 13.5px; font-weight: 600; color: #18181b; }
.pm-perm__desc { font-size: 12px; color: #71717a; margin-top: 2px; line-height: 1.45; }

/* Checkbox rendered as a switch (still a native checkbox) */
.pm-perm input.pm-switch {
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
    width: 36px;
    height: 20px;
    margin-top: 1px;
    border-radius: 999px;
    background: #e4e4e7;
    position: relative;
    cursor: pointer;
    transition: background 0.18s;
    border: none !important;
    padding: 0 !important;
}
.pm-perm input.pm-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: right 0.18s;
}
.pm-perm input.pm-switch:checked { background: #18181b; }
.pm-perm input.pm-switch:checked::after { right: 18px; }
.pm-perm input.pm-switch:disabled { cursor: not-allowed; }

.pm-stores { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.pm-store {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #ececef;
    border-radius: 11px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.pm-store:hover { border-color: #d4d4d8; }
.pm-store.is-on { border-color: #18181b; box-shadow: 0 0 0 1px #18181b inset; }
.pm-store__badge {
    width: 32px; height: 32px; border-radius: 9px;
    background: var(--pick-color); color: #fff;
    font-weight: 700; font-size: 14px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pm-store__now { font-size: 11px; color: #3f3f46; background: #f4f4f5; border: 1px solid #ececef; border-radius: 6px; padding: 2px 8px; font-weight: 500; }
.pm-check { width: 16px; height: 16px; flex-shrink: 0; }
.pm-selected { margin-top: 12px; padding: 10px 14px; background: #fafafa; border: 1px solid #ececef; border-radius: 10px; font-size: 13px; color: #3f3f46; }
.pm-selected__list { color: #71717a; margin-top: 2px; }

.pm-footer {
    display: flex;
    gap: 10px;
    padding: 14px 24px;
    background: #fff;
    border-top: 1px solid #ececef;
    flex-shrink: 0;
}

/* --- Confirm dialog (tasks delete / hide) --- */
.cm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(24,24,27,0.42);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 16px;
    animation: cm-fade 0.15s ease-out;
}
.cm-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px 22px 18px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 24px 48px -12px rgba(0,0,0,0.25);
    direction: rtl;
    text-align: center;
    animation: cm-pop 0.18s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes cm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cm-pop { from { opacity: 0; transform: scale(0.96) translateY(6px); } to { opacity: 1; transform: none; } }
.cm-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f5;
    color: #3f3f46;
}
.cm-icon--danger { background: #fef2f2; color: #dc2626; }
.cm-message { margin: 0 0 20px; font-size: 15px; font-weight: 500; color: #18181b; line-height: 1.6; }
.cm-actions { display: flex; gap: 8px; }
.cm-card .cm-btn {
    flex: 1;
    height: 42px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.cm-card .cm-btn--ghost { background: #fff; color: #3f3f46; border: 1px solid #e4e4e7 !important; }
.cm-card .cm-btn--ghost:hover { background: #f4f4f5; transform: none; box-shadow: none; }
.cm-card .cm-btn--danger { background: #dc2626; color: #fff; border: 1px solid #dc2626 !important; }
.cm-card .cm-btn--danger:hover { background: #b91c1c; transform: none; }
.cm-card .cm-btn--dark { background: #18181b; color: #fff; border: 1px solid #18181b !important; }
.cm-card .cm-btn--dark:hover { background: #27272a; transform: none; }

/* --- Store management (full page) --- */
.um-page .sm-card { padding: 0 !important; }
.sm-section-title { font-size: 13px; font-weight: 600; color: #71717a; margin: 0 2px 10px; }
.sm-list { display: flex; flex-direction: column; gap: 10px; }
.sm-row {
    background: #fff;
    border: 1px solid #ececef;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(16,24,40,0.04);
}
.sm-row__inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.sm-row__info { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sm-swatch { width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }
.sm-name { font-size: 16px; font-weight: 700; color: #18181b; text-transform: capitalize; margin-bottom: 2px; }
.sm-meta { font-size: 12.5px; color: #71717a; }
.sm-actions { display: flex; gap: 8px; flex-shrink: 0; }
.um-page .sm-btn {
    width: 104px;
    height: 38px;
    border-radius: 9px;
    background: #fff;
    color: #27272a;
    border: 1px solid #e4e4e7 !important;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.um-page .sm-btn:hover { background: #f4f4f5; transform: none; box-shadow: none; }
.um-page .sm-btn--danger { color: #dc2626; }
.um-page .sm-btn--danger:hover { background: #fef2f2; border-color: #fecaca !important; }

/* --- Influencer monthly data (full page) --- */
.um-page .md-card { overflow: hidden; }
.md-body { background: #f7f7f8; }
.md-grid { align-items: start; }
.md-panel {
    background: #fff;
    border: 1px solid #ececef;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(16,24,40,0.04);
    min-width: 0;
}
.md-panel__title { font-size: 15px; font-weight: 700; color: #18181b; margin: 0 0 14px; }
/* Desktop: the add/edit form stays in place on the right while the history scrolls */
@media (min-width: 769px) {
    /* Compact form: two fields per row, fits without its own scrollbar */
    .md-grid > .md-panel:first-child {
        position: sticky;
        top: 0;
        align-self: start;
        z-index: 1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 10px 12px;
        padding: 16px 18px;
    }
    .md-grid > .md-panel:first-child > * { margin: 0 !important; }
    /* Fill the whole right side: the notes row takes whatever height is left */
    .md-grid > .md-panel:first-child {
        height: calc(100vh - 185px);
        grid-template-rows: auto auto auto auto auto minmax(88px, 1fr) auto auto;
        align-content: stretch;
        /* Only if the content truly can't fit (many documents, small screen) — never hidden behind the save bar */
        overflow-y: auto;
        scrollbar-width: thin;
    }
    .md-grid > .md-panel:first-child > :nth-child(9) { display: flex; flex-direction: column; min-height: 88px; }
    .md-grid > .md-panel:first-child > :nth-child(9) textarea { flex: 1; height: auto !important; min-height: 52px; resize: none; }
    .md-grid > .md-panel:first-child > :nth-child(1),
    .md-grid > .md-panel:first-child > :nth-child(9),
    .md-grid > .md-panel:first-child > :nth-child(10),
    .md-grid > .md-panel:first-child > :nth-child(11) { grid-column: 1 / -1; }
    .md-grid > .md-panel:first-child > :nth-child(8) { grid-column: 1 / -1; }
    .md-grid > .md-panel:first-child label { font-size: 12.5px !important; margin-bottom: 4px !important; color: #3f3f46; }
    .md-grid > .md-panel:first-child input:not([type="file"]),
    .md-grid > .md-panel:first-child select { height: 38px; padding: 0 10px !important; font-size: 13.5px; }
    .md-grid > .md-panel:first-child textarea { height: 56px; min-height: 0; padding: 8px 10px !important; font-size: 13.5px; resize: vertical; }
    .md-grid > .md-panel:first-child p.text-xs { font-size: 11px !important; margin-top: 3px !important; }
    .md-grid > .md-panel:first-child > :nth-child(9) p,
    .md-grid > .md-panel:first-child > :nth-child(10) > p { display: none; }
    /* Document upload: one compact row */
    .md-grid > .md-panel:first-child > :nth-child(10) {
        background: #fafafa !important;
        border: 1px dashed #e4e4e7 !important;
        border-radius: 10px !important;
        padding: 10px 12px !important;
    }
    .md-grid > .md-panel:first-child > :nth-child(10) > label { margin-bottom: 6px !important; color: #3f3f46 !important; }
    .md-grid > .md-panel:first-child > :nth-child(10) input[type="file"] { padding: 6px 8px !important; font-size: 12.5px; }
    /* Automatic calculations: three tiles per row */
    .md-grid > .md-panel:first-child > :nth-child(11) { padding: 10px 12px !important; border-radius: 10px !important; }
    .md-grid > .md-panel:first-child > :nth-child(11) > div:first-child { margin-bottom: 6px !important; font-size: 12.5px !important; }
    .md-grid > .md-panel:first-child > :nth-child(11) .grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px !important; }
    .md-grid > .md-panel:first-child > :nth-child(11) .md-tile { padding: 6px 8px; }
    .md-grid > .md-panel:last-child { height: auto !important; }
    .md-grid > .md-panel:last-child > .overflow-y-auto { overflow: visible !important; }
}
.md-panel input, .md-panel select, .md-panel textarea {
    border: 1px solid #e4e4e7 !important;
    border-radius: 10px !important;
    background: #fff;
}
.md-panel input:focus, .md-panel select:focus, .md-panel textarea:focus { border-color: #18181b !important; box-shadow: 0 0 0 3px rgba(24,24,27,0.08) !important; }

/* Value tiles: all the same — no tile is singled out */
.md-tile {
    background: #fafafa;
    border: 1px solid #f0f0f2;
    border-radius: 10px;
    padding: 8px 10px;
}
.md-label { display: block; font-size: 11.5px; color: #71717a; margin-bottom: 2px; }
.md-val { font-size: 14px; font-weight: 700; color: #18181b; }
.md-tiles { gap: 6px !important; }

/* History card */
.md-hist {
    border: 1px solid #ececef;
    border-radius: 12px;
    padding: 14px;
    background: #fff;
    margin-bottom: 10px;
}
.md-hist > div:first-child { margin-bottom: 12px !important; }
.md-hist > div:first-child .font-bold { font-size: 15px; color: #18181b; }
.um-page .md-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    background: #fff;
    color: #27272a;
    border: 1px solid #e4e4e7 !important;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.um-page .md-btn:hover { background: #f4f4f5; transform: none; box-shadow: none; }
.um-page .md-btn--sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.md-docs {
    margin-top: 12px;
    padding: 10px;
    background: #fafafa;
    border: 1px solid #f0f0f2;
    border-radius: 10px;
}
.md-docs > div:first-child { font-size: 12px; color: #71717a; font-weight: 600; margin-bottom: 8px; }
.md-docs .bg-white { border: 1px solid #f0f0f2; border-radius: 9px; }
.um-page .md-link-danger {
    margin-top: 10px;
    background: transparent;
    border: none !important;
    color: #a1a1aa;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
}
.um-page .md-link-danger:hover { color: #dc2626; transform: none; box-shadow: none; }
.um-page .md-save { width: 100%; }
/* Campaign form: the financial section is its own block, visibly locked until the campaign is closed */
.cf-fin {
    margin-top: 8px;
    background: #fff !important;
    border: 1px solid #e4e4e7 !important;
    border-top: 3px solid #18181b !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
}
.cf-fin__title { display: flex !important; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px !important; color: #18181b !important; }
.cf-fin__badge {
    margin-inline-start: auto;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11.5px;
    font-weight: 600;
}
.cf-fin.is-locked { background: #fafafa !important; border-top-color: #d4d4d8 !important; }
.cf-fin.is-locked .cf-fin__title { color: #52525b !important; }
.cf-fin__note { background: #fffbeb !important; border-color: #fde68a !important; color: #78350f !important; }
.cf-fin.is-locked input:disabled,
.cf-fin.is-locked textarea:disabled { background: #f4f4f5 !important; cursor: not-allowed; }
.cf-fin.is-locked .grid { opacity: 0.6; }

/* Uniform icon actions: edit / delete / download */
.md-actions { display: flex; gap: 6px; flex-shrink: 0; }
.um-page .md-icon {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
    background: #fff;
    color: #52525b;
    border: 1px solid #e4e4e7 !important;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.um-page .md-icon:hover { background: #f4f4f5; color: #18181b; border-color: #d4d4d8 !important; transform: none; box-shadow: none; }
.um-page .md-icon--danger { color: #a1a1aa; }
.um-page .md-icon--danger:hover { color: #dc2626; background: #fef2f2; border-color: #fecaca !important; }
/* Attached documents in the form: same look as in the history */
.md-grid > .md-panel:first-child .space-y-1 > div { border: 1px solid #f0f0f2 !important; border-radius: 9px !important; padding: 6px 8px !important; }
.md-grid > .md-panel:first-child .space-y-1 > div .flex.gap-1 { gap: 6px; }

/* --- Form popups (e.g. new / edit brand commitment) --- */
.fm-overlay { backdrop-filter: blur(2px); background: rgba(24,24,27,0.42) !important; }
.fm-card {
    border-radius: 18px !important;
    box-shadow: 0 30px 70px -20px rgba(0,0,0,0.35) !important;
    max-width: 720px !important;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    animation: cm-pop 0.18s cubic-bezier(0.34, 1.4, 0.64, 1);
    direction: rtl;
}
.fm-head {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px 16px;
    background: #fff;
    border-bottom: 1px solid #ececef;
}
.fm-title { margin: 0; font-size: 20px; font-weight: 700; color: #18181b; letter-spacing: -0.4px; }
.fm-sub { font-size: 12.5px; color: #71717a; margin-top: 3px; }
.fixed.inset-0 .fm-close {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: transparent;
    border: none !important;
    color: #a1a1aa;
    cursor: pointer;
    padding: 0 !important;
    flex-shrink: 0;
}
.fixed.inset-0 .fm-close:hover { background: #f4f4f5; color: #18181b; transform: none; box-shadow: none; }
.fm-body { padding: 20px 24px; }
.fm-body > .space-y-4 > * + * { margin-top: 16px !important; }
.fm-card label.block { font-size: 13px !important; font-weight: 600 !important; color: #3f3f46 !important; margin-bottom: 6px !important; }
.fm-card input[type="text"],
.fm-card input[type="number"],
.fm-card select,
.fm-card textarea {
    width: 100%;
    border: 1px solid #e4e4e7 !important;
    border-radius: 10px !important;
    background: #fff;
    font-size: 14px;
    color: #18181b;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.fm-card input[type="text"], .fm-card input[type="number"], .fm-card select { height: 42px; padding: 0 12px !important; }
.fm-card textarea { padding: 10px 12px !important; }
.fm-card input:focus, .fm-card select:focus, .fm-card textarea:focus { border-color: #18181b !important; box-shadow: 0 0 0 3px rgba(24,24,27,0.08) !important; outline: none; }
.fm-hint-chip {
    display: inline-flex;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f4f4f5;
    border: 1px solid #ececef;
    font-size: 12.5px;
    font-weight: 600;
    color: #3f3f46;
}
/* Payment status as a two-option toggle (still native radio buttons) */
.fm-radio-group { gap: 8px !important; }
.fm-radio-group > label {
    flex: 1;
    justify-content: center;
    height: 42px;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    background: #fff;
    position: relative;
    transition: border-color 0.15s, background 0.15s;
}
.fm-radio-group > label input { position: absolute; opacity: 0; pointer-events: none; }
.fm-radio-group > label span { color: #52525b !important; font-weight: 600 !important; font-size: 14px; }
.fm-radio-group > label:has(input:checked) { background: #18181b; border-color: #18181b; }
.fm-radio-group > label:has(input:checked) span { color: #fff !important; }
.fm-radio-group > label:hover:not(:has(input:checked)) { background: #f4f4f5; }
/* Documents */
.fm-upload { background: #fafafa !important; border: 1px dashed #e4e4e7 !important; border-radius: 12px !important; }
.fm-upload > label { color: #3f3f46 !important; }
.fm-upload > p { color: #a1a1aa !important; }
.fm-upload input[type="file"] { border: 1px solid #e4e4e7 !important; border-radius: 9px !important; padding: 8px !important; }
.fm-upload .bg-white { border: 1px solid #ececef !important; border-radius: 10px !important; padding: 8px 10px !important; }
.fixed.inset-0 .fm-icon-btn {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e4e4e7 !important;
    color: #3f3f46;
    cursor: pointer;
    padding: 0 !important;
}
.fixed.inset-0 .fm-icon-btn:hover { background: #f4f4f5; transform: none; box-shadow: none; }
.fixed.inset-0 .fm-icon-btn--danger { color: #dc2626; }
.fixed.inset-0 .fm-icon-btn--danger:hover { background: #fef2f2; border-color: #fecaca !important; }
/* Footer */
.fm-footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    gap: 10px;
    padding: 14px 24px 18px;
    background: #fff;
    border-top: 1px solid #ececef;
}
.fixed.inset-0 .fm-btn {
    flex: 1;
    height: 44px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0 16px !important;
}
.fixed.inset-0 .fm-btn--dark { background: #18181b; color: #fff; border: 1px solid #18181b !important; }
.fixed.inset-0 .fm-btn--dark:hover { background: #27272a; transform: none; }
.fixed.inset-0 .fm-btn--ghost { background: #fff; color: #3f3f46; border: 1px solid #e4e4e7 !important; }
.fixed.inset-0 .fm-btn--ghost:hover { background: #f4f4f5; transform: none; box-shadow: none; }
@media (max-width: 768px) {
    html body .fixed.inset-0 .fm-card { border-radius: 0 !important; }
    html body .fm-head { padding: 14px 16px !important; }
    html body .fm-head h2.fm-title { font-size: 18px !important; padding: 0 !important; }
    html body .fm-body { padding: 14px 16px !important; }
    html body .fm-footer { padding: 10px 16px !important; }
    html body .fm-radio-group > label { padding: 0 !important; }
}

/* --- Promo "view details" popup --- */
.pv-overlay { backdrop-filter: blur(2px); background: rgba(24,24,27,0.42) !important; }
.pv-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 30px 70px -20px rgba(0,0,0,0.35);
    width: 100%;
    max-width: 640px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: cm-pop 0.18s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.pv-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 22px 24px 18px;
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
    border-bottom: 1px solid #ececef;
}
.pv-head__main { min-width: 0; }
.pv-eyebrow { font-size: 11.5px; font-weight: 600; color: #a1a1aa; letter-spacing: 0.3px; margin-bottom: 4px; }
.pv-title { margin: 0 0 12px; font-size: 21px; font-weight: 700; color: #18181b; letter-spacing: -0.4px; line-height: 1.3; }
.pv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-chip {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e4e4e7;
    font-size: 12.5px;
    font-weight: 500;
    color: #3f3f46;
    white-space: nowrap;
}
.pv-chip--store { background: var(--chip-color); border-color: var(--chip-color); color: #fff; font-weight: 600; text-transform: capitalize; }
.fixed.inset-0 .pv-close {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: transparent;
    border: none !important;
    color: #a1a1aa;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0 !important;
}
.fixed.inset-0 .pv-close:hover { background: #f4f4f5; color: #18181b; transform: none; box-shadow: none; }
.pv-body { padding: 20px 24px; overflow-y: auto; }
.pv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pv-field { background: #fafafa; border: 1px solid #f0f0f2; border-radius: 12px; padding: 10px 14px; min-width: 0; }
.pv-field--wide { grid-column: 1 / -1; }
.pv-field__label { font-size: 11.5px; font-weight: 600; color: #a1a1aa; margin-bottom: 3px; }
.pv-field__value { font-size: 14px; color: #18181b; line-height: 1.5; word-break: break-word; }
.pv-notes { margin-top: 10px; background: #fffdf5; border: 1px solid #f5ecd0; border-radius: 12px; padding: 12px 14px; }
.pv-notes__text { font-size: 14px; color: #3f3f46; line-height: 1.6; white-space: pre-wrap; }
.pv-foot { display: flex; gap: 8px; padding: 14px 24px 18px; border-top: 1px solid #ececef; }
.fixed.inset-0 .pv-btn {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 42px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    padding: 0 16px !important;
}
.fixed.inset-0 .pv-btn--ghost { background: #fff; color: #27272a; border: 1px solid #e4e4e7 !important; }
.fixed.inset-0 .pv-btn--ghost:hover { background: #f4f4f5; }
.fixed.inset-0 .pv-btn--dark { background: #18181b; color: #fff; border: 1px solid #18181b !important; }
.fixed.inset-0 .pv-btn--dark:hover { background: #27272a; transform: none; }
@media (max-width: 768px) {
    html body .fixed.inset-0 .pv-card { border-radius: 0 !important; max-height: none !important; height: 100% !important; }
    html body .pv-grid { grid-template-columns: 1fr 1fr !important; }
    html body .pv-head { padding: 16px !important; }
    html body .pv-head h2.pv-title { font-size: 19px !important; padding: 0 !important; }
    html body .pv-body { padding: 14px 16px !important; flex: 1; }
    html body .pv-foot { padding: 12px 16px !important; }
}

/* --- Influencer reports popup: classic light header --- */
.fixed.inset-0 .irm-head { background: #fff !important; border-bottom: 1px solid #ececef !important; }
.fixed.inset-0 .irm-head h2 { color: #18181b !important; }
.fixed.inset-0 .irm-head p { color: #71717a !important; }
.fixed.inset-0 .irm-head select { background: #fff !important; color: #18181b !important; border-color: #e4e4e7 !important; }
.fixed.inset-0 .irm-head .irm-close { background: #fff !important; color: #71717a !important; border: 1px solid #e4e4e7 !important; }

/* --- Mobile --- */
@media (max-width: 768px) {
    html body .irm-head { flex-wrap: wrap; gap: 10px; padding: 14px !important; align-items: flex-start !important; }
    html body .irm-head__main { flex-wrap: wrap; flex: 1 1 calc(100% - 52px) !important; min-width: 0; gap: 8px !important; }
    html body .irm-head__main > div { flex: 1 1 100%; }
    html body .irm-head__main select { flex: 1 1 140px; min-width: 0; height: 40px; }
    html body .irm-head .irm-close { padding: 0 !important; width: 38px; height: 38px; justify-content: center; flex-shrink: 0; }
    html body .irm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    html body .um-avatar { display: inline-flex !important; padding: 0 !important; font-size: 13px !important; line-height: 1 !important; }
    html body .um-avatar--lg { font-size: 15px !important; }

    /* All popups on phones: form grids stack to one column, fields can shrink to the screen */
    html body .fixed.inset-0 .grid.grid-cols-2:not(.text-xs):not(.irm-grid),
    html body .fixed.inset-0 .grid.grid-cols-3:not(.text-xs):not(:has(> div > input[type="checkbox"])):not(:has(> label > input[type="checkbox"])) { grid-template-columns: 1fr !important; }
    html body .fixed.inset-0 input,
    html body .fixed.inset-0 select,
    html body .fixed.inset-0 textarea { min-width: 0 !important; max-width: 100%; }
    html body .fixed.inset-0 .flex > input.flex-1 { flex: 1 1 0; width: 0; }
    html body .fixed.inset-0 > div { overflow-x: hidden; }

    /* Two-column popups stack on phones (e.g. influencer monthly data: form, then history) */
    html body .m-stack-2 { grid-template-columns: 1fr !important; gap: 20px !important; }
    html body .m-stack-2 > * { min-width: 0; }
    html body .m-stack-2 input, html body .m-stack-2 select, html body .m-stack-2 textarea { max-width: 100%; }
    /* Round × close buttons keep their size (old stylesheet shrinks all button text) */
    html body .fixed.inset-0 .m-close {
        position: fixed !important;
        top: 14px !important;
        left: 14px !important;
        margin-top: 0 !important;
        transform: none !important;
        right: auto !important;
        z-index: 30 !important;
        padding: 0 !important;
        font-size: 28px !important;
        width: 40px; height: 40px;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: #71717a !important;
    }

    /* Monthly data on phones */
    html body .md-panel { padding: 14px; }
    html body .um-page .md-btn { padding: 0 12px !important; font-size: 13px !important; }
    html body .um-page .md-link-danger { padding: 4px 0 !important; }
    html body .um-page .md-icon { padding: 0 !important; width: 34px; height: 34px; }
    html body .md-tiles { grid-template-columns: 1fr 1fr !important; }

    /* Store management on phones: actions under the store, equal halves */
    html body .sm-row__inner { flex-direction: column; align-items: stretch; }
    html body .sm-actions { width: 100%; }
    html body .um-page .sm-btn { flex: 1; width: auto; padding: 0 !important; height: 40px; font-size: 14px !important; }
    .um-header { padding: 12px 14px; flex-wrap: wrap; }
    .um-body { padding: 12px 12px 18px; }
    .pm-grid, .pm-stores { grid-template-columns: 1fr; }
    .pm-footer { padding: 10px 12px; }
    .um-page .um-btn--lg { flex: 1; padding: 0 14px !important; }

    /* each user becomes a card */
    .fixed.inset-0 .um-modal table.um-table,
    .fixed.inset-0 .um-modal .um-table tbody { display: block !important; white-space: normal !important; overflow: visible !important; min-width: 0 !important; width: 100% !important; border: none; background: transparent; box-shadow: none; }
    .fixed.inset-0 .um-modal .um-table thead { display: none !important; }
    .fixed.inset-0 .um-modal .um-table tr.um-row {
        display: block !important;
        width: 100% !important;
        border: 1px solid #ececef;
        border-radius: 12px;
        padding: 6px 4px;
        margin-bottom: 10px;
        background: #fff;
    }
    .fixed.inset-0 .um-modal .um-table td {
        display: flex !important;
        align-items: flex-start;
        gap: 10px;
        padding: 6px 10px !important;
        border: none !important;
        white-space: normal !important;
        text-align: right !important;
    }
    .fixed.inset-0 .um-modal .um-table td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 64px;
        font-size: 11px;
        color: #a1a1aa;
        padding-top: 2px;
    }
    .fixed.inset-0 .um-modal .um-table td.um-cell-actions { justify-content: flex-start; border-top: 1px solid #f4f4f5 !important; margin-top: 4px; padding-top: 8px !important; }
    .um-modal .um-cell-actions > div { justify-content: flex-start !important; }
}
