/* Project journal (Journals.razor): balance summary, ledger tools and the ledger table.
   The figures row and amount/method cells are shared with contracts and live in components.css. */
.ish-journal-page { gap: 16px; }

.ish-journal-action .msr { font-size: 19px; }

.ish-journal-action--expense .msr { color: var(--error); }

.ish-journal-action--payment .msr { color: var(--warning); }

.ish-journal-action--return .msr { color: var(--success); }

/* ── Summary: balance tile beside the figures ────────────────────────────── */
.ish-journal-summary { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(0, 4fr); gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-soft); }

.ish-journal-balance {
  --tone: var(--success);
  display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent); border-radius: 12px;
  background: color-mix(in srgb, var(--tone) 9%, var(--surface));
}

.ish-journal-balance.is-negative { --tone: var(--error); }

.ish-journal-balance-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; font-weight: 700; }

.ish-journal-balance-label .msr { color: var(--tone); font-size: 19px; }

.ish-journal-balance strong { color: var(--tone); font-size: 1.35rem; font-weight: 850; line-height: 1.2; font-variant-numeric: tabular-nums; }

.ish-journal-balance strong small { color: var(--muted); font-size: .8rem; font-weight: 700; }

/* ── Ledger ──────────────────────────────────────────────────────────────── */
.ish-journal-ledger { display: flex; flex-direction: column; gap: 12px; padding: 16px; }

.ish-journal-tools { display: flex; align-items: center; gap: 10px; }

.ish-journal-tools .fl-search { min-width: 0; flex: 1 1 auto; }

.ish-segmented { display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: 9px; background: var(--surface-2); }

.ish-segmented button {
  height: 34px; padding: 0 13px; border: 0; border-radius: 7px; background: transparent; color: var(--muted);
  font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background-color .12s ease, color .12s ease;
}

.ish-segmented button:hover { color: var(--ink); }

.ish-segmented button[aria-pressed="true"] { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-xs); }

.ish-segmented button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--brand-tint); }

.ish-journal-typebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.ish-journal-typebar .ish-projects-reset { flex: none; font-size: .78rem; }

.ish-journal-ledger .fl-table th.fl-col-num, .ish-journal-ledger .fl-table td.fl-col-num { text-align: end; }

.ish-journal-ledger .fl-table tbody tr:hover { background: var(--brand-tint-2); }

.ish-journal-ledger .fl-table tbody tr.ish-journal-row--in { background: color-mix(in srgb, var(--success) 8%, var(--surface)); }

.ish-journal-ledger .fl-table tbody tr.ish-journal-row--in:hover { background: color-mix(in srgb, var(--success) 13%, var(--surface)); }

.ish-journal-ledger .fl-table tbody tr.ish-journal-row--in td { border-top-color: color-mix(in srgb, var(--success) 35%, var(--surface)); border-bottom: 1px solid color-mix(in srgb, var(--success) 35%, var(--surface)); }

.ish-journal-type { gap: 4px; }

.ish-journal-type .msr { font-size: 16px; }

@media (max-width: 620px) {
  .ish-journal-page, .ish-journal-page > * { width: 100%; min-width: 0; max-width: 100%; }

  .ish-journal-summary { grid-template-columns: 1fr; }

  .ish-journal-balance strong { font-size: 1.25rem; }

  .ish-journal-ledger { padding: 12px; }

  .ish-journal-tools { flex-direction: column; align-items: stretch; }

  .ish-segmented button { flex: 1; }

  /* Ledger rows become compact cards: description and amount, then type and actions, then date and method. */
  .ish-journal-ledger .fl-table tbody tr {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "desc desc amount" "type type actions" "date method method";
    gap: 8px 10px;
  }

  .ish-journal-ledger .fl-table tbody tr:hover { background: transparent; }

  .ish-journal-ledger .fl-table tbody tr.ish-journal-row--in { padding-inline: 10px; border: 1px solid color-mix(in srgb, var(--success) 35%, var(--surface)); border-radius: 8px; }

  .ish-journal-ledger .fl-table tbody tr.ish-journal-row--in td { border: 0; }

  .ish-journal-ledger .fl-table tbody td:nth-child(1) { grid-area: date; font-size: .74rem; }

  .ish-journal-ledger .fl-table tbody td:nth-child(2) { grid-area: desc; }

  .ish-journal-ledger .fl-table tbody td:nth-child(3) { grid-area: type; }

  .ish-journal-ledger .fl-table tbody td:nth-child(4) { grid-area: method; font-size: .74rem; }

  .ish-journal-ledger .fl-table tbody td:nth-child(5) { grid-area: amount; align-self: start; }

  .ish-journal-ledger .fl-table tbody td:nth-child(6) { grid-area: actions; }
}
