/* Nymee — the applications table (2026-10-11): a dense, sortable ledger with a docked detail pane.
   Colours and type come from styles.css; everything table-specific lives here. */
body.wide main { max-width: none; padding: 12px 16px 24px; }

/* toolbar: status chips with faceted counts, search, portal, salary range, column/export buttons */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.toolbar .chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; }  /* styles.css gives .chips card padding */
.chips .chip {
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  padding: 4px 10px; font-size: 13px; line-height: 1.3;
}
.chips .chip b { font-weight: 600; font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.chips .chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--queued); }
.chips .chip .dot[data-status="running"] { background: var(--running); }
.chips .chip .dot[data-status="paused"] { background: var(--paused); }
.chips .chip .dot[data-status="submitted"] { background: var(--submitted); }
.chips .chip .dot[data-status="failed"] { background: var(--failed); }
.chips .chip .dot[data-status="skipped"], .chips .chip .dot[data-status="cancelled"] { background: var(--skipped); }
.chips .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--page); }
.chips .chip[aria-pressed="true"] b { color: var(--page); }
.chips .chip.zero { opacity: .55; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.tools input, .tools select { width: auto; padding: 6px 9px; font-size: 14px; }
#q { min-width: 240px; }
.range { display: inline-flex; gap: 4px; }
.range input { width: 88px; }
.btn.small { padding: 6px 10px; font-size: 14px; }
.count { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; min-height: 20px; }
.count .warn { color: var(--paused); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: inherit; text-decoration: underline; }

/* workbench: the table, and the pane docked to the right when a row is open */
.wb { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
body.pane-open .wb { grid-template-columns: minmax(0, 1fr) 460px; }
@media (min-width: 1500px) { body.pane-open .wb { grid-template-columns: minmax(0, 1fr) 540px; } }
.table-wrap {
  overflow: auto; max-height: calc(100vh - 200px); min-height: 160px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.table-wrap .empty { margin: 16px; }

/* the table: fixed layout driven by <colgroup> widths, sticky header and sticky actions column */
table.apps { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: 100%; font-size: 13px; }
table.apps thead th {
  position: sticky; top: 0; z-index: 1; background: var(--surface);
  height: 32px; padding: 0 8px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2);
  border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; -webkit-user-select: none;
}
table.apps thead th:hover { color: var(--ink); }
table.apps th.sorted { color: var(--ink); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
table.apps th .sa { margin-left: 4px; color: var(--accent); font-size: 10px; }
table.apps th .rz { position: absolute; top: 0; right: -5px; width: 10px; height: 100%; cursor: col-resize; z-index: 2; touch-action: none; }
table.apps th .rz::after { content: ""; position: absolute; left: 4px; top: 25%; width: 1px; height: 50%; background: var(--line); }
table.apps th .rz:hover::after, body.col-resizing table.apps th .rz::after { background: var(--accent); width: 2px; }
table.apps th.drop-before { box-shadow: inset 3px 0 0 var(--accent); }
table.apps th.drop-after { box-shadow: inset -3px 0 0 var(--accent); }
table.apps th.num, table.apps td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.apps td {
  height: 34px; padding: 4px 8px; border-bottom: 1px solid var(--line); vertical-align: middle;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
table.apps tbody tr { cursor: pointer; }
table.apps tbody tr:hover td { background: var(--page); }
table.apps tbody tr.sel td { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
/* the status stripe lives in the first cell; selection/cursor turn it into the accent bar */
table.apps tbody td:first-child { box-shadow: inset 3px 0 0 var(--queued); }
table.apps tbody tr[data-status="running"] td:first-child { box-shadow: inset 3px 0 0 var(--running); }
table.apps tbody tr[data-status="paused"] td:first-child { box-shadow: inset 3px 0 0 var(--paused); }
table.apps tbody tr[data-status="submitted"] td:first-child { box-shadow: inset 3px 0 0 var(--submitted); }
table.apps tbody tr[data-status="failed"] td:first-child { box-shadow: inset 3px 0 0 var(--failed); }
table.apps tbody tr[data-status="skipped"] td:first-child, table.apps tbody tr[data-status="cancelled"] td:first-child { box-shadow: inset 3px 0 0 var(--skipped); }
table.apps tbody tr.sel td:first-child, table.apps tbody tr.cur td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.apps tbody tr.cur td { outline: 1px dashed var(--accent); outline-offset: -1px; }
td.dash { color: var(--ink-2); }
td .sub { color: var(--ink-2); font-size: 12px; }
td a { color: inherit; text-decoration: none; }
td a:hover { color: var(--accent); text-decoration: underline; }

/* status badge: outline + tinted fill from the same per-status variable (dark mode comes free) */
.st {
  display: inline-block; max-width: 100%; padding: 1px 8px; border-radius: 10px; border: 1px solid currentColor;
  font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--queued);
  background: color-mix(in srgb, currentColor 12%, transparent);
}
.st[data-status="running"] { color: var(--running); }
.st[data-status="paused"] { color: var(--paused); }
.st[data-status="submitted"] { color: var(--submitted); }
.st[data-status="failed"] { color: var(--failed); }
.st[data-status="skipped"], .st[data-status="cancelled"] { color: var(--skipped); }
.pend {
  display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px;
  background: var(--paused); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 600;
}

/* actions column: sticky on the right; the pill shows on hover or on the selected row */
table.apps th.acts, table.apps td.acts { position: sticky; right: 0; text-align: right; padding-right: 6px; background: var(--surface); cursor: default; }
table.apps tbody tr:hover td.acts { background: var(--page); }
table.apps tbody tr.sel td.acts { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.pill-acts {
  display: inline-flex; gap: 2px; visibility: hidden; padding: 1px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
}
tr:hover .pill-acts, tr.sel .pill-acts, tr.cur .pill-acts { visibility: visible; }
.ra { width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; font-size: 14px; line-height: 24px; text-align: center; text-decoration: none; color: var(--ink); padding: 0; }
.ra:is(a) { font-weight: 600; }
.ra:hover { background: var(--page); }
.ra.ok { color: var(--submitted); }
.ra.danger { color: var(--failed); }
.ra.warn { color: var(--paused); }

/* the detail pane */
.pane {
  position: sticky; top: 62px; max-height: calc(100vh - 74px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 18px;
}
.pane[hidden] { display: none; }
.pane-head { display: flex; align-items: flex-start; gap: 10px; }
.pane-head .ttl { flex: 1; min-width: 0; }
.pane-head .ttl p { margin: 0; }
.pane-head .row-title { font-size: 17px; line-height: 1.3; }
.pane-head .row-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; }
.pane-head .close { flex: none; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-size: 16px; color: var(--ink-2); }
.pane-head .close:hover { color: var(--ink); background: var(--page); }
.pane .links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; font-size: 14px; }
.pane .kv { margin-top: 12px; font-size: 14px; grid-template-columns: 110px 1fr; }
.pane .actions { margin-top: 12px; }
.pane .actions .btn { padding: 7px 12px; font-size: 14px; }
.pane .panel { margin-top: 12px; padding: 12px 14px; }
.pane .panel h2 { margin: 0 0 8px; }
.pane textarea { min-height: 72px; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin: 16px 0 10px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 6px 7px; cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 13px; white-space: nowrap;
}
.tabs button b { font-weight: 600; color: var(--ink-2); font-size: 12px; margin-left: 4px; }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs button .pend { margin-left: 4px; }
.qa { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.qa li { padding: 8px 0; border-top: 1px solid var(--line); }
.qa li:first-child { border-top: 0; padding-top: 0; }
.qa .qt { margin: 0; color: var(--ink-2); }
.qa .an { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.qa .src { font-size: 12px; color: var(--ink-2); margin-left: 6px; }
.qa li.pending .an { color: var(--paused); font-weight: 600; }
.pane .timeline li { grid-template-columns: 56px 1fr; }
.pane .timeline .msg { overflow-wrap: anywhere; }
.pane .shots { margin-top: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.pane .placeholder { color: var(--ink-2); font-size: 14px; margin: 0; }
.pane .pane-empty { color: var(--ink-2); font-size: 14px; margin: 0; }

/* column menu (right-click on a header, or the «Колонки» button) */
.colmenu {
  position: fixed; z-index: 6; min-width: 230px; max-height: 70vh; overflow: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18); font-size: 14px;
}
.colmenu[hidden] { display: none; }
.colmenu button, .colmenu label {
  display: flex; width: 100%; align-items: center; gap: 8px; padding: 6px 8px; margin: 0;
  border: 0; border-radius: 4px; background: none; text-align: left; cursor: pointer; color: var(--ink); font-size: 14px;
}
.colmenu button:hover, .colmenu label:hover { background: var(--page); }
.colmenu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.colmenu .mh { padding: 4px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }

.hint { font-size: 12px; color: var(--ink-2); margin: 8px 0 0; }
#export-dlg .check { margin: 8px 0; }
#export-dlg .actions { margin-top: 14px; }

/* phones: no pane (rows open application.html), fewer columns (table.js picks them), inputs stack */
@media (max-width: 719px) {
  body.wide main { padding: 10px 10px 20px; }
  .pane, .hint { display: none !important; }
  body.pane-open .wb { grid-template-columns: minmax(0, 1fr); }
  .tools { margin-left: 0; width: 100%; }
  #q { min-width: 0; flex: 1 1 100%; }
  .range input { width: 80px; }
  .table-wrap { max-height: none; }
  /* the page scrolls, not the wrapper: a sticky header would slide under the site header (z-index 2) */
  table.apps thead th { position: static; }
  /* without a positioned th the resize handle escaped the table and widened the page by 5 px */
  table.apps th .rz { display: none; }
  table.apps td, table.apps th { padding-left: 6px; padding-right: 6px; }
}

/* the «Повідомлення» tab (2026-10-25): one block per recruiter conversation, bubbles from styles.css */
.pane .thread + .thread { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.pane .thread-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 14px; }
.pane .thread > .sub { margin: 0 0 8px; font-size: 13px; }
