/* ==========================================================================
   ZakoGo — budget.css
   Owner: M-BU (js/budget.js). Module-only extras.
   Tokens, shell and every shared component live in styles.css (F1) — do not
   redefine them here.

   What is genuinely module-specific:
     1. the head row + tappable exchange-rate line of the dark totals card;
     2. the category filter chips (colour-coded, with totals);
     3. the per-day headers and the two-line amount block of an expense row;
     4. the rate preview and the category-manager rows inside the sheets.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Totals card (uses .totals / .totals-* from styles.css)
   -------------------------------------------------------------------------- */

.bu-totals-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.bu-count {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: #BFD3C7;              /* same secondary ink as .totals-label, 7:1 on pine-900 */
  white-space: nowrap;
}

/* The whole "Cambio: 1 € = 4,25 zł · Modifica" line is one 44px target. */
button.bu-rate {
  width: 100%;
  min-height: 44px;
  text-align: left;
  font-family: var(--font-ui);
  font-size: 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 140ms ease;
}
.bu-rate-txt { font-variant-numeric: tabular-nums; }
.bu-rate-sep { color: rgba(250, 249, 245, .45); }
.bu-rate-edit {
  color: var(--sun);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.bu-rate:active .bu-rate-edit { color: #FFD27A; }
.bu-rate:focus-visible { outline-offset: 2px; }

/* --------------------------------------------------------------------------
   2. Category filter chips
   -------------------------------------------------------------------------- */

.bu-cats {
  margin-top: 14px;
  align-items: center;
}
.bu-cats:empty { display: none; }

.bu-chip {
  min-height: 40px;
  padding: 6px 13px;
  background: var(--card);
  border-color: var(--line-strong);
  color: var(--pine-900);
}
.bu-chip .icn { color: var(--c-ink, var(--ink-soft)); }
.bu-chip .bu-chip-name { font-weight: 600; }
.bu-chip .bu-chip-tot {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}
/* .chip.is-on (styles.css) already tints background/border/text with --c-* */
.bu-chip.is-on .bu-chip-tot { color: inherit; }

.bu-filter-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin: 4px 2px 0;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.bu-filter-note strong { color: var(--pine-900); }
.bu-filter-note .link-action { font-size: 14.5px; }

/* --------------------------------------------------------------------------
   3. Per-day sections and expense rows
   -------------------------------------------------------------------------- */

.bu-days { margin-top: 2px; }

.bu-day-head {
  margin-top: 22px;
  font-size: 16px;
}
.bu-day-total {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bu-today {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 12px;
  padding: 2px 9px;
  text-transform: lowercase;
}

/* .row-title sets display:block after .clamp-2 in styles.css: give the
   shared clamp utility back its box so a long note stops at two lines. */
.bu-exp .row-title.clamp-2 { display: -webkit-box; }

/* Amount block: entry currency on top (Baloo), converted value under it. */
.bu-amount {
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  text-align: right;
}
.bu-amt {
  font-size: 17px;
  line-height: 1.2;
  color: var(--pine-900);
  white-space: nowrap;
}
.bu-amt-alt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  white-space: nowrap;
}

.bu-manage {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* --------------------------------------------------------------------------
   4. Sheets — rate preview
   -------------------------------------------------------------------------- */

.bu-rate-preview {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--pine-050);
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   5. Sheets — category manager
   -------------------------------------------------------------------------- */

.bu-cat-list { overflow: hidden; }

.bu-cat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.bu-cat-row:last-child { border-bottom: 0; }

.bu-cat-main { flex: 1 1 auto; min-width: 0; }
.bu-cat-main input {
  min-height: 44px;
  padding: 9px 12px;
  font-size: 15.5px;
}
.bu-cat-use {
  display: block;
  margin: 4px 2px 0;
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink-soft);
}

.bu-cat-add { margin-top: 18px; }
.bu-cat-addrow {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.bu-cat-addrow input { flex: 1 1 auto; min-width: 0; }
.bu-cat-addrow .btn { flex: 0 0 auto; padding: 0 16px; }

/* Category picker chips inside the expense sheet */
.bu-picks { margin-top: 2px; }

/* --------------------------------------------------------------------------
   6. Hover — pointer devices only
   -------------------------------------------------------------------------- */

@media (hover: hover) and (pointer: fine) {
  .bu-rate:hover { background: rgba(250, 249, 245, .07); }
  .bu-rate:hover .bu-rate-edit { color: #FFD27A; }
  .bu-chip:hover { background: var(--pine-050); border-color: var(--pine-500); }
  .bu-chip.is-on:hover { background: var(--c-tint, var(--pine-100)); filter: brightness(.98); }
}

/* --------------------------------------------------------------------------
   7. Narrow screens (360px and below)
   -------------------------------------------------------------------------- */

@media (max-width: 359.98px) {
  .bu-count { font-size: 13px; }
  .bu-chip { min-height: 38px; padding: 5px 11px; font-size: 14px; }
  .bu-amt { font-size: 16px; }
  .bu-amt-alt { font-size: 12.5px; }
  .bu-day-head { font-size: 15px; }
  .bu-cat-addrow .btn { padding: 0 12px; font-size: 15px; }
}
