/* A details panel for a selected list row (jobs-peek). Desktop: a slim panel pinned bottom right; phone: a sheet at the bottom of the screen. */
#app .jobs-table tbody tr, #app .cust-peekable tbody tr { cursor: pointer; }
#app .jobs-table tbody tr.jobs-peeked, #app .cust-peekable tbody tr.jobs-peeked { outline: 2px solid var(--km2-accent, #147d64); outline-offset: -2px; }
#app .jobs-peek { position: fixed; z-index: 40; right: 76px; bottom: 16px; width: 300px; max-height: calc(100vh - 140px); overflow: auto; padding: 12px 14px; border: 1px solid var(--km2-border-strong, #c9d6d1); border-radius: 12px; background: var(--km2-surface, #fff); box-shadow: 0 10px 30px rgba(0,0,0,.16); }
#app .jobs-peek header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
#app .jobs-peek .jobs-peek-x { border: 0; background: transparent; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 4px; color: inherit; }
#app .jobs-peek .jobs-peek-badges { margin: 6px 0; }
#app .jobs-peek dl { margin: 0; display: grid; grid-template-columns: 70px 1fr; gap: 4px 8px; font-size: .85rem; }
#app .jobs-peek dt { color: var(--km2-muted, #596a64); }
#app .jobs-peek dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
#app .jobs-peek .jobs-peek-text { max-height: 4.6em; overflow: hidden; }
#app .jobs-peek .jobs-peek-actions { display: flex; gap: 8px; margin-top: 10px; }
@media (max-width: 760px) { #app .jobs-peek { left: 8px; right: 8px; top: auto; bottom: 68px; width: auto; max-height: 50vh; border-radius: 14px; } }
/* Hidden helper text inside a scrolling table must not make the whole page scroll sideways. */
#app .page-content :is(.table-wrap, .jobs-table-wrap, .ticket-table, .table-scroll) { position: relative; }

/* Calmer page tops (2026-11-17): the Jobs list heading, quick filters and search share fewer rows; a hidden Smart summary is a small text link, not a boxed button; badges never break mid-word. */
#app .jobs-panel-header-action { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
#app .jobs-panel-header-action > .jobs-list-heading { flex: 1 1 auto; }
#app .jobs-panel-header-action > .jobs-quick { flex: 0 1 auto; margin: 0 !important; }
#app .jobs-panel-header-action > .jobs-filters-row { flex: 1 1 100%; }
#app .jobs-quick button { min-height: 28px !important; padding: 3px 10px !important; font-size: .76rem !important; }
#app .sg-off { text-align: right; margin: 0 !important; }
#app .sg-off .sg-link { background: none !important; border: 0 !important; box-shadow: none !important; min-height: 0 !important; padding: 0 4px !important; font-size: .72rem !important; }
#app .page-content .jobs-badge, #app .page-content .status-pill { white-space: nowrap; }
/* Tasks & projects: the four big overview tiles become one slim strip. */
#app .project-portfolio .portfolio-metrics { display: flex !important; flex-wrap: wrap; gap: 0 !important; border: 1px solid var(--km2-border-strong, #c9d6d1); border-radius: 10px; overflow: hidden; }
#app .project-portfolio .portfolio-metrics > button { flex: 1 1 140px; display: flex !important; align-items: baseline; gap: 8px; min-height: 0 !important; padding: 8px 12px !important; border: 0 !important; border-right: 1px solid var(--km2-border-strong, #c9d6d1) !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; text-align: left; }
#app .project-portfolio .portfolio-metrics > button strong { order: -1; font-size: 1.1rem; }
#app .project-portfolio .portfolio-metrics > button small { display: none; }
#app .project-portfolio .portfolio-metrics > button span { font-size: .76rem; }
#app .project-portfolio .portfolio-metrics > button.selected { background: rgba(31, 184, 140, .14) !important; }
/* Receivables: the invoice number and customer stack inside their column; a long customer name is cut with an ellipsis instead of overlapping the next column. */
#app .receivables-row .receivables-link { display: flex !important; flex-direction: column; align-items: flex-start; max-width: 100%; min-width: 0; box-sizing: border-box; }
#app .receivables-row .receivables-link strong { white-space: nowrap; }
#app .receivables-row .receivables-link small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Dispatch calendar: below 1100px the search and filter boxes were stacked in a tall column that pushed the calendar off the screen; keep them in one row. */
@media (max-width: 1100px) {
  #app .jobcalendar-toolbar { flex-direction: row !important; align-items: center !important; gap: 8px 12px !important; padding: 10px 14px !important; }
  #app .jobcalendar-toolbar-left { flex-direction: row !important; flex: 1 1 auto !important; align-items: center; gap: 8px !important; }
  #app .jobcalendar-toolbar-left > * { height: auto !important; flex: 0 1 auto !important; }
  #app .jobcalendar-search { flex: 1 1 200px !important; width: auto !important; min-width: 160px !important; }
  #app .jobcalendar-filter { width: auto !important; min-width: 130px !important; }
}
/* Support Desk overview: seven summary cells share one slim row instead of two rows of four. */
@media (min-width: 901px) {
  #app .app-layout:not(.mfg-shell) .page-content .ov-strip:has(> :nth-child(7)):not(:has(> :nth-child(8))) { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }
}
/* Wide tables with action buttons: buttons never wrap letter by letter; the table keeps its natural width and scrolls sideways inside its own box (Cybersecurity worklist). */
#app .sx-wide { min-width: max-content; }
#app .sx-wide td, #app .sx-wide th { white-space: nowrap; }
#app .sx-wide td:last-child { position: sticky; right: 0; background: var(--km2-surface, #fff); box-shadow: -6px 0 6px -6px rgba(0,0,0,.18); }
#app .page-content td > a.km-button, #app .page-content td > button.km-button, #app .page-content td > a.jobs-toggle-btn { white-space: nowrap; }
#app .page-content :is(.mfg-table-wrap, .table-wrap) { overflow-x: auto; max-width: 100%; }
/* The details panel must be solid in both themes: the dark theme contract makes every aside inside the page transparent, so the table showed through the text. */
html body #app .jobs-peek { background-color: var(--km2-surface, #fff) !important; background-image: none !important; color: var(--km2-text, inherit) !important; border: 1px solid var(--km2-border-strong, #c9d6d1) !important; box-shadow: 0 12px 34px rgba(0,0,0,.28) !important; opacity: 1 !important; z-index: 900 !important; }
html body #app .jobs-peek :is(header, dl, dt, dd, p, div) { background: transparent !important; }
html[data-theme="dark"] body #app .jobs-peek { background-color: #1a1e24 !important; border-color: #3a4450 !important; }
html[data-theme="dark"] body #app .jobs-peek dt { color: #9aa8b3 !important; }
/* New job from the dispatch calendar: the matching-customer list stays inside the dialog (capped height that scrolls, never wider than the form). */
#app .dispatch-matches { max-height: min(220px, 32vh); overflow-y: auto; overflow-x: hidden; min-width: 0; max-width: 100%; box-sizing: border-box; padding-right: 2px; overscroll-behavior: contain; }
#app .dispatch-match { min-width: 0; max-width: 100%; box-sizing: border-box; width: 100%; background: var(--km2-surface, #fff); }
#app .dispatch-match strong, #app .dispatch-match span { overflow-wrap: anywhere; min-width: 0; }
#app .jobcalendar-create-form-grid > * { min-width: 0; }