/* ==========================================================================
   IronFit CRM — UI redesign  ("Operational Console")
   Self-contained. Everything is scoped under `.rd-body` and prefixed `rd-` so
   it cannot leak into the live app's crm.css. Ported 1:1 from the ironfit-erp
   redesign design system (reference only — no runtime dependency on the ERP).
   Delete this file + the redesign route/controllers/views/js to remove it.
   ========================================================================== */

/* --- tokens ------------------------------------------------------------- */
.rd-body {
    /* brand — kept, used sparingly */
    --rd-accent: #00b9dc;
    --rd-accent-deep: #0096b3;
    --rd-accent-ink: #066b80;
    --rd-accent-soft: #e7f8fc;
    --rd-accent-hover: #0098b6; /* primary-action hover */
    --rd-head-tint: #ebf9fd;    /* table + form/section header band */

    /* cool blue-gray console neutrals */
    --rd-ink: #0f1722;       /* headings */
    --rd-text: #283541;      /* body */
    --rd-muted: #5f6e7b;     /* secondary */
    --rd-faint: #6b7785;     /* tertiary / placeholder — darkened to clear WCAG AA */
    --rd-faintest: #97a4b0;  /* decorative only (dots, dividers) — not for text */
    --rd-line: #e7ebef;      /* hairline */
    --rd-line-2: #d6dde3;    /* stronger hairline */
    --rd-canvas: #f4f6f8;
    --rd-surface: #ffffff;
    --rd-surface-2: #fafbfc;

    /* sidebar */
    --rd-side: #14161b;
    --rd-side-2: #1c1f27;
    --rd-side-line: rgba(255,255,255,.075);
    --rd-side-text: rgba(255,255,255,.60);
    --rd-side-strong: rgba(255,255,255,.94);

    /* status */
    --rd-ok: #15a34a;   --rd-ok-soft: #e7f6ec;   --rd-ok-ink: #0f7a37;
    --rd-warn: #c2710a; --rd-warn-soft: #fbf0df; --rd-warn-ink: #8a5200;
    --rd-bad: #d92d20;  --rd-bad-soft: #fcebea;  --rd-bad-ink: #b42318;

    --rd-r-card: 8px;
    --rd-r-ctl: 6px;
    --rd-r-pill: 999px;

    /* centered single-column form width (form column + its sticky footer share this) */
    --rd-form-w: 960px;

    /* sidebar icon column — fixed so icons hold their lane across rail collapse.
       (content - slot)/2 == padx == 10px keeps the icon dead-centre of the 62px rail. */
    --rd-row-padx: 10px;
    --rd-ico-slot: 22px;

    --rd-pop: 0 10px 30px -12px rgba(15,23,34,.32), 0 0 0 1px var(--rd-line);
    --rd-bar-shadow: 0 -1px 0 var(--rd-line), 0 -10px 26px -18px rgba(15,23,34,.25);

    --rd-ff: 'Sora', system-ui, -apple-system, sans-serif;
    --rd-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

    margin: 0;
    background: var(--rd-canvas);
    color: var(--rd-text);
    font-family: var(--rd-ff);
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.rd-body *,
.rd-body *::before,
.rd-body *::after { box-sizing: border-box; }

.rd-body h1, .rd-body h2, .rd-body h3, .rd-body h4 {
    margin: 0;
    color: var(--rd-ink);
    font-weight: 600;
    line-height: 1.2;
}
.rd-body a { color: inherit; text-decoration: none; }
.rd-body button { font-family: inherit; }
.rd-mono { font-family: var(--rd-mono); font-feature-settings: "tnum" 1; }
.rd-num  { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* tiny shared label */
.rd-eyebrow {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--rd-faint);
}

/* --- shell -------------------------------------------------------------- */
/* Sidebar is fixed + content gets a matching margin, so the icon-rail can
   overlay-expand on hover WITHOUT reflowing the page. */
/* Every 100dvh below is preceded by a 100vh declaration: dvh tracks the mobile
   URL bar as it collapses (100vh does not, so the shell overflows the screen by
   the bar's height), and browsers that don't know dvh keep the vh value. */
.rd-shell { min-height: 100vh; min-height: 100dvh; }

.rd-side {
    width: 226px;
    background: var(--rd-side);
    color: var(--rd-side-text);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 40;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    padding: 14px 10px 16px;
    border-right: 1px solid #000;
    transition: width .18s ease, box-shadow .18s ease, transform .22s ease;
}
.rd-side::-webkit-scrollbar { width: 6px; }
.rd-side::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 99px; }

.rd-brand {
    display: flex; align-items: center; gap: 9px;
    /* left pad sized so the 28px logo mark centres on x=31 — the same column as
       every nav icon, so the logo doesn't shift when the rail collapses/expands. */
    padding: 4px 8px 14px 7px;
    color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .04em;
}
.rd-brand-mark {
    width: 28px; height: 28px; border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(150deg, var(--rd-accent), var(--rd-accent-deep));
    color: #fff; font-weight: 800; font-size: 14px;
    box-shadow: 0 6px 16px -8px rgba(0,185,220,.7);
}
.rd-brand-name { white-space: nowrap; }

/* nav: sectioned, collapsible, draggable — mirrors the live app's sidebar */
.rd-nav { display: flex; flex-direction: column; gap: 1px; }

