/* ============================================================
   Request Log — modern minimalist redesign
   Ported from the React/Tailwind design in
   `Redesign request log page/src/app/components/request-log`.
   Loaded after css/style.css.
   ============================================================ */

/* ── Local design tokens (mapped onto the global theme) ──────── */
.requests-page {
  --rl-bg:           var(--bg);
  --rl-card:         var(--surface);
  --rl-card-2:       var(--surface2);
  --rl-fg:           var(--heading);
  --rl-fg-soft:      var(--text);
  --rl-muted:        var(--muted);
  --rl-border:       rgba(148, 163, 184, 0.18);
  --rl-border-soft:  rgba(148, 163, 184, 0.10);
  --rl-accent:       rgba(148, 163, 184, 0.16);
  --rl-radius-sm:    8px;
  --rl-radius-md:    12px;
  --rl-radius-lg:    16px;
  --rl-radius-xl:    20px;

  /* Status palette */
  --rl-pending:    #f59e0b;
  --rl-progress:   #38bdf8;
  --rl-completed:  #10b981;
  --rl-cancelled:  #94a3b8;

  /* Priority palette */
  --rl-prio-low:       #94a3b8;
  --rl-prio-medium:    #38bdf8;
  --rl-prio-high:      #f59e0b;
  --rl-prio-critical:  #f43f5e;
}

[data-theme="light"] .requests-page {
  --rl-border:      rgba(15, 23, 42, 0.12);
  --rl-border-soft: rgba(15, 23, 42, 0.07);
  --rl-accent:      rgba(15, 23, 42, 0.05);
}

/* ── Body / layout ────────────────────────────────────────────── */

body.requests-page {
  min-height: 100vh;
  background: var(--rl-bg);
  color: var(--rl-fg);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Neutralize the global `section { padding:96px 24px; max-width:1100px; ...}`
   rule from style.css inside the requests-log page. Each section here is
   already laid out by .rl-main. */
body.requests-page section {
  padding: 0;
  max-width: none;
  margin: 0;
}

/* Re-assert [hidden]: author CSS in this file uses absolute / grid / flex
   `display` declarations that can override the UA default for [hidden]. */
[hidden] { display: none !important; }

.rl-main {
  /* max-width: 1480px; */
  margin: 0 206px;
  padding: 96px 32px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Sticky offsets are tuned to the real heights of each strip so they stack
   neatly under the nav: nav 64 + filter ~56 + rail ~56 = 176px to rows-head. */
:root {
  --rl-nav-h:      64px;
  --rl-filter-h:   66px; /* 40 input + 12+14 padding */
  --rl-rail-h:     72px; /* 8 bar + 10 gap + 30 chip + 12+12 padding */
}

/* ── Icons ─── */
.rl-icon-3 { width: 12px; height: 12px; }
.rl-icon-4 { width: 16px; height: 16px; }
.rl-icon-5 { width: 20px; height: 20px; }

/* ── Intro section ────────────────────────────────────────────── */

.rl-intro {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 720px;
}

.rl-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rl-muted);
  font-weight: 600;
}

.rl-title {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--rl-fg);
  margin: 0;
  background: none;
  -webkit-text-fill-color: initial;
}

.rl-subtitle {
  font-size: 14px;
  color: var(--rl-muted);
  margin-top: 4px;
  line-height: 1.55;
}

/* ── Stat strip ───────────────────────────────────────────────── */

.rl-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rl-border);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-xl);
  overflow: hidden;
}

.rl-stat {
  background: var(--rl-card);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.18s ease;
}
.rl-stat:hover { background: var(--rl-accent); }

.rl-stat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rl-stat__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rl-muted);
  font-weight: 500;
}

