/*
 * /kpi — Yerli Kateqoriya üzrə Nəticələr. (2026-09-22)
 *
 * Its own stylesheet rather than more lines inside kpi.html, for the same
 * reason the script is its own file: npm run build:assets content-hashes it, so
 * a change reaches a browser that has the old one cached.
 *
 * It borrows the page's tokens (--blue, --line, --ink, --muted) and its
 * .results-* table furniture on purpose — this is another screen of the same
 * product, not a second design.
 */
.kcat { font-family: Arial, sans-serif; }

.kcat-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.kcat-spacer { flex: 1 1 auto; }

.kcat-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.kcat-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 0; font: 700 13px/1.2 Arial, sans-serif; color: var(--muted); cursor: pointer; }
.kcat-tab.is-active { color: var(--blue-dark); border-bottom-color: var(--blue); }

.kcat-headline { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font: 400 14px/1.6 Arial, sans-serif; color: #2b3f56; margin-bottom: 16px; }
.kcat-headline b { font-variant-numeric: tabular-nums; color: var(--ink); }

.kcat-scope { background: #eef6fc; border: 1px solid #cfe4f3; border-radius: 12px; padding: 10px 14px; font: 400 13px/1.5 Arial, sans-serif; color: #24527a; margin-bottom: 12px; }
.kcat-warn { background: #fdf6e6; border: 1px solid #f0e0b8; border-radius: 12px; padding: 10px 14px; font: 400 13px/1.55 Arial, sans-serif; color: #6d5a23; margin-bottom: 12px; }
.kcat-warn-note { color: #8a7a4a; margin-top: 4px; }
.kcat-note { font: 400 12.5px/1.6 Arial, sans-serif; color: var(--muted); margin: 0 0 12px; max-width: 900px; }

.kcat-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 10px; }
.kcat-search input { min-width: 220px; }
.kcat-check { display: inline-flex; align-items: center; gap: 6px; font: 400 13px/1.3 Arial, sans-serif; color: #2b3f56; }
.kcat-check-inline { padding-bottom: 8px; }
.kcat-multi { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px 10px; font: 400 13px/1.3 Arial, sans-serif; }
.kcat-multi summary { cursor: pointer; color: #4a6480; }
.kcat-multi > div { display: flex; flex-direction: column; gap: 5px; max-height: 240px; overflow-y: auto; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

.kcat-quick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.kcat-quickbtn, .kcat-blockbtn { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 5px 13px; font: 400 13px/1.3 Arial, sans-serif; color: #2b3f56; cursor: pointer; }
.kcat-quickbtn span { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); margin-left: 4px; }
.kcat-quickbtn.is-active { background: #eaf4fb; border-color: var(--blue); color: var(--blue-dark); font-weight: 700; }
.kcat-blockbtn.is-on { background: #eef7f0; border-color: #bcdcc5; color: #2c6b3f; }

.kcat-breadcrumb { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font: 400 13px/1.3 Arial, sans-serif; color: var(--muted); margin-bottom: 12px; }
.kcat-breadcrumb button { background: none; border: 0; color: var(--blue); font: 700 13px/1.3 Arial, sans-serif; cursor: pointer; padding: 0; }
.kcat-breadcrumb button:hover { text-decoration: underline; }

.kcat-table-wrap { overflow-x: auto; }
table.kcat-table { width: 100%; border-collapse: collapse; font: 400 13px/1.4 Arial, sans-serif; }
/*
 * Twelve columns have to fit 1,110px of content width, because the answer to a
 * wide table here is the Satış/Marja block toggles — not a horizontal scrollbar
 * a director has to find. Headings wrap onto two lines, cells stay on one, and
 * the padding is tight enough that both blocks open still fit. The wrapper's
 * overflow-x remains as the fallback for a narrower window, not as the plan.
 */
table.kcat-table th { white-space: normal; line-height: 1.25; padding: 8px 9px; vertical-align: bottom; }
table.kcat-table td { white-space: nowrap; padding: 8px 9px; }
table.kcat-table td.sales, table.kcat-table th.sales { background: #fbfcfe; }
table.kcat-table td.margin, table.kcat-table th.margin { background: #fcfbf8; }
table.kcat-table td.ok { color: #2c7a4b; font-weight: 700; }
table.kcat-table td.fail { color: #b3465c; font-weight: 700; }
table.kcat-table td.none { color: #8a9bad; }
table.kcat-table td.warn { color: #a5761c; font-weight: 700; }
table.kcat-table td.strong { font-weight: 700; color: var(--ink); }
table.kcat-table tr.is-nodata td { background: #fafafa; color: #7d8ea0; }
table.kcat-table tr.is-diff td { background: #fdf6e6; }
.kcat-sub { display: block; font: 400 11px/1.3 Arial, sans-serif; color: #8a9bad; }
.kcat-link { background: none; border: 0; color: var(--blue); font: 700 13px/1.3 Arial, sans-serif; cursor: pointer; padding: 0; text-align: left; }
.kcat-link:hover { text-decoration: underline; }
.kcat-link.danger { color: #b3465c; }
.kcat-chip { display: inline-block; font: 400 10.5px/1.6 Arial, sans-serif; padding: 0 7px; border-radius: 9px; background: #eef2f6; color: #5d7591; vertical-align: middle; }
.kcat-chip.warn { background: #fdf0d8; color: #8a6d1a; }

.kcat-pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; font: 400 12.5px/1.3 Arial, sans-serif; color: var(--muted); margin-bottom: 18px; }
.kcat-pager select { border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }

.kcat-settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.kcat-setting { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.kcat-setting-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font: 400 13.5px/1.3 Arial, sans-serif; }
.kcat-setting-head code { font: 400 11px/1.3 ui-monospace, monospace; color: #9aa9b8; }
.kcat-setting-desc { font: 400 12px/1.5 Arial, sans-serif; color: var(--muted); }
.kcat-setting-editor input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; font: 400 13px/1.3 Arial, sans-serif; }

.kcat-import { margin-bottom: 16px; }
.kcat-counts { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.kcat-count { font: 400 12.5px/1.6 Arial, sans-serif; padding: 3px 11px; border-radius: 12px; background: #eef2f6; color: #4a6480; }
.kcat-count b { font-variant-numeric: tabular-nums; }
.kcat-count.ok { background: #eaf6ee; color: #2c6b3f; }
.kcat-count.warn { background: #fdf3df; color: #8a6d1a; }
.kcat-count.err { background: #fbeaec; color: #a3435a; }
.kcat-issues { max-height: 320px; overflow-y: auto; }
tr.kcat-issue-error td { background: #fbeaec; }
tr.kcat-issue-warning td { background: #fdf6e6; }
.kcat-done { font: 700 13px/1.3 Arial, sans-serif; color: #2c6b3f; }
.kcat-file { position: relative; overflow: hidden; }

.kcat-modal-backdrop { position: fixed; inset: 0; background: rgba(20, 35, 50, .45); display: flex; align-items: center; justify-content: center; z-index: 90; padding: 18px; }
.kcat-modal { background: #fff; border-radius: 16px; padding: 22px; width: min(420px, 100%); display: flex; flex-direction: column; gap: 12px; }
.kcat-modal h3 { margin: 0; font: 700 16px/1.3 Arial, sans-serif; color: var(--ink); }
.kcat-modal input { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font: 400 13px/1.3 Arial, sans-serif; width: 100%; }
.kcat-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* A director reads this on a phone; wide tables scroll inside their own box
   rather than pushing the page sideways, and the column groups collapse. */
@media (max-width: 760px) {
  .kcat-tabs { gap: 12px; overflow-x: auto; }
  .kcat-tab { white-space: nowrap; }
  .kcat-filters .results-field, .kcat-multi { flex: 1 1 100%; }
  .kcat-search input { min-width: 0; width: 100%; }
  .kcat-settings { grid-template-columns: 1fr; }
  .kcat-headline { font-size: 13px; }
  table.kcat-table { font-size: 12px; }
  table.kcat-table td, table.kcat-table th { padding: 7px 9px; }
  .kcat-pager { justify-content: space-between; }
}

@media print {
  .kcat-bar, .kcat-tabs, .kcat-quick, .kcat-filters, .kcat-pager, .kcat-import { display: none !important; }
  .kcat-table-wrap { overflow: visible; }
  table.kcat-table { font-size: 10.5px; }
}
