/* FK Command Center — Tabulator brand overrides.
 *
 * Loaded AFTER the vendor tabulator.min.css so these rules win on
 * specificity. Targets the wrapper class `fk-table` (added by
 * fkTabulator() defaults) so non-FK Tabulator instances on the same
 * page are untouched.
 *
 * Conventions:
 *   - Brand tokens duplicated as literals here (CSS vars work too,
 *     but Tabulator generates many sub-elements where ::before pseudo
 *     content needs concrete values — literals avoid edge cases).
 *   - DM Mono on numeric cells; Syne on headers.
 *   - Mobile-collapse expand-row uses the same dark/gold tokens.
 */

.tabulator.fk-table,
.tabulator.fk-table .tabulator-tableholder,
.tabulator.fk-table .tabulator-header,
.tabulator.fk-table .tabulator-footer {
  background: #111111;            /* --bg2 */
  border-color: rgba(201,168,76,0.15);
  color: #F0EDE6;                 /* --text */
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
}

/* ── HEADER (Syne, gold accent on hover/sort) ──────────────────── */
.tabulator.fk-table .tabulator-header {
  background: #0A0A0A;            /* --bg, slightly darker than body */
  border-bottom: 1px solid rgba(201,168,76,0.25);
}
.tabulator.fk-table .tabulator-header .tabulator-col {
  background: transparent;
  border-right-color: rgba(201,168,76,0.10);
}
.tabulator.fk-table .tabulator-header .tabulator-col .tabulator-col-title {
  font-family: 'Syne', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #C9A84C;                 /* --gold */
  padding: 6px 4px;
}
.tabulator.fk-table .tabulator-header .tabulator-col.tabulator-sortable:hover {
  background: rgba(201,168,76,0.06);
  cursor: pointer;
}

/* Sort arrows — pure gold, no defaults. */
.tabulator.fk-table .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {
  border-bottom-color: #C9A84C;
}
.tabulator.fk-table .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="descending"] .tabulator-arrow {
  border-top-color: #C9A84C;
  border-bottom-color: transparent;
}

/* ── BODY ROWS ─────────────────────────────────────────────────── */
.tabulator.fk-table .tabulator-row {
  background: transparent;
  border-bottom: 1px solid rgba(201,168,76,0.08);
  min-height: 38px;
}
.tabulator.fk-table .tabulator-row.tabulator-row-even {
  background: rgba(201,168,76,0.02);
}
.tabulator.fk-table .tabulator-row:hover {
  background: rgba(201,168,76,0.06);
}
.tabulator.fk-table .tabulator-row.tabulator-selected {
  background: rgba(201,168,76,0.10);
}
.tabulator.fk-table .tabulator-row .tabulator-cell {
  color: #F0EDE6;
  padding: 8px 10px;
  border-right-color: rgba(201,168,76,0.05);
  font-size: 13px;
}

/* ── FK CELL TYPES (set by fk-formatters in table-theme.js) ───── */
.fk-cell-money,
.fk-cell-percent {
  font-family: 'DM Mono', ui-monospace, "SF Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}
.fk-cell-positive { color: #4CAF7A; }
.fk-cell-negative { color: #E05555; }

.fk-cell-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: rgba(255,255,255,0.06);
  color: #777;
  border: 1px solid rgba(255,255,255,0.10);
}
.fk-cell-badge.fk-badge-good {
  background: rgba(76,175,122,0.10);
  color: #4CAF7A;
  border-color: rgba(76,175,122,0.30);
}
.fk-cell-badge.fk-badge-warn {
  background: rgba(201,168,76,0.10);
  color: #C9A84C;
  border-color: rgba(201,168,76,0.30);
}
.fk-cell-badge.fk-badge-bad {
  background: rgba(224,85,85,0.10);
  color: #E05555;
  border-color: rgba(224,85,85,0.30);
}

/* ── FOOTER / PAGINATION ────────────────────────────────────── */
.tabulator.fk-table .tabulator-footer {
  background: #0A0A0A;
  border-top: 1px solid rgba(201,168,76,0.15);
  color: #777;
  font-size: 11.5px;
}
.tabulator.fk-table .tabulator-footer .tabulator-paginator {
  color: #F0EDE6;
}
.tabulator.fk-table .tabulator-footer .tabulator-page {
  background: transparent;
  border: 1px solid rgba(201,168,76,0.20);
  color: #F0EDE6;
  border-radius: 4px;
  margin: 0 2px;
  padding: 2px 8px;
  font-family: 'DM Mono', ui-monospace, monospace;
}
.tabulator.fk-table .tabulator-footer .tabulator-page.active {
  background: #C9A84C;
  color: #0A0A0A;
  border-color: #C9A84C;
}
.tabulator.fk-table .tabulator-footer .tabulator-page:not(.disabled):hover {
  background: rgba(201,168,76,0.10);
  color: #F0EDE6;
}

/* ── MOBILE RESPONSIVE COLLAPSE ROW (expandable detail) ──────── */
.tabulator.fk-table .tabulator-responsive-collapse {
  background: rgba(201,168,76,0.04);
  border-top: 1px solid rgba(201,168,76,0.12);
  padding: 8px 12px;
}
.tabulator.fk-table .tabulator-responsive-collapse table tr td {
  border: none;
  padding: 3px 6px;
  font-size: 12px;
  color: #F0EDE6;
}
.tabulator.fk-table .tabulator-responsive-collapse table tr td:first-child {
  color: #C9A84C;
  font-family: 'Syne', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-size: 10.5px;
}
.tabulator.fk-table .tabulator-responsive-collapse-toggle {
  background: #C9A84C;
  color: #0A0A0A;
}

/* ── PLACEHOLDER ────────────────────────────────────────────── */
.tabulator.fk-table .tabulator-tableholder .tabulator-placeholder {
  color: #777;
  font-style: italic;
}

/* ── PREFERS REDUCED MOTION ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .tabulator.fk-table,
  .tabulator.fk-table * {
    transition: none !important;
    animation: none !important;
  }
}