.rd-nav-link {
    position: relative;
    display: flex; align-items: center; gap: 9px;
    padding: 7px 10px 7px var(--rd-row-padx); border-radius: 6px;
    color: var(--rd-side-text); font-size: 12.5px; font-weight: 500;
    transition: background .14s, color .14s;
}
.rd-nav-link .rd-ico {
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; width: var(--rd-ico-slot); transition: opacity .12s;
}
.rd-nav-link .rd-ico svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.7; fill: none; }
.rd-nav-link .rd-label-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-nav-link:hover { background: var(--rd-side-2); color: var(--rd-side-strong); }
.rd-nav-link.is-active { background: var(--rd-side-2); color: #fff; box-shadow: inset 2px 0 0 var(--rd-accent); }
.rd-nav-link.is-soon { color: rgba(255,255,255,.30); cursor: default; }
.rd-nav-link.is-soon:hover { background: transparent; color: rgba(255,255,255,.30); }
.rd-nav-top { margin-bottom: 3px; }

.rd-nav-tag, .rd-nav-soon { font-size: 8.5px; font-weight: 700; letter-spacing: .08em; padding: 1px 5px; border-radius: 99px; flex-shrink: 0; }
.rd-nav-tag { background: rgba(0,185,220,.22); color: #8fe4f5; }
.rd-nav-soon { background: rgba(255,255,255,.07); color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .1em; }

/* section group */
.rd-nav-group { display: flex; flex-direction: column; margin-top: 3px; }
/* section header = a full-bleed separator BAND: the gray that used to sit on the
   small icon tile now spans the whole sidebar width (both rail + expanded), so
   sections read as clearly divided. The -10px side margins cancel .rd-side's 10px
   padding to reach both edges; the matching +10px left padding keeps the section
   icon on the shared x=31 icon column, so nothing shifts on collapse. */
.rd-nav-section {
    position: relative; display: flex; align-items: center; gap: 0;
    margin: 0 -10px; padding-left: 10px; padding-right: 10px;
    background: rgba(255,255,255,.07); transition: background .14s;
}
.rd-nav-section:hover { background: rgba(255,255,255,.10); }
.rd-nav-section-toggle {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px;
    background: transparent; border: 0; cursor: pointer;
    padding: 5px 6px 5px var(--rd-row-padx); color: rgba(255,255,255,.34);
    font-size: 9.5px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
}
.rd-nav-section-toggle .rd-label-text { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* labels fade (not display-toggle) so they don't hard-pop while the rail width animates */
.rd-label-text { transition: opacity .15s ease; }
.rd-nav-section-toggle:hover { color: rgba(255,255,255,.62); }
.rd-caret { display: inline-flex; flex-shrink: 0; }
.rd-caret svg { width: 13px; height: 13px; transition: transform .16s; }
.rd-nav-group.is-collapsed .rd-caret svg { transform: rotate(-90deg); }
.rd-nav-group.is-collapsed .rd-nav-group-items { display: none; }
.rd-nav-group-items { display: flex; flex-direction: column; gap: 1px; padding-top: 4px; padding-bottom: 3px; }

/* drag handle — its OWN slot on the FAR RIGHT (order:2 pushes it past the toggle),
   no longer overlapping the icon column, so the grip is an easy, unambiguous grab
   target instead of fighting the icon for the pointer. Height is capped to the
   label line so it can't make a row taller expanded than collapsed (where it's
   display:none) — no vertical drift. Reveals on row hover. */
.rd-drag-handle {
    order: 2; flex-shrink: 0;
    width: var(--rd-ico-slot); height: 18px; border-radius: 5px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: grab; color: rgba(255,255,255,.32); touch-action: none;
    opacity: 0; transition: opacity .12s, color .12s, background .12s;
}
.rd-drag-handle:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.08); }
.rd-drag-handle:active { cursor: grabbing; }
.rd-nav-section:hover .rd-drag-handle { opacity: 1; }
.rd-nav-group.rd-dragging { opacity: .6; outline: 1px dashed rgba(0,185,220,.55); border-radius: 8px; background: var(--rd-side-2); }
.rd-nav-link.rd-dragging { opacity: .6; background: var(--rd-side-2); border-radius: 6px; }
/* while a drag is in progress: grabbing cursor everywhere, no text selection */
body.rd-dragging-active, body.rd-dragging-active * { cursor: grabbing !important; user-select: none !important; }

/* recent-visit close button — height capped like the pin so recent rows keep the
   same height whether or not the close button (display:none when collapsed) shows. */
.rd-recent-close {
    margin-left: auto; flex-shrink: 0; width: 20px; height: 18px;
    border: 0; background: transparent; color: rgba(255,255,255,.3);
    font-size: 15px; line-height: 1; cursor: pointer; border-radius: 5px;
    opacity: 0; transition: opacity .12s, color .12s;
}
.rd-nav-link:hover .rd-recent-close { opacity: 1; }
.rd-recent-close:hover { color: #fff; background: rgba(255,255,255,.08); }
.rd-nav-recent-empty { padding: 4px 12px 7px; font-size: 11px; color: rgba(255,255,255,.3); white-space: nowrap; transition: opacity .15s ease; }
.rd-side-foot {
    margin-top: auto; padding: 12px 6px 2px;
    display: flex; align-items: center; gap: 8px;
}
.rd-side-foot-text { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.3); }
.rd-rail-toggle {
    width: 30px; height: 30px; flex-shrink: 0; border: 0; border-radius: 7px;
    background: var(--rd-side-2); color: rgba(255,255,255,.55); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: color .14s, background .14s;
}
.rd-rail-toggle svg { width: 16px; height: 16px; transition: transform .18s ease; }
.rd-rail-toggle:hover { color: #fff; background: #2a2f3a; }

/* section icon — the section anchor: shown in BOTH states, in the same fixed x=31
   column as the item icons below it, so it never moves when the rail collapses.
   No longer a filled tile — the full-width section BAND behind it now carries the
   "this is a section header" cue (in both the rail and expanded), so the glyph just
   sits on the band, a touch brighter than the item glyphs for readability. */
.rd-nav-sec-ico {
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; width: var(--rd-ico-slot);
    color: rgba(255,255,255,.62);
    transition: opacity .12s, color .12s;
}
.rd-nav-sec-ico svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.8; fill: none; }
/* the active section's band + glyph pick up the brand accent so you can spot where
   you are at a glance, even in the collapsed rail. Excludes "Terakhir Dibuka"
   (data-rd-group="__recent"): the current page is ALWAYS in your history, so that
   section would light up permanently — a meaningless cue. History stays neutral. */
.rd-nav-group:not([data-rd-group="__recent"]):has(.rd-nav-link.is-active) .rd-nav-section {
    background: rgba(0,185,220,.14); box-shadow: inset 2px 0 0 var(--rd-accent);
}
.rd-nav-group:not([data-rd-group="__recent"]):has(.rd-nav-link.is-active) .rd-nav-sec-ico { color: #8fe4f5; }
/* and don't flag the active page's own row inside the history list either — the real
   active marker lives under its actual module section. */
[data-rd-recent] .rd-nav-link.is-active {
    background: transparent; color: var(--rd-side-text); box-shadow: none;
}

/* ---- icon-rail (auto-collapse), desktop only --------------------------- */
@media (min-width: 861px) {
    .rd-shell.is-rail .rd-side { width: 62px; }
    .rd-shell.is-rail .rd-content { margin-left: 62px; }
    /* expand as an overlay on hover / keyboard focus / forced peek (e.g. during a drag) */
    .rd-shell.is-rail .rd-side:hover,
    .rd-shell.is-rail .rd-side:focus-within,
    .rd-shell.is-rail .rd-side.is-peek { width: 226px; box-shadow: 12px 0 48px -16px rgba(0,0,0,.7); }
    /* chevrons point left ("collapse") when the sidebar is pinned open */
    .rd-shell:not(.is-rail) .rd-rail-toggle svg { transform: rotate(180deg); }

    /* collapsed look — applies only while NOT peeking */
    .rd-shell.is-rail .rd-side:not(:hover):not(:focus-within):not(.is-peek) :is(.rd-nav-tag, .rd-nav-soon, .rd-recent-close, .rd-drag-handle, .rd-caret, .rd-side-foot-text) { display: none; }
    .rd-shell.is-rail .rd-side:not(:hover):not(:focus-within):not(.is-peek) .rd-brand > span:not(.rd-brand-mark) { display: none; }
    /* labels + the empty-recent placeholder stay in layout but fade to 0 — keeping
       them in flow means the row/section heights are identical collapsed vs expanded,
       so NOTHING drifts vertically; fading + the width animation read as one motion. */
    .rd-shell.is-rail .rd-side:not(:hover):not(:focus-within):not(.is-peek) :is(.rd-label-text, .rd-nav-recent-empty) { opacity: 0; }
    /* nav rows + the logo keep their padding and the shared icon column, so NOTHING
       shifts horizontally on collapse — every glyph already sits on x=31. Only the
       foot toggle (no shared column) gets centred. */
    .rd-shell.is-rail .rd-side:not(:hover):not(:focus-within):not(.is-peek) .rd-side-foot { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
}

.rd-content { margin-left: 226px; min-width: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; transition: margin-left .18s ease; }

/* --- command bar (page header) ----------------------------------------- */
.rd-cmdbar {
    position: sticky; top: 0; z-index: 20;
    background: rgba(255,255,255,.86);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--rd-line);
    padding: 13px 24px 12px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.rd-cmdbar-title { min-width: 0; flex: 1 1 auto; }
.rd-cmdbar-crumb { font-size: 11px; color: var(--rd-faint); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-cmdbar-crumb a:hover { color: var(--rd-accent-ink); }
.rd-cmdbar h1 { font-size: 19px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* inline context "ticker" under the title */
.rd-ticker {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
    margin-top: 6px; font-size: 12px; color: var(--rd-muted);
}
.rd-ticker b { color: var(--rd-ink); font-weight: 600; }
.rd-ticker .rd-tick { display: inline-flex; align-items: center; gap: 6px; }
.rd-ticker .rd-tick + .rd-tick::before {
    content: ""; width: 3px; height: 3px; border-radius: 50%;
    background: var(--rd-line-2); margin-right: 14px;
}
.rd-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--rd-faintest); }
.rd-dot.is-ok { background: var(--rd-ok); }
.rd-dot.is-warn { background: var(--rd-warn); }
.rd-dot.is-bad { background: var(--rd-bad); }
.rd-dot.is-off { background: var(--rd-faintest); }

.rd-cmdbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* wrapper around the notif/profil/keluar cluster — flex+gap here reproduce the
   spacing the items had as direct children of .rd-cmdbar-actions. On phones the
   mobile media query hides this whole group (it moves into the drawer). */
.rd-cmdbar-util { display: flex; align-items: center; gap: 8px; }

/* Drawer account block — desktop keeps notif/profil/keluar in the command bar,
   so this is mobile-only (revealed inside the @media (max-width:860px) block). */
.rd-side-account { display: none; }

/* --- buttons ------------------------------------------------------------ */
.rd-btn {
    display: inline-flex; align-items: center; gap: 7px;
    height: 32px; padding: 0 14px;
    border-radius: var(--rd-r-ctl);
    border: 1px solid var(--rd-line-2);
    background: var(--rd-surface);
    color: var(--rd-text);
    font-size: 12px; font-weight: 600; letter-spacing: .005em;
    cursor: pointer; white-space: nowrap;
    transition: background .14s, border-color .14s, color .14s, box-shadow .14s;
}
.rd-btn svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.rd-btn:hover { border-color: var(--rd-faint); background: var(--rd-surface-2); }
.rd-btn:active { transform: translateY(.5px); }
.rd-btn.is-primary {
    /* brand-cyan fill for primary actions; darker cyan on hover. */
    background: var(--rd-accent); border-color: var(--rd-accent);
    color: #fff; box-shadow: 0 6px 14px -8px rgba(0,150,179,.55);
}
.rd-btn.is-primary:hover { background: var(--rd-accent-hover); border-color: var(--rd-accent-hover); }
.rd-btn.is-quiet { border-color: transparent; background: transparent; color: var(--rd-muted); }
.rd-btn.is-quiet:hover { background: var(--rd-canvas); color: var(--rd-ink); }
.rd-btn.is-danger { color: var(--rd-bad); border-color: var(--rd-line-2); }
.rd-btn.is-danger:hover { background: var(--rd-bad-soft); border-color: var(--rd-bad); }
.rd-btn.is-sm { height: 27px; padding: 0 10px; font-size: 11.5px; }
.rd-icon-btn {
    width: 30px; height: 30px; padding: 0; justify-content: center;
    border-radius: var(--rd-r-ctl);
}

/* --- main scroll region ------------------------------------------------- */
.rd-main { padding: 18px 24px 64px; }
/* width (not max-width): .rd-main is a flex item of the flex-column .rd-content, so
   an auto inline margin cancels the stretch and would collapse it to content width.
   A definite width fills to the cap and margin-inline:auto still centers it. */
.rd-main.is-narrow { width: min(100%, 1180px); margin-inline: auto; }

/* --- filter toolbar ----------------------------------------------------- */
.rd-toolbar {
    position: sticky; top: var(--rd-cmdh, 92px); z-index: 15;
    display: flex; align-items: center; gap: 8px;
    padding: 9px 10px;
    background: var(--rd-surface);
    border: 1px solid var(--rd-line);
    border-radius: var(--rd-r-card);
    box-shadow: 0 1px 0 rgba(15,23,34,.02);
}
.rd-search {
    position: relative; flex: 0 1 300px; min-width: 160px;
}
.rd-search svg {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    width: 15px; height: 15px; stroke: var(--rd-faint); stroke-width: 1.8; fill: none;
    pointer-events: none;
}
.rd-search input {
    width: 100%; height: 32px; padding: 0 10px 0 32px;
    border: 1px solid var(--rd-line-2); border-radius: var(--rd-r-ctl);
    background: var(--rd-surface); color: var(--rd-text);
    font-family: inherit; font-size: 12.5px;
}
.rd-search input::placeholder { color: var(--rd-faint); }

/* segmented control */
.rd-seg {
    display: inline-flex; padding: 2px;
    background: var(--rd-canvas); border: 1px solid var(--rd-line);
    border-radius: var(--rd-r-ctl);
}
.rd-seg button {
    border: 0; background: transparent; cursor: pointer;
    height: 26px; padding: 0 12px; border-radius: 4px;
    font-size: 11.5px; font-weight: 600; color: var(--rd-muted);
    transition: background .14s, color .14s, box-shadow .14s;
}
.rd-seg button.is-on {
    background: var(--rd-surface); color: var(--rd-ink);
    box-shadow: 0 1px 2px rgba(15,23,34,.12);
}

.rd-toolbar-spacer { flex: 1; }
.rd-result-count { font-size: 11.5px; color: var(--rd-muted); white-space: nowrap; }
.rd-result-count b { color: var(--rd-ink); font-weight: 600; }

/* filter popover */
.rd-pop-wrap { position: relative; }
.rd-pop-trigger.has-active { border-color: var(--rd-accent); color: var(--rd-accent-ink); }
.rd-pop-trigger .rd-pop-badge {
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
    background: var(--rd-accent-ink); color: #fff;
    font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.rd-pop {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
    width: 320px; padding: 12px;
    background: var(--rd-surface); border-radius: var(--rd-r-card);
    box-shadow: var(--rd-pop);
}
.rd-pop[hidden] { display: none; }
.rd-pop-row { margin-bottom: 10px; }
.rd-pop-row:last-of-type { margin-bottom: 0; }
.rd-pop-foot {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rd-line);
}
.rd-field-label {
    display: block; font-size: 10px; font-weight: 600; letter-spacing: .1em;
    text-transform: uppercase; color: var(--rd-muted); margin-bottom: 4px;
}
.rd-select, .rd-input {
    width: 100%; height: 32px; padding: 0 10px;
    border: 1px solid var(--rd-line-2); border-radius: var(--rd-r-ctl);
    background: var(--rd-surface); color: var(--rd-text);
    font-family: inherit; font-size: 12.5px;
}
.rd-select:disabled { background: var(--rd-canvas); color: var(--rd-faint); cursor: not-allowed; }
textarea.rd-input { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }

.rd-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--rd-text); }
.rd-check input { width: 15px; height: 15px; accent-color: var(--rd-accent); }

/* multi-select checklist filter (analytics: Sumber Prospek, Progress Pipeline) */
.rd-checklist {
    display: flex; flex-wrap: wrap; gap: 6px 16px; max-width: 420px;
    max-height: 84px; overflow-y: auto; padding: 2px 4px 2px 0;
}

/* active filter chips */
.rd-chips { display: none; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.rd-chips.is-shown { display: flex; }
.rd-chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 24px; padding: 0 6px 0 10px;
    background: var(--rd-accent-soft); color: var(--rd-accent-ink);
    border: 1px solid #cdeef6; border-radius: var(--rd-r-pill);
    font-size: 11px; font-weight: 600;
}
.rd-chip .rd-chip-k { color: var(--rd-accent-ink); font-weight: 500; }
.rd-chip button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border: 0; border-radius: 50%;
    background: transparent; color: var(--rd-accent-ink); cursor: pointer;
}
.rd-chip button:hover { background: rgba(0,150,179,.16); }
.rd-chip button svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2.2; fill: none; }
.rd-chip-clear {
    border: 0; background: transparent; cursor: pointer;
    font-size: 11px; font-weight: 600; color: var(--rd-muted);
    padding: 0 6px; height: 24px;
}
.rd-chip-clear:hover { color: var(--rd-bad); }

