/* public/finance.css — «📊 Финансы» (Ф1, 30.10.2026) */
#finance-view .fin-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
#finance-view .fin-head h2 { margin: 0; }
.fin-conf { color: #b42318; font-weight: 600; font-size: 13px; }
html[data-theme="dark"] .fin-conf { color: var(--g-bad, #f4867b); } /* №261116-КИ-3: тёмный двойник — контраст ≥ 4,5 на тёмном фоне */
.fin-meta { color: var(--muted, #6b7280); font-size: 13px; }
.fin-box { max-width: 640px; display: grid; gap: 10px; margin-top: 12px; }
.fin-box label { display: grid; gap: 4px; }
.fin-box input, .fin-box textarea { max-width: 100%; box-sizing: border-box; }
.fin-ul { margin: 0; padding-left: 20px; }
.fin-words { columns: 3 140px; padding-left: 28px; font-size: 16px; font-weight: 600; margin: 4px 0; }
.fin-check { display: flex; gap: 6px; align-items: center; }
.fin-alert { border-radius: 10px; padding: 10px 12px; margin: 10px 0; overflow-wrap: anywhere; }
.fin-red { background: #fde8e8; border: 1px solid #f5b5b5; color: #7a1010; }
.fin-yellow { background: #fff6d6; border: 1px solid #f1d36b; color: #5c4400; }
.fin-pre { color: #8a5a00; font-weight: 600; margin: 6px 0; }
.fin-note { margin: 6px 0; }
.fin-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 12px 0; }
.fin-bar label { display: flex; gap: 6px; align-items: center; }
.fin-seg { display: inline-flex; border: 1px solid var(--border, #d8dde6); border-radius: 10px; overflow: hidden; }
.fin-seg button { border: 0; border-radius: 0; padding: 6px 12px; background: transparent; }
.fin-seg button.active { background: var(--accent, #1e5aa8); color: #fff; }
.fin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 10px; margin: 10px 0 14px; }
.fin-card { border: 1px solid var(--border, #d8dde6); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; min-width: 0; }
.fin-card span { font-size: 12px; color: var(--muted, #6b7280); }
.fin-card b { font-size: 18px; overflow-wrap: anywhere; }
.fin-card small { font-size: 11px; color: var(--muted, #6b7280); }
.fin-card.main { border-color: var(--accent, #1e5aa8); }
.fin-card.neg b, .fin-t td.neg { color: #b42318; }
.fin-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border, #d8dde6); margin-bottom: 10px; }
.fin-tabs button { border: 0; background: transparent; padding: 8px 10px; border-bottom: 2px solid transparent; border-radius: 0; }
.fin-tabs button.active { border-bottom-color: var(--accent, #1e5aa8); font-weight: 600; }
.fin-tools { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
.fin-tw { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; margin-bottom: 12px; }
.fin-t { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.fin-t th, .fin-t td { border-bottom: 1px solid var(--border, #e5e7eb); padding: 4px 6px; white-space: nowrap; }
.fin-t thead th { position: sticky; top: 0; background: var(--surface, #fff); }
.fin-t tbody th { text-align: left; font-weight: 400; position: sticky; left: 0; background: var(--surface, #fff); max-width: 260px; white-space: normal; }
.fin-t td.num { text-align: right; font-variant-numeric: tabular-nums; }
.fin-t .q, .fin-t td.q { background: rgba(30, 90, 168, .05); }
.fin-t .y, .fin-t td.y { background: rgba(30, 90, 168, .1); font-weight: 600; }
.fin-t tr.b th, .fin-t tr.b td { font-weight: 600; }
.fin-t tr.total th, .fin-t tr.total td { border-top: 2px solid var(--text, #111); }
.fin-t tr.sub th { padding-left: 18px; color: var(--muted, #6b7280); }
.fin-log td { white-space: normal; }
.fin-log tr.deny td { color: #b42318; }
.fin-new { background: #fff1b8; border-radius: 6px; padding: 0 6px; font-size: 11px; }
.fin-shares { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.fin-shares input { width: 70px; }
.hn-item.hn-alert .hn-row { background: #fde8e8; border-left: 4px solid #b42318; }
@media (max-width: 640px) {
  .fin-cards { grid-template-columns: 1fr; }
  .fin-bar { gap: 6px 10px; }
  .fin-t tbody th { max-width: 140px; }
}
/* Ф2: сигналы и отчёты */
.fin-signals { display: grid; gap: 4px; margin: 6px 0 12px; }
.fin-sig { border-radius: 8px; padding: 6px 10px; overflow-wrap: anywhere; }
.fin-sig-red { background: #fde8e8; color: #7a1010; }
.fin-sig-orange { background: #ffefd9; color: #6b3a00; }
.fin-sig-yellow { background: #fff8d6; color: #5c4400; }
#fin-rep-view h3 { font-size: 16px; margin: 14px 0 6px; }
.fin-green { background: #e7f6ec; border: 1px solid #a6d9b6; color: #14532d; }

/* 31.10.2026: справка раздела (только владельцу) */
.fin-help-box { position: relative; border: 1px solid var(--border, #d0d7de); border-radius: 10px; padding: 12px 16px; margin: 10px 0; background: var(--card, #fff); font-size: 14px; line-height: 1.5; }
.fin-help-box .fin-help-x { position: absolute; top: 8px; right: 8px; }
.fin-help-box h3 { margin: 0 32px 8px 0; }
/* 01.11.2026: агенты «Финансов» (public/finance-agents.js) и «🧾 Бухгалтерия» (public/books.js) */
.fa-chat { max-height: 420px; overflow-y: auto; border: 1px solid var(--border, #ddd); border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
.fa-q { margin: 10px 0 4px; }
.fa-a { background: rgba(127, 127, 127, .08); border-radius: 8px; padding: 6px 10px; overflow-wrap: anywhere; }
.fa-a p, .fa-analysis p { margin: 4px 0; }
.fa-card summary { cursor: pointer; }
.fa-urgent > summary { color: #b00; }
.fa-analysis { border-top: 1px solid var(--border, #ddd); margin-top: 12px; padding-top: 8px; }
.bk-task.overdue { color: #b00; }
.fa-fail { background: rgba(192, 57, 43, .08); color: var(--danger, #c0392b); }