.rl-stat__delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.rl-stat__delta.is-up    { color: #10b981; }
.rl-stat__delta.is-down  { color: #f43f5e; }

.rl-stat__body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.rl-stat__value {
  font-variant-numeric: tabular-nums;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--rl-fg);
}

.rl-stat__spark {
  width: 88px;
  height: 36px;
  opacity: 0.9;
}
.rl-stat[data-stat="total"]      .rl-stat__spark { color: #38bdf8; }
.rl-stat[data-stat="active"]     .rl-stat__spark { color: #f59e0b; }
.rl-stat[data-stat="completed"]  .rl-stat__spark { color: #10b981; }
.rl-stat[data-stat="cancelled"]  .rl-stat__spark { color: #94a3b8; }

.rl-stat__spark svg { width: 100%; height: 100%; display: block; }

.rl-stat__hint {
  font-size: 11px;
  color: var(--rl-muted);
}

/* ── Filter bar ───────────────────────────────────────────────── */

/* Specificity bump: must beat `body.requests-page section { padding: 0; }` reset. */
body.requests-page .rl-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: var(--rl-nav-h);
  /* Must beat .rl-rows-head (z:9) and .rl-board-section__head (z:8) — both
     siblings of the bar. The Filter popover lives inside this stacking
     context, so its inner z:20 only matters relative to bar's own children;
     the *whole bar* needs to outrank the heads to surface the panel. */
  z-index: 12;
  background: var(--rl-bg);
  padding: 12px 0 14px;
  /* Pull up to remove the .rl-main column gap between sticky strips so
     scrolling rows can't peek through the seam. */
  margin-bottom: -24px;
}

.rl-fb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rl-fb-spacer { flex: 1; }

.rl-search {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 480px;
}

.rl-search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--rl-muted);
}

.rl-search input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 36px;
  background: var(--rl-card);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-sm);
  color: var(--rl-fg);
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.rl-search input::placeholder { color: var(--rl-muted); }
.rl-search input:focus {
  outline: none;
  border-color: var(--rl-fg);
  box-shadow: 0 0 0 3px var(--rl-accent);
}

.rl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--rl-radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  border: 1px solid var(--rl-border);
  background: var(--rl-card);
  color: var(--rl-fg);
  white-space: nowrap;
}
.rl-btn:hover { background: var(--rl-accent); }

.rl-btn--ghost {
  background: var(--rl-card);
}

.rl-btn--primary {
  background: var(--rl-fg);
  color: var(--rl-bg);
  border-color: var(--rl-fg);
}
.rl-btn--primary:hover { background: var(--rl-fg); opacity: 0.9; }

.rl-filter-popover {
  position: relative;
}

.rl-filter-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  background: var(--rl-card);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-md);
  padding: 12px;
  min-width: 240px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rl-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rl-filter-field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rl-muted);
  font-weight: 600;
}
.rl-filter-field select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--rl-border);
  background: var(--rl-card);
  color: var(--rl-fg);
  border-radius: var(--rl-radius-sm);
  font-size: 13px;
  cursor: pointer;
}

.rl-view-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--rl-border);
  background: var(--rl-card);
  border-radius: var(--rl-radius-sm);
}

.rl-view-btn {
  height: 32px;
  padding: 0 14px;
  border: none;
  background: transparent;
  color: var(--rl-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.18s, color 0.18s;
}
.rl-view-btn:hover { color: var(--rl-fg); }
.rl-view-btn.is-active {
  background: var(--rl-accent);
  color: var(--rl-fg);
}

.rl-active-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.rl-active-chips__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rl-muted);
  margin-right: 4px;
}
.rl-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--rl-border);
  background: var(--rl-card);
  font-size: 12px;
  color: var(--rl-fg);
  cursor: pointer;
}
.rl-active-chip__key { color: var(--rl-muted); }
.rl-active-chip__close { display: inline-flex; color: var(--rl-muted); }
.rl-active-chip:hover { background: var(--rl-accent); }

/* ── Status rail ──────────────────────────────────────────────── */

body.requests-page .rl-status-rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: calc(var(--rl-nav-h) + var(--rl-filter-h) - 4px);
  z-index: 7;
  background: var(--rl-bg);
  padding: 12px 0;
  margin-bottom: -24px; /* eat .rl-main gap so rows-section abuts the rail */
  /* Extend solid bg 24px below the rail to seal the seam against rows-head.
     Without this, the exact rail height can differ from --rl-rail-h by a few
     pixels and row content scrolling underneath becomes visible in the gap. */
  box-shadow: 0 24px 0 0 var(--rl-bg);
}

.rl-status-bar {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--rl-border);
  overflow: hidden;
}

.rl-status-bar__seg {
  transition: width 0.4s ease;
}
.rl-status-bar__seg[data-seg="pending"]      { background: var(--rl-pending); }
.rl-status-bar__seg[data-seg="in-progress"]  { background: var(--rl-progress); }
.rl-status-bar__seg[data-seg="completed"]    { background: var(--rl-completed); }
.rl-status-bar__seg[data-seg="cancelled"]    { background: var(--rl-cancelled); }