/* --- card / surface ----------------------------------------------------- */
.rd-card {
    background: var(--rd-surface);
    border: 1px solid var(--rd-line);
    border-radius: var(--rd-r-card);
}
.rd-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 11px 14px; border-bottom: 1px solid var(--rd-line);
    background: var(--rd-head-tint);
    border-radius: var(--rd-r-card) var(--rd-r-card) 0 0;
}
.rd-card-head h3 { font-size: 13px; }
.rd-card-pad { padding: 14px; }

/* --- table -------------------------------------------------------------- */
.rd-tablewrap { margin-top: 12px; border: 1px solid var(--rd-line); border-radius: var(--rd-r-card); background: var(--rd-surface); }
.rd-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.rd-table thead th {
    background: var(--rd-head-tint);
    text-align: left;
    font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    color: var(--rd-muted);
    padding: 9px 12px;
    border-bottom: 1px solid var(--rd-line);
    white-space: nowrap;
}
.rd-table thead th.rd-r { text-align: right; }
/* sticky header opt-in (list page only) — kept off cards so short tables
   don't detach their header. No overflow ancestor, so sticky binds to the page. */
.rd-table.is-sticky thead th { position: sticky; top: calc(var(--rd-cmdh, 92px) + 52px); z-index: 5; }
/* round the inner corners so a non-clipping wrapper still looks crisp */
.rd-tablewrap .rd-table thead th:first-child { border-top-left-radius: var(--rd-r-card); }
.rd-tablewrap .rd-table thead th:last-child { border-top-right-radius: var(--rd-r-card); }
.rd-tablewrap .rd-table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--rd-r-card); }
.rd-tablewrap .rd-table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--rd-r-card); }
.rd-table tbody td {
    padding: 9px 12px; border-bottom: 1px solid var(--rd-line);
    color: var(--rd-text); font-size: 12.5px; vertical-align: middle;
}
.rd-table tbody tr:last-child td { border-bottom: 0; }
.rd-table tbody tr { position: relative; }
.rd-table tbody tr:hover td { background: #f7fcfe; }
.rd-table tbody td.rd-r { text-align: right; }
/* footer total row — share the body cells' padding + right-alignment so the
   totals line up under their column headers (without this, tfoot .rd-r falls
   back to left-align and every total drifts a column left). */
.rd-table tfoot td { padding: 9px 12px; vertical-align: middle; }
.rd-table tfoot td.rd-r { text-align: right; }

/* name cell with mono sku caption */
.rd-name { display: flex; align-items: center; gap: 10px; }
.rd-name .rd-name-main { min-width: 0; }
.rd-name .rd-name-t { font-weight: 600; color: var(--rd-ink); font-size: 12.5px; line-height: 1.25; }
.rd-name .rd-name-sku {
    font-family: var(--rd-mono); font-size: 10.5px; color: var(--rd-faint);
    letter-spacing: -.01em; margin-top: 1px;
}

/* the signature: stock-level meter */
.rd-stock { display: inline-flex; align-items: center; gap: 9px; justify-content: flex-end; white-space: nowrap; }
.rd-stock .rd-stock-n { font-family: var(--rd-mono); font-size: 12px; color: var(--rd-ink); min-width: 38px; text-align: right; }
.rd-meter { width: 52px; height: 5px; border-radius: 99px; background: var(--rd-line); overflow: hidden; }
.rd-meter span { display: block; height: 100%; border-radius: 99px; background: var(--rd-ok); }
.rd-meter.is-warn span { background: var(--rd-warn); }
.rd-meter.is-bad span { background: var(--rd-bad); }

.rd-price { font-family: var(--rd-mono); font-size: 12px; color: var(--rd-ink); white-space: nowrap; }

/* status / level pills */
.rd-pill {
    display: inline-flex; align-items: center; gap: 5px;
    height: 19px; padding: 0 8px; border-radius: var(--rd-r-pill);
    font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    background: var(--rd-canvas); color: var(--rd-muted);
}
.rd-pill.is-ok { background: var(--rd-ok-soft); color: var(--rd-ok-ink); }
.rd-pill.is-warn { background: var(--rd-warn-soft); color: var(--rd-warn-ink); }
.rd-pill.is-bad { background: var(--rd-bad-soft); color: var(--rd-bad-ink); }
.rd-pill.is-off { background: var(--rd-canvas); color: var(--rd-muted); }

/* Global flash banner (session status/error), rendered by the layout above page content. */
.rd-flash {
    margin-bottom: 16px; padding: 11px 14px; border-radius: 10px;
    font-size: 13px; font-weight: 500;
    border: 1px solid var(--rd-ok); background: var(--rd-ok-soft); color: var(--rd-ok-ink);
}
.rd-flash.is-error { border-color: var(--rd-bad); background: var(--rd-bad-soft); color: var(--rd-bad-ink); }

.rd-tag {
    display: inline-flex; align-items: center; height: 18px; padding: 0 8px;
    border-radius: var(--rd-r-pill); font-size: 10px; font-weight: 600; color: #fff;
}

.rd-muted { color: var(--rd-faint); }
.rd-rowmenu { color: var(--rd-faint); }
.rd-rowmenu:hover { color: var(--rd-ink); }

.rd-empty { padding: 40px 16px; text-align: center; color: var(--rd-faint); font-size: 12.5px; }

/* table footer */
.rd-tfoot {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 12px; font-size: 12px; color: var(--rd-muted);
}
.rd-pager { display: inline-flex; gap: 4px; }
.rd-pager a, .rd-pager span {
    min-width: 28px; height: 28px; padding: 0 8px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--rd-line); border-radius: var(--rd-r-ctl);
    font-size: 12px; color: var(--rd-text); background: var(--rd-surface);
}
.rd-pager .is-on { background: var(--rd-accent-ink); border-color: var(--rd-accent-ink); color: #fff; }
.rd-pager .is-mute { color: var(--rd-faint); pointer-events: none; }

/* Server-rendered Laravel paginator wrapper. The redesign shell loads no Tailwind,
   so links()'s default Tailwind markup is functional but visually plain — a custom
   rd-styled paginator view is a reasonable follow-up. This just gives it spacing. */
.rd-pagination { margin-top: 12px; font-size: 12px; }
.rd-pagination a, .rd-pagination button { color: var(--rd-accent-ink); }
.rd-pagination svg { display: inline; width: 16px; height: 16px; vertical-align: middle; }

/* The self-contained redesign paginator (partials/pagination.blade.php). Its
   children are already .rd-btn, so this rule only lays them out — it must NOT
   restyle bare a/span the way .rd-pager does, or it would fight .rd-btn. Wraps
   so the "‹ Sebelumnya … Berikutnya ›" run reflows onto a phone instead of
   pushing the page sideways. */
.rd-pagenav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }

