/* O-43 — Membership renewals. TWO COLOURS ONLY: blue for a renewal, green once
   paid. There is deliberately no red/late style in this file. */

.mr-summary{display:flex;flex-wrap:wrap;gap:16px;margin:0 0 10px;font-size:12px;color:var(--muted,#64748b)}
.mr-summary b{color:#22303f;font-size:14px;margin-right:4px}
.mr-flag{color:#b45309}
.mr-error{border:1px solid #eccaca;background:#fdf5f5;color:#7c2d2d;border-radius:8px;padding:8px 12px;font-size:12px;margin-bottom:10px}

.mr-table{border:1px solid #d9dee7;border-radius:12px;background:#fff;overflow:hidden}
.mr-head,.mr-row{display:grid;grid-template-columns:96px 1.2fr 90px 92px 120px 1.4fr 76px;gap:10px;align-items:center;padding:8px 12px;min-width:0}
.mr-head{background:#f5f6f8;color:#7b8699;font-size:8.5px;font-weight:850;letter-spacing:.055em;text-transform:uppercase}
.mr-row{border-top:1px solid #e4e8ef;font-size:12px;color:#344054}
.mr-row:nth-child(odd){background:#fafbfc}
.mr-row:hover{background:#f5f8fc}
.mr-row>*{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mr-row strong{display:block;font-size:12.5px}
.mr-row small{display:block;font-size:9.5px;color:#94a3b8}
.mr-src{color:#94a3b8;font-size:11px}
.mr-end{display:flex;justify-content:flex-end}
.mr-empty{padding:30px;text-align:center;color:#94a3b8;font-size:12.5px}

.mr-status{font-weight:800;font-size:11px;letter-spacing:.3px}
.mr-upcoming{color:#2563eb}     /* the same blue as an appointment */
.mr-due{color:#2563eb}
.mr-paid{color:#188045}         /* green once paid — the whole vocabulary */

/* The calendar face: blue like any appointment, green when paid. */
.mr-cal-renewal{outline:1px solid rgba(37,99,235,.35)}
.mr-cal-paid{background:#e8f6ee !important;color:#188045 !important;outline-color:rgba(24,128,69,.4)}

/* Popover */
.mr-backdrop{position:fixed;inset:0;background:rgba(24,33,47,.42);display:flex;align-items:center;justify-content:center;z-index:1300;padding:20px}
.mr-pop{width:min(560px,100%);background:#fff;border-radius:12px;box-shadow:0 18px 50px rgba(30,42,58,.2);display:flex;flex-direction:column;max-height:calc(100vh - 40px)}
.mr-pop-head{display:flex;justify-content:space-between;align-items:flex-start;padding:14px 18px;border-bottom:1px solid #e5eaf0}
.mr-pop-head h3{margin:0;font-size:16px}
.mr-pop-head p{margin:2px 0 0;font-size:12px;color:#64748b}
.mr-pop-body{padding:14px 18px;overflow-y:auto;overflow-x:hidden;font-size:13px}
/* #291 correction (David, 2026-08-28): one row, no redundant Close (the X top-right already
   closes it) — Mark Scheduled / Mark Paid left-grouped, Close Out pushed right by its own
   margin-left:auto rather than a second flex container. */
.mr-pop-foot{display:flex;align-items:center;padding:12px 18px;border-top:1px solid #e5eaf0}
.mr-quiet{border:1px solid #d9dee7;background:#fff;color:#475369;font-weight:600;font-size:12.5px;padding:8px 13px;border-radius:8px;margin-left:8px;cursor:pointer}
.mr-primary{background:#2563eb;color:#fff;border:none;font-weight:700;font-size:13px;padding:9px 18px;border-radius:8px;margin-left:8px;cursor:pointer}
.mr-paid-note{border-left:3px solid #188045;background:#f2fbf6;padding:8px 12px;border-radius:6px;color:#166534;margin-bottom:10px}

/* STEP 4 (2026-08-24) — Close Out / permanent final closure. Deliberately
   NOT part of the blue/green renewal vocabulary above (it isn't a renewal
   status) and deliberately not red either (this file's own stated
   restraint) — a distinct neutral slate, same family as the existing
   .mr-flag amber used for other administrative markers. */
.mr-closedout{color:#475369}
.mr-closedout-note{border-left:3px solid #94a3b8;background:#f4f6f8;padding:8px 12px;border-radius:6px;color:#475369;margin-bottom:10px}
.mr-flag-closedout{color:#475369;font-weight:700}
/* #291 correction (David, 2026-08-28): "quiet, right-aligned, red text only" — same .mr-quiet
   shell (white fill, gray border), only the text goes red; replaces the old orange-outline
   .mr-danger, now unused anywhere and removed. */
.mr-quiet-danger{color:#b91c1c;margin-left:auto;cursor:default}
.mr-quiet-danger:hover{background:#fef2f2;border-color:#fecaca}

/* NEW FEATURE (2026-08-24) — editable bar title + global closed-out color. */
/* #261 (2026-08-27) fix — min-width:0 on the flex/grid children below: a raw
   flex/grid item defaults to min-width:auto (content-based), which is exactly
   what caused the modal's horizontal scrollbar (a long title/filename could not
   shrink) and the clipped Check-copy box (a raw file input has its own wide
   intrinsic minimum). Both scroll bugs were structural, not cosmetic. */
.mr-titlerow{display:flex;gap:8px;align-items:center}
/* #414 — ONE SAVE MODEL: the quiet "Saved · h:mm" beside each field group (law 4.27: minimal, vanishing); an error stays, red */
.mr-saved{font-size:12px;color:#5b6472;margin-left:8px;white-space:nowrap;flex:0 0 auto;min-width:0}
.mr-saved:empty{display:none}
.mr-saved.is-saving{color:#94a3b8}
.mr-saved.is-ok{color:#15803d}
.mr-saved.is-bad{color:#b91c1c;white-space:normal;font-weight:600}
.mr-saved-row{display:flex;justify-content:flex-end;min-height:0;margin-top:2px}
.mr-saved-row .mr-saved{margin-left:0}
.mr-titlerow input{flex:1;min-width:0}
/* #291 (David, 2026-08-28) — the read-only amount sits before the QuickBooks link input in the
   same row (order rule 1: "next to Amount Due"); flex:0 so it never competes for the input's
   shrink space (the same min-width:0 scroll-bug fix above stays intact). */
.mr-qbamount{flex:0 0 auto;font-weight:700;color:#344054;white-space:nowrap}
.mr-qblink-error{color:#b91c1c;font-size:11.5px;margin-top:4px}
.mr-preview-qbline{color:#64748b;font-size:12px;margin-bottom:10px}
.mr-titlesave{margin-left:0;flex:0 0 auto;padding:8px 12px}
.mr-colorfield{border:1px solid #e5eaf0;border-radius:8px;padding:10px 12px;margin-bottom:16px;background:#fafbfc}
.mr-colorrow{display:flex;align-items:center;gap:10px}
.mr-colorrow input[type=color]{width:44px;height:32px;border:1px solid #d9dee7;border-radius:6px;padding:2px;cursor:default;background:#fff}
.mr-colorrow span{font-family:monospace;font-size:12px;color:#475369;text-transform:uppercase}
.mr-uploads{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:8px;min-width:0}
.mr-upload{border:1px dashed #cbd5e1;border-radius:8px;padding:8px 10px;font-size:12px;display:block;min-width:0}
.mr-upload span{display:block;font-weight:700;margin-bottom:4px}
.mr-upload small{display:block;color:#94a3b8;font-size:10.5px;margin-top:4px}
.mr-upload a{word-break:break-word}
/* #261 — the polished drop-zone (Reuse Law: same visual language as Quick Fax's
   #quickFaxDrop, app.js/styles.css). The <input> is visually hidden — its own
   <label> wrapper already opens the native picker on click. */
.mr-dropzone{cursor:default;border-style:dashed;transition:border-color .15s,background-color .15s}
.mr-dropzone input[type=file]{display:none}
.mr-dropzone.dragging{border-color:#2563eb;background:#f2f7ff}
.mr-dropzone.busy{opacity:.6}

/* #261 (David, final scope 2026-08-27) — the renewal reminder email. */
.mr-reminder{border:1px solid #e5eaf0;border-radius:8px;padding:10px 12px;background:#fafbfc}
.mr-reminder textarea{width:100%;min-height:64px;resize:vertical;border:1px solid #d9dee7;border-radius:8px;padding:8px 10px;font:inherit;font-size:12.5px}
.mr-reminder-actions{display:flex;gap:8px;margin-top:8px}
.mr-reminder-actions button{margin-left:0}
.mr-reminder-sent{display:flex;align-items:center;gap:7px;color:#166534;font-size:12.5px;padding:4px 0}
.mr-reminder-history{margin-top:10px;border-top:1px solid #e5eaf0;padding-top:8px}
.mr-reminder-history-label{display:block;font-size:10px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:#94a3b8;margin-bottom:5px}
.mr-reminder-history-row{display:flex;align-items:center;gap:7px;font-size:12px;color:#344054;padding:2px 0}
.mr-reminder-history-row a{margin-left:auto;color:#2563eb;font-size:11.5px;white-space:nowrap}
.mr-envelope-icon,.mr-reminder-sent svg{color:#15803d;flex:0 0 auto}

/* #286 (David, 2026-08-28) — auto-attach payment docs. Cards reuse .p3-results-card
   verbatim (assistant-calendar.css); this is only the label/empty-state/action-row chrome
   around them, matching .mr-reminder's own field styling immediately above. */
.mr-paydocs-empty{color:#94a3b8;font-size:12px;margin:2px 0}
.mr-paydocs-actions{display:flex;gap:8px;margin-top:8px}
.mr-paydocs-actions button{margin-left:0;cursor:default} /* law 5.21 — .mr-quiet's shared cursor:pointer predates the ban; new buttons don't inherit it */

/* The preview-before-send modal — read-only render, no editing (David's spec). */
.mr-preview-pop{width:min(640px,100%)}
.mr-preview-render{border:1px solid #e5eaf0;border-radius:8px;overflow:hidden}
.mr-preview-loading{padding:24px;text-align:center;color:#94a3b8;font-size:12.5px}

/* The dashboard flasher */
#p3RenewalToken{position:fixed;right:18px;left:auto;bottom:84px;z-index:1250}
.mr-token{position:relative;display:flex;align-items:center;gap:10px;background:#fff;border:1px solid #d9dee7;border-left:4px solid #2563eb;border-radius:10px;box-shadow:0 10px 26px rgba(30,42,58,.16);padding:9px 34px 9px 12px;font-size:12.5px;max-width:520px}
.mr-token button{border:1px solid #d9dee7;background:#fff;border-radius:7px;padding:5px 9px;font-size:11px;font-weight:700;color:#33465c;cursor:default}
.mr-token-dot{width:9px;height:9px;border-radius:50%;background:#2563eb;flex-shrink:0;opacity:.35;transition:opacity .4s}
.mr-token.on .mr-token-dot{opacity:1;box-shadow:0 0 0 4px rgba(37,99,235,.18)}
.mr-token-collapse{position:absolute;top:6px;right:8px;border:none!important;background:none!important;padding:0!important;width:18px;height:18px;line-height:18px;font-size:15px;color:#94a3b8;cursor:default}
.mr-token-collapse:hover{color:#475369}
/* David's ruling 2026-08-26: collapsed by default — a footprint no bigger than a
   single button so it can no longer sit on top of a real action button underneath
   it (records queue Refax, bulk-review Confirm, the PVT editor Save all got blocked
   by the full card). Click expands it in place; the card's own × re-collapses it. */
.mr-token-badge{display:flex;align-items:center;justify-content:center;gap:2px;width:34px;height:34px;border-radius:50%;background:#fff;border:1px solid #d9dee7;box-shadow:0 6px 16px rgba(30,42,58,.16);cursor:default;padding:0}
.mr-token-badge:hover{border-color:#2563eb}
.mr-token-badge .mr-token-dot{width:10px;height:10px}
.mr-token-badge.on .mr-token-dot{opacity:1;box-shadow:0 0 0 4px rgba(37,99,235,.18)}
.mr-token-count{font-size:9.5px;font-weight:800;color:#2563eb}

/* #312 — Amount Due is typed here (it never had a field) */
.mr-amount-input{width:120px;flex:0 0 120px}
.mr-titlerow input#mrQbLink{flex:1 1 auto;min-width:0}

/* #312 — the Amount Due box must be usable width; the title-row rule above outranks the class rule */
.mr-titlerow input.mr-amount-input{flex:0 0 130px;width:130px}

/* #312 — law 4.10: Polish / Preview stay reachable while the popover body scrolls on a short screen */
.mr-reminder-actions{position:sticky;bottom:-14px;background:#fff;padding:8px 0;z-index:1}
/* #335 — the "Polish didn't work, your text is unchanged" state: loud, stays until the next action (law 4.27) */
.mr-polish-note{margin-top:8px;padding:8px 12px;border:1px solid #f0c8a8;background:#fff4ec;border-radius:9px;color:#8a3d0c;font-size:13px;font-weight:600}
/* #343 — Add Membership: the same .mr-pop dialog family as the renewal popover; two roads, one form */
.mr-head-actions{display:flex;gap:8px;align-items:center}
.mr-add{width:min(560px,94vw)}
.mr-add .mr-add-grid{display:grid;grid-template-columns:1.1fr 1fr 1fr;gap:10px}
.mr-add .field{margin-bottom:10px}
.mr-add .field label{display:block;font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:#6b7890;margin-bottom:4px}
.mr-add input[type=date],.mr-add input[type=number],.mr-add select,.mr-add textarea{width:100%;box-sizing:border-box;border:1px solid #d6dde7;border-radius:8px;padding:8px 10px;font:inherit;background:#fff;color:#10213d}
.mr-add .mr-pop-foot{display:flex;justify-content:flex-end;gap:8px}
@media(max-width:720px){.mr-add .mr-add-grid{grid-template-columns:1fr}}

/* #347 — rows created from Google evidence, awaiting David's date + amount */
.mr-status.mr-needs{color:#b45309}
.mr-confirm-block{border:1px solid #f5d0a0;background:#fff7ed;border-radius:10px;padding:12px 14px;margin:0 0 14px}
.mr-link-block{border:1px solid #f5c2c2;background:#fff5f5;border-radius:10px;padding:12px 14px;margin:0 0 14px}   /* #399: an unlinked renewal — the address comes from the chart */
.mr-link-block p{margin:0 0 10px;font-size:13px;line-height:1.45;color:#7f1d1d}
.mr-confirm-block p{margin:0 0 10px;color:#7c2d12;font-size:13px;line-height:1.45}
.mr-confirm-actions{display:flex;align-items:center;gap:12px;margin-top:4px}
.mr-confirm-error{color:#b91c1c;font-size:12.5px}
