/* Sections and lists. .card is a section: kicker head + content; its outlined box lives in components/widget.css.
   Rows are lists with thin rules, not cards: .rows > .row-btn / .row-static, table-like .table > .trow.
   Rows separated by border-top have no radius (a rounded corner hooks the rule). */
@layer components {
  .card-link { display: block; color: inherit; }
  .section-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; min-height: 28px; margin-bottom: 10px; }
  .section-title h2 { font-family: var(--font-text); font-size: var(--fs-kicker); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); line-height: 1.3; font-variation-settings: normal; }
  .section-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

  /* simple rows */
  .rows { display: flex; flex-direction: column; }
  .row-btn, .row-static {
    position: relative; width: 100%; min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 8px 0;
    border-top: 1px solid var(--rule); text-align: left; color: var(--ink-2);
  }
  .rows > :first-child { border-top: 0; }
  .row-ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; color: var(--ink-2); }
  .row-ico.good { color: var(--good-ink); }
  .row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.35; overflow-wrap: anywhere; }
  .row-main b { color: var(--ink); font-weight: 600; }
  .row-main .muted { font-size: var(--fs-caption); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* grouped list: rows inside a soft tonal group (contact, ledger payments, settings) */
  .rows.group { padding: 4px 14px; background: var(--paper-2); border-radius: var(--r-group); }

  /* table-like list (finance, accounting) */
  .table { display: flex; flex-direction: column; }
  .trow {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(90px, 1fr) minmax(120px, 1.2fr) minmax(130px, 1.4fr) auto;
    gap: 12px; align-items: center; min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--rule);
  }
  .trow:last-child { border-bottom: 0; }
  .thead { min-height: 0; padding: 0 0 8px; border-bottom-color: var(--rule-2); font-size: var(--fs-kicker); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
  .trow-btn { width: 100%; text-align: left; }
  .trow b { font-weight: 600; }

  /* toolbars above lists */
  .toolbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin-bottom: 18px; }
  .select-inline { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
  .back-link { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin-bottom: 6px; color: var(--ink-2); font-weight: 600; font-size: var(--fs-caption); }

  @media (max-width: 760px) {
    .trow { grid-template-columns: minmax(0, 1.6fr) auto auto; }
    .toolbar .search { flex: 1 1 100%; max-width: none; }
    .toolbar .select-inline { margin-left: 0; }
  }
  @media (max-width: 420px) { .trow { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; } }
  @media (hover: hover) {
    .row-btn:hover, .trow-btn:hover { background: var(--paper-2); }
    .back-link:hover { color: var(--ink); }
  }
}