/* ==========================================================================
   Detail page
   ========================================================================== */
.rd-hero {
    background: var(--rd-surface);
    border: 1px solid var(--rd-line);
    border-radius: var(--rd-r-card);
    padding: 16px 18px;
}
.rd-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.rd-hero h2 { font-size: 21px; letter-spacing: -.01em; }
.rd-hero-sku { font-family: var(--rd-mono); font-size: 12px; color: var(--rd-muted); margin-top: 3px; }
.rd-hero-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 12px; color: var(--rd-muted); }
.rd-hero-facts b { color: var(--rd-text); font-weight: 600; }
.rd-hero-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* stat strip */
.rd-stats {
    display: grid; grid-template-columns: repeat(4, 1fr);
    margin-top: 16px; border: 1px solid var(--rd-line); border-radius: var(--rd-r-card);
    overflow: hidden;
}
.rd-stat { padding: 12px 14px; border-right: 1px solid var(--rd-line); background: var(--rd-surface); }
.rd-stat:last-child { border-right: 0; }
.rd-stat .rd-stat-l { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--rd-faint); }
.rd-stat .rd-stat-v { margin-top: 6px; font-size: 23px; font-weight: 600; color: var(--rd-ink); font-variant-numeric: tabular-nums; line-height: 1; }
.rd-stat .rd-stat-v small { font-size: 12px; font-weight: 600; color: var(--rd-muted); }
.rd-stat .rd-stat-s { margin-top: 5px; font-size: 11px; color: var(--rd-muted); }

.rd-grid2 { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(0,1fr); gap: 14px; margin-top: 14px; }

/* definition list */
.rd-dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; }
.rd-dl dt { font-size: 11px; color: var(--rd-faint); letter-spacing: .04em; }
.rd-dl dd { margin: 0; color: var(--rd-text); font-size: 12.5px; text-align: right; }

/* warehouse mini rows */
.rd-whrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rd-line); }
.rd-whrow:last-child { border-bottom: 0; }
.rd-whrow .rd-wh-name { font-size: 12.5px; color: var(--rd-text); }
.rd-whrow .rd-wh-sub { font-size: 10.5px; color: var(--rd-faint); margin-top: 1px; }

/* movements timeline */
.rd-tl { position: relative; padding-left: 18px; }
.rd-tl::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1.5px; background: var(--rd-line); }
.rd-tl-item { position: relative; padding: 0 0 14px; }
.rd-tl-item:last-child { padding-bottom: 0; }
.rd-tl-item::before {
    content: ""; position: absolute; left: -16px; top: 4px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--rd-surface); border: 2px solid var(--rd-faint);
}
.rd-tl-item.is-in::before { border-color: var(--rd-ok); }
.rd-tl-item.is-out::before { border-color: var(--rd-bad); }
.rd-tl-item.is-adjust::before { border-color: var(--rd-warn); }
.rd-tl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rd-tl-t { font-size: 12.5px; color: var(--rd-ink); font-weight: 600; }
.rd-tl-q { font-family: var(--rd-mono); font-size: 12px; }
.rd-tl-q.is-pos { color: var(--rd-ok-ink); }
.rd-tl-q.is-neg { color: var(--rd-bad-ink); }
.rd-tl-sub { font-size: 11px; color: var(--rd-faint); margin-top: 2px; }

/* ==========================================================================
   Form page
   ========================================================================== */
.rd-formgrid { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 18px; align-items: start; }
/* Single-column variant for simple forms that have no summary rail (Tags/Brands/etc.) —
   avoids the dead 320px gutter left by the two-column default. */
/* width (not just max-width) is required: this sits in a flex column, and an auto
   cross-axis margin cancels the flex stretch that would otherwise fill to max-width —
   so an unstretched item collapses to content width. A definite width fills to the
   token and margin-inline:auto still centers it. */
.rd-formgrid.is-single { grid-template-columns: minmax(0,1fr); width: min(100%, var(--rd-form-w)); margin-inline: auto; }
.rd-form-col { display: flex; flex-direction: column; gap: 14px; }

.rd-section { background: var(--rd-surface); border: 1px solid var(--rd-line); border-radius: var(--rd-r-card); }
.rd-section-head { padding: 12px 16px 11px; border-bottom: 1px solid var(--rd-line); background: var(--rd-head-tint); border-radius: var(--rd-r-card) var(--rd-r-card) 0 0; }
.rd-section-head h3 { font-size: 13px; }
.rd-section-head p { margin: 2px 0 0; font-size: 11.5px; color: var(--rd-faint); }
.rd-section-body { padding: 14px 16px; }

.rd-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.rd-field { display: flex; flex-direction: column; }
.rd-field.is-full { grid-column: 1 / -1; }
.rd-field > label {
    font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
    color: var(--rd-muted); margin-bottom: 4px;
}
.rd-field > label .rd-req { color: var(--rd-bad); margin-left: 2px; }
.rd-field .rd-hint { font-size: 10.5px; color: var(--rd-faint); margin-top: 4px; line-height: 1.45; }
.rd-input:focus, .rd-select:focus, .rd-search input:focus {
    outline: none; border-color: var(--rd-accent);
    box-shadow: 0 0 0 3px rgba(0,185,220,.16);
}

/* sticky summary rail */
.rd-rail { position: sticky; top: calc(var(--rd-cmdh, 84px) + 8px); display: flex; flex-direction: column; gap: 14px; }
.rd-rail .rd-card-pad { padding: 14px 16px; }
.rd-sku-preview {
    font-family: var(--rd-mono); font-size: 15px; color: var(--rd-ink);
    background: var(--rd-canvas); border: 1px dashed var(--rd-line-2);
    border-radius: var(--rd-r-ctl); padding: 10px 12px; word-break: break-all;
}
.rd-sku-preview .rd-sku-empty { color: var(--rd-faint); }
.rd-rail-note { font-size: 11.5px; color: var(--rd-muted); line-height: 1.5; }

/* sticky action bar.
   The content row (note + buttons) stays inside the narrow form column, but the
   bar's background must bleed edge-to-edge across the full content area. We paint
   it with a full-bleed ::before (width:100vw) and clip the overflow on the page
   that actually has an action bar — `clip` (not `hidden`) so the sticky cmdbar /
   action bar stay anchored to the viewport instead of a new scroll container. */
.rd-content:has(.rd-actionbar) { overflow-x: clip; }
.rd-actionbar {
    position: sticky; bottom: 0; z-index: 18;
    margin: auto -24px -64px;  /* margin-top:auto pins the bar to the bottom on short forms */
    padding: 12px 24px;
    display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    /* .rd-btn is white-space:nowrap, so without wrap a 3-button bar pushes the page
       sideways on a phone instead of stacking. */
    flex-wrap: wrap;
}
.rd-actionbar::before {
    /* full-bleed background centered on the bar, so it spans the viewport even when
       the content column is centered (no gap on the left gutter). */
    content: ""; position: absolute; top: 0; bottom: 0; left: 50%; margin-left: -50vw;
    width: 100vw; z-index: -1;
    background: rgba(255,255,255,.9);
    backdrop-filter: saturate(1.4) blur(8px);
    border-top: 1px solid var(--rd-line);
    box-shadow: var(--rd-bar-shadow);
}
.rd-actionbar .rd-ab-note { margin-right: auto; font-size: 11.5px; color: var(--rd-faint); }
/* Footer content constrained to the centered form column width, so the buttons line
   up with the form's right edge instead of the full-bleed bar's edge. Matches the
   .rd-formgrid.is-single max-width. */