.rl-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rl-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--rl-border);
  background: transparent;
  color: var(--rl-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.rl-chip:hover {
  color: var(--rl-fg);
  background: var(--rl-accent);
}
.rl-chip.is-active {
  background: var(--rl-fg);
  color: var(--rl-bg);
  border-color: var(--rl-fg);
}
.rl-chip[data-status="pending"].is-active,
.rl-chip[data-status="in-progress"].is-active,
.rl-chip[data-status="completed"].is-active,
.rl-chip[data-status="cancelled"].is-active {
  background: var(--rl-accent);
  color: var(--rl-fg);
  border-color: var(--rl-border);
}

.rl-chip__count {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  margin-left: 2px;
  opacity: 0.85;
}

.rl-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.rl-dot.is-pending     { background: var(--rl-pending); }
.rl-dot.is-progress    { background: var(--rl-progress); }
.rl-dot.is-completed   { background: var(--rl-completed); }
.rl-dot.is-cancelled   { background: var(--rl-cancelled); }

/* ── Rows view ────────────────────────────────────────────────── */

.rl-rows-section {
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-xl);
  background: var(--rl-card);
  /* No `overflow:hidden` here — would clip position:sticky on .rl-rows-head.
     Use clip-path on the section's corners via children radii instead. */
}
.rl-rows-head { border-top-left-radius: var(--rl-radius-xl); border-top-right-radius: var(--rl-radius-xl); }
.rl-infinite  { border-bottom-left-radius: var(--rl-radius-xl); border-bottom-right-radius: var(--rl-radius-xl); }

/* Header reuses the same grid as `.rl-row` so column labels align pixel-
   perfect with row cells. Count text spans the first 2 cells (dot/id +
   title). The remaining 4 cells map 1:1 to Priority / Progress / Assignee /
   Status. */
.rl-rows-head {
  display: grid;
  grid-template-columns: auto 1fr 130px 150px 160px 110px;
  gap: 20px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--rl-border);
  font-size: 12px;
  color: var(--rl-muted);
  /* Sticky below the filter bar + status rail (also sticky). */
  position: sticky;
  top: calc(var(--rl-nav-h) + var(--rl-filter-h) + var(--rl-rail-h));
  /* Must beat the rail (z=7) so its shadow doesn't cover head's corners. */
  z-index: 9;
  background: color-mix(in srgb, var(--rl-card) 94%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.rl-rows-head strong {
  color: var(--rl-fg);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.rl-rows-head__count        { grid-column: 1 / span 2; }
.rl-rows-head__col          { font-variant-numeric: tabular-nums; }
.rl-rows-head__col--center  { text-align: center; }

@media (max-width: 900px) {
  /* Collapse header to a single 1fr column at narrow widths;
     hide column labels while keeping the count line. */
  .rl-rows-head { grid-template-columns: 1fr; gap: 0; }
  .rl-rows-head__col { display: none; }
  .rl-rows-head__count { grid-column: auto; }
}

.rl-rows {
  display: flex;
  flex-direction: column;
}

.rl-row {
  display: grid;
  grid-template-columns: auto 1fr 130px 150px 160px 110px;
  align-items: center;
  gap: 20px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--rl-border-soft);
  cursor: pointer;
  transition: background 0.16s ease;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
}
.rl-row:last-child { border-bottom: none; }
.rl-row:hover { background: var(--rl-accent); }
.rl-row:hover .rl-row__chev { opacity: 1; }

.rl-row__lead {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rl-row__dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rl-row__dot.is-pending    { background: var(--rl-pending);    box-shadow: 0 0 0 4px rgba(245,158,11,0.15); }
.rl-row__dot.is-progress   { background: var(--rl-progress);   box-shadow: 0 0 0 4px rgba(56,189,248,0.15); }
.rl-row__dot.is-completed  { background: var(--rl-completed);  box-shadow: 0 0 0 4px rgba(16,185,129,0.15); }
.rl-row__dot.is-cancelled  { background: var(--rl-cancelled);  box-shadow: 0 0 0 4px rgba(148,163,184,0.15); }

.rl-row__id {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--rl-muted);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.rl-row__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rl-row__title {
  font-size: 14px;
  color: var(--rl-fg);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 12px;
}

.rl-row__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--rl-muted);
}
.rl-row__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.rl-row__meta-item svg { color: var(--rl-muted); }
.rl-row__project {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--rl-progress);
}
.rl-row__project svg { color: var(--rl-progress); }

.rl-row__prio {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
}

/* Priority column: bars + label */
.rl-row__prio-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.rl-row__prio-label {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.rl-row__prio-label.is-low       { color: var(--rl-prio-low); }
.rl-row__prio-label.is-medium    { color: var(--rl-prio-medium); }
.rl-row__prio-label.is-high      { color: var(--rl-prio-high); }
.rl-row__prio-label.is-critical  { color: var(--rl-prio-critical); }
.rl-row__prio-bar {
  width: 3px;
  border-radius: 1px;
  background: var(--rl-border);
}
.rl-row__prio-bar.is-on.is-low       { background: var(--rl-prio-low); }
.rl-row__prio-bar.is-on.is-medium    { background: var(--rl-prio-medium); }
.rl-row__prio-bar.is-on.is-high      { background: var(--rl-prio-high); }
.rl-row__prio-bar.is-on.is-critical  { background: var(--rl-prio-critical); }

.rl-row__progress {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rl-row__progress-track {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--rl-border);
  overflow: hidden;
}
.rl-row__progress-fill {
  display: block; /* fill is a <span>; inline elements ignore width/height */
  height: 100%;
  transition: width 0.3s ease;
}
.rl-row__progress-fill.is-pending     { background: var(--rl-pending); }
.rl-row__progress-fill.is-progress    { background: var(--rl-progress); }
.rl-row__progress-fill.is-completed   { background: var(--rl-completed); }
.rl-row__progress-fill.is-cancelled   { background: var(--rl-cancelled); }
.rl-row__progress-num {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--rl-muted);
  min-width: 32px;
  text-align: right;
}

