/* ============================================================================
   Kovac Property Command Center — Income & Expense annotations.
   Companion to transactions-v2.js. Built on the same shadcn/ui CSS-variable
   tokens the compiled bundle and reports-v2.css use, so light/dark themes come
   along for free. Nothing here hides or repositions a compiled node.
   ========================================================================== */

.tx2-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  font-size: 0.8125rem;
}
.tx2-panel:empty { display: none; }

.tx2-legend,
.tx2-files {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.tx2-legend-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin-right: 0.15rem;
}

/* ── badges ───────────────────────────────────────────────────────────────── */

.tx2-badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.tx2-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

/* Statement rows are the traceable ones, so they read as the "verified" state. */
.tx2-badge-statement {
  border-color: hsl(var(--primary) / 0.35);
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
}
.tx2-badge-manual {
  border-color: hsl(var(--foreground) / 0.2);
  background: hsl(var(--foreground) / 0.06);
  color: hsl(var(--foreground));
}
.tx2-badge-bank {
  border-color: hsl(var(--border));
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}
.tx2-badge-dup {
  border-color: hsl(var(--destructive) / 0.4);
  background: hsl(var(--destructive) / 0.12);
  color: hsl(var(--destructive));
}
/* A netted row is correct, not suspect — it reads as information, which is why
   it borrows the primary token rather than the destructive one. */
.tx2-badge-split {
  border-color: hsl(var(--primary) / 0.45);
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.tx2-file {
  display: inline-block;
  max-width: 22rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
}

/* ── notes and the duplicate box ─────────────────────────────────────────── */

.tx2-note {
  margin: 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  line-height: 1.5;
}
.tx2-note-error { color: hsl(var(--destructive)); }

.tx2-retry {
  align-self: flex-start;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  cursor: pointer;
}
.tx2-retry:hover { background: hsl(var(--muted)); }
.tx2-retry:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 1px; }

.tx2-dup {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid hsl(var(--destructive) / 0.35);
  border-radius: var(--radius);
  background: hsl(var(--destructive) / 0.08);
}
.tx2-dup-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.8125rem;
  color: hsl(var(--destructive));
}
.tx2-dup-row {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: hsl(var(--foreground));
  overflow-wrap: anywhere;
}

/* ── split disclosure ─────────────────────────────────────────────────────── */

.tx2-split {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid hsl(var(--primary) / 0.35);
  border-radius: var(--radius);
  background: hsl(var(--primary) / 0.07);
}
.tx2-split-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.8125rem;
  color: hsl(var(--primary));
}
.tx2-split-row {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: hsl(var(--foreground));
  overflow-wrap: anywhere;
}
/* The one state where a netted row still needs a human decision: a released
   property with no offsetting statement on this page. */
.tx2-split-warn {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: hsl(var(--destructive));
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .tx2-panel { padding: 0.65rem 0.75rem; }
  .tx2-file  { max-width: 12rem; }
  .tx2-badges { margin-left: 0; margin-top: 0.25rem; }
}
