/* ============================================================
   UNIFRANZ VOD Ingesta — Design System (DARK · Amatista + Iris)
   Primary #7C4DFF (iris) · Bg #15101f (amethyst night)
   Card #221833 · Text #F2EBFA · accessible (contrast AA).
   ============================================================ */

/* Global guard: any element carrying the `hidden` attribute must not render,
   regardless of other `display` rules (.login-view, .modal-host, etc. had
   `display:flex` that overrode `hidden` and blocked/covered the UI). */
[hidden] {
  display: none !important;
}

:root {
  color-scheme: dark;

  --primary: #7c4dff; /* iris electric accent */
  --primary-dark: #6b3fe0;
  --primary-darker: #5925c7;
  --accent: #9b7cff; /* lighter iris */

  --light: #2c2042; /* dark surface-2 (was light lavender) */
  --lighter: #221833; /* card surface (was near-white) */

  --bg: #15101f; /* amethyst night background */
  --card-bg: #221833; /* card */
  --text: #f2ebfa; /* warm lavender off-white */
  --text-muted: #b8a6d8; /* muted lavender */

  /* Status colors tuned for dark (vivid + translucent bg) */
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.15);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.15);
  --error: #fb7185;
  --error-bg: rgba(251, 113, 133, 0.15);
  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.15);

  /* Gray scale INVERTED for dark: low numbers = dark surfaces, high = bright */
  --gray-50: #15101f;
  --gray-100: #1a1326;
  --gray-200: #221833; /* card */
  --gray-300: #2c2042; /* surface-2 */
  --gray-400: #3a2a55; /* border */
  --gray-500: #6b5b8a;
  --gray-600: #b8a6d8; /* text-muted */
  --gray-700: #d6c9ed;
  --gray-800: #f2ebfa; /* text */
  --gray-900: #ffffff;

  --white: #ffffff; /* KEEP white — text ON the iris buttons */
  --border: #3a2a55;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --ring: 0 0 0 3px rgba(124, 77, 255, 0.4);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, monospace;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-400) transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--gray-100);
}
::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  color: var(--accent);
  line-height: 1.25;
}

a {
  color: var(--accent);
}

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s,
    transform 0.05s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}
.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}
/* Q2 (UX-21/22): icon-only buttons get a >=44px touch target (mobile) */
.btn.btn-icon {
  min-height: 44px;
  min-width: 44px;
}
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--gray-400);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--gray-300);
  border-color: var(--primary);
}
.btn-danger {
  background: var(--error);
  color: var(--white);
  border-color: var(--error);
}
.btn-danger:hover:not(:disabled) {
  background: #e11d48;
}
.btn-success {
  background: var(--success);
  color: var(--white);
  border-color: var(--success);
}
.btn-light {
  background: var(--gray-300);
  color: var(--accent);
  border-color: var(--gray-400);
}
.btn-light:hover:not(:disabled) {
  background: var(--gray-400);
}
.btn-block {
  width: 100%;
}