.rl-row__assignee {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.rl-row__assignee .rl-avatar { width: 24px; height: 24px; font-size: 10px; }
.rl-row__assignee-name {
  font-size: 12px;
  color: var(--rl-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rl-row__assignee-name.is-empty {
  color: var(--rl-muted);
  font-style: italic;
}

.rl-row__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rl-row__status-text {
  font-size: 12px;
}
.rl-row__status-text.is-pending    { color: var(--rl-pending); }
.rl-row__status-text.is-progress   { color: var(--rl-progress); }
.rl-row__status-text.is-completed  { color: var(--rl-completed); }
.rl-row__status-text.is-cancelled  { color: var(--rl-cancelled); }
.rl-row__chev {
  opacity: 0;
  transition: opacity 0.16s;
  color: var(--rl-muted);
}

@media (max-width: 1100px) {
  .rl-row { grid-template-columns: auto 1fr 110px 120px auto; }
  .rl-row__assignee { display: none; }
}
@media (max-width: 900px) {
  .rl-row { grid-template-columns: auto 1fr auto auto; }
  .rl-row__progress { display: none; }
}
@media (max-width: 540px) {
  .rl-row { grid-template-columns: auto 1fr auto; }
  .rl-row__prio-cell { display: none; }
  .rl-row__title { font-size: 13px; }
}

/* ── Avatar ──────────────────────────────────────────────────── */

.rl-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rl-accent);
  color: var(--rl-fg);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  text-transform: uppercase;
}
.rl-avatar.is-empty {
  background: transparent;
  border: 1px dashed var(--rl-border);
  color: var(--rl-muted);
}

/* ── Empty / loading state ───────────────────────────────────── */

.rl-loading,
.rl-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--rl-muted);
}
.rl-empty__icon {
  font-size: 28px;
  margin-bottom: 8px;
  opacity: 0.7;
}
.rl-empty h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--rl-fg);
  margin: 0 0 4px;
}
.rl-empty p { font-size: 13px; }

.rl-loader {
  width: 28px;
  height: 28px;
  border: 2px solid var(--rl-border);
  border-top-color: var(--rl-fg);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: rl-spin 0.7s linear infinite;
}
@keyframes rl-spin { to { transform: rotate(360deg); } }

/* ── Infinite scroll footer ──────────────────────────────────── */

.rl-infinite {
  border-top: 1px solid var(--rl-border);
}
.rl-infinite:empty { display: none; }

.rl-infinite__sentinel,
.rl-infinite__end {
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--rl-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.rl-infinite__end {
  font-variant-numeric: tabular-nums;
}

.rl-loader--sm {
  width: 14px;
  height: 14px;
  margin: 0;
  border-width: 2px;
}

/* ── Board view ───────────────────────────────────────────────── */

.rl-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) { .rl-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .rl-board { grid-template-columns: 1fr; } }

.rl-col {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  /* Fill the viewport minus the sticky stack (nav + filter + rail) plus a
     small bottom breathing room. So each column body uses all remaining
     vertical space — long card lists scroll inside the column, and the
     stat-strip scrolls away cleanly above. */
  max-height: calc(100vh - var(--rl-nav-h) - var(--rl-filter-h) - var(--rl-rail-h) - 32px);
  background: color-mix(in srgb, var(--rl-card) 50%, transparent);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-lg);
  transition: background 0.18s, border-color 0.18s;
}

.rl-col.is-drop-active {
  border-color: color-mix(in srgb, var(--rl-fg) 40%, transparent);
  background: var(--rl-accent);
}

.rl-col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rl-border);
  /* Sticky under the rail + filter bar, same offset as rows-head, so the
     column title + count stay visible while scrolling the page. */
  position: sticky;
  top: calc(var(--rl-nav-h) + var(--rl-filter-h) + var(--rl-rail-h));
  /* Must beat the rail (z=7) and its box-shadow extension — otherwise the
     rail's 24px shadow covers the top portion of this sticky head. */
  z-index: 8;
  background: var(--rl-card); /* solid — column bg is translucent */
  /* Match the column's rounded top corners when pinned. */
  border-top-left-radius: var(--rl-radius-lg);
  border-top-right-radius: var(--rl-radius-lg);
}
.rl-col__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--rl-fg);
  font-weight: 500;
}
.rl-col__count {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--rl-muted);
}

