.crm-board { min-width: 0; }
.crm-board [hidden] { display: none !important; }
.crm-board__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.crm-board__heading > div:first-child { min-width: 0; }
.crm-board__heading > div:first-child > div { display: flex; align-items: center; gap: 10px; }
.crm-board__heading h1 { margin: 5px 0 6px; font-size: clamp(27px, 3vw, 38px); line-height: 1.06; letter-spacing: -.04em; }
.crm-board__heading h1 + span { padding: 4px 9px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 10px; font-weight: 800; }
.crm-board__heading p { max-width: 780px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.crm-board__heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.crm-board__heading-actions button, .crm-reset, .crm-board__pagination button, .crm-board__empty button { min-height: 38px; padding: 8px 12px; color: #314139; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-weight: 750; }
.crm-board__heading-actions button { color: #fff; background: var(--green); border-color: var(--green); }
.crm-board__heading-actions button:disabled { opacity: .5; cursor: wait; }
.crm-board__heading-actions span { flex-basis: 100%; color: var(--muted); font-size: 10px; text-align: right; }
.crm-board__filters { display: grid; grid-template-columns: minmax(240px, 1.6fr) minmax(160px, .7fr) auto auto auto; gap: 9px; align-items: end; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.crm-field { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 9px; font-weight: 750; }
.crm-field input, .crm-field select { width: 100%; height: 38px; padding: 0 10px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.crm-lane-filter { min-width: 190px; margin: 0; padding: 0; border: 0; }
.crm-lane-filter legend { margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 750; }
.crm-lane-filter > div { display: flex; height: 38px; padding: 3px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; }
.crm-lane-filter button { flex: 1; min-width: 54px; color: var(--muted); background: transparent; border: 0; border-radius: 6px; cursor: pointer; font-size: 10px; font-weight: 750; }
.crm-lane-filter button.active { color: var(--green-dark); background: #fff; box-shadow: 0 1px 3px rgba(30,50,39,.12); }
.crm-problems-filter { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; white-space: nowrap; font-size: 10px; font-weight: 700; }
.crm-problems-filter input { width: 16px; height: 16px; accent-color: var(--green); }
.crm-board__source, .crm-board__error { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 10px; }
.crm-board__source { color: var(--muted); }
.crm-board__error { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--red); background: var(--red-soft); border-color: #f2c8c8; }
.crm-board__error button { color: var(--red); background: transparent; border: 0; text-decoration: underline; cursor: pointer; font-weight: 800; }
.crm-board__columns, .crm-board__skeleton { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(244px, 280px); gap: 10px; width: 100%; margin-top: 12px; padding-bottom: 10px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.crm-stage { min-width: 0; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.crm-stage > header { display: flex; min-height: 78px; align-items: flex-start; justify-content: space-between; gap: 11px; padding: 12px 13px; background: #fff; border-bottom: 1px solid var(--line); }
.crm-stage > header h2 { margin: 0; font-size: 14px; }
.crm-stage > header p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.35; }
.crm-stage > header > span { display: grid; min-width: 27px; height: 27px; place-items: center; padding: 0 6px; color: var(--muted); background: var(--surface-soft); border-radius: 999px; font-size: 10px; font-weight: 850; }
.crm-stage--pick_lists > header { box-shadow: inset 4px 0 #98a2b3; }
.crm-stage--assembly > header { box-shadow: inset 4px 0 var(--blue); }
.crm-stage--marking > header { box-shadow: inset 4px 0 var(--violet); }
.crm-stage--ready > header { box-shadow: inset 4px 0 var(--green); }
.crm-stage--to_handoff > header { box-shadow: inset 4px 0 #0e9384; }
.crm-stage--in_delivery > header { box-shadow: inset 4px 0 #1570ef; }
.crm-stage--completed > header { box-shadow: inset 4px 0 #475467; }
.crm-stage__cards { display: grid; gap: 8px; padding: 8px; }
.crm-card { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 2px rgba(30,50,39,.05); }
.crm-card--problem { border-color: #efcf92; }
.crm-card--expanded { box-shadow: 0 8px 22px rgba(30,50,39,.1); }
.crm-card__toggle { width: 100%; padding: 11px; color: var(--ink); background: #fff; border: 0; cursor: pointer; text-align: left; }
.crm-card__head, .crm-card__metrics, .crm-card__problem { display: flex; align-items: center; gap: 7px; min-width: 0; }
.crm-card__head { justify-content: space-between; }
.crm-card__head > span:first-child { min-width: 0; overflow: hidden; font: 800 10px ui-monospace,SFMono-Regular,Menlo,monospace; text-overflow: ellipsis; white-space: nowrap; }
.crm-lane { flex: none; padding: 3px 6px; border-radius: 5px; font-size: 8px; font-weight: 850; }
.crm-lane--fast { color: var(--green-dark); background: var(--green-soft); }
.crm-lane--kiz { color: var(--violet); background: var(--violet-soft); }
.crm-card__metrics { flex-wrap: wrap; margin-top: 9px; color: var(--muted); font-size: 9px; }
.crm-card__metrics span:not(:last-child)::after { content: "·"; margin-left: 7px; }
.crm-card__problem { justify-content: space-between; margin-top: 9px; }
.crm-card__problem > span:last-child { color: var(--green); font-size: 9px; font-weight: 800; }
.crm-problem { display: inline-flex; min-width: 0; align-items: center; gap: 4px; padding: 4px 6px; color: var(--amber); background: var(--amber-soft); border-radius: 6px; font-size: 8px; font-weight: 800; }
.crm-problem--error { color: var(--red); background: var(--red-soft); }
.crm-problem--clear { color: var(--green-dark); background: var(--green-soft); }
.crm-problem__more { padding: 1px 4px; color: #fff; background: currentColor; border-radius: 999px; }
.crm-card__details { padding: 10px; background: #fcfdfc; border-top: 1px solid var(--line); }
.crm-card__actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
.crm-action { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; min-width: 0; padding: 6px 8px; color: var(--green); background: #fff; border: 1px solid #b8d2c7; border-radius: 8px; cursor: pointer; font-size: 9px; font-weight: 820; text-align: center; text-decoration: none; }
.crm-action--primary { grid-column: 1/-1; color: #fff; background: var(--green); border-color: var(--green); }
.crm-action:disabled, .crm-action--disabled { color: #98a2b3; background: #f2f4f7; border-color: var(--line); cursor: not-allowed; }
.crm-action-note, .crm-action-retry { grid-column: 1/-1; font-size: 8px; line-height: 1.35; }
.crm-action-note { color: var(--amber); }
.crm-action-note--error { color: var(--red); }
.crm-action-retry { padding: 0; color: var(--red); background: transparent; border: 0; cursor: pointer; text-align: left; text-decoration: underline; font-weight: 800; }
.crm-card__causes { display: grid; gap: 5px; margin: 9px 0; }
.crm-card__cause { display: flex; justify-content: space-between; gap: 8px; padding: 6px 7px; color: #475467; background: var(--amber-soft); border-radius: 6px; font-size: 8px; }
.crm-card__orders-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 10px 0 5px; }
.crm-card__orders-heading h3 { margin: 0; font-size: 11px; }
.crm-card__orders-heading span { color: var(--muted); font-size: 8px; }
.crm-card__orders { display: grid; max-height: 290px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.crm-order { display: grid; gap: 5px; padding: 7px; border-bottom: 1px solid var(--line); }
.crm-order:last-child { border-bottom: 0; }
.crm-order__main, .crm-order__signals { display: flex; align-items: center; gap: 6px; min-width: 0; }
.crm-order__main { justify-content: space-between; }
.crm-order__main span { font: 750 8px ui-monospace,SFMono-Regular,Menlo,monospace; }
.crm-order__main b { min-width: 0; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.crm-order__signals { flex-wrap: wrap; }
.crm-contour, .crm-muted-state, .crm-work-state { padding: 3px 6px; border-radius: 5px; font-size: 8px; font-weight: 780; }
.crm-contour--fast { color: var(--green-dark); background: var(--green-soft); }
.crm-contour--kiz { color: var(--violet); background: var(--violet-soft); }
.crm-muted-state, .crm-work-state { color: var(--muted); background: var(--surface-soft); }
.crm-work-state--attention { color: var(--red); background: var(--red-soft); }
.crm-inline-action { min-height: 23px; padding: 3px 6px; color: var(--green); background: #fff; border: 1px solid #b8d2c7; border-radius: 6px; cursor: pointer; font-size: 8px; font-weight: 800; }
.crm-card__empty, .crm-card__truncated { color: var(--muted); font-size: 8px; text-align: center; }
.crm-card__empty { padding: 14px 8px; }
.crm-card__truncated { margin: 6px 0 0; }
.crm-board__pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 10px; }
.crm-board__empty { max-width: 520px; margin: 28px auto; padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 13px; text-align: center; }
.crm-board__empty strong { font-size: 17px; }
.crm-board__empty p { margin: 6px 0 14px; color: var(--muted); font-size: 11px; }
.crm-board__skeleton > div { display: grid; gap: 8px; padding: 8px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; }
.crm-board__skeleton i { display: block; height: 96px; background: linear-gradient(90deg,#eef1ef 25%,#f8faf9 45%,#eef1ef 65%); background-size: 300% 100%; border-radius: 8px; animation: crm-shimmer 1.3s linear infinite; }
.crm-print-frame { position: fixed; right: 0; bottom: 0; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }
@keyframes crm-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (max-width: 1080px) { .crm-board__filters { grid-template-columns: minmax(220px,1.3fr) minmax(160px,.7fr) auto; } }
@media (max-width: 720px) { .crm-board__heading { flex-direction: column; } .crm-board__heading-actions { justify-content: flex-start; } .crm-board__heading-actions span { text-align: left; } .crm-board__filters { grid-template-columns: 1fr; } .crm-lane-filter { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .crm-board *, .crm-board *::before, .crm-board *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
