:root {
  --canvas: #f7f8fb;
  --surface: #ffffff;
  --ink: #1e2a44;
  --muted: #6f7b91;
  --line: #e6eaf0;
  --accent: #f05d43;
  --accent-dark: #d84b33;
  --nav: #1d2b46;
  --nav-light: #2a3c5f;
  --success-bg: #e8f7ef;
  --success-ink: #21734a;
  --warning-bg: #fff6df;
  --warning-ink: #8f6319;
  --danger-bg: #fff0ed;
  --danger-ink: #b34432;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
a { color: inherit; }

.app-shell { align-items: start; min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { align-self: start; background: var(--nav); color: #dbe4f5; display: flex; flex-direction: column; height: 100vh; overflow-y: auto; padding: 28px 20px; position: sticky; top: 0; }
.brand { align-items: center; color: #fff; display: flex; font-size: 21px; font-weight: 500; gap: 10px; padding: 0 13px 31px; text-decoration: none; }
.brand-mark { align-items: center; background: var(--accent); border-radius: 9px; display: inline-flex; font-size: 18px; font-weight: 800; height: 34px; justify-content: center; width: 34px; }
.nav { display: grid; gap: 5px; }
.nav a { border-radius: 9px; color: #bdc9dd; font-size: 13px; padding: 10px 13px; text-decoration: none; transition: background .15s ease; }
.nav a:hover, .nav a.active { background: var(--nav-light); color: #fff; }
.nav--service { border-top: 1px solid rgba(255,255,255,.12); margin: 64px 0 0; padding-top: 16px; }
.nav-section-label { color: #8da0bd; font-size: 10px; font-weight: 750; letter-spacing: .08em; padding: 0 13px 5px; text-transform: uppercase; }
.nav-placeholder { align-items: center; border-radius: 9px; color: #71819d; cursor: not-allowed; display: flex; font-size: 13px; justify-content: space-between; padding: 10px 13px; user-select: none; }
.nav-placeholder small { border: 1px solid rgba(141,160,189,.35); border-radius: 999px; color: #8da0bd; font-size: 9px; font-weight: 700; line-height: 1; padding: 3px 5px; text-transform: uppercase; }
.sidebar-note { border-top: 1px solid rgba(255,255,255,.12); color: #8da0bd; font-size: 11px; line-height: 1.55; margin: 22px 0 0; padding: 18px 13px 0; }

.main-content { max-width: 1440px; min-width: 0; padding: 40px 48px 56px; width: 100%; }
.topbar { align-items: flex-end; display: flex; justify-content: space-between; margin-bottom: 29px; gap: 16px; }
.topbar-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
.topbar-account { align-items: center; border-left: 1px solid var(--line); display: flex; gap: 10px; padding-left: 12px; }
.topbar-account > div { display: grid; gap: 2px; text-align: right; }
.topbar-account strong { color: var(--ink); font-size: 13px; font-weight: 700; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-account span { color: var(--muted); font-size: 11px; }
.topbar-account form { margin: 0; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 750; letter-spacing: .09em; margin: 0 0 5px; text-transform: uppercase; }
h1 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -.04em; margin: 0; }
h2 { font-size: 18px; letter-spacing: -.02em; margin: 0; }
h3 { font-size: 16px; margin: 0; }
p { color: var(--muted); line-height: 1.5; margin: 5px 0 0; }

.button { align-items: center; border: 1px solid transparent; border-radius: 9px; cursor: pointer; display: inline-flex; font: inherit; font-size: 14px; font-weight: 650; justify-content: center; min-height: 40px; padding: 0 15px; text-decoration: none; }
.button-primary { background: var(--accent); color: white; }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.button-secondary:hover { background: #f3f5f8; }
.button-danger { background: var(--danger-bg); border-color: #f4c9c1; color: var(--danger-ink); }
.button-danger:hover { background: #fde4df; border-color: #efa99c; }
.button-small { font-size: 12px; min-height: 32px; padding: 0 10px; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 20px; }

.notice { border-radius: 10px; font-size: 14px; margin-bottom: 20px; padding: 12px 15px; }
.notice-success { background: var(--success-bg); color: var(--success-ink); }
.notice-warning { background: var(--warning-bg); color: var(--warning-ink); }
.notice-error { background: var(--danger-bg); color: var(--danger-ink); }

.metric-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 22px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 21px 22px; text-decoration: none; }
.metric-card:hover { border-color: #cfd7e4; box-shadow: 0 8px 25px rgba(30,42,68,.05); }
.metric-card span { color: var(--muted); display: block; font-size: 13px; }
.metric-card strong { display: block; font-size: 31px; letter-spacing: -.04em; margin-top: 5px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel--orders { overflow: visible; }
.panel-heading { align-items: center; display: flex; justify-content: space-between; gap: 12px; padding: 22px 24px 16px; }
.panel-heading.compact { padding-bottom: 14px; }
.panel-heading p { font-size: 13px; }
.text-link { color: var(--accent); font-size: 13px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.text-link:hover, .table-link:hover { text-decoration: underline; }

.archive-tabs { display: flex; gap: 7px; margin-bottom: 22px; overflow-x: auto; }
.archive-tabs a { border: 1px solid var(--line); border-radius: 9px; color: #53627b; font-size: 14px; font-weight: 650; padding: 10px 14px; text-decoration: none; white-space: nowrap; }
.archive-tabs a:hover { background: #fff; color: var(--ink); }
.archive-tabs a.active { background: var(--nav); border-color: var(--nav); color: #fff; }

.filters-panel { background: #fbfcff; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); padding: 0 24px; }
.filters-panel > summary { align-items: center; color: #3e4d67; cursor: pointer; display: flex; font-size: 13px; font-weight: 700; justify-content: space-between; list-style: none; min-height: 53px; user-select: none; }
.filters-panel > summary::-webkit-details-marker { display: none; }
.filters-panel > summary::after { color: var(--accent); content: "⌄"; font-size: 19px; font-weight: 500; line-height: 1; transition: transform .15s ease; }
.filters-panel[open] > summary::after { transform: rotate(180deg); }
.filters-form { padding: 1px 0 19px; }
.filter-grid { display: grid; gap: 13px 15px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filter-grid--customers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filter-grid--products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.journal-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.journal-row--error { background: #fffafa; }
.journal-table td { vertical-align: middle; }
.filter-field { color: #53627b; display: grid; font-size: 12px; font-weight: 650; gap: 6px; min-width: 0; }
fieldset.filter-field { border: 0; margin: 0; padding: 0; }
.filter-field legend { margin: 0; padding: 0; }
.filter-field__label { display: block; }
.filter-field--wide { grid-column: span 2; }
.filter-field--multiselect { position: relative; }
.filter-range { align-items: center; display: grid; gap: 7px; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.filter-range > span { color: #9aa6ba; font-size: 13px; }
.filter-multiselect { position: relative; }
.filter-multiselect summary { align-items: center; background: #fff; border: 1px solid #dce2ec; border-radius: 8px; color: var(--ink); cursor: pointer; display: flex; font-size: 14px; font-weight: 500; justify-content: space-between; list-style: none; min-height: 41px; padding: 10px 11px; user-select: none; }
.filter-multiselect summary::-webkit-details-marker { display: none; }
.filter-multiselect summary::after { color: #66748c; content: "⌄"; font-size: 18px; line-height: .7; transition: transform .15s ease; }
.filter-multiselect[open] summary { border-color: var(--accent); border-bottom-left-radius: 0; border-bottom-right-radius: 0; box-shadow: 0 0 0 3px rgba(240,93,67,.12); }
.filter-multiselect[open] summary::after { transform: rotate(180deg); }
.filter-multiselect__menu { background: #fff; border: 1px solid var(--accent); border-radius: 0 0 8px 8px; box-shadow: 0 12px 24px rgba(30,42,68,.13); left: 0; max-height: 260px; overflow: auto; padding: 8px; position: absolute; right: 0; top: 40px; z-index: 10; }
.filter-multiselect__menu fieldset { border: 0; display: grid; gap: 5px; margin: 0; padding: 0; }
.filter-multiselect__empty { font-size: 13px; margin: 6px 4px; }
.check-option { align-items: center; background: #fff; border: 1px solid #dce2ec; border-radius: 7px; color: #4d5b72; cursor: pointer; display: flex; font-size: 12px; font-weight: 600; gap: 8px; min-height: 36px; padding: 8px 10px; }
.check-option:has(input:checked) { background: #fff0ed; border-color: #f4b0a4; color: #a34331; }
.check-option input { accent-color: var(--accent); height: 14px; margin: 0; min-width: auto; padding: 0; width: 14px; }
.check-option--record { align-items: flex-start; }
.check-option__record-text { display: grid; gap: 2px; min-width: 0; }
.check-option__record-text b { color: #65738a; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }
.check-option__record-text span { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visually-hidden { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; min-width: 560px; width: 100%; }
th { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 11px 24px; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { border-top: 1px solid var(--line); color: #32405a; font-size: 14px; padding: 14px 24px; vertical-align: middle; }
td strong { color: var(--ink); display: block; font-weight: 650; }
td small { color: var(--muted); display: block; font-size: 12px; margin-top: 3px; }
tfoot td { background: #fbfcfd; color: var(--ink); font-weight: 700; }
.table-link { color: var(--accent); font-weight: 700; text-decoration: none; }
.money { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.record-code { color: #596981; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; font-weight: 700; white-space: nowrap; }
.table-actions { text-align: right; white-space: nowrap; width: 1%; }
.table-actions form { margin: 0; }

.status { border-radius: 999px; display: inline-block; font-size: 12px; font-weight: 650; line-height: 1; padding: 7px 9px; white-space: nowrap; }
.status--draft { background: #eef1f5; color: #627089; }
.status--new { background: #fff3d9; color: #9a6514; }
.status--in_progress { background: #e8efff; color: #365fba; }
.status--confirmed, .status--completed { background: #e5f6ed; color: #237649; }
.status--cancelled, .status--closed { background: #f5e9ec; color: #925062; }
.status--neutral { background: #eef1f5; color: #627089; }
.status--error { background: #fff0ed; color: #b34432; }
/* The status catalogue maps every business code to one of these finite
   presentation classes.  New RetailCRM codes therefore do not need a CSS
   rule per code, and unknown historical codes remain visibly distinguishable. */
.status--catalog-new { background: #fff3d9; color: #9a6514; }
.status--catalog-process { background: #e8efff; color: #365fba; }
.status--catalog-complete { background: #e5f6ed; color: #237649; }
.status--catalog-cancel { background: #f5e9ec; color: #925062; }
.status--catalog-warning { background: #fff0ed; color: #b34432; }
.status--catalog-legacy { background: #eef1f5; color: #627089; }
.status--catalog-unknown { background: #f1f3f7; color: #56647a; }

.two-column { align-items: start; display: grid; gap: 22px; grid-template-columns: minmax(280px, .76fr) minmax(0, 1.7fr); }
.detail-grid { align-items: start; display: grid; gap: 22px; grid-template-columns: minmax(0, 1.7fr) minmax(290px, .75fr); }
.calculator-context { align-items: center; display: flex; gap: 13px; margin-bottom: 22px; padding: 16px 20px; }
.calculator-context__icon { align-items: center; background: #e8efff; border-radius: 10px; color: #315cae; display: inline-flex; flex: 0 0 auto; font-size: 23px; font-weight: 800; height: 40px; justify-content: center; width: 40px; }
.calculator-context strong { color: var(--ink); display: block; font-size: 15px; }
.calculator-context p { font-size: 13px; margin-top: 2px; }
.calculator-layout { align-items: start; display: grid; gap: 22px; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .72fr); }
.calculator-editor { overflow: visible; }
.calculator-form { display: grid; gap: 16px; padding: 0 24px 24px; }
.calculator-field, .calculator-native-field, .calculator-advanced > label { color: #4d5b72; display: grid; font-size: 12px; font-weight: 700; gap: 6px; min-width: 0; }
.calculator-field { max-width: 420px; }
.calculator-native-fields { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); transition: opacity .15s ease; }
.calculator-native-fields--disabled { opacity: .42; pointer-events: none; }
.calculator-native-fields__empty { grid-column: 1 / -1; font-size: 13px; }
.calculator-native-field--checkbox { align-content: end; }
.calculator-native-field__check { align-items: center; border: 1px solid #dce2ec; border-radius: 8px; color: #4d5b72; display: flex; font-size: 13px; font-weight: 600; gap: 8px; min-height: 41px; padding: 9px 11px; }
.calculator-native-field__check input, .calculator-advanced__toggle input { accent-color: var(--accent); height: 15px; margin: 0; min-width: auto; padding: 0; width: 15px; }
.calculator-native-field small { color: var(--muted); font-size: 11px; font-weight: 500; }
.calculator-form__hint { font-size: 12px; margin: -2px 0 0; }
.calculator-advanced { background: #f8faff; border: 1px solid #dbe4f1; border-radius: 10px; overflow: hidden; }
.calculator-advanced > summary { color: #3c5279; cursor: pointer; font-size: 13px; font-weight: 700; list-style: none; padding: 12px 14px; user-select: none; }
.calculator-advanced > summary::-webkit-details-marker { display: none; }
.calculator-advanced > summary::after { color: var(--accent); content: "⌄"; float: right; font-size: 18px; line-height: .75; }
.calculator-advanced[open] > summary { border-bottom: 1px solid #dbe4f1; }
.calculator-advanced[open] > summary::after { transform: rotate(180deg); }
.calculator-advanced > label, .calculator-advanced > p { margin: 13px 14px 0; }
.calculator-advanced > p { font-size: 11px; margin-bottom: 14px; }
.calculator-advanced textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.45; resize: vertical; }
.calculator-advanced__toggle { align-items: center; color: #4d5b72; cursor: pointer; display: flex !important; font-size: 12px; font-weight: 650; gap: 8px; }
.calculator-form__actions { padding: 0; }
.calculator-help { padding-bottom: 19px; }
.calculator-help ol { color: #4e5c74; display: grid; font-size: 13px; gap: 8px; line-height: 1.45; margin: 0; padding: 0 24px 0 42px; }
.calculator-help > p { font-size: 12px; margin: 15px 24px 0; }
.calculator-unavailable { padding: 26px 24px; }
.calculator-unavailable h2 { font-size: 17px; }
.calculator-result { margin-top: 22px; }
.calculator-result__summary { border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0; }
.calculator-result__summary > div { border-right: 1px solid var(--line); display: grid; gap: 3px; min-width: 150px; padding: 15px 24px; }
.calculator-result__summary > div:last-child { border-right: 0; }
.calculator-result__summary span { color: var(--muted); font-size: 11px; }
.calculator-result__summary strong { color: var(--ink); font-size: 14px; }
.calculator-quotes { display: grid; gap: 0; }
.calculator-quote { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 16px; justify-content: space-between; padding: 16px 24px; }
.calculator-quote:last-child { border-bottom: 0; }
.calculator-quote--selected { background: #f2fbf6; }
.calculator-quote > div:first-child { display: grid; gap: 3px; }
.calculator-quote span { color: #50607a; font-size: 12px; font-weight: 650; }
.calculator-quote strong { color: var(--ink); font-size: 19px; letter-spacing: -.02em; }
.calculator-quote small { color: var(--muted); font-size: 12px; }
.calculator-quote__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.calculator-quote__actions form { margin: 0; }
.calculator-quote__unavailable { flex-basis: 100%; max-width: 300px; text-align: right; }
.calculator-result__empty { padding: 22px 24px; }
.calculator-result__empty strong { font-size: 14px; }
.calculator-result__empty p { font-size: 13px; }
.order-composition-actions { align-items: center; display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.order-main-stack { display: grid; gap: 22px; min-width: 0; }
.side-stack { display: grid; gap: 22px; }
.settings-heading { margin: 0 0 20px; max-width: 760px; }
.settings-heading h2 { font-size: 20px; }
.settings-heading p { font-size: 14px; }
.settings-tabs { display: flex; gap: 7px; margin: 0 0 20px; overflow-x: auto; padding-bottom: 1px; }
.settings-tabs a { border: 1px solid var(--line); border-radius: 9px; color: #53627b; flex: 0 0 auto; font-size: 13px; font-weight: 700; padding: 9px 13px; text-decoration: none; white-space: nowrap; }
.settings-tabs a:hover { background: #fff; color: var(--ink); }
.settings-tabs a.active { background: var(--nav); border-color: var(--nav); color: #fff; }
.status-settings-note { align-items: flex-start; background: #f2f6ff; border: 1px solid #cbd9f5; border-radius: 10px; color: #4d638b; display: grid; font-size: 13px; gap: 3px; margin: 0 0 22px; max-width: 900px; padding: 13px 15px; }
.status-settings-note strong { color: #315cae; font-size: 13px; }
.status-group-create { margin-bottom: 22px; overflow: visible; }
.status-group-create > summary { align-items: center; cursor: pointer; display: flex; gap: 16px; justify-content: space-between; list-style: none; padding: 18px 24px; user-select: none; }
.status-group-create > summary::-webkit-details-marker { display: none; }
.status-group-create > summary > span:first-child { display: grid; gap: 3px; }
.status-group-create > summary strong { color: var(--ink); font-size: 15px; }
.status-group-create > summary small { color: var(--muted); font-size: 13px; }
.status-group-create[open] > summary { border-bottom: 1px solid var(--line); }
.status-group-create[open] > summary .button::after { content: "Свернуть"; font-size: 12px; }
.status-group-create[open] > summary .button { font-size: 0; }
.status-management-form { align-items: end; display: grid; gap: 12px; }
.status-management-form > label:not(.status-toggle) { color: #4d5b72; display: grid; font-size: 12px; font-weight: 700; gap: 6px; min-width: 0; }
.status-management-form > label input { min-width: 0; }
.status-management-form--create { grid-template-columns: minmax(220px, 1.5fr) minmax(120px, .42fr) minmax(190px, .72fr) auto; padding: 19px 24px 22px; }
.status-toggle { align-items: center; color: #4d5b72; cursor: pointer; display: flex; flex-wrap: wrap; font-size: 12px; font-weight: 700; gap: 7px; min-height: 41px; }
.status-toggle input { accent-color: var(--accent); height: 15px; margin: 0; min-width: auto; padding: 0; width: 15px; }
.status-toggle small { color: var(--muted); flex-basis: 100%; font-size: 11px; font-weight: 500; margin-left: 22px; margin-top: -4px; }
.status-groups-panel { overflow: visible; }
.status-groups-list { display: grid; }
.status-group-card { border-top: 1px solid var(--line); padding: 22px 24px; }
.status-group-card:first-child { border-top: 0; }
.status-group-card--archived { background: #fbfcfe; }
.status-group-card__header { align-items: flex-start; display: flex; gap: 14px; justify-content: space-between; }
.status-group-card__identity { display: grid; gap: 7px; min-width: 0; }
.status-group-card__identity h3 { color: var(--ink); font-size: 16px; overflow-wrap: anywhere; }
.status-catalog-meta, .status-definition__meta { align-items: center; color: var(--muted); display: flex; flex-wrap: wrap; font-size: 11px; gap: 6px 9px; }
.status-catalog-meta code, .status-definition__meta code { background: #f1f4f8; border-radius: 5px; color: #56647a; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; padding: 3px 5px; }
.status-catalog-state { background: #e8f7ef; border-radius: 999px; color: #21734a; font-size: 10px; font-weight: 750; line-height: 1; padding: 5px 7px; }
.status-catalog-state--inactive { background: #fff6df; color: #8f6319; }
.status-catalog-state--archived { background: #f5e9ec; color: #925062; }
.status-management-form--group { grid-template-columns: minmax(190px, 1.35fr) minmax(112px, .35fr) minmax(150px, .66fr) auto; margin-top: 16px; max-width: 900px; }
.status-catalog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.status-catalog-actions form { margin: 0; }
.status-group-statuses { border-top: 1px dashed #dfe5ee; margin-top: 20px; padding-top: 17px; }
.status-group-statuses__heading { align-items: center; display: flex; gap: 8px; justify-content: space-between; margin-bottom: 10px; }
.status-group-statuses__heading h4 { color: #40506a; font-size: 13px; margin: 0; }
.status-group-statuses__heading > span { align-items: center; background: #eef2f8; border-radius: 999px; color: #596981; display: inline-flex; font-size: 11px; font-weight: 800; height: 22px; justify-content: center; min-width: 22px; padding: 0 7px; }
.status-group-statuses__reorder-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; margin-left: auto; }
.status-group-statuses__reorder-draft { color: #8f6319; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-definition-list { display: grid; gap: 8px; }
.status-definition { background: #fbfcff; border: 1px solid #e2e8f1; border-radius: 10px; display: grid; gap: 10px; padding: 12px; }
.status-definition--archived { background: #f8f9fb; opacity: .84; }
.status-management-form--status { grid-template-columns: minmax(190px, 1.45fr) minmax(108px, .35fr) minmax(145px, .64fr) auto; }
.status-catalog-actions--status { margin-top: -2px; }
.status-definition-empty { font-size: 13px; margin: 5px 0 0; }
.status-create-form { margin-top: 14px; }
.status-create-form > summary { color: #40506a; cursor: pointer; font-size: 12px; font-weight: 750; list-style: none; width: fit-content; }
.status-create-form > summary::-webkit-details-marker { display: none; }
.status-create-form > summary::before { color: var(--accent); content: "+"; font-size: 16px; margin-right: 5px; }
.status-management-form--create-status { background: #f7f9fd; border: 1px solid #dfe6f0; border-radius: 10px; grid-template-columns: minmax(205px, 1.4fr) minmax(108px, .35fr) minmax(155px, .72fr) auto; margin-top: 10px; padding: 12px; }
.status-settings-empty { border-top: 1px solid var(--line); }
/* Compact administration of a large status catalogue.  The directory keeps
   a hundred-plus RetailCRM values scannable and only opens one editor at a
   time, while group composition has its own focused workspace. */
.status-catalog-tabs { display: flex; gap: 7px; margin: -7px 0 18px; overflow-x: auto; padding-bottom: 1px; }
.status-catalog-tabs a { border: 1px solid var(--line); border-radius: 8px; color: #53627b; flex: 0 0 auto; font-size: 12px; font-weight: 750; padding: 8px 12px; text-decoration: none; white-space: nowrap; }
.status-catalog-tabs a:hover { background: #fff; color: var(--ink); }
.status-catalog-tabs a.active { background: #edf2ff; border-color: #cad9f7; color: #315cae; }
.status-directory-create { margin-bottom: 20px; overflow: visible; }
.status-directory-create > summary { align-items: center; cursor: pointer; display: flex; gap: 16px; justify-content: space-between; list-style: none; padding: 15px 20px; user-select: none; }
.status-directory-create > summary::-webkit-details-marker { display: none; }
.status-directory-create > summary > span:first-child { display: grid; gap: 3px; }
.status-directory-create > summary strong { color: var(--ink); font-size: 14px; }
.status-directory-create > summary small { color: var(--muted); font-size: 12px; }
.status-directory-create[open] > summary { border-bottom: 1px solid var(--line); }
.status-directory-create[open] > summary .button::after { content: "Свернуть"; font-size: 12px; }
.status-directory-create[open] > summary .button { font-size: 0; }
.status-management-form--directory-create { grid-template-columns: minmax(200px, 1.4fr) minmax(180px, 1fr) minmax(110px, .4fr) auto; padding: 17px 20px 20px; }
.status-directory { overflow: visible; }
.status-directory__heading { align-items: flex-start; }
.status-directory__count { align-items: center; background: #eef2f8; border-radius: 999px; color: #596981; display: inline-flex; font-size: 12px; font-weight: 800; height: 28px; justify-content: center; min-width: 28px; padding: 0 9px; }
.status-directory-filters { align-items: end; background: #fbfcff; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; gap: 11px; grid-template-columns: minmax(210px, 1.5fr) minmax(170px, 1fr) minmax(150px, .78fr) auto auto; padding: 14px 24px; }
.status-directory-filters label { color: #4d5b72; display: grid; font-size: 11px; font-weight: 750; gap: 5px; min-width: 0; }
.button-link { background: transparent; color: #53627b; min-width: auto; padding-left: 5px; padding-right: 5px; }
.button-link:hover { color: var(--accent); }
.status-directory-list { display: grid; }
.status-directory-list__labels { align-items: end; background: #fbfcff; border-bottom: 1px solid var(--line); color: #69778e; display: grid; font-size: 10px; font-weight: 750; gap: 10px; grid-template-columns: minmax(220px, 1.6fr) minmax(150px, .8fr) 82px minmax(90px, .45fr) auto auto; letter-spacing: .045em; padding: 9px 24px; text-transform: uppercase; }
.status-directory-list__labels span:last-child { justify-self: start; }
.status-directory-list__labels--reorder { grid-template-columns: 24px minmax(220px, 1.6fr) minmax(150px, .8fr) 82px minmax(90px, .45fr) auto auto; }
.status-directory-list__labels--reorder span:first-child { grid-column: 2; }
.status-directory-row { border-bottom: 1px solid var(--line); }
.status-directory-row:last-child { border-bottom: 0; }
.status-directory-row__inner { align-items: end; display: grid; grid-template-columns: minmax(0, 1fr) auto; min-width: 0; padding: 10px 24px; }
.status-directory-row--reorderable .status-directory-row__inner { grid-template-columns: 24px minmax(0, 1fr) auto; }
.status-directory-row--reorderable .status-directory-row__form { grid-column: 2; }
.status-directory-row--reorderable .status-directory-row__actions { grid-column: 3; }
.status-directory-row:hover .status-directory-row__inner { background: #fbfcff; }
.status-directory-row--archived .status-directory-row__inner { background: #fbfcfe; opacity: .82; }
.status-directory-row__form { align-items: end; display: grid; gap: 10px; grid-template-columns: minmax(220px, 1.6fr) minmax(150px, .8fr) 82px minmax(90px, .45fr) auto; min-width: 0; }
.status-directory-row__name { display: grid; gap: 4px; min-width: 0; }
.status-directory-row__name input { min-width: 0; }
.status-directory-row__name small, .status-group-picker small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-directory-row__name code, .status-group-picker code { background: #f1f4f8; border-radius: 4px; color: #56647a; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; padding: 2px 4px; }
.status-directory-row__field { color: #69778e; display: grid; font-size: 10px; font-weight: 750; gap: 4px; letter-spacing: .045em; min-width: 0; text-transform: uppercase; }
.status-directory-row__field select, .status-directory-row__field input { min-width: 0; }
.status-directory-row__field--position input { font-variant-numeric: tabular-nums; }
.status-directory-row__state { align-self: end; justify-self: start; padding-bottom: 7px; }
.status-directory-row__save { align-self: end; }
.status-directory-row__actions { align-items: end; display: flex; margin-left: 8px; min-height: 32px; }
.status-directory-row__actions form { margin: 0; }
.status-directory-row__drag { align-items: center; align-self: end; background: transparent; border: 0; border-radius: 7px; color: #8a96a8; cursor: grab; display: inline-flex; font-size: 20px; height: 32px; justify-content: center; margin: 0 8px 0 -8px; padding: 0; width: 24px; }
.status-directory-row__drag:hover, .status-directory-row__drag:focus-visible { background: #eef2f8; color: #40506a; outline: 0; }
.status-directory-row__drag:active { cursor: grabbing; }
.status-directory-row__drag:disabled { cursor: default; opacity: 0; pointer-events: none; }
.status-directory-list--reorder.status-reorder-enabled .status-directory-row__drag { background: #f2f6ff; border: 1px solid #d3e0fa; color: #3d64ae; opacity: 1; pointer-events: auto; }
.status-directory-list--reorder.status-reorder-saving { cursor: progress; opacity: .68; pointer-events: none; }
.status-directory-list--reorder.status-reorder-dirty { box-shadow: inset 3px 0 0 #f2b343; }
.status-directory-row.status-reorder-dragging { background: #f2f6ff; box-shadow: 0 5px 16px rgba(30,42,68,.08); opacity: .78; }
.status-directory-row.status-reorder-drop-before { border-top: 3px solid #5175c1; }
.status-directory-row.status-reorder-drop-after { border-bottom: 3px solid #5175c1; }
.status-directory-list__reorder-notice { color: #69778e; font-size: 12px; margin: 10px 0 0; }
.status-directory-list__reorder-notice[data-state="error"] { color: var(--danger-ink); }
.status-directory-list__reorder-notice[data-state="saving"] { color: #315cae; }
.status-directory-list__reorder-notice[data-state="success"] { color: var(--success-ink); }
.status-directory-list__reorder-notice[data-state="draft"] { color: #8f6319; }
.status-advanced-settings { align-self: stretch; border: 1px solid #dfe6f0; border-radius: 8px; min-width: 0; padding: 8px 10px; }
.status-advanced-settings > summary { color: #53627b; cursor: pointer; font-size: 11px; font-weight: 750; list-style: none; }
.status-advanced-settings > summary::-webkit-details-marker { display: none; }
.status-advanced-settings > summary::after { color: var(--accent); content: "⌄"; font-size: 15px; font-weight: 500; margin-left: 5px; }
.status-advanced-settings[open] > summary { margin-bottom: 7px; }
.status-advanced-settings[open] > summary::after { display: inline-block; transform: rotate(180deg); }
.status-advanced-settings p { font-size: 11px; line-height: 1.4; margin: 4px 0 0; }
.status-advanced-settings .status-toggle { min-height: 20px; }
.status-groups-workspace { align-items: start; display: grid; gap: 18px; grid-template-columns: minmax(240px, .62fr) minmax(0, 1.58fr); }
.status-group-picker { overflow: hidden; }
.status-group-picker .panel-heading { padding-bottom: 13px; }
.status-group-picker__list { border-top: 1px solid var(--line); display: grid; max-height: min(62vh, 720px); overflow: auto; }
.status-group-picker__list > a { align-items: center; border-bottom: 1px solid var(--line); color: inherit; display: flex; gap: 10px; justify-content: space-between; min-width: 0; padding: 12px 15px; text-decoration: none; }
.status-group-picker__list > a:hover { background: #fbfcff; }
.status-group-picker__list > a.active { background: #fff0ed; box-shadow: inset 3px 0 0 var(--accent); }
.status-group-picker__list > a > span:first-child { display: grid; gap: 4px; min-width: 0; }
.status-group-picker__list strong { color: var(--ink); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-group-picker__meta { align-items: flex-end; color: #69778e; display: grid; flex: 0 0 auto; gap: 3px; justify-items: end; }
.status-group-picker__meta b { align-items: center; background: #eef2f8; border-radius: 999px; display: inline-flex; font-size: 10px; height: 20px; justify-content: center; min-width: 20px; padding: 0 6px; }
.status-group-picker__meta i { font-size: 9px; font-style: normal; font-weight: 700; }
.status-group-detail { min-width: 0; overflow: visible; padding: 22px 24px; }
.status-group-detail__header { align-items: flex-start; display: flex; gap: 14px; justify-content: space-between; }
.status-group-detail__header h2 { font-size: 18px; overflow-wrap: anywhere; }
.status-management-form--group-detail { grid-template-columns: minmax(190px, 1.35fr) minmax(112px, .42fr) minmax(225px, 1.05fr) auto; margin-top: 17px; }
.status-group-detail__members { border-top: 1px dashed #dfe5ee; margin-top: 20px; padding-top: 17px; }
.status-group-detail__members .status-group-statuses__heading { align-items: flex-start; }
.status-group-detail__members .status-group-statuses__heading h3 { color: #40506a; font-size: 14px; margin: 0; }
.status-group-detail__members .status-group-statuses__heading p { font-size: 12px; max-width: 560px; }
.status-management-form--group-create-status { background: #f7f9fd; border: 1px solid #dfe6f0; border-radius: 10px; grid-template-columns: minmax(210px, 1.35fr) minmax(112px, .4fr) auto; margin-top: 10px; padding: 12px; }
.employee-create-panel { margin-bottom: 22px; overflow: visible; }
.employee-create-panel > summary { align-items: center; cursor: pointer; display: flex; gap: 16px; justify-content: space-between; list-style: none; padding: 18px 24px; user-select: none; }
.employee-create-panel > summary::-webkit-details-marker { display: none; }
.employee-create-panel > summary > span:first-child { display: grid; gap: 3px; }
.employee-create-panel > summary strong { color: var(--ink); font-size: 15px; }
.employee-create-panel > summary small { color: var(--muted); font-size: 13px; }
.employee-create-panel[open] > summary { border-bottom: 1px solid var(--line); }
.employee-create-panel[open] > summary .button::after { content: "Свернуть"; font-size: 12px; }
.employee-create-panel[open] > summary .button { font-size: 0; }
.employee-create-form { padding-bottom: 22px; padding-top: 19px; }
.employee-create-grid { display: grid; gap: 15px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.employee-create-grid > label:nth-child(4), .employee-create-grid > label:nth-child(5) { grid-column: span 1; }
.employee-create-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
.employee-create-actions .form-hint { flex: 1 1 410px; margin: 0; }
.users-directory { min-width: 0; }
.filter-grid--users { grid-template-columns: minmax(230px, 1.6fr) repeat(2, minmax(180px, 1fr)); }
.users-table { min-width: 990px; }
.users-table th { padding-bottom: 12px; padding-top: 12px; }
.users-table td { font-size: 13px; }
.users-table__row { transition: background .14s ease; }
.users-table__row:hover { background: #fafcff; }
.users-table__row--inactive { background: #fbfcfe; }
.users-table__row--inactive:hover { background: #f5f7fa; }
.user-table-person { align-items: center; color: inherit; display: flex; gap: 10px; min-width: 165px; text-decoration: none; }
.user-table-person:hover strong, .user-table-email:hover { color: var(--accent); text-decoration: underline; }
.user-table-person strong { color: var(--ink); font-size: 13px; }
.user-table-person small { color: var(--muted); display: block; font-size: 11px; margin-top: 2px; }
.user-avatar { align-items: center; background: #edf0f4; border-radius: 50%; color: #5c6980; display: inline-flex; flex: 0 0 auto; font-size: 11px; font-weight: 800; height: 34px; justify-content: center; width: 34px; }
.user-table-email { color: #40506a; overflow-wrap: anywhere; text-decoration: none; }
.table-muted { color: var(--muted); }
.profile-details { display: flex; flex-wrap: wrap; gap: 12px 30px; margin: 15px 0; }
.profile-details div { display: grid; gap: 3px; }
.profile-details dt { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.profile-details dd { color: #40506a; font-size: 13px; margin: 0; }
.profile-layout { grid-template-columns: minmax(260px, .72fr) minmax(320px, 1.1fr); max-width: 930px; }
.profile-details { margin: 0; padding: 0 24px 22px; }
.user-detail-layout { grid-template-columns: minmax(280px, .78fr) minmax(340px, 1.25fr); max-width: 1100px; }
.user-summary-panel--inactive { background: #fbfcfe; }
.user-detail-list { display: grid; gap: 15px; margin: 0; padding: 0 24px 22px; }
.user-detail-list div { display: grid; gap: 4px; }
.user-detail-list dt { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.user-detail-list dd { color: #34435c; font-size: 14px; margin: 0; overflow-wrap: anywhere; }
.user-access-summary { border-top: 1px solid var(--line); padding: 17px 24px 22px; }
.user-access-summary h3 { font-size: 13px; }
.user-access-summary p { font-size: 13px; }
.form-panel { padding-bottom: 23px; }
.wide-form { max-width: 720px; }
.form-stack { display: grid; gap: 15px; padding: 0 24px; }
.form-stack label { color: #4d5b72; display: grid; font-size: 13px; font-weight: 650; gap: 7px; }
input, select, textarea { background: #fff; border: 1px solid #dce2ec; border-radius: 8px; color: var(--ink); font: inherit; font-size: 14px; min-width: 0; outline: none; padding: 10px 11px; width: 100%; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,93,67,.12); }
.form-stack .button { justify-self: start; margin-top: 4px; }
.form-hint { color: var(--muted); display: block; font-size: 11px; font-weight: 500; line-height: 1.45; }
.scheduled-message-filter { align-items: end; border-top: 1px solid var(--line); display: flex; gap: 10px; padding: 14px 24px; }
.scheduled-message-filter label { color: #4d5b72; display: grid; font-size: 12px; font-weight: 700; gap: 6px; min-width: 200px; }
.form-intro { border-left: 3px solid var(--accent); font-size: 14px; margin: 0 24px 21px; padding-left: 12px; }
.order-note { border-top: 1px solid var(--line); margin: 0 24px; padding: 17px 0 2px; }
.order-note p { font-size: 14px; white-space: pre-wrap; }
.order-add-item-form { align-items: end; border-top: 1px solid var(--line); display: flex; gap: 12px; margin: 0 24px; padding: 17px 0; }
.order-add-item-form__fields { display: grid; flex: 1 1 420px; gap: 12px; grid-template-columns: minmax(0, 1fr) 130px; min-width: 0; }
.order-add-item-form label { color: #4d5b72; display: grid; font-size: 12px; font-weight: 700; gap: 6px; min-width: 0; }
.order-add-item-form .button { min-width: 150px; }
.order-item-number-heading, .order-item-number { padding-left: 16px; padding-right: 8px; text-align: center; width: 1%; }
.order-item-number { color: #687891; font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 750; white-space: nowrap; }
.order-item-attributes-inline { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.order-item-attributes-inline span { background: #f2f5fa; border-radius: 999px; color: #52627d; font-size: 11px; font-weight: 600; padding: 3px 7px; }
.order-fields-form { gap: 0; padding: 0; }
.order-field-group { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 18px 24px 21px; }
.order-field-group legend { color: var(--ink); font-size: 14px; font-weight: 750; padding: 0; }
.order-fields-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 13px; }
.order-fields-grid > label, .order-field { color: #4d5b72; display: grid; font-size: 13px; font-weight: 650; gap: 7px; }
.delivery-checkbox { align-content: center; color: #4d5b72; display: flex !important; font-size: 13px; font-weight: 650; gap: 7px; min-height: 42px; }
.delivery-checkbox input { inline-size: auto; margin: 0; }
.warehouse-directory { display: grid; gap: 12px; padding: 14px; }
.warehouse-card { border: 1px solid var(--line); border-radius: 12px; padding: 0 16px 16px; }
.warehouse-card summary { align-items: center; cursor: pointer; display: flex; justify-content: space-between; min-height: 56px; }
.warehouse-card summary span { display: grid; gap: 3px; }
.warehouse-card summary small { color: var(--muted); }
.warehouse-form { margin-top: 8px; }
.kiwano-eye-search-form { align-items: end; display: grid; gap: 14px; grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) minmax(120px, .7fr) auto; padding: 0 24px 20px; }
.kiwano-eye-search-form label { color: #4d5b72; display: grid; font-size: 13px; font-weight: 650; gap: 7px; }
.kiwano-eye-search-form small { color: var(--muted); font-weight: 500; }
.kiwano-eye-intro .form-hint { margin: 0; padding: 0 24px 20px; }
.kiwano-eye-layout { display: grid; gap: 20px; grid-template-columns: minmax(230px, .62fr) minmax(0, 2fr); margin-top: 20px; }
.kiwano-eye-history { align-self: start; }
.kiwano-eye-history-list { display: grid; max-height: 620px; overflow: auto; }
.kiwano-eye-history-list a { border-top: 1px solid var(--line); color: inherit; display: grid; gap: 4px; padding: 13px 16px; text-decoration: none; }
.kiwano-eye-history-list a:first-child { border-top: 0; }
.kiwano-eye-history-list a:hover, .kiwano-eye-history-list a.active { background: #fff0ed; }
.kiwano-eye-history-list span, .kiwano-eye-history-list small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kiwano-eye-warning { align-items: flex-start; background: #fff7df; border-block: 1px solid #f6dfaa; color: #805d0d; display: grid; gap: 4px; grid-template-columns: auto 1fr; margin: 0 0 18px; padding: 13px 18px; }
.kiwano-eye-warning strong { grid-row: span 2; }
.kiwano-eye-table td > strong, .kiwano-eye-table td > span, .kiwano-eye-table td > small { display: block; }
.kiwano-eye-table td > span { margin-top: 3px; overflow-wrap: anywhere; }
.kiwano-eye-table td > small { color: var(--muted); margin-top: 4px; }
.kiwano-eye-table a { overflow-wrap: anywhere; }
.kiwano-eye-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.kiwano-eye-actions form { margin: 0; }
.kiwano-eye-manual-contact { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 15px; }
.kiwano-eye-manual-contact summary { color: var(--accent); cursor: pointer; font-weight: 700; }
.kiwano-eye-manual-contact form { margin-top: 16px; }
.kiwano-eye-candidates { border-bottom: 1px solid var(--line); display: grid; margin-bottom: 20px; padding-bottom: 16px; }
.kiwano-eye-candidate { border: 1px solid var(--line); border-radius: 10px; color: inherit; display: grid; gap: 4px; margin-top: 8px; padding: 12px 14px; text-decoration: none; }
.kiwano-eye-candidate:hover, .kiwano-eye-candidate.active { background: #fff0ed; border-color: #ffc7bd; }
.kiwano-eye-candidate span, .kiwano-eye-candidate small { color: var(--muted); }
.kiwano-eye-selected-candidate { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 20px; }
.customer-public-contacts { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.customer-public-contacts h3 { font-size: 15px; margin: 0; }
.customer-public-contacts > p { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.customer-public-contacts ul { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.customer-public-contacts li { display: grid; gap: 3px; }
.customer-public-contacts li strong { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.customer-public-contacts li a { font-size: 13px; }
.customer-public-contacts li small { color: var(--muted); }
.order-field small { color: #8c6b21; font-size: 10px; font-weight: 650; }
.order-field--full { grid-column: 1 / -1; }
.order-field--checkbox { align-items: center; background: #fbfcff; border: 1px solid #dce5f2; border-radius: 8px; cursor: pointer; display: flex; gap: 9px; min-height: 42px; padding: 10px 11px; }
.order-field--checkbox input[type="hidden"] { display: none; }
.order-field--checkbox input[type="checkbox"] { accent-color: var(--accent); height: 16px; margin: 0; padding: 0; width: 16px; }
.form-actions { padding: 0 24px 23px; }
.form-actions .button { margin: 0; }
.order-field-readonly { display: grid; gap: 19px; padding: 19px 24px 22px; }
.order-field-readonly h3 { font-size: 14px; }
.order-data-list { display: grid; gap: 11px 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.order-data-list div { display: grid; gap: 3px; }
.order-data-list dt { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.order-data-list dd { color: #34435c; font-size: 13px; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.order-data-list--padded { padding: 19px 24px 22px; }
.order-data-list--compact { margin: 13px 0 0; }
.order-detail-form { padding-bottom: 23px; }
.empty-state--compact { padding: 25px 24px; }
.order-item-property-list { display: grid; }
.order-item-property-editor { border-top: 1px solid var(--line); }
.order-item-property-editor summary { align-items: center; cursor: pointer; display: flex; font-size: 13px; gap: 12px; justify-content: space-between; list-style: none; padding: 15px 24px; }
.order-item-property-editor summary::-webkit-details-marker { display: none; }
.order-item-property-editor__position { color: #687891; font-size: 12px; font-variant-numeric: tabular-nums; margin-right: 7px; }
.order-item-property-editor summary span { color: var(--muted); font-size: 12px; }
.order-item-property-editor[open] summary { background: #fbfcff; border-bottom: 1px solid var(--line); }
.order-item-property-editor .order-data-list { padding: 0 24px; }
.order-item-property-form { align-items: end; display: grid; gap: 10px; grid-template-columns: 1fr 1.3fr 1.4fr auto; padding: 16px 24px 19px; }
.order-item-property-form label { color: #4d5b72; display: grid; font-size: 12px; font-weight: 650; gap: 5px; }
.order-item-property-form input { font-size: 13px; padding: 8px 9px; }
.payment-summary { background: #fbfcff; border-bottom: 1px solid var(--line); display: grid; gap: 1px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.payment-summary div { border-right: 1px solid var(--line); display: grid; gap: 4px; padding: 14px 18px; }
.payment-summary div:last-child { border-right: 0; }
.payment-summary span { color: var(--muted); font-size: 11px; font-weight: 650; }
.payment-summary strong { color: var(--ink); font-size: 14px; }
.payment-summary__overpaid { color: #a34331 !important; }
.payment-list { display: grid; }
.payment-row { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 16px; justify-content: space-between; padding: 13px 24px; }
.payment-row > div { display: grid; gap: 3px; min-width: 0; }
.payment-row span, .payment-row time, .payment-row small { color: var(--muted); font-size: 12px; }
.payment-form { padding-bottom: 23px; padding-top: 18px; }
.order-source-chat { align-items: center; display: flex; gap: 16px; justify-content: space-between; padding: 18px 20px; }
.order-source-chat h2 { font-size: 14px; }
.order-source-chat p { font-size: 12px; }
.archive-panel { align-items: center; display: flex; gap: 18px; justify-content: space-between; padding: 20px 24px; }
.archive-panel p { font-size: 13px; max-width: 300px; }

.integrations-layout { align-items: start; display: grid; gap: 22px; grid-template-columns: minmax(290px, .76fr) minmax(0, 1.55fr); }
.integration-connect-panel { padding-bottom: 23px; }
.integration-security-note { background: #edf3ff; border: 1px solid #cfddfa; border-radius: 9px; color: #3d5b90; font-size: 13px; line-height: 1.45; margin: 0 24px 20px; padding: 12px 13px; }
.integration-security-note strong { display: block; font-size: 13px; }
.integration-security-note p { color: inherit; font-size: 12px; margin-top: 4px; }
.form-help { color: var(--muted); font-size: 12px; line-height: 1.45; margin: -4px 0 0; }
.field-error { color: var(--danger-ink); font-size: 12px; font-weight: 600; }
.integration-list { display: grid; gap: 0; }
.sender-qr-enrollment { border-top: 1px solid var(--line); display: grid; gap: 12px; padding: 16px 24px 18px; }
.sender-qr-enrollment > :first-child { align-items: start; display: flex; gap: 16px; justify-content: space-between; }
.sender-qr-enrollment > :first-child > div { min-width: 0; }
.sender-qr-enrollment p { font-size: 12px; margin-top: 4px; }
.sender-qr-image { background: #fff; border: 1px solid #cfddfa; border-radius: 8px; display: block; height: auto; margin-top: 10px; max-width: min(260px, 100%); padding: 8px; }
.sender-qr-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 24px 18px; }
.sender-qr-enrollment .sender-qr-actions { margin: 0; }
.sender-qr-actions form { margin: 0; }
.integration-card { border-top: 1px solid var(--line); padding: 19px 24px 20px; }
.integration-card--disabled { background: #fbfcfe; }
.integration-card--error { background: #fffafa; }
.integration-card--archived { background: #fbfcfe; opacity: .78; }
.integration-card__main { align-items: flex-start; display: flex; gap: 14px; justify-content: space-between; }
.integration-card__identity { align-items: center; display: flex; gap: 11px; min-width: 0; }
.integration-provider-mark { align-items: center; background: #e8efff; border-radius: 9px; color: #3562bd; display: inline-flex; flex: 0 0 auto; font-size: 11px; font-weight: 800; height: 36px; justify-content: center; letter-spacing: -.02em; width: 36px; }
.integration-card h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.integration-card__identity p { font-size: 12px; margin-top: 3px; }
.integration-details { display: flex; flex-wrap: wrap; gap: 10px 30px; margin: 16px 0; }
.integration-details div { display: grid; gap: 3px; }
.integration-details dt { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.integration-details dd { color: #40506a; font-size: 13px; margin: 0; }
.integration-status--healthy { background: #e5f6ed; color: #237649; }
.integration-status--disabled { background: #eef1f5; color: #627089; }
.integration-status--error { background: #fff0ed; color: #b34432; }
.integration-status--archived { background: #f5e9ec; color: #925062; }
.integration-card__actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.integration-card__actions form { margin: 0; }
.integration-rename-form { align-items: center; display: flex; flex: 1 1 275px; gap: 8px; }
.integration-rename-form input { min-width: 0; padding-bottom: 7px; padding-top: 7px; }
.integration-token-replace { position: relative; }
.integration-token-replace > summary { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); cursor: pointer; display: inline-flex; font-size: 12px; font-weight: 650; list-style: none; min-height: 32px; padding: 0 10px; user-select: none; }
.integration-token-replace > summary::-webkit-details-marker { display: none; }
.integration-token-replace[open] > summary { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,93,67,.12); }
.integration-token-form { align-items: center; background: #fff; border: 1px solid var(--accent); border-radius: 9px; box-shadow: 0 12px 24px rgba(30,42,68,.13); display: flex; gap: 8px; padding: 9px; position: absolute; right: 0; top: 38px; width: min(330px, calc(100vw - 56px)); z-index: 20; }
.integration-token-form input { min-width: 0; padding-bottom: 7px; padding-top: 7px; }
.integration-archived-panel { margin-top: 22px; }

/* Sender automation monitor. It keeps provider data compact; the few
   lifecycle forms below are separately feature-gated and never expose
   Telegram credentials, sessions, or message bodies. */
.automation-heading { padding-bottom: 12px; }
.automation-heading__badges { align-items: center; display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.automation-period-form { align-items: end; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 24px; }
.automation-period-form label { color: #4d5b72; display: grid; font-size: 12px; font-weight: 650; gap: 5px; }
.automation-period-form input { font-size: 13px; min-height: 36px; padding: 7px 9px; }
.automation-period-form .button { margin-bottom: 0; }
.automation-observed-note { color: var(--muted); display: flex; flex-wrap: wrap; font-size: 12px; gap: 5px 18px; padding: 0 24px 17px; }
.automation-observed-note span { overflow-wrap: anywhere; }
.automation-errors { margin-bottom: 18px; }
.automation-metrics { margin: 0 24px 22px; }
.automation-inner-panel { border-left: 0; border-radius: 0; border-right: 0; margin: 0; }
.automation-inner-panel + .automation-inner-panel { border-top: 0; }
.automation-stat-grid { border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.automation-stat-grid div { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); display: grid; gap: 4px; padding: 15px 18px; }
.automation-stat-grid div:nth-child(3n) { border-right: 0; }
.automation-stat-grid div:nth-last-child(-n + 3) { border-bottom: 0; }
.automation-stat-grid span { color: var(--muted); font-size: 11px; font-weight: 650; }
.automation-stat-grid strong { color: var(--ink); font-size: 20px; }
.automation-accounts-table { min-width: 940px; }
.automation-accounts-table td { vertical-align: top; }
.automation-accounts-table td > small { color: var(--muted); display: block; font-size: 11px; margin-top: 3px; }
.automation-management-panel { margin-top: 22px; }
.automation-control-global-actions { padding: 0 24px 18px; }
.automation-account-controls-table-wrap { padding: 0 24px 20px; }
.automation-account-controls-table { min-width: 820px; }
.automation-account-controls-table td { vertical-align: middle; }
.automation-stage2-panel { margin-top: 22px; }
.automation-stage2-note { margin-bottom: 0; }
.automation-stage2-summary { border-top: 1px solid var(--line); }
.automation-stage2-section { padding: 18px 24px; }
.automation-stage2-section + .automation-stage2-section { border-top: 1px solid var(--line); }
.automation-stage2-section__heading { align-items: flex-start; display: flex; flex-wrap: wrap; gap: 9px 18px; justify-content: space-between; margin-bottom: 14px; }
.automation-stage2-section__actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.automation-stage2-section__actions form { margin: 0; }
.automation-stage2-section__heading h3 { font-size: 15px; }
.automation-stage2-section__heading p { font-size: 12px; margin-top: 3px; }
.automation-stage2-section__heading > small { color: var(--muted); font-size: 11px; padding-top: 3px; }
.automation-stage2-capabilities, .automation-stage2-data-list { display: grid; gap: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.automation-stage2-capabilities > div, .automation-stage2-data-list > div { border: 1px solid var(--line); border-right: 0; display: grid; gap: 6px; min-width: 0; padding: 11px 13px; }
.automation-stage2-capabilities > div:first-child, .automation-stage2-data-list > div:first-child { border-radius: 8px 0 0 8px; }
.automation-stage2-capabilities > div:last-child, .automation-stage2-data-list > div:last-child { border-radius: 0 8px 8px 0; border-right: 1px solid var(--line); }
.automation-stage2-capabilities dt, .automation-stage2-data-list dt { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; }
.automation-stage2-capabilities dd, .automation-stage2-data-list dd { color: var(--ink); font-size: 13px; font-weight: 650; margin: 0; overflow-wrap: anywhere; }
.automation-commands-table { min-width: 680px; }
.automation-commands-table td > small { color: var(--muted); display: block; font-size: 11px; margin-top: 3px; }
.automation-stage2-empty { color: var(--muted); font-size: 13px; margin: 2px 0 0; }

/* Chats / omnichannel inbox */
.chat-live-controls { align-items: center; display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
.chat-live-status { align-items: center; background: #edf3ff; border: 1px solid #cfddfa; border-radius: 9px; color: #3d5b90; display: inline-flex; gap: 8px; min-height: 40px; padding: 6px 10px; }
.chat-live-status__indicator { background: #91a1b9; border-radius: 50%; box-shadow: 0 0 0 3px rgba(145,161,185,.14); display: inline-block; flex: 0 0 auto; height: 7px; width: 7px; }
.chat-live-status__copy { display: grid; gap: 1px; line-height: 1.2; }
.chat-live-status__copy strong { color: #36527f; font-size: 11px; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; }
.chat-live-status__copy span { font-size: 11px; }
.chat-live-controls[data-chat-live-state="active"] .chat-live-status__indicator { background: #35a66c; box-shadow: 0 0 0 3px rgba(53,166,108,.14); }
.chat-live-controls[data-chat-live-state="updating"] .chat-live-status__indicator { animation: chat-live-pulse 1s ease-in-out infinite; background: #3e70c9; box-shadow: 0 0 0 3px rgba(62,112,201,.14); }
.chat-live-controls[data-chat-live-state="warning"] .chat-live-status { background: #fff7e8; border-color: #f3dfaf; color: #805b1d; }
.chat-live-controls[data-chat-live-state="warning"] .chat-live-status__indicator { background: #d5962c; box-shadow: 0 0 0 3px rgba(213,150,44,.14); }
.chat-live-controls[data-chat-live-state="deferred"] .chat-live-status { background: #fff7e8; border-color: #f3dfaf; color: #805b1d; }
.chat-live-controls[data-chat-live-state="deferred"] .chat-live-status__indicator { background: #d5962c; box-shadow: 0 0 0 3px rgba(213,150,44,.14); }
.chat-sync-form { margin: 0; }
.chat-sync-fallback { font-size: 12px; min-height: 40px; }
.chat-templates-link { font-size: 12px; min-height: 40px; }
.chat-sync-summary { font-size: 11px; line-height: 1.35; margin: 6px 2px 0; }
.chat-sync-summary--success { color: #3b7c59; }
.chat-sync-summary--warning { color: var(--warning-ink); }
.chat-section-tabs { display: flex; gap: 7px; margin: -8px 0 18px; overflow-x: auto; padding-bottom: 1px; }
.chat-section-tabs a { border: 1px solid var(--line); border-radius: 9px; color: #53627b; flex: 0 0 auto; font-size: 13px; font-weight: 700; padding: 9px 13px; text-decoration: none; white-space: nowrap; }
.chat-section-tabs a:hover { background: #fff; color: var(--ink); }
.chat-section-tabs a.active { background: #edf2ff; border-color: #cad9f7; color: #315cae; }
.chat-template-heading { margin-bottom: 20px; }
.chat-template-heading h2 { font-size: 20px; }
.chat-template-heading p { font-size: 14px; max-width: 720px; }
.chat-template-create, .chat-template-directory { margin-bottom: 22px; overflow: visible; }
.chat-template-form { display: grid; gap: 12px; }
.chat-template-form--create { align-items: end; grid-template-columns: minmax(180px, .72fr) minmax(300px, 1.5fr) auto; padding: 0 24px 22px; }
.chat-template-form--row { align-items: end; border-top: 1px solid var(--line); grid-template-columns: minmax(180px, .72fr) minmax(320px, 1.5fr) auto; padding: 15px 24px; }
.chat-template-field { color: #4d5b72; display: grid; font-size: 12px; font-weight: 700; gap: 6px; min-width: 0; }
.chat-template-field input, .chat-template-field textarea { min-width: 0; }
.chat-template-field textarea { line-height: 1.4; min-height: 84px; resize: vertical; }
.chat-template-form__actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 1px; }
.chat-template-empty { border-top: 1px solid var(--line); }
.chat-template-archive { margin-top: 22px; overflow: visible; }
.chat-template-archive > summary { align-items: center; cursor: pointer; display: flex; justify-content: space-between; list-style: none; padding: 16px 20px; user-select: none; }
.chat-template-archive > summary::-webkit-details-marker { display: none; }
.chat-template-archive > summary > span:first-child { display: grid; gap: 3px; }
.chat-template-archive > summary strong { font-size: 14px; }
.chat-template-archive > summary small, .chat-template-archive > summary > span:last-child { color: var(--muted); font-size: 12px; }
.chat-template-archive[open] > summary { border-bottom: 1px solid var(--line); }
.chat-template-archive__body { padding: 15px 20px 20px; }
.chat-template-archive__body > p { font-size: 13px; margin: 0 0 12px; }
.chat-template-archive__list { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chat-template-archive__list li { align-items: center; background: #fbfcff; border: 1px solid #e2e8f1; border-radius: 9px; display: flex; gap: 12px; justify-content: space-between; padding: 10px 11px; }
.chat-template-archive__list li > div { display: grid; gap: 3px; min-width: 0; }
.chat-template-archive__list strong { color: var(--ink); font-size: 13px; }
.chat-template-archive__list small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-template-archive__list form { margin: 0; }
.chat-template-archive__empty { font-size: 13px; }
@keyframes chat-live-pulse { 50% { opacity: .38; transform: scale(.8); } }
.chat-workspace { display: grid; grid-template-columns: minmax(248px, .7fr) minmax(360px, 1.7fr) minmax(292px, .82fr); min-height: 640px; }
.chat-workspace--resizable { grid-template-columns: var(--chat-list-width, 292px) 8px minmax(360px, 1fr) 8px var(--chat-details-width, 336px); }
.chat-workspace--resizable .chat-list-pane { border-right: 0; }
.chat-workspace--resizable .chat-details { border-left: 0; }
.chat-resize-handle { align-self: stretch; background: transparent; border: 0; cursor: col-resize; display: none; min-width: 8px; outline: none; padding: 0; position: relative; touch-action: none; }
.chat-workspace--resizable .chat-resize-handle:not([hidden]) { display: block; }
.chat-resize-handle::after { background: #e3e9f2; border-radius: 999px; content: ""; inset: 0 3px; position: absolute; transition: background .15s ease, box-shadow .15s ease; }
.chat-resize-handle:hover::after, .chat-resize-handle:focus-visible::after { background: #cbdcf8; box-shadow: 0 0 0 2px rgba(62,112,201,.12); }
.chat-resize-handle:focus-visible::after { background: #8fafe2; }
body.chat-resizing, body.chat-resizing * { cursor: col-resize !important; user-select: none !important; }
.chat-list-pane { background: #fbfcff; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.chat-list-pane__header { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; min-height: 82px; padding: 17px 18px; }
.chat-list-pane__header h2 { font-size: 17px; }
.chat-list-pane__header p { font-size: 12px; }
.chat-list-pane__provider { align-items: center; background: #e8efff; border-radius: 9px; color: #3562bd; display: inline-flex; flex: 0 0 auto; font-size: 11px; font-weight: 800; height: 34px; justify-content: center; width: 34px; }
.chat-list-filter { background: #fff; border-bottom: 1px solid var(--line); display: block; flex: 0 0 auto; margin: 0; padding: 9px 14px; }
.chat-list-filter__primary { align-items: center; display: grid; gap: 7px; grid-template-columns: minmax(0, 1fr) auto auto; }
.chat-list-filter select { font-size: 12px; min-width: 0; padding: 7px 8px; }
.chat-list-filter .button { min-height: 33px; padding-left: 9px; padding-right: 9px; }
.chat-list-filter__reset { align-items: center; border: 1px solid #dce3ed; border-radius: 7px; color: #62718a; display: inline-flex; font-size: 18px; height: 33px; justify-content: center; line-height: 1; text-decoration: none; width: 33px; }
.chat-list-filter__reset:hover { background: #f4f6fa; color: var(--ink); }
.chat-list-filter__advanced { border-top: 1px dashed #dfe5ee; margin-top: 8px; padding-top: 8px; }
.chat-list-filter__advanced > summary { align-items: center; color: #53647d; cursor: pointer; display: flex; font-size: 11px; font-weight: 750; justify-content: space-between; list-style: none; user-select: none; }
.chat-list-filter__advanced > summary::-webkit-details-marker { display: none; }
.chat-list-filter__advanced > summary::after { color: #6f81a0; content: "⌄"; font-size: 15px; line-height: 1; margin-left: auto; transition: transform .15s ease; }
.chat-list-filter__advanced[open] > summary::after { transform: rotate(180deg); }
.chat-list-filter__advanced > summary span { align-items: center; background: #e8efff; border-radius: 999px; color: #3562bd; display: inline-flex; font-size: 10px; height: 18px; justify-content: center; margin-left: 6px; min-width: 18px; padding: 0 5px; }
.chat-list-filter__fields { display: grid; gap: 8px; margin-top: 9px; }
.chat-list-filter__fields label { color: #596981; display: grid; font-size: 10px; font-weight: 750; gap: 4px; letter-spacing: .035em; text-transform: uppercase; }
.chat-list-filter__fields select { background: #fff; letter-spacing: normal; text-transform: none; }
.chat-list-filter__apply-more { margin-top: 9px; width: 100%; }
.chat-list { display: flex; flex-direction: column; max-height: calc(100vh - 250px); min-height: 0; overflow-y: auto; }
.chat-list-item { border-bottom: 1px solid var(--line); color: inherit; display: flex; flex: 0 0 auto; min-width: 0; padding: 8px 12px; text-decoration: none; transition: background .15s ease, box-shadow .15s ease; }
.chat-list-item:hover { background: #f1f5fb; }
.chat-list-item.active { background: #fff0ed; box-shadow: inset 3px 0 0 var(--accent); }
.chat-list-item__content { display: grid; gap: 1px; min-width: 0; width: 100%; }
.chat-list-item__row { align-items: baseline; display: flex; gap: 6px; justify-content: space-between; line-height: 1.2; min-width: 0; }
.chat-list-item__row strong { color: var(--ink); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list-item__row time { color: var(--muted); flex: 0 0 auto; font-size: 9px; white-space: nowrap; }
.chat-list-item__preview { color: #64728a; font-size: 11px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list-item__meta { color: #8b98ab; font-size: 9px; font-weight: 650; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list-pagination { background: #fbfcff; border-top: 1px solid var(--line); flex: 0 0 auto; padding: 8px 12px; }
.chat-list-pagination .button { justify-content: center; width: 100%; }
.chat-list-pagination--newest { border-top: 0; padding-top: 0; text-align: center; }
.chat-list-pagination__newest { color: #536f9f; font-size: 11px; font-weight: 700; text-decoration: none; }
.chat-list-pagination__newest:hover { color: #284d88; text-decoration: underline; }
.chat-list-empty { margin: auto 0; padding: 38px 20px; text-align: center; }
.chat-list-empty strong { font-size: 14px; }
.chat-list-empty p { font-size: 12px; }

.chat-thread { display: flex; flex-direction: column; min-width: 0; }
.chat-thread__header { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 14px; justify-content: space-between; min-height: 82px; padding: 14px 20px; }
.chat-thread__identity { align-items: center; display: flex; gap: 11px; min-width: 0; }
.chat-thread__header-actions { align-items: center; display: flex; flex: 0 0 auto; gap: 8px; }
.chat-thread__avatar { align-items: center; background: #fff0ed; border-radius: 50%; color: #a3402e; display: inline-flex; flex: 0 0 auto; font-size: 14px; font-weight: 800; height: 40px; justify-content: center; width: 40px; }
.chat-thread__identity h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread__identity p { font-size: 12px; margin-top: 2px; }
.chat-thread__meta { align-items: center; display: flex; flex-wrap: wrap; gap: 3px; }
.chat-channel-inline { align-items: center; color: #53647d; display: inline-flex; flex-wrap: wrap; font-weight: 650; gap: 3px; }
.chat-channel-inline__provider { color: #3865bb; }
.chat-channel-inline__connection { color: #53647d; }
.chat-connection-status { flex: 0 0 auto; }
.chat-connection-status--active { background: #e5f6ed; color: #237649; }
.chat-connection-status--disabled { background: #eef1f5; color: #627089; }
.chat-connection-status--error { background: #fff0ed; color: #b34432; }
.chat-connection-status--archived { background: #f5e9ec; color: #925062; }
.chat-readonly-notice { align-items: flex-start; background: #fff7e8; border-bottom: 1px solid #f3dfaf; color: #805b1d; display: flex; gap: 9px; padding: 11px 20px; }
.chat-readonly-notice__icon { align-items: center; background: #f0c562; border-radius: 50%; color: #62430d; display: inline-flex; flex: 0 0 auto; font-size: 11px; font-weight: 800; height: 17px; justify-content: center; margin-top: 2px; width: 17px; }
.chat-readonly-notice strong { display: block; font-size: 13px; }
.chat-readonly-notice p { color: inherit; font-size: 12px; margin-top: 2px; }
.chat-message-list { align-items: stretch; background: #f7f8fb; display: flex; flex: 1 1 auto; flex-direction: column; gap: 10px; max-height: min(62vh, 700px); min-height: 300px; overflow-y: auto; padding: 20px; }
.chat-message { display: flex; max-width: 84%; }
.chat-message:first-child { margin-top: auto; }
.chat-message--incoming { align-self: flex-start; }
.chat-message--outgoing { align-self: flex-end; }
.chat-message--internal { align-self: center; max-width: 100%; }
.chat-message__bubble { border: 1px solid var(--line); border-radius: 13px 13px 13px 3px; box-shadow: 0 2px 5px rgba(30,42,68,.04); padding: 9px 11px 7px; }
.chat-message--incoming .chat-message__bubble { background: #fff; }
.chat-message--outgoing .chat-message__bubble { background: #eaf3ff; border-color: #cfe0fa; border-radius: 13px 13px 3px 13px; }
.chat-message--internal .chat-message__bubble { background: #fff6df; border-color: #f3ddaa; border-radius: 10px; }
.chat-message__bubble p { color: #2f3d56; font-size: 14px; line-height: 1.45; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-message__bubble p.chat-message__empty-text { color: var(--muted); font-size: 12px; font-style: italic; }
.chat-message__attachments { display: grid; gap: 7px; margin-top: 8px; }
.chat-message__attachment { align-items: center; background: rgba(255,255,255,.72); border: 1px solid #d6e0ee; border-radius: 8px; color: #315cae; display: flex; font-size: 12px; font-weight: 700; gap: 8px; max-width: 280px; overflow: hidden; padding: 6px 8px; text-decoration: none; }
.chat-message__attachment:hover { border-color: #9db8df; text-decoration: underline; }
.chat-message__attachment img { border-radius: 5px; flex: 0 0 auto; height: 38px; object-fit: cover; width: 38px; }
.chat-message__attachment-icon { align-items: center; background: #e4edf9; border-radius: 5px; color: #416da9; display: inline-flex; flex: 0 0 auto; font-size: 14px; height: 30px; justify-content: center; width: 30px; }
.chat-message__attachment-copy { display: grid; gap: 1px; min-width: 0; }
.chat-message__attachment-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-message__attachment-copy small { color: #6d7f99; font-size: 10px; font-weight: 600; }
.chat-message__bubble footer { align-items: center; display: flex; gap: 8px; justify-content: flex-end; margin-top: 5px; }
.chat-message__bubble time, .chat-message__delivery { color: #7c899d; font-size: 10px; }
.chat-message__delivery { color: #5375ad; }
.chat-message__internal-label { align-self: center; color: #87651f; font-size: 10px; font-weight: 750; margin-right: 7px; text-transform: uppercase; }
.chat-thread-empty { align-content: center; display: grid; justify-items: center; margin-block: auto; min-height: 300px; padding: 35px 24px; text-align: center; }
.chat-thread-empty h3 { font-size: 15px; }
.chat-thread-empty p { font-size: 13px; max-width: 350px; }
.chat-thread-empty--large { flex: 1; min-height: 500px; }
.chat-thread-empty--large h2 { margin-top: 12px; }
.chat-thread-empty__icon { align-items: center; background: #e8efff; border-radius: 50%; color: #3562bd; display: inline-flex; font-size: 29px; height: 54px; justify-content: center; transform: rotate(30deg); width: 54px; }
.chat-compose { align-items: flex-end; background: #fff; border-top: 1px solid var(--line); display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) auto; padding: 13px 16px; }
.chat-compose__tools { align-items: end; display: flex; flex-wrap: wrap; gap: 8px 12px; grid-column: 1 / -1; }
.chat-compose__template, .chat-compose__file { color: #69778e; display: grid; font-size: 10px; font-weight: 750; gap: 4px; letter-spacing: .045em; text-transform: uppercase; }
.chat-compose__template select { font-size: 12px; min-height: 33px; padding: 6px 8px; }
.chat-compose__file input { color: #53627b; font-size: 11px; max-width: min(250px, 42vw); padding: 4px 0; }
.chat-compose__template-settings { align-self: end; font-size: 12px; min-height: 33px; padding-top: 7px; }
.chat-compose__sender-note { align-self: end; color: #69778e; font-size: 12px; line-height: 1.35; max-width: 360px; min-height: 33px; padding-top: 7px; }
.chat-compose textarea { max-height: 130px; min-height: 42px; padding-bottom: 9px; padding-top: 9px; }
.chat-compose .button { min-height: 42px; }
.chat-compose__feedback { color: #a33b2e; font-size: 12px; grid-column: 1 / -1; margin: -2px 0 0; }
.chat-compose__feedback[hidden] { display: none; }
.chat-compose--disabled { background: #fbfcfe; }
.chat-compose textarea:disabled, .chat-compose button:disabled { cursor: not-allowed; opacity: .65; }

.chat-details { background: #fbfcff; border-left: 1px solid var(--line); min-width: 0; }
.chat-details__section { border-bottom: 1px solid var(--line); padding: 21px 18px; }
.chat-details__section h2 { font-size: 14px; margin-bottom: 14px; }
.chat-details__section-heading { align-items: flex-start; display: flex; gap: 10px; justify-content: space-between; }
.chat-details__section-heading h2 { margin-bottom: 0; }
.chat-details__section-heading p { font-size: 11px; margin-top: 3px; }
.chat-details-list { display: grid; gap: 12px; margin: 0 0 16px; }
.chat-details-list div { display: grid; gap: 3px; }
.chat-details-list dt { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.chat-details-list dd { color: #34435c; font-size: 13px; margin: 0; overflow-wrap: anywhere; }
.chat-channel-detail__provider { color: #3865bb; font-weight: 700; }
.chat-details__empty { font-size: 12px; }
.chat-customer-association { border-top: 1px solid var(--line); display: grid; gap: 9px; margin-top: 13px; padding-top: 13px; }
.chat-customer-association > p { color: var(--muted); font-size: 11px; line-height: 1.4; margin: 0; }
.chat-customer-association__form { align-items: end; display: grid; gap: 7px; grid-template-columns: minmax(0, 1fr) auto; margin: 0; }
.chat-customer-association__form label { color: #53627b; display: grid; font-size: 11px; font-weight: 700; gap: 4px; min-width: 0; }
.chat-customer-association__form input { font-size: 12px; min-width: 0; padding: 7px 8px; }
.chat-customer-association__form .button { min-height: 33px; padding-left: 9px; padding-right: 9px; }
.chat-customer-tags { margin-top: 14px; padding: 14px 0 0; }
.chat-orders-count { align-items: center; background: #e8efff; border-radius: 999px; color: #3562bd; display: inline-flex; flex: 0 0 auto; font-size: 11px; font-weight: 800; height: 22px; justify-content: center; min-width: 22px; padding: 0 7px; }
.chat-linked-orders { display: grid; gap: 7px; list-style: none; margin: 15px 0 0; padding: 0; }
.chat-linked-order { align-items: center; background: #fff; border: 1px solid #dfe5ee; border-radius: 9px; display: flex; gap: 8px; justify-content: space-between; padding: 9px 10px; text-decoration: none; }
.chat-linked-order:hover { border-color: #c5d2e8; box-shadow: 0 4px 12px rgba(30,42,68,.05); }
.chat-linked-order__main { display: grid; gap: 2px; min-width: 0; }
.chat-linked-order__main strong { color: var(--accent); font-size: 12px; }
.chat-linked-order__main span { color: #586981; font-size: 11px; font-variant-numeric: tabular-nums; }
.chat-linked-order .status { font-size: 10px; padding: 6px 7px; }
.chat-order-create { margin-top: 15px; }
.chat-order-create > summary { list-style: none; width: 100%; }
.chat-order-create > summary::-webkit-details-marker { display: none; }
.chat-order-create[open] > summary { background: var(--accent-dark); }
.chat-order-create__body { background: #f7f9fd; border: 1px solid #dce5f2; border-radius: 9px; margin-top: 9px; padding: 12px; }
.chat-order-create__customer { color: #4c5d77; font-size: 12px; margin: 0; }
.chat-order-create__customer span { color: var(--muted); display: block; font-size: 10px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.chat-order-create__customer strong { color: var(--ink); display: inline; font-size: 13px; }
.chat-order-create__help, .chat-order-create__blocked { font-size: 11px; line-height: 1.45; margin: 7px 0 0; }
.chat-order-create__blocked { color: #805b1d; }
.chat-order-form { display: grid; gap: 10px; margin-top: 12px; }
.chat-order-lines { display: grid; gap: 8px; }
.chat-order-line { background: #fff; border: 1px solid #dfe5ee; border-radius: 8px; display: grid; gap: 8px; padding: 9px; }
.chat-order-line label, .chat-order-note { color: #4d5b72; display: grid; font-size: 11px; font-weight: 700; gap: 5px; }
.chat-order-line select, .chat-order-line input, .chat-order-note textarea { font-size: 12px; padding: 8px 9px; }
.chat-order-line__remove { justify-self: start; }
.chat-order-add { border-style: dashed; justify-self: start; }
.chat-order-actions { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chat-order-actions .button { justify-content: center; min-width: 0; padding-left: 8px; padding-right: 8px; }
.chat-details-empty { align-content: center; color: var(--muted); display: grid; justify-items: center; min-height: 100%; padding: 34px 19px; text-align: center; }
.chat-details-empty span { align-items: center; background: #e8efff; border-radius: 9px; color: #3562bd; display: inline-flex; font-size: 11px; font-weight: 800; height: 34px; justify-content: center; width: 34px; }
.chat-details-empty p { font-size: 12px; }

/* On a wide screen the inbox behaves like a desktop workspace rather than a
   single long document.  Each pane receives the wheel only while it is under
   the pointer, so a long order form cannot push the compose box out of view. */
@media (min-width: 1201px) {
  /* Chats is a working surface, so it uses nearly the entire desktop viewport.
     The three column scroll regions below remain independent. */
  .main-content.chat-page { max-width: none; padding: 12px 20px 14px; }
  .chat-page .topbar { align-items: flex-start; margin-bottom: 10px; min-height: 32px; }
  .chat-page .topbar > div:first-child { min-width: 0; }
  .chat-page .eyebrow { display: none; }
  .chat-page h1 { font-size: 28px; line-height: 1.15; }
  .chat-page .topbar-actions { align-items: flex-start; flex-wrap: nowrap; gap: 6px; }
  .chat-page .topbar-account { align-items: flex-start; gap: 7px; padding-left: 9px; }
  .chat-page .topbar-account > div { gap: 0; }
  .chat-page .topbar-account strong { font-size: 12px; }
  .chat-page .topbar-account span { font-size: 10px; }
  .chat-page .topbar-account .button { font-size: 11px; min-height: 32px; padding-left: 10px; padding-right: 10px; }
  .chat-page .chat-live-controls { flex-wrap: nowrap; gap: 6px; }
  .chat-page .chat-live-status { border-radius: 8px; gap: 7px; min-height: 32px; padding: 4px 8px; }
  .chat-page .chat-live-status__copy { display: block; }
  .chat-page .chat-live-status__copy strong { display: none; }
  .chat-page .chat-live-status__copy span { display: block; font-size: 10px; white-space: nowrap; }
  .chat-page .chat-sync-fallback, .chat-page .chat-templates-link { font-size: 11px; min-height: 32px; padding-left: 10px; padding-right: 10px; }
  .chat-workspace { height: clamp(560px, calc(100vh - 118px), 1200px); min-height: 0; overflow: hidden; }
  .chat-list-pane, .chat-thread { min-height: 0; overflow: hidden; }
  .chat-list { flex: 1 1 auto; max-height: none; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
  .chat-message-list { flex: 1 1 0; max-height: none; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
  .chat-details { min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
  .chat-compose { flex: 0 0 auto; }
  .chat-thread-empty--large { min-height: 0; }
}

/* The sidebar and main-page padding make the content area narrower than the
   browser viewport, so the client card moves below the chat before columns
   become cramped. */
@media (max-width: 1200px) {
  .chat-workspace { grid-template-columns: minmax(230px, .68fr) minmax(0, 1.55fr); min-height: 560px; }
  .chat-resize-handle { display: none !important; }
  .chat-details { border-left: 0; border-top: 1px solid var(--line); display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-details__section { border-bottom: 0; }
  .chat-details__section + .chat-details__section { border-left: 1px solid var(--line); }
  .chat-details-empty { display: none; }
}

.empty-state { padding: 46px 24px; text-align: center; }
.empty-state p { margin-left: auto; margin-right: auto; max-width: 380px; }
.timeline { display: grid; gap: 20px; list-style: none; margin: 4px 0 0; padding: 3px 24px 24px; }
.timeline li { display: grid; gap: 11px; grid-template-columns: 10px 1fr; position: relative; }
.timeline li:not(:last-child)::before { background: #e0e6ef; content: ""; height: calc(100% + 20px); left: 4px; position: absolute; top: 10px; width: 2px; }
.timeline-dot { background: var(--accent); border-radius: 50%; height: 10px; margin-top: 5px; position: relative; width: 10px; }
.timeline p { font-size: 13px; margin-top: 2px; }
.timeline time { color: var(--muted); display: block; font-size: 11px; margin-top: 6px; }
.activity-history-panel { overflow: hidden; }
.activity-history > summary { align-items: center; cursor: pointer; display: flex; justify-content: space-between; list-style: none; min-height: 64px; padding: 15px 24px; user-select: none; }
.activity-history > summary::-webkit-details-marker { display: none; }
.activity-history > summary::after { color: var(--accent); content: "⌄"; font-size: 20px; font-weight: 500; line-height: 1; transition: transform .15s ease; }
.activity-history[open] > summary { border-bottom: 1px solid var(--line); }
.activity-history[open] > summary::after { transform: rotate(180deg); }
.activity-history > summary > span { display: grid; gap: 3px; }
.activity-history > summary strong { color: var(--ink); font-size: 15px; }
.activity-history > summary small { color: var(--muted); font-size: 12px; }
.activity-history__timeline { gap: 16px; padding-bottom: 20px; padding-top: 15px; }
.activity-history__timeline li:not(:last-child)::before { height: calc(100% + 16px); }
.activity-history__meta { color: var(--muted); display: block; font-size: 11px; margin-top: 6px; }
.activity-history__meta time { display: inline; margin-top: 0; }
.activity-history__empty { color: var(--muted); font-size: 13px; margin: 0; padding: 17px 24px 22px; }

/* Customer card: a read-only sales and channel history around one contact. */
.customer-metric-grid { margin-bottom: 22px; }
.customer-metric-money { font-size: clamp(23px, 2.35vw, 31px); white-space: nowrap; }
.metric-card small { color: var(--muted); display: block; font-size: 11px; margin-top: 4px; }
.customer-card-main { display: grid; gap: 22px; min-width: 0; }
.customer-card-grid--without-orders { grid-template-columns: minmax(0, 760px); }
.customer-card-empty { padding: 34px 24px; text-align: center; }
.customer-card-empty strong { display: block; font-size: 15px; }
.customer-card-empty p { font-size: 13px; margin-left: auto; margin-right: auto; max-width: 430px; }
.customer-card-empty--compact { padding-bottom: 22px; padding-top: 7px; }
.customer-contact-card, .customer-conversations-panel { overflow: hidden; }
.customer-detail-list { display: grid; gap: 14px; margin: 0; padding: 0 24px 22px; }
.customer-detail-list div { display: grid; gap: 4px; }
.customer-detail-list dt { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.customer-detail-list dd { color: #34435c; font-size: 14px; margin: 0; overflow-wrap: anywhere; }
.customer-detail-list dd a { color: var(--accent); font-weight: 650; text-decoration: none; }
.customer-detail-list dd a:hover { text-decoration: underline; }
.customer-detail-list__muted { color: var(--muted) !important; }
.customer-responsible-inactive { color: #a76d12; display: inline-block; font-size: 10px; font-weight: 700; margin-left: 5px; }
.customer-responsible-form { align-items: end; border-top: 1px solid var(--line); display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) auto; padding: 15px 24px 17px; }
.customer-responsible-form label { color: #53627b; display: grid; font-size: 12px; font-weight: 650; gap: 6px; min-width: 0; }
.customer-responsible-form select { min-width: 0; }
.customer-responsible-form .button { min-height: 34px; padding-left: 10px; padding-right: 10px; }
.order-responsible-inactive { color: #a76d12; display: inline-block; font-size: 10px; font-weight: 700; margin-left: 5px; }
.order-responsibility-card__data { grid-template-columns: 1fr; }
.order-responsible-form { align-items: end; border-top: 1px solid var(--line); display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) auto; padding: 15px 24px 17px; }
.order-responsible-form label { color: #53627b; display: grid; font-size: 12px; font-weight: 650; gap: 6px; min-width: 0; }
.order-responsible-form select { min-width: 0; }
.order-responsible-form .button { min-height: 34px; padding-left: 10px; padding-right: 10px; }
.customer-tags { border-top: 1px solid var(--line); padding: 15px 24px 19px; }
.customer-tags__heading { align-items: center; display: flex; gap: 8px; justify-content: space-between; }
.customer-tags__heading h3 { font-size: 13px; }
.customer-tags__count { align-items: center; background: #e8efff; border-radius: 999px; color: #3562bd; display: inline-flex; font-size: 10px; font-weight: 800; height: 21px; justify-content: center; min-width: 21px; padding: 0 6px; }
.customer-tag-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 11px 0 0; padding: 0; }
.customer-tag { align-items: center; background: #eef4ff; border: 1px solid #cadcf9; border-radius: 999px; color: #315caa; display: inline-flex; font-size: 11px; font-weight: 700; max-width: 100%; min-width: 0; padding: 4px 5px 4px 9px; }
.customer-tag__filter, .customer-tag__label { color: inherit; min-width: 0; overflow: hidden; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.customer-tag__filter:hover { color: #1d477f; text-decoration: underline; }
.customer-tag form { display: flex; margin: 0; }
.customer-tag__remove { align-items: center; background: transparent; border: 0; border-radius: 50%; color: #5b79a9; cursor: pointer; display: inline-flex; font: inherit; font-size: 15px; height: 18px; justify-content: center; line-height: 1; margin-left: 3px; padding: 0; width: 18px; }
.customer-tag__remove:hover { background: #d9e7fb; color: #a13d2d; }
.customer-tags__empty { font-size: 12px; margin: 8px 0 0; }
.customer-tag-form { display: grid; gap: 7px; grid-template-columns: minmax(0, 1fr) auto; margin: 11px 0 0; }
.customer-tag-form input { font-size: 12px; min-width: 0; padding: 7px 9px; }
.customer-tag-form .button { min-height: 33px; padding-left: 9px; padding-right: 9px; }
.customer-note { border-top: 1px solid var(--line); margin: 0 24px; padding: 15px 0 20px; }
.customer-note strong { font-size: 12px; }
.customer-note p { font-size: 13px; white-space: pre-wrap; }
.customer-merged-profiles { border-top: 1px solid var(--line); padding: 16px 24px 20px; }
.customer-merged-profiles h3 { font-size: 13px; }
.customer-merged-profiles > p { color: var(--muted); font-size: 12px; margin-top: 5px; }
.customer-merged-profiles ul { display: grid; gap: 8px; list-style: none; margin: 12px 0 0; padding: 0; }
.customer-merged-profiles li { background: #f8faff; border: 1px solid #e2e8f1; border-radius: 8px; color: #53627b; display: flex; flex-wrap: wrap; font-size: 12px; gap: 4px 7px; padding: 9px 10px; }
.customer-merged-profiles li strong { color: var(--ink); font-size: 13px; }
.customer-merged-profiles li span { overflow-wrap: anywhere; }
.customer-merged-profiles li span:not(:first-of-type)::before { color: #a5b0c0; content: "·"; margin-right: 7px; }
.customer-merged-profiles li small { color: var(--muted); flex-basis: 100%; font-size: 11px; white-space: pre-wrap; }
.customer-conversation-list { border-top: 1px solid var(--line); display: grid; }
.customer-conversation-item { border-bottom: 1px solid var(--line); color: #53627b; display: grid; gap: 3px; padding: 14px 24px; text-decoration: none; }
.customer-conversation-item:hover { background: #f7f9fd; }
.customer-conversation-item__provider { color: #3865bb; font-size: 11px; font-weight: 750; text-transform: uppercase; }
.customer-conversation-item strong { color: var(--ink); font-size: 14px; }
.customer-conversation-item > span:not(.customer-conversation-item__provider), .customer-conversation-item time { color: var(--muted); font-size: 12px; }
.customer-identities { border-top: 1px solid var(--line); padding: 16px 24px 20px; }
.customer-identities h3 { font-size: 13px; }
.customer-identities ul { display: grid; gap: 7px; list-style: none; margin: 10px 0 0; padding: 0; }
.customer-identities li { color: #53627b; font-size: 12px; overflow-wrap: anywhere; }
.customer-identities li strong { color: #3865bb; }

/* Customer merge intentionally uses a regular page instead of a transient
   modal: an administrator can compare both profiles before a high-impact
   change. These compact cards keep names and counts visible during that step. */
.customer-merge-heading { max-width: 900px; }
.customer-merge-layout { grid-template-columns: minmax(0, 1.25fr) minmax(340px, .9fr); }
.customer-merge-search-form { border-bottom: 1px solid var(--line); }
.customer-merge-candidates { display: grid; }
.customer-merge-candidate { border-bottom: 1px solid var(--line); color: #53627b; display: grid; gap: 3px; padding: 14px 24px; text-decoration: none; }
.customer-merge-candidate:hover { background: #f7f9fd; }
.customer-merge-candidate--selected { background: #fff1ee; box-shadow: inset 3px 0 0 var(--accent); }
.customer-merge-candidate strong { color: var(--ink); font-size: 14px; }
.customer-merge-candidate small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.customer-merge-summary-panel__body, .customer-merge-confirm-panel__body { padding: 0 24px 24px; }
.customer-merge-profile { background: #f8faff; border: 1px solid #e0e7f2; border-radius: 9px; display: grid; gap: 5px; padding: 12px; }
.customer-merge-profile--selected { background: #eef5ff; border-color: #cbdcf8; }
.customer-merge-profile__heading { align-items: center; display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: space-between; }
.customer-merge-profile__heading > div { align-items: baseline; display: flex; flex-wrap: wrap; gap: 6px; }
.customer-merge-profile__heading strong { color: var(--ink); font-size: 14px; }
.customer-merge-profile__heading > span { color: var(--muted); font-size: 11px; }
.customer-merge-profile p { color: #53627b; font-size: 12px; margin: 0; overflow-wrap: anywhere; }
.customer-merge-profile small { color: var(--muted); font-size: 11px; }
.customer-merge-confirm-panel__body { display: grid; gap: 16px; }
.customer-merge-primary-choice { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 9px; margin: 0; padding: 12px; }
.customer-merge-primary-choice legend { color: #4d5b72; font-size: 12px; font-weight: 750; padding: 0 4px; }
.customer-merge-primary-choice label, .customer-merge-confirmation { align-items: flex-start; color: #44536a; cursor: pointer; display: flex; font-size: 13px; gap: 8px; line-height: 1.35; }
.customer-merge-primary-choice input, .customer-merge-confirmation input { accent-color: var(--accent); flex: 0 0 auto; height: 16px; margin: 1px 0 0; min-width: auto; padding: 0; width: 16px; }
.customer-merge-confirmation { border-top: 1px solid var(--line); padding-top: 14px; }

/* Roles deliberately use the same master-detail pattern as status groups:
   an administrator can keep a compact overview at left while changing only
   one role at a time. Permissions are section-level for now, so the wording
   makes it clear that a checkbox grants entry and work in that section. */
.role-settings-heading { max-width: 830px; }
.role-create-panel { margin-bottom: 22px; overflow: visible; }
.role-create-panel > summary { align-items: center; cursor: pointer; display: flex; gap: 16px; justify-content: space-between; list-style: none; padding: 18px 24px; user-select: none; }
.role-create-panel > summary::-webkit-details-marker { display: none; }
.role-create-panel > summary > span:first-child { display: grid; gap: 3px; }
.role-create-panel > summary strong { color: var(--ink); font-size: 15px; }
.role-create-panel > summary small { color: var(--muted); font-size: 13px; }
.role-create-panel[open] > summary { border-bottom: 1px solid var(--line); }
.role-create-panel[open] > summary .button::after { content: "Свернуть"; font-size: 12px; }
.role-create-panel[open] > summary .button { font-size: 0; }
.role-create-form { align-items: end; display: grid; gap: 14px; grid-template-columns: minmax(245px, 1fr) minmax(260px, 1.35fr) auto; padding: 19px 24px 22px; }
.role-create-form label, .role-name-form label { color: #4d5b72; display: grid; font-size: 13px; font-weight: 650; gap: 7px; min-width: 0; }
.role-create-form .form-hint { margin: 0; }
.role-settings-workspace { align-items: start; display: grid; gap: 18px; grid-template-columns: minmax(250px, .6fr) minmax(0, 1.7fr); }
.role-picker { overflow: hidden; }
.role-picker .panel-heading { padding-bottom: 13px; }
.role-picker__list { border-top: 1px solid var(--line); display: grid; max-height: min(63vh, 720px); overflow: auto; }
.role-picker__list > a { align-items: center; border-bottom: 1px solid var(--line); color: inherit; display: flex; gap: 10px; justify-content: space-between; min-width: 0; padding: 13px 15px; text-decoration: none; }
.role-picker__list > a:hover { background: #fbfcff; }
.role-picker__list > a.active { background: #fff0ed; box-shadow: inset 3px 0 0 var(--accent); }
.role-picker__list > a.role-picker__item--archived { background: #fbfcfe; opacity: .8; }
.role-picker__list > a.role-picker__item--archived.active { background: #fff6f4; opacity: 1; }
.role-picker__list > a > span:first-child { display: grid; gap: 4px; min-width: 0; }
.role-picker__list strong { color: var(--ink); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-picker__list small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-picker__meta { align-items: flex-end; color: #69778e; display: grid; flex: 0 0 auto; gap: 3px; justify-items: end; }
.role-picker__meta b, .role-user-count { align-items: center; background: #eef2f8; border-radius: 999px; color: #596981; display: inline-flex; font-size: 10px; font-weight: 800; height: 20px; justify-content: center; min-width: 20px; padding: 0 7px; }
.role-picker__meta i { font-size: 9px; font-style: normal; font-weight: 700; }
.role-picker__empty { padding: 24px; }
.role-picker__empty h3 { font-size: 14px; }
.role-picker__empty p { font-size: 12px; }
.role-detail { min-width: 0; overflow: visible; padding: 22px 24px 24px; }
.role-detail__header { align-items: flex-start; display: flex; gap: 18px; justify-content: space-between; }
.role-detail__header h2 { font-size: 19px; overflow-wrap: anywhere; }
.role-detail__header p { font-size: 13px; max-width: 620px; }
.role-detail__badges { align-items: flex-end; display: grid; flex: 0 0 auto; gap: 7px; justify-items: end; }
.role-admin-access { align-items: flex-start; background: #eff9f3; border: 1px solid #c9e9d5; border-radius: 10px; display: flex; gap: 12px; margin-top: 20px; padding: 16px; }
.role-admin-access__mark { align-items: center; background: #ccefd9; border-radius: 50%; color: #21734a; display: inline-flex; flex: 0 0 auto; font-size: 17px; font-weight: 800; height: 30px; justify-content: center; width: 30px; }
.role-admin-access h3 { color: #21734a; font-size: 14px; }
.role-admin-access p { color: #47735a; font-size: 13px; margin-top: 4px; }
.role-name-form { align-items: end; border-bottom: 1px solid var(--line); display: grid; gap: 12px; grid-template-columns: minmax(230px, .9fr) minmax(230px, 1.1fr) auto; margin-top: 20px; padding: 0 0 20px; }
.role-name-form .form-hint { margin: 0; }
.role-system-note { border-bottom: 1px solid var(--line); margin-top: 20px; padding: 0 0 20px; }
.role-system-note h3 { color: #40506a; font-size: 13px; }
.role-system-note p { font-size: 12px; margin-bottom: 0; }
.role-permissions-form { display: grid; gap: 16px; padding-top: 20px; }
.role-permissions-form__heading { align-items: flex-start; display: flex; gap: 14px; justify-content: space-between; }
.role-permissions-form__heading h3 { font-size: 15px; }
.role-permissions-form__heading p { font-size: 12px; max-width: 590px; }
.role-permissions-form__hint { align-items: center; background: #eef2f8; border-radius: 999px; color: #596981; display: inline-flex; flex: 0 0 auto; font-size: 11px; font-weight: 750; min-height: 25px; padding: 0 9px; white-space: nowrap; }
.role-permission-groups { display: grid; gap: 12px; }
.role-permission-group { border: 1px solid #e0e7f0; border-radius: 10px; margin: 0; min-width: 0; padding: 13px; }
.role-permission-group legend { color: #40506a; font-size: 12px; font-weight: 800; padding: 0 4px; }
.role-permission-group > p { font-size: 11px; margin: 0 0 10px; }
.role-permission-grid { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.role-permission { align-items: flex-start; background: #fbfcff; border: 1px solid #e1e7f0; border-radius: 8px; color: #44536a; cursor: pointer; display: flex; gap: 9px; min-height: 62px; padding: 10px; }
.role-permission:hover { background: #f7f9fd; border-color: #cdd8e7; }
.role-permission--granted { background: #f0f6ff; border-color: #c6d9fb; }
.role-permission input { accent-color: var(--accent); flex: 0 0 auto; height: 16px; margin: 2px 0 0; min-width: auto; padding: 0; width: 16px; }
.role-permission span { display: grid; gap: 3px; min-width: 0; }
.role-permission strong { color: var(--ink); font-size: 12px; }
.role-permission small { color: var(--muted); font-size: 11px; line-height: 1.3; }
.role-permissions-empty { font-size: 13px; margin: 0; }
.role-permissions-form__actions { border-top: 1px solid var(--line); padding-top: 16px; }
.role-detail__archive { border-top: 1px dashed #dfe5ee; margin-top: 22px; padding-top: 17px; }
.role-detail__archive h3 { color: #40506a; font-size: 13px; }
.role-detail__archive p { font-size: 12px; max-width: 620px; }
.role-detail__archive form { margin-top: 11px; }
.role-detail__empty { padding: 24px 0 0; }

/* Tasks: the directory stays table-first for a compact manager workload,
   while the create and detail forms retain the ordinary CRM form rhythm. */
.panel--tasks { overflow: visible; }
/* A single fixed task outlet is shared by every authorised CRM screen. The
   bubble stays small until its bell is opened, so it does not consume the
   manager's working area. */
.task-global-notifications { bottom: 24px; position: fixed; right: 24px; z-index: 50; }
.task-global-notifications__bell { align-items: center; background: #fff; border: 1px solid #ccd9ee; border-radius: 999px; box-shadow: 0 8px 25px rgba(30,42,68,.15); color: #315eaa; cursor: pointer; display: inline-flex; height: 46px; justify-content: center; padding: 0; position: relative; transition: background .15s ease, border-color .15s ease, transform .15s ease; width: 46px; }
.task-global-notifications__bell:hover, .task-global-notifications__bell[aria-expanded="true"] { background: #edf4ff; border-color: #9fbbe7; transform: translateY(-1px); }
.task-global-notifications__bell:focus-visible, .task-notification-toast__close:focus-visible { outline: 3px solid rgba(49,94,170,.32); outline-offset: 3px; }
.task-global-notifications__bell svg { height: 20px; width: 20px; }
.task-global-notifications__count { align-items: center; background: var(--accent); border: 2px solid #fff; border-radius: 999px; color: #fff; display: inline-flex; font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 750; justify-content: center; min-height: 21px; min-width: 21px; padding: 0 5px; position: absolute; right: -5px; top: -6px; }
.task-notification-toast { background: #fff; border: 1px solid #d6e1f2; border-radius: 13px; bottom: 56px; box-shadow: 0 16px 36px rgba(30,42,68,.2); max-height: min(540px, calc(100vh - 108px)); overflow: auto; padding: 0; position: absolute; right: 0; width: min(390px, calc(100vw - 48px)); }
.task-notification-toast[hidden] { display: none; }
.task-notification-toast__heading { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; padding: 15px 15px 12px 17px; }
.task-notification-toast__heading h2 { font-size: 15px; }
.task-notification-toast__actions { align-items: center; display: flex; flex: 0 0 auto; gap: 5px; }
.task-notification-toast__close { background: transparent; border: 0; border-radius: 7px; color: #586984; cursor: pointer; font-size: 23px; height: 31px; line-height: 1; padding: 0; width: 31px; }
.task-notification-toast__close:hover { background: #f1f4f8; color: var(--ink); }
.task-notification-toast__list { display: grid; list-style: none; margin: 0; padding: 0; }
.task-notification-toast__list li { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 12px; justify-content: space-between; padding: 12px 17px; }
.task-notification-toast__list li > div { min-width: 0; }
.task-notification-toast__list strong, .task-notification-toast__list small { display: block; }
.task-notification-toast__list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-notification-toast__list small { color: var(--muted); font-size: 11px; margin-top: 4px; }
.task-notification-toast__empty, .task-notification-toast__state, .task-notification-toast__hint { color: var(--muted); font-size: 12px; line-height: 1.4; margin: 0; padding: 13px 17px; }
.task-notification-toast__state:not(:empty) { background: #f6f9fe; border-bottom: 1px solid var(--line); color: #486384; }
.task-notification-toast__hint { border-top: 1px solid var(--line); font-size: 11px; }
.task-directory-heading { align-items: flex-start; }
.task-directory-heading__actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.task-my-filter { background: #f3f6fd; border: 1px solid #d6e0f3; border-radius: 999px; color: #405d8b; font-size: 12px; font-weight: 700; padding: 7px 10px; text-decoration: none; white-space: nowrap; }
.task-my-filter:hover, .task-my-filter--active { background: #e7efff; border-color: #bfcfec; color: #2f5ca7; }
.filter-grid--tasks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.task-filter-check .check-option { min-height: 41px; }
.tasks-table { min-width: 980px; }
.tasks-table td { vertical-align: top; }
.task-row--overdue td:first-child { box-shadow: inset 3px 0 0 #e0664d; }
.task-source { color: #546f9f !important; font-weight: 650; }
.task-overdue { color: var(--danger-ink) !important; font-weight: 650; }
.task-priority { border-radius: 999px; display: inline-block; font-size: 12px; font-weight: 650; line-height: 1; padding: 7px 9px; white-space: nowrap; }
.task-priority--low { background: #eef1f5; color: #627089; }
.task-priority--normal { background: #edf3ff; color: #456696; }
.task-priority--high { background: #fff3d9; color: #9a6514; }
.task-priority--urgent { background: #fff0ed; color: #b34432; }
.task-links { display: grid; gap: 4px; min-width: 150px; }
.task-links span { color: #53627b; font-size: 12px; }
.task-links .text-link { font-size: 12px; }
.task-empty { border-top: 1px solid var(--line); }
.task-create-panel { margin-top: 22px; overflow: visible; }
.task-form { display: grid; gap: 14px; padding: 4px 24px 24px; }
.task-form--create { align-items: end; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.task-form--edit { align-items: end; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.task-form > label { color: #4d5b72; display: grid; font-size: 12px; font-weight: 700; gap: 6px; min-width: 0; }
.task-form__title, .task-form__description { grid-column: 1 / -1; }
.task-form textarea { line-height: 1.45; resize: vertical; }
.task-form__self-assignee { align-self: center; margin: 0; }
.task-form__conversation-note { grid-column: 1 / -1; margin: 0; }
.task-notification-fields { border: 1px solid #dce5f2; border-radius: 10px; grid-column: 1 / -1; margin: 0; min-width: 0; padding: 12px 13px; }
.task-notification-fields legend { color: #405570; font-size: 12px; font-weight: 700; padding: 0 4px; }
.task-notification-fields > div { display: flex; flex-wrap: wrap; gap: 8px; }
.task-notification-fields > small { color: var(--muted); display: block; font-size: 11px; line-height: 1.4; margin-top: 9px; }
.task-form__actions { grid-column: 1 / -1; }
.task-access-note { margin-top: 22px; }
.task-detail-summary { align-items: flex-start; display: flex; gap: 20px; justify-content: space-between; margin-bottom: 22px; padding: 20px 24px; }
.task-detail-summary__body { min-width: 0; }
.task-detail-summary__body > div { align-items: center; display: flex; flex-wrap: wrap; gap: 7px; }
.task-detail-summary__description { color: #36455f; font-size: 14px; max-width: 820px; white-space: pre-wrap; }
.task-detail-summary__actions { align-items: center; display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 8px; }
.task-detail-summary__actions form { margin: 0; }
.task-meta-list, .task-links-list { display: grid; gap: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 17px 0 0; }
.task-meta-list > div, .task-links-list > div { border-right: 1px solid var(--line); display: grid; gap: 4px; min-width: 0; padding: 0 15px; }
.task-meta-list > div:first-child, .task-links-list > div:first-child { padding-left: 0; }
.task-meta-list > div:last-child, .task-links-list > div:last-child { border-right: 0; }
.task-meta-list dt, .task-links-list dt { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.task-meta-list dd, .task-links-list dd { color: var(--ink); font-size: 13px; font-weight: 650; margin: 0; overflow-wrap: anywhere; }
.task-detail-main { display: grid; gap: 22px; min-width: 0; }
.task-readonly-description__body { color: #36455f; font-size: 14px; line-height: 1.5; padding: 0 24px 22px; white-space: pre-wrap; }
.task-notifications-panel { overflow: hidden; }
.task-notifications-table { min-width: 640px; }
.task-notification-awaiting { color: #80611e; font-size: 12px; font-weight: 650; }
.task-links-panel { overflow: hidden; }
.task-links-list { grid-template-columns: 1fr; margin: 0; padding: 0 24px 18px; }
.task-links-list > div { border-bottom: 1px solid var(--line); border-right: 0; padding: 12px 0; }
.task-links-list > div:last-child { border-bottom: 0; }
.task-history-panel { overflow: hidden; }

/* The group picker consumes part of the content width. Stack it before an
   inline status row would be forced wider than its panel. */
@media (max-width: 1500px) {
  .status-groups-workspace { grid-template-columns: 1fr; }
  .status-group-picker__list { max-height: 290px; }
}

/* Keep direct editing compact on laptops rather than allowing the table-like
   row to overflow horizontally. The numeric order field remains available
   as a keyboard alternative to drag-and-drop. */
@media (max-width: 1240px) {
  .status-directory-list__labels { display: none; }
  .status-directory-row__inner { align-items: start; gap: 9px; grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
  .status-directory-row--reorderable .status-directory-row__inner { grid-template-columns: 24px minmax(0, 1fr); }
  .status-directory-row__form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-directory-row__name { grid-column: 1 / -1; }
  .status-directory-row--reorderable .status-directory-row__form { grid-column: 2; }
  .status-directory-row__state { align-self: end; padding-bottom: 0; }
  .status-directory-row__save { justify-self: start; }
  .status-directory-row__actions { grid-column: 1; margin-left: 0; }
  .status-directory-row--reorderable .status-directory-row__actions { grid-column: 2; }
  .status-directory-row__drag { align-self: start; margin: 7px 0 0; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; overflow: visible; padding: 15px 18px; position: static; }
  .brand { padding-bottom: 15px; }
  .nav { display: flex; overflow-x: auto; }
  .nav a { white-space: nowrap; }
  .nav--service { margin: 14px 0 0; padding-top: 12px; }
  .nav-section-label, .nav-placeholder { flex: 0 0 auto; white-space: nowrap; }
  .sidebar-note { display: none; }
  .main-content { padding: 26px 20px 40px; }
  .two-column, .detail-grid { grid-template-columns: 1fr; }
  .calculator-layout { grid-template-columns: 1fr; }
  .integrations-layout { grid-template-columns: 1fr; }
  .automation-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .automation-stat-grid div:nth-child(3n) { border-right: 1px solid var(--line); }
  .automation-stat-grid div:nth-child(2n) { border-right: 0; }
  .automation-stat-grid div:nth-last-child(-n + 3) { border-bottom: 1px solid var(--line); }
  .automation-stat-grid div:nth-last-child(-n + 2) { border-bottom: 0; }
  .automation-stage2-capabilities, .automation-stage2-data-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .automation-stage2-capabilities > div, .automation-stage2-data-list > div { border-right: 1px solid var(--line); }
  .automation-stage2-capabilities > div:nth-child(n + 3), .automation-stage2-data-list > div:nth-child(n + 3) { border-top: 0; }
  .automation-stage2-capabilities > div:first-child, .automation-stage2-data-list > div:first-child { border-radius: 8px 0 0 0; }
  .automation-stage2-capabilities > div:nth-child(2), .automation-stage2-data-list > div:nth-child(2) { border-radius: 0 8px 0 0; }
  .automation-stage2-capabilities > div:last-child, .automation-stage2-data-list > div:last-child { border-radius: 0 0 8px 8px; }
  .order-item-property-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-item-property-form .button { justify-self: start; }
  .chat-message-list { max-height: 55vh; }
  .filter-grid--products, .filter-grid--orders, .filter-grid--users, .filter-grid--tasks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-form--create, .task-form--edit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-meta-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-meta-list > div:nth-child(2n) { border-right: 0; }
  .task-meta-list > div:nth-child(n + 3) { border-top: 1px solid var(--line); padding-top: 12px; }
  .employee-create-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-management-form--create, .status-management-form--group, .status-management-form--status, .status-management-form--create-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-management-form--create > .button, .status-management-form--group > .button, .status-management-form--status > .button, .status-management-form--create-status > .button { justify-self: start; }
  .status-management-form--directory-create, .status-management-form--group-detail, .status-management-form--group-create-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-directory-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .status-directory-filters .button { justify-self: start; }
  .status-groups-workspace { grid-template-columns: 1fr; }
  .status-group-picker__list { max-height: 290px; }
  .role-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-create-form .form-hint { grid-column: 1 / -1; }
  .role-settings-workspace { grid-template-columns: 1fr; }
  .role-picker__list { max-height: 290px; }
  .chat-template-form--create, .chat-template-form--row { grid-template-columns: minmax(170px, .7fr) minmax(250px, 1.3fr); }
  .chat-template-form__actions { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { justify-content: flex-start; width: 100%; }
  .metric-grid { grid-template-columns: 1fr; }
  .task-detail-summary { display: grid; padding: 17px 18px; }
  .task-detail-summary__actions { justify-content: flex-start; }
  .task-global-notifications { bottom: 16px; right: 16px; }
  .task-notification-toast { bottom: 55px; width: min(390px, calc(100vw - 32px)); }
  .task-notification-toast__list li { align-items: flex-start; flex-direction: column; }
  .task-notification-toast__list li .button { width: 100%; }
  .task-meta-list { grid-template-columns: 1fr; }
  .task-meta-list > div { border-bottom: 1px solid var(--line); border-right: 0; padding: 10px 0; }
  .task-meta-list > div:first-child { padding-top: 0; }
  .task-meta-list > div:last-child { border-bottom: 0; }
  .calculator-context { align-items: flex-start; padding-left: 16px; padding-right: 16px; }
  .calculator-form { padding-left: 16px; padding-right: 16px; }
  .calculator-native-fields { grid-template-columns: 1fr; }
  .calculator-quote { align-items: flex-start; flex-direction: column; padding-left: 16px; padding-right: 16px; }
  .calculator-quote__actions, .calculator-quote__actions form, .calculator-quote__actions .button { width: 100%; }
  .calculator-result__summary > div { border-bottom: 1px solid var(--line); border-right: 0; width: 100%; }
  .calculator-result__summary > div:last-child { border-bottom: 0; }
  .panel-heading, th, td { padding-left: 16px; padding-right: 16px; }
  .form-stack { padding-left: 16px; padding-right: 16px; }
  .form-intro, .order-note, .order-add-item-form { margin-left: 16px; margin-right: 16px; }
  .order-add-item-form { align-items: stretch; flex-direction: column; }
  .order-add-item-form__fields { grid-template-columns: 1fr; }
  .order-add-item-form .button { width: 100%; }
  .order-field-group { padding-left: 16px; padding-right: 16px; }
  .order-fields-grid, .order-data-list, .kiwano-eye-search-form, .kiwano-eye-layout { grid-template-columns: 1fr; }
  .order-field--full { grid-column: auto; }
  .form-actions { padding-left: 16px; padding-right: 16px; }
  .order-field-readonly { padding-left: 16px; padding-right: 16px; }
  .order-data-list--padded { padding-left: 16px; padding-right: 16px; }
  .order-item-property-editor summary { padding-left: 16px; padding-right: 16px; }
  .order-item-property-editor .order-data-list { padding-left: 16px; padding-right: 16px; }
  .order-item-property-form { grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
  .payment-summary { grid-template-columns: 1fr; }
  .payment-summary div { border-bottom: 1px solid var(--line); border-right: 0; }
  .payment-summary div:last-child { border-bottom: 0; }
  .payment-row { align-items: flex-start; flex-direction: column; padding-left: 16px; padding-right: 16px; }
  .filters-panel { padding-left: 16px; padding-right: 16px; }
  .filter-grid, .filter-grid--customers, .filter-grid--products, .filter-grid--orders, .filter-grid--users { grid-template-columns: 1fr; }
  .filter-field--wide { grid-column: auto; }
  .archive-panel { align-items: flex-start; flex-direction: column; }
  .order-source-chat { align-items: flex-start; flex-direction: column; }
  .integration-card, .integration-security-note { margin-left: 0; margin-right: 0; }
  .integration-card { padding-left: 16px; padding-right: 16px; }
  .integration-security-note { margin-left: 16px; margin-right: 16px; }
  .automation-period-form { padding-left: 16px; padding-right: 16px; }
  .automation-observed-note { padding-left: 16px; padding-right: 16px; }
  .automation-metrics { margin-left: 16px; margin-right: 16px; }
  .automation-stat-grid { grid-template-columns: 1fr; }
  .automation-stat-grid div, .automation-stat-grid div:nth-child(3n), .automation-stat-grid div:nth-child(2n) { border-bottom: 1px solid var(--line); border-right: 0; }
  .automation-stat-grid div:last-child { border-bottom: 0; }
  .automation-stage2-section { padding-left: 16px; padding-right: 16px; }
  .automation-stage2-capabilities, .automation-stage2-data-list { grid-template-columns: 1fr; }
  .automation-stage2-capabilities > div, .automation-stage2-data-list > div { border-bottom: 0; border-right: 1px solid var(--line); border-radius: 0; }
  .automation-stage2-capabilities > div:first-child, .automation-stage2-data-list > div:first-child { border-radius: 8px 8px 0 0; }
  .automation-stage2-capabilities > div:last-child, .automation-stage2-data-list > div:last-child { border-bottom: 1px solid var(--line); border-radius: 0 0 8px 8px; }
  .integration-card__main { gap: 9px; }
  .integration-card__main > .status { flex: 0 0 auto; }
  .integration-rename-form { flex-basis: 100%; }
  .integration-token-replace { flex-basis: 100%; }
  .integration-token-replace > summary { width: 100%; }
  .integration-token-form { left: 0; right: auto; width: min(100%, 330px); }
  .employee-create-panel > summary { align-items: flex-start; padding-left: 16px; padding-right: 16px; }
  .employee-create-panel > summary small { display: none; }
  .employee-create-grid { grid-template-columns: 1fr; }
  .employee-create-actions { align-items: stretch; flex-direction: column; }
  .employee-create-actions .button { width: 100%; }
  .user-detail-list, .user-access-summary { padding-left: 16px; padding-right: 16px; }
  .settings-tabs { margin-bottom: 16px; }
  .chat-section-tabs { margin-bottom: 16px; }
  .chat-template-form--create, .chat-template-form--row { grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
  .chat-template-form__actions { grid-column: auto; }
  .chat-template-form__actions .button { flex: 1 1 auto; }
  .chat-template-archive > summary, .chat-template-archive__body { padding-left: 16px; padding-right: 16px; }
  .chat-template-archive__list li { align-items: flex-start; flex-direction: column; }
  .chat-template-archive__list form, .chat-template-archive__list .button { width: 100%; }
  .role-create-panel > summary { align-items: flex-start; padding-left: 16px; padding-right: 16px; }
  .role-create-panel > summary small { display: none; }
  .role-create-form { grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
  .role-create-form .form-hint { grid-column: auto; }
  .role-create-form .button { width: 100%; }
  .role-detail { padding-left: 16px; padding-right: 16px; }
  .role-detail__header { align-items: flex-start; flex-direction: column; }
  .role-detail__badges { align-items: flex-start; justify-items: start; }
  .role-name-form { grid-template-columns: 1fr; }
  .role-permissions-form__heading { align-items: flex-start; flex-direction: column; }
  .role-permission-grid { grid-template-columns: 1fr; }
  .role-permissions-form__actions .button { width: 100%; }
  .status-settings-note { font-size: 12px; }
  .status-group-create > summary { align-items: flex-start; padding-left: 16px; padding-right: 16px; }
  .status-group-create > summary small { display: none; }
  .status-management-form--create, .status-management-form--group, .status-management-form--status, .status-management-form--create-status { grid-template-columns: 1fr; }
  .status-management-form--create { padding-left: 16px; padding-right: 16px; }
  .status-group-card { padding-left: 16px; padding-right: 16px; }
  .status-group-card__header { align-items: flex-start; flex-direction: column; }
  .status-management-form--create > .button, .status-management-form--group > .button, .status-management-form--status > .button, .status-management-form--create-status > .button { width: 100%; }
  .status-directory-create > summary { align-items: flex-start; padding-left: 16px; padding-right: 16px; }
  .status-directory-create > summary small { display: none; }
  .status-management-form--directory-create, .status-management-form--group-detail, .status-management-form--group-create-status, .status-directory-filters { grid-template-columns: 1fr; }
  .status-management-form--directory-create, .status-directory-filters { padding-left: 16px; padding-right: 16px; }
  .status-management-form--directory-create > .button, .status-management-form--group-detail > .button, .status-management-form--group-create-status > .button { width: 100%; }
  .status-directory-list__labels { display: none; }
  .status-directory-row__inner { align-items: start; gap: 9px; grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
  .status-directory-row--reorderable .status-directory-row__inner { grid-template-columns: 24px minmax(0, 1fr); }
  .status-directory-row__form { grid-template-columns: 1fr; }
  .status-directory-row--reorderable .status-directory-row__form { grid-column: 2; }
  .status-directory-row__actions { grid-column: 1; margin-left: 0; }
  .status-directory-row--reorderable .status-directory-row__actions { grid-column: 2; }
  .status-directory-row__state { padding-bottom: 0; }
  .status-directory-row__save { width: 100%; }
  .status-directory-row__drag { align-self: start; margin: 7px 0 0; }
  .status-group-statuses__heading { align-items: flex-start; flex-wrap: wrap; }
  .status-group-statuses__reorder-actions { justify-content: flex-start; margin-left: 0; width: 100%; }
  .status-group-statuses__reorder-actions .button { flex: 1 1 auto; }
  .status-group-detail { padding-left: 16px; padding-right: 16px; }
  .status-group-detail__header { align-items: flex-start; flex-direction: column; }
  .chat-live-controls { align-items: stretch; justify-content: stretch; width: 100%; }
  .chat-live-status { flex: 1 1 100%; }
  .chat-sync-form, .chat-sync-form .button { width: 100%; }
  .chat-workspace { display: flex; flex-direction: column; min-height: 0; }
  .chat-list-pane { border-bottom: 1px solid var(--line); border-right: 0; max-height: 320px; }
  .chat-list { max-height: 188px; }
  .chat-thread { min-height: 480px; }
  .chat-thread__header { align-items: flex-start; padding-left: 16px; padding-right: 16px; }
  .chat-thread__identity { min-width: 0; }
  .chat-thread__identity h2 { max-width: 165px; }
  .chat-connection-status { font-size: 10px; padding: 6px 7px; }
  .chat-readonly-notice { padding-left: 16px; padding-right: 16px; }
  .chat-message-list { max-height: 55vh; padding: 15px; }
  .chat-message { max-width: 92%; }
  .chat-compose { grid-template-columns: 1fr; padding: 12px 16px; }
  .chat-compose .button { width: 100%; }
  .chat-details { display: block; }
  .chat-details__section + .chat-details__section { border-left: 0; border-top: 1px solid var(--line); }
  .customer-tags { padding-left: 16px; padding-right: 16px; }
  .customer-responsible-form { grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
  .customer-responsible-form .button { justify-self: start; }
  .order-responsible-form { grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
  .order-responsible-form .button { justify-self: start; }
  .chat-customer-tags { padding-left: 0; padding-right: 0; }
}