.rl-col__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  overflow-y: auto;
}

.rl-col__empty {
  font-size: 12px;
  text-align: center;
  padding: 32px 12px;
  color: var(--rl-muted);
  border: 1px dashed var(--rl-border);
  border-radius: var(--rl-radius-sm);
}

.rl-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--rl-border);
  background: var(--rl-card);
  border-radius: var(--rl-radius-md);
  cursor: grab;
  transition: background 0.16s, border-color 0.16s, opacity 0.16s, transform 0.16s;
  text-align: left;
}
.rl-card:hover { background: var(--rl-accent); border-color: color-mix(in srgb, var(--rl-fg) 20%, var(--rl-border)); }
.rl-card:active { cursor: grabbing; }
.rl-card.is-dragging { opacity: 0.45; transform: scale(0.98); }

.rl-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--rl-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.rl-card__title {
  font-size: 13px;
  color: var(--rl-fg);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rl-card__progress {
  height: 3px;
  border-radius: 999px;
  background: var(--rl-border);
  overflow: hidden;
}
.rl-card__progress-fill { display: block; height: 100%; }
.rl-card__progress-fill.is-pending     { background: var(--rl-pending); }
.rl-card__progress-fill.is-progress    { background: var(--rl-progress); }
.rl-card__progress-fill.is-completed   { background: var(--rl-completed); }
.rl-card__progress-fill.is-cancelled   { background: var(--rl-cancelled); }

.rl-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rl-card__foot-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ── Detail modal redesign ─────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
}
.modal-content {
  position: relative;
  background: var(--rl-card);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-lg);
  width: 100%;
  max-width: 880px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
}
.modal-content--wide   { max-width: 920px; padding: 32px; overflow-y: auto; }
.modal-content--detail { max-width: min(1100px, calc(100vw - 32px)); }
.modal-content--narrow { max-width: 440px; padding: 28px; text-align: center; }

.rl-created__icon {
  width: 56px;
  height: 56px;
  margin: 4px auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
  color: #8B5CF6;
}
.rl-created__icon svg { width: 30px; height: 30px; }
.rl-created__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.rl-created__desc {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--rl-muted);
  line-height: 1.5;
}
.rl-created__actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.rl-created__actions .rl-copy-ctx { margin-left: 0; }

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  color: var(--rl-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  z-index: 10;
}
.modal-close:hover { background: var(--rl-accent); color: var(--rl-fg); }

.modal-content--detail .modal-close { top: 8px; right: 8px; }

.rl-detail {
  display: grid;
  grid-template-columns: 1fr 320px;
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
}

.rl-detail__main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.rl-detail__topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  height: 48px;
  border-bottom: 1px solid var(--rl-border);
  font-size: 12px;
  color: var(--rl-muted);
}
.rl-detail__topbar .rl-detail__id {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.06em;
}
.rl-detail__topbar .rl-divider { color: var(--rl-border); }

.rl-copy-ctx {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #B146C2 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(99, 102, 241, 0.25), 0 4px 12px rgba(139, 92, 246, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.rl-copy-ctx svg { width: 14px; height: 14px; }
.rl-copy-ctx:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3), 0 8px 18px rgba(139, 92, 246, 0.35);
}
.rl-copy-ctx:active { transform: translateY(0); filter: brightness(0.95); }
.rl-copy-ctx.is-flash {
  background: #13A10E;
  box-shadow: 0 1px 2px rgba(19, 161, 14, 0.3), 0 4px 12px rgba(19, 161, 14, 0.3);
}

.rl-detail__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.rl-detail__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--rl-fg);
  line-height: 1.3;
  margin: 0;
}

.rl-detail__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--rl-muted);
}
.rl-detail__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rl-detail__progress-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-md);
}
.rl-detail__progress-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rl-detail__progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}
.rl-detail__progress-head .label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rl-muted);
}
.rl-detail__progress-head .value {
  font-variant-numeric: tabular-nums;
  color: var(--rl-fg);
}
.rl-detail__progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--rl-border);
  overflow: hidden;
}
.rl-detail__progress-fill { height: 100%; }
.rl-detail__divider-v { width: 1px; height: 36px; background: var(--rl-border); }
.rl-detail__priority-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 110px;
}
.rl-detail__priority-col .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rl-muted);
}
.rl-detail__priority-val {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rl-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rl-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rl-progress);
  font-weight: 700;
  padding: 3px 9px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, transparent 100%);
  border-left: 3px solid var(--rl-progress);
  border-radius: 0 var(--rl-radius-sm) var(--rl-radius-sm) 0;
}
.rl-section__title::before {
  content: '›';
  font-size: 16px;
  font-weight: 800;
  color: var(--rl-progress);
}
.rl-section__body {
  font-size: 13px;
  color: var(--rl-fg-soft);
  line-height: 1.65;
}
.rl-section__body p { margin: 0; white-space: pre-wrap; }