.rd-actionbar-inner { display: flex; align-items: center; gap: 8px; justify-content: flex-end; width: 100%; max-width: var(--rd-form-w); margin-inline: auto; flex-wrap: wrap; }
/* Only on pages with an action bar: let the form fill the content column so the bar
   sits at the bottom of the viewport on short forms (and scrolls naturally on tall ones). */
.rd-main:has(.rd-actionbar) { flex: 1; display: flex; flex-direction: column; }
.rd-main:has(.rd-actionbar) > form { flex: 1; display: flex; flex-direction: column; }

/* prototype ribbon */
.rd-proto {
    display: inline-flex; align-items: center; gap: 6px;
    height: 20px; padding: 0 9px; border-radius: var(--rd-r-pill);
    background: #fff4d6; color: #8a5a00; border: 1px solid #f3d98a;
    font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}

/* non-sticky footer for a section that owns its own independent <form> —
   unlike .rd-actionbar (page-level, sticky, exactly one per page), a page can
   stack several of these (profile info / password / preferences). */
.rd-section-actions {
    display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rd-line);
}

/* ==========================================================================
   Profile hero (Profil Saya)
   ========================================================================== */
.rd-profile-hero .rd-section-body {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.rd-avatar-lg {
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(150deg, var(--rd-accent), var(--rd-accent-deep));
    color: #fff; font-weight: 700; font-size: 24px;
}
.rd-profile-id { min-width: 0; }
.rd-profile-id h2 { margin: 0; font-size: 19px; }
.rd-profile-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
    margin-top: 6px; font-size: 12px; color: var(--rd-muted);
}
.rd-profile-meta .rd-meta-item { display: inline-flex; align-items: center; gap: 5px; }
.rd-profile-meta svg { width: 13px; height: 13px; stroke: var(--rd-faint); flex-shrink: 0; }

/* toggle switch */
.rd-switch { display: inline-flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.rd-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.rd-switch-track {
    position: relative; flex-shrink: 0; width: 38px; height: 22px; border-radius: 999px;
    background: var(--rd-line-2); transition: background .15s ease; margin-top: 1px;
}
.rd-switch-track::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15,23,34,.25);
    transition: transform .15s ease;
}
.rd-switch input:checked + .rd-switch-track { background: var(--rd-accent); }
.rd-switch input:checked + .rd-switch-track::after { transform: translateX(16px); }
.rd-switch input:focus-visible + .rd-switch-track { box-shadow: 0 0 0 3px rgba(0,185,220,.22); }
.rd-switch-copy { font-size: 12.5px; color: var(--rd-text); }
.rd-switch-copy b { display: block; font-size: 13px; color: var(--rd-ink); margin-bottom: 2px; }

/* Akses Cepat checklist (Profil Saya) */
.rd-quick-picker { display: flex; flex-wrap: wrap; gap: 20px 36px; }
.rd-quick-group { display: flex; flex-direction: column; gap: 9px; min-width: 150px; }
.rd-quick-group-label {
    font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
    color: var(--rd-faint); margin-bottom: 1px;
}

/* ==========================================================================
   PEMBELIAN (Purchasing) module additions
   ========================================================================== */

/* --- KPI stat strip variant with accent feature tile -------------------- */
.rd-stat.is-feature { background: linear-gradient(180deg, #fbfeff, #f1fbfd); }
.rd-stat.is-feature .rd-stat-v { color: var(--rd-accent-ink); }
.rd-stat-v.is-money { font-size: 18px; }
.rd-stat-v.is-money small { font-size: 11px; }

/* --- pipeline board (overview hero) ------------------------------------- */
.rd-pipe {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    margin-top: 16px;
}
.rd-lane {
    position: relative;
    background: var(--rd-surface); border: 1px solid var(--rd-line);
    border-radius: var(--rd-r-card); padding: 14px 14px 12px;
    display: flex; flex-direction: column; min-height: 132px;
    transition: border-color .14s, box-shadow .14s, transform .14s;
}
.rd-lane:hover { border-color: var(--rd-line-2); box-shadow: 0 8px 22px -16px rgba(15,23,34,.4); transform: translateY(-1px); }
.rd-lane::after {
    content: ""; position: absolute; right: -8px; top: 50%; z-index: 2;
    width: 16px; height: 16px; transform: translateY(-50%) rotate(45deg);
    border-top: 1px solid var(--rd-line); border-right: 1px solid var(--rd-line);
    background: var(--rd-canvas);
}
.rd-pipe .rd-lane:last-child::after { display: none; }
.rd-lane-stage { font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--rd-accent-ink); }
.rd-lane-label { margin-top: 3px; font-size: 14px; font-weight: 600; color: var(--rd-ink); }
.rd-lane-sub { font-size: 11px; color: var(--rd-faint); margin-top: 1px; }
.rd-lane-count { margin-top: auto; font-size: 30px; font-weight: 700; color: var(--rd-ink); line-height: 1; font-variant-numeric: tabular-nums; }
.rd-lane-count small { font-size: 12px; font-weight: 600; color: var(--rd-muted); }
.rd-lane-val { margin-top: 5px; font-size: 11.5px; color: var(--rd-muted); }
.rd-lane-val b { color: var(--rd-text); font-weight: 600; font-family: var(--rd-mono); }

/* --- warehouse pipeline: delivery schedule + 4-stage operational board --- */

/* label band above the operational board */
.rd-board-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 22px 2px 12px; }
.rd-board-head h2 { font-size: 14.5px; font-weight: 600; color: var(--rd-ink); }
.rd-board-head .rd-board-sub { font-size: 11.5px; color: var(--rd-muted); }

/* delivery schedule — date-spined agenda (top zone) */
.rd-agenda { display: flex; flex-direction: column; }
.rd-agenda-day { display: grid; grid-template-columns: 60px minmax(0,1fr); gap: 16px; padding: 13px 14px; border-bottom: 1px solid var(--rd-line); }
.rd-agenda-day:last-child { border-bottom: 0; }
.rd-agenda-day.is-today { background: var(--rd-accent-soft); }
.rd-date { text-align: center; padding-top: 2px; }
.rd-date-num { font-size: 25px; font-weight: 700; color: var(--rd-ink); line-height: 1; font-variant-numeric: tabular-nums; }
.rd-date.is-today .rd-date-num { color: var(--rd-accent-ink); }
.rd-date-mon { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--rd-faint); margin-top: 4px; }
.rd-date-dow { font-size: 10.5px; color: var(--rd-muted); margin-top: 1px; }
.rd-date-tag { display: inline-block; margin-top: 6px; font-size: 8.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--rd-accent-ink); }
.rd-agenda-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* one scheduled trip */
.rd-trip { display: flex; align-items: center; gap: 13px; padding: 9px 12px; border: 1px solid var(--rd-line); border-radius: var(--rd-r-ctl); background: var(--rd-surface); transition: border-color .14s; }
.rd-trip:hover { border-color: var(--rd-line-2); }
.rd-trip-time { font-family: var(--rd-mono); font-size: 11.5px; color: var(--rd-muted); width: 46px; flex-shrink: 0; text-align: center; }
.rd-trip-main { min-width: 0; flex: 1; }
.rd-trip-t { font-size: 12.5px; color: var(--rd-text); }
.rd-trip-t b { color: var(--rd-ink); font-weight: 600; }
.rd-trip-sub { display: flex; flex-wrap: wrap; gap: 1px 12px; margin-top: 2px; font-size: 11px; color: var(--rd-faint); }
.rd-trip-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* the 4-stage operational board */
/* The pipeline board's column count is data-driven (one per stage), so the page
   passes it in as --rd-board-cols rather than as an inline grid-template-columns
   — an inline declaration would outrank the responsive rules below and keep the
   board multi-column on a phone. */
