/* ── Bulma variable overrides ────────────────────────────────────────────── */
/* Set link/primary colour to indigo (#4f46e5 ≈ h243 s75% l59%) */
:root {
  --bulma-link-h: 243;
  --bulma-link-s: 75%;
  --bulma-link-l: 59%;
  --bulma-primary-h: 243;
  --bulma-primary-s: 75%;
  --bulma-primary-l: 59%;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bulma-background);
}
[data-theme=dark],
[data-theme=dark] body {
  background-color: #0d0c0b;
  color: #e8e3de;
}

/* Mute the indigo link/primary colour in dark mode */
[data-theme=dark] {
  --bulma-link-l: 44%;
  --bulma-link-s: 52%;
  --bulma-primary-l: 44%;
  --bulma-primary-s: 52%;
}

/* Dark mode: lift Bulma's grey text helpers so they read on dark surfaces */
[data-theme=dark] .has-text-grey-dark  { color: #c8c3be !important; }
[data-theme=dark] .has-text-grey       { color: #a09b97 !important; }
[data-theme=dark] .has-text-grey-light { color: #7a7672 !important; }
main { flex: 1; }

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.drs-logo {
  height: 2rem;
  width: auto;
  border-radius: 0.75rem;
}

.drs-nav-subtitle {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--bulma-link);
  letter-spacing: 0.03em;
  line-height: 1;
}

/* Nav links centered in the flex space between brand and navbar-end
   (desktop) — flex-grow lets it fill the remaining row width so it can
   never overlap navbar-end, unlike a container-wide absolute center. */
.drs-nav-center {
  display: flex;
  flex-grow: 1;
  align-items: stretch;
  justify-content: center;
}

[data-theme=dark] .navbar,
[data-theme=dark] .navbar.is-white {
  background-color: #1c1917;
  border-bottom: 1px solid #3d3830;
}
/* Nav items: text-colour-only, no background fill */
a.navbar-item:hover,
a.navbar-item.is-active {
  background-color: transparent !important;
  color: var(--bulma-link) !important;
}

[data-theme=dark] .navbar-item,
[data-theme=dark] a.navbar-item { color: #d6d3d1; }
[data-theme=dark] a.navbar-item:hover,
[data-theme=dark] a.navbar-item.is-active {
  background-color: transparent !important;
  color: #a5b4fc !important;
}
[data-theme=dark] .navbar-burger span { background-color: #d6d3d1; }
[data-theme=dark] .navbar-menu {
  background-color: #1c1917;
  border-top: 1px solid #3d3830;
}

/* ── User avatar ─────────────────────────────────────────────────────────── */
.drs-user-avatar {
  position: relative;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
}
.navbar-item .drs-user-avatar img { max-height: none; }
.drs-avatar--lg { width: 5rem; height: 5rem; }

/* Profile (avatar + name/role) and logout share one row, pushed to
   opposite edges — regardless of breakpoint, since .navbar-item is only a
   flex container at desktop widths, block below that. */
.drs-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.drs-profile-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.drs-profile-item p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Theme toggle ────────────────────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 0.125rem;
  padding: 0.125rem;
  border-radius: 0.75rem;
  background-color: #f5f5f4;
}
[data-theme=dark] .theme-toggle { background-color: #292524; }

/* In the burger menu, stretch the pill to 80% of the item width instead of
   staying pinned to its compact desktop size, and let the buttons fill it
   evenly rather than leaving dead space after the last one. */
@media (max-width: 1023px) {
  .theme-toggle {
    width: 80%;
    margin: 0 auto;
  }
  .theme-toggle .theme-btn { flex: 1; }
}

.theme-btn {
  padding: 0.3rem;
  border-radius: 0.45rem;
  color: #a8a29e;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.theme-btn:hover { color: #78716c; background: transparent; }
[data-theme=dark] .theme-btn:hover { color: #d6d3d1; }
.theme-btn[data-active] { background: white; color: #1c1917; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
[data-theme=dark] .theme-btn[data-active] { background: #44403c; color: #fafaf9; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
}
[data-theme=dark] .footer {
  background-color: #1c1917;
  border-top: 1px solid #3d3830;
}

/* ── Bento card grid ─────────────────────────────────────────────────────── */
.bento-card-footer { border-top: 1px solid #e8e4e0; }
[data-theme=dark] .bento-card-footer { border-top-color: #3d3830; }

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 1024px) { .bento-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .bento-grid { grid-template-columns: 1fr; } }

.bento-card {
  background: white;
  border: 1px solid #e7e5e4;
  border-radius: 1.25rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  transition: box-shadow 0.2s, transform 0.2s;
  min-height: 160px;
  text-decoration: none;
  color: inherit;
}
.bento-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transform: translateY(-1px);
}
[data-theme=dark] .bento-card {
  background: #1c1917;
  border-color: #3d3830;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
[data-theme=dark] .bento-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.6); }

/* ── Stat card accents ───────────────────────────────────────────────────── */
.stat-card.stat-accent-amber   { border-left: 4px solid #fbbf24; }
.stat-card.stat-accent-violet  { border-left: 4px solid #a78bfa; }
.stat-card.stat-accent-emerald { border-left: 4px solid #6ee7b7; }
[data-theme=dark] .stat-card.stat-accent-amber   { border-left-color: #b45309; }
[data-theme=dark] .stat-card.stat-accent-violet  { border-left-color: #6d28d9; }
[data-theme=dark] .stat-card.stat-accent-emerald { border-left-color: #065f46; }

.stat-icon-indigo  { width:2.5rem;height:2.5rem;border-radius:0.75rem;background:#e0e7ff;display:flex;align-items:center;justify-content:center; }
.stat-icon-amber   { width:2.5rem;height:2.5rem;border-radius:0.75rem;background:#fef3c7;display:flex;align-items:center;justify-content:center; }
.stat-icon-violet  { width:2.5rem;height:2.5rem;border-radius:0.75rem;background:#ede9fe;display:flex;align-items:center;justify-content:center; }
.stat-icon-emerald { width:2.5rem;height:2.5rem;border-radius:0.75rem;background:#d1fae5;display:flex;align-items:center;justify-content:center; }
[data-theme=dark] .stat-icon-indigo  { background: #1e1b4b; }
[data-theme=dark] .stat-icon-amber   { background: #451a03; }
[data-theme=dark] .stat-icon-violet  { background: #2e1065; }
[data-theme=dark] .stat-icon-emerald { background: #052e16; }

.stat-value-amber  { color: #92400e; }
.stat-value-violet { color: #7c3aed; }
.stat-value-emerald { color: #059669; }
[data-theme=dark] .stat-value-amber   { color: #fbbf24; }
[data-theme=dark] .stat-value-violet  { color: #a78bfa; }
[data-theme=dark] .stat-value-emerald { color: #34d399; }

/* ── Stat cards ──────────────────────────────────────────────────────────── */
.stat-card {
  background: white;
  border: 1px solid #e7e5e4;
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
[data-theme=dark] .stat-card { background: #1c1917; border-color: #3d3830; }

/* ── Bulma tag is-light dark overrides ──────────────────────────────────── */
[data-theme=dark] .tag.is-light              { background-color: #2a2724; color: #c0bbb7; }
[data-theme=dark] .tag.is-success.is-light  { background-color: rgba(5,150,105,.18);  color: #6ee7b7; }
[data-theme=dark] .tag.is-danger.is-light   { background-color: rgba(220,38,38,.18);  color: #fca5a5; }
[data-theme=dark] .tag.is-warning.is-light  { background-color: rgba(217,119,6,.18);  color: #fcd34d; }
[data-theme=dark] .tag.is-info.is-light     { background-color: rgba(37,99,235,.18);  color: #93c5fd; }
[data-theme=dark] .tag.is-primary.is-light  { background-color: rgba(79,70,229,.18);  color: #a5b4fc; }

/* ── Bulma button is-light dark overrides ────────────────────────────────── */
[data-theme=dark] .button.is-danger.is-light {
  background-color: rgba(220, 38, 38, 0.15);
  color: #fca5a5;
  border-color: transparent;
}
[data-theme=dark] .button.is-danger.is-light:hover {
  background-color: rgba(220, 38, 38, 0.25);
  color: #fca5a5;
}
[data-theme=dark] .button.is-warning.is-light {
  background-color: rgba(217, 119, 6, 0.15);
  color: #fcd34d;
  border-color: transparent;
}
[data-theme=dark] .button.is-warning.is-light:hover {
  background-color: rgba(217, 119, 6, 0.25);
  color: #fcd34d;
}
[data-theme=dark] .button.is-success.is-light {
  background-color: rgba(5, 150, 105, 0.15);
  color: #6ee7b7;
  border-color: transparent;
}
[data-theme=dark] .button.is-success.is-light:hover {
  background-color: rgba(5, 150, 105, 0.25);
  color: #6ee7b7;
}

/* ── Bulma notification dark overrides ───────────────────────────────────── */
[data-theme=dark] .notification.is-danger.is-light {
  background-color: rgba(220, 38, 38, 0.15);
  color: #fca5a5;
}
[data-theme=dark] .notification.is-warning.is-light {
  background-color: rgba(217, 119, 6, 0.15);
  color: #fcd34d;
}
[data-theme=dark] .notification.is-success.is-light {
  background-color: rgba(5, 150, 105, 0.15);
  color: #6ee7b7;
}
[data-theme=dark] .notification.is-info.is-light {
  background-color: rgba(37, 99, 235, 0.15);
  color: #93c5fd;
}

/* ── Status badges ───────────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-draft      { background: #f4f4f5; color: #71717a; }
.status-pending    { background: #fef3c7; color: #d97706; }
.status-approved   { background: #dbeafe; color: #2563eb; }
.status-rejected   { background: #fee2e2; color: #dc2626; }
.status-inprogress { background: #ede9fe; color: #7c3aed; }
.status-completed  { background: #d1fae5; color: #059669; }
.status-failed     { background: #fef2f2; color: #991b1b; }
.status-cancelled  { background: #f4f4f5; color: #71717a; }

/* Inline status select */
.status-select {
  appearance: none;
  padding: 0.2rem 1.6rem 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  min-width: 8rem;
  outline: none;
  transition: opacity 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23555' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  background-size: 0.6em;
  font-family: inherit;
}
.status-select:hover { opacity: 0.85; }
.status-select.status-draft      { background-color: #f4f4f5; color: #71717a; }
.status-select.status-pending    { background-color: #fef3c7; color: #d97706; }
.status-select.status-approved   { background-color: #dbeafe; color: #2563eb; }
.status-select.status-rejected   { background-color: #fee2e2; color: #dc2626; }
.status-select.status-inprogress { background-color: #ede9fe; color: #7c3aed; }
.status-select.status-completed  { background-color: #d1fae5; color: #059669; }
.status-select.status-failed     { background-color: #fef2f2; color: #991b1b; }
.status-select.status-cancelled  { background-color: #f4f4f5; color: #71717a; }

/* ── Priority pips ───────────────────────────────────────────────────────── */
.priority-pip {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  flex-shrink: 0;
}
.priority-low      { background: #9ca3af; }
.priority-medium   { background: #60a5fa; }
.priority-high     { background: #f97316; }
.priority-critical { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.25); }

/* ── Tags ────────────────────────────────────────────────────────────────── */
.tag-drs {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.65rem;
  font-weight: 500;
  background: #f1f5f9;
  color: #475569;
  letter-spacing: 0.01em;
}
[data-theme=dark] .tag-drs { background: #292524; color: #a8a29e; }

.group-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  background: #eff6ff;
  color: #1d4ed8;
  letter-spacing: 0.01em;
  max-width: 9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
[data-theme=dark] .group-badge { background: rgba(37,99,235,.18); color: #93c5fd; }

.campaign-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  background: #f5f3ff;
  color: #7c3aed;
  letter-spacing: 0.01em;
  max-width: 9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
[data-theme=dark] .campaign-badge { background: rgba(124,58,237,.18); color: #c4b5fd; }

/* ── File upload ─────────────────────────────────────────────────────────── */
/* Bulma uses height:2.5em — relative to font-size, so mismatched font-sizes
   between .file-cta and .file-name produce unequal heights. Fix with rem. */
.file .file-cta,
.file .file-name {
  height: 2.5rem;
  font-size: 0.875rem;
}
.file.is-small .file-cta,
.file.is-small .file-name {
  height: 1.875rem;
  font-size: 0.75rem;
}
/* Bulma's block-spacing rule adds margin-bottom to .file:not(:last-child),
   which shifts vertical alignment inside flex rows. */
.is-flex > .file {
  margin-bottom: 0;
}

/* ── Form elements ───────────────────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #44403c;
  margin-bottom: 0.35rem;
}
[data-theme=dark] .form-label { color: #c0bbb7; }

.form-input {
  width: 100%;
  height: 2.5rem;
  padding: 0 0.85rem;
  border: 1.5px solid #ccc8c4;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  color: #1c1917;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}
.form-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.form-input::placeholder { color: #a8a29e; }
textarea.form-input { line-height: 1.5; height: auto; padding-top: 0.55rem; padding-bottom: 0.55rem; }
select.form-input { cursor: pointer; }
.form-input-readonly { background-color: #f5f5f4; color: #78716c; cursor: not-allowed; }
.form-input-narrow { width: auto; max-width: 10rem; flex-shrink: 0; }

[data-theme=dark] .form-input { background: #201e1c; border-color: #4a4540; color: #fafaf9; }
[data-theme=dark] .form-input:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(129,140,248,.15); }
[data-theme=dark] .form-input::placeholder { color: #6b6560; }
[data-theme=dark] .form-input-readonly { background: #161412; color: #6b6560; }

/* ── Markdown + math prose ───────────────────────────────────────────────── */
.prose-md p          { margin: 0.35em 0; }
.prose-md p:first-child { margin-top: 0; }
.prose-md p:last-child  { margin-bottom: 0; }
.prose-md ul, .prose-md ol { margin: 0.4em 0 0.4em 1.4em; }
.prose-md ul         { list-style: disc; }
.prose-md ol         { list-style: decimal; }
.prose-md li         { margin: 0.15em 0; }
.prose-md blockquote { border-left: 3px solid #d6d3d1; padding-left: 0.9em; margin: 0.5em 0; color: #57534e; }
.prose-md table      { width: 100%; margin: 0.5em 0; border-collapse: collapse; font-size: 0.95em; }
.prose-md th, .prose-md td { border: 1px solid #e7e5e4; padding: 0.35em 0.6em; text-align: left; }
.prose-md th         { background: #f5f5f4; font-weight: 600; }
.prose-md code       { background: #e7e5e4; border-radius: 4px; padding: 0.1em 0.35em; font-size: 0.875em; }
.prose-md pre        { background: #1c1917; color: #e7e5e4; border-radius: 10px; padding: 0.75em 1em; overflow-x: auto; margin: 0.5em 0; }
.prose-md pre code   { background: none; padding: 0; }
.prose-md strong     { font-weight: 600; }
.prose-md em         { font-style: italic; }
.prose-md a          { color: #4f46e5; text-decoration: underline; }
.prose-md h1, .prose-md h2, .prose-md h3,
.prose-md h4, .prose-md h5, .prose-md h6 { font-weight: 600; line-height: 1.3; margin: 0.6em 0 0.3em; }
.prose-md h1:first-child, .prose-md h2:first-child, .prose-md h3:first-child,
.prose-md h4:first-child, .prose-md h5:first-child, .prose-md h6:first-child { margin-top: 0; }
.prose-md h1 { font-size: 1.5em; }
.prose-md h2 { font-size: 1.3em; }
.prose-md h3 { font-size: 1.15em; }
.prose-md h4 { font-size: 1.05em; }
.prose-md h5 { font-size: 1em; }
.prose-md h6 { font-size: 0.95em; color: #78716c; }
[data-theme=dark] .prose-md code { background: #44403c; color: #e7e5e4; }
[data-theme=dark] .prose-md a    { color: #818cf8; }
[data-theme=dark] .prose-md h6   { color: #a09b97; }
[data-theme=dark] .prose-md blockquote { border-left-color: #57534e; color: #a8a29e; }
[data-theme=dark] .prose-md th, [data-theme=dark] .prose-md td { border-color: #44403c; }
[data-theme=dark] .prose-md th   { background: #292524; }

/* ── Assignment select ───────────────────────────────────────────────────── */
.assign-select {
  appearance: none;
  width: 100%;
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  border: 1.5px solid #ccc8c4;
  border-radius: 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1c1917;
  background-color: white;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 0.7em;
  font-family: inherit;
}
.assign-select:hover  { border-color: #d6d3d1; }
.assign-select:focus  { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
[data-theme=dark] .assign-select {
  background-color: #201e1c;
  border-color: #4a4540;
  color: #e7e5e4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
}
[data-theme=dark] .assign-select:hover { border-color: #57534e; }

/* ── Inline priority select ──────────────────────────────────────────────── */
.priority-select {
  appearance: none;
  padding: 0.15rem 1.4rem 0.15rem 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  outline: none;
  transition: opacity 0.15s;
  background-color: #f1f5f9;
  color: #475569;
  min-width: 5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23555' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  background-size: 0.6em;
  font-family: inherit;
}
.priority-select:hover { opacity: 0.8; }
.priority-select.priority-low      { background-color: #f1f5f9; color: #475569; }
.priority-select.priority-medium   { background-color: #dbeafe; color: #2563eb; }
.priority-select.priority-high     { background-color: #ffedd5; color: #c2410c; }
.priority-select.priority-critical { background-color: #fee2e2; color: #dc2626; }

/* ── Event timeline ──────────────────────────────────────────────────────── */
.event-comment  { background: #fafaf9; border: 1px solid #e7e5e4; }
.event-internal { background: #fffbeb; border: 1px solid #fde68a; }
[data-theme=dark] .event-comment  { background: #252220; border-color: #3d3830; }
[data-theme=dark] .event-internal { background: #251800; border-color: #6b3a0a; }
.form-input.is-internal { background: #fffbeb; border-color: #fde68a; }
[data-theme=dark] .form-input.is-internal { background: #251800; border-color: #6b3a0a; }

/* ── Batch checkboxes ────────────────────────────────────────────────────── */
.batch-cb {
  appearance: none;
  width: 1rem;
  height: 1rem;
  border: 1.5px solid #ccc8c4;
  border-radius: 0.25rem;
  background: white;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.15s, background-color 0.15s;
  vertical-align: middle;
}
.batch-cb:hover { border-color: #6366f1; }
.batch-cb:checked {
  background: #4f46e5;
  border-color: #4f46e5;
}
.batch-cb:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 6px;
  border: 2px solid white;
  border-top: none;
  border-right: none;
  transform: translate(-50%, -65%) rotate(-45deg);
}
[data-theme=dark] .batch-cb {
  background: #201e1c;
  border-color: #4a4540;
}
[data-theme=dark] .batch-cb:hover { border-color: #818cf8; }
[data-theme=dark] .batch-cb:checked {
  background: #6366f1;
  border-color: #6366f1;
}

/* ── Navbar separator ────────────────────────────────────────────────────── */
.navbar-separator {
  width: 1px; height: 1.5rem;
  background: #e7e5e4;
  margin: 0 0.25rem;
}
[data-theme=dark] .navbar-separator { background: #3d3830; }

/* Horizontal divider between nav links and theme/profile/logout in the
   burger menu, where everything stacks in one column. */
.navbar-mobile-divider {
  border: none;
  border-top: 1px solid #e7e5e4;
  margin: 0.5rem 1.5rem;
}
[data-theme=dark] .navbar-mobile-divider { border-top-color: #3d3830; }

/* ── Login header ────────────────────────────────────────────────────────── */
.login-header {
  background: linear-gradient(to bottom, #eef2ff, white);
}
[data-theme=dark] .login-header {
  background: linear-gradient(to bottom, #1e1b4b, #1c1917);
}

/* ── Violet button (In Progress batch action) ────────────────────────────── */
.btn-violet {
  background: #7c3aed;
  color: white;
  border: none;
}
.btn-violet:hover { background: #6d28d9; color: white; }
[data-theme=dark] .btn-violet { background: #5b21b6; }
[data-theme=dark] .btn-violet:hover { background: #4c1d95; }

/* ── Batch toolbar separator ─────────────────────────────────────────────── */
.batch-separator {
  width: 1px; height: 1rem;
  background: #c7d2fe;
}
[data-theme=dark] .batch-separator { background: #3730a3; }

/* ── Batch toolbar ───────────────────────────────────────────────────────── */
.batch-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 1rem;
  padding: 0.6rem 1.25rem;
}
[data-theme=dark] .batch-toolbar { background: #1e1b4b; border-color: #3730a3; }

/* ── Prose display blocks ────────────────────────────────────────────────── */
.prose-block {
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 0.75rem;
  padding: 1rem;
}
[data-theme=dark] .prose-block { background: #252220; border-color: #3d3830; }

.prose-block-notes {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 0.75rem;
  padding: 0.75rem;
}
[data-theme=dark] .prose-block-notes { background: #2a1d00; border-color: #8a6500; }

/* ── Detail items ────────────────────────────────────────────────────────── */
.detail-item {
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 0.75rem;
  padding: 0.75rem;
}
.detail-item--required { background: #fff5f5; border-color: #fecaca; }
[data-theme=dark] .detail-item { background: #252220; border-color: #3d3830; }
[data-theme=dark] .detail-item--required {
  background: rgba(69, 10, 10, 0.18);
  border-color: rgba(127, 29, 29, 0.35);
}

.detail-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b6560;
}
.detail-value {
  display: block;
  font-size: 0.875rem;
  color: #1c1917;
  margin-top: 0.2rem;
}
[data-theme=dark] .detail-label { color: #a8a49f; }
[data-theme=dark] .detail-value { color: #ece8e4; }

/* ── Status badge / select dark variants ────────────────────────────────── */
[data-theme=dark] .status-draft,      [data-theme=dark] .status-select.status-draft      { background: #3f3f46; color: #a1a1aa; }
[data-theme=dark] .status-pending,    [data-theme=dark] .status-select.status-pending    { background: #451a03; color: #fbbf24; }
[data-theme=dark] .status-approved,   [data-theme=dark] .status-select.status-approved   { background: #1e3a5f; color: #60a5fa; }
[data-theme=dark] .status-rejected,   [data-theme=dark] .status-select.status-rejected   { background: #450a0a; color: #f87171; }
[data-theme=dark] .status-inprogress, [data-theme=dark] .status-select.status-inprogress { background: #2e1065; color: #a78bfa; }
[data-theme=dark] .status-completed,  [data-theme=dark] .status-select.status-completed  { background: #052e16; color: #34d399; }
[data-theme=dark] .status-failed,     [data-theme=dark] .status-select.status-failed     { background: #450a0a; color: #fca5a5; }
[data-theme=dark] .status-cancelled,  [data-theme=dark] .status-select.status-cancelled  { background: #3f3f46; color: #a1a1aa; }

/* ── Priority select dark variants ──────────────────────────────────────── */
[data-theme=dark] .priority-select.priority-low      { background-color: #292524; color: #a8a29e; }
[data-theme=dark] .priority-select.priority-medium   { background-color: #1e3a5f; color: #60a5fa; }
[data-theme=dark] .priority-select.priority-high     { background-color: #431407; color: #fb923c; }
[data-theme=dark] .priority-select.priority-critical { background-color: #450a0a; color: #f87171; }

/* ── Dark scrollbar ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d4d4; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #a3a3a3; }
[data-theme=dark] ::-webkit-scrollbar-thumb { background: #57534e; }
[data-theme=dark] ::-webkit-scrollbar-thumb:hover { background: #78716c; }

/* ── HTMX loading indicator ──────────────────────────────────────────────── */
.htmx-indicator { opacity: 0; transition: opacity 0.2s; }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator  { opacity: 1; }

/* ── Detail page card ────────────────────────────────────────────────────── */
.detail-card {
  background: white;
  border: 1px solid #e7e5e4;
  border-radius: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
[data-theme=dark] .detail-card { background: #1c1917; border-color: #3d3830; }

/* ── Request list card ───────────────────────────────────────────────────── */
.request-list-box {
  background: white;
  border: 1px solid #e7e5e4;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  overflow: hidden;
}
[data-theme=dark] .request-list-box { background: #1c1917; border-color: #3d3830; }

/* ── Icon buttons ────────────────────────────────────────────────────────── */
.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #d4d4d4;
  transition: color 0.15s, background-color 0.15s;
  line-height: 1;
}
.btn-icon:hover { color: #6366f1; background: #eef2ff; }
.btn-icon-danger:hover { color: #ef4444; background: #fee2e2; }
[data-theme=dark] .btn-icon { color: #57534e; }
[data-theme=dark] .btn-icon:hover { color: #818cf8; background: rgba(129,140,248,.12); }
[data-theme=dark] .btn-icon-danger:hover { color: #f87171; background: rgba(239,68,68,.12); }

/* ── Panel row (file list items, approval rows, etc.) ───────────────────── */
.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
}
[data-theme=dark] .panel-row { background: #252220; border-color: #3d3830; }
a.panel-row { text-decoration: none; color: inherit; }
a.panel-row:hover { border-color: #c7d2fe; }
[data-theme=dark] a.panel-row:hover { border-color: #4f46e5; }

.campaign-unassigned-box { border-left: 3px solid #f59e0b; }

/* ── Avatar circle ───────────────────────────────────────────────────────── */
.drs-avatar {
  position: relative;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
}
.drs-avatar img,
.drs-user-avatar img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Gap utilities (not in Bulma 1.0.4) ─────────────────────────────────── */
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem  !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem    !important; }
.gap-5 { gap: 1.5rem  !important; }
.gap-6 { gap: 3rem    !important; }

/* ── Divider utilities ───────────────────────────────────────────────────── */
.has-divider-top    { border-top:    1px solid #e0dcd8; }
.has-divider-bottom { border-bottom: 1px solid #e0dcd8; }
[data-theme=dark] .has-divider-top    { border-top-color:    #3d3830; }
[data-theme=dark] .has-divider-bottom { border-bottom-color: #3d3830; }

/* Table row borders inside the request list box */
[data-theme=dark] .request-list-box tr { border-bottom: 1px solid #3d3830 !important; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-card-head,
.modal-card-foot { padding: .75rem 1.25rem; }
.modal-card-foot { gap: .5rem; }

/* ── Misc helpers ────────────────────────────────────────────────────────── */
.is-capitalized { text-transform: capitalize; }
.is-truncated   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-shrink-0    { flex-shrink: 0; }
.is-grow-1      { flex-grow: 1; }
.min-w-0        { min-width: 0; }
.ml-auto        { margin-left: auto !important; }