.rl-section textarea.modal-input {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  background: var(--rl-card-2);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-sm);
  color: var(--rl-fg);
  font: inherit;
  font-size: 13px;
  resize: vertical;
}
.rl-section textarea.modal-input:focus {
  outline: none;
  border-color: var(--rl-fg);
  box-shadow: 0 0 0 3px var(--rl-accent);
}

/* Budget toggles */
.rl-budget-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 4px 0;
}
.rl-budget-toggles .rl-toggle,
label.rl-toggle {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--rl-fg);
}
.rl-toggle input[type="checkbox"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.rl-toggle__track {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  background: var(--rl-muted);
  border-radius: 12px;
  transition: background 0.2s ease;
}
.rl-toggle__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}
.rl-toggle input:checked + .rl-toggle__track {
  background: var(--rl-completed);
}
.rl-toggle input:checked + .rl-toggle__track::after {
  transform: translateX(20px);
}
.rl-toggle__label {
  font-size: 13px;
  color: var(--rl-fg-soft);
}
.rl-toggle input:checked ~ .rl-toggle__label {
  color: var(--rl-fg);
  font-weight: 500;
}

/* Budget readonly */
.rl-budget-readonly {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.rl-budget-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--rl-radius-sm);
  font-size: 13px;
  font-weight: 500;
}
.rl-budget-item.is-yes {
  background: rgba(16, 185, 129, 0.15);
  color: var(--rl-completed);
}
.rl-budget-item.is-no {
  background: rgba(148, 163, 184, 0.15);
  color: var(--rl-muted);
}

.rl-activity {
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 6px; /* breathing room for scrollbar */
}
.rl-activity::-webkit-scrollbar        { width: 6px; }
.rl-activity::-webkit-scrollbar-track  { background: transparent; }
.rl-activity::-webkit-scrollbar-thumb  { background: var(--rl-border); border-radius: 3px; }
.rl-activity::-webkit-scrollbar-thumb:hover { background: var(--rl-muted); }
.rl-activity__item {
  display: flex;
  gap: 12px;
}
.rl-activity__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.rl-activity__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--rl-card);
  border: 1px solid var(--rl-border);
  color: var(--rl-muted);
  flex-shrink: 0;
}
.rl-activity__line {
  width: 1px;
  flex: 1;
  background: var(--rl-border);
  margin: 6px 0;
}
.rl-activity__body {
  padding-bottom: 16px;
  flex: 1;
}
.rl-activity__line-text {
  font-size: 13px;
  color: var(--rl-fg-soft);
}
.rl-activity__line-text strong { color: var(--rl-fg); font-weight: 500; }
.rl-activity__line-text em { color: var(--rl-muted); font-style: normal; }
.rl-activity__line-text .rl-tag {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--rl-border);
  font-size: 11px;
  color: var(--rl-fg-soft);
  margin-left: 4px;
}
.rl-activity__meta {
  font-size: 11px;
  color: var(--rl-muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.rl-detail__sidebar {
  border-left: 1px solid var(--rl-border);
  background: color-mix(in srgb, var(--rl-card-2) 80%, transparent);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.rl-detail__sidebar-inner {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rl-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rl-field > label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rl-muted);
  font-weight: 600;
}
.rl-field select,
.rl-field input[type="date"],
.rl-field input[type="number"] {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  background: var(--rl-card);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-sm);
  color: var(--rl-fg);
  font-size: 13px;
}
.rl-field select:focus,
.rl-field input:focus {
  outline: none;
  border-color: var(--rl-fg);
}

.rl-field__user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rl-field__user-info { display: flex; flex-direction: column; min-width: 0; }
.rl-field__user-name { font-size: 13px; color: var(--rl-fg); }
.rl-field__user-email { font-size: 11px; color: var(--rl-muted); }

.rl-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.rl-time-cell {
  padding: 8px 10px;
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-sm);
  background: var(--rl-card);
}
.rl-time-cell label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rl-muted);
  font-weight: 600;
}
.rl-time-cell input {
  width: 100%;
  height: auto;
  padding: 2px 0 0;
  background: transparent;
  border: none;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--rl-fg);
}
.rl-time-cell input:focus { outline: none; }

.rl-sidebar-divider {
  height: 1px;
  background: var(--rl-border);
}

.rl-detail__actions {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rl-btn--block {
  width: 100%;
  justify-content: center;
}

.rl-btn--danger {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--rl-prio-critical);
  font-size: 12px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.18s;
}
.rl-btn--danger:hover {
  background: rgba(244, 63, 94, 0.1);
}