.rd-board { display: grid; grid-template-columns: var(--rd-board-cols, repeat(4, minmax(0,1fr))); gap: 14px; align-items: start; }
.rd-col { position: relative; display: flex; flex-direction: column; background: var(--rd-surface-2); border: 1px solid var(--rd-line); border-radius: var(--rd-r-card); }
/* connective flow chevron between lanes — reads the board left-to-right */
.rd-board .rd-col::after {
    content: ""; position: absolute; right: -8px; top: 24px; z-index: 2;
    width: 13px; height: 13px; transform: translateY(-50%) rotate(45deg);
    border-top: 1px solid var(--rd-line-2); border-right: 1px solid var(--rd-line-2);
    background: var(--rd-canvas);
}
.rd-board .rd-col:last-child::after { display: none; }
.rd-col-head { padding: 10px 12px; background: var(--rd-surface); border-bottom: 1px solid var(--rd-line); border-top: 2px solid var(--rd-faintest); border-radius: var(--rd-r-card) var(--rd-r-card) 0 0; }
.rd-col-stage { font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--rd-faint); }
.rd-col-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; }
.rd-col-title h3 { font-size: 13px; font-weight: 600; }
.rd-col-n { font-family: var(--rd-mono); font-size: 11.5px; font-weight: 600; color: var(--rd-muted); background: var(--rd-canvas); border-radius: var(--rd-r-pill); padding: 1px 9px; }
.rd-col-body { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.rd-col-empty { padding: 20px 10px; text-align: center; font-size: 11px; color: var(--rd-faint); }

/* stage tones — Akan Datang stays calm slate (inbound supply); the outbound
   lanes progress accent → warn → ok */
.rd-col.is-plan  .rd-col-head { border-top-color: var(--rd-accent); }
.rd-col.is-plan  .rd-col-stage { color: var(--rd-accent-ink); }
.rd-col.is-inden .rd-col-head { border-top-color: var(--rd-warn); }
.rd-col.is-inden .rd-col-stage { color: var(--rd-warn-ink); }
.rd-col.is-ready .rd-col-head { border-top-color: var(--rd-ok); }
.rd-col.is-ready .rd-col-stage { color: var(--rd-ok-ink); }

/* ── parked lanes — Dibatalkan / Ditunda ────────────────────────────────────
   Off-pipeline: hidden until the board's checkboxes reveal them, and without
   the flow chevron, because nothing flows *through* a parked lane.
   .rd-col sets display:flex, which outranks the UA [hidden] rule — hence the
   explicit one, without which hiding a lane would do nothing. */
.rd-col[hidden] { display: none; }
.rd-board .rd-col.is-parked::after { display: none; }
.rd-col.is-cancel .rd-col-head { border-top-color: var(--rd-bad); }
.rd-col.is-cancel .rd-col-stage { color: var(--rd-bad-ink); }
.rd-col.is-hold .rd-col-head { border-top-color: var(--rd-warn); }
.rd-col.is-hold .rd-col-stage { color: var(--rd-warn-ink); }
.rd-parked-more { display: block; padding: 6px 4px 0; text-align: center; font-size: 11px; color: var(--rd-muted); }
.rd-parked-more:hover { color: var(--rd-accent-ink); text-decoration: underline; }

/* drop zones above the board — always live targets, and lit while a drag is in
   flight so the rep can see where a card can go without hunting for it */
.rd-parkbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 2px 14px; }
.rd-parkzone {
    flex: 0 1 250px; padding: 9px 11px 10px;
    background: var(--rd-surface-2); border: 1px solid var(--rd-line); border-radius: var(--rd-r-card);
}
.rd-parkzone-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rd-parkzone-title { font-size: 11.5px; font-weight: 600; }
.rd-parkzone-head .rd-check { font-size: 11px; color: var(--rd-muted); }
.rd-parkzone.is-cancel .rd-parkzone-title { color: var(--rd-bad-ink); }
.rd-parkzone.is-hold .rd-parkzone-title { color: var(--rd-warn-ink); }
.rd-parkzone-drop {
    margin-top: 8px; padding: 11px 8px; min-height: 42px;
    display: flex; align-items: center; justify-content: center;
    border: 1px dashed var(--rd-line-2); border-radius: var(--rd-r-ctl);
    font-size: 11px; color: var(--rd-faint); text-align: center;
    transition: border-color .14s, background .14s, color .14s;
}
.rd-parkbar.is-armed .rd-parkzone.is-cancel .rd-parkzone-drop {
    border-color: var(--rd-bad); background: var(--rd-bad-soft); color: var(--rd-bad-ink);
}
.rd-parkbar.is-armed .rd-parkzone.is-hold .rd-parkzone-drop {
    border-color: var(--rd-warn); background: var(--rd-warn-soft); color: var(--rd-warn-ink);
}

/* ── modal ──────────────────────────────────────────────────────────────────
   The redesign UI otherwise confirms with window.confirm(). This exists because
   parking a prospect has to collect a reason, and a native dialog cannot hold a
   textarea. z-index clears the mobile drawer (80) and its backdrop (70). */
.rd-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 18px; }
.rd-modal[hidden] { display: none; }
.rd-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 34, .45); }
.rd-modal-card {
    position: relative; width: 100%; max-width: 420px; padding: 18px;
    background: var(--rd-surface); border: 1px solid var(--rd-line); border-radius: var(--rd-r-card);
    box-shadow: 0 24px 60px -24px rgba(15, 23, 34, .55);
}
.rd-modal-title { font-size: 15px; font-weight: 600; color: var(--rd-ink); }
.rd-modal-sub { margin-top: 3px; font-size: 12.5px; color: var(--rd-muted); }
.rd-modal-body { margin-top: 14px; }
.rd-modal-body[hidden] { display: none; }
.rd-modal-body textarea.rd-input { resize: vertical; min-height: 72px; line-height: 1.5; }
.rd-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
body.rd-modal-open { overflow: hidden; }

/* a card inside a lane */
.rd-mini { background: var(--rd-surface); border: 1px solid var(--rd-line); border-radius: var(--rd-r-ctl); padding: 9px 11px; transition: border-color .14s, box-shadow .14s; }
.rd-mini:hover { border-color: var(--rd-line-2); box-shadow: 0 6px 16px -14px rgba(15,23,34,.45); }
.rd-mini-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.rd-mini-no { font-family: var(--rd-mono); font-size: 11.5px; font-weight: 600; color: var(--rd-ink); }
.rd-mini-cust { font-size: 11px; color: var(--rd-muted); margin-top: 2px; line-height: 1.35; }
.rd-mini-sku { font-family: var(--rd-mono); font-size: 10.5px; color: var(--rd-faint); margin-top: 4px; }
.rd-mini-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.rd-mini-val { font-family: var(--rd-mono); font-size: 11.5px; font-weight: 600; color: var(--rd-ink); }
.rd-mini-meta { font-size: 10.5px; color: var(--rd-faint); }
.rd-mini-note { display: flex; align-items: center; gap: 5px; margin-top: 7px; font-size: 10.5px; color: var(--rd-muted); }
.rd-mini-note svg { width: 12px; height: 12px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; }
.rd-mini-note.is-ok { color: var(--rd-ok-ink); }
.rd-mini-note.is-faint { color: var(--rd-faint); }
.rd-eta { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: var(--rd-r-pill); background: var(--rd-canvas); color: var(--rd-muted); font-family: var(--rd-mono); font-size: 10px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.rd-qty { font-family: var(--rd-mono); font-size: 11px; color: var(--rd-muted); }

/* --- the signature: DP / balance payment split bar ---------------------- */
.rd-split { display: flex; flex-direction: column; gap: 7px; }
.rd-split-track {
    display: flex; height: 8px; border-radius: 99px; overflow: hidden;
    background: var(--rd-line);
}
.rd-split-track > span { display: block; height: 100%; }
.rd-split-track > span.is-dp { background: var(--rd-accent); }
.rd-split-track > span.is-paid { background: var(--rd-ok); }
.rd-split-track > span.is-due { background: var(--rd-warn); }
.rd-split-track > span.is-due.is-overdue { background: var(--rd-bad); }
.rd-split-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11px; color: var(--rd-muted); }
.rd-split-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rd-split-legend i { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.rd-split-legend i.is-dp { background: var(--rd-accent); }
.rd-split-legend i.is-paid { background: var(--rd-ok); }
.rd-split-legend i.is-due { background: var(--rd-warn); }
.rd-split-legend i.is-due.is-overdue { background: var(--rd-bad); }
.rd-split-legend b { color: var(--rd-ink); font-weight: 600; font-family: var(--rd-mono); }

/* compact inline split for table cells */
.rd-split.is-inline { flex-direction: row; align-items: center; gap: 9px; justify-content: flex-end; }
.rd-split.is-inline .rd-split-track { width: 72px; flex-shrink: 0; }
.rd-split.is-inline.is-tri .rd-split-track { width: 104px; }  /* 3-segment (commercial) needs more room */
.rd-split-pct { font-family: var(--rd-mono); font-size: 11.5px; color: var(--rd-muted); min-width: 30px; text-align: right; }

/* --- lifecycle stepper -------------------------------------------------- */
.rd-steps { display: flex; padding: 4px 6px 2px; margin: 0; list-style: none; }
.rd-step { flex: 1; position: relative; text-align: center; min-width: 0; }
.rd-step::before {
    content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 2px;
    background: var(--rd-line-2); z-index: 0;
}
.rd-step:first-child::before { display: none; }
.rd-step.is-done::before, .rd-step.is-current::before { background: var(--rd-accent); }
.rd-step-dot {
    position: relative; z-index: 1; margin: 0 auto;
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--rd-surface); border: 2px solid var(--rd-line-2);
    font-size: 10px; font-weight: 700; color: var(--rd-faint);
    font-variant-numeric: tabular-nums;
}
.rd-step-dot svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3; fill: none; }
.rd-step.is-done .rd-step-dot { background: var(--rd-accent); border-color: var(--rd-accent); color: #fff; }
.rd-step.is-current .rd-step-dot { border-color: var(--rd-accent); color: var(--rd-accent-ink); box-shadow: 0 0 0 4px rgba(0,185,220,.14); }
.rd-step-label { margin-top: 8px; font-size: 11px; color: var(--rd-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-step.is-current .rd-step-label { color: var(--rd-ink); font-weight: 600; }
.rd-step.is-done .rd-step-label { color: var(--rd-muted); }
.rd-steps-cancelled {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px;
    background: var(--rd-bad-soft); border-radius: var(--rd-r-ctl);
    color: var(--rd-bad-ink); font-size: 12.5px; font-weight: 600;
}

/* --- supplier avatar ---------------------------------------------------- */
.rd-ava {
    width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; letter-spacing: .02em;
    background: var(--rd-accent-soft); color: var(--rd-accent-ink);
}
.rd-ava.is-import { background: #efeafe; color: #6536c7; }
.rd-ava.is-lg { width: 44px; height: 44px; border-radius: 10px; font-size: 15px; }

/* --- attention list (overview) ------------------------------------------ */
.rd-attn-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--rd-line); }
.rd-attn-row:last-child { border-bottom: 0; }
.rd-attn-row:hover { background: #f7fcfe; }
.rd-attn-ic {
    width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.rd-attn-ic svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.9; fill: none; }
.rd-attn-ic.is-bad { background: var(--rd-bad-soft); color: var(--rd-bad-ink); }
.rd-attn-ic.is-warn { background: var(--rd-warn-soft); color: var(--rd-warn-ink); }
.rd-attn-ic.is-mute { background: var(--rd-canvas); color: var(--rd-muted); }
.rd-attn-main { min-width: 0; flex: 1; }
.rd-attn-t { font-size: 12.5px; font-weight: 600; color: var(--rd-ink); }
.rd-attn-t .rd-attn-no { font-family: var(--rd-mono); font-size: 11px; color: var(--rd-accent-ink); margin-left: 6px; }
.rd-attn-sub { font-size: 11px; color: var(--rd-faint); margin-top: 1px; }
.rd-attn-amt { font-family: var(--rd-mono); font-size: 12px; color: var(--rd-ink); white-space: nowrap; }
.rd-empty-soft { padding: 26px 14px; text-align: center; color: var(--rd-faint); font-size: 12px; }

/* --- document trail (cross-pipeline links) ------------------------------ */
.rd-trail { position: relative; padding-left: 20px; }
.rd-trail::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1.5px; background: var(--rd-line); }
.rd-trail-item { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; }
.rd-trail-item::before {
    content: ""; position: absolute; left: -18px; top: 12px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--rd-surface); border: 2px solid var(--rd-accent);
}
.rd-trail-item.is-self::before { background: var(--rd-accent); }
.rd-trail-l { min-width: 0; }
.rd-trail-type { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rd-faint); }
.rd-trail-no { font-family: var(--rd-mono); font-size: 12px; color: var(--rd-ink); }
.rd-trail-no a:hover { color: var(--rd-accent-ink); }
.rd-trail-self { font-family: var(--rd-mono); font-size: 12px; color: var(--rd-ink); font-weight: 600; }

