/* The Owner page: only what the shared console.css does not have. */
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.account-grid .form, .account-grid .facts { margin-top: 16px; }

/* One AG per row: its plate, what it is called, its money and its state. */
.ag-row .row-link { display: grid; grid-template-columns: minmax(170px, max-content) minmax(0, 1fr) auto auto auto; }
.ag-row .plate { justify-self: start; }
.ag-meta { text-align: right; font-size: 14px; font-weight: 600; }
.ag-meta small { font-weight: 400; }

/* What all AGs hold together: one figure per currency, never added across currencies. */
.credit-totals { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.credit-totals:empty { display: none; }
/* The button under a block of a report that opens, or goes on with, its list. */
.block-tools { margin: 8px 2px 0; }
.credit-total { display: grid; gap: 2px; flex: 1 1 240px; max-width: 440px; }
/* The credit of the open AG: the amount, what happened last, and the two things an Owner can do about it. */
.credit-box { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 8px; background: #fbfcf9; }
.credit-box .notice { margin: 4px 0 0; }
.credit-box .notice a { color: inherit; font-weight: 700; text-decoration: underline; }
.credit-box .step-action { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.connections { display: grid; gap: 16px; }
.connection { display: grid; gap: 16px; }
.connection-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.connection-result { border-radius: 10px; padding: 12px 14px; background: var(--open-bg); color: #0d4f38; font-size: 14px; }
.connection-result.is-stop { background: var(--stop-bg); color: #7d2915; }
.empty code { font: 600 13.5px var(--code); background: #eef3ea; padding: 2px 6px; border-radius: 5px; color: var(--ink); }

/* One AMB account in the catalog: what it is, the button that reads its lists, then its providers. */
.connection-head .button { margin-left: auto; }
/* A notice that asks for a decision carries the button for it. */
.choice-notice { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin: 0; }
.choice-notice span { flex: 1 1 320px; }
/* What narrows a long list, above it: a search, and what the search came to. */
.list-tools { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.list-tools label { display: grid; gap: 6px; flex: 1 1 240px; max-width: 360px; font-size: 14px; font-weight: 600; }
.list-tools input { width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid #cdd9cd; border-radius: 8px; background: var(--sheet); font-weight: 400; }
.catalog-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
/* A long list inside a dialog scrolls by itself and keeps its head in view. */
.table-wrap.scroll { max-height: min(38dvh, 400px); border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; }
/* Inside a dialog the search stands a little apart from the sentence above it. */
dialog .list-tools { margin-top: 14px; }
.table-wrap.scroll th { position: sticky; top: 0; z-index: 1; }
#products-form { margin-top: 16px; }
/* The box that ticks a row. */
td.pick { width: 1%; padding-right: 0; }
td.pick input { display: block; width: 18px; height: 18px; accent-color: var(--forest); }

.approvals > li { align-items: flex-start; }
.approvals p { font-size: 14px; margin-top: 3px; overflow-wrap: anywhere; }
.approval-side { display: grid; gap: 8px; justify-items: end; flex: 0 0 auto; max-width: 46%; }
.approval-side small { text-align: right; }
.approval-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.team-form { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); grid-template-columns: 1.3fr 1fr 1fr; align-items: end; }
.team-form h3, .team-form .dialog-actions { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .account-grid, .team-form { grid-template-columns: minmax(0, 1fr); }
  .list-tools input { min-height: 44px; }
  .connection-head .button { margin-left: 0; }
  td.pick input { width: 22px; height: 22px; }
  .ag-row .row-link { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; }
  .ag-row .grow { grid-column: 1 / -1; grid-row: 2; }
  .ag-row .ag-meta { grid-column: 1; grid-row: 3; text-align: left; }
  .ag-row .chip { grid-column: 2; grid-row: 1; }
  .ag-row .chevron { grid-column: 2; grid-row: 3; justify-self: end; }
  .approvals > li { flex-direction: column; }
  .approval-side { justify-items: start; max-width: none; }
  .approval-side small { text-align: left; }
  .approval-actions { justify-content: flex-start; }
}