@media (max-width: 900px) {
  .rl-detail { grid-template-columns: 1fr; }
  .rl-detail__sidebar { border-left: none; border-top: 1px solid var(--rl-border); }
  .rl-detail__scroll { max-height: 50vh; }
  .rl-detail__sidebar { max-height: 45vh; }
}

/* ── Tabs ─────────────────────────────────────────────────────── */

.rl-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--rl-border);
  margin-bottom: 12px;
}

.rl-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--rl-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rl-tab:hover { color: var(--rl-fg); }
.rl-tab.is-active {
  color: var(--rl-fg);
  border-bottom-color: var(--rl-fg);
}

.rl-tab__count {
  background: var(--rl-accent);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.rl-tab-content[hidden] { display: none; }

/* ── Comments ─────────────────────────────────────────────────── */

.rl-comments {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 6px;
  margin-bottom: 16px;
}

.rl-comments::-webkit-scrollbar        { width: 6px; }
.rl-comments::-webkit-scrollbar-track  { background: transparent; }
.rl-comments::-webkit-scrollbar-thumb  { background: var(--rl-border); border-radius: 3px; }
.rl-comments::-webkit-scrollbar-thumb:hover { background: var(--rl-muted); }

.rl-comments__empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--rl-muted);
  font-size: 13px;
}

.rl-comment {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rl-comment__main {
  display: flex;
  gap: 10px;
}

.rl-comment__avatar { flex-shrink: 0; }

.rl-comment__content {
  flex: 1;
  min-width: 0;
}

.rl-comment__header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.rl-comment__author {
  font-size: 13px;
  color: var(--rl-fg);
}

.rl-comment__time {
  font-size: 11px;
  color: var(--rl-muted);
  font-variant-numeric: tabular-nums;
}

.rl-comment__text {
  font-size: 13px;
  color: var(--rl-fg-soft);
  line-height: 1.5;
  word-break: break-word;
}

.rl-comment__actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.rl-comment__action {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  color: var(--rl-muted);
  cursor: pointer;
  transition: color 0.18s;
}

.rl-comment__action:hover { color: var(--rl-fg); }
.rl-comment__action--primary { color: var(--rl-progress); }
.rl-comment__action--primary:hover { color: var(--rl-progress); opacity: 0.8; }
.rl-comment__action--danger:hover { color: var(--rl-prio-critical); }

.rl-comment__edited {
  font-size: 10px;
  color: var(--rl-muted);
  font-style: italic;
  margin-left: 4px;
}

.rl-comment-edit-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--rl-card-2);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-sm);
  color: var(--rl-fg);
  font: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
  line-height: 1.5;
}

.rl-comment-edit-input:focus {
  outline: none;
  border-color: var(--rl-progress);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Replies */
.rl-comment__replies {
  margin-left: 38px;
  padding-left: 12px;
  border-left: 2px solid var(--rl-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rl-comment--reply .rl-comment__text { font-size: 12px; }

/* Mention highlight */
.rl-mention {
  background: rgba(56, 189, 248, 0.15);
  color: var(--rl-progress);
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 500;
}

/* Comment form */
.rl-comment-form {
  border-top: 1px solid var(--rl-border);
  padding-top: 12px;
}

.rl-comment-form__reply-to {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--rl-accent);
  border-radius: var(--rl-radius-sm);
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--rl-fg-soft);
}

.rl-comment-form__reply-to strong { color: var(--rl-fg); }

.rl-comment-form__cancel-reply {
  background: none;
  border: none;
  padding: 2px;
  color: var(--rl-muted);
  cursor: pointer;
  display: inline-flex;
}

.rl-comment-form__cancel-reply:hover { color: var(--rl-fg); }

.rl-comment-input-wrapper {
  position: relative;
}

.rl-comment-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--rl-card-2);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-sm);
  color: var(--rl-fg);
  font: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
}

.rl-comment-input:focus {
  outline: none;
  border-color: var(--rl-fg);
  box-shadow: 0 0 0 3px var(--rl-accent);
}

.rl-comment-input::placeholder { color: var(--rl-muted); }

.rl-comment-form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Mention dropdown */
.rl-mention-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--rl-card);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  margin-top: 4px;
  max-height: 180px;
  overflow-y: auto;
  z-index: 100;
}

.rl-mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--rl-fg);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.rl-mention-item:hover,
.rl-mention-item.is-selected {
  background: var(--rl-accent);
}

/* ── New request form ──────────────────────────────────────────── */