/* --- editable line table (forms) ---------------------------------------- */
.rd-table td.rd-cellpad { padding: 6px 8px; }
.rd-cellinput {
    width: 100%; height: 28px; padding: 0 8px;
    border: 1px solid var(--rd-line-2); border-radius: 5px;
    background: var(--rd-surface); color: var(--rd-text);
    font-family: inherit; font-size: 12px;
}
.rd-cellinput.rd-num-input { text-align: right; font-family: var(--rd-mono); }
.rd-cellinput:focus { outline: none; border-color: var(--rd-accent); box-shadow: 0 0 0 3px rgba(0,185,220,.16); }
.rd-cellinput::placeholder { color: var(--rd-faint); }
.rd-cell-amt { font-family: var(--rd-mono); font-size: 12px; color: var(--rd-ink); white-space: nowrap; }
.rd-line-del {
    width: 26px; height: 26px; padding: 0; border: 0; border-radius: 5px;
    background: transparent; color: var(--rd-faint); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.rd-line-del:hover { background: var(--rd-bad-soft); color: var(--rd-bad); }
.rd-line-del svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
.rd-line-add {
    display: inline-flex; align-items: center; gap: 7px;
    margin: 10px 0 0; padding: 7px 12px;
    border: 1px dashed var(--rd-line-2); border-radius: var(--rd-r-ctl);
    background: var(--rd-surface-2); color: var(--rd-accent-ink);
    font-size: 12px; font-weight: 600; cursor: pointer; width: 100%;
    justify-content: center; transition: border-color .14s, background .14s;
}
.rd-line-add:hover { border-color: var(--rd-accent-ink); background: var(--rd-accent-soft); }
.rd-line-add svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none; }

/* source-pull picker rows (proforma/commercial/PL create) */
.rd-pick { display: flex; flex-direction: column; gap: 8px; }
.rd-pick-row {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px;
    border: 1px solid var(--rd-line); border-radius: var(--rd-r-ctl);
    background: var(--rd-surface); transition: border-color .14s, background .14s;
}
.rd-pick-row:has(input:checked) { border-color: var(--rd-accent); background: var(--rd-accent-soft); }
.rd-pick-row input { width: 16px; height: 16px; accent-color: var(--rd-accent); flex-shrink: 0; }
.rd-pick-main { flex: 1; min-width: 0; }
.rd-pick-no { font-family: var(--rd-mono); font-size: 12.5px; color: var(--rd-ink); font-weight: 600; }
.rd-pick-sub { font-size: 11px; color: var(--rd-faint); margin-top: 1px; }
.rd-pick-amt { font-family: var(--rd-mono); font-size: 12.5px; color: var(--rd-ink); white-space: nowrap; }

/* --- form totals panel (rail) ------------------------------------------- */
.rd-totals { display: flex; flex-direction: column; }
.rd-totals-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rd-line); font-size: 12.5px; color: var(--rd-muted); }
.rd-totals-row .v { font-family: var(--rd-mono); font-size: 12.5px; color: var(--rd-text); }
.rd-totals-row.is-accent .v { color: var(--rd-accent-ink); }
.rd-totals-row.is-grand { border-bottom: 0; padding-top: 11px; font-size: 13px; color: var(--rd-ink); font-weight: 600; }
.rd-totals-row.is-grand .v { font-size: 16px; font-weight: 700; color: var(--rd-ink); }

/* --- money / currency helpers ------------------------------------------- */
.rd-cur { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; color: var(--rd-faint); }
.rd-money-big { font-family: var(--rd-mono); font-variant-numeric: tabular-nums; }
.rd-sub2 { font-size: 10.5px; color: var(--rd-faint); margin-top: 1px; }

