/* Red Dragon Seeds stock control. Bootstrap 5 base with a restrained red brand and warm neutrals. */
:root {
  --rd-red: #9b1d20;
  --rd-red-dark: #6f1416;
  --rd-red-soft: #f8e9e8;
  --rd-ink: #1f1d1b;
  --rd-muted: #6b665f;
  --rd-bg: #f5f3ef;
  --rd-line: #e3dfd8;
  --rd-sidebar: #241f1c;
  --rd-sidebar-ink: #d9d3cb;
  --rd-good: #1f7a4d;
  --rd-warn: #a35d00;
  --rd-bad: #b42318;

  --bs-primary: var(--rd-red);
  --bs-primary-rgb: 155, 29, 32;
  --bs-link-color: var(--rd-red);
  --bs-link-color-rgb: 155, 29, 32;
  --bs-link-hover-color: var(--rd-red-dark);
  --bs-body-color: var(--rd-ink);
  --bs-border-color: var(--rd-line);
  --bs-font-sans-serif: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

html { font-size: 15px; }
body { background: var(--rd-bg); }

.btn-primary { --bs-btn-bg: var(--rd-red); --bs-btn-border-color: var(--rd-red); --bs-btn-hover-bg: var(--rd-red-dark); --bs-btn-hover-border-color: var(--rd-red-dark); --bs-btn-active-bg: var(--rd-red-dark); --bs-btn-disabled-bg: var(--rd-red); --bs-btn-disabled-border-color: var(--rd-red); }
.btn-outline-primary { --bs-btn-color: var(--rd-red); --bs-btn-border-color: var(--rd-red); --bs-btn-hover-bg: var(--rd-red); --bs-btn-hover-border-color: var(--rd-red); --bs-btn-active-bg: var(--rd-red-dark); }
.form-control:focus, .form-select:focus { border-color: #c97b7c; box-shadow: 0 0 0 .2rem rgba(155, 29, 32, .15); }
.form-check-input:checked { background-color: var(--rd-red); border-color: var(--rd-red); }
.text-bg-primary { background-color: var(--rd-red) !important; }

/* Shell */
.rd-shell { display: flex; min-height: 100vh; }
.rd-main { flex: 1; min-width: 0; padding: 1.5rem 2rem 3rem; }
.rd-topbar { background: var(--rd-sidebar); color: #fff; display: flex; align-items: center; padding: .6rem 1rem; position: sticky; top: 0; z-index: 1030; }

.rd-sidebar { width: 248px; flex-shrink: 0; background: var(--rd-sidebar) !important; color: var(--rd-sidebar-ink); display: flex; flex-direction: column; }
@media (min-width: 992px) { .rd-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; } }
@media (max-width: 991.98px) { .rd-sidebar.offcanvas-lg { background: var(--rd-sidebar); } .rd-main { padding: 1rem 1rem 3rem; } }
.rd-sidebar-head { padding: 1.25rem 1.25rem .75rem; position: relative; }
.rd-sidebar-head .btn-close { position: absolute; right: 1rem; top: 1.25rem; }
.rd-brand { color: #fff; font-weight: 700; letter-spacing: .01em; text-decoration: none; display: inline-flex; align-items: center; gap: .55rem; font-size: 1.05rem; }
.rd-brand:hover { color: #fff; }
.rd-mark { width: 1.35rem; height: 1.35rem; border-radius: 50% 50% 50% 0; background: var(--rd-red); transform: rotate(-45deg); box-shadow: inset -3px -3px 0 rgba(0,0,0,.18); }
.rd-sub { font-size: .78rem; color: #9b948b; margin-left: 1.9rem; text-transform: uppercase; letter-spacing: .08em; }
.rd-nav { padding: .25rem .6rem 1rem; flex: 1; }
.rd-group { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: #a3e635; padding: 1.1rem .7rem .35rem; margin-top: .35rem; border-top: 1px solid rgba(163,230,53,.18); }
.rd-nav > .rd-favs:first-child .rd-group, .rd-nav > .rd-group:first-child { margin-top: 0; border-top: 0; }
.rd-group-fav { color: #facc15; border-top: 0; margin-top: 0; padding-top: .4rem; }
.rd-favs { padding-bottom: .4rem; margin-bottom: .2rem; border-bottom: 1px solid rgba(250,204,21,.25); }
.rd-fav-star { margin-left: auto; padding: 0 .15rem; color: rgba(255,255,255,.35); opacity: 0; line-height: 1; cursor: pointer; border-radius: .25rem; }
.rd-fav-star i { width: auto !important; font-size: .85rem !important; }
.rd-nav-badge + .rd-fav-star { margin-left: .35rem; }
.rd-link:hover .rd-fav-star, .rd-fav-star:focus, .rd-fav-star.on { opacity: 1; }
.rd-fav-star.on { color: #facc15; }
.rd-fav-star:hover { color: #facc15; }
.rd-link.active .rd-fav-star.on { color: #fff; }
@media (hover: none) { .rd-fav-star { opacity: .55; } }
.rd-link { display: flex; align-items: center; gap: .65rem; color: var(--rd-sidebar-ink); text-decoration: none; padding: .5rem .7rem; border-radius: .45rem; font-size: .95rem; }
.rd-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .85; }
.rd-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.rd-link.active { background: var(--rd-red); color: #fff; }
.rd-link.active i { opacity: 1; }
.rd-sidebar-foot { padding: .9rem 1.25rem 1.1rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .88rem; }
.rd-user { color: #fff; }
.rd-foot-link { color: #b8b0a6; font-size: .82rem; text-decoration: none; }
.rd-foot-link:hover { color: #fff; }

/* Page furniture */
.rd-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.rd-page-head h1 { font-size: 1.6rem; font-weight: 700; margin: 0; }
.rd-page-head .rd-lead { color: var(--rd-muted); margin: .2rem 0 0; }
.rd-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.rd-flash { margin-bottom: 1rem; }

.rd-card { background: #fff; border: 1px solid var(--rd-line); border-radius: .6rem; padding: 1.1rem 1.25rem; }
.rd-card + .rd-card { margin-top: 1rem; }
.rd-card h2 { font-size: 1.1rem; font-weight: 650; margin: 0 0 .85rem; }
.rd-section-title { font-size: 1.05rem; font-weight: 650; margin: 1.5rem 0 .6rem; }

.rd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .85rem; margin-bottom: 1.25rem; }
.rd-stat { background: #fff; border: 1px solid var(--rd-line); border-radius: .6rem; padding: .85rem 1rem; }
.rd-stat .rd-stat-label { font-size: .8rem; color: var(--rd-muted); }
.rd-stat .rd-stat-value { font-size: 1.55rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rd-stat .rd-stat-note { font-size: .78rem; color: var(--rd-muted); }
.rd-stat.rd-stat-alert .rd-stat-value { color: var(--rd-bad); }

/* Filters */
.rd-filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: .9rem; }
.rd-filters .form-label { font-size: .78rem; color: var(--rd-muted); margin-bottom: .15rem; }
.rd-filters .rd-filter { min-width: 150px; }
.rd-filters .rd-filter-wide { min-width: 240px; flex: 1; max-width: 360px; }

/* Tables */
.rd-table-wrap { background: #fff; border: 1px solid var(--rd-line); border-radius: .6rem; overflow: auto; max-height: calc(100vh - 220px); }
.rd-table-wrap.rd-short { max-height: none; }
.rd-table { margin: 0; font-size: .92rem; }
.rd-table thead th { position: sticky; top: 0; background: #faf8f5; z-index: 1; font-weight: 600; font-size: .8rem; color: var(--rd-muted); text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--rd-line); white-space: nowrap; }
.rd-table td, .rd-table th { padding: .55rem .75rem; vertical-align: middle; }
.rd-table tbody tr:hover { background: #fcfaf7; }
.rd-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rd-table tfoot td { font-weight: 650; background: #faf8f5; }
.rd-muted { color: var(--rd-muted); }
.rd-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .88em; white-space: nowrap; }
.neg { color: var(--rd-bad); }
.pos { color: var(--rd-good); }

/* Badges */
.rd-badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .2rem .5rem; border-radius: 999px; white-space: nowrap; }
.rd-s-tomake { background: #fff1d6; color: #7a4a00; }
.rd-s-inprogress { background: #dbeafe; color: #1e40af; }
.rd-s-made { background: #dcf3e6; color: #17603c; }
.rd-s-cancelled { background: #ececec; color: #5d5d5d; }
.rd-s-hold { background: #ede4f7; color: #5b2d8c; }
.rd-p-urgent { background: var(--rd-red-soft); color: var(--rd-red); }
.rd-p-low { background: #eef0f2; color: #555; }
.rd-flag { background: #fde8e7; color: var(--rd-bad); }
.rd-flag-warn { background: #fff1d6; color: #7a4a00; }
.rd-ok { background: #dcf3e6; color: #17603c; }

/* Forms */
.rd-form { max-width: 760px; }
.rd-form .form-label { font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.rd-form .form-text { font-size: .8rem; }
.rd-big-input { font-size: 1.35rem; font-weight: 600; padding: .55rem .8rem; }
.rd-help { color: var(--rd-muted); font-size: .88rem; }
.rd-kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: 0; }
.rd-kv dt { color: var(--rd-muted); font-weight: 500; }
.rd-kv dd { margin: 0; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
.validation-summary-valid { display: none !important; }

/* Touch-friendly production screens */
.rd-touch .btn, .rd-touch .form-control, .rd-touch .form-select { min-height: 48px; }
.rd-touch .btn-lg { min-height: 56px; font-size: 1.15rem; }
.rd-bag-row { border: 1px solid var(--rd-line); border-radius: .5rem; padding: .7rem .9rem; margin-bottom: .5rem; background: #fff; }
.rd-bag-row.selected { border-color: var(--rd-red); background: #fffafa; }

/* Sign-in */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(160deg, #2a2320 0%, #3b2a26 55%, #6f1416 100%); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: .8rem; padding: 2rem; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.auth-card .rd-brand { color: var(--rd-ink); font-size: 1.25rem; }

.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0; }
@media print { .rd-sidebar, .rd-topbar, .rd-actions, .rd-filters, .btn { display: none !important; } .rd-main { padding: 0; } .rd-table-wrap { max-height: none; border: 0; } }

/* Dashboard */
a.rd-stat-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.rd-stat-link:hover { border-color: #c9a3a3; box-shadow: 0 1px 4px rgba(31, 29, 27, .08); }
.rd-chart { position: relative; }

/* Reports */
.rd-report td, .rd-report th { white-space: nowrap; }
.rd-report td { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--rd-red); --bs-nav-link-color: var(--rd-red); --bs-nav-link-hover-color: var(--rd-red-dark); }

/* Amazon FBA mapping status */
.rd-m-matched { background: #e3f3ea; color: #155c39; }
.rd-m-review { background: #fdf0d5; color: #7a4600; }
.rd-m-unmatched { background: #fbe4e2; color: #9b1d20; }
.rd-m-conflict { background: #efe4f7; color: #5b2a86; }
.rd-m-excluded { background: #eceae6; color: #5c5750; }
.rd-snapshot { display: inline-flex; align-items: center; gap: .4rem; background: #fff; border: 1px solid var(--rd-line); border-radius: .5rem; padding: .35rem .7rem; font-size: .85rem; }

/* Amazon FBA inventory table */
.rd-fba td { white-space: nowrap; }
.rd-fba td.rd-fba-name { white-space: normal; min-width: 260px; max-width: 420px; }
.rd-sort { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; white-space: nowrap; }
.rd-sort:hover, .rd-sort:focus-visible { color: var(--rd-ink, #222); text-decoration: underline; }
.rd-colorder { max-height: 60vh; overflow-y: auto; }
.rd-colorder .rd-drop { border-top: 2px solid #b8352a; }
.rd-colpick { max-height: 60vh; overflow-y: auto; }
.rd-colgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 1rem; }
#fbaFilters .btn.active { background: #b8352a; border-color: #b8352a; color: #fff; }
/* Picking list */
.rd-pick td, .rd-pick th { font-size: .9rem; }
.rd-pick .rd-box { display: inline-block; width: 1.1rem; height: 1.1rem; border: 1.5px solid #333; border-radius: 2px; }
.rd-blank { display: inline-block; min-width: 4.5rem; border-bottom: 1px solid #333; height: 1.2rem; vertical-align: bottom; }
@media print {
  @page { size: A4; margin: 12mm; }
  body, .rd-main { background: #fff !important; }
  .rd-pick { font-size: 10pt; }
  .rd-pick tr { page-break-inside: avoid; }
  .rd-snapshot { border: 0; padding: 0; }
  .rd-noprint { display: none !important; }
}

/* Replenishment: Amazon recommends sending but our sales-based figure is 0 */
tr.rd-row-amazon > td { background: #fff8e6; }
.rd-stat-on { border-color: #c9a3a3; box-shadow: inset 0 0 0 1px #c9a3a3; }

/* Markem Master */
.rd-count { display: inline-block; white-space: nowrap; flex-shrink: 0; font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; padding: .1rem .45rem; border-radius: 999px; }
.rd-count-ok { background: #e3f3ea; color: #155c39; }
.rd-count-near { background: #fdf0d5; color: #7a4600; }
.rd-count-over { background: #fbe4e2; color: #9b1d20; }
.rd-mk td { vertical-align: middle; }
.rd-mk tbody tr { cursor: pointer; }
.rd-mk tbody tr:hover > td { background: #faf6f2; }
.rd-mk .rd-mk-url { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-mk th button { all: unset; cursor: pointer; }
.rd-mk th button:hover { text-decoration: underline; }
.rd-missing { color: #9b1d20; font-size: .8rem; font-weight: 600; }
.rd-field-missing { border-color: #d9534f !important; }
.rd-diff-old { background: #fbe4e2; text-decoration: line-through; padding: 0 .2rem; }
.rd-diff-new { background: #e3f3ea; padding: 0 .2rem; }

/* Shared tables: sortable headings and Excel-style column resizing (rd-grid.js) */
th.rd-sortable { cursor: pointer; user-select: none; }
th.rd-sortable:hover { color: var(--rd-ink, #1f1d1b); }
th.rd-sorted { color: var(--rd-ink, #1f1d1b); }
.rd-sort-ind { display: inline-block; min-width: .8em; margin-left: .25rem; font-size: .7rem; color: var(--rd-red, #9b1d20); }
th.rd-resizable { overflow: visible; }
.rd-col-resize { position: absolute; top: 0; right: -4px; width: 9px; height: 100%; cursor: col-resize; z-index: 3; touch-action: none; }
.rd-col-resize::after { content: ""; position: absolute; top: 20%; bottom: 20%; left: 4px; width: 1px; background: transparent; transition: background .1s; }
th:hover .rd-col-resize::after, .rd-col-resize:hover::after { background: #c9a3a3; }
body.rd-resizing, body.rd-resizing * { cursor: col-resize !important; user-select: none !important; }
table.rd-grid-fixed { table-layout: fixed; }
table.rd-grid-fixed th { overflow: hidden; text-overflow: ellipsis; }
table.rd-grid-fixed td { overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere; }
.rd-reset-widths { font-size: .8rem; padding: .15rem 0; color: var(--rd-muted); text-decoration: none; }
.rd-reset-widths:hover { color: var(--rd-red, #9b1d20); }

/* Barcode required (production queue) */
.rd-bc { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .03em; padding: .15rem .45rem; border-radius: .3rem; white-space: nowrap; }
.rd-bc-yes { background: #9b1d20; color: #fff; }
.rd-bc-unknown { border: 1.5px solid #c62828; color: #c62828; background: #fff5f5; }
.rd-bc-no { color: #5c5750; background: #eceae6; font-weight: 600; }

/* ---------------------------------------------------------------- Tasks (4.4) */
.rd-nav-badge { margin-left: auto; min-width: 1.35rem; padding: .05rem .4rem; border-radius: 999px; background: var(--rd-red); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.rd-link.active .rd-nav-badge { background: #fff; color: var(--rd-red); }

.rd-ttabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--rd-line); margin-bottom: .75rem; }
.rd-ttab { padding: .45rem .8rem; color: var(--rd-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: .92rem; }
.rd-ttab:hover { color: var(--rd-ink); }
.rd-ttab.active { color: var(--rd-red); border-bottom-color: var(--rd-red); }
.rd-ttab-n { display: inline-block; min-width: 1.3rem; padding: 0 .35rem; border-radius: 999px; background: #eceae6; color: var(--rd-ink); font-size: .72rem; text-align: center; }
.rd-ttab.active .rd-ttab-n { background: var(--rd-red-soft); color: var(--rd-red); }
.rd-ttab-over { font-size: .72rem; color: var(--rd-bad); font-weight: 700; }
.rd-tfilters .rd-filter { min-width: 0; width: auto; max-width: 210px; }

/* The inbox: one line per task. */
table.rd-tasks { table-layout: fixed; width: 100%; min-width: 880px; }
table.rd-tasks td, table.rd-tasks th { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.rd-tasks td { padding: .32rem .6rem; font-size: .9rem; }
table.rd-tasks th { padding: .45rem .6rem; }
.rd-tasks .rd-tc-check { width: 38px; padding-right: 0; text-align: center; }
.rd-tasks .rd-tc-link { width: 170px; }
.rd-tasks .rd-tc-who { width: 130px; }
.rd-tasks .rd-tc-pri { width: 96px; }
.rd-tasks .rd-tc-due { width: 88px; }
.rd-tasks .rd-tc-when { width: 104px; }
.rd-tasks .rd-tc-status { width: 142px; position: relative; overflow: visible; }
.rd-tasks tbody tr[data-task] { cursor: pointer; }
.rd-tasks tbody tr[data-task]:hover > td { background: #f8f4ef; }
.rd-tasks tr.rd-task-current > td { background: #f6ecea !important; }
.rd-tasks tr.rd-task-current > td:first-child { box-shadow: inset 3px 0 0 var(--rd-red); }
.rd-task-open { color: var(--rd-ink); text-decoration: none; font-weight: 550; }
.rd-task-open:hover { text-decoration: underline; color: var(--rd-ink); }
.rd-tasks .rd-tc-title { overflow: hidden; text-overflow: ellipsis; }
.rd-task-cc, .rd-task-hasdesc { color: #a39c93; font-size: .78rem; margin-left: .35rem; }
.rd-task-cc i { margin-right: .15rem; }
.rd-task-link { text-decoration: none; font-size: .85rem; }
.rd-task-link i { margin-right: .25rem; opacity: .8; }
.rd-task-link:hover { text-decoration: underline; }
.rd-tasks tr.rd-done .rd-task-open { color: var(--rd-muted); text-decoration: line-through; font-weight: 400; }
.rd-tasks tr.rd-overdue > td:first-child { box-shadow: inset 3px 0 0 var(--rd-bad); }
.rd-due-over, table.rd-tasks td.rd-due-over { color: var(--rd-bad); font-weight: 700; }
.rd-due-today, table.rd-tasks td.rd-due-today { color: var(--rd-warn); font-weight: 700; }
table.rd-tasks td.rd-muted { color: var(--rd-muted); }
.rd-tasks tr.rd-task-busy { opacity: .55; }
.rd-tasks tr.rd-task-leaving > td { transition: opacity .4s; opacity: .25; }
.rd-task-check { width: 1.1rem; height: 1.1rem; cursor: pointer; margin: 0; }
.rd-task-check:disabled { cursor: not-allowed; }

.rd-tpri { display: inline-block; font-size: .74rem; font-weight: 700; padding: .08rem .45rem; border-radius: .3rem; }
.rd-tpri-urgent { background: var(--rd-red); color: #fff; }
.rd-tpri-high { background: #fde8e7; color: var(--rd-bad); }
.rd-tpri-normal { color: var(--rd-muted); font-weight: 500; padding-left: 0; }
.rd-tpri-low { color: #8f877d; font-weight: 500; background: #f1efeb; }

/* Quick actions appear on hover, over the status. */
.rd-qa { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); display: none; gap: .1rem; background: #f8f4ef; padding-left: .3rem; }
.rd-tasks tr:hover .rd-qa, .rd-tasks tr:focus-within .rd-qa, .rd-qa:has(.show) { display: inline-flex; }
.rd-qa-btn { padding: .1rem .38rem; color: var(--rd-muted); border: 1px solid transparent; line-height: 1.2; }
.rd-qa-btn:hover { color: var(--rd-red); border-color: var(--rd-line); background: #fff; }
.rd-tasks .dropdown-menu { font-size: .88rem; }
@media (hover: none) { .rd-qa { position: static; transform: none; display: inline-flex; background: none; } }

/* Hover preview */
.rd-task-tip { position: fixed; z-index: 1070; max-width: 420px; min-width: 260px; background: #fff; border: 1px solid var(--rd-line); border-radius: .5rem; box-shadow: 0 8px 28px rgba(31, 29, 27, .16); padding: .65rem .8rem; font-size: .85rem; pointer-events: none; }
.rd-tip-title { font-weight: 650; margin-bottom: .25rem; white-space: normal; overflow-wrap: anywhere; }
.rd-tip-desc { color: var(--rd-ink); white-space: pre-line; margin-bottom: .4rem; max-height: 9.5em; overflow: hidden; overflow-wrap: anywhere; }
.rd-task-tip dl { display: grid; grid-template-columns: max-content 1fr; gap: .1rem .7rem; margin: 0; }
.rd-task-tip dt { color: var(--rd-muted); font-weight: 500; }
.rd-task-tip dd { margin: 0; overflow-wrap: anywhere; }

/* Slide-out panel */
.rd-task-panel.offcanvas-end { width: 500px; max-width: 100vw; border-left: 1px solid var(--rd-line); box-shadow: -8px 0 30px rgba(31, 29, 27, .12); }
.rd-tp { display: flex; flex-direction: column; min-height: 100%; }
.rd-tp-head { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem .4rem; position: sticky; top: 0; background: #fff; z-index: 2; }
.rd-tp-kicker { display: flex; align-items: center; gap: .45rem; font-size: .8rem; color: var(--rd-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.rd-tp-close { display: none; }
.offcanvas .rd-tp-close { display: block; }
.rd-tp-form[data-kind="save"], .rd-tp-read { padding: 0 1rem .6rem; }
.rd-tp-title { font-size: 1.12rem; font-weight: 650; resize: none; overflow: hidden; line-height: 1.35; padding: .35rem .5rem; border-color: transparent; background: #faf8f5; }
.rd-tp-title:hover { border-color: var(--rd-line); }
.rd-tp-title:focus { background: #fff; }
.rd-tp-grid { display: grid; grid-template-columns: 92px 1fr; gap: .45rem .6rem; align-items: center; }
.rd-tp-label { font-size: .8rem; color: var(--rd-muted); font-weight: 600; margin: 0; }
.rd-tp-due { max-width: 140px; }
.rd-tp-prio { display: flex; flex-wrap: wrap; gap: .25rem; }
.rd-tp-prio .btn { --bs-btn-padding-y: .12rem; --bs-btn-padding-x: .55rem; border: 1px solid var(--rd-line); color: var(--rd-muted); font-size: .8rem; }
.rd-tp-prio .btn-check:checked + .rd-prio-low { background: #eceae6; color: var(--rd-ink); border-color: #c9c3ba; }
.rd-tp-prio .btn-check:checked + .rd-prio-normal { background: #e8eef7; color: #1e3a6b; border-color: #a9bbd8; }
.rd-tp-prio .btn-check:checked + .rd-prio-high { background: #fde8e7; color: var(--rd-bad); border-color: #e9a7a3; }
.rd-tp-prio .btn-check:checked + .rd-prio-urgent { background: var(--rd-red); color: #fff; border-color: var(--rd-red); }
.rd-tp-chip { display: flex; align-items: center; flex-wrap: wrap; gap: .1rem .45rem; border: 1px solid var(--rd-line); border-radius: .4rem; padding: .2rem .2rem .2rem .55rem; background: #fff; font-size: .88rem; }
.rd-tp-chip-link { text-decoration: none; }
.rd-tp-chip-link:hover strong { text-decoration: underline; }
.rd-tp-chip-detail { color: var(--rd-muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; flex: 1; min-width: 0; }
.rd-tp-unlink { color: var(--rd-muted); padding: 0 .35rem; margin-left: auto; }
.rd-tp-actions { display: flex; align-items: center; gap: .4rem; margin-top: .8rem; }
.rd-tp-meta { padding: .2rem 1rem .4rem; border-top: 1px solid var(--rd-line); margin-top: .2rem; padding-top: .55rem; }
.rd-tp-quick { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: 0 1rem .6rem; }
.rd-tp-history { padding: .6rem 1rem 1rem; background: #faf8f5; border-top: 1px solid var(--rd-line); flex: 1; }
.rd-tp-section { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--rd-muted); font-weight: 700; margin-bottom: .4rem; }
.rd-tp-feed { list-style: none; padding: 0; margin: 0 0 .6rem; max-height: 46vh; overflow-y: auto; }
.rd-tp-event { display: grid; grid-template-columns: 1rem 1fr auto; gap: .2rem; font-size: .8rem; color: var(--rd-muted); padding: .12rem 0; }
.rd-tp-event strong { color: var(--rd-ink); font-weight: 600; }
.rd-tp-event time, .rd-tp-comment time { font-size: .74rem; color: #a39c93; white-space: nowrap; }
.rd-tp-comment { background: #fff; border: 1px solid var(--rd-line); border-radius: .45rem; padding: .4rem .6rem; margin: .35rem 0; font-size: .88rem; }
.rd-tp-comment-head { display: flex; justify-content: space-between; gap: .5rem; font-size: .8rem; }
.rd-tp-comment-body { white-space: pre-line; overflow-wrap: anywhere; }
.rd-tp-readtitle { font-size: 1.15rem; font-weight: 650; overflow-wrap: anywhere; }
.rd-tp-readdesc { white-space: pre-line; overflow-wrap: anywhere; }
.rd-tp-loading { padding: 2rem 1rem; color: var(--rd-muted); }
.rd-tp-page { max-width: 640px; padding: 0; overflow: hidden; }
.rd-tp-page .rd-tp-head { position: static; }
.rd-tp-note { color: var(--rd-good); margin-top: .15rem; }
@keyframes rd-flash { from { box-shadow: 0 0 0 .25rem rgba(31, 122, 77, .35); } to { box-shadow: 0 0 0 0 rgba(31, 122, 77, 0); } }
.rd-flash-field { animation: rd-flash 1.1s ease-out; }

/* @ and # autocomplete */
.rd-ac { position: fixed; z-index: 1080; background: #fff; border: 1px solid var(--rd-line); border-radius: .45rem; box-shadow: 0 10px 30px rgba(31, 29, 27, .18); max-height: 320px; overflow-y: auto; padding: .25rem; font-size: .88rem; }
.rd-ac-item { display: grid; grid-template-columns: 1.3rem auto 1fr; align-items: baseline; gap: .1rem .45rem; padding: .35rem .5rem; border-radius: .3rem; cursor: pointer; }
.rd-ac-item.active, .rd-ac-item:hover { background: #f6ecea; }
.rd-ac-item i { color: var(--rd-red); }
.rd-ac-main { font-weight: 600; white-space: nowrap; }
.rd-ac-sub { color: var(--rd-muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-ac-empty { padding: .4rem .6rem; color: var(--rd-muted); }

/* Toast after saving */
.rd-toast { position: fixed; z-index: 1090; left: 50%; bottom: 1.25rem; transform: translateX(-50%); background: var(--rd-sidebar); color: #fff; padding: .5rem 1rem; border-radius: .45rem; font-size: .9rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }

/* Open tasks on a record page */
.rd-rec-tasks { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; background: #fff; border: 1px solid var(--rd-line); border-left: 3px solid var(--rd-red); border-radius: .45rem; padding: .4rem .7rem; margin: -.4rem 0 1rem; font-size: .88rem; }
.rd-rec-tasks-head { color: var(--rd-muted); font-weight: 600; }
.rd-rec-tasks-head i { color: var(--rd-red); margin-right: .3rem; }
.rd-rec-task { display: inline-flex; gap: .35rem; align-items: baseline; max-width: 420px; text-decoration: none; color: var(--rd-ink); border: 1px solid var(--rd-line); border-radius: 999px; padding: .08rem .6rem; background: #faf8f5; }
.rd-rec-task:hover { border-color: #c9a3a3; color: var(--rd-ink); }
.rd-rec-task .rd-rec-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.rd-rec-task .rd-muted { white-space: nowrap; font-size: .8rem; }
.rd-rec-task.rd-overdue { border-color: #e9a7a3; background: #fdf3f2; }
.rd-rec-pri-urgent, .rd-rec-pri-high { color: var(--rd-bad); }

/* Dashboard: my tasks */
.rd-dash-tasks { list-style: none; margin: 0; padding: 0; }
.rd-dash-tasks li { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) auto; align-items: center; gap: .4rem; padding: .32rem 0; border-bottom: 1px solid #f0ede8; font-size: .92rem; }
.rd-dash-tasks li:last-child { border-bottom: 0; }
.rd-dash-tasks .rd-dash-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--rd-ink); text-decoration: none; font-weight: 550; }
.rd-dash-tasks .rd-dash-t:hover { text-decoration: underline; }
.rd-dash-tasks .rd-dash-m { white-space: nowrap; font-size: .8rem; color: var(--rd-muted); display: flex; gap: .5rem; align-items: center; }
.rd-dash-tasks li.rd-overdue .rd-dash-t { color: var(--rd-bad); }
@media print { .rd-task-panel, .rd-task-tip, .rd-toast, .rd-qa { display: none !important; } }
@media (max-width: 991.98px) { table.rd-tasks { min-width: 1000px; } }

/* Rich text (Trix) in task notes and comments (4.5) */
.rd-tp trix-toolbar { margin-top: .5rem; }
.rd-tp trix-toolbar .trix-button-row { flex-wrap: wrap; overflow-x: visible; }
.rd-tp trix-toolbar .trix-button-group { margin-bottom: 4px; border-color: var(--rd-line); }
.rd-tp trix-toolbar .trix-button { border-bottom: 0; }
.rd-tp trix-toolbar .trix-button-group:not(:first-child) { margin-left: .4vw; }
.rd-tp trix-toolbar .trix-button--icon { width: 2.1em; height: 1.75em; }
.rd-tp trix-toolbar [data-trix-button-group="file-tools"] .trix-button { background-color: #fff6f5; }
trix-editor.rd-tp-desc { min-height: 5.5em; max-height: 45vh; overflow-y: auto; background: #faf8f5; border: 1px solid var(--rd-line); border-radius: .375rem; padding: .4rem .55rem; font-size: .9rem; margin-top: 0 !important; }
trix-editor.rd-tp-commentbox { min-height: 3.6em; max-height: 35vh; overflow-y: auto; background: #fff; border: 1px solid var(--rd-line); border-radius: .375rem; padding: .35rem .5rem; font-size: .88rem; }
trix-editor:focus { background: #fff; border-color: #c97b7c; box-shadow: 0 0 0 .2rem rgba(155, 29, 32, .12); outline: 0; }
trix-editor:empty:not(:focus)::before { color: #a39c93; }
.rd-rich { overflow-wrap: anywhere; }
.rd-rich img { max-width: 100%; height: auto; border-radius: .3rem; }
.rd-rich h1 { font-size: 1.05rem; font-weight: 700; margin: .3rem 0; }
.rd-rich ul, .rd-rich ol { padding-left: 1.3rem; margin: .2rem 0; }
.rd-rich blockquote { border-left: 3px solid var(--rd-line); margin: .3rem 0; padding-left: .6rem; color: var(--rd-muted); }
.rd-rich pre { background: #f3f0eb; padding: .4rem .55rem; border-radius: .3rem; font-size: .82rem; white-space: pre-wrap; }
.rd-rich .attachment { max-width: 100%; }
.rd-rich .attachment--file { border: 1px solid var(--rd-line); border-radius: .35rem; padding: .3rem .6rem; background: #fff; display: inline-block; }
.rd-tp-readdesc { background: #faf8f5; border-radius: .375rem; padding: .45rem .6rem; margin-top: .4rem; }
.rd-tp-comment-body.trix-content { white-space: normal; }
.rd-tp-files { padding: .55rem 1rem .5rem; border-top: 1px solid var(--rd-line); }
.rd-tp-files ul { list-style: none; margin: 0; padding: 0; }
.rd-tp-files li { display: grid; grid-template-columns: 1.1rem minmax(0, auto) 1fr auto; gap: .4rem; align-items: baseline; font-size: .85rem; padding: .1rem 0; }
.rd-tp-files li > a:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.rd-tp-files .rd-muted { font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-tp-dl { color: var(--rd-muted); }
.rd-tip-files { color: var(--rd-muted); margin-bottom: .35rem; }
.rd-tp-comment-body img, trix-editor.rd-tp-commentbox img { max-height: 220px; width: auto; }
.rd-tp-readdesc img, trix-editor.rd-tp-desc img { max-height: 320px; width: auto; }
.rd-task-lock { color: #8f877d; font-size: .78rem; margin-right: .35rem; }

/* Long column headings wrap onto several lines instead of widening the column (4.6). Once a column has been
   resized, its heading wraps to fit too, so columns can be dragged narrower than their heading. */
table.rd-wrap-head thead th, .rd-table.rd-wrap-head thead th.num { white-space: normal; vertical-align: bottom; line-height: 1.2; }
table.rd-grid-fixed thead th, .rd-table.rd-grid-fixed thead th.num { white-space: normal; overflow-wrap: normal; word-break: normal; text-overflow: clip; vertical-align: bottom; line-height: 1.2; }
table.rd-wrap-head .rd-sort { white-space: normal; text-align: inherit; }

/* Column chooser (4.6.1) */
.rd-table .rd-col-off { display: none !important; }
.rd-colchoose { columns: 2; column-gap: 1.5rem; }
.rd-colchoose .form-check { break-inside: avoid; margin-bottom: .3rem; }
[data-grid-columns].rd-cols-on { background: var(--rd-red-soft); }
/* Replenishment: one line per listing, like FBA inventory (4.6.3) */
.rd-replen td { padding-top: .4rem; padding-bottom: .4rem; }
.rd-ell { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-ell-wide { max-width: 300px; }
table.rd-grid-fixed .rd-ell { max-width: none; }
.rd-replen .rd-code { font-size: .82rem; }
.rd-replen td.rd-oos { color: var(--rd-bad); font-weight: 700; }
.rd-replen .rd-use-amazon { padding: 0 .35rem; font-size: .72rem; line-height: 1.4; margin-left: .3rem; vertical-align: baseline; }
.rd-replen .rd-qty { width: 4.8rem; padding: .1rem .4rem; display: inline-block; }

/* Audit log: one compact row per entry, click to expand the detail underneath. */
.rd-audit-count { display: flex; align-items: center; gap: .75rem; font-size: .88rem; color: var(--rd-muted); margin: -.3rem 0 .4rem; }
.rd-audit-count strong { color: var(--rd-ink); }
.rd-audit-wrap { max-height: none; }
.rd-audit .rd-audit-chev { width: 1.6rem; padding-right: 0; color: var(--rd-muted); }
.rd-audit .rd-audit-chev .bi { display: inline-block; transition: transform .15s; font-size: .8rem; }
.rd-audit tr.rd-audit-row { cursor: pointer; }
.rd-audit tr.rd-audit-row:hover > td { background: #faf8f5; }
.rd-audit tr.rd-audit-row:focus-visible { outline: 2px solid var(--rd-red); outline-offset: -2px; }
.rd-audit tr.rd-audit-row[aria-expanded="true"] > td { background: var(--rd-red-soft); border-bottom-color: transparent; }
.rd-audit tr.rd-audit-row[aria-expanded="true"] .rd-audit-chev .bi { transform: rotate(90deg); }
.rd-audit .rd-audit-sum { width: 62%; max-width: 0; min-width: 18rem; }
.rd-audit .rd-clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-audit-full { font-size: .92rem; margin: 0 0 .6rem; color: var(--rd-ink); }
.rd-audit .rd-audit-sum span { color: #3d3934; }
.rd-audit .rd-audit-rec { width: 38%; max-width: 0; min-width: 11rem; }

.rd-audit tr.rd-audit-more > td { background: #fcfbf9; border-bottom: 2px solid var(--rd-line); }
.rd-audit-detail { padding: .35rem 0 .5rem; max-width: 980px; }
.rd-audit-meta, .rd-audit-facts { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; margin: 0 0 .75rem; font-size: .88rem; }
.rd-audit-meta dt, .rd-audit-facts dt { color: var(--rd-muted); font-weight: 500; }
.rd-audit-meta dd, .rd-audit-facts dd { margin: 0; word-break: break-word; }
.rd-audit-facts dd { white-space: pre-line; }
.rd-audit-changes { width: auto; min-width: 28rem; max-width: 100%; font-size: .88rem; margin-bottom: .75rem; background: #fff; border: 1px solid var(--rd-line); }
.rd-audit-changes th { font-size: .75rem; color: var(--rd-muted); font-weight: 600; }
.rd-audit-changes td { vertical-align: top; word-break: break-word; }
.rd-audit-changes .rd-audit-old { color: #7a3b2e; text-decoration: line-through; text-decoration-color: rgba(122,59,46,.35); }
.rd-audit-changes .rd-audit-new { color: var(--rd-good); font-weight: 500; }
.rd-audit-json summary { font-size: .82rem; color: var(--rd-muted); cursor: pointer; }
.rd-audit-json pre { background: #fff; border: 1px solid var(--rd-line); border-radius: .4rem; padding: .6rem .75rem; font-size: .78rem; max-height: 22rem; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: .35rem 0 0; }
.rd-audit-pager { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .75rem; }
.rd-audit-pager .page-link { color: var(--rd-red); }
.rd-audit-pager .active .page-link { background: var(--rd-red); border-color: var(--rd-red); color: #fff; }
.rd-audit-imports { align-self: center; margin: 1.1rem .25rem 0; font-size: .88rem; white-space: nowrap; }
.rd-audit .rd-audit-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.rd-audit .rd-audit-sort:hover { color: var(--rd-red); }

/* Production scheduling: planned date indicators (always with text, never colour alone). */
.rd-plan { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .03em; padding: .15rem .45rem; border-radius: .3rem; white-space: nowrap; border: 1px solid transparent; }
.rd-plan-today { background: #1f7a4d; color: #fff; }
.rd-plan-tomorrow { background: #f5b83d; color: #3d2a00; }
.rd-plan-overdue { background: #b42318; color: #fff; }
.rd-plan-upcoming { background: #fff; color: var(--rd-ink); border-color: #c9c3ba; }
.rd-plan-none { background: #eceae6; color: #6b665f; }
.rd-plan-date { display: block; font-size: .8rem; color: #3d3934; margin-top: .15rem; white-space: nowrap; }
table.rd-table tr.rd-row-today > td { background: #eef7f1; }
table.rd-table tr.rd-row-overdue > td { background: #fbeeec; }
table.rd-table tr.rd-row-today > td:first-child { box-shadow: inset 3px 0 0 #1f7a4d; }
table.rd-table tr.rd-row-overdue > td:first-child { box-shadow: inset 3px 0 0 #b42318; }
.rd-day-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.rd-day-stat { display: inline-flex; align-items: baseline; gap: .35rem; padding: .35rem .75rem; border-radius: .45rem; background: #fff; border: 1px solid var(--rd-line); color: var(--rd-ink); text-decoration: none; font-size: .95rem; }
.rd-day-stat strong { font-size: 1.15rem; }
.rd-day-stat:hover { border-color: var(--rd-red); color: var(--rd-ink); }
.rd-day-overdue { border-left: 4px solid #b42318; }
.rd-day-overdue.rd-day-zero { border-left-color: var(--rd-line); }
.rd-day-today { border-left: 4px solid #1f7a4d; }
.rd-day-tomorrow { border-left: 4px solid #f5b83d; }
.rd-day-filters { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .8rem; }
.rd-day-filters .rd-day-n { display: inline-block; min-width: 1.3rem; margin-left: .35rem; padding: 0 .3rem; border-radius: 999px; background: rgba(0,0,0,.08); font-size: .75rem; }
.rd-day-filters .btn-primary .rd-day-n { background: rgba(255,255,255,.25); }
.rd-reschedule { display: flex; gap: .4rem; max-width: 18rem; }

/* VFFS sachet stock: names wrap, codes and numbers don't. */
.rd-sachets td.rd-wrap { min-width: 12rem; white-space: normal; }
.rd-sachets td.num, .rd-sachets th.num { white-space: nowrap; }

/* Seeds to order */
.rd-order-needed { border-left: 4px solid #a35d00; }
.rd-order-ordered { border-left: 4px solid #2c5f8a; }
.rd-order-received { border-left: 4px solid #1f7a4d; }
.rd-badge.rd-order-needed { border: 0; background: #fff1d6; color: #7a4a00; }
.rd-badge.rd-order-ordered { border: 0; background: #e3eef8; color: #1d4a72; }
.rd-badge.rd-order-received { border: 0; background: #dcf3e6; color: #17603c; }
.rd-badge.rd-order-cancelled { background: #eceae6; color: #6b665f; }
.rd-orders td.rd-wrap { min-width: 11rem; white-space: normal; }
.rd-orders tbody.rd-order-group th { background: #f7f4ef; font-size: .9rem; padding-top: .55rem; text-transform: none; letter-spacing: 0; }
.rd-order-group-name { font-weight: 700; color: var(--rd-ink); }
.rd-order-group-tools { margin-left: .75rem; }
.rd-order-group-tools .btn { padding: 0 .4rem; font-size: .82rem; }
.rd-seedstock { background: #faf8f5; border: 1px solid var(--rd-line); border-radius: .5rem; padding: .65rem .8rem; }
.rd-seedstock-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem 1rem; }
.rd-seedstock-figs strong { display: block; font-size: 1.15rem; }
.rd-seedstock-label { display: block; font-size: .75rem; color: var(--rd-muted); }
.rd-yield-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .45rem 1rem; align-items: end; }
.rd-yield-figs strong { display: block; font-size: 1.15rem; }
.rd-yield-spp .form-control { max-width: 8rem; }
.rd-order-quick { color: var(--rd-muted); margin-left: .4rem; }
.rd-order-quick:hover { color: var(--rd-red); }

/* Supplier catalogue matching */
.rd-match { padding: .5rem 0; border-top: 1px solid var(--rd-line); }
.rd-match:first-child { border-top: 0; padding-top: 0; }
.rd-match:last-child { padding-bottom: 0; }
.rd-reasons, .rd-cautions { margin: .2rem 0 0; padding-left: 1.1rem; font-size: .8rem; }
.rd-reasons { color: var(--rd-muted); }
.rd-cautions { color: var(--rd-warn); }
.rd-match-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; align-items: center; }
.rd-match-variety { min-width: 200px; }
.rd-match-list > tbody > tr > td { vertical-align: top; }

/* Seeds to order: catalogue products */
.rd-catalogue-choice { padding: .3rem 0 .3rem 1.6rem; border-top: 1px solid var(--rd-line); }
.rd-catalogue-choice:first-of-type { border-top: 0; }
.rd-order-group-total { font-weight: 400; font-size: .85rem; margin-left: .5rem; }
#buyPanel > * + * { margin-top: .5rem; }
.rd-table tr:has(+ .rd-catalogue-prices) > td { border-bottom: 0; }
.rd-buy-lowest { background: #f1faf4; }
.rd-buy-plan { font-size: .86rem; margin-top: .1rem; }
.rd-buy-total { font-weight: 700; }
.rd-buy-warn { color: var(--rd-warn); }
.rd-buy-alts summary { color: var(--rd-muted); cursor: pointer; }
.rd-buy-alts ul { padding-left: 1.1rem; }
.rd-pack-editor { margin: .4rem 0 .2rem; padding: .45rem .6rem; border: 1px dashed var(--rd-line); border-radius: .4rem; background: #fff; }
.rd-pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .35rem .6rem; margin-top: .3rem; }
.rd-pack-cell { display: flex; flex-direction: column; gap: .1rem; font-size: .8rem; }
.rd-pack-cell input { max-width: 6rem; }
.rd-buy-suggested { background: #fbfaf8; }
.rd-buy-options { margin: 0; padding: 0; list-style: none; }
.rd-buy-options li { white-space: nowrap; }

/* Seed replenishment */
.rd-repl-notes { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .75rem; }
.rd-repl-row { cursor: pointer; }
.rd-repl-row[aria-expanded="true"] { background: var(--rd-red-soft); }
.rd-repl-chev { display: inline-block; font-size: .7rem; color: var(--rd-muted); margin-right: .35rem; transition: transform .15s; }
.rd-repl-row[aria-expanded="true"] .rd-repl-chev { transform: rotate(90deg); }
.rd-repl-total { font-weight: 700; }
.rd-repl-short { color: var(--rd-bad); font-weight: 600; }
.rd-repl-detail > td { background: #fbfaf8; padding: .75rem 1rem; }
.rd-repl-details h3 { font-size: .9rem; font-weight: 700; margin: 0 0 .4rem; }
.rd-repl-details h4 { font-size: .82rem; font-weight: 700; margin: .5rem 0 .25rem; }
.rd-repl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr)); gap: 1rem 1.5rem; }
.rd-repl-grid > section { min-width: 0; overflow-x: auto; }
.rd-repl-grid > .rd-repl-wide { grid-column: 1 / -1; }
.rd-repl-reasons { margin: 0 0 .75rem; padding-left: 1.1rem; font-size: .82rem; }
.rd-repl-inc { color: var(--rd-bad); }
.rd-repl-est { color: var(--rd-warn); }

/* Bulk production planning (4.16) */
.rd-fba-pickcol { width: 2.2rem; text-align: center; }
.rd-form.rd-bulk-form { max-width: none; }
.rd-bulk td { vertical-align: top; }
.rd-bulk .rd-bulk-qty { max-width: 6.5rem; margin-left: auto; }
.rd-bulk input[type=date] { min-width: 9.5rem; }
.rd-bulk tr.rd-bulk-off > td { opacity: .6; }
.rd-bulk tr.rd-bulk-error > td { background: #fdf0ef; }
.rd-sticky-bottom { position: sticky; bottom: .5rem; z-index: 5; box-shadow: 0 -2px 10px rgba(0,0,0,.08); }
.rd-bulk td .rd-code { white-space: normal; overflow-wrap: anywhere; }
.rd-bulk td[data-v] select.form-select-sm { min-width: 11rem; }
.rd-bulk th[data-col="listings"] { width: 16rem; }

/* Packaging (4.17): foil sachets from the VFFS, paper envelopes filled by hand */
.rd-badge.rd-pack-foil { background: #eef1f4; color: #3c4a57; border: 1px solid #d5dce3; }
.rd-badge.rd-pack-paper { background: #fbf1df; color: #7a4b00; border: 1px solid #ecd2a4; }
.rd-pack-filters { margin-bottom: .6rem; }

/* Kings crawler: four progress figures fit on one row inside the card. */
.rd-crawl-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* Notifications: the bell, its drop-down and pop-ups (4.21) */
.rd-headbar { justify-content: flex-end; align-items: center; gap: .9rem; margin: -.75rem 0 .5rem; min-height: 2rem; }
.rd-headbar-user { color: var(--rd-muted); text-decoration: none; font-size: .88rem; }
.rd-headbar-user:hover { color: var(--rd-ink); }
.rd-bell-btn { position: relative; border: 0; background: transparent; color: var(--rd-ink); font-size: 1.25rem; line-height: 1; padding: .3rem .4rem; border-radius: .4rem; }
.rd-bell-btn:hover, .rd-bell-btn[aria-expanded="true"] { background: #ebe7e1; }
.rd-topbar .rd-bell-btn { color: #fff; }
.rd-topbar .rd-bell-btn:hover, .rd-topbar .rd-bell-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .12); }
.rd-bell-n { position: absolute; top: -.1rem; right: -.25rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 999px; background: var(--rd-red); color: #fff; font-size: .68rem; font-weight: 700; line-height: 1.15rem; text-align: center; }
.rd-bell-menu { width: min(400px, 94vw); padding: 0; border-color: var(--rd-line); box-shadow: 0 10px 30px rgba(0, 0, 0, .14); }
.rd-bell-head { display: flex; align-items: center; padding: .6rem .9rem; border-bottom: 1px solid var(--rd-line); }
.rd-bell-empty { padding: 1rem .9rem; color: var(--rd-muted); font-size: .9rem; }
.rd-bell-foot { border-top: 1px solid var(--rd-line); padding: .5rem .9rem; font-size: .85rem; }
.rd-bell-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.rd-bell-list li + li { border-top: 1px solid #efece7; }
.rd-bell-list a { display: flex; gap: .65rem; padding: .6rem .9rem; color: var(--rd-ink); text-decoration: none; }
.rd-bell-list a:hover { background: #faf8f5; }
.rd-bell-list i { color: var(--rd-muted); margin-top: .1rem; }
.rd-bell-list .rd-unread a { background: #fdf6f5; }
.rd-bell-list .rd-unread i { color: var(--rd-red); }
.rd-bell-list .rd-unread .rd-bell-title { font-weight: 650; }
.rd-bell-text { display: flex; flex-direction: column; min-width: 0; }
.rd-bell-title { font-size: .9rem; }
.rd-bell-body { font-size: .82rem; color: var(--rd-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rd-bell-when { font-size: .76rem; color: var(--rd-muted); margin-top: .1rem; }
.rd-notice-page { max-height: none; }
.rd-notice-page .rd-bell-body { -webkit-line-clamp: unset; }
.rd-notices { position: fixed; z-index: 1085; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; width: min(360px, calc(100vw - 2rem)); }
.rd-notice { display: flex; align-items: flex-start; gap: .4rem; background: #fff; border: 1px solid var(--rd-line); border-left: 4px solid var(--rd-red); border-radius: .5rem; box-shadow: 0 10px 28px rgba(0, 0, 0, .18); padding: .65rem .7rem; transition: opacity .35s, transform .35s; }
.rd-notice a { display: flex; gap: .6rem; flex: 1; min-width: 0; color: var(--rd-ink); text-decoration: none; font-size: .9rem; }
.rd-notice a i { color: var(--rd-red); font-size: 1.1rem; }
.rd-notice-body { display: block; color: var(--rd-muted); font-size: .82rem; margin-top: .1rem; }
.rd-notice-out { opacity: 0; transform: translateY(8px); }
@media print { .rd-headbar, .rd-notices { display: none !important; } }
.rd-select-on { border-color: var(--rd-red); background-color: var(--rd-red-soft); font-weight: 600; }
.rd-bell-list li { position: relative; }
.rd-bell-list .rd-unread a { padding-right: 2.4rem; }
.rd-bell-markread { position: absolute; top: .5rem; right: .55rem; border: 1px solid var(--rd-line); background: #fff; color: var(--rd-muted); border-radius: .35rem; width: 1.7rem; height: 1.7rem; line-height: 1; padding: 0; }
.rd-bell-markread:hover { color: var(--rd-good); border-color: var(--rd-good); }

/* Filling methods and scoops (4.22) */
.rd-fill { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .45rem; border-radius: 999px; white-space: nowrap; background: #eef2f6; color: #34495e; }
.rd-fill-manualscoop { background: #f3ecdf; color: #6b4a12; }
.rd-scoop { border-left: 3px solid #b8892e; background: #fbf7ef; border-radius: .45rem; padding: .6rem .8rem; }
.rd-scoop-best { font-size: 1.15rem; font-weight: 650; }
.rd-scoop-tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; margin-left: .35rem; vertical-align: middle; }
.rd-scoop-verified { background: #dcf3e6; color: #17603c; }
.rd-scoop-unverified { background: #fff1d6; color: #7a4a00; }
.rd-scoop-estimated { background: #fde8e7; color: #a01f1a; }
.rd-weigh-result { font-size: 1.25rem; font-weight: 650; }
.rd-scoop-retired { background: #ececec; color: #5d5d5d; }

/* 4.24: catalogue multi-select and Seeds to Order totals */
.rd-pick-col { width: 2.2rem; text-align: center; }
.rd-pick-col .form-check-input { margin: 0; cursor: pointer; }
.rd-pick-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-top: .6rem; padding: .5rem .75rem; background: #fff; border: 1px solid var(--rd-line); border-left: 4px solid var(--rd-red); border-radius: .45rem; position: sticky; bottom: .5rem; z-index: 5; box-shadow: 0 -2px 10px rgba(0,0,0,.06); }
.rd-pick-bar.rd-pick-none { border-left-color: var(--rd-line); box-shadow: none; }
.rd-pick-count strong { font-size: 1.1rem; }
.rd-pick-list summary { cursor: pointer; color: var(--rd-red); font-size: .88rem; }
.rd-pick-list[open] { flex-basis: 100%; order: 10; }
.rd-pick-items { list-style: none; padding: 0; margin: .35rem 0 0; max-height: 14rem; overflow-y: auto; font-size: .88rem; }
.rd-pick-items li { padding: .1rem 0; border-bottom: 1px dotted var(--rd-line); }
.rd-pick-remove { padding: 0 .3rem; color: var(--rd-muted); }
.rd-pick-msg { color: var(--rd-bad); font-size: .85rem; }
.rd-order-totals { background: #fff; border: 1px solid var(--rd-line); border-radius: .5rem; padding: .55rem .75rem .45rem; margin-bottom: .8rem; }
.rd-ot-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .75rem; margin-bottom: .35rem; }
.rd-ot-wrap { max-height: none; border: 0; }
.rd-ot-table { font-size: .9rem; }
.rd-ot-table th, .rd-ot-table td { padding: .2rem .5rem; white-space: nowrap; }
.rd-ot-table thead th { font-size: .75rem; color: var(--rd-muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; position: static; background: transparent; }
.rd-ot-table tbody th { font-weight: 600; }
.rd-ot-all th, .rd-ot-all td { border-top: 2px solid var(--rd-line); font-weight: 700; }
.rd-ot-shown th, .rd-ot-shown td { background: #faf8f5; font-style: italic; }
.rd-ot-needed th { border-left: 3px solid #a35d00; }
.rd-ot-ordered th { border-left: 3px solid #2c5f8a; }
.rd-ot-flag { color: var(--rd-warn); font-size: .82rem; font-weight: 600; }
.rd-ot-foot { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; margin-top: .3rem; }
.rd-ot-suppliers summary { cursor: pointer; color: var(--rd-red); }
.rd-ot-suppliers[open] { flex-basis: 100%; }
.rd-ot-suppliers table { max-width: 46rem; }
.rd-order-msg { font-size: .88rem; color: var(--rd-good); min-height: 1.2rem; margin: -.4rem 0 .3rem; }
.rd-order-msg-bad { color: var(--rd-bad); }
.rd-qty-input { width: 6.5rem; min-width: 5rem; text-align: right; display: inline-block; }
.rd-unit-input { width: auto; min-width: 4.5rem; max-width: 12rem; }
.rd-order-saving { opacity: .55; transition: opacity .15s; }
.rd-order-just-added > td { background: #fffbe8; }
.rd-badge.rd-flag-cat { border: 0; background: #e8e3f6; color: #4a3a85; }
.rd-buy-offers { font-size: .8rem; }
.rd-order-added-list { columns: 2 18rem; margin-bottom: .25rem; }
@media (max-width: 575.98px) { .rd-pick-bar { bottom: 0; border-radius: 0; } .rd-ot-head span { display: block; } }
.rd-orders tbody td { vertical-align: top; }

/* 4.25: WooCommerce products */
.rd-woo-bulk { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0 0 .6rem; padding: .45rem .6rem; background: #fff; border: 1px solid var(--rd-line); border-radius: .45rem; }
.rd-woo-list td { vertical-align: top; }
.rd-woo-variety { min-width: 18rem; }
.rd-woo-facts th { width: 12rem; color: var(--rd-muted); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .88rem; position: static; background: transparent; }
.rd-woo-create td { vertical-align: top; position: relative; }   /* keeps the category picker's hidden select inside the scrolling table */
.rd-woo-create td:nth-child(2) { min-width: 14rem; }
.rd-woo-create td:nth-child(3), .rd-woo-create td:nth-child(4) { min-width: 10rem; }
.rd-woo-create td:nth-child(5) { min-width: 14rem; }
.rd-woo-create .rd-flag-warn { background: transparent; }
.rd-row-muted td { opacity: .7; }

/* Production gaps (4.29) */
.rd-day-stat-on { border-color: var(--rd-red); box-shadow: inset 0 0 0 1px var(--rd-red); }
.rd-gaps-bar { margin-bottom: .6rem; }
.rd-gaps td { vertical-align: top; }
.rd-gap-background { list-style: none; padding: 0; color: var(--rd-muted); }
.rd-gap-background li::before { content: "– "; }

/* Production gaps crop overview (4.30) */
.rd-crops .rd-crop-row { cursor: pointer; }
.rd-crops .rd-crop-row:hover td { background: rgba(0,0,0,.03); }
.rd-crops .rd-crop-row:focus-visible { outline: 2px solid var(--rd-red); outline-offset: -2px; }
.rd-crop-chevron { display: inline-block; transition: transform .15s; color: var(--rd-muted); }
.rd-crop-open .rd-crop-chevron { transform: rotate(90deg); }
.rd-crop-gaps .rd-crop-row td:first-child { box-shadow: inset 4px 0 0 var(--rd-red); }
.rd-crop-clear .rd-crop-row td { color: var(--rd-muted); }
.rd-crop-clear .rd-crop-row strong { font-weight: 500; }
.rd-gap-count { color: var(--rd-red); font-weight: 700; }
.rd-done-count { color: #198754; font-weight: 600; }
.rd-crop-detail > td { background: #faf8f5; padding: .5rem .5rem .75rem 1.5rem; }
.rd-crop-detail .rd-table-wrap { max-height: none; }

/* 4.31 supplier order documents */
.rd-import-attention > td { background: #fff8e8; }
.rd-ok-text { color: #17603c; }
.rd-import-doc > summary { cursor: pointer; list-style-position: outside; }
.rd-import-doc > summary h2 { font-size: 1.05rem; }
.rd-supplier-docs { border: 1px solid #e6e0d6; border-radius: .5rem; padding: .75rem 1rem; background: #fbfaf7; }
.rd-facts { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; font-size: .9rem; }
.rd-facts dt { font-weight: 600; color: #555; }
.rd-facts dd { margin: 0; }
@media (max-width: 575px) { .rd-facts { grid-template-columns: 1fr; } .rd-facts dd { margin-bottom: .3rem; } }
.rd-decision { min-width: 14rem; }

/* Price comparison (4.33): one supplier product per line in each supplier's cell, clickable to choose it. */
.rd-compare td { vertical-align: top; }
.rd-cmp-cell { min-width: 12rem; }
.rd-cmp-opt { display: block; position: relative; padding: .3rem .45rem .3rem 1.7rem; margin: 0 0 .3rem; border: 1px solid var(--rd-line); border-radius: .4rem; background: #fff; cursor: pointer; line-height: 1.35; }
.rd-cmp-opt:last-child { margin-bottom: 0; }
.rd-cmp-opt:hover { border-color: var(--rd-red); }
.rd-cmp-opt .rd-cmp-pick { position: absolute; left: .45rem; top: .45rem; margin: 0; }
.rd-cmp-price { font-weight: 700; margin-right: .25rem; }
.rd-cmp-best { background: #eef7ef; border-color: #9fcca6; }
.rd-cmp-out { opacity: .6; cursor: default; }
.rd-cmp-chosen { box-shadow: inset 0 0 0 2px var(--rd-red); border-color: var(--rd-red); }
.rd-compare-crops th .small { font-size: .72rem; }
.rd-cmp-byname { border-style: dashed; }

/* Seeds to Order (4.38): compact rows, folding the totals away, moving columns. */
.rd-ot-line { display: none; flex-wrap: wrap; align-items: center; gap: .2rem .9rem; font-size: .9rem; }
.rd-order-totals.rd-ot-folded { padding: .2rem .75rem; }
.rd-ot-folded .rd-ot-line { display: flex; }
.rd-ot-folded .rd-ot-head, .rd-ot-folded .rd-ot-wrap, .rd-ot-folded .rd-ot-foot { display: none; }
.rd-ot-head .btn-link, .rd-ot-line .btn-link { padding: 0 .25rem; font-size: .85rem; }
.rd-rate-note:has(~ .rd-ot-folded) { display: none; }
.rd-orders.rd-compact > tbody > tr > td { padding-top: .18rem; padding-bottom: .18rem; vertical-align: middle; line-height: 1.25; }
.rd-orders.rd-compact .rd-more { display: none !important; }
.rd-orders.rd-compact .rd-clip { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.rd-orders.rd-compact .rd-cell-variety .rd-clip { max-width: 16rem; }
.rd-orders.rd-compact .rd-cell-catalogue .rd-clip { max-width: 15rem; }
.rd-orders.rd-compact .rd-cell-notes .rd-clip { max-width: 12rem; }
.rd-orders.rd-compact.rd-grid-fixed .rd-clip { max-width: calc(100% - .2rem); }
.rd-orders.rd-compact .rd-cell-variety, .rd-orders.rd-compact .rd-cell-catalogue { white-space: nowrap; }
/* 4.51: the name gives way, so its badge and Create variety stay in sight however long the name is. */
.rd-var-line { display: flex; flex-wrap: wrap; align-items: center; column-gap: .25rem; min-width: 0; }
.rd-var-line > .rd-clip { min-width: 0; }
.rd-var-line > .rd-badge, .rd-var-line > .rd-create-var { flex: none; }
.rd-var-line > .rd-create-var { flex-basis: 100%; }
.rd-var-line > .rd-badge.ms-1 { margin-left: 0 !important; }
.rd-orders.rd-compact .rd-var-line { flex-wrap: nowrap; }
.rd-orders.rd-compact .rd-var-line > .rd-clip { flex: 0 1 auto; }
.rd-orders.rd-compact .rd-var-line > .rd-create-var { flex-basis: auto; margin-left: 0; }
.rd-orders.rd-compact .rd-create-var { display: inline; margin-left: .25rem; }
.rd-orders.rd-compact .rd-create-var span { display: none; }
.rd-orders.rd-compact .rd-buy-warn { display: inline; margin-left: .3rem; font-size: 0; }
.rd-orders.rd-compact .rd-buy-warn i { font-size: .8rem; }
.rd-orders.rd-compact .rd-buy-options li { display: inline; }
.rd-orders.rd-compact .rd-buy-options li + li::before { content: " · "; color: var(--rd-muted); }
.rd-orders.rd-compact .rd-status-extra { display: inline; margin: 0 0 0 .25rem !important; }
.rd-orders.rd-compact .rd-cell-status { white-space: nowrap; }
.rd-orders.rd-compact .rd-qty-input, .rd-orders.rd-compact .rd-unit-input { padding-top: 0; padding-bottom: 0; min-height: 1.65rem; font-size: .85rem; }
.rd-orders.rd-compact .btn-sm { padding: .05rem .4rem; font-size: .8rem; }
.rd-orders.rd-compact td .rd-badge { padding-top: .05rem; padding-bottom: .05rem; }
th.rd-movable { cursor: grab; }
th.rd-dragging { opacity: .45; }
th.rd-drop-before { box-shadow: inset 3px 0 0 var(--rd-red); }
th.rd-drop-after { box-shadow: inset -3px 0 0 var(--rd-red); }
.rd-colchoose:has(.rd-colchoose-row) { columns: 1; }
.rd-colchoose .rd-colchoose-row { display: flex; align-items: flex-start; gap: .5rem; padding-left: 0; padding-bottom: .15rem; border-bottom: 1px dotted var(--rd-line); }
.rd-colchoose-row .form-check-input { float: none; margin: .25rem 0 0; flex: none; }
.rd-colchoose-row .form-check-label { flex: 1; }
.rd-colchoose-tools { white-space: nowrap; }

/* Seeds to Order (4.39): ticking lines, and the bar of what to do with them. */
.rd-orders th.rd-pick, .rd-orders td.rd-pick { width: 2rem; min-width: 2rem; padding-left: .5rem; padding-right: .25rem; text-align: center; }
.rd-orders tr.rd-picked > td { background: var(--rd-red-soft); }
.rd-pick-bar { position: sticky; bottom: .5rem; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin-top: .5rem;
    padding: .5rem .75rem; background: var(--rd-surface, #fff); border: 1px solid var(--rd-red); border-radius: .5rem; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.rd-pick-bar[hidden] { display: none; }

/* Seeds to Order (4.40): a quiet link, e.g. the Crop type column. */
.rd-link-quiet { color: inherit; text-decoration: none; }
.rd-link-quiet:hover { color: var(--rd-red); text-decoration: underline; }

/* Range gaps (4.40). */
.rd-gap-whole-badge { background: var(--rd-bad); color: #fff; font-weight: 600; }
.rd-crop-whole > .rd-crop-row > td:first-child { box-shadow: inset 4px 0 0 var(--rd-bad); }
.rd-gap-missing { background: var(--rd-red-soft); color: var(--rd-red-dark); font-weight: 600; }
.rd-day-stat.rd-gap-whole { border-left-color: var(--rd-bad); }

/* Collection costing (4.41). */
.rd-costing tr.rd-cost-missing > td { background: #fff8e6; }
.rd-cost-summary th { font-weight: 500; }
.rd-cost-summary tr.rd-cost-total > * { border-top: 2px solid var(--rd-ink); }

/* Variety hover card with a Google Images link (4.42) */
.rd-plant-card { position: absolute; z-index: 1080; max-width: 300px; background: #fff; border: 1px solid var(--rd-line); border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,.14); padding: .55rem .7rem; font-size: .85rem; line-height: 1.3; }
.rd-plant-name { font-weight: 600; }
.rd-plant-bot { font-style: italic; color: var(--rd-muted); }
.rd-plant-sub { color: var(--rd-muted); font-size: .8rem; }
.rd-plant-link { display: inline-block; margin-top: .4rem; font-weight: 600; }
.rd-plant-note { color: var(--rd-muted); font-size: .72rem; margin-top: .2rem; }
.rd-plant-btn { border: 0; background: none; padding: 0 .2rem; color: var(--rd-muted); line-height: 1; }

/* Product preparation (4.44) */
.rd-prep-progress { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.rd-prep-chip { font-size: .75rem; padding: .15rem .5rem; border-radius: 999px; background: #fff1d6; color: #7a4a00; white-space: nowrap; }
.rd-prep-chip-done { background: #dcf3e6; color: #17603c; }
.rd-prep-missing { display: inline-block; font-size: .7rem; padding: 0 .35rem; margin: 0 .15rem .15rem 0; border-radius: 4px; background: #fff1d6; color: #7a4a00; white-space: nowrap; }
.rd-prep-waiting, .rd-prep-waiting-text { color: #8a4b00; }
.rd-prep-waiting { font-size: .75rem; }
.rd-prep-tabs .nav-link { color: var(--rd-ink, #222); }
.rd-prep-tabbody { border-top-left-radius: 0; }
.rd-prep-pic { border: 1px solid var(--rd-line); border-radius: 8px; padding: .75rem; height: 100%; background: #fff; }
.rd-prep-pic-done { border-color: #b8e2c8; }
.rd-prep-thumb { display: block; background: repeating-conic-gradient(#f3f3f3 0% 25%, #fff 0% 50%) 50% / 16px 16px; border-radius: 6px; text-align: center; }
.rd-prep-thumb img { max-width: 100%; max-height: 260px; object-fit: contain; display: inline-block; }
.rd-prep-pdf, .rd-prep-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 160px; color: var(--rd-muted); gap: .25rem; }
.rd-prep-pdf .bi, .rd-prep-empty .bi { font-size: 2.5rem; }
.rd-prep-empty { border: 2px dashed var(--rd-line); border-radius: 6px; }
.rd-prep-warn { color: #8a4b00; margin-top: .25rem; }
.rd-prep-trix { min-height: 9rem; background: #fff; }
.rd-prep-field trix-toolbar .trix-button-group--file-tools { display: none; }
.rd-prep-assign { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding: .6rem .9rem; }
.rd-send-table td { vertical-align: top; }
.rd-send-waiting td:first-child { box-shadow: inset 3px 0 0 #e0a100; }
.rd-prep-pic[data-drop="1"] { transition: box-shadow .12s, border-color .12s; }
.rd-prep-pic.rd-prep-drop { border-color: var(--bs-primary, #9b1c1c); box-shadow: 0 0 0 3px rgba(155, 28, 28, .18); background: #fff8f6; }
.rd-prep-empty .small { font-size: .75rem; }
.rd-prep-import { padding: .7rem .9rem; border-style: dashed; transition: box-shadow .12s, border-color .12s; }
.rd-prep-import.rd-prep-drop { border-color: var(--bs-primary, #9b1c1c); box-shadow: 0 0 0 3px rgba(155, 28, 28, .18); background: #fff8f6; }
.rd-import-table td { vertical-align: top; }
.rd-import-html { max-height: 22rem; overflow: auto; background: #fff; }
.rd-import-notes { padding-left: 1.1rem; }

/* 4.49: a variety's shop name beside it in the search drop-downs. */
.rd-select-also { color: var(--rd-muted); font-size: .85em; }

/* AI product creation (4.50) */
.rd-ai-people { max-height: 14rem; overflow-y: auto; border: 1px solid var(--bs-border-color); border-radius: .4rem; padding: .4rem .6rem; }
.rd-ai-ref { display: flex; gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--bs-border-color); }
.rd-ai-ref:first-of-type { border-top: 0; }
.rd-ai-ref-thumb { width: 72px; height: 72px; flex: none; display: flex; align-items: center; justify-content: center; background: #f4f4f2; border-radius: .4rem; overflow: hidden; color: #999; font-size: 1.5rem; }
.rd-ai-ref-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rd-ai-prompt { border-top: 1px solid var(--bs-border-color); padding: .6rem 0; }
.rd-ai-photos { display: flex; flex-wrap: wrap; gap: .6rem; }
.rd-ai-photos figure { margin: 0; width: 110px; }
.rd-ai-photos img { width: 110px; height: 110px; object-fit: cover; border-radius: .4rem; border: 1px solid var(--bs-border-color); }
.rd-ai-photos figcaption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-ai-generate { min-width: min(100%, 26rem); }
.rd-ai-version { border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .75rem; margin-bottom: .75rem; }
.rd-ai-version.rd-ai-chosen { border-color: var(--bs-primary); box-shadow: 0 0 0 1px var(--bs-primary); }
.rd-ai-version-head { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; font-size: .875rem; margin-bottom: .5rem; }
.rd-ai-making { color: #555; font-size: .9rem; }
.rd-ai-pic-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.rd-ai-thumb { flex: none; display: block; width: 240px; }
.rd-ai-thumb img { width: 100%; height: auto; border-radius: .35rem; border: 1px solid var(--bs-border-color); background: #fff; }
.rd-ai-problems { padding-left: 0; list-style: none; margin-bottom: .25rem; }
.rd-ai-problems li { margin-bottom: .2rem; color: #9a3412; }
.rd-ai-problems li.rd-ai-advisory { color: #555; }
.rd-ai-read { white-space: pre-wrap; font-size: .8rem; background: #f7f7f5; padding: .5rem; border-radius: .35rem; max-height: 14rem; overflow: auto; }
.rd-ai-fields th { width: 14rem; font-weight: 600; font-size: .85rem; }
.rd-ai-flags { margin-bottom: .25rem; }
.rd-ai-none { margin-bottom: .5rem; }
@media (max-width: 576px) { .rd-ai-thumb { width: 100%; } }

/* Amazon envelopes (4.52): where the label and QR code go, over the design */
.rd-env-thumb { position: relative; }
.rd-env-zone { position: absolute; border: 1.5px dashed #b45309; background: rgba(255,255,255,.55); color: #92400e; font-size: .65rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.1; pointer-events: none; }

/* SEO Manager (4.55) */
.rd-seo-readonly { background: var(--bs-success-bg-subtle, #e8f5e9); border: 1px solid var(--bs-success-border-subtle, #b6dfb9); border-radius: .5rem; padding: .5rem .75rem; font-size: .9rem; }
.rd-seo-chart { width: 100%; height: auto; display: block; }
.rd-seo-grid { stroke: #e3e6ea; stroke-width: 1; }
.rd-seo-axis { fill: #6c757d; font-size: 12px; }
.rd-seo-line { stroke: #b3262d; stroke-width: 2; }
.rd-seo-event { stroke: #6c757d; stroke-width: 1; stroke-dasharray: 4 4; }
.rd-seo-launch { stroke: #0d6efd; stroke-width: 2; stroke-dasharray: 6 4; }
.rd-seo-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; }
.rd-seo-kpi { border: 1px solid #e3e6ea; border-radius: .5rem; padding: .6rem .75rem; background: #fff; }
.rd-seo-kpi .v { font-size: 1.35rem; font-weight: 600; }
.rd-seo-kpi .l { font-size: .8rem; color: #6c757d; }
.rd-seo-q { font-size: .85rem; }
.rd-seo-draft { background: #fff8e1; border: 1px dashed #e0b84c; border-radius: .5rem; padding: .5rem .75rem; }
.rd-seo-bad { color: #b02a37; font-weight: 600; }

/* ---- Chat (4.61) ---- */
.rd-chat-toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 1090; display: flex; flex-direction: column; gap: .5rem; max-width: min(360px, calc(100vw - 2rem)); }
.rd-chat-toast { display: flex; gap: .6rem; align-items: flex-start; background: #fff; border: 1px solid var(--rd-line, #e4ded6); border-left: 4px solid var(--rd-red); border-radius: .5rem; padding: .6rem .8rem; box-shadow: 0 6px 24px rgba(0,0,0,.12); color: inherit; text-decoration: none; transition: opacity .35s, transform .35s; }
.rd-chat-toast i { color: var(--rd-red); font-size: 1.1rem; margin-top: .1rem; }
.rd-chat-toast strong { display: block; font-size: .85rem; }
.rd-chat-toast span { display: block; font-size: .85rem; color: #57514a; white-space: pre-line; overflow-wrap: anywhere; }
.rd-chat-toast.rd-out { opacity: 0; transform: translateY(8px); }
.rd-chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100dvh - 7.5rem); min-height: 420px; background: #fff; border: 1px solid var(--rd-line); border-radius: .6rem; overflow: hidden; }
.rd-chat-side { border-right: 1px solid var(--rd-line); display: flex; flex-direction: column; min-height: 0; min-width: 0; background: #fbfaf8; }
.rd-chat-side-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem .9rem .5rem; }
.rd-chat-side-head h1 { font-size: 1.25rem; margin: 0; }
.rd-chat-find { position: relative; padding: 0 .9rem .5rem; }
.rd-chat-find i { position: absolute; left: 1.45rem; top: .45rem; color: var(--rd-muted); font-size: .85rem; }
.rd-chat-find input { padding-left: 1.8rem; }
.rd-chat-rooms, .rd-chat-results { flex: 1; overflow-y: auto; padding-bottom: .5rem; }
.rd-chat-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--rd-muted); padding: .7rem .95rem .25rem; font-weight: 600; }
.rd-chat-none { padding: 0 .95rem .4rem; }
.rd-chat-room { display: flex; gap: .6rem; align-items: center; width: 100%; border: 0; background: none; text-align: left; padding: .45rem .9rem; color: inherit; }
.rd-chat-room:hover { background: #f1ede7; }
.rd-chat-room.on { background: var(--rd-red-soft); }
.rd-chat-room.closed { opacity: .65; }
.rd-chat-room-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rd-chat-room-name { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-chat-room.unread .rd-chat-room-name { font-weight: 700; }
.rd-chat-room-last { font-size: .78rem; color: var(--rd-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-chat-room-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; font-size: .72rem; color: var(--rd-muted); }
.rd-chat-n { background: var(--rd-red); color: #fff; border-radius: 1rem; padding: 0 .45rem; font-weight: 700; font-size: .72rem; line-height: 1.35rem; min-width: 1.35rem; text-align: center; }
.rd-chat-ico { width: 2rem; height: 2rem; border-radius: .5rem; background: #ece6de; display: inline-flex; align-items: center; justify-content: center; color: #5b544c; flex-shrink: 0; }
.rd-avatar { width: 2rem; height: 2rem; border-radius: 50%; background: hsl(var(--h, 0), 45%, 42%); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; flex-shrink: 0; }
.rd-chat-hit { display: flex; flex-direction: column; gap: .1rem; width: 100%; border: 0; background: none; text-align: left; padding: .45rem .95rem; font-size: .82rem; }
.rd-chat-hit:hover { background: #f1ede7; }
.rd-chat-hit span:last-child { color: var(--rd-muted); }
.rd-chat-notify { border-top: 1px solid var(--rd-line); padding: .6rem .9rem; font-size: .8rem; }
.rd-chat-closed { padding: .2rem .95rem .6rem; color: var(--rd-muted); }
.rd-chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.rd-chat-empty { margin: auto; text-align: center; color: var(--rd-muted); padding: 2rem; }
.rd-chat-empty i { font-size: 2.5rem; color: #cfc6bb; }
.rd-chat-head { display: flex; align-items: center; gap: .5rem; padding: .65rem 1rem; border-bottom: 1px solid var(--rd-line); }
.rd-chat-head h2 { font-size: 1.05rem; margin: 0; }
.rd-chat-title { min-width: 0; }
.rd-chat-title .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-chat-back { padding: 0 .3rem 0 0; font-size: 1.3rem; color: inherit; }
.rd-chat-msgs { flex: 1; overflow-y: auto; padding: .5rem 0 .75rem; overscroll-behavior: contain; }
.rd-chat-first { text-align: center; padding: 2rem; }
.rd-chat-day, .rd-chat-new { text-align: center; position: relative; margin: .8rem 0 .3rem; font-size: .75rem; color: var(--rd-muted); }
.rd-chat-day::before, .rd-chat-new::before { content: ""; position: absolute; left: 1rem; right: 1rem; top: 50%; border-top: 1px solid var(--rd-line); }
.rd-chat-day span, .rd-chat-new span { position: relative; background: #fff; padding: 0 .6rem; }
.rd-chat-new { color: var(--rd-red); font-weight: 600; }
.rd-chat-new::before { border-color: #e8b9b9; }
.rd-msg { display: flex; gap: .65rem; padding: .3rem 1rem; position: relative; }
.rd-msg:hover { background: #faf8f5; }
.rd-msg.joined { padding-top: .05rem; }
.rd-msg.mentioned { background: #fff7e6; }
.rd-msg-gutter { width: 2rem; flex-shrink: 0; font-size: .65rem; color: transparent; text-align: right; padding-top: .2rem; }
.rd-msg:hover .rd-msg-gutter { color: var(--rd-muted); }
.rd-msg-main { min-width: 0; flex: 1; }
.rd-msg-head { display: flex; gap: .5rem; align-items: baseline; }
.rd-msg-head strong { font-size: .88rem; }
.rd-msg-head span { font-size: .72rem; color: var(--rd-muted); }
.rd-msg-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; line-height: 1.45; }
.rd-msg.deleted .rd-msg-body { color: var(--rd-muted); }
.rd-msg-edited { font-size: .72rem; color: var(--rd-muted); }
.rd-mention { background: #f3e3e3; color: var(--rd-red-dark); border-radius: .25rem; padding: 0 .15rem; font-weight: 600; }
.rd-mention.me { background: #ffe08a; color: #4d3b00; }
.rd-msg-quote { display: block; border: 0; border-left: 3px solid #d9cfc4; background: #f6f2ed; text-align: left; font-size: .8rem; color: #57514a; padding: .2rem .5rem; margin: .1rem 0 .25rem; border-radius: 0 .3rem .3rem 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-msg-quote i { margin-right: .25rem; }
.rd-msg-files { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; }
.rd-msg-img img { max-width: min(280px, 100%); max-height: 220px; border-radius: .4rem; border: 1px solid var(--rd-line); display: block; object-fit: cover; }
.rd-msg-file { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--rd-line); border-radius: .4rem; padding: .35rem .6rem; font-size: .82rem; text-decoration: none; color: inherit; max-width: 100%; }
.rd-msg-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-msg-file small { color: var(--rd-muted); }
.rd-msg-reacts { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .25rem; }
.rd-react { border: 1px solid var(--rd-line); background: #fff; border-radius: 1rem; font-size: .8rem; padding: 0 .45rem; line-height: 1.5rem; }
.rd-react.on { background: var(--rd-red-soft); border-color: #e2b4b4; }
.rd-msg-tools { position: absolute; right: .8rem; top: -.7rem; display: none; background: #fff; border: 1px solid var(--rd-line); border-radius: .4rem; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.rd-msg:hover .rd-msg-tools, .rd-msg:focus-within .rd-msg-tools { display: flex; }
.rd-msg-tools button { border: 0; background: none; padding: .2rem .45rem; color: #5b544c; }
.rd-msg-tools button:hover { color: var(--rd-red); }
.rd-react-pick { position: absolute; right: .8rem; top: 1.2rem; z-index: 5; background: #fff; border: 1px solid var(--rd-line); border-radius: .5rem; box-shadow: 0 4px 16px rgba(0,0,0,.12); padding: .25rem; display: flex; flex-wrap: wrap; max-width: 220px; }
.rd-react-pick button { border: 0; background: none; font-size: 1.2rem; padding: .15rem .3rem; border-radius: .3rem; }
.rd-react-pick button:hover { background: #f1ede7; }
.rd-flash-msg { animation: rdFlashMsg 2s ease-out; }
@keyframes rdFlashMsg { 0%, 40% { background: #ffe9a8; } 100% { background: transparent; } }
.rd-chat-typing { min-height: 1.2rem; padding: 0 1rem; }
.rd-chat-compose { border-top: 1px solid var(--rd-line); padding: .55rem .8rem .4rem; }
.rd-chat-compose.rd-drop { background: var(--rd-red-soft); }
.rd-chat-row { display: flex; gap: .45rem; align-items: flex-end; }
.rd-chat-input { flex: 1; position: relative; }
.rd-chat-input textarea { resize: none; max-height: 220px; }
.rd-chat-mention { position: absolute; bottom: 100%; left: 0; margin-bottom: .25rem; max-height: 240px; overflow-y: auto; }
.rd-chat-attach, .rd-chat-send { flex-shrink: 0; }
.rd-chat-replying { font-size: .8rem; color: #57514a; background: #f6f2ed; border-radius: .35rem; padding: .25rem .55rem; margin-bottom: .4rem; display: flex; align-items: center; gap: .3rem; }
.rd-chat-files { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .4rem; }
.rd-chat-chip { display: inline-flex; align-items: center; gap: .35rem; background: #f1ede7; border-radius: 1rem; padding: .15rem .3rem .15rem .6rem; font-size: .8rem; max-width: 100%; }
.rd-chat-hint { margin-top: .2rem; }
.rd-chat-closednote { border-top: 1px solid var(--rd-line); padding: .7rem 1rem; }
@media (pointer: coarse) {
  .rd-chat-hint { display: none; }
  .rd-msg:hover .rd-msg-tools, .rd-msg:focus-within .rd-msg-tools { display: none; }
  .rd-msg.tools-on .rd-msg-tools { display: flex; top: -.9rem; }
  .rd-msg-tools button { padding: .35rem .6rem; font-size: 1.05rem; }
}
@media (max-width: 991.98px) {
  .rd-chat { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 6.5rem); border-radius: .4rem; }
  .rd-chat .rd-chat-main { display: none; }
  .rd-chat.rd-chat-in .rd-chat-side { display: none; }
  .rd-chat.rd-chat-in .rd-chat-main { display: flex; }
  .rd-chat-side { border-right: 0; }
}
.rd-rec-chat { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; margin: -.4rem 0 .9rem; text-decoration: none; }
.rd-rec-chat i { color: var(--rd-red); }
.rd-top-chat { position: relative; color: #fff; font-size: 1.25rem; line-height: 1; padding: .3rem .4rem; border-radius: .4rem; }
.rd-top-chat:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.rd-top-chat .rd-bell-n { box-shadow: 0 0 0 2px var(--rd-sidebar); }

/* 4.62 FBA storage reports: a small share bar */
.rd-bar { display: inline-block; height: .55rem; min-width: 1px; max-width: 60px; background: #c0534d; border-radius: 2px; opacity: .75; }
