/* Yolt v11 — sortable column · cmd+K palette · inline tbl-search (Section 5a-C)
 */

/* ═════ C.1 sortable table ═════ */
.traffic-tbl {
  width: 100%; border-collapse: collapse;
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
  font-size: 12.5px;
}
.traffic-tbl thead th {
  background: var(--bg-2); color: var(--ink-1);
  text-align: left; padding: 8px var(--space-md);
  font-weight: 600; font-size: 12px;
  border-bottom: 1px solid var(--line);
  position: relative;
  white-space: nowrap;
  user-select: none;
}
.traffic-tbl thead th .head-row { display: inline-flex; align-items: center; gap: 6px; }
.traffic-tbl thead th .sort-ind {
  display: inline-block; width: 9px; height: 9px;
  position: relative; opacity: 0.4;
}
.traffic-tbl thead th .sort-ind::before, .traffic-tbl thead th .sort-ind::after {
  content: ""; position: absolute; left: 1px; width: 0; height: 0;
  border-left: 3.5px solid transparent; border-right: 3.5px solid transparent;
}
.traffic-tbl thead th .sort-ind::before { top: 0; border-bottom: 4px solid currentColor; }
.traffic-tbl thead th .sort-ind::after  { bottom: 0; border-top: 4px solid currentColor; }
.traffic-tbl thead th.sort-asc .sort-ind { opacity: 1; }
.traffic-tbl thead th.sort-asc .sort-ind::after { display: none; }
.traffic-tbl thead th.sort-desc .sort-ind { opacity: 1; }
.traffic-tbl thead th.sort-desc .sort-ind::before { display: none; }
.traffic-tbl thead th .filter-icon, .traffic-tbl thead th .kebab {
  border: none; background: transparent; color: var(--ink-3);
  cursor: pointer; width: 18px; height: 18px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 3px;
}
.traffic-tbl thead th .filter-icon:hover, .traffic-tbl thead th .kebab:hover { background: var(--bg-3); color: var(--ink-0); }
.traffic-tbl thead th .filter-icon.active { color: var(--brand); }
.traffic-tbl thead th .filter-icon svg, .traffic-tbl thead th .kebab svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.traffic-tbl thead th .resize {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 4px; cursor: col-resize;
}
.traffic-tbl thead th .resize:hover { background: var(--brand); }
.traffic-tbl tbody td {
  padding: 8px var(--space-md);
  border-bottom: 1px solid var(--line-soft);
  font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums;
  color: var(--ink-1);
}
.traffic-tbl tbody td:first-child { font-family: inherit; color: var(--ink-0); }
.traffic-tbl tbody tr:last-child td { border-bottom: none; }
.traffic-tbl tbody tr:hover td { background: var(--bg-2); }

/* column popovers */
.col-popover, .kebab-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--r-sm); box-shadow: 0 12px 32px color-mix(in oklch, oklch(0 0 0) 50%, transparent);
  padding: var(--space-sm); z-index: 50; min-width: 200px;
  display: none;
}
.col-popover.is-open, .kebab-menu.is-open { display: block; }
.col-popover .head { font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; padding-bottom: 4px; }
.col-popover input {
  width: 100%; background: var(--bg-0); border: 1px solid var(--line);
  border-radius: 3px; padding: 5px 8px; color: var(--ink-0); font: inherit; font-size: 12px;
  font-family: ui-monospace, monospace;
}
.col-popover input:focus { outline: none; border-color: var(--brand); }
.col-popover .acts { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.col-popover .acts button { border: none; background: transparent; color: var(--ink-2); font: inherit; font-size: 11.5px; padding: 4px 8px; border-radius: 3px; cursor: pointer; }
.col-popover .acts button:hover { background: var(--bg-2); color: var(--ink-0); }
.col-popover .acts button.primary { background: var(--brand); color: var(--bg-0); font-weight: 600; }
.col-popover .acts button.primary:hover { background: color-mix(in oklch, var(--brand) 80%, var(--ink-0)); }
.kebab-menu .item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 12.5px; color: var(--ink-1); border-radius: 3px; cursor: pointer; }
.kebab-menu .item:hover { background: var(--bg-2); color: var(--ink-0); }
.kebab-menu .item.warn { color: var(--bad); }
.kebab-menu .sep { border-top: 1px solid var(--line-soft); margin: 4px 0; }

/* ═════ C.2 search-palette ═════ */
.search-palette {
  position: absolute; left: 50%; top: 12%; transform: translateX(-50%);
  width: min(640px, calc(100% - 32px));
  max-height: 70%;
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: 0 24px 64px color-mix(in oklch, oklch(0 0 0) 60%, transparent);
  display: flex; flex-direction: column;
  z-index: 300;
}
.sp-h {
  display: flex; align-items: center; gap: 10px;
  padding: 10px var(--space-md);
  border-bottom: 1px solid var(--line-soft);
}
.sp-h svg { width: 16px; height: 16px; stroke: var(--ink-3); fill: none; stroke-width: 1.5; flex: none; }
.sp-h input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--ink-0); font: inherit; font-size: 14px;
}
.sp-h input::placeholder { color: var(--ink-4); }
.sp-h .esc-hint { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-3); font-family: ui-monospace, monospace; }
.sp-body { flex: 1; overflow-y: auto; padding: 6px; }
.sp-group { margin-bottom: 4px; }
.sp-group .group-label { padding: 6px 12px 4px; font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; }
.sp-result {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 12.5px; color: var(--ink-1);
}
.sp-result:hover, .sp-result.active { background: var(--bg-2); color: var(--ink-0); }
.sp-result svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; flex: none; color: var(--ink-3); }
.sp-result .label { flex: 1; }
.sp-result mark { background: color-mix(in oklch, var(--brand) 30%, transparent); color: var(--ink-0); padding: 0 2px; border-radius: 2px; }
.sp-result .hint { font-family: ui-monospace, monospace; font-size: 10.5px; color: var(--ink-3); }

/* ═════ C.3 tbl-search ═════ */
.tbl-search {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 4px 8px;
  height: 30px; min-width: 280px;
}
.tbl-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in oklch, var(--brand) 22%, transparent); }
.tbl-search svg { width: 12px; height: 12px; stroke: var(--ink-3); fill: none; stroke-width: 1.5; flex: none; }
.tbl-search input { flex: 1; background: transparent; border: none; outline: none; color: var(--ink-0); font: inherit; font-size: 12.5px; min-width: 0; }
.tbl-search input::placeholder { color: var(--ink-4); }
.tbl-search .clear { border: none; background: transparent; color: var(--ink-3); cursor: pointer; width: 16px; height: 16px; padding: 0; border-radius: 50%; font-family: ui-monospace, monospace; }
.tbl-search .clear:hover { background: var(--bg-2); color: var(--ink-0); }
.tbl-search .count-chip {
  font-family: ui-monospace, monospace; font-size: 10.5px;
  color: var(--ink-3); background: var(--bg-2);
  padding: 1px 6px; border-radius: 3px;
}

.batch-foot {
  border-top: 1px solid var(--line-soft); padding-top: var(--space-md);
  font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--ink-3);
  display: flex; flex-wrap: wrap; gap: var(--space-md);
}
.batch-foot b { color: var(--ink-1); font-weight: 600; }