:root {
  --ink: #1b2520;
  --muted: #68736d;
  --line: #dfe5e1;
  --surface: #ffffff;
  --canvas: #f4f6f4;
  --sidebar: #18221d;
  --sidebar-muted: #9daba3;
  --green: #16805b;
  --green-soft: #dff3e9;
  --yellow: #a66d05;
  --yellow-soft: #fff0c8;
  --blue: #2267a6;
  --blue-soft: #e2eef8;
  --coral: #bd503d;
  --coral-soft: #f9e5e0;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(17, 31, 23, 0.06), 0 8px 24px rgba(17, 31, 23, 0.04);
}

/* Label sets and print jobs */
.set-list { display: grid; gap: 10px; }
.set-row { display: grid; grid-template-columns: minmax(180px, 0.8fr) minmax(280px, 1.7fr) auto; align-items: center; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.set-row > div:first-child { display: grid; gap: 4px; }
.set-row small { color: var(--muted); }
.set-sequence { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.set-sequence > span, .set-sequence > div { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.set-sequence > div > span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #e9f4ee; color: #17603a; font-size: 12px; font-weight: 700; }
.set-sequence > div small { color: var(--muted); }
.component-list { display: grid; gap: 10px; }
.component-row { display: grid; grid-template-columns: 30px minmax(240px, 1fr) 110px auto; align-items: end; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.component-row[hidden] { display: none; }
.drag-handle { align-self: center; color: var(--muted); }
.component-actions { display: flex; align-items: center; gap: 6px; padding-bottom: 1px; }
.component-actions > input[type="checkbox"] { display: none; }
.print-validation ul { margin: 8px 0 0; padding-left: 20px; }
.print-validation li + li { margin-top: 5px; }

@media (max-width: 760px) {
  .set-row { grid-template-columns: 1fr; gap: 10px; }
  .component-row { grid-template-columns: 24px minmax(0, 1fr); align-items: center; }
  .component-template, .component-copies, .component-actions { grid-column: 2; }
  .component-actions { padding-bottom: 0; }
}

* { box-sizing: border-box; }
html { font-family: Inter, Arial, sans-serif; color: var(--ink); background: var(--canvas); }
body { margin: 0; min-width: 320px; font-size: 14px; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; stroke-width: 1.8; flex: 0 0 auto; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px; color: #f7faf8; background: var(--sidebar); z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 4px 8px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 6px; font-weight: 700; }
.brand span:last-child { display: grid; gap: 2px; }
.brand strong { font-size: 15px; }
.brand small { color: var(--sidebar-muted); font-size: 11px; }
.nav-list { display: grid; gap: 3px; margin-top: 24px; }
.nav-list + .nav-list { margin-top: 4px; }
.nav-list a { height: 40px; display: flex; align-items: center; gap: 11px; padding: 0 10px; color: #c4cec8; border-radius: 6px; font-weight: 500; }
.nav-list a:hover { color: white; background: #223029; }
.nav-list a.active { color: white; background: #2a3a32; box-shadow: inset 3px 0 var(--green); }
.nav-section-label { margin: 26px 10px 0; color: #718078; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; }
.tariff-compact { display: flex; justify-content: space-between; gap: 8px; padding: 10px; color: #c9d2cd; background: #223029; border-radius: 6px; font-size: 11px; }
.tariff-compact strong { color: #aee4ca; }
.user-menu { width: 100%; min-height: 50px; display: grid; grid-template-columns: 32px 1fr 18px; align-items: center; gap: 9px; padding: 6px 8px; color: white; text-align: left; border: 0; border-top: 1px solid #314039; background: transparent; cursor: pointer; }
.user-menu:hover { background: #223029; }
.user-menu > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.user-menu strong, .user-menu small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu strong { font-size: 12px; }
.user-menu small { color: var(--sidebar-muted); font-size: 10px; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; color: #143024; background: #b9e6ce; border-radius: 50%; font-weight: 700; }

.workspace { min-width: 0; }
.mobile-header { display: none; }
.content { width: min(1420px, 100%); margin: 0 auto; padding: 34px 38px 60px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-header h1 { margin: 2px 0 6px; font-size: 28px; line-height: 1.2; letter-spacing: 0; }
.page-header p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--green) !important; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.action-group { display: flex; gap: 8px; }

.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 6px; font-weight: 600; cursor: pointer; }
.button.primary { color: white; background: var(--green); }
.button.primary:hover { background: #116e4e; }
.button.secondary { color: var(--ink); background: white; border-color: var(--line); }
.button.secondary:hover { background: #f7f9f7; }
.button.danger { color: white; background: var(--danger); }
.button.danger:hover { background: #8f1c13; }
.button.wide { width: 100%; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); background: white; border-radius: 6px; }
.table-action { width: 32px; height: 32px; display: grid; place-items: center; margin-left: auto; color: var(--muted); border-radius: 5px; }
.table-action:hover { color: var(--green); background: var(--green-soft); }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; }
.row-link { color: var(--green); font-weight: 700; }
.row-link:hover { text-decoration: underline; }
.text-link svg { width: 15px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat { min-height: 94px; display: flex; align-items: center; gap: 14px; padding: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.stat:hover { border-color: #bdc8c1; }
.stat > span:last-child { display: grid; gap: 7px; }
.stat small { color: var(--muted); font-size: 12px; }
.stat strong { font-size: 25px; line-height: 1; }
.stat-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 6px; }
.stat-icon.green { color: var(--green); background: var(--green-soft); }
.stat-icon.yellow { color: var(--yellow); background: var(--yellow-soft); }
.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.stat-icon.coral { color: var(--coral); background: var(--coral-soft); }

.section-block { margin-top: 20px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.section-heading h2 { margin: 0 0 4px; font-size: 17px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th { height: 42px; padding: 0 14px; color: #66726b; background: #f8faf8; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
td { height: 54px; padding: 9px 14px; border-bottom: 1px solid #edf0ee; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfb; }
.mono { font-family: Consolas, monospace; font-size: 12px; }
.subline { display: block; max-width: 480px; margin-top: 3px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-row { min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); }
.empty-row svg { width: 24px; height: 24px; }
.empty-block { min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.empty-block h1, .empty-block h3 { color: var(--ink); }
.empty-block svg { width: 34px; height: 34px; color: var(--green); }

.status { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: 4px; color: #49544e; background: #edf0ee; font-size: 11px; font-weight: 600; white-space: nowrap; }
.status-completed, .status-active, .status-paid, .status-received, .status-ready { color: #08613f; background: var(--green-soft); }
.status-processing, .status-printing, .status-running, .status-submitted, .status-queued, .status-pending, .status-partial { color: #805400; background: var(--yellow-soft); }
.status-onboarding, .status-suspended, .status-exhausted, .status-expired { color: #805400; background: var(--yellow-soft); }
.status-failed, .status-rejected, .status-overdue, .status-cancelled, .status-written_off, .status-blocked { color: #982f22; background: var(--coral-soft); }
.status-shipped { color: #155487; background: var(--blue-soft); }
.status-printed { color: #155487; background: var(--blue-soft); }
.status-applied { color: #08613f; background: var(--green-soft); }
.status-api { color: #4a4a5a; background: #eceef2; font-size: 0.72em; }

.toolbar { display: flex; gap: 8px; margin-bottom: 14px; }
.search-field { width: min(520px, 100%); height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 12px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; }
.search-field svg { color: var(--muted); }

.messages { display: grid; gap: 8px; margin-bottom: 18px; }
.message { padding: 11px 13px; color: #155487; background: var(--blue-soft); border-left: 3px solid var(--blue); border-radius: 4px; }
.message.success { color: #08613f; background: var(--green-soft); border-color: var(--green); }
.message.error { color: var(--danger); background: var(--coral-soft); border-color: var(--danger); }

.settings-layout { display: grid; grid-template-columns: minmax(0, 620px) minmax(260px, 360px); gap: 36px; align-items: start; }
.settings-form { display: grid; gap: 18px; padding: 24px; background: white; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.narrow-form { max-width: 660px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.details-list { display: grid; border-top: 1px solid var(--line); }
.details-list div { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.details-list span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.connection-state { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-weight: 600; }
.security-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 42px; align-items: start; }
.security-section { min-width: 0; }
.security-section .settings-form { max-width: none; }
.totp-setup-layout { display: grid; grid-template-columns: minmax(300px, 0.85fr) minmax(340px, 1.15fr); gap: 48px; align-items: start; }
.totp-enrollment, .totp-confirmation { min-width: 0; }
.totp-step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; margin-bottom: 20px; }
.totp-step > span { width: 32px; height: 32px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 50%; font-weight: 700; }
.totp-step h2 { margin: 2px 0 5px; font-size: 17px; }
.totp-step p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.totp-qr { display: block; width: 240px; height: 240px; margin: 0 0 18px 46px; padding: 10px; background: white; border: 1px solid var(--line); image-rendering: pixelated; }
.totp-manual { display: grid; gap: 7px; margin-left: 46px; }
.totp-manual span { color: var(--muted); font-size: 11px; }
.totp-manual code { max-width: 100%; padding: 11px 12px; overflow-wrap: anywhere; background: #edf0ee; border-radius: 5px; font-size: 13px; line-height: 1.6; }

.form-stack { display: grid; gap: 17px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-span { grid-column: 1 / -1; }
.form-field { display: grid; gap: 7px; }
.form-field label { font-size: 12px; font-weight: 600; }
.form-control { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); background: white; border: 1px solid #cfd7d2; border-radius: 5px; outline: 0; }
.form-control:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 128, 91, 0.12); }
.help-text { color: var(--muted); font-size: 10px; line-height: 1.4; }
.error-text { color: var(--danger); font-size: 11px; }
.form-error { padding: 10px 12px; color: var(--danger); background: var(--coral-soft); border-radius: 5px; }
.form-error ul { margin: 0; padding-left: 18px; }

.template-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 14px; }
.template-item { padding: 12px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.label-preview { aspect-ratio: 58 / 40; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); background: #f5f7f5; border: 1px dashed #c7d0ca; border-radius: 4px; }
.label-preview svg { width: 44px; height: 44px; color: var(--ink); }
.label-preview span { font-size: 11px; }
.template-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px 2px; }
.template-meta > div { display: grid; gap: 3px; }
.template-meta small { color: var(--muted); }
.template-actions { display: flex; align-items: center; gap: 7px; }
.document-layout { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 14px; align-items: start; }
.inline-document-form { display: grid; gap: 12px; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.document-list { display: grid; background: white; border: 1px solid var(--line); border-radius: 6px; }
.document-row { min-height: 66px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 38px; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.document-row:last-child { border-bottom: 0; }
.document-row > div:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.document-row span, .document-row small { color: var(--muted); font-size: 11px; }
.document-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 5px; }
.empty-inline { padding: 24px; color: var(--muted); text-align: center; }
.shipment-form { display: grid; gap: 18px; }
.mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode-button { min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 8px 12px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.mode-button.active { color: var(--green); background: var(--green-soft); border-color: #84c7aa; }
.shipment-panel { min-height: 250px; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.kiz-choice-list { max-height: 440px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; }
.kiz-choice-list ul { margin: 0; padding: 0; list-style: none; }
.kiz-choice-list li { border-bottom: 1px solid var(--line); }
.kiz-choice-list li:last-child { border-bottom: 0; }
.kiz-choice-list label { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; }
.kiz-choice-list label:hover { background: #f8faf8; }
.upload-zone { min-height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; border: 1px dashed #aebbb3; border-radius: 5px; text-align: center; }
.upload-zone > svg { width: 36px; height: 36px; color: var(--green); }
.upload-zone > div { display: grid; gap: 5px; }
.upload-zone span { color: var(--muted); font-size: 12px; }
.shipment-footer { position: sticky; bottom: 14px; display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: end; gap: 16px; padding: 14px 16px; color: white; background: var(--sidebar); border-radius: 6px; box-shadow: 0 12px 32px rgba(17,31,23,.22); }
.shipment-footer label { color: #d5ddd8; }
.shipment-summary { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
.shipment-summary > div:nth-child(4) { border-right: 0; }
.editor-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); min-height: 680px; background: white; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.editor-sidebar { display: grid; align-content: start; gap: 18px; padding: 18px; border-right: 1px solid var(--line); background: #fafbfa; }
.editor-fields, .property-panel { display: grid; gap: 12px; }
.size-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.check-row { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 12px; cursor: pointer; }
.check-row input { width: 17px; height: 17px; accent-color: var(--green); }
.panel-label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.element-tools { display: grid; gap: 9px; padding-top: 16px; border-top: 1px solid var(--line); }
.element-tools > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tool-button { min-height: 62px; display: grid; place-items: center; align-content: center; gap: 5px; padding: 6px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; font-size: 10px; }
.tool-button:hover { color: var(--green); border-color: #83bca4; }
.property-panel { padding-top: 16px; border-top: 1px solid var(--line); }
.property-heading { display: flex; align-items: center; justify-content: space-between; }
.danger-icon { color: var(--danger); }
.editor-workspace { min-width: 0; display: grid; grid-template-rows: 42px 1fr; background: #edf1ee; }
.editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; color: var(--muted); background: white; border-bottom: 1px solid var(--line); font-size: 11px; }
.editor-toolbar label { min-width: 0; display: flex; align-items: center; gap: 7px; }
.editor-toolbar select { width: min(380px, 38vw); min-height: 30px; height: 30px; padding: 3px 28px 3px 8px; font-size: 10px; }
.editor-toolbar .snap-toggle { flex: 0 0 auto; cursor: pointer; }
.snap-toggle input { width: 16px; height: 16px; accent-color: var(--green); }
.canvas-stage { min-width: 0; display: grid; place-items: center; padding: 44px; overflow: auto; }
.label-canvas { position: relative; width: min(680px, 90%); background: white; border: 1px solid #b8c2bc; box-shadow: 0 14px 40px rgba(17,31,23,.12); overflow: hidden; }
.canvas-element { position: absolute; display: grid; place-items: center; box-sizing: border-box; padding: 0; color: var(--ink); background: rgba(255,255,255,.8); border: 0; outline: 1px dashed #87958c; cursor: move; overflow: hidden; }
.canvas-element.selected { outline: 2px solid var(--green); box-shadow: 0 0 0 2px rgba(22,128,91,.14); z-index: 2; }
.canvas-element > span { max-width: 100%; font-size: 10px; overflow: hidden; }
.canvas-element .canvas-text { width: 100%; height: 100%; display: block; box-sizing: border-box; padding: 0; white-space: pre; overflow: hidden; font-family: Arial, sans-serif; letter-spacing: 0; }
.resize-handle { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; background: linear-gradient(135deg, transparent 0 45%, var(--green) 46% 58%, transparent 59% 68%, var(--green) 69% 82%, transparent 83%); cursor: nwse-resize; z-index: 3; }
.editor-segmented, .element-align-actions { display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 5px; }
.editor-segmented button, .element-align-actions button { min-height: 34px; display: grid; place-items: center; padding: 5px; color: var(--muted); background: white; border: 0; border-right: 1px solid var(--line); cursor: pointer; }
.editor-segmented button:last-child, .element-align-actions button:nth-child(3n) { border-right: 0; }
.editor-segmented button:hover, .element-align-actions button:hover, .editor-segmented button.active { color: var(--green); background: var(--green-soft); }
.editor-segmented svg, .element-align-actions svg { width: 16px; height: 16px; }
.element-align-actions { grid-template-columns: repeat(3, 1fr); }
.element-align-actions button:nth-child(n+4) { border-top: 1px solid var(--line); }
.snap-guide { position: absolute; display: block; pointer-events: none; background: #e5484d; z-index: 8; }
.snap-guide.vertical { top: 0; bottom: 0; width: 1px; }
.snap-guide.horizontal { left: 0; right: 0; height: 1px; }
.text-overflow-panel { display: grid; gap: 9px; padding: 10px; color: #7d331f; background: #fff3ee; border: 1px solid #efc2b4; border-radius: 5px; }
.text-overflow-panel > div:first-child { display: grid; grid-template-columns: 17px 1fr; align-items: start; gap: 7px; font-size: 11px; line-height: 1.45; }
.text-overflow-panel > div:last-child { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.compact-button { min-height: 34px; padding: 5px 7px; font-size: 10px; }
.matrix-pattern { width: 84%; height: 84%; background-color: white; background-image: linear-gradient(90deg,#18221d 50%,transparent 50%),linear-gradient(#18221d 50%,transparent 50%); background-size: 7px 7px; }
.barcode-pattern { width: 90%; height: 76%; background: repeating-linear-gradient(90deg,#18221d 0 2px,transparent 2px 4px,#18221d 4px 5px,transparent 5px 8px); }
.editor-submit { position: sticky; bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding: 13px 16px; color: white; background: var(--sidebar); border-radius: 6px; box-shadow: 0 12px 32px rgba(17,31,23,.22); }
.editor-submit span { color: #aab8b0; font-size: 11px; }
.control-stats { margin-bottom: 24px; }
.control-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.control-columns > .section-block { min-width: 0; }
.amount-total { color: var(--danger); font-size: 16px; }
.audit-list { display: grid; background: white; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.audit-list > div { min-height: 46px; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 13px; border-bottom: 1px solid var(--line); }
.audit-list > div:last-child { border-bottom: 0; }
.audit-list p { margin: 0; font-size: 12px; }
.audit-list p a { margin-left: 5px; color: var(--green); font-weight: 600; }
.audit-list time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.audit-mark { width: 7px; height: 7px; background: var(--green); border-radius: 50%; }
.compact-audit { box-shadow: none; }
.filter-toolbar { display: grid; grid-template-columns: minmax(260px, 520px) 210px auto; gap: 8px; margin-bottom: 14px; }
.compact-select { min-height: 40px; }
.control-form { max-width: 860px; }
.control-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.control-check { align-self: end; padding: 7px 0; }
.control-check small { display: block; }
.title-line { display: flex; align-items: center; gap: 10px; }
.quick-actions { position: absolute; right: 38px; top: 92px; min-width: 240px; padding: 6px; background: white; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 14px 38px rgba(17,31,23,.16); z-index: 10; }
.quick-actions form { margin: 0; }
.quick-actions button { width: 100%; min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 7px 9px; color: var(--ink); background: transparent; border: 0; border-radius: 4px; text-align: left; cursor: pointer; }
.quick-actions button:hover { background: var(--canvas); }
.danger-text { color: var(--danger) !important; }
.company-facts { display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)) minmax(230px, 1.7fr) minmax(230px, 1.7fr); margin-bottom: 18px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.company-facts > div { min-height: 94px; display: grid; align-content: center; gap: 5px; padding: 14px; border-right: 1px solid var(--line); }
.company-facts > div:last-child { border-right: 0; }
.company-facts span:first-child { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.company-facts strong { font-size: 20px; }
.company-facts small { color: var(--muted); font-size: 10px; }
.company-facts a { width: fit-content; color: var(--green); font-size: 11px; font-weight: 600; }
.company-facts .fact-wide strong { font-size: 13px; }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.row-actions form { margin: 0; }
.success-action { color: var(--green); background: transparent; border: 0; cursor: pointer; }
.invoice-pay-band { max-width: 660px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 14px; padding: 14px 16px; color: white; background: var(--sidebar); border-radius: 6px; }
.invoice-pay-band > div { display: grid; gap: 3px; }
.invoice-pay-band strong { font-size: 20px; }
.invoice-pay-band span { color: #aab8b0; font-size: 11px; }
.kiz-status-strip { display: grid; grid-template-columns: repeat(6, minmax(100px, 1fr)); margin-bottom: 14px; background: white; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.kiz-status-strip a { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 13px; color: var(--muted); border-right: 1px solid var(--line); }
.kiz-status-strip a:last-child { border-right: 0; }
.kiz-status-strip a:hover { background: #f8faf8; }
.kiz-status-strip a.active { color: var(--green); background: var(--green-soft); box-shadow: inset 0 -3px var(--green); }
.kiz-status-strip span { font-size: 11px; }
.kiz-status-strip strong { color: var(--ink); font-size: 18px; }
.select-cell { width: 38px; padding-left: 12px; padding-right: 4px; text-align: center; }
.select-cell input { width: 16px; height: 16px; accent-color: var(--green); }
tr.row-disabled { color: #89928d; background: #fafbfa; }
.kiz-action-band { position: sticky; bottom: 14px; display: grid; grid-template-columns: 72px minmax(180px, .8fr) minmax(180px, 1fr) minmax(220px, 1.4fr) auto; align-items: end; gap: 10px; margin-top: 12px; padding: 12px 14px; color: white; background: var(--sidebar); border-radius: 6px; box-shadow: 0 12px 32px rgba(17,31,23,.22); z-index: 5; }
.kiz-action-band label { color: #d5ddd8; }
.kiz-action-band textarea { min-height: 42px; height: 42px; resize: vertical; }
.selection-counter { min-height: 42px; display: grid; align-content: center; }
.selection-counter strong { font-size: 20px; }
.selection-counter span { color: #aab8b0; font-size: 10px; }
.pagination { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.pagination > div { display: flex; gap: 6px; }
.operation-summary, .kiz-detail-summary { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
.operation-summary > div:nth-child(4), .kiz-detail-summary > div:nth-child(4) { border-right: 0; }
.kiz-code-block { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 16px; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.kiz-code-block > div { min-width: 0; display: grid; gap: 7px; }
.kiz-code-block span:first-child { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.kiz-code-block code { font-family: Consolas, monospace; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.movement-timeline { display: grid; background: white; border: 1px solid var(--line); border-radius: 6px; }
.movement-timeline > div { min-height: 58px; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.movement-timeline > div:last-child { border-bottom: 0; }
.movement-timeline > div > div { display: grid; gap: 4px; }
.movement-timeline small, .movement-timeline time { color: var(--muted); font-size: 10px; }
.movement-dot { width: 10px; height: 10px; border-radius: 50%; background: #aab3ae; }
.movement-dot.status-received, .movement-dot.status-applied { background: var(--green); }
.movement-dot.status-printed, .movement-dot.status-shipped { background: var(--blue); }
.movement-dot.status-written_off { background: var(--danger); }
.movement-filters { display: grid; grid-template-columns: minmax(260px, 1fr) 190px 150px 150px auto; align-items: end; gap: 8px; margin-bottom: 14px; }
.date-filter { display: grid; gap: 5px; }
.date-filter span { color: var(--muted); font-size: 10px; }
.inline-arrow { display: inline-block; width: 14px; margin: 0 4px; vertical-align: middle; color: var(--muted); }
.compact-movements { box-shadow: none; }
.report-table td:not(:first-child) { text-align: center; }
.report-table th:not(:first-child) { text-align: center; }
.billing-layout { display: grid; gap: 26px; }
.order-summary { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); margin-bottom: 18px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.order-summary > div { min-height: 82px; display: grid; align-content: center; gap: 8px; padding: 13px; border-right: 1px solid var(--line); }
.order-summary > div:last-child { border-right: 0; }
.order-summary span:first-child { color: var(--muted); font-size: 11px; }
.notice { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; padding: 13px; border-radius: 5px; }
.notice > div { display: grid; gap: 4px; }
.notice span { font-size: 12px; }
.notice.warning { color: #754c00; background: var(--yellow-soft); }
.notice.danger { color: var(--danger); background: var(--coral-soft); }
.order-form { display: grid; gap: 26px; }
.order-cart-form { display: grid; gap: 18px; }
.order-product-picker, .order-cart-section { display: grid; gap: 14px; padding: 18px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.single-product-entry { display: grid; grid-template-columns: minmax(320px, 1fr) 150px auto; align-items: end; gap: 12px; }
.picker-add { min-width: 126px; margin-bottom: 15px; }
.picker-quantity { margin-bottom: 0; }
.order-cart-list { display: grid; border-top: 1px solid var(--line); }
.order-cart-row { min-height: 62px; display: grid; grid-template-columns: minmax(240px, 1fr) 130px 38px; align-items: center; gap: 14px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.order-cart-product { min-width: 0; }
.order-cart-product strong { display: block; overflow-wrap: anywhere; font-size: 11px; line-height: 1.45; }
.order-cart-quantity { display: grid; align-items: center; text-align: right; font-variant-numeric: tabular-nums; }
.order-cart-quantity input { min-height: 38px; text-align: right; }
.order-cart-empty { border: 1px dashed var(--line); border-radius: 5px; }
.order-cart-empty.attention { color: var(--danger); border-color: var(--danger); }
.order-settings { max-width: 620px; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.order-lines { display: grid; gap: 12px; }
.order-characteristics-toolbar { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; padding: 11px 14px; background: white; border: 1px solid var(--line); border-radius: 6px; z-index: 9; }
.order-characteristics-current { min-width: 0; display: flex; align-items: center; gap: 12px; }
.order-characteristics-current > span { flex: 0 0 auto; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.order-characteristics-current > div { min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.order-characteristics-current > div > span { max-width: 260px; padding: 4px 7px; overflow: hidden; color: #315d4b; background: var(--green-soft); border-radius: 4px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.line-list { display: grid; gap: 8px; }
.order-line { display: grid; grid-template-columns: minmax(260px, 1fr) 150px 42px; align-items: end; gap: 12px; padding: 14px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.product-search { position: relative; display: grid; gap: 5px; }
.product-search-input { position: relative; }
.product-search-input > svg { position: absolute; top: 50%; left: 12px; width: 16px; height: 16px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.product-search-input input { width: 100%; min-height: 42px; padding: 9px 12px 9px 38px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 5px; outline: 0; }
.product-search-input input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.product-search-results { position: absolute; top: 47px; right: 0; left: 0; max-height: 310px; overflow-y: auto; background: white; border: 1px solid #aebdb5; border-radius: 5px; box-shadow: 0 14px 32px rgba(17, 31, 23, 0.18); z-index: 20; }
.product-search-results[hidden], .product-search-selected[hidden] { display: none; }
.product-search-results > button { width: 100%; padding: 10px 12px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); font-size: 11px; line-height: 1.45; text-align: left; cursor: pointer; }
.product-search-results > button > span { display: block; }
.product-search-results > button > small { display: block; margin-top: 3px; color: var(--green); font-size: 10px; font-weight: 700; }
.product-search-results > button:last-child { border-bottom: 0; }
.product-search-results > button:hover, .product-search-results > button:focus { background: var(--green-soft); outline: 0; }
.product-search-empty { padding: 18px 12px; color: var(--muted); font-size: 11px; text-align: center; }
.product-search-selected { display: grid; grid-template-columns: 18px minmax(0, 1fr) 28px; align-items: center; gap: 7px; padding: 7px 8px; color: #315d4b; background: var(--green-soft); border-radius: 5px; }
.product-search-selected > svg { width: 17px; height: 17px; }
.product-search-selected > span { overflow-wrap: anywhere; font-size: 11px; line-height: 1.4; }
.product-search-selected > button { width: 28px; height: 28px; display: grid; place-items: center; color: #315d4b; background: transparent; border: 0; border-radius: 4px; cursor: pointer; }
.product-search-selected > button:hover { background: rgba(49, 93, 75, 0.1); }
.product-search-selected > button svg { width: 15px; height: 15px; }
.product-search-status { color: var(--muted); font-size: 10px; }
.print-settings { display: grid; grid-template-columns: minmax(260px, 0.72fr) minmax(360px, 1.28fr); gap: 20px; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.filename-settings { display: grid; gap: 9px; }
.filename-template-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.filename-template-meta span:last-child { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.filename-field-insert { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 8px; }
.filename-settings > .help-text { margin: 0; }
.archive-rename-form { display: grid; gap: 18px; }
.archive-name-settings { grid-template-columns: minmax(0, 1fr); }
.archive-name-preview .document-row { grid-template-columns: 38px minmax(0, 1fr); }
.archive-name-preview strong { overflow-wrap: anywhere; }
.print-remaining { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.print-remaining.danger, .filename-template-meta .danger { color: var(--danger); font-weight: 700; }
.print-order-line { grid-template-columns: minmax(260px, 1fr) 150px; }
.product-search-selected > button[hidden] { display: none; }
.printable-orders { display: grid; background: white; border: 1px solid var(--line); border-radius: 6px; }
.printable-order-row { min-height: 70px; display: grid; grid-template-columns: minmax(240px, 1fr) 160px auto; align-items: center; gap: 16px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.printable-order-row:last-child { border-bottom: 0; }
.printable-order-row > div { display: grid; gap: 4px; }
.printable-order-row span { color: var(--muted); font-size: 10px; }
.delete-field { display: flex; align-items: center; min-height: 42px; }
.delete-field > input { display: none; }
.remove-line { color: var(--danger); }
.order-submit { position: sticky; bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; background: #17231d; color: white; border-radius: 6px; box-shadow: 0 12px 32px rgba(17, 31, 23, 0.22); }
.order-submit > div { display: grid; gap: 3px; }
.order-submit span { color: #aab8b0; font-size: 11px; }
.order-submit strong, .order-submit strong span { color: white; font-size: 18px; }
.order-submit .order-submit-actions { display: flex; align-items: center; gap: 8px; }
.button.secondary.inverse { color: white; background: transparent; border-color: #607067; }
.button.secondary.inverse:hover { background: rgba(255,255,255,.08); }
.split-order-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.split-order-list > a { min-height: 76px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-content: center; gap: 4px 12px; padding: 11px 13px; color: var(--ink); background: white; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.split-order-list > a:hover, .split-order-list > a.active { background: var(--green-soft); }
.split-order-list > a > span:first-child, .split-order-list small { color: var(--muted); font-size: 10px; }
.split-order-list strong { min-width: 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.split-order-list .status { grid-row: 1 / 3; grid-column: 2; align-self: center; }

.catalog-sync-summary { min-height: 64px; display: grid; grid-template-columns: 38px minmax(220px, 1fr) auto auto 18px; align-items: center; gap: 13px; margin: -10px 0 16px; padding: 10px 14px; background: white; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.catalog-sync-summary:hover { border-color: #b9c6bf; }
.catalog-sync-summary > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.catalog-sync-summary small { color: var(--muted); font-size: 10px; }
.sync-summary-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 5px; }
.sync-summary-counts { color: var(--muted); font-size: 11px; white-space: nowrap; }
.sync-workspace { margin-top: 16px; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.sync-progress-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.sync-progress-heading > div { min-width: 0; }
.sync-progress-heading h2 { margin: 10px 0 0; font-size: 18px; overflow-wrap: anywhere; }
.sync-progress-heading > strong { font-size: 28px; }
.sync-progress-track { height: 9px; margin-top: 16px; overflow: hidden; background: #e8edea; border-radius: 4px; }
.sync-progress-track span { height: 100%; display: block; background: var(--green); border-radius: inherit; transition: width 240ms ease; }
.sync-category-count { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 11px; }
.sync-category-count strong { color: var(--ink); }
.sync-metrics { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 20px; border-top: 1px solid var(--line); }
.sync-metrics > div { min-height: 76px; display: grid; align-content: center; gap: 7px; padding: 12px 14px; border-right: 1px solid var(--line); }
.sync-metrics > div:last-child { border-right: 0; }
.sync-metrics span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.sync-metrics strong { font-size: 22px; }
.catalog-toolbar { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; z-index: 8; }
.catalog-toolbar .toolbar { flex: 1; margin-bottom: 0; }
.column-picker { position: relative; flex: 0 0 auto; }
.column-picker > summary { list-style: none; user-select: none; }
.column-picker > summary::-webkit-details-marker { display: none; }
.column-picker[open] > summary { color: var(--green); border-color: #9dc7b4; }
.picker-chevron { width: 14px; transition: transform 150ms ease; }
.column-picker[open] .picker-chevron { transform: rotate(180deg); }
.column-picker-menu { position: absolute; top: 44px; right: 0; width: min(390px, calc(100vw - 32px)); padding: 12px; background: white; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 18px 45px rgba(17,31,23,.18); z-index: 30; }
.column-search { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; }
.column-search svg { width: 15px; color: var(--muted); }
.column-search input { width: 100%; min-width: 0; border: 0; outline: 0; }
.column-options { max-height: 330px; display: grid; align-content: start; margin-top: 10px; overflow-y: auto; border-top: 1px solid var(--line); }
.column-group-label { position: sticky; top: 0; padding: 10px 8px 6px; color: var(--muted); background: white; font-size: 10px; font-weight: 700; text-transform: uppercase; z-index: 1; }
.column-option { min-height: 35px; display: grid; grid-template-columns: 18px minmax(0,1fr); align-items: center; gap: 8px; padding: 5px 8px; border-radius: 4px; cursor: pointer; }
.column-option:hover { background: #f5f8f6; }
.column-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.column-option span { min-width: 0; line-height: 1.35; overflow-wrap: anywhere; }
.column-picker-actions { display: flex; justify-content: space-between; gap: 8px; padding-top: 11px; border-top: 1px solid var(--line); }
.catalog-table-wrap { overflow: auto; }
.catalog-table { min-width: 760px; table-layout: auto; }
.catalog-table th { max-width: 240px; }
.catalog-table td { min-width: 125px; }
.catalog-table .catalog-expand-cell { width: 44px; min-width: 44px; padding-left: 7px; padding-right: 4px; }
.catalog-table td:nth-child(2) { min-width: 145px; }
.catalog-table .catalog-name-cell { min-width: 260px; max-width: 430px; }
.catalog-table .catalog-data-cell { min-width: 145px; max-width: 280px; overflow-wrap: anywhere; }
.catalog-expand svg { transition: transform 150ms ease; }
.catalog-product-row.expanded { background: #f5f9f7; }
.catalog-product-row.expanded td { border-bottom-color: #d3dfd8; }
.catalog-detail-row:hover { background: transparent; }
.catalog-detail-row > td { padding: 0; background: #f8faf8; border-bottom: 1px solid #cfd9d3; }
.catalog-product-detail { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; padding: 20px; }
.catalog-product-image { width: 132px; height: 132px; display: grid; place-items: center; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 5px; }
.catalog-product-image img { width: 100%; height: 100%; object-fit: contain; }
.catalog-product-overview { min-width: 0; display: grid; gap: 14px; }
.catalog-product-overview > div:first-child { display: grid; gap: 5px; }
.catalog-product-overview > div:first-child > span, .catalog-description > span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.catalog-product-overview > div:first-child > strong { font-size: 16px; line-height: 1.4; }
.catalog-description { display: grid; gap: 5px; }
.catalog-description p { max-width: 980px; margin: 0; color: #4f5b55; line-height: 1.55; }
.catalog-product-facts { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.catalog-product-facts > span { min-width: 0; display: grid; align-content: center; gap: 5px; min-height: 62px; padding: 9px 12px; border-right: 1px solid var(--line); }
.catalog-product-facts > span:last-child { border-right: 0; }
.catalog-product-facts small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.catalog-product-facts strong { font-size: 11px; overflow-wrap: anywhere; }
.catalog-characteristics { padding: 0 20px 20px; }
.catalog-detail-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.catalog-detail-heading span { min-width: 24px; min-height: 20px; display: inline-grid; place-items: center; padding: 2px 6px; color: var(--blue); background: var(--blue-soft); border-radius: 4px; font-size: 10px; font-weight: 700; }
.characteristic-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.characteristic-grid > div { min-height: 58px; display: grid; grid-template-columns: minmax(120px, .9fr) minmax(100px, 1.1fr); align-items: center; gap: 12px; padding: 9px 11px; background: white; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.characteristic-grid > div > span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.characteristic-grid > div > span small { display: block; margin-top: 3px; color: #96a19b; font-size: 8px; text-transform: uppercase; }
.characteristic-grid > div > strong { font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }

.auth-body { min-height: 100vh; background: white; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 42%) minmax(480px, 58%); }
.auth-context { min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; padding: 38px 48px; color: white; background: #17231d; }
.auth-brand { width: fit-content; color: white; }
.auth-context > div:nth-child(2) { max-width: 520px; }
.auth-context h1 { max-width: 500px; margin: 10px 0 16px; font-size: 38px; line-height: 1.18; letter-spacing: 0; }
.auth-context p:not(.eyebrow) { color: #b9c6bf; line-height: 1.6; }
.auth-facts { display: flex; gap: 20px; color: #93a299; font-size: 11px; }
.auth-panel { display: grid; place-items: center; min-width: 0; padding: 38px; background: #f7f9f7; }
.auth-form-wrap { width: min(420px, 100%); }
.register-form { width: min(600px, 100%); }
.auth-heading { margin-bottom: 24px; }
.auth-heading h2 { margin: 5px 0 8px; font-size: 25px; }
.auth-heading > p:last-child { margin: 0; color: var(--muted); line-height: 1.5; }
.auth-switch { margin: 20px 0 0; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--green); font-weight: 600; }
.login-assist { margin-top: -7px; text-align: right; }
.login-assist a { color: var(--green); font-size: 11px; font-weight: 600; }
.state-page { text-align: center; }
.state-page h2 { margin-top: 16px; }
.state-page p { margin-bottom: 24px; color: var(--muted); line-height: 1.6; }
.state-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto; color: var(--green); background: var(--green-soft); border-radius: 50%; font-size: 18px; font-weight: 700; }
.state-icon.danger { color: var(--danger); background: var(--coral-soft); }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(170px, 1fr)); }
  .template-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .auth-context { padding: 32px; }
  .auth-context h1 { font-size: 32px; }
  .order-summary { grid-template-columns: repeat(3, 1fr); }
  .order-summary > div:nth-child(3) { border-right: 0; }
  .order-summary > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -260px; width: 248px; transition: left 160ms ease; box-shadow: 12px 0 30px rgba(0, 0, 0, 0.2); }
  .sidebar.open { left: 0; }
  .mobile-header { height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: white; border-bottom: 1px solid var(--line); }
  .mobile-brand { font-weight: 700; }
  .content { padding: 24px 16px 44px; }
  .page-header { align-items: stretch; flex-direction: column; }
  .page-header .button { width: 100%; }
  .action-group { flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { min-height: 86px; padding: 12px; }
  .stat-icon { width: 34px; height: 34px; }
  .stat strong { font-size: 21px; }
  .settings-layout { grid-template-columns: 1fr; gap: 22px; }
  .security-layout, .totp-setup-layout { grid-template-columns: 1fr; gap: 34px; }
  .order-summary { grid-template-columns: repeat(2, 1fr); }
  .order-summary > div { border-bottom: 1px solid var(--line); }
  .order-summary > div:nth-child(even) { border-right: 0; }
  .order-summary > div:nth-last-child(-n+2) { border-bottom: 0; }
  .order-line { grid-template-columns: 1fr 110px 42px; }
  .single-product-entry { grid-template-columns: minmax(0, 1fr) 110px; }
  .picker-add { grid-column: 1 / -1; width: 100%; margin-bottom: 0; }
  .print-order-line { grid-template-columns: 1fr 110px; }
  .print-settings { grid-template-columns: 1fr; }
  .printable-order-row { grid-template-columns: 1fr auto; }
  .printable-order-row .button { grid-column: 1 / -1; width: 100%; }
  .template-grid { grid-template-columns: 1fr; }
  .document-layout { grid-template-columns: 1fr; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .canvas-stage { padding: 24px; }
  .control-columns { grid-template-columns: 1fr; gap: 0; }
  .company-facts { grid-template-columns: repeat(2, 1fr); }
  .company-facts > div { border-bottom: 1px solid var(--line); }
  .company-facts > div:nth-child(even) { border-right: 0; }
  .company-facts .fact-wide { min-height: 104px; }
  .quick-actions { right: 16px; top: 138px; }
  .auth-layout { display: block; }
  .auth-context { min-height: auto; padding: 20px; }
  .auth-context > div:nth-child(2), .auth-facts { display: none; }
  .auth-panel { min-height: calc(100vh - 88px); padding: 28px 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-span { grid-column: auto; }
  .totp-qr, .totp-manual { margin-left: 0; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat { min-height: 74px; }
  .page-header h1 { font-size: 24px; }
  .order-line { grid-template-columns: 1fr 70px 38px; gap: 7px; padding: 10px; }
  .order-product-picker, .order-cart-section { padding: 12px; }
  .single-product-entry { grid-template-columns: 1fr 88px; gap: 8px; }
  .order-cart-row { grid-template-columns: minmax(0,1fr) 76px 34px; gap: 8px; }
  .order-submit { align-items: stretch; flex-direction: column; }
  .order-submit .order-submit-actions { display: grid; grid-template-columns: 1fr; }
  .order-submit-actions .button { width: 100%; }
  .print-order-line { grid-template-columns: 1fr 70px; }
  .order-characteristics-toolbar { align-items: stretch; flex-direction: column; }
  .order-characteristics-current { align-items: flex-start; flex-direction: column; gap: 7px; }
  .filename-field-insert { grid-template-columns: 1fr; }
  .filename-field-insert .button { width: 100%; }
  .order-submit { bottom: 8px; }
  .mode-switch { grid-template-columns: 1fr; }
  .shipment-footer { grid-template-columns: 1fr; }
  .shipment-footer .button { width: 100%; }
  .document-row { grid-template-columns: 34px minmax(0,1fr) 36px; }
  .document-row > .status { display: none; }
  .editor-submit { align-items: stretch; flex-direction: column; }
  .editor-submit .button { width: 100%; }
  .filter-toolbar { grid-template-columns: 1fr; }
  .control-form-grid { grid-template-columns: 1fr; }
  .catalog-toolbar { align-items: stretch; flex-direction: column; }
  .catalog-toolbar .toolbar { width: 100%; }
  .column-picker > summary { width: 100%; }
  .column-picker-menu { position: fixed; top: 74px; right: 16px; left: 16px; width: auto; max-height: calc(100vh - 94px); }
  .column-options { max-height: calc(100vh - 250px); }
  .catalog-product-detail { grid-template-columns: 1fr; }
  .catalog-product-image { width: 110px; height: 110px; }
  .catalog-product-facts { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
  .catalog-product-facts > span { border-bottom: 1px solid var(--line); }
  .catalog-product-facts > span:nth-child(even) { border-right: 0; }
  .characteristic-grid { grid-template-columns: 1fr; }
  .catalog-sync-summary { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .catalog-sync-summary .sync-summary-counts, .catalog-sync-summary > svg { display: none; }
  .sync-metrics { grid-template-columns: repeat(2, 1fr); }
  .sync-metrics > div { border-bottom: 1px solid var(--line); }
  .sync-metrics > div:nth-child(even) { border-right: 0; }
  .sync-metrics > div:last-child { border-bottom: 0; }
  .invoice-pay-band { align-items: stretch; flex-direction: column; }
  .invoice-pay-band .button { width: 100%; }
  .kiz-status-strip { grid-template-columns: repeat(2, 1fr); }
  .kiz-status-strip a { border-bottom: 1px solid var(--line); }
  .kiz-action-band { position: static; grid-template-columns: 1fr; }
  .kiz-action-band .button { width: 100%; }
  .operation-summary, .kiz-detail-summary { grid-template-columns: repeat(2, 1fr); }
  .movement-filters { grid-template-columns: 1fr 1fr; }
  .movement-filters .search-field { grid-column: 1 / -1; }
  .movement-filters .button { grid-column: 1 / -1; }
}

/* --- Электронный знак: отчёты, отгрузки, контрагенты --- */
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stack-form { display: grid; gap: 18px; max-width: 960px; }
.panel { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat-card { display: grid; gap: 5px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.stat-card span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
.stat-card strong { font-size: 17px; line-height: 1.2; }
.form-footer { display: flex; justify-content: flex-end; gap: 10px; }
.eas-row { padding: 12px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; }
.eas-row-head { display: grid; grid-template-columns: 1.2fr 1fr 1fr 36px; gap: 8px; align-items: center; }
.eas-docs { display: grid; gap: 8px; margin-top: 10px; }
.eas-doc { display: grid; grid-template-columns: 1.4fr 1.4fr 150px 36px; gap: 8px; align-items: center; }
@media (max-width: 720px) { .eas-row-head, .eas-doc { grid-template-columns: 1fr; } }
.eas-saved { margin-top: 8px; max-width: 420px; }
.panel .stack-form.inner { gap: 12px; }
.nested-row td { color: var(--muted); font-size: 12px; }