/* ===================== Login ===================== */
.login-view {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #2c2042 0%, #15101f 100%);
}
.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.login-logo {
  display: inline-block;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
  font-size: 14px;
  background: var(--gray-300);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.login-card h1 {
  font-size: 26px;
  margin-bottom: 8px;
}
.login-sub {
  color: var(--text-muted);
  margin: 0 0 28px;
  font-size: 15px;
}
.login-note {
  margin: 20px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===================== App layout ===================== */
.app-view {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.app-header {
  background: var(--gray-100);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--gray-900);
}
.brand-org {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-email {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.admin-badge {
  background: var(--primary);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}
.superadmin-badge {
  background: #fbbf24;
  color: #1f2937;
}

/* ===================== Tabs ===================== */
.tabs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.tab:hover {
  color: var(--accent);
}
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--primary);
}

.app-main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 48px;
}
.tab-panel {
  display: none;
  animation: fade 0.2s ease;
}
.tab-panel.active {
  display: block;
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-footer {
  border-top: 1px solid var(--border);
  background: var(--gray-100);
  padding: 10px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.health-status {
  color: var(--success);
  font-size: 14px;
}

/* ===================== Cards & sections ===================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.section-sub {
  color: var(--text-muted);
  margin: 0 0 20px;
  font-size: 14px;
}
.grid {
  display: grid;
  gap: 20px;
}
.grid-2 {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 760px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ===================== Forms ===================== */
.form-group {
  margin-bottom: 16px;
}
.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.form-row > .form-group {
  flex: 1;
  min-width: 140px;
}
label.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
label.field-label .req {
  color: var(--error);
}
.field-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
input[type="text"],
input[type="email"],
input[type="search"],
input[type="date"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-400);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--gray-300);
  caret-color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder,
textarea::placeholder {
  color: var(--gray-500);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
input.invalid,
select.invalid {
  border-color: var(--error);
  background: var(--error-bg);
}
.slug-preview {
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--gray-300);
  border: 1px dashed var(--primary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--accent);
  font-family: var(--mono);
  word-break: break-all;
}
.slug-preview .arrow {
  color: var(--primary);
  font-weight: 700;
  margin-right: 6px;
}
.radio-group {
  display: flex;
  gap: 16px;
}
.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--gray-400);
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.15s;
}
.radio-pill input {
  width: auto;
  accent-color: var(--primary);
}
.radio-pill:has(input:checked) {
  border-color: var(--primary);
  background: rgba(124, 77, 255, 0.15);
  color: var(--accent);
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
}
.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}
.checkbox-row label {
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
}
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ===================== Drag & drop ===================== */
.dropzone {
  border: 2px dashed var(--gray-400);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--gray-50);
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: var(--gray-300);
}
.dropzone-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 8px;
}
.dropzone-title {
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 4px;
}
.dropzone-hint {
  font-size: 13px;
  color: var(--text-muted);
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-300);
  border: 1px solid var(--primary);
  border-radius: 20px;
  padding: 8px 14px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}
.file-chip .remove {
  cursor: pointer;
  font-weight: 700;
}
.alert {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn);
}
.alert-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error);
}
.alert-info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info);
}
.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success);
}

/* ===================== Tables ===================== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th,
table.data td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data th {
  background: var(--gray-300);
  font-weight: 600;
  color: var(--gray-700);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
}
table.data tbody tr:hover {
  background: rgba(124, 77, 255, 0.08);
}
table.data tbody tr:last-child td {
  border-bottom: none;
}
.cell-break {
  white-space: normal;
  word-break: break-word;
}
.muted {
  color: var(--text-muted);
}
.mono {
  font-family: var(--mono);
  font-size: 12px;
}
.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Status pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pill-pending {
  background: var(--gray-100);
  color: var(--text-muted);
  border: 1px solid var(--gray-400);
}
.pill-processing {
  background: var(--info-bg);
  color: var(--info);
}
.pill-done {
  background: var(--success-bg);
  color: var(--success);
}
.pill-failed {
  background: var(--error-bg);
  color: var(--error);
}
.pill-done-icon {
  color: var(--success);
}
.pill-failed-icon {
  color: var(--error);
}

/* Progress bar */
.progress {
  width: 110px;
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.5s ease;
}
.progress-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
  font-weight: 600;
}

/* ===================== Filters bar ===================== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.filters .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filters .field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}
.filters input,
.filters select {
  min-width: 130px;
  padding: 8px 10px;
  font-size: 13px;
}
.filters-spacer {
  flex: 1;
}

/* ===================== Native selects on dark theme ===================== */
/* B14: <option> elements inherit OS colors and render unreadable (dark on
   dark / white on white) unless both the select and its options get explicit
   background/color. Applies app-wide: config editor, create-user modal,
   change-role select, etc. Matches the .filters selects treatment. */
select {
  color: var(--text);
  background: var(--gray-300);
  border: 1px solid var(--gray-400);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
}
select option,
select optgroup {
  background: var(--card-bg);
  color: var(--text);
}

