/* Receipt lookup (receipts.js) — Customer Service tab sub-view.

   Self-contained on purpose: every rule the tool needs is defined here with an
   rcpt- prefix, so it borrows nothing from admin.css (whose .report* / .pill /
   .scroll-table rules are all scoped under #panel-admin). That kept the move
   from the Admin tab to CS a pure re-parent, and keeps the tool portable if it
   ever needs to appear on a third tab.

   Scoped under #panel-cs. Palette tokens come from styles.css. */

/* ---------- launch card on the CS home view ---------- */
#panel-cs .rcpt-launch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
#panel-cs .rcpt-launch h3 { margin: 0 0 2px; }
#panel-cs .rcpt-launch p { margin: 0; color: var(--muted); font-size: 12.5px; }

/* ---------- lookup shell ---------- */
#panel-cs .rcpt-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  margin-top: 16px;
}
#panel-cs .rcpt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
#panel-cs .rcpt-head h2 { font-size: 18px; margin: 0 0 2px; }
#panel-cs .rcpt-sub { display: block; color: var(--muted); font-size: 12.5px; }
#panel-cs .rcpt-status { color: var(--muted); margin: 16px 0; }

#panel-cs .rcpt-back {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  padding: 0;
  margin-bottom: 6px;
  cursor: pointer;
}
#panel-cs .rcpt-back:hover { text-decoration: underline; }

/* ---------- search ---------- */
#panel-cs .rcpt-search { display: flex; gap: 8px; margin-top: 14px; }
#panel-cs .rcpt-search input {
  flex: 1 1 auto;
  max-width: 340px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}
#panel-cs .rcpt-search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
#panel-cs .rcpt-hint { margin: 6px 0 0; }
#panel-cs .rcpt-count { margin: 14px 0 8px; }

/* ---------- results table ---------- */
#panel-cs .rcpt-scroll {
  max-height: 56vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
#panel-cs .rcpt-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
#panel-cs .rcpt-table th,
#panel-cs .rcpt-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
#panel-cs .rcpt-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--line);
}
#panel-cs .rcpt-table tbody tr:last-child td { border-bottom: 0; }
#panel-cs .rcpt-num { font-variant-numeric: tabular-nums; }

#panel-cs .rcpt-row { cursor: pointer; }
#panel-cs .rcpt-row:hover { background: var(--bg); }
#panel-cs .rcpt-sc { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
#panel-cs .rcpt-name { word-break: break-all; color: var(--muted); }
#panel-cs .rcpt-action { text-align: right; white-space: nowrap; }
#panel-cs .rcpt-empty { color: var(--muted); padding: 22px 8px; text-align: center; }
#panel-cs .rcpt-more { margin-top: 12px; text-align: center; }

/* ---------- viewer popup ---------- */
/* .modal-card caps at 380px for the login/security dialogs; a receipt image
   needs the room. The modal is position:fixed, so the 820px .content clamp on
   the CS panel does not constrain it. */
#panel-cs .rcpt-modal-card {
  max-width: 960px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 14px;
}
#panel-cs .rcpt-modal-card .modal-head { align-items: flex-start; }
#panel-cs .rcpt-modal-card .modal-head h2 { margin: 0 0 2px; }

#panel-cs .rcpt-view {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #0f172a;
  border-radius: 8px;
  padding: 10px;
}
#panel-cs .rcpt-img {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 4px;
}
#panel-cs .rcpt-pdf {
  width: 100%;
  height: 68vh;
  border: 0;
  border-radius: 4px;
  background: #fff;
}
#panel-cs .rcpt-nopreview { color: #cbd5e1; margin: 40px 0; }
#panel-cs .rcpt-view .rcpt-status,
#panel-cs .rcpt-view .message { color: #e2e8f0; }
#panel-cs .rcpt-openout { margin: 0; text-align: center; }
#panel-cs .rcpt-openout a { color: #93c5fd; }
#panel-cs .rcpt-openout .fine { color: #94a3b8; display: inline; margin: 0; }

#panel-cs .rcpt-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
#panel-cs .rcpt-modal-foot .fine { margin: 0; }
#panel-cs .rcpt-modal-foot button:disabled { opacity: 0.45; cursor: default; }
