/* =========================================================================
   bytenight finance — page-specific extensions (transactions, reports)
   Builds on top of app.css. Same dark bytenight theme, same tokens.
   ========================================================================= */

.dashboard-details { margin-top: 22px; }

/* ── Login page ──────────────────────────────────────────────────────── */

.login-shell {
  display: flex;
  justify-content: center;
  padding-top: clamp(20px, 8vh, 90px);
}

.login-panel {
  width: 100%;
  max-width: 440px;
}

.login-panel .button.discord { width: 100%; }

.login-hint {
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
}

.login-fallback {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.login-fallback summary { font-size: 13px; }
.login-fallback-form { margin-top: 16px; }

/* ── Transaction list ────────────────────────────────────────────────── */

.transaction-list { display: grid; gap: 14px; }

.transaction.panel { transition: border-color .15s ease; }
.transaction.panel:has(.transaction-checkbox:checked) {
  border-color: var(--accent);
  background: rgba(139, 185, 157, .06);
}

.transaction-main,
.transaction-tools,
.match {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.transaction-main h2 { margin: 10px 0 5px; font-size: 17px; }

.amount {
  font-size: 22px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.transaction-tools {
  border-top: 1px solid var(--border);
  margin-top: 18px;
  padding-top: 18px;
  flex-wrap: wrap;
}

.inline-form { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.inline-form select, .inline-form input {
  min-height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 7px 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.inline-form select:focus, .inline-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 185, 157, .18);
}

.match {
  margin-top: 14px;
  padding: 13px 16px;
  background: rgba(139, 185, 157, .1);
  border: 1px solid rgba(139, 185, 157, .25);
  border-radius: 8px;
  color: var(--ink);
}

.report-table { margin-top: 22px; }
.tax-note { margin-top: 16px; }

/* Bulk-edit checkbox on each transaction row — kept visually distinct
   (accent-colored, larger hit target) so it reads clearly as a selection
   control against the dark theme, not just decorative badge. */
.transaction-select {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 6px 4px 4px;
  border-radius: 999px;
}

.transaction-select input {
  width: 19px;
  height: 19px;
  cursor: pointer;
  accent-color: var(--accent);
}

.suggestion-hint { font-size: 12px; }
.classify-feedback { font-size: 12px; }
.classify-feedback-error { color: var(--danger); }

/* A suggested kind/category (see views.suggest_classifications_by_counterparty and
   suggest_refund_reclassifications) pre-fills the same <select> elements a real, saved
   classification would use - visually identical otherwise. Nico mistook a pending suggestion
   for an already-saved classification because of this (see bug report: transaction id=14 stayed
   unclassified). The warning-colored box + badge make "not saved yet" unmissable, and the
   accent "Zuordnen"/"Vorschlag übernehmen" button (see transactions.html) makes clear an
   explicit click is required - the classify-kind/-category auto-submit-on-change (see
   transactions.js) does NOT fire just because the page loaded with a pre-selected option. */
.classify-fields {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.classify-fields.has-suggestion {
  padding: 10px 12px;
  border: 1px solid var(--warning);
  background: var(--warning-bg);
  border-radius: var(--radius-sm);
}

.suggestion-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--warning);
  color: #2a2308;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* Auto-submit classify dropdowns get a subtle accent border so it's clear
   changing them takes immediate effect (no explicit submit click needed). */
.classify-kind, .classify-category {
  border-color: rgba(139, 185, 157, .35) !important;
}

.classify-kind:hover, .classify-category:hover {
  border-color: var(--accent) !important;
}

/* Sticky bulk-action bar, shown once >=1 row is selected (see transactions.js), hidden
   otherwise via the native [hidden] attribute. IMPORTANT: this rule must only ever apply
   `display: flex` while the element is NOT hidden - a bare `.bulk-bar { display: flex }` has
   the same specificity as the UA stylesheet's `[hidden] { display: none }`, and since author
   CSS is applied after the UA stylesheet, `display: flex` would win and silently cancel the
   `hidden` attribute. That kept this sticky, `position: sticky; bottom: 16px` bar permanently
   visible even with 0 rows selected, where it could overlap and swallow clicks on whatever
   transaction-row button happened to sit near the bottom of the viewport (e.g. "Vorschlag
   uebernehmen") - no JS error, no network request, because the click never reached the
   intended button (see bug report: click on "Vorschlag uebernehmen" did nothing). */
.bulk-bar:not([hidden]) {
  position: sticky;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  margin-top: 18px;
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  flex-wrap: wrap;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}

.bulk-bar select {
  min-height: 40px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  padding: 7px 10px;
  font: inherit;
}

.bulk-bar select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 185, 157, .18);
}

.bulk-count {
  font-weight: 700;
  white-space: nowrap;
  color: var(--accent-strong);
}

@media (max-width: 650px) {
  .transaction-main, .match { align-items: flex-start; flex-direction: column; }
  .amount { order: -1; }
  .transaction-tools { align-items: stretch; }
  .inline-form { width: 100%; }
  .inline-form select { flex: 1; }
  .bulk-bar { position: static; flex-direction: column; align-items: stretch; }
}