/* --- a11y / motion ------------------------------------------------------ */
.rd-body :focus-visible {
    /* deep teal clears the 3:1 non-text-contrast floor on both the white
       content surfaces and the dark sidebar */
    outline: 2px solid var(--rd-accent-ink);
    outline-offset: 2px;
    border-radius: 3px;
}
/* visually-hidden text for screen-reader-only state words */
.rd-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* horizontal scroll wrapper for dense editable line tables on small screens */
.rd-scrollx { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --- activity-log attribute diff ---------------------------------------- */
/* field | old value | new value, rendered inside the narrowest cell of an
   already-scrolling table — so it has to be able to collapse (see the ≤640
   block). Lives in CSS, not inline on the row, precisely so it can. */
.rd-logdiff {
    display: grid; grid-template-columns: max-content 1fr 1fr;
    gap: 10px; align-items: baseline; font-size: 12px;
}
.rd-logdiff-full { grid-column: 2 / span 2; }

@media (prefers-reduced-motion: reduce) {
    .rd-body * { transition: none !important; animation: none !important; }
}

/* --- responsive --------------------------------------------------------- */
@media (max-width: 1080px) {
    .rd-grid2 { grid-template-columns: 1fr; }
    .rd-formgrid { grid-template-columns: 1fr; }
    .rd-rail { position: static; }
    .rd-pipe { grid-template-columns: repeat(2, 1fr); }
    /* 2x2 wrap: directional arrows become ambiguous (some would point into the
       gutter), so drop them — the grid reads naturally left-to-right, top-to-bottom */
    .rd-lane::after { display: none; }
    .rd-board { grid-template-columns: repeat(2, 1fr); }
    .rd-board .rd-col::after { display: none; }
}
@media (max-width: 860px) {
    /* rail is desktop-only; on mobile the sidebar is the off-canvas drawer */
    .rd-content, .rd-shell.is-rail .rd-content { margin-left: 0; }
    .rd-side, .rd-shell.is-rail .rd-side { width: 240px; transform: translateX(-100%); transition: transform .22s; z-index: 80; box-shadow: none; }
    /* The shell keeps its `is-rail` class at every width (rail is a desktop-only look,
       but the class isn't stripped on mobile), so `.rd-shell.is-rail .rd-side` sets the
       off-canvas translateX at specificity (0,3,0). The open rule must match that reach
       or the drawer can't slide in when the burger adds `is-open`. */
    .rd-side.is-open, .rd-shell.is-rail .rd-side.is-open { transform: translateX(0); box-shadow: 0 20px 60px -10px rgba(0,0,0,.5); }
    .rd-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 70; }
    .rd-backdrop[hidden] { display: none; }
    .rd-burger { display: inline-flex !important; }

    /* Utility cluster moves into the drawer on phones; hide the command-bar copy.
       If page actions were the only other thing in the row, it's now empty — the
       :not(:has()) rule collapses that leftover row so the title sits flush. */
    .rd-cmdbar-util { display: none; }
    .rd-cmdbar-actions:not(:has(> :not(.rd-cmdbar-util))) { display: none; }

    /* rail toggle is a desktop-only affordance — drop it from the mobile drawer foot.
       Also clear the foot's own margin-top:auto so only the account block's auto margin
       absorbs the free space (two auto margins would split it and drift them apart). */
    .rd-rail-toggle { display: none; }
    .rd-side-foot { margin-top: 0; }

    /* --- drawer account block (mobile) --- */
    .rd-side-account {
        display: flex; flex-direction: column; gap: 8px;
        margin-top: auto; padding-top: 12px; /* margin-top:auto sinks it to the drawer bottom */
        border-top: 1px solid var(--rd-side-line);
    }
    .rd-side-user {
        display: flex; align-items: center; gap: 11px;
        padding: 9px 10px; border-radius: 9px; color: var(--rd-side-strong);
        transition: background .14s;
    }
    .rd-side-user:hover, .rd-side-user:active { background: var(--rd-side-2); }
    .rd-side-user .rd-avatar {
        flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
        display: inline-flex; align-items: center; justify-content: center;
        background: linear-gradient(150deg, var(--rd-accent), var(--rd-accent-deep));
        color: #fff; font-weight: 700; font-size: 15px;
    }
    .rd-side-user-id { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
    .rd-side-user-id b { font-size: 13.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .rd-side-user-id span { margin-top: 1px; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--rd-side-text); }
    .rd-side-account-row { display: flex; align-items: stretch; gap: 8px; }
    .rd-side-account-row form { flex: 1; display: flex; margin: 0; }
    .rd-side-acc-btn {
        flex: 1; width: 100%; position: relative;
        display: inline-flex; align-items: center; justify-content: center; gap: 8px;
        height: 40px; padding: 0 12px; border-radius: 9px;
        border: 1px solid var(--rd-side-line); background: var(--rd-side-2);
        color: var(--rd-side-strong); font-family: inherit; font-size: 12.5px; font-weight: 600;
        cursor: pointer; transition: background .14s, color .14s, border-color .14s;
    }
    .rd-side-acc-btn:hover, .rd-side-acc-btn:active { background: #2a2f3a; color: #fff; }
    .rd-side-acc-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.7; fill: none; flex-shrink: 0; }
    .rd-side-acc-btn.is-danger { color: #ff9ba1; }
    .rd-side-acc-btn.is-danger:hover, .rd-side-acc-btn.is-danger:active { background: rgba(255,90,100,.14); border-color: rgba(255,90,100,.4); color: #ffb3b8; }
    .rd-side-acc-badge {
        min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
        background: var(--rd-bad); color: #fff; font-size: 9.5px; font-weight: 700;
        line-height: 17px; text-align: center;
    }
    .rd-stats { grid-template-columns: repeat(2, 1fr); }
    .rd-stat:nth-child(2) { border-right: 0; }
    .rd-stat:nth-child(1), .rd-stat:nth-child(2) { border-bottom: 1px solid var(--rd-line); }
    /* drop sticky stacking on small screens so the three bars can't collide */
    .rd-cmdbar { position: static; }
    /* Two deliberate rows: burger+title never wrap (title truncates instead);
       the utility/page-action cluster is forced onto its own full-width row
       via flex-basis:100%, where it's free to wrap its own buttons if they
       don't fit — rather than the whole bar wrapping unpredictably mid-row
       (which used to shove the title flush right or clip the avatar/logout
       off-screen depending on content width). */
    .rd-cmdbar { flex-wrap: wrap; row-gap: 8px; }
    .rd-cmdbar-actions { flex: 1 1 100%; flex-wrap: wrap; row-gap: 8px; }
    .rd-toolbar { flex-wrap: wrap; position: static; }
    .rd-search { flex: 1 1 100%; }
    .rd-table.is-sticky thead th { position: static; }
    /* let the dense table scroll horizontally rather than clip (thead is static here) */
    .rd-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* The drawer is the ONLY navigation on a phone and its rows are ~29px tall —
       under the 44px minimum touch target, with no pointer to aim with. */
    .rd-nav-link { min-height: 44px; }

    /* Drag-to-reorder is a desktop affordance: the handle is opacity:0 until the
       row is hovered (which never happens on touch), yet it still occupies a
       22px `touch-action: none` slot on the far right of every section header —
       and startDrag() fires on pointerdown. Tapping the right edge of a header
       therefore starts an invisible drag instead of toggling the section. */
    .rd-side .rd-drag-handle { display: none; }

    /* The filter popover is position:absolute + right:0 + a fixed 320px. At this
       width .rd-toolbar wraps and .rd-search takes the whole row (above), which
       drags .rd-pop-wrap to the left edge — so a right-anchored 320px panel renders
       mostly off-screen and cannot be reached. Both the leads and logs pages open it
       server-side whenever a filter is active, so it would sit there permanently
       invisible. Flow it inline underneath the toolbar instead. */
    /* Once the panel is in normal flow it contributes to its shrink-to-fit
       wrapper's max-content width, so the wrapper itself has to be told to take
       the row and be allowed to shrink — otherwise the pair overflows by the
       panel's padding. */
    .rd-pop-wrap { flex: 1 1 100%; min-width: 0; }
    .rd-pop {
        position: static;
        width: 100%;
        max-width: 100%;
        margin-top: 8px;
        box-shadow: none;
        border: 1px solid var(--rd-line-2);
    }

    /* iOS zooms into any control it considers too small to read and does not zoom
       back out. The viewport meta deliberately omits maximum-scale (pinch-zoom must
       keep working), so 16px on the controls themselves is the only fix. */
    .rd-input, .rd-select, textarea.rd-input,
    .rd-search input, .rd-cellinput, .rd-check { font-size: 16px; }
    /* a native date/time control carries a UA min-width that grows with the font
       size above, which is enough to burst a two-up grid on a narrow phone */
    .rd-input[type="date"], .rd-input[type="time"] { min-width: 0; }
    .rd-cellinput { height: 32px; }
    .rd-btn { font-size: 14px; }
}
.rd-burger { display: none; }
@media (max-width: 640px) {
    .rd-main { padding: 14px 14px 64px; }
    .rd-cmdbar { padding: 12px 14px; }
    .rd-fields { grid-template-columns: 1fr; }
    .rd-stats { grid-template-columns: 1fr; }
    .rd-stat { border-right: 0; border-bottom: 1px solid var(--rd-line); }
    .rd-stat:last-child { border-bottom: 0; }
    .rd-hide-sm { display: none !important; }
    /* extra bottom padding clears the iOS home indicator, which overlaps a bar
       stuck to the bottom of the viewport */
    .rd-actionbar { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
    .rd-pipe { grid-template-columns: 1fr; }
    .rd-board { grid-template-columns: 1fr; }
    .rd-agenda-day { grid-template-columns: 50px minmax(0,1fr); gap: 12px; padding: 12px; }
    .rd-lane { min-height: 0; }
    /* single column: every lane (except the last) points down to the next */
    .rd-lane::after { display: block; right: 50%; top: auto; bottom: -8px; transform: translateX(50%) rotate(135deg); }
    .rd-pipe .rd-lane:last-child::after { display: none; }
    /* let lifecycle stage labels wrap instead of truncating to ellipsis */
    .rd-step-label { font-size: 10px; white-space: normal; text-overflow: clip; line-height: 1.2; }
    /* three columns inside the narrowest cell of a scrolling table is unreadable
       on a phone — stack field, old value and new value instead */
    .rd-logdiff { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .rd-logdiff-full { grid-column: 1 / -1; }
}

/* --- dashboard work feed ------------------------------------------------- */
/* Extends the .rd-attn-* attention-row vocabulary with the bits a work row
   needs that the notifications inbox did not: stacked title/subtitle inside a
   flex row, a muted assignee column, and a trailing action group. */
.rd-work-row { flex-wrap: wrap; row-gap: 8px; }
.rd-work-row .rd-attn-t,
.rd-work-row .rd-attn-sub { display: block; }
.rd-work-row .rd-attn-t a { color: var(--rd-ink); text-decoration: none; }
.rd-work-row .rd-attn-t a:hover { color: var(--rd-accent-ink); text-decoration: underline; }
.rd-work-meta { font-size: 11.5px; color: var(--rd-muted); white-space: nowrap; }
.rd-work-actions { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.rd-work-actions form { display: inline; }

@media (max-width: 640px) {
    /* the row already drops .rd-hide-sm columns; let the actions sit on their
       own line instead of squeezing the title to a couple of characters */
    .rd-work-row .rd-attn-main { flex-basis: 100%; }
    .rd-work-actions { margin-left: auto; }
}