.modal-header { margin-bottom: 20px; }
.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--rl-fg);
  margin: 0;
}
.modal-subtitle {
  font-size: 13px;
  color: var(--rl-muted);
  margin-top: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--rl-fg);
  margin-bottom: 6px;
}
.required-mark {
  color: var(--rl-prio-critical, #e84855);
  font-weight: 700;
}
.form-group input:not([type="checkbox"]),
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--rl-card-2);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-sm);
  color: var(--rl-fg);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--rl-fg);
  box-shadow: 0 0 0 3px var(--rl-accent);
}
.form-group textarea { resize: vertical; min-height: 110px; }
.form-group input:disabled,
.form-group input.is-disabled {
  background: var(--rl-hover);
  color: var(--rl-muted);
  cursor: not-allowed;
  opacity: 0.7;
}
.char-count {
  display: block;
  text-align: right;
  font-size: 11px;
  color: var(--rl-muted);
  margin-top: 4px;
}

.form-fieldset {
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-sm);
  padding: 10px 14px 12px;
  background: var(--rl-card-2);
}
.form-fieldset > legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--rl-muted);
}
.form-check {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--rl-fg) !important;
  cursor: pointer;
  margin-bottom: 0 !important;
}
.form-check input[type="checkbox"] {
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.modal-btn {
  height: 40px;
  padding: 0 16px;
  border-radius: var(--rl-radius-sm);
  border: 1px solid var(--rl-border);
  background: var(--rl-card);
  color: var(--rl-fg);
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.modal-btn:hover { background: var(--rl-accent); }
.modal-btn.danger:hover { color: var(--rl-prio-critical); border-color: var(--rl-prio-critical); background: transparent; }

.submit-btn {
  flex: 1;
  height: 40px;
  padding: 0 18px;
  background: var(--rl-fg);
  color: var(--rl-bg);
  border: none;
  border-radius: var(--rl-radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.18s;
}
.submit-btn:hover { opacity: 0.9; }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Notification toast ──────────────────────────────────────── */

.notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--rl-card);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-md);
  padding: 12px 18px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10000;
  min-width: 260px;
  animation: rl-notif-in 0.25s ease;
}
.notification.success { border-left: 3px solid var(--rl-completed); }
.notification.error   { border-left: 3px solid var(--rl-prio-critical); }
.notification.info    { border-left: 3px solid var(--rl-progress); }
.notif-icon { font-size: 16px; }
.notif-text { flex: 1; font-size: 13px; color: var(--rl-fg); }

@keyframes rl-notif-in {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Theme tweaks ────────────────────────────────────────────── */

[data-theme="light"] .modal-content {
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
}
[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.35);
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .rl-stat-strip { grid-template-columns: repeat(2, 1fr); }
}
/* ≤760: filter bar wrap thành 2 hàng (search+Filters / Rows-Board+New request).
   Khi đó `--rl-filter-h` phải tăng tương ứng để rail + rows-head sticky không
   bị che. Stat strip cũng được làm gọn (font/padding/sparkline nhỏ lại). */
@media (max-width: 760px) {
  /* Sticky offset cho rail + rows-head — auto cascade qua custom prop */
  :root {
    --rl-filter-h: 122px; /* 2 hàng × 40px control + 8 gap + 12+14 padding */
  }

  .rl-main             { padding: 88px 16px 48px; margin: 0 auto; }
  .rl-title            { font-size: 26px; }
  .form-row            { grid-template-columns: 1fr; }
  .modal-content--wide { padding: 24px; }

  /* Filter bar: search + Filters cùng hàng; toggle + New request hàng 2 */
  .rl-search           { max-width: none; min-width: 0; }
  .rl-fb-spacer        { flex: 1 0 100%; height: 0; margin: 0; padding: 0; }
  .rl-view-toggle      { margin-left: 0; }

  /* Stat strip compact — vẫn 2×2 nhưng card nhỏ gọn hơn */
  .rl-stat             { padding: 12px 14px; gap: 4px; }
  .rl-stat__label      { font-size: 10px; letter-spacing: 0.06em; }
  .rl-stat__value      { font-size: 22px; }
  .rl-stat__spark      { width: 56px; height: 24px; }
  .rl-stat__hint       { font-size: 10px; }
  .rl-stat__delta      { font-size: 10px; }

  /* column labels */
  .rl-rows-head        { top: calc(var(--rl-nav-h) + var(--rl-filter-h) + var(--rl-rail-h) + 32px); }
}

/* ≤540: bo gọn thêm — search co lại nhưng vẫn cùng hàng Filters.
   New request bỏ chữ chỉ giữ icon để không tràn. */
@media (max-width: 540px) {
  .rl-stat-strip      { grid-template-columns: 1fr; }
  .rl-stat__value     { font-size: 24px; }
  .rl-search          { flex: 1 1 0; min-width: 0; }
  .rl-fb-row          { gap: 6px; }
  .rl-view-toggle     { flex: 1 1 auto; }
  .rl-view-btn        { flex: 1; }
  .rl-btn--primary    { flex: 0 0 auto; padding: 0 12px; }
}
