/* Fix rem base so Bootstrap scales consistently across browsers/OS font settings */
html { font-size: 14px; }

/* Sidebar layout: nowrap only from lg up, where the sidebar is an inline column;
   below lg it is an offcanvas drawer and rows must be free to wrap. */
.container-fluid > .row .col { min-width: 0; overflow-x: auto; }
.app-topnav { width: 100%; }

@media (min-width: 992px) {
  .container-fluid > .row { flex-wrap: nowrap !important; }
  .app-sidebar { flex: 0 0 clamp(8rem, 8%, 12rem); }
  .app-topnav { width: auto; }
}

/* Phones and small tablets: lists keep a readable width and scroll sideways. */
@media (max-width: 991.98px) {
  .dt-container .dt-layout-row { flex-wrap: wrap; gap: .5rem; }
  .dt-container .dt-layout-cell.dt-layout-full { overflow-x: auto; }
  .dt-container table.dataTable { min-width: var(--table-min-width, 60rem); }
  .dt-container table.dataTable th { white-space: nowrap; }
  /* !important: per-template #id rules (e.g. word-break:break-all) would otherwise win. */
  .dt-container table.dataTable th,
  .dt-container table.dataTable td { overflow-wrap: break-word !important; word-break: normal !important; }
  .dt-container .dtcc-search input { min-width: 6rem; }
  /* !important: inline table-layout:fixed on plain tables squeezes columns. */
  main table[style*="table-layout"] { table-layout: auto !important; min-width: var(--table-min-width, 60rem); }
}

/* Make negative numbers red in tables */
.num-neg,
th .num-neg,
.num-neg{color:#c00 !important}  /* negative numbers appear in red */

/* ── Drag-and-Drop File Upload Zone ──────────────────────────────────────── */
.drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  padding: .625rem 1rem;
  border: 2px dashed #adb5bd;
  border-radius: .375rem;
  background: #f8f9fa;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s ease, background .15s ease;
  overflow: hidden;
}
.drop-zone:hover,
.drop-zone--active {
  border-color: #0d6efd;
  background: #e8f0fe;
}
.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
  padding: 0;
}
.drop-zone__icon {
  font-size: 1.6rem;
  color: #6c757d;
  line-height: 1;
}
.drop-zone--active .drop-zone__icon,
.drop-zone:hover .drop-zone__icon { color: #0d6efd; }
.drop-zone__prompt {
  margin: .25rem 0 0;
  font-size: .8rem;
  color: #6c757d;
  pointer-events: none;
}
.drop-zone__file-name {
  margin-top: .25rem;
  font-size: .8rem;
  color: #0d6efd;
  font-weight: 600;
  word-break: break-all;
  pointer-events: none;
}