:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #172033;
  --muted: #667085;
  --border: #e2e8f0;
  --primary: #1e5eff;
  --primary-dark: #194fd6;
  --success: #16803c;
  --warning: #b45309;
  --danger: #c62828;
  --nav: #101828;
  --nav-muted: #98a2b3;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(15, 23, 42, .06);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); font-size: 14px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 258px; background: var(--nav); color: white; position: fixed; inset: 0 auto 0 0; overflow-y: auto; padding: 18px 14px 28px; z-index: 40; }
.brand { display: flex; align-items: center; gap: 11px; color: white; padding: 5px 8px 19px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 13px; }
.brand:hover { color: white; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg,#5b8cff,#1e5eff); font-size: 20px; font-weight: 800; box-shadow: 0 8px 20px rgba(30,94,255,.35); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { color: var(--nav-muted); font-size: 10px; margin-top: 2px; }
.main-nav { display: flex; flex-direction: column; gap: 2px; }
.main-nav a { display: flex; align-items: center; gap: 10px; min-height: 39px; padding: 8px 11px; color: #d0d5dd; border-radius: 9px; transition: .15s ease; }
.main-nav a span { width: 20px; text-align: center; font-size: 16px; }
.main-nav a:hover { background: rgba(255,255,255,.07); color: white; }
.main-nav a.active { background: #1d2939; color: white; box-shadow: inset 3px 0 0 #5b8cff; }
.nav-group { margin: 15px 11px 5px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: #667085; }
.page-shell { margin-left: 258px; min-width: 0; width: calc(100% - 258px); }
.topbar { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(10px); }
.topbar-spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 9px; padding-left: 8px; }
.user-chip strong, .user-chip small { display: block; line-height: 1.2; }
.user-chip strong { font-size: 13px; }
.user-chip small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #e8efff; color: var(--primary); font-weight: 800; }
.icon-button { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 9px; color: var(--muted); }
.icon-button:hover { background: var(--surface-2); color: var(--text); }
.mobile-menu { display: none; }
.content { padding: 24px; max-width: 1800px; margin: 0 auto; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-heading h1 { margin: 0 0 5px; font-size: 25px; letter-spacing: -.02em; }
.page-heading p { margin: 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; background: var(--primary); color: white; font-weight: 650; white-space: nowrap; }
.button:hover { background: var(--primary-dark); color: white; }
.button-secondary { background: white; color: var(--text); border-color: var(--border); }
.button-secondary:hover { background: var(--surface-2); color: var(--text); }
.button-danger { background: #fee2e2; color: var(--danger); border-color: #fecaca; }
.button-danger:hover { background: #fecaca; color: var(--danger); }
.button-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.button-ghost:hover { background: var(--surface-2); color: var(--text); }
.button-small { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-header h2, .card-header h3 { margin: 0; font-size: 16px; }
.card-body { padding: 18px; }
.cards-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { padding: 17px; position: relative; overflow: hidden; }
.metric-card small { color: var(--muted); display: block; margin-bottom: 8px; }
.metric-card strong { display: block; font-size: 24px; letter-spacing: -.03em; }
.metric-card .metric-note { margin-top: 7px; color: var(--muted); font-size: 12px; }
.metric-accent { position: absolute; right: -16px; bottom: -28px; width: 90px; height: 90px; border-radius: 50%; background: #eef3ff; }
.two-column { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(320px,.85fr); gap: 18px; align-items: start; }
.three-column { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.stack { display: grid; gap: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; background: var(--surface-2); }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:hover { background: #fbfcfe; }
td.number, th.number { text-align: right; white-space: nowrap; }
.table-link { font-weight: 700; color: var(--text); }
.table-link:hover { color: var(--primary); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #eef2f6; color: #475467; white-space: nowrap; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.alert ul { margin: 6px 0 0 18px; }
.alert-success { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.alert-danger { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.alert-warning { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 9px; padding: 13px; margin-bottom: 16px; background: white; border: 1px solid var(--border); border-radius: 12px; }
.filter-bar .field { min-width: 150px; flex: 1; }
.filter-bar .field-wide { flex: 2; }
.form-card { max-width: 980px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.form-grid .full { grid-column: 1/-1; }
.field label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: #344054; }
.field input, .field select, .field textarea { width: 100%; min-height: 40px; border: 1px solid #d0d5dd; border-radius: 8px; padding: 8px 10px; color: var(--text); background: white; outline: none; }
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #84a7ff; box-shadow: 0 0 0 3px #edf2ff; }
.field-help { font-size: 11px; color: var(--muted); margin-top: 4px; }
.checkbox { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.checkbox input { width: 17px; height: 17px; }
.form-actions { display: flex; gap: 9px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.detail-hero { padding: 20px; display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.detail-hero h1 { margin: 0 0 7px; font-size: 24px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px 18px; color: var(--muted); }
.info-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.info-item { padding: 12px; background: var(--surface-2); border-radius: 10px; }
.info-item small { color: var(--muted); display: block; margin-bottom: 5px; }
.info-item strong { font-size: 15px; }
.progress { height: 7px; border-radius: 999px; background: #e9eef5; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.kanban-wrap { overflow-x: hidden; padding-bottom: 12px; }
.kanban-board { display: grid; grid-template-columns: repeat(var(--kanban-columns), minmax(0, 1fr)); gap: 10px; align-items: start; }
.kanban-column { min-width: 0; background: #edf1f7; border: 1px solid #e1e7ef; border-radius: 13px; padding: 10px; min-height: 220px; transition: .15s ease; }
.kanban-bottom { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.kanban-bottom-title { margin: 0 0 9px 2px; color: var(--muted); font-size: 12px; font-weight: 700; }
.kanban-column.drag-over { background: #e4ecff; border-color: #9db7ff; }
.kanban-header { display: flex; align-items: center; gap: 8px; padding: 4px 3px 10px; font-weight: 750; }
.kanban-dot { width: 9px; height: 9px; border-radius: 50%; }
.kanban-count { margin-left: auto; min-width: 23px; height: 23px; border-radius: 999px; display: grid; place-items: center; background: rgba(255,255,255,.8); color: var(--muted); font-size: 11px; }
.kanban-cards { display: grid; gap: 9px; min-height: 130px; }
.kanban-card { background: white; border: 1px solid #dfe5ed; border-radius: 10px; padding: 12px; box-shadow: 0 3px 10px rgba(15,23,42,.05); cursor: grab; }
.kanban-card.dragging { opacity: .45; transform: rotate(1deg); }
.kanban-card h3 { margin: 0 0 6px; font-size: 13px; overflow-wrap: anywhere; }
.kanban-card h3 a { color: var(--text); }
.kanban-card h3 a:hover { color: var(--primary); }
.kanban-card .amount { font-size: 16px; font-weight: 800; margin: 9px 0; }
.kanban-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 7px; color: var(--muted); font-size: 11px; margin-top: 8px; }
.kanban-warning { border-left: 3px solid #f59e0b; }
.kanban-danger { border-left: 3px solid #ef4444; }
.timeline { position: relative; min-width: 780px; }
.gantt-row { display: grid; grid-template-columns: 260px minmax(520px,1fr); min-height: 52px; border-bottom: 1px solid var(--border); }
.gantt-label { padding: 10px 12px; border-right: 1px solid var(--border); }
.gantt-track { position: relative; background-image: linear-gradient(to right, transparent 24.8%, #eef2f6 25%, transparent 25.2%, transparent 49.8%, #eef2f6 50%, transparent 50.2%, transparent 74.8%, #eef2f6 75%, transparent 75.2%); }
.gantt-bar { position: absolute; top: 13px; height: 25px; min-width: 8px; border-radius: 7px; background: var(--primary); color: white; font-size: 10px; padding: 5px 7px; white-space: nowrap; overflow: hidden; }
.cash-chart { display: grid; grid-template-columns: repeat(6,minmax(80px,1fr)); gap: 10px; align-items: end; min-height: 210px; padding: 18px 8px 4px; }
.cash-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; height: 185px; }
.cash-bar-shape { width: 45px; min-height: 3px; max-height: 145px; border-radius: 7px 7px 3px 3px; background: #5b8cff; }
.cash-bar-shape.negative { background: #ef4444; }
.cash-bar strong { font-size: 10px; writing-mode: horizontal-tb; white-space: nowrap; }
.cash-bar small { color: var(--muted); font-size: 10px; }
.details-list { display: grid; gap: 8px; }
.details-item { padding: 11px; border: 1px solid var(--border); border-radius: 9px; background: white; }
.details-item summary { cursor: pointer; font-weight: 700; }
.empty-state { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--text); display: block; margin-bottom: 5px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left,#e8efff,transparent 36%),radial-gradient(circle at bottom right,#e9f8f1,transparent 34%),#f5f7fb; }
.login-card { width: min(440px,100%); background: white; padding: 30px; border-radius: 18px; border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(15,23,42,.12); }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 25px; }
.login-logo .brand-mark { color: white; }
.login-card h1 { margin: 0 0 6px; font-size: 24px; }
.login-card p { margin: 0 0 22px; color: var(--muted); }
.login-card .button { width: 100%; margin-top: 8px; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.nowrap { white-space: nowrap; }
@media (max-width: 1180px) {
  .cards-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .info-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .two-column { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 14px 0 30px rgba(15,23,42,.25); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .page-shell { margin-left: 0; width: 100%; }
  .mobile-menu { display: inline-grid; place-items: center; }
  .content { padding: 16px; }
  .topbar { padding: 0 14px; }
  .user-chip span:not(.avatar) { display: none; }
  .page-heading, .detail-hero { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .cards-grid, .three-column, .info-grid { grid-template-columns: 1fr; }
  .kanban-wrap { overflow-x: auto; }
  .kanban-board { min-width: max-content; grid-template-columns: repeat(var(--kanban-columns), 240px); }
}
@media print {
  .sidebar,.topbar,.page-actions,.filter-bar,.button { display:none!important; }
  .page-shell { margin:0; width:100%; }
  .content { padding:0; }
  .card { box-shadow:none; }
}
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 190px; }
.inline-form { display: inline-flex; margin: 0; }
.audit-json { max-width: 520px; white-space: pre-wrap; word-break: break-word; font-size: 11px; background: var(--surface-2); padding: 9px; border-radius: 8px; }

.questionnaire-shell { min-height:100vh; padding:32px 18px; background:radial-gradient(circle at top left,#e8efff,transparent 34%),var(--bg); }
.questionnaire-card { width:min(1120px,100%); margin:0 auto; padding:26px; background:white; border:1px solid var(--border); border-radius:18px; box-shadow:0 20px 60px rgba(15,23,42,.1); }
.questionnaire-summary { margin-bottom:18px; }
.consent-check { margin-top:20px; padding:14px; border:1px solid #c7d7fe; border-radius:10px; background:#f5f8ff; align-items:flex-start; }
@media (max-width:820px) {
  .questionnaire-shell { padding:0; }
  .questionnaire-card { border:0; border-radius:0; padding:18px 14px 28px; min-height:100vh; }
}

/* CRM 1.2: customer master data, controlled transitions and address book. */
[hidden] { display: none !important; }
.wide-form-card { max-width: 1180px; }
.subsection { margin-top: 18px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.subsection:first-child { margin-top: 0; }
.subsection-inner { background: white; }
.subsection h3 { margin: 0 0 4px; font-size: 15px; }
.section-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 15px; }
.section-title-row h2, .section-title-row h3 { margin: 0 0 4px; }
.section-title-row p { margin: 0; color: var(--muted); font-size: 12px; }
.lookup-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.lookup-status { font-size: 11px; max-width: 280px; }
.input-action { display: flex; gap: 7px; align-items: stretch; }
.input-action input { min-width: 0; }
.input-action .button { flex: 0 0 auto; }
.inline-check { margin-top: 13px; }
.customer-summary { display: grid; grid-template-columns: 1.1fr .75fr 1.6fr auto; align-items: center; gap: 12px; padding: 13px; margin-top: 13px; border: 1px solid #c7d7fe; background: #f5f8ff; border-radius: 11px; }
.customer-summary small, .customer-summary strong { display: block; }
.customer-summary small { color: var(--muted); font-size: 10px; margin-bottom: 3px; }
.customer-summary strong { font-size: 13px; }
.is-loading { opacity: .65; }
.sticky-actions { position: sticky; bottom: 0; z-index: 10; background: rgba(245,247,251,.94); backdrop-filter: blur(8px); padding: 12px 0; }
.metric-text { font-size: 16px !important; line-height: 1.25; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.info-span-2 { grid-column: span 2; }
.contact-row { display: flex; justify-content: space-between; gap: 12px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 5px 13px; margin: 6px 0; font-size: 12px; }

.transition-path { display: flex; align-items: center; gap: 12px; margin: -4px 0 17px; }
.transition-arrow { color: var(--muted); font-size: 20px; }
.document-requirements { display: grid; gap: 10px; }
.document-requirement { display: grid; grid-template-columns: 32px 1fr; gap: 11px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); background: white; border-radius: 10px; }
.document-requirement.is-complete { border-color: #bbf7d0; background: #f7fef9; }
.document-requirement-status { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #eef2f6; color: var(--muted); font-weight: 800; }
.document-requirement.is-complete .document-requirement-status { background: #dcfce7; color: #166534; }
.document-requirement-main > strong { display: block; margin-bottom: 3px; }

.action-menu { position: relative; }
.action-menu > summary { list-style: none; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu-panel { position: absolute; right: 0; top: calc(100% + 7px); min-width: 235px; padding: 7px; border: 1px solid var(--border); border-radius: 10px; background: white; box-shadow: 0 16px 36px rgba(15,23,42,.16); z-index: 20; }
.action-menu-panel a { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 7px; color: var(--text); }
.action-menu-panel a:hover { background: var(--surface-2); }

.approval-list { display: grid; gap: 10px; }
.approval-step { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 12px; padding: 13px; border: 1px solid var(--border); border-radius: 11px; background: white; }
.approval-step.is-complete { border-color: #bbf7d0; background: #f7fef9; }
.approval-step.is-current { border-color: #9db7ff; box-shadow: 0 0 0 2px #edf2ff; }
.approval-step.is-locked { opacity: .68; background: var(--surface-2); }
.approval-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #eef2f6; color: var(--muted); font-weight: 800; }
.approval-step.is-complete .approval-number { background: #dcfce7; color: #166534; }
.approval-step.is-current .approval-number { background: #dbeafe; color: #1e40af; }
.approval-main > strong { display: block; margin: 4px 0; }
.approval-form { margin-top: 10px; }

.sales-package { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.package-item { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 9px; padding: 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.package-item.is-ready { background: #f7fef9; border-color: #c6efd3; }
.package-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #e9eef5; color: var(--muted); font-weight: 800; }
.package-item.is-ready .package-icon { background: #dcfce7; color: #166534; }
.package-item strong, .package-item a, .package-item small { display: block; overflow-wrap: anywhere; }
.package-item a { margin-top: 3px; font-size: 12px; }
.package-item small { color: var(--muted); margin-top: 3px; }

.activity-timeline { position: relative; display: grid; gap: 0; }
.activity-entry { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 9px; position: relative; padding-bottom: 15px; }
.activity-entry:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 13px; bottom: 0; width: 2px; background: #e3e8ef; }
.activity-marker { width: 14px; height: 14px; border: 3px solid #dbeafe; background: var(--primary); border-radius: 50%; z-index: 1; margin-top: 3px; }
.activity-content { min-width: 0; padding-bottom: 3px; }
.activity-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.activity-content p { margin: 7px 0; }
.transcript { margin-top: 7px; padding: 10px; border-radius: 8px; background: var(--surface-2); font-size: 12px; max-height: 260px; overflow-y: auto; }
.integration-fields { margin-top: 10px; padding: 10px; border: 1px dashed var(--border); border-radius: 9px; }
.integration-fields summary { cursor: pointer; color: var(--muted); font-size: 12px; }

.address-filters { margin-bottom: 16px; }
.filters-grid { grid-template-columns: repeat(5,minmax(150px,1fr)); }
.filter-actions { display: flex; gap: 8px; border-top: 1px solid var(--border); }
.address-book-table table { min-width: 1550px; }
.long-cell { min-width: 220px; max-width: 360px; white-space: normal; }
.kanban-card.is-pending { opacity: .55; pointer-events: none; }

@media (max-width: 1180px) {
  .customer-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filters-grid { grid-template-columns: repeat(3,minmax(150px,1fr)); }
}
@media (max-width: 820px) {
  .section-title-row { flex-direction: column; }
  .lookup-actions { justify-content: flex-start; }
  .customer-summary, .sales-package, .filters-grid { grid-template-columns: 1fr; }
  .info-span-2 { grid-column: auto; }
  .approval-step { grid-template-columns: 34px minmax(0,1fr); }
  .approval-step > form.inline-form { grid-column: 2; }
  .contact-row { flex-direction: column; }
  .input-action { flex-direction: column; }
  .action-menu-panel { left: 0; right: auto; }
}

/* CRM 1.2.2: multi-stage sales transition wizard. */
.notice { padding: 13px 15px; border: 1px solid var(--border); border-radius: 11px; margin-bottom: 16px; line-height: 1.5; }
.notice-info { background: #f5f8ff; border-color: #c7d7fe; color: #243b70; }
.batch-transition-notice strong { display: block; margin-bottom: 3px; color: #1e3a8a; }
.transition-path-multi { flex-wrap: wrap; }
.transition-step-list { display: grid; gap: 18px; }
.transition-step-card { margin-top: 0; background: #fbfcfe; border-color: #d7deea; }
.transition-step-heading { justify-content: flex-start; align-items: center; }
.transition-step-heading > div:nth-child(2) { flex: 1; }
.transition-step-number { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 50%; background: #dbeafe; color: #1e40af; font-weight: 800; }
.badge-soft { margin-left: auto; background: #eef2ff; color: #3730a3; }
@media (max-width: 820px) {
  .transition-path-multi { gap: 7px; }
  .transition-step-heading { align-items: flex-start; }
  .badge-soft { margin-left: 0; }
}

/* CRM 1.2.3: multi-file uploads and drag-and-drop from the desktop. */
.file-drop-zone {
  position: relative;
  overflow: hidden;
  border: 1.5px dashed #aebdd2;
  border-radius: 11px;
  background: #f8fafc;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.file-drop-zone:hover,
.file-drop-zone.is-dragover {
  border-color: #5b8cff;
  background: #f1f5ff;
  box-shadow: 0 0 0 3px rgba(30,94,255,.09);
}
.file-drop-zone.is-dragover .file-drop-icon { transform: translateY(-2px); background: #dbeafe; color: #1d4ed8; }
.file-drop-zone.has-files { border-style: solid; border-color: #b9c9e2; background: white; }
.file-drop-input {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.file-drop-prompt { display: flex; align-items: center; gap: 12px; padding: 14px; }
.file-drop-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e9eef8;
  color: #475467;
  font-size: 19px;
  font-weight: 800;
  transition: .15s ease;
}
.file-drop-copy { min-width: 0; flex: 1; }
.file-drop-copy strong,
.file-drop-copy span,
.file-drop-copy small { display: block; }
.file-drop-copy strong { margin-bottom: 2px; color: #24324a; }
.file-drop-copy span { color: var(--muted); font-size: 12px; }
.file-drop-copy small { margin-top: 4px; color: #7a8699; font-size: 10px; }
.file-drop-browse { flex: 0 0 auto; cursor: pointer; }
.file-drop-selection { padding: 0 14px 12px; }
.file-drop-summary { padding-top: 10px; border-top: 1px solid var(--border); color: #475467; font-size: 11px; font-weight: 700; }
.file-drop-items { display: grid; gap: 6px; margin-top: 8px; }
.file-drop-item { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border: 1px solid #e3e8ef; border-radius: 8px; background: #fbfcfe; }
.file-drop-item-name { min-width: 0; flex: 1; }
.file-drop-item-name strong,
.file-drop-item-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-drop-item-name strong { color: #344054; font-size: 12px; }
.file-drop-item-name span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.file-drop-remove { width: 28px; height: 28px; flex: 0 0 28px; border: 0; border-radius: 7px; background: #f1f3f6; color: #667085; font-size: 20px; line-height: 1; }
.file-drop-remove:hover { background: #fee2e2; color: #b42318; }
.existing-document-list { display: grid; gap: 5px; margin-top: 7px; }
.existing-document-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 12px; }
.existing-document-item span { color: var(--muted); font-size: 10px; }
.package-document-list { display: grid; gap: 7px; margin-top: 5px; }
.package-document-list > div { padding-top: 6px; border-top: 1px solid rgba(22,101,52,.12); }
.package-document-list > div:first-child { padding-top: 0; border-top: 0; }

@media (max-width: 820px) {
  .file-drop-prompt { align-items: flex-start; flex-wrap: wrap; }
  .file-drop-copy { min-width: calc(100% - 52px); }
  .file-drop-browse { margin-left: 50px; }
}

/* ProjectOps 1.2.4: birthdays, secure password management and responsive Kanban. */
.user-chip { color: var(--text); padding: 5px 8px; border-radius: 10px; }
.user-chip:hover { color: var(--text); background: var(--surface-2); }
.password-card { max-width: 760px; }
.password-security-note { line-height: 1.45; }
.password-input-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: stretch; }
.password-input-row .button { min-width: 86px; }
.password-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.password-tools [data-password-status] { min-height: 18px; }
.kanban-column.is-processing { border-color: #84a7ff; box-shadow: 0 0 0 3px rgba(30,94,255,.08); }
.kanban-card.is-pending { position: relative; opacity: .7; pointer-events: none; }
.kanban-card.is-pending::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 16px;
  height: 16px;
  border: 2px solid #c7d7fe;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: projectops-spin .7s linear infinite;
}
@keyframes projectops-spin { to { transform: rotate(360deg); } }
.toast-container { position: fixed; top: 78px; right: 22px; z-index: 1000; display: grid; gap: 9px; width: min(390px, calc(100vw - 32px)); pointer-events: none; }
.toast { opacity: 0; transform: translateY(-8px); padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px; background: white; color: var(--text); box-shadow: 0 16px 36px rgba(15,23,42,.16); line-height: 1.4; transition: opacity .18s ease, transform .18s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-success { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.toast-error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.toast-info { border-color: #bfdbfe; background: #eff6ff; color: #1e40af; }
@media (max-width: 820px) {
  .password-input-row { grid-template-columns: 1fr; }
  .password-input-row .button { width: 100%; }
  .toast-container { top: 70px; right: 16px; }
}

/* ProjectOps 1.3.0: calendar plan, performer allocation, expense contracts and Gantt. */
.calendar-plan-table { min-width: 1380px; }
.performer-address-table { min-width: 1500px; }
.assignment-inline { display: grid; gap: 2px; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.assignment-inline:last-child { border-bottom: 0; }
.assignment-inline small { display: block; color: var(--muted); }
.allocation-cell { min-width: 135px; display: grid; gap: 5px; }
.allocation-cell strong, .allocation-cell small { display: block; }
.allocation-banner { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.allocation-banner > div { padding: 13px 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.allocation-banner small, .allocation-banner strong { display: block; }
.allocation-banner strong { margin-top: 4px; font-size: 22px; }
.assignment-stage-card { overflow: hidden; }
.assignment-stage-head { gap: 14px; align-items: center; flex-wrap: wrap; }
.assignment-stage-head h2 { margin-bottom: 3px; }
.allocation-summary { min-width: 128px; padding: 9px 12px; border-radius: 9px; background: #fff7ed; color: #9a3412; text-align: center; }
.allocation-summary.is-complete { background: #f0fdf4; color: #166534; }
.allocation-summary strong, .allocation-summary span { display: block; }
.allocation-summary strong { font-size: 18px; }
.assignment-picker { display: grid; gap: 8px; }
.assignment-picker-item { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; }
.assignment-picker-item:hover { border-color: #a8bfff; background: #f8faff; }
.assignment-picker-item[hidden] { display: none !important; }
.assignment-picker-item input { margin-top: 3px; }
.assignment-picker-item span { min-width: 0; }
.assignment-picker-item strong, .assignment-picker-item small { display: block; }
.assignment-picker-item small { margin-top: 3px; color: var(--muted); }
.readonly-metric { min-height: 42px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.readonly-metric strong, .readonly-metric span { display: block; }
.requisites-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 22px; }
.requisites-grid > div { min-width: 0; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.requisites-grid small, .requisites-grid strong { display: block; overflow-wrap: anywhere; }
.requisites-grid small { margin-bottom: 4px; color: var(--muted); }
.reference-panel { display: grid; grid-template-columns: minmax(180px,1fr) minmax(230px,1.2fr) minmax(260px,1.5fr); gap: 12px; margin-bottom: 14px; }
.reference-panel > div { padding: 12px 14px; border: 1px solid #dbe4ff; border-radius: 10px; background: #f7f9ff; }
.reference-panel small, .reference-panel strong, .reference-panel span { display: block; }
.reference-panel small { margin-bottom: 4px; color: var(--muted); }
.gantt-legend { display: flex; flex-wrap: wrap; gap: 12px 18px; margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.gantt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gantt-legend i { width: 10px; height: 10px; border-radius: 3px; }
/* legacy grid-template-columns: 360px minmax(760px,1fr) */
.project-gantt { min-width: 1360px; }
.project-gantt .gantt-row { grid-template-columns: 360px 105px 105px minmax(760px,1fr); min-height: 70px; }
.project-gantt .gantt-row-header { min-height: 54px; position: sticky; top: 0; z-index: 4; background: #fff; }
.project-gantt .gantt-label { width: auto; min-width: 0; padding: 10px 14px; }
.project-gantt .gantt-track { min-width: 760px; position: relative; overflow: visible; background: none; }
.gantt-date-head, .gantt-date-cell { padding: 10px 8px; border-right: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.gantt-date-head { display: flex; align-items: center; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.gantt-date-cell { display: flex; align-items: center; }
.gantt-axis { position: relative; height: 100%; color: var(--muted); font-size: 10px; }
.gantt-month-line { position: absolute; z-index: 1; top: 0; bottom: 0; width: 1px; background: #dbe4ee; pointer-events: none; }
.gantt-month-label { position: absolute; top: 8px; transform: translateX(4px); white-space: nowrap; color: var(--muted); font-weight: 700; }
.gantt-timeline-marker { position: absolute; z-index: 5; top: 30px; width: 11px; height: 11px; margin-left: -5px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(15,23,42,.3); }
.gantt-reference { position: absolute; z-index: 2; top: 0; bottom: 0; width: 2px; background: rgba(124,58,237,.45); pointer-events: none; }
.gantt-reference::before { content: "D0"; position: absolute; top: 2px; left: 4px; padding: 1px 4px; border-radius: 4px; background: #ede9fe; color: #5b21b6; font-size: 9px; font-weight: 800; }
.gantt-label-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; color: var(--muted); font-size: 10px; }
.gantt-label-meta strong { padding: 1px 5px; border-radius: 5px; background: var(--surface-2); color: var(--text); }
.gantt-stage-tree > summary, .gantt-performer-tree > summary { list-style: none; cursor: pointer; }
.gantt-stage-tree > summary::-webkit-details-marker, .gantt-performer-tree > summary::-webkit-details-marker { display: none; }
.gantt-stage-tree { border-bottom: 1px solid var(--border); }
.gantt-stage-tree > summary.gantt-row { border-bottom: 0; }
.gantt-stage-children { margin-left: 0; border-left: 0; }
.gantt-performer-tree { border-top: 1px dashed #d7e0ec; }
.gantt-performer-row { min-height: 38px !important; background: #f8fbff; }
.gantt-performer-row .gantt-label { display: flex; align-items: flex-start; gap: 7px; padding-left: 14px !important; }
.gantt-performer-row .gantt-bar { top: 4px; height: 30px; }
.gantt-expander { display: inline-flex; flex: 0 0 18px; width: 18px; height: 18px; align-items: center; justify-content: center; margin-top: 1px; border-radius: 50%; background: #16a34a; color: #fff; font-size: 15px; font-weight: 800; line-height: 1; box-shadow: 0 1px 3px rgba(22,163,74,.3); }
.gantt-performer-tree[open] .gantt-expander { transform: rotate(45deg); background: #15803d; }
.gantt-performer-link { border: 0; padding: 0; background: transparent; color: var(--primary); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.gantt-performer-link:hover { text-decoration: underline; }
.gantt-dialog-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.gantt-dialog-grid > div { display: grid; gap: 5px; padding: 14px 18px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.gantt-dialog-grid small { color: var(--muted); font-size: 12px; }.gantt-dialog-grid strong { overflow-wrap: anywhere; font-size: 14px; }
@media (max-width: 620px) { .gantt-dialog-grid { grid-template-columns: 1fr; }.gantt-dialog-grid > div { border-right: 0; } }

/* Карточка расходного договора в профиле исполнителя. */
.choice-dialog-body { padding: 20px 24px; display: grid; gap: 16px; max-height: min(66vh, 620px); overflow-y: auto; }
.choice-dialog-body > h3 { margin: 0; font-size: 15px; }
.choice-dialog-body .gantt-dialog-grid { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.choice-dialog-body .gantt-dialog-grid > div { padding: 12px 14px; }
.choice-dialog-body .details-list { display: grid; gap: 8px; }
.choice-dialog-body .details-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }
.choice-dialog-body details { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.choice-dialog-body summary { cursor: pointer; font-weight: 600; }
.choice-dialog > .terms-footer { display: flex; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--border); }
.workflow-terms { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.workflow-terms th, .workflow-terms td { padding: 9px 10px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--border); }
.workflow-terms th { color: var(--muted); font-size: 11px; font-weight: 700; }
.workflow-terms tr:last-child td { border-bottom: 0; }
.workflow-terms .workflow-current td { background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.workflow-terms .workflow-complete td:first-child { color: #15803d; }
.workflow-terms-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
@media (max-width: 620px) { .choice-dialog-body { padding: 16px; }.choice-dialog > .terms-footer { padding: 12px 16px; }.workflow-terms { min-width: 650px; } }
.gantt-performer-stage-list { border-top: 1px solid #e5edf6; }
.gantt-performer-stage-row { min-height: 52px !important; background: #fff; }
.gantt-performer-stage-row .gantt-label { padding-left: 52px !important; }
.gantt-expand-hint { width: fit-content; margin-top: 5px; color: var(--primary); font-size: 10px; font-weight: 700; }
.gantt-performers { display: inline-flex; align-items: center; gap: 5px; }
.gantt-stage-expander { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; border-radius: 50%; background: #16a34a; color: #fff; font-size: 14px; font-weight: 800; line-height: 1; box-shadow: 0 1px 3px rgba(22,163,74,.3); }
.gantt-stage-tree[open] .gantt-stage-expander { transform: rotate(45deg); background: #15803d; }
.gantt-performers { cursor: pointer; }
.gantt-performer-bar { cursor: pointer; }
.gantt-performer-stage-bar { opacity: .88; }
.gantt-performer-stage-bar { border: 0; font: inherit; text-align: left; cursor: pointer; }
.gantt-row-marker { position: absolute; z-index: 6; top: 8px; width: 14px; height: 17px; margin-left: -7px; background: transparent !important; cursor: default; }
.gantt-row-marker::before { content: ""; position: absolute; inset: 0; background: var(--marker-color, #16a34a); border: 2px solid #fff; border-radius: 3px 3px 3px 0; clip-path: polygon(0 0,100% 0,100% 82%,50% 100%,0 82%); box-shadow: 0 2px 6px rgba(15,23,42,.32); }
.gantt-kind-stage .gantt-row-marker { top: 7px; width: 15px; height: 18px; }
[data-gantt-tooltip] { position: absolute; cursor: default; }
[data-gantt-tooltip]::after { content: attr(data-gantt-tooltip); position: absolute; z-index: 30; left: 50%; top: calc(100% + 8px); width: max-content; max-width: 280px; transform: translateX(-50%); padding: 7px 9px; border-radius: 7px; background: #172033; color: #fff; font-size: 11px; font-weight: 600; line-height: 1.35; white-space: pre-line; box-shadow: 0 5px 16px rgba(15,23,42,.25); opacity: 0; pointer-events: none; transition: opacity .12s ease; }
[data-gantt-tooltip]:hover::after { opacity: 1; }
.assignment-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.assignment-summary-grid > div { display: grid; gap: 6px; min-width: 0; padding: 16px 18px; border-right: 1px solid var(--border); }
.assignment-summary-grid > div:last-child { border-right: 0; }
.assignment-summary-grid small { color: var(--muted); font-size: 12px; }
.assignment-summary-grid strong { overflow-wrap: anywhere; font-size: 14px; line-height: 1.35; }
@media (max-width: 920px) { .assignment-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .assignment-summary-grid > div:nth-child(2) { border-right: 0; } .assignment-summary-grid > div:nth-child(n+3) { border-top: 1px solid var(--border); } }
@media (max-width: 580px) { .assignment-summary-grid { grid-template-columns: 1fr; } .assignment-summary-grid > div { border-right: 0; border-top: 1px solid var(--border); } .assignment-summary-grid > div:first-child { border-top: 0; } }
.project-gantt .gantt-bar { z-index: 3; display: flex; align-items: center; min-width: 9px; height: 30px; top: 20px; border-radius: 6px; padding: 0 8px; color: white; text-decoration: none; box-shadow: 0 4px 12px rgba(15,23,42,.16); }
.project-gantt .gantt-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.gantt-marker { position: absolute; z-index: 3; top: 23px; width: 19px; height: 19px; margin-left: -9px; border: 3px solid white; border-radius: 50%; box-shadow: 0 2px 8px rgba(15,23,42,.28); }
.gantt-kind-expense_contract .gantt-label { background: #fffaf5; }
.gantt-filter { grid-template-columns: minmax(280px, 1.4fr) minmax(210px, .8fr) minmax(190px, .7fr) auto; }
.gantt-marker:hover { transform: scale(1.18); }
.row-alert { background: #fff7ed; }
.long-cell { max-width: 330px; white-space: normal; }

@media (max-width: 900px) {
  .allocation-banner, .requisites-grid, .reference-panel { grid-template-columns: 1fr; }
  .project-gantt { min-width: 1120px; }
  .project-gantt .gantt-row { grid-template-columns: 280px 92px 92px minmax(620px,1fr); }
  .project-gantt .gantt-track { min-width: 620px; }
  .gantt-filter { grid-template-columns: 1fr; }
}

.is-muted-section {
  opacity: .58;
}

.software-check-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.software-check { display: flex; align-items: flex-start; gap: 9px; min-width: 0; padding: 10px 11px; border: 1px solid var(--border); border-radius: 9px; background: #fff; cursor: pointer; }
.software-check:hover { border-color: #a8bfff; background: #f8faff; }
.software-check[hidden] { display: none !important; }
.software-check input { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 1px; }
.software-check span { min-width: 0; line-height: 1.3; }
@media (max-width: 980px) { .software-check-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 620px) { .software-check-grid { grid-template-columns: 1fr; } }

.dadata-suggest-field { position: relative; }
.dadata-suggest-list { position: absolute; z-index: 90; top: calc(100% + 5px); left: 0; width: 100%; max-height: 360px; overflow-y: auto; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; box-shadow: 0 14px 34px rgba(15,23,42,.18); }
.dadata-suggest-list[hidden] { display: none !important; }
.dadata-suggest-option { display: block; width: 100%; min-height: 44px; padding: 10px 13px; border: 0; border-bottom: 1px solid #e5e7eb; border-radius: 0; background: #fff; color: var(--text); text-align: left; white-space: normal; cursor: pointer; }
.dadata-suggest-option:first-child { border-radius: 9px 9px 0 0; }
.dadata-suggest-option:last-child { border-bottom: 0; border-radius: 0 0 9px 9px; }
.dadata-suggest-option:hover, .dadata-suggest-option.is-active { background: #eff4ff; color: #153eaa; }
.dadata-suggest-value { display: block; overflow-wrap: anywhere; line-height: 1.35; }
.dadata-suggest-option small { display: block; margin-top: 4px; color: var(--muted); }
.service-advance-fields { display: grid; gap: 7px; min-width: 0; }
.service-advance-fields .performer-inline-check { white-space: normal; }
.service-advance-fields input[type="number"] { width: 100%; }

.disagreement-table { width: 100%; min-width: 1320px; table-layout: fixed; }
.disagreement-table th:nth-child(1) { width: 7%; }
.disagreement-table th:nth-child(2) { width: 20%; }
.disagreement-table th:nth-child(3) { width: 13%; }
.disagreement-table th:nth-child(4) { width: 20%; }
.disagreement-table th:nth-child(5) { width: 15%; }
.disagreement-table th:nth-child(6) { width: 20%; }
.disagreement-table th:nth-child(7) { width: 5%; }
.disagreement-table textarea, .disagreement-table input, .disagreement-table select { width: 100%; min-width: 0; box-sizing: border-box; }
.disagreement-table textarea { min-height: 74px; resize: none; overflow-y: hidden; }
.gip-decision-icons { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.gip-decision-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--muted); font-size: 20px; font-weight: 800; cursor: pointer; transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease; }
.gip-decision-icon:hover, .gip-decision-icon:focus-visible { border-color: var(--primary); color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.gip-decision-accept.is-active { border-color: #16a34a; background: #dcfce7; color: #166534; }
.gip-decision-revise.is-active { border-color: #2563eb; background: #dbeafe; color: #1d4ed8; }
.gip-decision-original.is-active { border-color: #d97706; background: #fef3c7; color: #92400e; }
.legal-wording { padding: 12px 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); white-space: pre-wrap; line-height: 1.5; }

.choice-dialog { width: min(760px, calc(100vw - 32px)); max-width: none; padding: 0; border: 0; border-radius: 16px; background: #fff; color: var(--text); box-shadow: 0 24px 70px rgba(15,23,42,.28); }
.choice-dialog::backdrop { background: rgba(15,23,42,.52); backdrop-filter: blur(2px); }
.choice-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 24px 16px; border-bottom: 1px solid var(--border); }
.choice-dialog-head h2 { margin: 0 0 5px; }
.choice-dialog-head p { margin: 0; color: var(--muted); }
.choice-dialog-close { flex: 0 0 auto; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--muted); font-size: 25px; line-height: 1; cursor: pointer; }
.choice-dialog-close:hover { border-color: #a8bfff; background: #f8faff; color: var(--text); }
.choice-dialog-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; padding: 22px 24px; }
.choice-dialog-option { display: block; min-width: 0; padding: 18px; border: 1px solid #cdd9ff; border-radius: 12px; background: #f8faff; color: var(--text); text-decoration: none; }
.choice-dialog-option:hover { border-color: var(--primary); background: #eef3ff; box-shadow: 0 8px 20px rgba(37,99,235,.12); }
.choice-dialog-option strong, .choice-dialog-option span { display: block; }
.choice-dialog-option strong { margin-bottom: 7px; color: var(--primary); font-size: 16px; }
.choice-dialog-option span { color: var(--muted); line-height: 1.45; }
.choice-dialog-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; padding: 15px 24px 20px; border-top: 1px solid var(--border); }
@media (max-width: 680px) {
  .choice-dialog-grid { grid-template-columns: 1fr; }
  .choice-dialog-footer .button { width: 100%; }
}

.performer-contract-group > td {padding:0;background:#f8fbff;}
.performer-contract-stages > summary {cursor:pointer;list-style:none;padding:13px 16px;color:var(--text);}
.performer-contract-stages > summary::-webkit-details-marker {display:none;}
.performer-contract-plus {display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-right:4px;border-radius:50%;background:#16a34a;color:#fff;font-weight:800;line-height:1;}
.performer-contract-stages[open] .performer-contract-plus {background:#15803d;}
.performer-contract-stages > summary small {margin-left:10px;color:var(--muted);font-weight:400;}
.performer-stage-table {width:100%;margin:0;border-top:1px solid var(--border);}

/* Finance Core: compact, source-aware read-only overview. */
.finance-overview-heading { align-items: center; margin-bottom: 14px; }
.finance-overview-filter { align-items: flex-end; }
.finance-overview-filter .field { min-width: 190px; }
.finance-filter-actions { display: flex; gap: 8px; padding-bottom: 1px; }
.finance-boundary-warning { margin-bottom: 20px; line-height: 1.5; }
.finance-boundary-warning strong { display: block; margin-bottom: 2px; }
.finance-overview-section { margin-bottom: 22px; }
.finance-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 0 2px 10px; }
.finance-section-heading h2 { margin: 0 0 3px; font-size: 18px; }
.finance-section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.finance-kpi-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.finance-kpi-grid-three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.finance-kpi { min-width: 0; padding: 14px; border: 1px solid var(--border); border-top: 3px solid #86b39a; border-radius: 12px; background: var(--surface); box-shadow: 0 5px 16px rgba(15,23,42,.045); }
.finance-kpi-status-warning { border-top-color: #f59e0b; }
.finance-kpi-status-danger { border-top-color: #ef4444; }
.finance-kpi-status-insufficient { border-top-color: #94a3b8; background: #fbfcfe; }
.finance-kpi-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.finance-kpi-head h3 { margin: 2px 0 0; font-size: 13px; line-height: 1.3; }
.finance-kpi-value { margin-top: 11px; font-size: 23px; font-weight: 800; letter-spacing: -.025em; }
.finance-kpi-value.is-na { color: var(--muted); }
.finance-kpi-note { min-height: 30px; margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.finance-kpi-alert { display: flex; gap: 6px; margin: 9px 0 0; padding: 7px 8px; border-radius: 7px; background: #fffbeb; color: #92400e; font-size: 11px; line-height: 1.35; }
.finance-kpi-explain { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border); }
.finance-kpi-explain summary { width: fit-content; color: var(--primary); font-size: 11px; font-weight: 700; cursor: pointer; }
.finance-kpi-explain dl { display: grid; grid-template-columns: 66px minmax(0,1fr); gap: 7px 9px; margin: 10px 0 0; font-size: 11px; }
.finance-kpi-explain dt { color: var(--muted); font-weight: 700; }
.finance-kpi-explain dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.finance-kpi-explain code { white-space: normal; color: #344054; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.finance-kpi-explain ul { margin: 0; padding-left: 16px; }
.finance-source-health { overflow: hidden; }
.finance-source-health > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 17px; cursor: pointer; font-weight: 700; }
.finance-source-health > summary small { color: var(--muted); font-weight: 400; }
.finance-source-list { border-top: 1px solid var(--border); }
.finance-source-row { display: grid; grid-template-columns: minmax(190px,1fr) auto 70px minmax(220px,1.4fr); gap: 10px; align-items: center; padding: 9px 17px; border-bottom: 1px solid var(--border); }
.finance-source-row:last-child { border-bottom: 0; }
.finance-source-row code { overflow-wrap: anywhere; }
.act-picker-row td { padding: 0; }
.act-picker-choice { display: block; padding: 13px 15px; color: var(--primary); font-weight: 800; text-decoration: none; cursor: pointer; }
.act-picker-choice span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.35; }
.act-picker-row:hover .act-picker-choice { background: #eef4ff; }
.act-picker-row.is-selected .act-picker-choice { background: #dbeafe; color: #1d4ed8; box-shadow: inset 3px 0 0 #2563eb; }
@media (max-width: 1100px) {
  .finance-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .finance-source-row { grid-template-columns: minmax(170px,1fr) auto 65px; }
.finance-source-row .muted { grid-column: 1/-1; }
}

/* Management-facing financial overview. Data semantics stay in Finance Core; this layer changes only presentation. */
.finance-dashboard-heading { margin-bottom: 12px; }
.finance-crumb { margin-bottom: 7px; color: #64748b; font-size: 12px; font-weight: 700; }
.finance-crumb span { padding: 0 7px; color: #94a3b8; }
.finance-dashboard-filter { margin-bottom: 14px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 4px 14px rgba(15,23,42,.04); }
.finance-dashboard-kpis { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
.finance-dashboard-kpi { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 11px; border-top: 3px solid #2563eb; background: var(--surface); box-shadow: 0 4px 13px rgba(15,23,42,.045); }
.finance-dashboard-kpi.finance-kpi-status-warning { border-top-color: #f59e0b; }.finance-dashboard-kpi.finance-kpi-status-danger { border-top-color: #ef4444; }.finance-dashboard-kpi.finance-kpi-status-insufficient { border-top-color: #94a3b8; background: #fbfcfe; }
.finance-dashboard-kpi-head { display: flex; min-height: 34px; align-items: flex-start; justify-content: space-between; gap: 7px; color: #475569; font-size: 11px; font-weight: 700; line-height: 1.25; }.finance-dashboard-kpi-head b { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; border-radius: 8px; background: #eff6ff; color: #2563eb; font-size: 15px; }
.finance-dashboard-kpi-value { display: block; margin-top: 7px; overflow: hidden; color: #0f172a; font-size: 20px; font-weight: 800; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }.finance-dashboard-kpi-value.is-na { color: #94a3b8; }.finance-dashboard-kpi small { display: block; min-height: 29px; margin-top: 5px; color: #64748b; font-size: 10px; line-height: 1.35; }.finance-dashboard-kpi em { display: block; margin-top: 7px; color: #b45309; font-size: 10px; font-style: normal; line-height: 1.3; }
.finance-dashboard-grid { display: grid; grid-template-columns: minmax(360px,1.45fr) minmax(290px,1fr) minmax(240px,.75fr); gap: 12px; margin-bottom: 14px; }.finance-dashboard-card { overflow: hidden; }.finance-dashboard-card .card-header h2,.finance-dashboard-details .card-header h2 { font-size: 15px; }.finance-dashboard-card .card-header a { color: var(--primary); font-size: 12px; font-weight: 700; }.finance-summary-labels { display: flex; justify-content: space-between; gap: 10px; color: #64748b; font-size: 11px; }.finance-summary-labels strong { color: #0f172a; font-size: 12px; }.finance-flow-bar { display: flex; height: 15px; overflow: hidden; margin: 12px 0 7px; border-radius: 5px; background: #e2e8f0; }.finance-flow-bar i { display: block; }.finance-flow-plan { width: 42%; background: #2563eb; }.finance-flow-fact { width: 31%; background: #38bdf8; }.finance-flow-forecast { width: 27%; background: #fbbf24; }.finance-flow-legend { display: flex; flex-wrap: wrap; gap: 11px; margin-bottom: 12px; color: #64748b; font-size: 10px; }.finance-flow-legend b { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 2px; vertical-align: baseline; }
.finance-rows { display: grid; gap: 0; }.finance-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid #eef2f7; color: #64748b; font-size: 11px; }.finance-row strong { color: #0f172a; font-size: 12px; white-space: nowrap; }.finance-row-blue strong { color: #2563eb; }.finance-row-warning strong { color: #c2410c; }.finance-row-success strong { color: #059669; }
.finance-cash-main { margin-bottom: 11px; padding: 12px; border-radius: 9px; background: linear-gradient(135deg,#eff6ff,#f8fbff); }.finance-cash-main span,.finance-cash-main small { display: block; color: #64748b; font-size: 11px; }.finance-cash-main strong { display: block; margin: 4px 0; color: #0f172a; font-size: 22px; letter-spacing: -.03em; }
.finance-control-card { background: linear-gradient(160deg,#fff,#fffbf8); }.finance-control-item { padding: 2px 0 12px; margin-bottom: 12px; border-bottom: 1px solid #fde7d8; }.finance-control-item b,.finance-control-item span { display: block; color: #64748b; font-size: 10px; line-height: 1.35; }.finance-control-item strong { display: block; margin: 4px 0; color: #0f172a; font-size: 17px; }.finance-control-alert { margin-top: 9px; padding: 8px; border-radius: 7px; background: #fff3e8; color: #b45309; font-size: 10px; line-height: 1.35; }
.finance-dashboard-details { margin-bottom: 14px; overflow: hidden; }.finance-formulas { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); background: #fbfcfe; }.finance-formula { min-width: 0; }.finance-formula summary { color: var(--primary); font-size: 11px; font-weight: 700; cursor: pointer; }.finance-formula dl { display: grid; grid-template-columns: 60px minmax(0,1fr); gap: 5px; margin: 9px 0 0; font-size: 10px; }.finance-formula dt { color: #64748b; font-weight: 700; }.finance-formula dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }.finance-formula code { white-space: normal; color: #334155; }
@media (max-width: 1380px) { .finance-dashboard-kpis { grid-template-columns: repeat(3,minmax(0,1fr)); }.finance-dashboard-grid { grid-template-columns: minmax(340px,1.3fr) minmax(270px,1fr); }.finance-control-card { grid-column: 1/-1; }.finance-control-card .card-body { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }.finance-control-alert { margin-top: 0; }.finance-formulas { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .finance-dashboard-kpis,.finance-dashboard-grid { grid-template-columns: 1fr; }.finance-control-card { grid-column:auto; }.finance-control-card .card-body { grid-template-columns: 1fr; }.finance-dashboard-kpi-value { font-size: 22px; } }
@media (max-width: 680px) {
  .finance-kpi-grid { grid-template-columns: 1fr; }
  .finance-filter-actions, .finance-filter-actions .button { width: 100%; }
  .finance-section-heading { flex-direction: column; }
  .finance-source-health > summary { align-items: flex-start; flex-direction: column; }
  .finance-source-row { grid-template-columns: minmax(0,1fr) auto; }
  .finance-source-row .number { text-align: left; }
}


/* Общий стиль рабочего пространства. Существующая сетка и поведение страниц сохранены. */
:root {
  --bg: #faf9f7;
  --surface: #fff;
  --surface-2: #f4f6f8;
  --text: #172844;
  --muted: #61728a;
  --border: #d9e0e8;
  --primary: #315fbe;
  --primary-dark: #254b9b;
  --nav: #f6f4f2;
  --nav-muted: #697c93;
  --radius: 8px;
  --shadow: none;
}
body { line-height: 1.45; }
.sidebar { color: var(--text); border-right: 1px solid #e2e2e1; }
.sidebar-close { display: none; }
.brand, .brand:hover { color: var(--text); border-color: #dedddb; }
.brand-mark { display: none; }
.brand strong { font-family: Georgia, 'Times New Roman', serif; font-size: 19px; line-height: 1.15; letter-spacing: -.02em; }
.brand small { margin-top: 5px; color: var(--nav-muted); letter-spacing: .07em; }
.nav-group { color: #697b91; }
.main-nav a { color: #354861; border-radius: 6px; }
.main-nav a:hover { color: #1c3e6c; background: #e8edf2; }
.main-nav a.active { color: #1e3d68; background: #dce6f0; box-shadow: none; }
.topbar { background: rgba(250,249,247,.97); border-bottom-color: var(--border); }
.page-heading h1 { font-family: Georgia, 'Times New Roman', serif; font-size: 29px; letter-spacing: -.025em; }
.page-heading p, .muted { color: var(--muted); }
.card, .filter-bar { box-shadow: none; border-color: var(--border); }
.card-header { background: #f2f4f7; }
.card-header h2, .card-header h3 { color: #1c304d; }
.button { border-radius: 5px; }
.button-secondary { color: var(--text); border-color: #cbd4df; }
.button-danger { color: #a5342c; }
.field label { color: #334963; }
.field input, .field select, .field textarea { border-radius: 5px; border-color: #cbd4df; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #5a83c7; box-shadow: 0 0 0 3px #e6eefb; }
table th { color: #53677f; background: #f4f6f8; }
table td, table th { border-color: #e1e6ed; }
.badge { border-radius: 5px; }
.kanban-column { background: #f0f2f4; border-color: #dce2e8; border-radius: 8px; }
.kanban-card { box-shadow: none; border-radius: 7px; }
.kanban-wrap { overflow-x: auto; }
.kanban-board[data-kanban-kind="sales"] { grid-template-columns: repeat(var(--kanban-columns), minmax(210px, 1fr)); min-width: max-content; }
.forecast-head h2 { font-family: Georgia, 'Times New Roman', serif; color: #1a304e; }
.forecast-chart { margin: 20px 0 8px; }
.forecast-chart-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.forecast-chart-heading h2 { margin: 0; font: 700 20px Georgia, 'Times New Roman', serif; }
.forecast-chart-heading span { color: var(--muted); font-size: 12px; }
.forecast-chart-scale { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.forecast-chart-key { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin: 0 4px 0 12px; }
.forecast-chart-in { background: #aac3e3; }
.forecast-chart-out { background: #5079ad; }
.forecast-chart-scroll { overflow-x: auto; }
.forecast-chart-bars { display: flex; min-width: max-content; gap: 9px; align-items: end; border-bottom: 1px solid var(--border); }
.forecast-chart-month { min-width: 60px; flex: 1; text-align: center; color: var(--muted); font-size: 11px; }
.forecast-chart-pair { height: 115px; display: flex; align-items: end; justify-content: center; gap: 3px; }
.forecast-chart-bar { display: block; width: 14px; }
@media (max-width: 820px) {
  .sidebar { box-shadow: 8px 0 24px rgba(32,49,71,.15); }
  .sidebar-close { display: block; float: right; border: 0; background: transparent; color: var(--text); font-size: 24px; line-height: 1; padding: 4px 7px; }
}

