/* ===================================================================
   APTSENSO Desktop/Laptop Tweaks (non-invasive)
   - No renaming/removing classes/IDs
   - No base display/grid overrides
   - Only spacing/overflow/width polish for ≥1366px viewports
   =================================================================== */

/* ---------- Safe content width on very wide screens ---------- */
@media (min-width: 1600px) {
  .main-content {
    max-width: 1600px;   /* keep lines readable on ultrawide */
  }
}
@media (min-width: 1920px) {
  .main-content {
    max-width: 1680px;
  }
}

/* ---------- Tables: preserve alignment & allow scroll ---------- */
.results-table-wrap,
.table-wrap {
  overflow-x: auto;              /* instead of squishing/wrapping */
  -webkit-overflow-scrolling: touch;
}

/* Keep table fonts and spacing reasonable on laptops */
@media (max-width: 1440px) and (min-width: 1280px) {
  .results-table th, .results-table td,
  table.dash th, table.dash td,
  .manage-table th, .manage-table td {
    padding: 8px 10px;
  }
}

/* Don’t force fixed layout or widths; just avoid ugly wraps in tiny columns */
.results-table th, .results-table td,
table.dash th, table.dash td,
.manage-table th, .manage-table td {
  vertical-align: middle;
}

/* Remark cells are usually longer; allow wrapping only there if it exists
   (6th column in your Results table: Project, ID, Scan, User, Remark, Date…)
   If column order differs on a page, this rule has no harmful effect. */
.results-table tbody td:nth-child(6),
.results-table thead th:nth-child(6) {
  white-space: normal;
  line-height: 1.35;
}

/* Checkbox & action columns: nudge to be compact if your markup has them */
.results-table thead th:first-child,
.results-table tbody td:first-child {
  width: 44px;       /* small checkbox cell */
}
.results-table thead th:last-child,
.results-table tbody td:last-child,
.manage-table thead th:last-child,
.manage-table tbody td:last-child {
  white-space: nowrap;
}

/* ---------- Top control bars: let them breathe without changing layout ---------- */
/* We do NOT set display here (to avoid layout shifts). Just spacing + min widths */
@media (min-width: 1280px) {
  .results-controls,
  .manage-controls,
  .org-controls,
  .su-controls {
    gap: 8px 12px;            /* works if the container is flex; harmless otherwise */
  }
  .results-controls .results-search,
  .manage-controls input[type="search"] {
    min-width: 220px;
  }
}

/* Keep dropdowns from overflowing */
.results-download-dropdown { position: relative; }

/* ---------- Dashboard/KPIs: gentle gap tuning only ---------- */
@media (min-width: 1280px) {
  .kpi-grid { gap: 12px; }    /* don’t alter the number of columns */
}

/* ---------- Sidebar: do not change its layout, just ensure overflow scroll ---------- */
.sidebar {
  overflow-y: auto;
}

/* ---------- Carousel cards: prevent squish on 1366 widths ---------- */
@media (min-width: 1280px) and (max-width: 1440px) {
  .carousel-card { min-width: 240px; }
}

/* ---------- Detailed result: keep raw pre block scrollable ---------- */
#dr_raw {
  max-width: 100%;
  overflow: auto;
}

/* ---------- Buttons & inputs: subtle consistency without forcing size ---------- */
button,
.results-download-btn,
.auth-btn,
.btn {
  line-height: 1.1;
}

/* ---------- High-DPI SVG rendering tweak (no layout impact) ---------- */
svg { shape-rendering: geometricPrecision; text-rendering: optimizeLegibility; }
