/* Ready Set Boom CRM */
.rsbcrm-wrap.container { width: auto; max-width: 1680px; padding-left: 12px; padding-right: 12px; }

.rsbcrm, .rsbcrm-login {
  --rc-ink: #22252a;
  --rc-ink-2: #555b65;
  --rc-ink-3: #8a9099;
  --rc-line: #e3e5e9;
  --rc-rail: #f3f4f6;
  --rc-pane: #ffffff;
  --rc-hover: #f7f8fa;
  --rc-select: #fff4e5;
  --rc-accent: #f7931e;
  --rc-accent-ink: #9a5200;
  --rc-link: #2f6fdb;
  --rc-warn: #b3261e;
  color: var(--rc-ink);
  font-size: 14px;
  line-height: 1.45;
}
.rsbcrm *, .rsbcrm-login * { box-sizing: border-box; }
.rsbcrm button, .rsbcrm input, .rsbcrm select, .rsbcrm textarea { font: inherit; color: inherit; }
.rsbcrm :focus-visible { outline: 2px solid var(--rc-accent); outline-offset: 1px; }

/* ---------- Login ---------- */
.rsbcrm-login { max-width: 360px; margin: 60px auto; padding: 32px; background: #fff; border: 1px solid var(--rc-line); border-radius: 10px; }
.rsbcrm-login h1 { font-size: 22px; margin: 0 0 2px; font-weight: 700; }
.rsbcrm-login p { margin: 0 0 22px; color: var(--rc-ink-2); }
.rsbcrm-login label { display: block; font-weight: 600; margin-bottom: 6px; }
.rsbcrm-login input { width: 100%; padding: 10px 12px; border: 1px solid #cfd3d9; border-radius: 6px; margin-bottom: 14px; }
.rsbcrm-login button { width: 100%; padding: 10px; border: 0; border-radius: 6px; background: var(--rc-accent); color: #fff; font-weight: 700; cursor: pointer; }
.rsbcrm-login-error { margin-top: 14px; color: var(--rc-warn); }

/* ---------- Shell ---------- */
.rsbcrm { border: 1px solid var(--rc-line); border-radius: 10px; background: var(--rc-pane); overflow: hidden; margin: 16px 0; }
.rc-top { display: flex; align-items: center; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--rc-line); flex-wrap: wrap; }
.rc-brand { font-weight: 800; font-size: 16px; white-space: nowrap; }
.rc-sites { display: flex; gap: 2px; background: var(--rc-rail); padding: 3px; border-radius: 8px; }
.rc-sites button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; cursor: pointer; color: var(--rc-ink-2); white-space: nowrap; }
.rc-sites button[aria-pressed="true"] { background: #fff; color: var(--rc-ink); font-weight: 700; box-shadow: 0 0 0 1px var(--rc-line); }
.rc-search { flex: 1 1 220px; }
.rc-search input { width: 100%; padding: 7px 10px; border: 1px solid var(--rc-line); border-radius: 6px; background: var(--rc-rail); }
.rc-search input:focus { background: #fff; }
.rc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.rc-btn { display: inline-block; border: 1px solid var(--rc-line); background: #fff; padding: 6px 12px; border-radius: 6px; cursor: pointer; text-decoration: none; color: var(--rc-ink); white-space: nowrap; }
.rc-btn:hover { background: var(--rc-hover); text-decoration: none; color: var(--rc-ink); }
.rc-btn-primary { background: var(--rc-accent); border-color: var(--rc-accent); color: #fff; font-weight: 700; }
.rc-btn-primary:hover { background: #e7840f; color: #fff; }
.rc-btn-quiet { border-color: transparent; color: var(--rc-ink-2); }
.rc-btn[disabled] { opacity: .55; cursor: default; }
.rc-btn-danger { color: var(--rc-warn); }

.rc-body { display: grid; grid-template-columns: 210px minmax(300px, 400px) 1fr; grid-template-rows: minmax(0, 1fr); height: calc(100vh - 170px); min-height: 560px; }
/* Grid children must be allowed to shrink, or they grow to fit every row and nothing scrolls. */
.rc-body > * { min-height: 0; }

/* ---------- Rail ---------- */
.rc-rail { background: var(--rc-rail); border-right: 1px solid var(--rc-line); overflow-y: auto; padding: 10px 8px; }
.rc-rail h3 { font-size: 12px; font-weight: 700; color: var(--rc-ink-3); margin: 14px 8px 4px; }
.rc-folder { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: var(--rc-ink-2); }
.rc-folder:hover { background: #e9ebef; }
.rc-folder[aria-current="true"] { background: #fff; color: var(--rc-ink); font-weight: 700; box-shadow: 0 0 0 1px var(--rc-line); }
.rc-folder .rc-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.rc-unread-pill { margin-left: auto; background: var(--rc-accent); color: #fff; font-size: 11px; font-weight: 700; border-radius: 9px; padding: 0 6px; line-height: 17px; }
.rc-unread-pill + .rc-count { margin-left: 6px; }
.rc-folder .rc-count { margin-left: auto; font-size: 12px; color: var(--rc-ink-3); font-weight: 400; }
.rc-folder .rc-count.rc-has-unread { color: var(--rc-accent-ink); font-weight: 700; }

/* ---------- List ---------- */
.rc-listpane { display: flex; flex-direction: column; border-right: 1px solid var(--rc-line); min-width: 0; overflow: hidden; }
.rc-listbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--rc-line); font-weight: 700; }
.rc-sort { font-weight: 400; color: var(--rc-ink-3); font-size: 12px; margin: 0; }
.rc-sort select { border: 0; background: transparent; color: var(--rc-ink); font-size: 12px; }
.rc-list { overflow-y: auto; flex: 1 1 auto; min-height: 0; outline: none; -webkit-overflow-scrolling: touch; }
.rc-row { display: grid; grid-template-columns: 50px 1fr; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--rc-line); cursor: pointer; position: relative; }
.rc-row:hover { background: var(--rc-hover); }
.rc-row[aria-selected="true"] { background: var(--rc-select); }
.rc-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--rc-status, transparent); }

/* Ticket-stub date: the event date is what this business runs on */
.rc-stub { border: 1px solid var(--rc-line); border-radius: 6px; text-align: center; background: #fff; height: 52px; display: flex; flex-direction: column; justify-content: center; }
.rc-stub b { display: block; font-size: 19px; line-height: 1; font-weight: 800; }
.rc-stub span { display: block; font-size: 10px; color: var(--rc-ink-2); margin-top: 2px; }
.rc-stub.rc-stub-none b { font-size: 11px; color: var(--rc-ink-3); }
.rc-stub.rc-stub-past { opacity: .5; }

.rc-row-main { min-width: 0; }
.rc-row-top { display: flex; gap: 8px; align-items: baseline; }
.rc-row-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-row.rc-unread .rc-row-name { font-weight: 800; }
.rc-row.rc-unread .rc-row-name::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--rc-accent); margin-right: 6px; vertical-align: 2px; }
.rc-row-when { margin-left: auto; font-size: 12px; color: var(--rc-ink-3); white-space: nowrap; }
.rc-row-sub { font-size: 13px; color: var(--rc-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-row-snip { font-size: 12px; color: var(--rc-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-tags { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.rc-tag { font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--rc-rail); color: var(--rc-ink-2); }
.rc-tag-warn { background: #fdecea; color: var(--rc-warn); }
.rc-list-empty { padding: 40px 20px; text-align: center; color: var(--rc-ink-3); }

/* ---------- Detail ---------- */
.rc-detail { overflow-y: auto; min-width: 0; }
.rc-empty { padding: 60px 30px; text-align: center; color: var(--rc-ink-3); }
.rc-hint { font-size: 12px; }
.rc-back { display: none; }
.rc-d-head { display: flex; gap: 20px; padding: 18px 22px; border-bottom: 1px solid var(--rc-line); align-items: flex-start; flex-wrap: wrap; }
.rc-d-who { flex: 1 1 260px; min-width: 0; }
.rc-d-who h2 { margin: 0 0 4px; font-size: 22px; font-weight: 800; line-height: 1.2; word-break: break-word; }
.rc-d-contact { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.rc-d-contact a { color: var(--rc-link); }
.rc-d-meta { font-size: 12px; color: var(--rc-ink-3); margin-top: 6px; }
.rc-countdown { text-align: right; min-width: 130px; }
.rc-countdown .rc-big { font-size: 44px; font-weight: 800; line-height: .95; letter-spacing: -1px; color: var(--rc-accent-ink); }
.rc-countdown .rc-big.rc-past { color: var(--rc-ink-3); }
.rc-countdown .rc-small { font-size: 12px; color: var(--rc-ink-2); }
.rc-countdown .rc-date { font-weight: 700; font-size: 13px; margin-top: 4px; }

.rc-d-bar { display: flex; gap: 8px; align-items: center; padding: 10px 22px; border-bottom: 1px solid var(--rc-line); flex-wrap: wrap; background: #fcfcfd; }
.rc-status-select { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--rc-line); border-left: 5px solid var(--rc-status, #ccc); font-weight: 700; background: #fff; }
.rc-d-bar .rc-spacer { flex: 1; }

.rc-d-section { padding: 16px 22px; border-bottom: 1px solid var(--rc-line); }
.rc-d-section h3 { font-size: 13px; font-weight: 700; margin: 0 0 10px; color: var(--rc-ink-2); }
.rc-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 20px; margin: 0; }
.rc-facts div { min-width: 0; }
.rc-facts dt { font-size: 12px; color: var(--rc-ink-3); font-weight: 400; }
.rc-facts dd { margin: 0; word-break: break-word; }
.rc-facts dd.rc-blank { color: var(--rc-ink-3); }
.rc-message { white-space: pre-wrap; word-break: break-word; max-width: 72ch; margin: 0; }
.rc-warnbox { background: #fdecea; color: var(--rc-warn); padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 13px; }
.rc-infobox { background: var(--rc-rail); padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 13px; color: var(--rc-ink-2); }
.rc-related a { color: var(--rc-link); cursor: pointer; }
.rc-related li { margin-bottom: 3px; }

.rc-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 16px; }
.rc-field label { display: block; font-size: 12px; color: var(--rc-ink-2); margin-bottom: 3px; }
.rc-field input, .rc-field select, .rc-field textarea, .rc-note-box textarea { width: 100%; padding: 7px 9px; border: 1px solid #cfd3d9; border-radius: 6px; background: #fff; }
/* Tick boxes must not be stretched by the rule above. */
.rc-field input[type="checkbox"], .rc-field input[type="radio"] { width: auto; margin: 0 7px 0 0; padding: 0; vertical-align: -1px; }
.rc-field label:has(input[type="checkbox"]) { display: flex; align-items: flex-start; gap: 0; margin-bottom: 6px; color: var(--rc-ink); font-size: 13px; }
.rc-field-wide { grid-column: 1 / -1; }
.rc-form-actions { margin-top: 12px; display: flex; gap: 8px; }

.rc-note-box textarea { min-height: 70px; resize: vertical; }
.rc-note-box .rc-form-actions { justify-content: flex-end; }
.rc-timeline { list-style: none; margin: 14px 0 0; padding: 0; }
.rc-timeline li { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--rc-line); margin-left: 5px; }
.rc-timeline li::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--rc-ink-3); }
.rc-timeline li.rc-t-note::before { border-color: var(--rc-accent); background: var(--rc-accent); }
.rc-timeline li.rc-t-status::before { border-color: var(--rc-link); }
.rc-t-when { font-size: 12px; color: var(--rc-ink-3); }
.rc-t-text { white-space: pre-wrap; word-break: break-word; }
.rc-t-note .rc-t-text { background: #fff8ee; border: 1px solid #f6dfbd; padding: 8px 10px; border-radius: 6px; margin-top: 3px; max-width: 72ch; }

/* ---------- Toast + dialog ---------- */
.rc-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--rc-ink); color: #fff; padding: 9px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10001; max-width: 90vw; }
.rc-toast.rc-show { opacity: 1; }
.rc-toast.rc-error { background: var(--rc-warn); }

.rc-overlay { position: fixed; inset: 0; top: 0; left: 0; right: 0; bottom: 0; background: rgba(20, 22, 26, .45); z-index: 10000; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px; overflow-y: auto; }
.rc-overlay[hidden] { display: none; }
.rc-dialog { background: #fff; border-radius: 10px; width: 100%; max-width: 640px; }
.rc-dialog-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--rc-line); }
.rc-dialog-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.rc-close { margin-left: auto; border: 0; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: var(--rc-ink-2); }
.rc-dialog-body { padding: 18px; }
.rc-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rc-line); margin: -4px 0 14px; }
.rc-tabs button { border: 0; background: transparent; padding: 8px 12px; cursor: pointer; color: var(--rc-ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.rc-tabs button[aria-selected="true"] { color: var(--rc-ink); font-weight: 700; border-bottom-color: var(--rc-accent); }
.rc-status-edit { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--rc-line); }
.rc-status-edit input[type="color"] { width: 30px; height: 30px; padding: 0; border: 1px solid var(--rc-line); border-radius: 6px; background: none; }
.rc-status-edit input[type="text"] { padding: 6px 8px; border: 1px solid #cfd3d9; border-radius: 6px; width: 100%; }
.rc-status-edit label { font-size: 12px; white-space: nowrap; margin: 0; font-weight: 400; }
.rc-status-edit .rc-mini { border: 1px solid var(--rc-line); background: #fff; border-radius: 4px; padding: 2px 7px; cursor: pointer; }
.rc-kv { width: 100%; border-collapse: collapse; font-size: 13px; }
.rc-kv th, .rc-kv td { text-align: left; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--rc-line); vertical-align: top; }
.rc-kv th { color: var(--rc-ink-2); font-weight: 600; width: 38%; }
.rc-ok { color: #12683a; font-weight: 700; }
.rc-bad { color: var(--rc-warn); font-weight: 700; }
.rc-code { font-family: Menlo, Consolas, monospace; font-size: 12px; background: var(--rc-rail); padding: 6px 8px; border-radius: 6px; word-break: break-all; display: block; margin-top: 4px; }

/* ---------- Resources + shared links ---------- */
.rc-links { list-style: none; margin: 0; padding: 0; }
.rc-links li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--rc-line); flex-wrap: wrap; }
.rc-links li:last-child { border-bottom: 0; }
.rc-links .rc-l-title { font-weight: 600; }
.rc-links .rc-l-meta { font-size: 12px; color: var(--rc-ink-3); }
.rc-links .rc-l-seen { font-size: 12px; color: #12683a; font-weight: 600; }
.rc-links .rc-l-actions { margin-left: auto; display: flex; gap: 6px; }
.rc-typebadge { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--rc-rail); color: var(--rc-ink-2); white-space: nowrap; }
.rc-typebadge.rc-type-form { background: #eef3fd; color: #1f4fa8; }
.rc-typebadge.rc-type-link { background: #f1ecfb; color: #5b36a8; }
.rc-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.rc-section-head h3 { margin: 0 auto 0 0; }
.rc-section-head .rc-btn { padding: 3px 10px; font-size: 13px; }
.rc-copyrow { display: flex; gap: 6px; margin-top: 10px; }
.rc-copyrow input { flex: 1; padding: 7px 9px; border: 1px solid #cfd3d9; border-radius: 6px; background: var(--rc-rail); font-size: 13px; }
.rc-form-resp { border: 1px solid var(--rc-line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.rc-form-resp h4 { margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.rc-reslist { max-height: 55vh; overflow-y: auto; margin-bottom: 12px; }
.rc-resrow { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--rc-line); }
.rc-resrow.rc-retired { opacity: .55; }
.rc-resrow .rc-r-main { flex: 1; min-width: 0; }
.rc-resrow .rc-r-title { font-weight: 700; }
.rc-resrow .rc-r-meta { font-size: 12px; color: var(--rc-ink-3); }
.rc-resrow .rc-r-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rc-resrow .rc-suggest { font-size: 11px; color: var(--rc-accent-ink); font-weight: 700; }
.rc-versions { font-size: 12px; margin: 8px 0 0; padding-left: 18px; }
.rc-versions a { color: var(--rc-link); }
.rc-dialog-wide { max-width: 760px; }

/* ---------- Conversation ---------- */
.rc-tag-await { background: #fff1dc; color: var(--rc-accent-ink); font-weight: 700; }
.rc-tag-ok { background: #e6f4ea; color: #12683a; }
.rc-cal-link { color: #12683a; font-weight: 600; margin-left: 6px; }
.rc-thread { display: flex; flex-direction: column; gap: 10px; }
.rc-mail { border: 1px solid var(--rc-line); border-radius: 8px; padding: 10px 12px; max-width: 78ch; }
.rc-mail-in { background: #fff; align-self: flex-start; }
.rc-mail-out { background: #f4f7fd; border-color: #dce5f5; align-self: flex-end; }
.rc-mail-head { display: flex; gap: 10px; align-items: baseline; }
.rc-mail-head .rc-t-when { margin-left: auto; white-space: nowrap; }
.rc-mail-subj { font-size: 12px; color: var(--rc-ink-2); margin-top: 1px; }
.rc-mail-body { white-space: pre-wrap; word-break: break-word; margin-top: 6px; }
.rc-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rc-att { font-size: 12px; border: 1px solid var(--rc-line); border-radius: 4px; padding: 2px 8px; color: var(--rc-link); background: #fff; }
.rc-att-missing { color: var(--rc-ink-3); }
.rc-mail-actions { display: flex; gap: 14px; margin-top: 6px; }
.rsbcrm .rc-linkbtn { border: 0; background: none; padding: 0; color: var(--rc-link); font-size: 12px; cursor: pointer; text-decoration: none; }
.rsbcrm .rc-linkbtn:hover { text-decoration: underline; }
.rsbcrm .rc-linkbtn[disabled] { color: var(--rc-ink-3); }
.rc-earlier { margin-bottom: 8px; font-size: 13px; }
.rc-from { padding: 6px 0; font-weight: 600; }
.rc-howto { margin-top: 10px; font-size: 13px; }
.rc-howto summary { cursor: pointer; color: var(--rc-link); }
.rc-howto ol { margin: 8px 0 0; padding-left: 20px; }
.rc-tpl { border: 1px solid var(--rc-line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.rc-tabs { flex-wrap: wrap; }

/* ---------- Quote and invoices ---------- */
.rc-qt { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
.rc-qt th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--rc-ink-3); padding: 0 8px 4px 0; font-weight: 700; }
.rc-qt td { padding: 5px 8px 5px 0; border-bottom: 1px solid var(--rc-line); vertical-align: middle; }
.rc-qt .rc-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rc-qt-total td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--rc-line); }
.rc-qt-edit input { width: 100%; padding: 5px 7px; border: 1px solid #cfd3d9; border-radius: 5px; }
.rc-qt-sum { max-width: 300px; margin-left: auto; }
.rc-invs .rc-typebadge { min-width: 60px; text-align: center; }
.rc-inserts { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 8px; }
.rsbcrm .rc-chip { border: 1px solid var(--rc-line); background: var(--rc-rail); border-radius: 20px; padding: 3px 11px; font-size: 12px; cursor: pointer; color: var(--rc-ink); }
.rsbcrm .rc-chip:hover { background: #fff; border-color: var(--rc-accent); }
.rc-inserts .rc-t-when { flex-basis: 100%; }
.rc-qb .rc-form-actions { align-items: center; }

/* ---------- Narrow screens: one pane at a time ---------- */
@media (max-width: 1100px) {
  .rc-body { grid-template-columns: 180px minmax(260px, 340px) 1fr; }
}
@media (max-width: 860px) {
  .rc-body { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; min-height: 0; }
  .rc-listpane { overflow: visible; }
  .rc-rail { display: flex; gap: 4px; overflow-x: auto; padding: 6px; border-right: 0; border-bottom: 1px solid var(--rc-line); }
  .rc-rail h3 { display: none; }
  .rc-folder { width: auto; white-space: nowrap; }
  .rc-list { max-height: none; }
  .rsbcrm[data-view="list"] .rc-detail { display: none; }
  .rsbcrm[data-view="detail"] .rc-rail,
  .rsbcrm[data-view="detail"] .rc-listpane { display: none; }
  .rc-back { display: inline-block; }
  .rc-countdown { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .rc-toast { transition: none; }
}
