.fin-journal-page .fin-summary { min-height: 86px; padding: 10px 14px; gap: 4px; }
.fin-journal-page .fin-summary-value { font-size: clamp(22px,3vw,29px); }
.journal-panel .fin-panel-head { padding: 9px 12px; }
.journal-panel .button.primary { min-height: 38px; border-color: transparent; background: var(--crm-gradient); color: #fff; }
.journal-panel .button.primary:hover { background: var(--crm-gradient); filter: brightness(1.08); }
.journal-tools { display: grid; gap: 8px; padding: 9px 12px; border-bottom: 1px solid #e1e6f3; }
.journal-tools-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.journal-tools .fin-search { flex-basis: 245px; max-width: 405px; }
.journal-range {
  display: flex; align-items: center; gap: 6px; min-height: 37px; padding: 0 7px 0 10px;
  border: 1px solid #cdd7eb; border-radius: 9px; background: #fcfdff; color: #3b5074;
}
.journal-range select {
  width: auto; min-height: 33px; padding: 3px 22px 3px 0; border: 0;
  box-shadow: none; background-color: transparent; color: inherit; font: inherit; font-size: 13px;
}
.journal-range:focus-within { border-color: var(--crm-indigo); box-shadow: var(--crm-focus); }
.journal-range select:focus-visible { outline: 0; box-shadow: none; }
.journal-range .icon { width: 15px; }
.journal-scroll { max-height: min(560px,calc(100dvh - 332px)); min-height: 120px; overflow-y: auto; border-radius: 0 0 13px 13px; }
.journal-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.journal-table :is(th,td) { text-align: left; vertical-align: middle; border: 0; }
.journal-table th:first-child { width: 8%; }
.journal-table th:nth-child(2) { width: 19%; }
.journal-table th:nth-child(3) { width: 29%; }
.journal-table th:nth-child(5) { width: 13%; }
.journal-table th:last-child { width: 36px; }
.journal-table thead th {
  position: sticky; top: 0; z-index: 2; padding: 7px 12px; background: #edf1fa; color: #465979; font-size: 12px; font-weight: 670;
}
.journal-table tbody td { padding: 6px 12px; height: 44px; border-bottom: 1px solid #e5eaf4; background: transparent; }
.journal-table tbody .journal-entry:hover { background: #f5f1ff; cursor: pointer; }
.journal-table tbody .journal-entry.is-selected { background: #f0eaff; }
.journal-table .journal-day th { padding: 5px 12px; border-bottom: 1px solid #e1e6f3; background: #f6f8fd; color: #445676; font-size: 12px; font-weight: 700; }
.journal-table .journal-amount { text-align: right; }
.journal-time, .journal-amount { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 720; }
.journal-time { color: #2d4265; }
.journal-amount[data-tone="in"] { color: #14704f; }
.journal-amount[data-tone="out"] { color: #5335a8; }
.journal-amount[data-tone="return"] { color: #9b3c34; }
.journal-amount[data-tone="deposit"] { color: #315e87; }
.journal-kind {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border: 1px solid transparent;
  border-radius: 6px; font-size: 12px; font-weight: 670; line-height: 1.35;
}
.journal-kind .icon { width: 12px; height: 12px; }
.journal-kind[data-tone="in"] { color: #176449; background: #e4f4ea; border-color: #c9e9d6; }
.journal-kind[data-tone="out"] { color: #53369e; background: #efe9ff; border-color: #ddd1fa; }
.journal-kind[data-tone="return"] { color: #922e31; background: #ffedea; border-color: #f1d1cd; }
.journal-kind[data-tone="deposit"] { color: #275a84; background: #e5f2fb; border-color: #cce2f3; }
.journal-person { display: block; color: var(--crm-ink); font-weight: 690; overflow-wrap: anywhere; }
.journal-sub { display: block; color: var(--crm-muted); font-size: 12px; }
.journal-order {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; color: #4e34ac;
  font: inherit; font-weight: 690; text-decoration: none; overflow-wrap: anywhere;
}
.journal-order:hover { color: #4e34ac; text-decoration: underline; }
.journal-detail {
  display: grid; place-items: center; min-width: 25px; min-height: 29px; margin-left: -7px; padding: 0;
  border: 0; border-radius: 5px; background: transparent; color: #644fc0; cursor: pointer;
}
.journal-detail:hover { background: #ebe4ff; }
.journal-detail .icon { width: 13px; transform: rotate(-90deg); }
.journal-breakdown { padding: 11px 13px; }
.journal-breakdown h3 { margin-bottom: 5px; }
.journal-breakdown dl > div {
  display: grid; grid-template-columns: minmax(90px,.8fr) minmax(0,1.2fr); align-items: baseline; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid #e4e9f3;
}
.journal-breakdown dl > div:last-child { border-bottom: 0; }
.journal-breakdown dt { color: var(--crm-muted); font-size: 13px; }
.journal-breakdown dd { text-align: right; font-weight: 620; overflow-wrap: anywhere; }
.journal-breakdown .journal-order { justify-content: end; }
.journal-breakdown p { color: #405271; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 800px) {
  .journal-scroll { min-height: 0; max-height: none; overflow: visible; }
  .journal-table, .journal-table tbody { display: block; }
  .journal-table thead { display: none; }
  .journal-table tbody tr {
    display: grid; grid-template-columns: minmax(38px,.33fr) minmax(0,1.25fr) auto 25px;
    grid-template-areas: "time party amount more" "kind kind order order"; align-items: center;
    gap: 4px 6px; padding: 7px 8px; border-bottom: 1px solid #e5eaf4;
  }
  .journal-table tbody td { display: block; padding: 0; height: auto; border: 0; }
  .journal-table tbody tr.journal-day { display: block; padding: 0; }
  .journal-table .journal-day th { display: block; width: 100%; padding-inline: 8px; border-bottom: 0; }
  .journal-entry td:nth-child(1) { grid-area: time; }
  .journal-entry td:nth-child(2) { grid-area: kind; }
  .journal-entry td:nth-child(3) { grid-area: party; }
  .journal-entry td:nth-child(4) { grid-area: order; text-align: right; }
  .journal-entry td:nth-child(5) { grid-area: amount; }
  .journal-entry td:nth-child(6) { grid-area: more; }
  .fin-journal-page .fin-summary { padding: 9px; }
  .fin-journal-page .fin-summary h2 { min-height: 32px; }
  .fin-journal-page .fin-summary p { min-height: 0; }
  .journal-order { justify-content: end; font-size: 12px; }
  .journal-detail { margin-left: 0; }
}
@media (max-width: 420px) {
  .journal-entry .journal-person, .journal-entry .journal-amount { font-size: 13px; }
  .journal-kind { font-size: 11px; }
  .journal-tools .fin-search { flex-basis: 100%; }
}
