.crm-finance-page { min-width: 0; }
.pa-page { padding:24px;min-width:0;color:var(--crm-ui-text); }
.pa-summary { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px;padding:18px 0;border-bottom:1px solid var(--crm-ui-border); }
.pa-summary strong { display:block;font-size:26px; }
.pa-summary span { font-size:13px;color:var(--crm-ui-muted); }
.pa-toolbar { display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:20px 0; }
.pa-toolbar [role=tablist] { display:flex;gap:4px;flex-wrap:wrap; }
.pa-toolbar [role=tab] { padding:9px 12px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--crm-ui-muted);font:inherit;cursor:pointer; }
.pa-toolbar [aria-selected=true] { color:var(--crm-ui-text);border-bottom-color:var(--primary); }
.pa-toolbar .field-input { padding:10px;border:1px solid var(--crm-ui-border);border-radius:6px;max-width:100%;min-width:0; }
.pa-table { overflow:auto;border:1px solid var(--crm-ui-border);border-radius:6px; }
.pa-table table { width:100%;min-width:750px;border-collapse:collapse;font-size:13px; }
.pa-table :is(th,td) { text-align:left;padding:12px;border-bottom:1px solid var(--crm-ui-border);background:var(--crm-ui-surface);max-width:260px;overflow-wrap:anywhere; }
.pa-table th { background:var(--crm-ui-field); }
.pa-table small { display:block;color:var(--crm-ui-muted);margin-top:4px; }
.pa-pagination,.pa-actions { display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:18px; }
.pa-page .btn svg { width:18px;height:18px; }
body.crm-fullscreen-active .pa-dialog { position:fixed;inset:0;margin:auto;width:min(760px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto;padding:24px;border-radius:8px;border:1px solid var(--crm-ui-border);font:inherit; }
.pa-dialog h2 { font-size:21px;margin-bottom:16px; }
.pa-dialog :is(h3,h4) { font-size:16px;margin:18px 0 10px; }
.pa-dialog .field { display:grid;gap:6px;margin:16px 0; }
.pa-dialog .field-input { border:1px solid var(--crm-ui-border);padding:10px;border-radius:6px;min-width:0;width:100%; }
.pa-info { display:grid;grid-template-columns:minmax(100px,1fr) minmax(0,2fr);gap:10px;margin:16px 0; }
.pa-info dt { color:var(--crm-ui-muted); }
.pa-info dd { margin:0;overflow-wrap:anywhere;white-space:pre-wrap; }
.pa-members { padding-left:20px;overflow-wrap:anywhere; }
.pa-membership { padding:12px 0;border-top:1px solid var(--crm-ui-border); }
.pa-confirm { max-width:480px!important; }
#pa-error,.pa-action-error { color:#c6334a; }
body.theme-dark :is(#pa-error,.pa-action-error) { color:#ff8798; }
.crm-lesson-fields { display:grid;gap:12px;margin:16px 0; }
.crm-lesson-fields[hidden] { display:none; }
body.crm-fullscreen-active #crm-cal-dialog { width:min(640px,calc(100vw - 24px)); }
body.crm-fullscreen-active #crm-cal-dialog .crm-v2-form-dialog-body { max-height:min(68dvh,650px); }
body.crm-fullscreen-active #crm-cal-dialog .crm-v2-form-dialog-actions [data-crm-close-dialog] { color:var(--crm-ui-text);background:var(--crm-ui-field);border:1px solid var(--crm-ui-border); }
body.crm-fullscreen-active .crm-v2-cal-event.is-lesson { display:grid;grid-template-columns:20px minmax(0,1fr) auto;align-items:start;gap:10px; }
.crm-v2-cal-event.is-lesson .crm-v2-cal-drag-handle { grid-area:1 / 1; }
.crm-v2-cal-event.is-lesson .crm-v2-cal-event-time { grid-area:1 / 2; }
.crm-v2-cal-event.is-lesson .crm-v2-cal-event-actions { grid-area:1 / 3; }
.crm-v2-cal-event.is-lesson .crm-v2-cal-event-body { grid-area:2 / 1 / 3 / 4;min-width:0; }
body.crm-fullscreen-active .crm-v2-cal-event-client { color:var(--crm-ui-muted); }
.crm-lesson-ledger { font-size:13px; }
.crm-cal-comment { white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0; }
.crm-lesson-ledger section { padding:10px 0;border-top:1px solid var(--crm-ui-border); }
.crm-lesson-ledger p { margin:5px 0; }
.crm-lesson-ledger .finance-row-actions { flex-wrap:wrap; }
.crm-lesson-ledger ul,.crm-lesson-payments { padding-left:18px;overflow-wrap:anywhere; }
.crm-payment-status { display:block;font-size:12px;font-weight:600;color:var(--crm-ui-muted); }
.crm-payment-status.is-paid { color:#138353; }
.crm-payment-status.is-overdue { color:#ba304c; }
.crm-payment-status.is-partial { color:#996100; }
body.theme-dark .crm-payment-status.is-paid { color:#54e1a7; }
body.theme-dark .crm-payment-status.is-overdue { color:#ff8798; }
body.theme-dark .crm-payment-status.is-partial { color:#ffd166; }
@media(max-width:700px) { .pa-page {padding:12px;} .pa-summary {grid-template-columns:repeat(2,minmax(0,1fr));} .pa-toolbar>input {width:100%;} .pa-info {grid-template-columns:minmax(0,1fr);} body.crm-fullscreen-active .pa-dialog {padding:16px;} }
body.crm-fullscreen-active { --crm-ui-surface:#fff; --crm-ui-field:#f5f7fb; --crm-ui-text:#202c3e; --crm-ui-muted:#596980; --crm-ui-border:#d6deea; color-scheme:light; }
body.crm-fullscreen-active.theme-dark { --crm-ui-surface:#171e2b; --crm-ui-field:#202a3b; --crm-ui-text:#edf2fa; --crm-ui-muted:#b3bfd2; --crm-ui-border:#39475e; color-scheme:dark; }
body.crm-fullscreen-active :is(.crm-v2-lead-layer,.crm-dialog) { color:var(--crm-ui-text); }
body.crm-fullscreen-active .crm-v2-lead-layer :is(.crm-v2-lead-layer-panel,.crm-v2-lead-layer-head,.crm-v2-lead-layer-foot,.crm-v2-lead-block),
body.crm-fullscreen-active .crm-dialog,
body.crm-fullscreen-active .crm-dialog .crm-dialog-inner { background:var(--crm-ui-surface); color:var(--crm-ui-text); border-color:var(--crm-ui-border); }
body.crm-fullscreen-active :is(.crm-v2-shell,.crm-v2-lead-layer,.crm-dialog) :is(.field-input,.crm-v2-form-select-btn,.crm-v2-form-select-menu,.crm-v2-more-menu) { background:var(--crm-ui-field); color:var(--crm-ui-text); border-color:var(--crm-ui-border); }
body.crm-fullscreen-active :is(.crm-v2-shell,.crm-v2-lead-layer,.crm-dialog) :is(.field-input,.crm-v2-form-select-btn) { font-family:inherit; }
body.crm-fullscreen-active :is(.crm-v2-lead-layer,.crm-dialog) :is(.field>span,.crm-v2-lead-block h4,.crm-v2-page-title) { color:var(--crm-ui-text); }
body.crm-fullscreen-active :is(.crm-v2-shell,.crm-v2-lead-layer,.crm-dialog) :is(input,textarea)::placeholder { color:var(--crm-ui-muted); opacity:1; }
body.crm-fullscreen-active :is(.crm-v2-form-select-menu,.crm-v2-more-menu) :is(button,strong) { color:var(--crm-ui-text); }
body.crm-fullscreen-active :is(.crm-v2-form-select-menu,.crm-v2-more-menu) small { color:var(--crm-ui-muted); }
body.crm-fullscreen-active .crm-finance-table :is(table,td,th) { background:var(--crm-ui-surface); color:var(--crm-ui-text); border-color:var(--crm-ui-border); }
body.crm-fullscreen-active .crm-finance-table th { background:var(--crm-ui-field); }
body.crm-fullscreen-active.theme-dark .finance-income { color:#54e1a7; }
body.crm-fullscreen-active.theme-dark .finance-expense { color:#ff8798; }
body.crm-fullscreen-active .crm-finance-table td.finance-income { color:#138353; }
body.crm-fullscreen-active .crm-finance-table td.finance-expense { color:#ba304c; }
body.crm-fullscreen-active.theme-dark .crm-finance-table td.finance-income { color:#54e1a7; }
body.crm-fullscreen-active.theme-dark .crm-finance-table td.finance-expense { color:#ff8798; }
body.crm-fullscreen-active .crm-finance-summary span { color:var(--crm-ui-muted); }
body.crm-fullscreen-active .crm-v2-lead-layer :is(.field-input,.crm-v2-form-select-btn) { border:1px solid var(--crm-ui-border); }
body.crm-fullscreen-active .crm-v2-lead-layer .field { display:flex;flex-direction:column;gap:6px;margin-bottom:14px;min-width:0; }
body.crm-fullscreen-active .crm-v2-lead-layer .field>span { margin-bottom:0; }
body.crm-fullscreen-active .crm-v2-lead-layer :is(.crm-v2-client-type-chip,.crm-v2-lead-layer-close) { color:var(--crm-ui-text);background:var(--crm-ui-field);border-color:var(--crm-ui-border);font-family:inherit; }
body.crm-fullscreen-active .crm-v2-lead-layer .crm-v2-client-type-chip.is-active { color:#087344;background:#def5e8;border-color:#168c56; }
body.crm-fullscreen-active.theme-dark .crm-v2-lead-layer .crm-v2-client-type-chip.is-active { color:#73efb3;background:#153d2d;border-color:#38b77a; }
body.crm-fullscreen-active .crm-v2-lead-layer :is(.crm-v2-lead-layer-inner,.crm-v2-lead-layer-form,.crm-v2-lead-block) { min-width:0; }
body.crm-fullscreen-active .crm-finance-table { border-radius:6px;box-shadow:none;border-color:var(--crm-ui-border); }
body.crm-fullscreen-active .crm-v2-shell table { font-family:inherit; }
.crm-dashboard-finance { padding:20px 0;margin:18px 0;border-top:1px solid var(--crm-ui-border);border-bottom:1px solid var(--crm-ui-border);min-width:0; }
.crm-dashboard-finance .finance-header h3 { font-size:18px; }
.crm-dashboard-finance .finance-row-actions { flex-wrap:wrap; }
.crm-finance-table table { min-width:720px; }
.crm-social-field { display:flex;gap:8px;align-items:center; }
.crm-social-field .field { flex:1;min-width:0; }
.crm-social-link { display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:34px;min-height:34px;padding:6px;border:1px solid var(--crm-ui-border);border-radius:4px;color:#087e61;text-decoration:none; }
body.theme-dark .crm-social-link { color:#59e9bd; }
.crm-social-link svg { width:17px;height:17px;flex-shrink:0; }
.crm-social-link[hidden] { display:none; }
.crm-event-participants { border:0;min-width:0;margin:14px 0; }
.crm-event-participants legend { margin-bottom:8px;font-weight:600; }
#crm-cal-clients { max-height:190px;overflow:auto;display:grid;gap:8px;margin-top:10px; }
#crm-cal-clients label { display:flex;align-items:flex-start;gap:8px;min-width:0;padding:6px;border-bottom:1px solid var(--crm-ui-border); }
#crm-cal-clients label[hidden] { display:none; }
#crm-cal-clients small { display:block;color:var(--crm-ui-muted); }
#crm-cal-clients input { accent-color:var(--primary);margin-top:3px; }
.crm-v2-money-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.crm-v2-money-stats .crm-v2-stat-value { font-size: 24px; padding-right: 52px; overflow-wrap: anywhere; }
.crm-v2-money-stats .crm-v2-stat-card { min-height: 128px; }
@media (max-width: 700px) {
  .crm-dashboard-finance .crm-finance-table table { min-width:0; }
  .crm-dashboard-finance .crm-finance-table :is(th,td):is(:nth-child(3),:nth-child(4),:nth-child(6),:nth-child(7),:nth-child(8)) { display:none; }
  .crm-dashboard-finance .crm-finance-table :is(th,td) { padding:12px 8px; }
  body.crm-fullscreen-active .crm-v2-lead-layer :is(.crm-v2-lead-layer-head,.crm-v2-lead-layer-foot) { padding:14px 12px; }
  body.crm-fullscreen-active .crm-v2-lead-layer .crm-v2-lead-layer-scroll { padding:16px 12px; }
  body.crm-fullscreen-active .crm-v2-lead-layer .crm-v2-lead-block { padding:16px 12px; }
  body.crm-fullscreen-active .crm-v2-client-setup-grid { grid-template-columns:minmax(0,1fr); }
  .crm-v2-client-detail-foot-inner { flex-wrap:wrap;gap:8px;min-width:0; }
  .crm-v2-client-detail-actions { gap:8px;min-width:0; }
  body.crm-fullscreen-active .crm-v2-lead-layer-foot .btn { min-width:0;padding:10px 12px; }
  .crm-v2-money-stats { grid-template-columns: minmax(0, 1fr); }
}
.crm-company-switch { max-width: 200px; font-size: 13px; }
.crm-company-label { max-width: 200px; overflow-wrap: anywhere; font-size: 13px; }
.finance-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.finance-header h2, .finance-header h3 { font-size: 22px; margin: 0; }
.finance-header .btn { display: inline-flex; align-items: center; gap: 8px; }
.crm-finance-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 22px 0; margin: 0 24px 20px; border-bottom: 1px solid #dce3df; }
.crm-finance-page .crm-finance-summary { margin-inline: 0; }
.crm-finance-summary span { display: block; color: #68716b; font-size: 13px; margin-bottom: 8px; }
.crm-finance-summary strong { display: block; font-size: 24px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.finance-income { color: #14804b; }
.finance-expense { color: #b23946; }
.finance-filters { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(140px, 1fr) repeat(2, minmax(130px, 1fr)) 40px; gap: 12px; align-items: end; margin-bottom: 20px; }
.finance-filters .field { margin: 0; min-width: 0; }
.crm-finance-page .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.crm-finance-page .field-input { width: 100%; box-sizing: border-box; min-height: 40px; border: 1px solid var(--border, #dce3df); border-radius: 6px; padding: 8px 10px; background: var(--card-bg, #fff); color: var(--text, #222); font: inherit; }
.finance-icon { width: 36px; height: 36px; display: inline-flex; justify-content: center; align-items: center; padding: 8px; flex-shrink: 0; }
.finance-icon svg { width: 20px; height: 20px; }
.finance-row-actions { display: flex; gap: 4px; }
.finance-amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.finance-comment { max-width: 320px; overflow-wrap: anywhere; white-space: normal; }
.finance-count { font-size: 13px; margin-top: 12px; }
.finance-editor { max-width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border-radius: 8px; }
.finance-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.finance-form-grid .field { min-width: 0; margin: 0; }
.finance-form-wide { grid-column: 1 / -1; }
.crm-tasks-content { padding: 24px; min-width: 0; }
.crm-tasks-content, #task-drawer { font-family: inherit; }
.crm-tasks-content .task-templates-bar { border: 0; background: transparent; padding-inline: 0; }
.crm-tasks-content .task-kanban { max-width: 100%; overflow-x: auto; }
.crm-tasks-content .task-section-head h2 { font-size: 24px; }
.crm-tasks-content .task-section-head p { font-size: 13px; }
.crm-tasks-content .task-section-head { flex-wrap: wrap; gap: 12px; }
.crm-tasks-content .task-filters-row, .crm-tasks-content .task-templates-bar { flex-wrap: wrap; }
.crm-tasks-content [draggable=false] { cursor: default; }
@media (max-width: 700px) {
  .crm-v2-topbar-start { flex-basis: 100%; }
  .crm-v2-topbar-end { max-width: 100%; flex-wrap: wrap; }
  .crm-v2-nav { flex-basis: 100%; }
  .finance-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-filters > :first-child { grid-column: 1 / -1; }
  .finance-form-grid { grid-template-columns: minmax(0, 1fr); }
  .crm-finance-summary { gap: 12px; margin-inline: 12px; }
  .crm-finance-summary strong { font-size: 17px; }
  .crm-finance-summary span { font-size: 12px; }
  .finance-header h2 { font-size: 20px; }
  .crm-tasks-content { padding: 12px; }
  .crm-tasks-content .task-section-actions { flex-wrap: wrap; }
}
