/* ext_products_admin.css — Products panel */

.pa-wrap { padding: 0 0 16px; }
.pa-loading, .pa-empty {
  color: var(--text-3, #768390); font-size: 12.5px; font-style: italic;
  padding: 26px 10px; text-align: center;
}
.pa-error {
  color: #ef4444; font-size: 12.5px; padding: 14px 16px;
  border: 1px solid rgba(239,68,68,.3); border-radius: 9px;
  background: rgba(239,68,68,.06);
}
.pa-retry {
  margin-left: 8px; background: var(--bg-2, #1b2230);
  border: 1px solid var(--line); color: var(--text-1, #dfe6ee);
  border-radius: 5px; padding: 2px 9px; cursor: pointer; font: inherit; font-size: 11px;
}
.pa-retry:hover { border-color: var(--accent); color: var(--accent); }

/* ── stats ──────────────────────────────────────────────────────────────── */

.pa-note {
  font-size: 12px; line-height: 1.55;
  color: var(--text-2, #adbac7);
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.28);
  border-radius: 9px; padding: 9px 12px; margin-bottom: 10px;
}
.pa-note b { color: #fbbf24; }

/* ── tools row: search + count + New, inside the table header ──────────── */
/* Deliberately part of the table rather than a bar above it: a separate
   toolbar row cost a whole line of vertical space for one input. */
.pa-tools th {
  position: static;
  background: var(--bg-2, #1b2230);
  border-bottom: 1px solid var(--line);
  padding: 7px 10px;
  text-transform: none;
  letter-spacing: 0;
}
.pa-tools-in {
  display: flex; align-items: center; gap: 9px;
}
/* Search takes the whole row. The count label is gone — the table itself
   already shows how many rows there are.

   Styled to match the CRM's own search field: the topbar uses
   `background: var(--bg-3)` + `border: var(--line)` + `border-radius: 6px`,
   and focuses to `--accent` (terminal lime). The first pass used --bg-1 and a
   blue focus ring, which read as a foreign control on this theme. */
.pa-search {
  flex: 1; min-width: 0;
  background: var(--bg-3, #17171c);
  border: 1px solid var(--line, #23232a);
  color: var(--text, #e6e6ec);
  border-radius: 6px;
  padding: 7px 12px; font: inherit; font-size: 12.5px;
}
.pa-search::placeholder { color: var(--text-3, #6a6a78); }
.pa-search:hover { border-color: var(--line-2, #2e2e38); }
.pa-search:focus {
  outline: none;
  border-color: var(--accent, #d4ff3a);
}
.pa-new {
  flex: 0 0 auto;
  background: var(--accent, #d4ff3a); color: #0d1117;
  border: 0; border-radius: 6px; padding: 7px 13px;
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  white-space: nowrap;
}
.pa-new:hover { filter: brightness(1.08); }

/* ── table ──────────────────────────────────────────────────────────────── */
.pa-scroll {
  overflow: auto; max-height: calc(100vh - 190px);
  border: 1px solid var(--line); border-radius: 10px;
}
table.pa-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.pa-table th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-3, #768390); font-weight: 700;
  padding: 9px 12px; background: var(--bg-2, #1b2230);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
/* the tools row is the first row; the real header sticks just beneath it */
table.pa-table thead tr:not(.pa-tools) th { top: 0; }
table.pa-table td {
  padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.05);
  color: var(--text-2, #adbac7); vertical-align: middle;
}
table.pa-table tbody tr:last-child td { border-bottom: 0; }
table.pa-table tbody tr:hover { background: rgba(255,255,255,.025); }

table.pa-table th.pa-sortable { cursor: pointer; user-select: none; }
table.pa-table th.pa-sortable:hover { color: var(--text-1, #dfe6ee); }
table.pa-table th.pa-sortable.active { color: var(--accent, #d4ff3a); }
.pa-arrow {
  font-family: var(--mono, monospace); margin-left: 5px;
  opacity: .35; font-size: 11px;
}
/* The idle glyph is a deliberate placeholder so every sortable header looks like
   one before you hover it; it brightens on hover so the affordance is legible
   without shouting. The ACTIVE column gets the accent + full opacity. */
table.pa-table th.pa-sortable:hover .pa-arrow { opacity: .8; }
table.pa-table th.pa-sortable.active .pa-arrow { opacity: 1; font-weight: 700; }

table.pa-table th.pa-r { text-align: right; }

.pa-id { font-family: var(--mono, monospace); color: var(--text-3, #768390); font-size: 11px; }
.pa-name { color: var(--text-1, #dfe6ee); font-weight: 600; }
.pa-tpl { min-width: 190px; }

.pa-brand {
  display: inline-block; font-weight: 700; font-size: 11px;
  padding: 1px 7px; border-radius: 5px;
  background: rgba(212,255,58,.14); color: var(--accent, #d4ff3a);
}
.pa-none { color: var(--text-3, #768390); font-size: 11px; font-style: italic; }
.pa-kind {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; padding: 1px 6px; border-radius: 4px;
  background: rgba(148,163,184,.16); color: #b6c2d1;
}
.pa-kind.k-funded { background: rgba(62,194,143,.16); color: #3ec28f; }
.pa-kind.k-broker { background: rgba(59,130,246,.16); color: #6ba4ff; }
.pa-kind.k-signals { background: rgba(168,85,247,.16); color: #c084fc; }
.pa-kind.k-ea_copy { background: rgba(245,158,11,.16); color: #fbbf24; }
.pa-ptype {
  font-size: 11px; font-family: var(--mono, monospace);
  color: var(--text-2, #adbac7);
  background: rgba(255,255,255,.06); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 6px;
}

.pa-tname { color: #3ec28f; font-weight: 600; font-size: 12px; }
.pa-missing { color: #fbbf24; font-size: 11.5px; font-weight: 600; }
.pa-warn { color: #fbbf24; cursor: help; }

.pa-sel {
  background: var(--bg-1, #141a22); border: 1px solid var(--line);
  color: var(--text-1, #dfe6ee); border-radius: 6px;
  padding: 4px 8px; font: inherit; font-size: 12px; min-width: 170px; cursor: pointer;
}
.pa-sel:hover { border-color: var(--accent); }
.pa-sel:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(212,255,58,.18); }

.pa-foot {
  margin-top: 10px; font-size: 11.5px; line-height: 1.55;
  color: var(--text-3, #768390);
}
.pa-foot code {
  font-family: var(--mono, monospace); font-size: 11px;
  background: var(--bg-2, #1b2230); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px; color: var(--text-2, #adbac7);
}

/* ── row actions, inactive state, deal count ──────────────────────────────── */
.pa-acts { white-space: nowrap; text-align: right; width: 108px; }
.pa-act {
  background: var(--bg-2, #1b2230);
  border: 1px solid rgba(255,255,255,.18);
  color: var(--text-1, #dfe6ee);
  border-radius: 6px;
  padding: 3px 8px; margin-left: 4px; cursor: pointer;
  font: inherit; font-size: 12px; line-height: 1.4;
  transition: border-color .12s, color .12s, background .12s;
}
.pa-act:hover { border-color: var(--accent, #d4ff3a); color: var(--accent, #d4ff3a); background: var(--bg-1, #141a22); }
.pa-act-del { border-color: rgba(239,68,68,.45); color: #f87171; }
.pa-act-del:hover { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,.1); }

/* Sales: right-aligned so the value sits under its header, not mid-row. */
.pa-deals { text-align: right; width: 64px; }
.pa-dc {
  font-family: var(--mono, monospace); font-size: 11.5px;
  color: var(--text-1, #dfe6ee);
  background: rgba(212,255,58,.14); border-radius: 4px; padding: 1px 7px;
  font-weight: 600;
}
.pa-deals .pa-none { padding-right: 7px; }

tr.pa-inactive td { opacity: .55; }
tr.pa-inactive .pa-name { text-decoration: line-through; }
.pa-off {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; padding: 1px 5px; border-radius: 4px;
  background: rgba(148,163,184,.18); color: #9aa4b2; margin-left: 6px;
  vertical-align: middle;
}

/* ── create / edit modal ──────────────────────────────────────────────────── */
.pa-modal-bg {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
}
.pa-modal {
  width: 460px; max-width: calc(100vw - 32px);
  background: var(--bg-1, #141a22);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  overflow: hidden;
}
.pa-modal-h {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.pa-modal-h b { font-size: 14px; flex: 1; }
.pa-x {
  background: none; border: 0; color: var(--text-3, #768390);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.pa-x:hover { color: #ef4444; }
.pa-modal-b { padding: 14px 16px; }
.pa-f { display: block; margin-bottom: 11px; }
.pa-f > span {
  display: block; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-3, #768390); margin-bottom: 5px;
}
.pa-req { color: #fbbf24; }
.pa-f input, .pa-f select {
  width: 100%; box-sizing: border-box;
  background: var(--bg-2, #1b2230); border: 1px solid var(--line);
  color: var(--text-1, #dfe6ee); border-radius: 7px;
  padding: 7px 10px; font: inherit; font-size: 12.5px;
}
.pa-f input:focus, .pa-f select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(212,255,58,.18);
}
.pa-f-note {
  font-size: 11px; line-height: 1.5; color: var(--text-3, #768390);
  background: var(--bg-2, #1b2230); border: 1px solid var(--line);
  border-radius: 7px; padding: 8px 10px;
}
.pa-modal-err {
  margin-top: 10px; font-size: 11.5px; line-height: 1.5;
  color: #ef4444; background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.3);
  border-radius: 7px; padding: 8px 10px;
}
.pa-modal-f {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--line);
}
.pa-btn {
  background: var(--accent, #d4ff3a); color: #0d1117;
  border: 0; border-radius: 7px; padding: 7px 15px;
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.pa-btn:hover { filter: brightness(1.1); }
.pa-btn:disabled { opacity: .5; cursor: default; filter: none; }
.pa-btn-sec {
  background: var(--bg-2, #1b2230); color: var(--text-1, #dfe6ee);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 15px; font: inherit; font-size: 12.5px; cursor: pointer;
}
.pa-btn-sec:hover { border-color: var(--accent); color: var(--accent); }
