/* ==========================================================================
   OBLIVET — transactions ledger and selection
   ========================================================================== */

/* --------------------------------------------------------------------------
   9. Transactions
   -------------------------------------------------------------------------- */
.tx-panel {
  padding: 0;
  overflow: hidden;
}

.tx-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(290px, 100%);
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.search-field:focus-within {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
}

.search-field svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--muted-dim);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.search-field input::placeholder {
  color: var(--muted-dim);
}

.search-field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: linear-gradient(45deg, transparent 44%, #8a8a8a 45%, #8a8a8a 55%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, #8a8a8a 45%, #8a8a8a 55%, transparent 56%);
  cursor: pointer;
}

.tx-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.014);
}

.filter-chip {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 450;
  line-height: 1.2;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.filter-chip:hover {
  color: var(--text);
}

.filter-chip.is-active {
  background: var(--white);
  color: #050505;
  font-weight: 500;
}

.filter-chip--clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
}

.filter-chip--clear:hover {
  border-color: var(--line-strong);
  color: var(--white);
}

.filter-chip--clear svg {
  width: 10px;
  height: 10px;
  color: var(--muted);
}

.select-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.select-field:focus-within {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
}

.select-field select {
  width: 100%;
  height: 40px;
  padding: 0 34px 0 12px;
  border: 0;
  outline: none;
  border-radius: inherit;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.select-field > svg {
  position: absolute;
  right: 12px;
  width: 12px;
  height: 12px;
  color: var(--muted);
  pointer-events: none;
}

.select-field select option {
  background: #0b0b0b;
  color: var(--text);
}

.select-field--compact {
  width: auto;
  min-width: 146px;
  height: 36px;
}

.select-field--compact select {
  height: 34px;
  font-size: 11.5px;
}

.tx-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.035);
}

.tx-selection-count {
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 450;
  font-variant-numeric: tabular-nums;
}

.tx-selection-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tx-clear-btn {
  padding: 5px 2px;
  color: var(--muted);
  font-size: 11px;
  transition: color 0.2s var(--ease);
}

.tx-clear-btn:hover {
  color: var(--white);
}

.tx-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tx-select-all-btn {
  color: var(--muted);
}

.tx-table {
  width: 100%;
}

.tx-head,
.tx-row {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) 112px 92px 120px 62px;
  align-items: center;
  gap: 14px;
}

.tx-head {
  padding: 11px 22px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted-dim);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tx-rows {
  display: flex;
  flex-direction: column;
}

.tx-row {
  position: relative;
  padding: 13px 22px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.tx-row:last-child {
  border-bottom: 0;
}

.tx-row:hover {
  background: rgba(255, 255, 255, 0.022);
}

.tx-row.is-selected {
  background: rgba(255, 255, 255, 0.045);
}

.tx-row.is-selected:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tx-row::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--white);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.tx-row.is-selected::before {
  opacity: 1;
}

/* The native checkbox fills the row invisibly: the whole line is the
   control, while the action buttons stay above it. */
.tx-row-check {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.tx-row-check:focus-visible {
  outline: none;
}

.tx-row:has(.tx-row-check:focus-visible) {
  outline: 1.5px solid rgba(255, 255, 255, 0.8);
  outline-offset: -2px;
  border-radius: 2px;
}

.tx-row.is-selected .monogram {
  position: relative;
  border-color: rgba(255, 255, 255, 0.65);
  background: var(--white);
  color: transparent;
}

.tx-row.is-selected .monogram::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #050505;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
}

.tx-row-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.tx-row:hover .tx-row-actions,
.tx-row:focus-within .tx-row-actions,
.tx-row.is-selected .tx-row-actions {
  opacity: 1;
}

.tx-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--muted-dim);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.tx-action svg {
  width: 13px;
  height: 13px;
}

.tx-action:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
}

.tx-action--delete:hover {
  color: var(--white);
}

.tx-ident {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tx-name-wrap {
  min-width: 0;
}

.tx-name {
  display: block;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 450;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-cat {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted-dim);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-cat-account {
  color: var(--muted);
}

.tx-cat-date {
  display: none;
}

.tx-date {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 450;
  letter-spacing: 0.015em;
  line-height: 1.25;
  white-space: nowrap;
}

.badge-dot {
  width: 4px;
  height: 4px;
  flex-shrink: 0;
  border-radius: 50%;
}

.badge--income .badge-dot { background: var(--white); }
.badge--expense .badge-dot { background: #666; }

.tx-amount {
  justify-self: end;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tx-amount.is-expense {
  color: var(--text-soft);
}

.tx-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 22px;
  border-top: 1px solid var(--line-soft);
}

/* Empty states */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}

.empty-state:first-child {
  border-top: 0;
}

.empty-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
}

.empty-mark svg {
  width: 22px;
  height: 22px;
}

.empty-state h3 {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.empty-state p {
  max-width: 300px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.empty-state .btn {
  margin-top: 18px;
}

.empty-inline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11.5px;
}

.empty-inline strong {
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 450;
}