/* ===================== Metrics ===================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.metric {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 6px;
}
.metric-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
  /* Q8 (UX-19): cifras alineadas en columna (los dígitos ocupan lo mismo) */
  font-variant-numeric: tabular-nums;
}
.metric-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===================== Pagination ===================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.page-info {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===================== Modal ===================== */
.modal-host {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
/* Respect the `hidden` attribute — without this the fixed overlay blocks the
   whole page (including the login button) even when no modal is shown. */
.modal-host[hidden] {
  display: none;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
}
.modal {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  animation: modalIn 0.18s ease;
}
.modal.modal-lg {
  max-width: 760px;
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.modal h3 {
  margin-bottom: 16px;
}

/* ===================== Spinner ===================== */
.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid var(--gray-400);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading-center {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

/* ===================== Toast ===================== */
.toast-host {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 40px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gray-400);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--text);
  min-width: 280px;
  max-width: 380px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}
.toast-show {
  opacity: 1;
  transform: translateX(0);
}
.toast-success {
  border-left-color: var(--success);
}
.toast-error {
  border-left-color: var(--error);
}
.toast-warn {
  border-left-color: var(--warn);
}
.toast-info {
  border-left-color: var(--info);
}
.toast-icon {
  font-size: 16px;
  line-height: 1;
}

/* ===================== Misc ===================== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.iframe-preview {
  background: #000;
  border-radius: var(--radius-sm);
  aspect-ratio: 16 / 9;
  width: 100%;
  border: none;
}
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 13px;
}
.kv dt {
  color: var(--text-muted);
  font-weight: 600;
}
.kv dd {
  margin: 0;
  font-family: var(--mono);
  word-break: break-all;
}
.code-block {
  background: var(--gray-100);
  color: #e5e7eb;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Responsive header */
@media (max-width: 560px) {
  .header-inner {
    flex-wrap: wrap;
  }
  .user-email {
    font-size: 12px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .brand-title {
    font-size: 13px;
  }
  .app-main {
    padding: 16px 12px 36px;
  }
  .card {
    padding: 16px;
  }
  .tab {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* ===================== C3: searchable course combobox ===================== */
.combo {
  position: relative;
  display: block;
  width: 100%;
}
.combo-input {
  width: 100%;
  cursor: text;
}
.combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 90;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--card-bg);
  border: 1px solid var(--gray-400);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
}
.combo-item {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}
.combo-item:hover,
.combo-item.active {
  background: rgba(124, 77, 255, 0.18);
  color: var(--gray-900);
}
.combo-item.selected {
  border-left: 3px solid var(--primary);
  padding-left: 7px;
  color: var(--accent);
  font-weight: 600;
}
.combo-empty {
  padding: 12px 10px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}
/* Combobox inside the filters bar keeps a readable width */
.filters .combo {
  min-width: 230px;
}

/* ===================== Q6 (UX-19): toast dismiss ===================== */
.toast-msg {
  flex: 1;
  min-width: 0;
}
.toast-close {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  margin: -2px -4px -2px 0;
}
.toast-close:hover,
.toast-close:focus-visible {
  color: var(--text);
  background: var(--gray-300);
  outline: none;
}

/* ===================== Q10 (UX-03): advanced options accordion ===================== */
details.adv {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  padding: 0 14px;
  margin-bottom: 16px;
}
details.adv > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 11px 0;
  user-select: none;
  list-style: none;
}
details.adv > summary::-webkit-details-marker {
  display: none;
}
details.adv > summary::before {
  content: "▸ ";
  color: var(--primary);
  font-size: 12px;
}
details.adv[open] > summary::before {
  content: "▾ ";
}
details.adv[open] > summary {
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  margin: 0 -14px 12px;
  padding: 11px 14px;
}
details.adv > .form-group:last-child {
  margin-bottom: 12px;
}

/* ===================== Q2: icon-only inline controls (queue ✕ etc.) ===================== */
.queue-row [role="button"],
.dthumb-chip [role="button"],
.qi-thumb-control {
  cursor: pointer;
}
