/* Label Account (plan §6.7). The page IS the ledger visually: the accordion, tab
   rows, line tables, badges, amount colours and modal all come from
   admin-statements.css (included by the Account pages) and its --stmt-* tokens.
   Only what the ledger has no equivalent for lives here. No hardcoded colours. */

.acct-page { padding: 24px 28px 64px; }

.acct-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.acct-head h1 { margin: 0; font-family: var(--stmt-font-mono); font-size: 1.5rem; color: var(--stmt-text-primary); font-weight: 600; }
.acct-meta { display: flex; gap: 12px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.acct-warn { color: var(--accent-emphasis); font-weight: 600; }
.acct-intro { margin: 6px 0 0; font-size: 13px; color: var(--text-muted); max-width: 70ch; }
.acct-basis { text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

.acct-toolbar { display: flex; gap: 8px; align-items: flex-start; }
.acct-search { position: relative; }
.acct-input, .acct-select {
    background: var(--bg-input, var(--bg-well)); color: var(--text-primary);
    border: 1px solid var(--bg-card-hover, #2a2d31); border-radius: 6px;
    padding: 7px 10px; font-size: 13px;
}
.acct-input { width: 220px; }
#acct-picker { position: absolute; z-index: 20; left: 0; right: 0; }
.acct-picker-list { background: var(--bg-card); border: 1px solid var(--bg-card-hover, #2a2d31); border-radius: 6px; margin-top: 6px; max-height: 260px; overflow: auto; }
.acct-picker-item { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: var(--text-primary); padding: 8px 10px; cursor: pointer; }
.acct-picker-item:hover { background: var(--bg-card-hover, #1c1c1c); }

/* Ledger accordion, account columns: tab | credits | charges | paid | balance | docs.
   The header row and the tab rows share one grid so the figures line up. */
.acct-accordion .accordion-header-row,
.acct-accordion .cat-row { grid-template-columns: 1fr 120px 120px 120px 130px 60px; }
.acct-accordion .accordion-header-row { padding: 14px 32px; }
.acct-tabs { padding: 4px 16px 12px; }
.acct-accordion .cat-row .acct-paid { font-size: 0.85rem; }
.acct-accordion .cat-row:focus-visible { outline: 2px solid var(--stmt-accent); outline-offset: 2px; }

/* Lines. Every cell stays on one line: the figures never wrap, and the description
   gives way instead — it is the only flexible column (max-width: 0 + width: 100% is
   what lets a table cell shrink below its content and clip it). */
.acct-accordion .lines-table th,
.acct-accordion .lines-table td { white-space: nowrap; }
.acct-accordion .lines-table td.acct-desc-cell { width: 100%; max-width: 0; }
.acct-desc { display: flex; align-items: center; gap: 8px; min-width: 0; }
.acct-desc > * { flex: 0 0 auto; }
.acct-number { font-family: var(--stmt-font-mono); }
/* The free text: clipped with an ellipsis, slid fully into view while the row is hovered. */
.acct-desc > .acct-ref {
    flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis;
    container-type: inline-size;
    color: var(--stmt-text-muted); font-size: 0.8rem;
}
/* At rest the text is plain inline content, so the ellipsis clips it mid-sentence
   (an inline-block would be dropped whole). Hovered, it becomes a box that can be
   slid by its own overflow: 100% is its full width, 100cqw the room it has. */
.acct-accordion .lines-table tr:hover .acct-ref { text-overflow: clip; }
.acct-accordion .lines-table tr:hover .acct-ref-text {
    display: inline-block;
    transform: translateX(min(0px, calc(100cqw - 100%)));
    transition: transform 2.5s linear 0.2s;
}
@media (prefers-reduced-motion: reduce) {
    .acct-accordion .lines-table tr:hover .acct-ref-text { transition: none; }
}
.acct-col-actions { width: 110px; text-align: right; white-space: nowrap; }
.acct-col-actions a.btn-icon { text-decoration: none; }
.acct-products-head td {
    background: var(--stmt-bg-expanded); color: var(--stmt-text-secondary);
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
.acct-accordion .total-reports-line { cursor: pointer; background: var(--stmt-bg-secondary); }
.acct-state {
    display: inline-block; padding: 2px 7px; border-radius: 4px;
    font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    border: 1px solid var(--stmt-border); color: var(--stmt-text-muted);
}
.acct-state-not_paid, .acct-state-partial { color: var(--stmt-color-negative); border-color: currentColor; }
.acct-state-in_payment { color: var(--stmt-accent-blue); border-color: currentColor; }

.acct-muted { color: var(--stmt-text-muted); font-size: 0.85rem; margin: 0; }

.acct-empty, .acct-loading { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.acct-empty h2 { color: var(--text-primary); }

/* ── Invoice YOYAKU (label-invoice-view.js): the same ledger chrome, in blocks ── */
.linv-block { margin-bottom: 20px; }
.acct-accordion .accordion-header-row.linv-block-head { display: block; padding: 14px 20px; }
.linv-block-body { padding: 12px 16px 16px; }
.linv-check { width: 28px; }
.linv-check input { cursor: pointer; }
.lines-table tr.linv-selected { background: var(--stmt-bg-expanded); }

.linv-state-todo { color: var(--stmt-accent); border-color: currentColor; }
.linv-state-wait { color: var(--stmt-accent-blue); border-color: currentColor; }
.linv-state-hold { color: var(--stmt-color-negative); border-color: currentColor; }
.linv-state-done { color: var(--stmt-color-positive); border-color: currentColor; }

.linv-how { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--stmt-border); }
.linv-how-total { display: flex; gap: 24px; align-items: baseline; font-size: 0.9rem; color: var(--stmt-text-secondary); margin-bottom: 12px; }
.linv-how-total strong { font-family: var(--stmt-font-mono); font-size: 1.05rem; color: var(--stmt-text-primary); }
.linv-how-total strong.positive { color: var(--stmt-color-positive); }
.linv-how-total strong.negative { color: var(--stmt-color-negative); }
.linv-how-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.linv-how-actions a.btn { text-decoration: none; }
.linv-disabled, .linv-how-actions button[disabled] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.linv-notice { margin: 12px 0 0; font-size: 0.8rem; line-height: 1.5; color: var(--stmt-text-muted); max-width: 90ch; white-space: normal; }
.linv-message { margin-bottom: 14px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--stmt-color-negative); color: var(--stmt-text-primary); font-size: 0.85rem; }

.linv-actions { text-align: right; white-space: nowrap; }
.linv-action, .linv-label-link {
    background: transparent; border: 1px solid var(--stmt-border); border-radius: 6px; color: var(--stmt-text-primary);
    font-size: 0.75rem; padding: 4px 8px; margin-left: 6px; cursor: pointer;
}
.linv-action:hover { border-color: var(--stmt-accent); }
.linv-action[disabled] { opacity: 0.45; cursor: not-allowed; }
.linv-label-link { border: 0; margin: 0; padding: 0; color: var(--stmt-accent); font-size: inherit; }
.linv-label-link:hover { text-decoration: underline; }

/* Dialogs: the ledger's .modal-overlay / .modal-content */
.linv-dialog { max-width: 520px; }
.linv-dialog-sub { margin: 8px 0 0; font-size: 0.8rem; color: var(--stmt-text-secondary); line-height: 1.5; }
.linv-dialog-sub strong { font-family: var(--stmt-font-mono); color: var(--stmt-text-primary); }
.linv-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.linv-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--stmt-text-muted); }
.linv-form .linv-form-file { grid-column: 1 / -1; }
.linv-form input, .linv-form textarea {
    background: var(--stmt-bg-secondary); border: 1px solid var(--stmt-border); border-radius: 6px;
    color: var(--stmt-text-primary); padding: 8px 10px; font-size: 0.9rem; font-family: inherit; text-transform: none; letter-spacing: 0;
}
.linv-form input:focus, .linv-form textarea:focus { outline: none; border-color: var(--stmt-accent); }
.linv-dialog-error { grid-column: 1 / -1; margin: 0; color: var(--stmt-color-negative); font-size: 0.85rem; }
