.crqqb {
  /* Dark Modern theme variables.  The line colour defines soft
     separators, ink is the primary text colour and muted is used
     for secondary labels.  These values create a high‑contrast
     interface on a dark backdrop. */
  --line: #32425c;
  --ink: #e5e7eb;
  --muted: #9ca3af;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: var(--ink);
  background-color: #0f172a;
  padding: 8px;
  border-radius: 8px;
}
.crqqb * { box-sizing: border-box; }
.crqqb .crq-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}
.crqqb label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.crqqb .crq-input,
.crqqb .crq-select,
.crqqb .crq-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  font-size: 14px;
  background-color: #1e293b;
  color: var(--ink);
}
.crqqb .crq-textarea { min-height: 92px; }
.crqqb .section-title {
  font-weight: 600;
  font-size: 18px;
  margin-top: 20px;
  margin-bottom: 12px;
  color: var(--ink);
}
.crqqb .crq-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  background-color: #1e293b;
}
.crqqb .crq-table-wrap table {
  /* Ensure item table cells are wider by setting a minimum width; horizontal scroll will appear if needed */
  min-width: 1100px;
}
.crqqb table { width:100%; border-collapse:collapse; font-size:13px; }
.crqqb thead th {
  position: sticky;
  top: 0;
  background: #1e293b;
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 8px;
  color: var(--ink);
}
.crqqb tbody td {
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  color: var(--ink);
}
.crqqb .actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.crqqb .crq-btn {
  background: #334155;
  color: #f1f5f9;
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease-in-out;
}
.crqqb .crq-btn:hover {
  background: #475569;
}
.crqqb .crq-btn.secondary {
  background: #475569;
}
.crqqb .sticky-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #1e293b;
  border-top: 1px solid var(--line);
}
.crqqb .muted { color: var(--muted); }
.crqqb .small { font-size: 12px; color: var(--muted); }

/* Mobile-friendly adjustments */
@media (max-width: 640px) {
  /* Stack all grid items vertically on small screens */
  .crqqb .crq-grid {
    grid-template-columns: 1fr;
  }
  /* Ensure inputs and selects fill available width */
  .crqqb .crq-input,
  .crqqb .crq-select,
  .crqqb .crq-textarea {
    width: 100%;
  }
  /* Tables become horizontally scrollable */
  .crqqb .crq-table-wrap {
    overflow-x: auto;
  }
  /* Buttons stack vertically with full width */
  .crqqb .actions {
    flex-direction: column;
  }
  .crqqb .crq-btn {
    width: 100%;
    text-align: center;
  }
  .crqqb .sticky-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Preview table numeric alignment and optional column visibility */
.crqqb table { table-layout: fixed; }
.crqqb thead th:nth-child(5), .crqqb tbody td:nth-child(5),
.crqqb thead th:nth-child(6), .crqqb tbody td:nth-child(6),
.crqqb thead th:nth-child(7), .crqqb tbody td:nth-child(7),
.crqqb thead th:nth-child(8), .crqqb tbody td:nth-child(8),
.crqqb thead th:nth-child(9), .crqqb tbody td:nth-child(9),
.crqqb thead th:nth-child(12), .crqqb tbody td:nth-child(12) { text-align: right; font-variant-numeric: tabular-nums; }

.crqqb .crq-suggestions {
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  max-height: 160px;
  overflow: auto;
  background: #1e293b;
}
.crqqb .crq-suggestion-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink);
}
.crqqb .crq-suggestion-item:hover {
  background: #334155;
}
