/* Дополнительные компоненты кабинета 2.0. Цвета берутся из общей темы styles.css. */
.v2-voice-card,
.v2-price-import,
.v2-extra-docs,
.v2-expenses,
.v2-team-card,
.v2-crm-card,
.v2-stroyprofi,
.v2-compare-wrap { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.v2-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.v2-card-head > * { min-width: 0; }
.v2-card-head h2 { margin: 0; }
.v2-voice-card { display: flex; flex-direction: column; gap: 10px; }
.v2-voice-card .v2-card-head { align-items: center; }
.v2-voice-controls { display: flex; align-items: center; gap: 10px; min-width: 0; }
.v2-mic-btn { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; background: var(--soft); color: var(--text); font-size: 21px; cursor: pointer; }
.v2-mic-btn:disabled { opacity: .55; cursor: not-allowed; }
.v2-mic-btn.is-listening { background: var(--danger); color: #fff; border-color: var(--danger); animation: v2-mic-pulse 1.1s ease-in-out infinite; }
@keyframes v2-mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 36%, transparent); } 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--danger) 0%, transparent); } }
.v2-voice-text { min-width: 0; resize: vertical; }
.v2-voice-results:empty { display: none; }
.v2-chip-list { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.v2-chip { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
.v2-compare-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; min-width: 0; }
.v2-compare-card { display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); overflow-wrap: anywhere; }
.v2-compare-card h3 { margin: 9px 0 5px; font-size: 18px; }
.v2-compare-card.is-hot { border: 2px solid var(--accent); box-shadow: 0 5px 20px color-mix(in srgb, var(--accent) 12%, transparent); }
.v2-compare-desc { flex: 1; min-height: 52px; color: var(--hint); font-size: 13px; }
.v2-compare-prices { display: grid; gap: 6px; padding: 12px 0; margin-top: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; }
.v2-compare-prices span, .v2-compare-total { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.v2-compare-prices b, .v2-compare-total b { text-align: right; font-variant-numeric: tabular-nums; }
.v2-compare-total { align-items: baseline; margin: 12px 0 2px; font-size: 14px; }
.v2-compare-total b { font-size: 20px; }
.v2-compare-card .btn { margin-top: 12px; font-size: 14px; }
.v2-compare-wrap > .btn { margin-top: 14px; }
.v2-live-bar { position: sticky; top: 52px; z-index: 4; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); background: var(--card); box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.v2-live-bar > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v2-live-bar span { color: var(--hint); font-size: 11px; }
.v2-live-bar b { font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.v2-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; min-width: 0; margin: 12px 0; }
.v2-kpi { display: flex; flex-direction: column; justify-content: center; gap: 5px; min-width: 0; min-height: 72px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.v2-kpi span { color: var(--hint); font-size: 11px; line-height: 1.25; }
.v2-kpi b { font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.v2-badge { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; padding: 5px 10px; border-radius: 999px; background: var(--soft); color: var(--link); font-size: 12px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.v2-badge.is-approved { background: color-mix(in srgb, #2f9e44 15%, var(--card)); color: #2f9e44; }
.v2-badge.is-changes { background: color-mix(in srgb, #e67700 15%, var(--card)); color: #b85f00; }
.v2-badge.is-pending { background: var(--soft); color: var(--hint); }
.v2-approval-status { margin-bottom: 10px; }
.v2-approval-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.v2-approval-actions .btn { min-width: 0; margin: 0; padding: 8px 10px; font-size: 14px; }
.v2-extra-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.v2-extra-grid .btn { min-width: 0; min-height: 44px; margin: 0; padding: 8px 10px; font-size: 13px; line-height: 1.3; }
.v2-expense-list, .v2-team-list { min-width: 0; }
.v2-expenses h3, .v2-team-card h3 { margin: 14px 0 7px; font-size: 15px; }
.v2-expense-row, .v2-team-row { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.v2-expense-name, .v2-team-row > span:first-child { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.v2-expense-name small, .v2-team-row small { color: var(--hint); font-size: 12px; }
.v2-expense-row > b { flex: none; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.v2-delete-expense { flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--soft); color: var(--danger); font-size: 23px; line-height: 1; cursor: pointer; }
.v2-expense-form { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.v2-expense-form .field { min-width: 0; }
.v2-expense-form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 8px; min-width: 0; }
.v2-expense-form-row .input { min-width: 0; }
.v2-team-row > span:nth-child(2) { flex: 1; min-width: 0; text-align: right; font-size: 12px; overflow-wrap: anywhere; }
.v2-invite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.v2-invite code { padding: 5px 8px; border-radius: 7px; background: var(--soft); overflow-wrap: anywhere; }
.v2-table-scroll { max-width: 100%; margin-top: 12px; overflow-x: auto; overscroll-behavior-x: contain; }
.v2-import-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.v2-import-table th, .v2-import-table td { padding: 9px 7px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
.v2-import-table th { color: var(--hint); font-size: 11px; }
.v2-import-table input { width: 18px; height: 18px; accent-color: var(--accent); }
.v2-price-import .field { margin-top: 12px; }
.v2-price-import > .btn { margin-top: 12px; }
.v2-event-list { display: flex; flex-direction: column; gap: 9px; margin: 14px 0; }
.v2-event-list > b { margin-bottom: 1px; }
.v2-crm-card .btns { margin-top: 12px; }
.v2-crm-card .btns .btn { min-width: 0; padding: 8px; font-size: 14px; }
.v2-stroyprofi .btn { margin-top: 10px; }
.v2-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.v2-voice-card *, .v2-compare-card *, .v2-price-import *, .v2-extra-docs *, .v2-expenses *, .v2-team-card *, .v2-crm-card *, .v2-stroyprofi * { min-width: 0; }
.editor-section-head, .editor-row-foot, .editor-row-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.editor-section-head > .input { flex: 1; }
.editor-section-head > b, .editor-row-foot > b { flex: none; font-size: 13px; overflow-wrap: anywhere; }
.editor-row-foot { flex-wrap: wrap; margin-top: 8px; }
.editor-row-actions { flex-wrap: wrap; justify-content: flex-start; }
.editor-price-pick { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin-top: 10px; }
.editor-price-pick .field { min-width: 0; margin: 0; }
.edit-line > label { display: block; min-width: 0; }
.edit-line > label .input { width: 100%; min-width: 0; }

@media (max-width: 680px) {
  .v2-compare-grid { grid-template-columns: minmax(0, 1fr); }
  .v2-compare-desc { min-height: 0; }
  .v2-extra-grid { grid-template-columns: minmax(0, 1fr); }
  .v2-extra-grid .btn { width: 100%; }
}
@media (max-width: 360px) {
  .v2-kpi-grid { gap: 5px; }
  .v2-kpi { padding: 8px 6px; }
  .v2-kpi b { font-size: 13px; }
  .v2-approval-actions { grid-template-columns: minmax(0, 1fr); }
  .v2-expense-form-row { grid-template-columns: minmax(0, 1fr); }
  .editor-section-head { align-items: stretch; flex-direction: column; }
  .editor-price-pick { grid-template-columns: minmax(0, 1fr); }
  .editor-price-pick .btn { width: 100%; }
  .editor-row-foot { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { .v2-mic-btn.is-listening { animation: none; } }

/* Финансы, сборное КП и условия договора используют общую тему. */
.v2-positive, .v2-kpi.v2-positive b { color: #187849; }
.v2-negative, .v2-kpi.v2-negative b { color: var(--danger, #b42318); }
.v2-budget { margin: 14px 0; }
.v2-budget-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-size: 13px; }
.v2-budget-bar { height: 10px; overflow: hidden; margin-top: 8px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.v2-budget-fill { height: 100%; max-width: 100%; border-radius: inherit; background: var(--accent); }
.v2-budget-bar.is-over .v2-budget-fill { background: var(--danger, #b42318); }
.v2-category-list { margin: 8px 0 16px; }
.v2-category-list > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.v2-category-list dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.v2-bundle-box { min-width: 0; max-width: 100%; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); overflow-wrap: anywhere; }
.v2-bundle-box fieldset { min-width: 0; margin: 0 0 12px; padding: 0; border: 0; }
.v2-bundle-box legend { margin-bottom: 8px; }
.v2-bundle-choice { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 0; }
.v2-bundle-choice input { flex: none; width: 20px; height: 20px; accent-color: var(--accent); }
.v2-bundle-choice span { min-width: 0; }
.v2-bundle-box .btn { white-space: normal; }
.v2-terms-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.v2-terms-grid > *, .v2-terms-grid .input { min-width: 0; max-width: 100%; }
.v2-terms-grid .field { margin: 0; overflow-wrap: anywhere; }
.v2-terms-schedule { grid-column: 1 / -1; }
.v2-payment-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12px; }
.v2-payment-table th, .v2-payment-table td { padding: 7px 3px; text-align: left; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); }
.v2-payment-table th:first-child { width: 8%; }
.v2-payment-table th:nth-child(2) { width: 38%; }
.v2-payment-table th:nth-child(3) { width: 18%; }
.v2-bundle-box[hidden], #customSchedule[hidden] { display: none; }
@media (max-width: 680px) {
  .v2-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .v2-terms-grid { grid-template-columns: minmax(0, 1fr); }
  .v2-expense-row { flex-wrap: wrap; }
  .v2-expense-row > b { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
}
@media (prefers-color-scheme: dark) { .v2-positive, .v2-kpi.v2-positive b { color: #67d99f; } }

.v2-preview-actions { flex-wrap: wrap; }
.v2-preview-actions > .btn { flex: 1 1 180px; min-width: 0; white-space: normal; text-align: center; text-decoration: none; }
:root[data-theme="dark"] .v2-positive, :root[data-theme="dark"] .v2-kpi.v2-positive b { color: #67d99f; }
.v2-bundle-box button:focus-visible, .v2-bundle-choice input:focus-visible, .v2-terms-grid button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
