:root {
  --ink: #17221f;
  --muted: #66716d;
  --paper: #f3f1eb;
  --surface: #ffffff;
  --line: #dcded8;
  --brand: #17362f;
  --brand-soft: #e6efec;
  --accent: #de8b38;
  --accent-soft: #fff2e3;
  --danger: #bb493e;
  --danger-soft: #fbece9;
  --success: #287861;
  --shadow: 0 18px 45px rgba(24, 48, 42, 0.09);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(222, 139, 56, 0.09), transparent 28rem),
    linear-gradient(180deg, #f8f7f3 0, var(--paper) 42rem);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.password-field { position: relative; display: block; }
.password-field input { width: 100%; padding-right: 48px; }
.password-toggle { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; position: absolute; top: 50%; right: 4px; transform: translateY(-50%); border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; }
.password-toggle:hover, .password-toggle.is-visible { color: var(--brand); background: var(--brand-soft); }
.password-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(222, 139, 56, 0.45);
  outline-offset: 3px;
}

.topbar {
  height: 78px;
  padding: 0 clamp(20px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(23, 54, 47, 0.1);
  background: rgba(248, 247, 243, 0.86);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}

/* Working modules use the page title as their header. Keep the module drawer
   available without reserving a separate branded row. */
.module-topbar {
  height: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  position: relative;
  overflow: visible;
}
.module-topbar .brand { display: none; }
.module-topbar .module-menu-trigger {
  position: absolute;
  top: 8px;
  right: clamp(10px, 2vw, 24px);
  min-height: 40px;
  z-index: 25;
}
.production-page .module-topbar {
  width: auto;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  position: absolute;
  top: 86px;
  right: max(58px, calc((100vw - 1180px) / 2 + 42px));
  z-index: 25;
  overflow: visible;
}
.production-page .module-topbar .module-menu-trigger {
  position: static;
  top: auto;
  right: auto;
}
.production-context-back { min-height: 44px; white-space: nowrap; }
.production-page .module-topbar .tablet-logout { min-height: 44px; margin-left: 0; }
.production-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.production-card-title { min-width: 0; }
.production-card-navigation { flex: 0 0 auto; }
.production-card-navigation .module-topbar {
  width: auto;
  height: 44px;
  position: static;
  inset: auto;
  justify-content: flex-end;
}
.active-work-view .module-topbar {
  right: max(16px, calc((100vw - 920px) / 2));
}
.production-detail-view .active-work-header { padding-right: 285px; }

/* Module landing pages do not repeat self-evident explanations below their
   titles. Field-level hints inside forms remain visible. */
.board-heading .lede,
.admin-intro > div > p:not(.eyebrow),
.shipments-intro p:not(.eyebrow),
.payroll-intro > div > p:not(.eyebrow),
.access-admin-shell .admin-intro p:not(.eyebrow) {
  display: none;
}

.brand {
  color: var(--brand);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand > span:last-child { display: grid; line-height: 1; gap: 5px; }
.brand strong { letter-spacing: 0.17em; font-size: 15px; }
.brand small { color: var(--muted); font-size: 12px; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--brand);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 9px;
  box-shadow: 0 8px 22px rgba(23, 54, 47, 0.2);
}

.brand-mark i { display: block; width: 5px; background: #fff; border-radius: 2px; }
.brand-mark i:nth-child(1) { height: 11px; opacity: 0.65; }
.brand-mark i:nth-child(2) { height: 19px; }
.brand-mark i:nth-child(3) { height: 15px; background: var(--accent); }

.quiet-link {
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 12px;
}

.quiet-link:hover { background: var(--brand-soft); }

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 16px auto 48px;
}

.card, .admin-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(23, 54, 47, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.work-card { width: min(920px, 100%); margin-inline: auto; padding: clamp(24px, 5vw, 48px); min-height: 570px; }

.board-card { padding: clamp(18px, 2.5vw, 28px); }
.board-heading { display: block; margin-bottom: 14px; }
.production-page .board-heading { padding-right: 155px; }
.production-detail-view .board-heading { padding-right: 285px; }
.board-heading .eyebrow { display: none; }
.board-heading h1 { margin-bottom: 2px; font-size: clamp(24px, 2.5vw, 30px); }
.board-heading .lede { max-width: 720px; }

.section-board-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.section-panel { min-width: 0; border: 1px solid var(--line); border-radius: 19px; background: #fafaf7; overflow: hidden; }
.section-panel-head { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border-bottom: 1px solid var(--line); background: #fff; }
.section-panel-head h2 { margin: 3px 0 0; font-size: 24px; }
.section-kicker { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.open-work-list { display: grid; gap: 9px; padding: 11px; }
.open-work-card { width: 100%; min-height: 126px; display: grid; justify-items: start; gap: 5px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease; }
.open-work-card:hover { border-color: #a9b5b0; transform: translateY(-1px); box-shadow: 0 7px 18px rgba(23, 54, 47, 0.08); }
.open-work-card > strong { font-size: 17px; }
.open-work-card > span:not(.work-status) { color: var(--ink); line-height: 1.35; }
.open-work-card > small { color: var(--muted); line-height: 1.35; }
.work-status { display: inline-flex; align-items: center; gap: 7px; color: var(--success); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: 0.045em; }
.work-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(40, 120, 97, 0.1); }
.open-work-card.is-paused { border-color: rgba(222, 139, 56, 0.42); background: #fffaf3; }
.open-work-card.is-paused .work-status { color: #a45e18; }
.open-work-card.is-paused .work-status i { background: var(--accent); box-shadow: 0 0 0 4px rgba(222, 139, 56, 0.12); }
.section-empty { min-height: 126px; display: grid; place-items: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; background: rgba(255,255,255,0.55); font-size: 13px; }
.new-work-btn { width: calc(100% - 22px); min-height: 54px; margin: 0 11px 11px; border: 0; border-radius: 13px; background: var(--brand-soft); color: var(--brand); font-weight: 850; cursor: pointer; }
.new-work-btn:hover { background: #d7e8e2; }
.board-footnote { margin: 19px 2px 0; color: var(--muted); font-size: 12px; }
.section-selector-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; }
.section-selector { min-height: 102px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 16px; padding: 17px 18px; background: #fff; color: var(--ink); text-align: center; cursor: pointer; transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease; }
.section-selector:hover { border-color: #a9b5b0; transform: translateY(-1px); box-shadow: 0 7px 18px rgba(23, 54, 47, 0.08); }
.section-selector > span { font-size: 18px; font-weight: 850; line-height: 1.2; }
.selected-section-actions { display: flex; align-items: center; justify-content: flex-start; margin-bottom: 12px; }
.selected-new-work { width: auto; min-height: 48px; margin: 0; padding: 10px 18px; border-radius: 13px; }
.section-work-list { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); padding: 0; }
.section-work-list .open-work-card { min-height: 108px; }
.section-work-list .section-empty { grid-column: 1 / -1; min-height: 180px; }

.step-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.production-detail-view .step-header { padding-right: 285px; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(30px, 5vw, 48px); line-height: 1.05; letter-spacing: -0.035em; }
h2 { margin-bottom: 8px; font-size: clamp(26px, 4vw, 38px); line-height: 1.1; letter-spacing: -0.025em; }
h3 { margin-bottom: 5px; font-size: 17px; }
.lede { color: var(--muted); margin-bottom: 0; font-size: 16px; line-height: 1.55; }

.back-btn, .icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  min-height: 44px;
  padding: 0 15px;
  font-weight: 700;
  cursor: pointer;
}

.back-btn:hover, .icon-button:hover { border-color: #aeb7b2; background: #fafaf8; }

.selection-trail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 26px;
}

.trail-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.option-grid.sections { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.employee-choice-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.employee-choice-column, .employee-choice-unassigned { min-width: 0; }
.employee-choice-unassigned h2 { margin: 0 0 10px; font-size: 14px; font-weight: 850; text-align: center; color: var(--muted); }
.employee-choice-column .option-grid { grid-template-columns: 1fr; }
.employee-choice-unassigned { margin-top: 18px; }
.sku-picker { display: grid; gap: 18px; }
.sku-search { display: grid; gap: 8px; max-width: 620px; color: var(--muted); font-size: .9rem; font-weight: 700; }
.sku-search input { width: 100%; min-height: 54px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); font: inherit; font-size: 1rem; }
.sku-search input:focus { border-color: var(--accent); outline: 3px solid rgba(38, 111, 92, .14); }
.legacy-sku-warning { display: grid; gap: 16px; margin: 22px 0; padding: 20px; border: 2px solid #e4a94f; border-radius: 18px; background: #fff8e8; }
.legacy-sku-warning h2, .legacy-sku-warning p { margin: 0; }

.option-card {
  border: 1px solid var(--line);
  border-radius: 17px;
  min-height: 86px;
  padding: 18px 19px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  font-weight: 750;
  line-height: 1.3;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.option-card:hover { border-color: #a9b5b0; transform: translateY(-2px); box-shadow: 0 9px 24px rgba(23, 54, 47, 0.08); }

.section-card { min-height: 132px; align-items: flex-end; font-size: 19px; position: relative; overflow: hidden; }
.section-card::before {
  content: "";
  position: absolute;
  width: 48px;
  height: 48px;
  top: 17px;
  left: 18px;
  border: 8px solid var(--brand-soft);
  border-radius: 14px;
  transform: rotate(8deg);
}
.section-card:nth-child(2)::before { border-radius: 50%; border-color: var(--accent-soft); }
.section-card:nth-child(3)::before { border-radius: 8px 18px 8px 18px; }

.quantity-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr); gap: 18px; }
.quantity-panel, .estimate-panel { border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.quantity-panel label { display: block; font-weight: 800; margin-bottom: 14px; }
.quantity-control { display: grid; grid-template-columns: 58px minmax(80px, 1fr) 58px; gap: 10px; }
.quantity-control button {
  border: 0;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 26px;
  cursor: pointer;
}
.quantity-control input {
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
  color: var(--ink);
  font-size: 30px;
  font-weight: 800;
}
.hint { margin: 13px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.estimate-panel { background: var(--brand-soft); border-color: transparent; }
.estimate-panel small { display: block; color: var(--muted); margin-bottom: 8px; }
.estimate-value { font-size: clamp(28px, 5vw, 42px); font-weight: 800; letter-spacing: -0.03em; }

.primary-btn, .danger-btn, .warning-btn, .secondary-btn {
  border: 0;
  border-radius: 16px;
  min-height: 64px;
  padding: 15px 22px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 150ms ease, transform 150ms ease;
}
.primary-btn { background: var(--brand); color: #fff; }
.warning-btn { background: var(--accent); color: #2b1c0d; }
.danger-btn { background: var(--danger); color: #fff; }
.secondary-btn { background: var(--brand-soft); color: var(--brand); }
.primary-btn:hover, .danger-btn:hover, .warning-btn:hover, .secondary-btn:hover { filter: brightness(0.96); transform: translateY(-1px); }
.primary-btn:disabled, .danger-btn:disabled, .warning-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.full-width { width: 100%; margin-top: 22px; }

.status-line { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 800; color: var(--success); }
.status-dot { width: 10px; height: 10px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 5px rgba(40, 120, 97, 0.12); }
.status-line.pause { color: var(--accent); }
.status-line.pause .status-dot { background: var(--accent); box-shadow: 0 0 0 5px rgba(222, 139, 56, 0.13); }

.current-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  margin: 25px 0;
}
.current-item { padding: 19px; background: #fff; }
.current-item small { display: block; color: var(--muted); margin-bottom: 7px; }
.current-item strong { font-size: 17px; line-height: 1.35; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.action-grid button { min-height: 94px; font-size: 18px; }
.blocking-note { color: var(--danger); margin: 12px 0 0; font-size: 13px; font-weight: 700; }

.pause-banner { border-radius: 18px; background: var(--accent-soft); padding: 22px; margin: 24px 0; border: 1px solid rgba(222, 139, 56, 0.22); }
.pause-banner p { margin: 4px 0 16px; color: #76502b; }
.pause-banner .warning-btn { width: 100%; }

.summary-hero { background: var(--brand); color: #fff; padding: 24px; border-radius: 19px; margin-bottom: 18px; }
.production-detail-view .summary-hero { padding-right: 285px; }
.summary-hero p { margin-bottom: 0; color: rgba(255,255,255,0.72); }
.summary-hero h2 { margin: 3px 0 8px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.metric { border: 1px solid var(--line); border-radius: 15px; padding: 17px; background: #fff; }
.metric small { display: block; color: var(--muted); margin-bottom: 7px; }
.metric strong { font-size: 22px; }
.variance.good { color: var(--success); }
.variance.bad { color: var(--danger); }
.summary-actions { display: flex; gap: 12px; margin-top: 22px; }
.summary-actions > * { flex: 1; text-align: center; text-decoration: none; display: grid; place-items: center; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(11, 28, 24, 0.58);
  display: grid;
  place-items: center;
  --modal-pad: 16px;
  --modal-screen-gap: 12px;
  padding: var(--modal-screen-gap);
  overflow: hidden;
}
.modal-card {
  width: min(var(--modal-width, 560px), 100%);
  min-width: 0;
  min-height: 0;
  max-height: calc(100vh - 2 * var(--modal-screen-gap));
  max-height: calc(100dvh - 2 * var(--modal-screen-gap));
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 16px;
  background: #fff;
  padding: var(--modal-pad);
  box-shadow: 0 24px 70px rgba(0,0,0,0.25);
}
.modal-head { position: sticky; top: 0; z-index: 8; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; padding-bottom: 8px; background: #fff; }
.modal-head > :first-child { min-width: 0; }
.modal-head h2 { margin: 0; font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.modal-head > button { flex-shrink: 0; }
.modal-card-compact { --modal-width: 480px; }
.modal-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.modal-form-grid > * { min-width: 0; }
.modal-form-grid > label { display: grid; gap: 4px; }
.modal-field-full { grid-column: 1 / -1; }
.reason-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.reason-choice input { position: absolute; opacity: 0; pointer-events: none; }
.reason-choice span { min-height: 56px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 13px; padding: 13px; cursor: pointer; font-weight: 700; }
.reason-choice input:checked + span { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.comment-field { margin-top: 16px; }
.comment-field label { display: block; font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.comment-field textarea { width: 100%; min-height: 96px; resize: vertical; border: 1px solid var(--line); border-radius: 13px; padding: 13px; }

.loading-card { min-height: 220px; display: grid; place-items: center; align-content: center; gap: 15px; color: var(--muted); }
.loader { width: 35px; height: 35px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { color: var(--muted); text-align: center; padding: 50px 20px; }

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 25px;
  transform: translate(-50%, 25px);
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 13px 18px;
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  max-width: min(520px, calc(100% - 32px));
  text-align: center;
  box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: #812d27; }

.admin-shell { width: min(1180px, calc(100% - 32px)); margin: 10px auto 48px; }
.admin-intro { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 12px; }
.admin-intro .eyebrow { margin-bottom: 3px; }
.admin-intro h1 { margin-bottom: 2px; }
.admin-intro h1 { font-size: clamp(26px, 3vw, 34px); }
.admin-intro p:not(.eyebrow) { color: var(--muted); max-width: 720px; line-height: 1.55; margin-bottom: 0; }
.prototype-badge { white-space: nowrap; color: var(--brand); background: var(--brand-soft); padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.tabs { display: flex; gap: 7px; margin-bottom: 13px; overflow-x: auto; padding-bottom: 2px; }
.statistics-mode .tabs { display: flex; }
.is-initializing .admin-intro, .is-initializing .tabs { visibility: hidden; }
.tab { white-space: nowrap; border: 1px solid var(--line); background: rgba(255,255,255,0.7); color: var(--muted); border-radius: 12px; padding: 8px 14px; font-weight: 800; cursor: pointer; }
.tab.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.admin-card { overflow: hidden; min-height: 400px; }
.admin-card-head { padding: 25px 27px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.admin-card-head h2 { font-size: 25px; margin-bottom: 4px; }
.admin-card-head p { margin: 0; color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
.sticky-table-wrap { max-height: min(68vh, 720px); overflow: auto; overscroll-behavior: contain; }
.sticky-table-wrap > table { border-collapse: separate; border-spacing: 0; }
.sticky-table-wrap > table > thead > tr > th { position: sticky; top: 0; z-index: 3; background: #f2f2ee; box-shadow: 0 1px var(--line); }
table { border-collapse: collapse; width: 100%; min-width: 730px; }
th, td { padding: 10px 14px; border-bottom: 1px solid #e9eae5; text-align: left; vertical-align: middle; }
th { background: #fafaf8; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; }
td { font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcfa; }
.section-label { color: var(--brand); font-weight: 800; }
.edit-cell { display: flex; align-items: center; gap: 8px; }
.edit-cell input { width: 98px; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-weight: 800; }
.matrix-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 14px 7px; }
.matrix-head h2 { margin: 0; font-size: 22px; }
.matrix-head p { display: none; }
.matrix-add-button { flex: 0 0 auto; min-width: 128px; }
.matrix-head-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 10px; }
.matrix-head-action { width: 180px; min-height: 36px; padding: 6px 13px; white-space: nowrap; }
.matrix-section-tabs { display: flex; gap: 7px; overflow-x: auto; padding: 0 14px 7px; }
.matrix-section-tabs button { min-width: 135px; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 12px; padding: 7px 11px; background: #fff; color: var(--ink); text-align: left; font-weight: 850; cursor: pointer; }
.matrix-section-tabs button small { color: var(--muted); font-size: 9px; font-weight: 700; }
.matrix-section-tabs button.is-active { border-color: var(--brand); background: var(--brand); color: #fff; }
.matrix-section-tabs button.is-active small { color: rgba(255,255,255,.7); }
.matrix-name-link { border: 0; padding: 0; background: transparent; color: inherit; font: inherit; font-weight: 800; cursor: pointer; text-align: left; }
.matrix-name-link:hover { color: var(--brand); text-decoration: underline; }
.reference-drag-handle { display: inline-grid; min-width: 26px; min-height: 28px; margin-right: 6px; place-items: center; border-radius: 8px; color: var(--muted); font-size: 17px; font-weight: 900; cursor: grab; user-select: none; touch-action: none; }
.reference-drag-handle:hover { background: var(--brand-soft); color: var(--brand); }
.reference-drag-handle:active { cursor: grabbing; }
[data-order-item-id].is-dragging { opacity: .42; }
[data-order-item-id] { transition: opacity .15s, box-shadow .15s; }
.matrix-source-line { display: flex; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 7px 18px; background: #fafaf8; color: var(--muted); font-size: 10px; }
.matrix-source-line strong { color: var(--ink); }
.matrix-wrap { max-height: 64vh; }
.operation-matrix { min-width: max-content; border-collapse: separate; border-spacing: 0; }
.operation-matrix th, .operation-matrix td { padding: 8px 12px; }
.operation-matrix th { position: sticky; top: 0; z-index: 2; max-width: 180px; min-width: 130px; background: #f2f2ee; white-space: normal; line-height: 1.25; }
.matrix-norm { position: relative; padding-right: 38px !important; }
.matrix-norm-content { display: grid; gap: 2px; }
.matrix-norm.is-not-applicable .matrix-norm-content { opacity: .42; }
.matrix-applicable-toggle { position: absolute; top: 50%; right: 10px; display: block; width: 20px; height: 20px; transform: translateY(-50%); cursor: pointer; }
.matrix-applicable-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.matrix-applicable-toggle span { display: grid; width: 20px; height: 20px; place-items: center; border: 2px solid #aab4af; border-radius: 5px; background: #fff; }
.matrix-applicable-toggle input:checked + span { border-color: var(--brand); background: var(--brand); }
.matrix-applicable-toggle input:checked + span::after { content: ""; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.matrix-applicable-toggle input:focus-visible + span { outline: 3px solid rgba(37,102,83,.22); outline-offset: 2px; }
.operation-matrix .matrix-id { min-width: 72px; width: 72px; position: sticky; left: 0; z-index: 3; background: #fafaf8; }
.operation-matrix .matrix-product { min-width: 250px; width: 250px; position: sticky; left: 72px; z-index: 3; background: #fff; box-shadow: 1px 0 var(--line); }
.operation-matrix thead .matrix-id, .operation-matrix thead .matrix-product { z-index: 5; background: #f2f2ee; }
.operation-matrix .matrix-batch { min-width: 130px; }
.operation-matrix td { height: 42px; vertical-align: middle; }
.operation-matrix td.matrix-id span { color: var(--muted); font-size: 10px; font-weight: 850; }
.matrix-editable { min-width: 130px; text-align: center; cursor: pointer; transition: background .15s, box-shadow .15s; }
.matrix-editable:hover, .matrix-editable:focus { outline: none; background: var(--brand-soft); box-shadow: inset 0 0 0 2px rgba(23,54,47,.2); }
.matrix-editable strong, .matrix-editable small { display: block; }
.matrix-editable small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.matrix-editable.is-empty { background: #fafaf8; }
.matrix-editable.is-empty:hover, .matrix-editable.is-empty:focus { background: var(--accent-soft); }
.matrix-empty { color: #a4a8a5; font-size: 10px; }
.sheet-cut-matrix .matrix-product { left: 0; min-width: 260px; width: 260px; }
.sheet-cut-cell { min-width: 155px; }
.hypothesis-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); gap:10px; padding:10px; }
.hypothesis-card { min-width:0; padding:12px; border:1px solid var(--line); border-radius:12px; overflow-wrap:anywhere; }
.hypothesis-card small { display:block; color:var(--muted); margin-top:5px; }
.hypothesis-card p { margin:8px 0; white-space:pre-wrap; }
.hypothesis-due { display:block; color:#a35412; margin-top:8px; }
.hypothesis-fields { border:0; padding:0; margin:0; display:grid; gap:12px; min-width:0; }
.hypothesis-projects { display:flex; flex-wrap:wrap; gap:10px; }
.hypothesis-projects label { display:flex; align-items:center; gap:8px; }
.hypothesis-projects input[type="checkbox"] { width:22px; min-height:22px; }
.hypothesis-history article { border-top:1px solid var(--line); padding:10px 0; white-space:pre-wrap; }
.team-hypotheses-panel { min-width:0; margin-top:14px; padding:14px 16px; border:1px solid var(--line); border-radius:16px; background:#fff; }
.team-workspace-body > .team-hypotheses-panel { margin-top:0; }
.team-hypotheses-panel .team-hypotheses-head { align-items:center; flex-direction:row; flex-wrap:wrap; gap:10px 16px; margin:0; padding:0; }
.team-hypotheses-head > div { min-width:0; flex:1 1 220px; }
.team-hypotheses-head h3 { display:flex; align-items:center; gap:8px; margin:0; font-size:16px; }
.team-hypotheses-head p { margin:5px 0 0; color:var(--muted); font-size:12px; line-height:1.4; }
.team-hypotheses-head > button { min-height:40px; padding:8px 12px; }
.team-hypotheses-count { padding:3px 7px; border-radius:999px; background:var(--brand-soft); color:var(--brand); font-size:12px; }
.team-hypotheses-panel .hypothesis-grid { gap:8px; padding:12px 0 0; }
.team-hypotheses-panel .hypothesis-card { background:var(--surface-soft); }
.team-hypotheses-panel .empty { margin:0; padding:10px 0 0; color:var(--muted); font-size:13px; }
@media (min-width:700px) and (max-width:1180px) {
  .operation-matrix th,.operation-matrix td{padding:6px 8px;font-size:12px}
  .operation-matrix td{height:38px}
  .operation-matrix th{min-width:108px;max-width:132px;line-height:1.15}
  .operation-matrix .matrix-id{min-width:56px;width:56px}
  .operation-matrix .matrix-product{left:56px;min-width:190px;width:190px;max-width:190px}
  .operation-matrix .matrix-product .matrix-name-link{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;line-height:1.2}
  .operation-matrix .matrix-batch{min-width:96px;width:96px;max-width:96px;white-space:normal;line-height:1.15}
  .operation-matrix .matrix-norm{min-width:108px;padding-right:32px!important}
  .operation-matrix thead th>.matrix-name-link{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;line-height:1.15}
  .matrix-applicable-toggle{right:7px}
  .matrix-add-button{min-height:44px;padding-block:8px}
  .operation-matrix.sheet-cut-matrix{width:100%;min-width:0;table-layout:fixed}
  .sheet-cut-matrix th,.sheet-cut-matrix td{min-width:0;max-width:none;overflow-wrap:anywhere}
  .sheet-cut-matrix .matrix-product{left:0;min-width:0;width:28%;max-width:none}
  .sheet-cut-matrix thead th>.matrix-name-link{display:block;-webkit-line-clamp:unset;line-clamp:unset;overflow:visible;white-space:normal;overflow-wrap:anywhere}
  .sheet-cut-matrix .matrix-product .matrix-name-link{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;line-height:1.2}
  .sheet-cut-cell{min-width:0;padding:6px 8px;font-size:12px}
}
.sheet-cut-product-cell { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 8px; }
.sheet-cut-product-cell > strong, .sheet-cut-product-cell > .matrix-name-link { width: 100%; min-width: 0; overflow-wrap: anywhere; text-align: left; }
.sheet-cut-product-cell > .matrix-name-link { display: grid; justify-items: start; gap: 3px; }
.sheet-cut-product-cell > .matrix-name-link small { color: var(--muted); font-size: 9px; text-decoration: none; }
.sheet-cut-archive-btn { flex: 0 0 auto; min-height: 28px; border: 0; border-radius: 9px; padding: 4px 8px; background: var(--danger-soft); color: var(--danger); font-size: 10px; font-weight: 850; cursor: pointer; }
.sheet-cut-archive-btn:hover { filter: brightness(.97); }
.sheet-cut-archive-confirm > p { color: var(--muted); line-height: 1.55; }
.sheet-cut-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.sheet-cut-confirm-actions button { min-height: 50px; padding: 11px 16px; }
.matrix-modal { --modal-width: 570px; }
.matrix-modal .modal-head p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); }
.sheet-material-form { display: grid; gap: 18px; width: 100%; margin-top: 8px; }
.sheet-material-form label { display: grid; gap: 8px; min-width: 0; }
.sheet-material-form label > span { color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.sheet-material-form input { width: 100%; min-width: 0; min-height: 52px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; color: var(--ink); font-size: 16px; }
.sheet-material-form small { color: var(--muted); line-height: 1.45; }
.matrix-item-editor { overflow: auto; }
.matrix-item-editor-form { display: grid; gap: 18px; padding: 2px 24px 24px; }
.matrix-item-editor-grid { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; }
.matrix-item-editor-field { display: grid; align-content: start; gap: 7px; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #f7f8f5; }
.matrix-item-editor-field > span { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.matrix-item-editor-field input { width: 100%; min-height: 46px; border: 1px solid #cfd5d1; border-radius: 11px; padding: 10px 12px; background: #fff; color: var(--ink); font: inherit; font-weight: 750; transition: border-color .15s, box-shadow .15s; }
.matrix-item-editor-field input:hover { border-color: #aeb8b3; }
.matrix-item-editor-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23,54,47,.12); }
.matrix-item-editor-code input { text-transform: uppercase; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.matrix-item-editor-field small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.matrix-item-editor-actions { display: flex; justify-content: flex-end; gap: 10px; }
.matrix-item-editor-actions button { min-height: 44px; padding-inline: 18px; }
@media (max-width: 620px) {
  .matrix-head { align-items: stretch; flex-direction: column; }
  .matrix-head-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .matrix-head-action { width: 100%; }
  .matrix-item-editor-form { padding-inline: 16px; }
  .matrix-item-editor-grid { grid-template-columns: 1fr; }
  .matrix-item-editor-actions { display: grid; grid-template-columns: 1fr; }
  .matrix-item-editor-actions .primary-btn { order: -1; }
}
#matrix-cell-form, #matrix-add-form, #production-product-form, #sheet-product-form { display: grid; gap: 8px; }
#matrix-cell-form label, #matrix-add-form label, #production-product-form label, #sheet-product-form label { display: grid; gap: 4px; }
#matrix-cell-form label > span, #matrix-add-form label > span, #production-product-form label > span, #sheet-product-form label > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
#matrix-cell-form input:not([type="checkbox"]), #matrix-add-form input:not([type="checkbox"]), #matrix-add-form select, #production-product-form input[type="text"], #sheet-product-form input { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: #fff; color: var(--ink); }
.catalog-active-toggle { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 10px !important; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.catalog-active-toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.catalog-active-toggle > span { align-self: center; color: var(--ink) !important; font-size: 12px !important; font-weight: 750; line-height: 1.25; letter-spacing: 0 !important; text-transform: none !important; }
.employee-section-picker { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 8px; }
.employee-section-picker legend { padding: 0 5px; color: var(--muted); font-size: 12px; }
.employee-section-picker .catalog-active-toggle { padding-block: 8px; }
#matrix-cell-form p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.save-btn { min-height: 42px; border: 0; border-radius: 10px; background: var(--brand-soft); color: var(--brand); padding: 8px 13px; font-weight: 800; cursor: pointer; }
.save-btn:hover { background: #d6e7e1; }
.production-product-table th, .production-product-table td { padding: 8px 14px; }
.production-product-table .save-btn { min-height: 34px; padding-block: 5px; }
.variance-badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.variance-badge.good { background: var(--brand-soft); color: var(--success); }
.variance-badge.bad { background: var(--danger-soft); color: var(--danger); }

.history-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: #fafaf8;
}
.history-filters label { display: grid; gap: 7px; min-width: 0; }
.history-filters label > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.055em; text-transform: uppercase; }
.history-filters input, .history-filters select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 11px; padding: 9px 11px; background: #fff; color: var(--ink); }
.history-filters input:hover, .history-filters select:hover { border-color: #b4bcb8; }
.history-search { grid-column: span 2; }
.clear-filters-btn { align-self: end; min-height: 44px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--brand); font-weight: 800; cursor: pointer; }
.clear-filters-btn:hover { background: var(--brand-soft); }
.history-groups { display: grid; gap: 16px; padding: 18px; background: #f5f4ef; }
.history-group { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.history-group > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--brand-soft); }
.history-group > header span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.history-group > header h3 { margin: 2px 0 0; color: var(--brand); font-size: 20px; }
.history-group > header strong { color: var(--brand); font-size: 13px; }
.history-group .table-wrap { margin: 0; }
.history-table { min-width: 1160px; }
.history-table td { line-height: 1.45; }
.history-table tbody tr[data-open-work] { cursor: pointer; }
.history-table tbody tr[data-open-work]:hover { background: var(--brand-soft); }
.downtime-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
.downtime-summary > div { display: grid; gap: 5px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.downtime-summary span, .work-history-facts span { color: var(--muted); font-size: 11px; font-weight: 800; }
.downtime-summary strong { color: var(--brand); font-size: 25px; }
.downtime-layout { display: grid; gap: 20px; }
.downtime-layout h3 { margin: 0 0 10px; }
.downtime-reasons { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 8px; }
.downtime-reasons > div { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); }
.downtime-reasons small { grid-column: 1 / -1; color: var(--muted); }
.downtime-table { min-width: 940px; }
.work-history-card { --modal-width: 820px; }
.work-correction-form{margin-top:18px;border-top:1px solid var(--line);padding-top:16px}.work-correction-form h3{margin:0 0 2px}.work-correction-form .switch-row{display:flex;align-items:center;gap:10px}.work-correction-form .switch-row input{width:18px;min-height:18px;flex:0 0 18px}
.work-correction-form [data-other-correction-reason][hidden]{display:none!important}
.work-correction-time-grid{display:grid;grid-template-columns:1.25fr .8fr .8fr;gap:10px}.work-correction-time-grid label{display:grid;gap:7px}@media(max-width:620px){.work-correction-time-grid{grid-template-columns:1fr 1fr}.work-correction-time-grid label:first-child{grid-column:1/-1}}
.work-history-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin: 18px 0 22px; }
.work-history-facts > div { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.work-downtimes h3 { margin-bottom: 10px; }
.work-downtimes article { display: grid; grid-template-columns: 1fr auto; gap: 5px 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.work-downtimes article div { display: grid; gap: 4px; }
.work-downtimes article span, .work-downtimes article p { color: var(--muted); font-size: 12px; }
.work-downtimes article p { grid-column: 1 / -1; margin: 2px 0 0; }
.history-table td:nth-child(1), .history-table td:nth-child(2), .history-table td:nth-child(5), .history-table td:nth-child(6), .history-table td:nth-child(7), .history-table td:nth-child(8) { white-space: nowrap; }
@media (min-width:700px) and (max-width:1180px) {
  .history-filters{grid-template-columns:repeat(4,minmax(120px,1fr));gap:8px;padding:12px 14px}
  .history-filters input,.history-filters select,.clear-filters-btn{min-height:38px;padding-block:6px}
  .history-groups{gap:10px;padding:10px}
  .history-group>header{gap:10px;padding:10px 12px}
  .history-group>header h3{font-size:17px}
  .history-table{min-width:900px;table-layout:fixed}
  .history-table th,.history-table td{padding:7px 8px;font-size:11px;line-height:1.25}
  .history-table th:nth-child(1){width:104px}
  .history-table th:nth-child(2){width:88px}
  .history-table th:nth-child(3){width:104px}
  .history-table th:nth-child(4){width:178px}
  .history-table th:nth-child(5){width:72px}
  .history-table th:nth-child(6){width:132px}
  .history-table th:nth-child(7){width:122px}
  .history-table th:nth-child(8){width:82px}
  .history-table td:nth-child(2),.history-table td:nth-child(3),.history-table td:nth-child(4),.history-table td:nth-child(6),.history-table td:nth-child(7){white-space:normal;overflow-wrap:anywhere}
  .history-table .section-label{white-space:normal;line-height:1.2}
  .statistics-tab-body{padding:10px}
  .statistics-section-panel{padding:10px 12px 12px}
}
@media(max-width:760px){.downtime-summary,.work-history-facts{grid-template-columns:1fr}.downtime-summary>div{padding:13px 15px}}
.history-ungrouped { padding: 0; }
.statistics-tab-body { padding: 18px; background: #f5f4ef; }
.statistics-tab-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.statistics-section-panel { padding: 16px 18px 18px; }
.statistics-panel-title { margin: 0; padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--brand-soft); color: var(--brand); font-size: 20px; }
.orders-statistics-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.orders-statistics-head h2 { margin: 0 0 4px; font-size: 24px; }
.orders-statistics-head p { margin: 0; color: var(--muted); font-size: 12px; }
.orders-period-form { display: flex; align-items: end; gap: 8px; }
.orders-period-form label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.orders-period-form input { min-height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 9px; background: #fff; color: var(--ink); }
.orders-period-form button { min-height: 38px; border: 0; border-radius: 9px; padding: 0 16px; background: var(--brand); color: #fff; font-weight: 850; cursor: pointer; }
.orders-statistics-summary { display: flex; align-items: baseline; gap: 10px; padding: 10px 20px; background: var(--brand-soft); color: var(--brand); }
.orders-statistics-summary span, .orders-statistics-summary small { font-size: 11px; font-weight: 800; }
.orders-statistics-summary strong { font-size: 22px; }
.orders-statistics-wrap { overflow-x: auto; }
.orders-statistics-table { min-width: 840px; border: 1px solid #cfd8d3; border-collapse: collapse; table-layout: fixed; }
.orders-statistics-table th, .orders-statistics-table td { border: 1px solid #d9e0dc; padding: 11px 9px; text-align: center; }
.orders-statistics-table thead th { background: #edf3ef; border-color: #c6d1cb; }
.orders-statistics-table th:first-child { width: 260px; text-align: left; }
.orders-statistics-table thead th:not(:first-child) { width: 76px; white-space: nowrap; }
.orders-statistics-table thead i { display: block; margin-top: 2px; color: #a36d25; font-size: 8px; font-style: normal; letter-spacing: 0; text-transform: none; }
.orders-statistics-table tbody th { background: #fff; color: var(--ink); font-size: 12px; text-align: left; text-transform: none; letter-spacing: 0; }
.orders-statistics-table tbody td { font-size: 15px; font-variant-numeric: tabular-nums; }
.orders-statistics-table tbody td:nth-last-child(2) { background: #f4f7f5; color: var(--brand); }
.orders-statistics-table .orders-monthly { background: var(--brand-soft); color: var(--brand); }
.output-statistics-wrap { max-width: 680px; }
.output-statistics-table { min-width: 0; }
.output-statistics-table th:first-child { width: auto; }
.output-statistics-table thead th:last-child { width: 140px; }
.output-statistics-table tbody tr.is-zero { opacity: .48; }
.orders-statistics-table tfoot th, .orders-statistics-table tfoot td { border-top: 2px solid var(--brand); border-bottom: 0; background: var(--brand-soft); color: var(--brand); font-weight: 900; }
.orders-unmatched-note, .orders-connection-note { margin: 0; border-top: 1px solid var(--line); padding: 10px 20px; color: var(--muted); font-size: 11px; }
.orders-unmatched-note { width: 100%; border-right: 0; border-bottom: 0; border-left: 0; background: #fff8e8; color: #8a5816; cursor: pointer; text-align: left; }
.orders-unmatched-note span { margin-left: 6px; font-weight: 800; text-decoration: underline; }

.shipments-shell { width: min(1320px, calc(100% - 32px)); margin: 16px auto 60px; }
.shipments-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.shipments-intro-main { display: flex; align-items: center; gap: 14px; }
.shipments-intro h1 { margin: 0; font-size: clamp(25px, 3vw, 32px); }
.shipments-intro p:not(.eyebrow) { max-width: 720px; margin-bottom: 0; color: var(--muted); line-height: 1.55; }
.compact-btn { min-height: 54px; padding-inline: 24px; white-space: nowrap; }
.shipment-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 190px)); gap: 8px; margin-bottom: 10px; }
.shipment-summary { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: rgba(255,255,255,0.88); color: var(--muted); cursor: pointer; text-align: left; }
.shipment-summary span { font-size: 12px; font-weight: 800; }
.shipment-summary strong { color: var(--ink); font-size: 25px; }
.shipment-summary:hover, .shipment-summary.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.shipment-summary.is-active strong { color: var(--brand); }
.shipment-summary.is-static { cursor: default; }
.shipment-summary.is-static:hover:not(.is-active) { border-color: var(--line); background: rgba(255,255,255,0.88); color: var(--muted); }
.shipment-journal { overflow: hidden; }
.shipment-toolbar { display: grid; grid-template-columns: minmax(260px, 1.6fr) minmax(180px, 0.7fr) auto; gap: 13px; align-items: end; padding: 20px 22px; border-bottom: 1px solid var(--line); background: #fafaf8; }
.shipment-toolbar label { display: grid; gap: 7px; }
.shipment-toolbar label > span, .shipment-form-grid label > span, .shipment-line label > span, .auto-date-note > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.055em; text-transform: uppercase; }
.shipment-toolbar input, .shipment-toolbar select, .shipment-form-grid input, .shipment-form-grid select, .shipment-line input, .shipment-line select { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; background: #fff; color: var(--ink); }
.shipment-toolbar input:focus, .shipment-toolbar select:focus, .shipment-form-grid input:focus, .shipment-form-grid select:focus, .shipment-line input:focus, .shipment-line select:focus { outline: 3px solid rgba(222, 139, 56, 0.18); border-color: var(--accent); }
.journal-result-count { align-self: center; color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
.shipment-list { display: grid; gap: 8px; padding: 10px; background: #f5f4ef; }
.shipment-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.shipment-card.is-pending { border-left: 5px solid var(--accent); }
.shipment-card.is-shipped { border-left: 5px solid var(--success); }
.shipment-card-head { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(310px, auto) auto; align-items: center; gap: 16px; padding: 11px 14px 9px; }
.shipment-card-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.shipment-title-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.shipment-status, .marketplace-chip, .entity-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 850; }
.shipment-number { color: var(--muted); font-size: 12px; font-weight: 750; white-space: nowrap; }
.shipment-status.pending { background: var(--accent-soft); color: #965718; }
.shipment-status.shipped { background: var(--brand-soft); color: var(--success); }
.marketplace-chip { background: #e8eef9; color: #31527d; }
.entity-chip { background: #f0efeb; color: var(--ink); }
.shipment-date-block { display: grid; justify-items: end; gap: 4px; white-space: nowrap; }
.shipment-date-block small { color: var(--muted); }
.shipment-date-block strong { font-size: 16px; }
.shipment-card-body { display: grid; grid-template-columns: minmax(280px, 1.3fr) minmax(390px, 1fr); gap: 10px; padding: 0 14px 11px; }
.shipment-products { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.shipment-products li { display: flex; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; background: #fbfbf9; }
.shipment-products li strong { font-size: 14px; }
.shipment-products li span { color: var(--brand); font-weight: 850; white-space: nowrap; }
.shipment-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.shipment-facts div { min-width: 0; padding: 7px 9px; background: #fff; }
.shipment-facts dt { margin-bottom: 3px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: 0.04em; }
.shipment-facts dd { margin: 0; font-weight: 850; }
.shipment-audit { display: grid; gap: 3px; color: var(--muted); font-size: 11px; }
.shipment-audit strong { color: var(--success); }
.shipment-card-controls { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.shipment-actions { display: flex; gap: 6px; }
.secondary-action, .warehouse-action, .add-line-btn, .remove-line-btn { min-height: 34px; border: 0; border-radius: 9px; padding: 7px 10px; font-size: 12px; font-weight: 850; cursor: pointer; }
.secondary-action { background: #ecece8; color: var(--ink); }
.warehouse-action { background: var(--brand); color: #fff; }
.add-line-btn { background: var(--brand-soft); color: var(--brand); }
.remove-line-btn { align-self: end; background: var(--danger-soft); color: var(--danger); }
.secondary-action:hover, .warehouse-action:hover, .add-line-btn:hover, .remove-line-btn:hover { filter: brightness(0.96); }
.secondary-action:disabled, .warehouse-action:disabled { opacity: 0.5; cursor: not-allowed; }
.shipment-empty { min-height: 260px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.shipment-empty strong { color: var(--ink); font-size: 20px; }
.shipment-empty p { margin: 7px 0 0; }
.shipment-form-card { --modal-width: 900px; }
.shipment-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.shipment-form-actions .primary-btn, .shipment-form-actions .danger-btn { min-width: 190px; }
.shipment-plan { overflow: hidden; }
.shipment-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.shipment-plan-head h2 { margin: 0; font-size: 20px; }
.shipment-plan-head strong { color: var(--muted); font-size: 12px; }
.shipment-plan-scroll { overflow: auto; max-width: 100%; }
.shipment-plan-table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; }
.shipment-plan-table th, .shipment-plan-table td { min-width: 94px; padding: 11px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.shipment-plan-table thead th { position: sticky; top: 0; z-index: 2; background: #f5f4ef; color: var(--muted); font-size: 11px; }
.shipment-plan-table th:first-child { position: sticky; left: 0; z-index: 3; min-width: 230px; max-width: 320px; background: #fff; color: var(--ink); text-align: left; }
.shipment-plan-table thead th:first-child { background: #f5f4ef; }
.shipment-plan-table th:last-child, .shipment-plan-table td:last-child { position: sticky; right: 0; z-index: 3; border-right: 0; background: var(--brand-soft); }
.shipment-plan-table td { background: #fff; color: var(--muted); font-weight: 750; }
.shipment-plan-table td.has-quantity { background: var(--accent-soft); color: #965718; font-size: 16px; font-weight: 900; }
.shipment-plan-table td.shipment-plan-total { color: var(--brand); font-size: 16px; font-weight: 900; }
.shipment-plan-table tbody tr:last-child th, .shipment-plan-table tbody tr:last-child td { border-bottom: 0; }
.shipment-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.shipment-form-grid label, .shipment-line label { display: grid; gap: 7px; min-width: 0; }
.auto-date-note { display: grid; align-content: center; gap: 7px; min-height: 70px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); }
.auto-date-note strong { color: var(--brand); font-size: 13px; }
.shipment-lines-section { margin-top: 23px; padding-top: 21px; border-top: 1px solid var(--line); }
.shipment-lines-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.shipment-lines-head h3 { margin-bottom: 3px; font-size: 20px; }
.shipment-lines-head p { margin: 0; color: var(--muted); font-size: 12px; }
#shipment-lines { display: grid; gap: 9px; }
.shipment-line { display: grid; grid-template-columns: minmax(240px, 1fr) 150px auto; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fafaf8; }
.form-note { margin: 17px 0 -5px; color: var(--muted); font-size: 12px; line-height: 1.5; }

.access-shell { width: min(980px, calc(100% - 32px)); margin: clamp(34px, 8vh, 82px) auto 70px; }
.access-intro { max-width: 760px; margin-bottom: 27px; }
.access-intro p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.access-warning { margin-top: 18px; border: 1px solid rgba(163, 59, 50, 0.24); border-radius: 13px; padding: 13px 15px; background: var(--danger-soft); color: var(--danger); font-weight: 750; }
.access-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.access-role-card { min-height: 235px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; border: 1px solid var(--line); border-radius: 19px; padding: 22px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; box-shadow: 0 12px 35px rgba(23,54,47,0.07); }
.access-role-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.access-role-card:disabled { opacity: 0.55; cursor: wait; }
.access-role-card strong { font-size: 19px; line-height: 1.25; }
.access-role-card small { color: var(--muted); line-height: 1.55; }
.role-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 14px; background: var(--brand-soft); color: var(--brand); font-weight: 900; }
.access-role-card:first-child .role-icon { background: var(--accent-soft); color: #965718; }
.access-current { margin: 20px 2px 0; color: var(--muted); font-size: 13px; }

.module-menu-trigger { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 0 15px; background: #fff; color: var(--brand); font-weight: 850; cursor: pointer; }
.module-menu-trigger i, .module-menu-trigger i::before, .module-menu-trigger i::after { width: 24px; height: 2px; display: block; border-radius: 2px; background: currentColor; content: ""; }
.module-menu-trigger i { position: relative; }
.module-menu-trigger i::before { position: absolute; top: -6px; }
.module-menu-trigger i::after { position: absolute; top: 6px; }
.module-nav-backdrop { position: fixed; inset: 0; z-index: 80; visibility: hidden; background: rgba(11,28,24,0); transition: 180ms ease; }
.module-nav-backdrop.is-open { visibility: visible; background: rgba(11,28,24,0.55); }
.module-nav-drawer { width: min(410px, calc(100% - 28px)); height: 100%; display: grid; grid-template-rows: auto 1fr auto; margin-left: auto; background: #f7f7f3; transform: translateX(100%); transition: 200ms ease; box-shadow: -20px 0 70px rgba(0,0,0,0.2); }
.module-nav-backdrop.is-open .module-nav-drawer { transform: translateX(0); }
.module-nav-drawer > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 25px; border-bottom: 1px solid var(--line); background: #fff; }
.module-nav-drawer > header p { margin: 0 0 5px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.module-nav-drawer > header strong { font-size: 19px; }
.module-nav-drawer > header button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: 24px; cursor: pointer; }
.module-nav-drawer nav { display: grid; align-content: start; gap: 8px; overflow: auto; padding: 14px; }
.module-group-card { width: 100%; min-height: 92px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 14px 12px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.module-group-card:hover { border-color: var(--brand); background: var(--brand-soft); }
.module-nav-group-title { display: flex; align-items: center; gap: 12px; margin: -2px 0 6px; padding: 8px 5px 13px; border-bottom: 1px solid var(--line); }
.module-nav-group-title button { min-height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; background: #fff; color: var(--ink); font-weight: 800; cursor: pointer; }
.module-nav-group-title div { display: grid; gap: 2px; }
.module-nav-group-title small { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.module-nav-group-title strong { font-size: 17px; }
.module-nav-item { min-height: 76px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; color: var(--ink); text-decoration: none; }
.module-nav-item:not(.is-locked):hover { border-color: var(--brand); background: var(--brand-soft); }
.module-nav-item.is-locked { opacity: .58; background: #efefec; }
.module-nav-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 900; }
.module-nav-copy { display: grid; gap: 4px; }
.module-nav-copy strong { font-size: 15px; }
.module-nav-copy small, .module-nav-state { color: var(--muted); font-size: 10px; }
.module-nav-state { font-weight: 800; white-space: nowrap; }
.module-nav-drawer footer { display: grid; gap: 8px; padding: 19px 22px; border-top: 1px solid var(--line); background: #fff; }
.module-nav-drawer footer a { color: var(--brand); font-weight: 850; text-decoration: none; }
.module-nav-drawer footer small { color: var(--muted); line-height: 1.4; }

.inventory-shell { width: min(1240px, calc(100% - 32px)); margin: 24px auto 70px; }
.inventory-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; margin-bottom: 9px; }
.inventory-summary > div { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 13px; padding: 9px 14px; background: #fff; }
.inventory-summary span { color: var(--muted); font-size: 12px; font-weight: 800; }
.inventory-summary strong { font-size: 25px; }
.inventory-summary .has-negative { border-color: rgba(163,59,50,.35); background: var(--danger-soft); }
.inventory-summary .has-negative strong { color: var(--danger); }
.inventory-warning { margin-bottom: 9px; border: 1px solid rgba(163,59,50,.28); border-radius: 12px; padding: 9px 13px; background: var(--danger-soft); color: var(--danger); font-size: 12px; font-weight: 750; }
.inventory-sync-status { margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 13px; background: #fff; font-size: 12px; }
.inventory-sync-status strong { flex: 0 0 auto; }
.inventory-sync-status span { color: var(--muted); text-align: right; }
.inventory-sync-status.is-ok { border-color: rgba(33,112,83,.28); background: #f1faf6; }
.inventory-sync-status.is-ok strong { color: var(--brand); }
.inventory-sync-status.is-warning, .inventory-sync-status.is-error { border-color: rgba(163,59,50,.28); background: var(--danger-soft); }
.inventory-sync-status.is-warning strong, .inventory-sync-status.is-error strong,
.inventory-sync-status.is-warning span, .inventory-sync-status.is-error span { color: var(--danger); }
.inventory-sync-status.is-muted { background: #f6f7f5; }
.inventory-card { overflow: hidden; }
.sku-catalog-card { margin-top: 14px; }
.sku-catalog-list { display: grid; gap: 1px; background: var(--line); }
.sku-catalog-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 22px; background: #fff; }
.sku-catalog-row > div { display: grid; gap: 4px; }
.sku-catalog-row small { color: var(--muted); }
.sku-catalog-row.is-inactive { background: #f7f7f4; opacity: .72; }
.sku-status { flex: 0 0 auto; border-radius: 999px; padding: 6px 10px; background: #eceeeb; color: var(--muted); font-size: 11px; font-weight: 850; }
.sku-status.is-active { background: var(--accent-soft); color: var(--brand); }
.inventory-actions { display: flex; gap: 10px; align-items: center; }
.inventory-intro-main { display: flex; align-items: flex-end; gap: 14px; min-width: 0; }
.inventory-intro-main > div:first-child { min-width: 0; }
.inventory-view-tabs { margin: -4px 0 9px; }
.inventory-view-tabs .tab { min-height: 36px; padding: 7px 12px; }
.sku-active-field { display: flex !important; align-items: center; gap: 10px; cursor: pointer; }
.sku-active-field input { width: 18px !important; min-height: 18px !important; accent-color: var(--accent); }
.sku-active-field span { color: var(--ink) !important; font-size: 14px !important; font-weight: 750 !important; letter-spacing: 0 !important; text-transform: none !important; }
.inventory-product-list { display: grid; gap: 1px; background: var(--line); }
.inventory-product { display: grid; grid-template-columns: minmax(260px,1fr) 150px auto; align-items: center; gap: 20px; padding: 18px 22px; background: #fff; }
.inventory-product > div { display: grid; gap: 5px; }
.inventory-product > div strong { font-size: 16px; }
.inventory-product > div small { color: var(--muted); }
.inventory-product.is-negative { background: #fff7f5; }
.inventory-product.is-negative > div small, .inventory-product.is-negative .inventory-balance { color: var(--danger); }
.inventory-balance { font-size: 28px; font-weight: 900; text-align: right; }
.inventory-balance small { font-size: 12px; }
.inventory-product button { min-height: 42px; border: 0; border-radius: 11px; padding: 9px 13px; background: var(--brand-soft); color: var(--brand); font-weight: 850; cursor: pointer; }
.finished-product-actions { display: grid; justify-items: end; gap: 8px; }
.finished-product-actions .sku-status { justify-self: end; }
.inventory-card .inventory-card-head { min-height: 0; padding: 10px 14px; }
.inventory-card .inventory-card-head h2 { margin: 0; font-size: 19px; }
.inventory-card .inventory-card-head p { margin: 3px 0 0; font-size: 11px; }
.inventory-stock-scroll { overflow: auto; max-height: 70vh; border-top: 1px solid var(--line); }
.inventory-stock-table { width: 100%; min-width: 0; }
.inventory-stock-head,
.inventory-stock-row { display: grid; grid-template-columns: minmax(180px, 1fr) 80px 72px repeat(5, minmax(76px, 90px)); align-items: center; }
.inventory-stock-head { position: sticky; top: 0; z-index: 1; }
.inventory-stock-head { background: #f5f7fa; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .025em; text-transform: uppercase; }
.inventory-stock-head > span,
.inventory-stock-row > * { min-width: 0; padding: 7px 9px; border-right: 1px solid var(--line); }
.inventory-stock-head > span:last-child,
.inventory-stock-row > *:last-child { border-right: 0; }
.inventory-stock-row { min-height: 52px; background: #fff; border-top: 1px solid var(--line); }
.inventory-stock-head + .inventory-stock-row { border-top: 0; }
.inventory-stock-row.is-negative { background: #fff7f5; }
.inventory-stock-row.is-negative .inventory-stock-number,
.inventory-stock-row.is-negative .inventory-stock-product small { color: var(--danger); }
.inventory-stock-product { display: grid; gap: 2px; }
.inventory-stock-product strong { font-size: 14px; }
.inventory-stock-product small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.inventory-stock-product .sku-status { width: max-content; margin-top: 2px; }
.inventory-stock-row button { min-height: 32px; border: 0; border-radius: 9px; padding: 6px 9px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 850; cursor: pointer; }
.inventory-stock-row .inventory-sku-link { width: 100%; min-height: 0; display: grid; gap: 2px; border-radius: 7px; padding: 3px 5px; background: transparent; color: var(--ink); text-align: left; }
.inventory-stock-row .inventory-sku-link:hover { background: var(--brand-soft); color: var(--brand); }
.inventory-sku-copy { display: grid; gap: 2px; }
.inventory-stock-number { text-align: right; font-size: 17px; }
.inventory-stock-number small { font-size: 9px; color: var(--muted); }
.inventory-archive-table .inventory-stock-head,
.inventory-archive-table .inventory-stock-row { grid-template-columns: minmax(230px, 1fr) 86px 78px; }
.inventory-components-card { margin-top: 10px; }
.inventory-components-table .inventory-stock-head,
.inventory-components-table .inventory-stock-row { grid-template-columns: minmax(230px, 1fr) 86px 90px; }
.component-composition-list { display: grid; gap: 7px; }
.component-composition-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 86px; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.component-composition-row input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }
.component-composition-row input[type="number"] { min-width: 0; }
.inventory-sku-form-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }
.inventory-sku-form-actions > button { min-height: 46px; padding: 10px 16px; }
.inventory-modal-card { --modal-width: 640px; }
.adjustment-form { display: grid; gap: 14px; }
.adjustment-form label { display: grid; gap: 7px; }
.adjustment-form label > span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.adjustment-form input, .adjustment-form select, .adjustment-form textarea { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; background: #fff; color: var(--ink); }
.adjustment-form textarea { min-height: 100px; resize: vertical; }
.adjustment-form label small { color: var(--muted); }
.inventory-history-card { --modal-width: 850px; }
.marketplace-articles-card .admin-card-head { align-items: center; }
.marketplace-article-rows { display: grid; gap: 1px; background: var(--line); }
.marketplace-article-row { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(360px, 1.8fr) auto; align-items: center; gap: 14px; padding: 14px 18px; background: #fff; }
.marketplace-article-row.is-inactive { background: #f7f7f4; opacity: .72; }
.marketplace-product-name { display: grid; gap: 4px; }
.marketplace-product-name > strong { font-size: 15px; }
.marketplace-product-name > small { color: var(--muted); font-size: 10px; }
.marketplace-article-list { display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; }
.marketplace-article-chip { min-width: 0; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(23,54,47,.14); border-radius: 11px; padding: 8px 10px; background: var(--brand-soft); color: var(--brand); text-align: left; cursor: pointer; }
.marketplace-article-chip:hover { border-color: var(--brand); }
.marketplace-article-chip.is-readonly { cursor: default; }
.marketplace-article-source { display: grid; gap: 1px; padding-right: 9px; border-right: 1px solid rgba(23,54,47,.18); }
.marketplace-article-source b { font-size: 10px; }
.marketplace-article-source small { max-width: 170px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.marketplace-article-chip > strong { overflow-wrap: anywhere; font-size: 12px; }
.marketplace-article-empty { color: var(--muted); font-size: 12px; }
.marketplace-article-add { min-height: 38px; border: 0; border-radius: 10px; padding: 8px 11px; background: var(--brand-soft); color: var(--brand); font-weight: 850; cursor: pointer; }
.marketplace-article-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.marketplace-article-form-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.marketplace-article-form-actions .primary-btn, .marketplace-article-form-actions .danger-btn, .marketplace-article-form-actions .secondary-btn { min-height: 48px; padding: 11px 17px; }
.inventory-confirm-card { --modal-width: 480px; }
.inventory-confirm-card > p { color: var(--muted); line-height: 1.55; }
.movement-list { display: grid; gap: 8px; }
.movement-row { display: grid; grid-template-columns: 70px minmax(0,1fr) auto; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 13px; padding: 13px; }
.movement-quantity { font-size: 23px; font-weight: 900; }
.movement-row.positive .movement-quantity { color: var(--success); }
.movement-row.negative .movement-quantity { color: var(--danger); }
.movement-row > div { display: grid; gap: 4px; }
.movement-row small, .movement-actor { color: var(--muted); font-size: 11px; }
.movement-row p { margin: 3px 0 0; font-size: 12px; }
.movement-actor { white-space: nowrap; }

.payroll-shell { width: min(1240px, calc(100% - 32px)); margin: 42px auto 70px; }
.payroll-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 25px; }
.payroll-intro > div { max-width: 790px; }
.payroll-intro h1 { font-size: clamp(36px, 5vw, 56px); }
.payroll-intro p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); line-height: 1.55; }
.payroll-period { position: relative; width: min(330px, 100%); min-width: 270px; display: grid; gap: 7px; }
.payroll-period span, .payroll-search span, .painting-rule-form label > span, #allowance-form label > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.payroll-period::after { content: "⌄"; position: absolute; right: 15px; bottom: 13px; color: var(--brand); font-size: 22px; font-weight: 900; line-height: 1; pointer-events: none; }
.payroll-period select { width: 100%; min-height: 48px; appearance: none; border: 1px solid rgba(23,54,47,.22); border-radius: 12px; padding: 10px 48px 10px 16px; background: rgba(255,255,255,.9); color: var(--brand); box-shadow: 0 8px 24px rgba(23,54,47,.08); font: inherit; font-size: 14px; font-weight: 850; cursor: pointer; }
.payroll-period select:hover { border-color: var(--brand); background: #fff; }
.payroll-period select:focus, .payroll-search input:focus, .payroll-settings-table input:focus, .painting-rule-form input:focus, #allowance-form input:focus { outline: 3px solid rgba(222,139,56,.18); border-color: var(--accent); }
.payroll-period select option { background: #fff; color: var(--ink); font-weight: 700; }
.payroll-search input, .payroll-settings-table input, .painting-rule-form input[type="number"], #allowance-form input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; color: var(--ink); }
.payroll-tabs { margin-bottom: 16px; }
.payroll-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.payroll-summary-grid > div { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 17px; padding: 19px; background: #fff; }
.payroll-summary-grid span { max-width: 130px; color: var(--muted); font-size: 12px; font-weight: 800; line-height: 1.35; }
.payroll-summary-grid strong { font-size: 27px; white-space: nowrap; }
.payroll-summary-grid .has-warning { border-color: rgba(222,139,56,.38); background: var(--accent-soft); }
.payroll-summary-grid .has-warning strong { color: #a45e18; }
.payroll-report-card, .payroll-employee-directory { overflow: hidden; }
.payroll-card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.payroll-card-head h2 { margin-bottom: 5px; font-size: 26px; }
.payroll-card-head p { max-width: 760px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.payroll-rule-chip { flex: 0 0 auto; border-radius: 999px; padding: 8px 12px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 850; white-space: nowrap; }
.payroll-report-wrap { max-height: min(68vh, 720px); overflow: auto; overscroll-behavior: contain; }
.payroll-report-wrap .payroll-table { border-collapse: separate; border-spacing: 0; }
.payroll-report-wrap .payroll-table thead th { position: sticky; top: 0; z-index: 3; background: #f2f2ee; box-shadow: 0 1px var(--line); }
.payroll-table { min-width: 1180px; }
.payroll-table td { vertical-align: top; white-space: nowrap; }
.payroll-table td:first-child { min-width: 190px; white-space: normal; }
.payroll-table td:first-child > strong, .payroll-table td:first-child > small { display: block; }
.payroll-table td:first-child > small { margin-top: 4px; color: var(--muted); }
.payroll-table tr.needs-rate { background: #fffaf3; }
.payroll-detail-link { margin-top: 8px; border: 0; padding: 0; background: transparent; color: var(--brand); font-size: 11px; font-weight: 850; cursor: pointer; }
.needs-rate-badge { display: inline-flex; border-radius: 999px; padding: 5px 8px; background: var(--accent-soft); color: #965718; font-size: 10px; font-weight: 900; }
.payroll-table td:last-child small { display: block; margin-top: 5px; color: var(--muted); }
@media (min-width:700px) and (max-width:1180px) {
  .payroll-shell{width:min(100% - 20px,1240px);margin-top:20px}
  .payroll-summary-grid{gap:8px}
  .payroll-summary-grid>div{min-height:78px;padding:12px}
  .payroll-summary-grid strong{font-size:22px}
  .payroll-card-head{gap:12px;padding:14px 16px}
  .payroll-card-head h2{font-size:22px}
  .payroll-card-head p{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;line-height:1.35}
  .payroll-table{min-width:960px;table-layout:fixed}
  .payroll-table th,.payroll-table td{padding:7px 7px;font-size:11px;line-height:1.25}
  .payroll-table th{white-space:normal;overflow-wrap:anywhere}
  .payroll-table td:first-child{min-width:0;width:145px}
  .payroll-table th:first-child{width:145px}
  .payroll-table td:first-child>strong,.payroll-table td:first-child>small{overflow-wrap:anywhere;line-height:1.2}
  .payroll-table td:nth-child(8),.payroll-table td:nth-child(9),.payroll-table td:nth-child(10){white-space:normal}
  .payroll-detail-link{margin-top:5px}
}
.payroll-empty { min-height: 260px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.payroll-empty strong { color: var(--ink); font-size: 20px; }
.payroll-empty p { margin: 7px 0 0; }
.payroll-search { width: min(330px, 100%); display: grid; gap: 7px; }
.payroll-employee-tools { display: flex; align-items: flex-end; gap: 10px; }
.payroll-employee-tools > label { display: grid; gap: 7px; }
.payroll-employee-tools label > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.payroll-employee-tools select { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; color: var(--ink); }
.payroll-settings-wrap { margin: 0; }
.payroll-settings-table { width: 100%; min-width: 1080px; table-layout: fixed; }
.payroll-settings-table th { white-space: normal; line-height: 1.35; }
.payroll-settings-table th:nth-child(1) { width: 200px; }
.payroll-settings-table th:nth-child(2) { width: 130px; }
.payroll-settings-table th:nth-child(3) { width: 125px; }
.payroll-settings-table th:nth-child(4) { width: 130px; }
.payroll-settings-table th:nth-child(5) { width: 150px; }
.payroll-settings-table th:nth-child(6) { width: 135px; }
.payroll-settings-table th:nth-child(7) { width: 150px; }
.payroll-settings-table td { vertical-align: middle; }
.payroll-settings-table td:first-child > strong, .payroll-settings-table td:first-child > small { display: block; }
.payroll-settings-table td:first-child > small { margin-top: 5px; color: var(--muted); }
.payroll-settings-table tr.is-inactive { background: #f5f5f2; opacity: .72; }
.payroll-settings-table input { width: 100%; min-width: 0 !important; padding-inline: 8px; text-align: right; }
.employee-name-edit { width: 100%; display: grid; gap: 4px; border: 0; padding: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.employee-name-edit:hover strong { color: var(--brand); text-decoration: underline; }
.employee-name-edit small { color: var(--muted); line-height: 1.3; }
.allowance-cell { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.allowance-cell > span { min-width: 0; display: grid; gap: 4px; }
.allowance-cell > span strong { color: var(--brand); }
.allowance-cell > span small { max-width: 190px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.allowance-cell > button { flex: 0 0 auto; min-height: 34px; border: 0; border-radius: 9px; padding: 7px 8px; background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 850; cursor: pointer; }
.payroll-row-save { min-height: 40px; white-space: nowrap; }
.payroll-row-save:disabled { opacity: .55; cursor: wait; }
.schedule-cell-button { width: 100%; min-height: 36px; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 9px; padding: 7px 8px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.schedule-cell-button:hover { border-color: var(--brand); background: var(--brand-soft); }
.schedule-cell-button small { color: var(--muted); font-size: 10px; }
.payroll-row-actions { display: flex; align-items: center; gap: 5px; }
.payroll-row-actions > button { min-width: 0; padding-inline: 6px; font-size: 10px; }
.payroll-row-actions .payroll-row-save { flex: 1.25 1 0; }
.payroll-row-actions .archive-employee-btn { flex: .85 1 0; }
.archive-employee-btn { min-height: 34px; border: 0; border-radius: 9px; padding: 7px 9px; background: #efefec; color: var(--muted); font-size: 10px; font-weight: 850; cursor: pointer; }
.archive-employee-btn.restore { background: var(--brand-soft); color: var(--brand); }
.painting-rule-form label, #allowance-form label { display: grid; gap: 7px; }
.allowance-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid var(--line); border-radius: 11px; padding: 10px 11px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.allowance-row.is-inactive { opacity: .58; background: #f1f1ee; }
.allowance-row + .allowance-row { margin-top: 7px; }
.allowance-row span { display: grid; gap: 3px; }
.allowance-row small, .allowance-empty { color: var(--muted); font-size: 10px; }
.allowance-row b { color: var(--brand); white-space: nowrap; }
.allowance-empty { margin: 8px 0 0; }
.payroll-rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.payroll-rule-card, .payroll-schedule-card { padding: 24px; }
.payroll-rule-card > p, .payroll-schedule-card > div > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.payroll-rule-card dl { display: grid; gap: 1px; overflow: hidden; margin: 20px 0 0; border: 1px solid var(--line); border-radius: 13px; background: var(--line); }
.payroll-rule-card dl div { display: flex; justify-content: space-between; gap: 18px; padding: 12px 14px; background: #fff; }
.payroll-rule-card dt { color: var(--muted); }
.payroll-rule-card dd { margin: 0; font-weight: 850; }
.painting-rule-form { display: grid; gap: 13px; }
.switch-row { display: flex !important; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 13px; padding: 12px; background: #fafaf8; }
.switch-row input { width: 21px; height: 21px; accent-color: var(--brand); }
.switch-row > span { display: grid; gap: 3px; }
.switch-row small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.payroll-schedule-card { grid-column: span 2; }
.payroll-schedule-card article { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); padding: 14px 0; }
.payroll-schedule-card article > div { display: grid; gap: 4px; }
.payroll-schedule-card article small { color: var(--muted); }
.payroll-schedule-card article > span { border-radius: 999px; padding: 7px 10px; background: #efefec; font-size: 12px; font-weight: 850; white-space: nowrap; }
.payroll-internal-note { margin: 16px 3px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.payroll-allowance-modal { --modal-width: 600px; }
.allowance-manager-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.allowance-manager-head p { max-width: 390px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.allowance-manager-head .primary-btn { min-height: 42px; padding: 9px 13px; white-space: nowrap; }
.allowance-manager-list { display: grid; gap: 7px; }
.payroll-empty.compact { min-height: 150px; border: 1px dashed var(--line); border-radius: 13px; }
.payroll-empty.compact strong { font-size: 17px; }
.piecework-summary-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 14px; padding: 22px 24px; }
.piecework-summary-card h2 { margin: 3px 0 5px; }
.piecework-summary-card p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; }
.piecework-summary-card > strong { color: var(--brand); font-size: 28px; white-space: nowrap; }
.piecework-card { overflow: visible; }
.piecework-form { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr auto; align-items: end; gap: 12px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.piecework-form label { display: grid; gap: 7px; }
.piecework-form label > span, .piecework-preview span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.piecework-form input, .piecework-form select { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; color: var(--ink); }
.piecework-preview { min-height: 44px; display: grid; align-content: center; gap: 3px; border-radius: 10px; padding: 6px 12px; background: var(--brand-soft); }
.piecework-preview strong { color: var(--brand); font-size: 18px; }
.piecework-total { display: flex; justify-content: space-between; gap: 16px; padding: 18px 24px; background: #fafaf8; }
.piecework-total span { color: var(--muted); font-weight: 800; }
.piecework-total strong { color: var(--brand); font-size: 22px; }
.piecework-table { min-width: 720px; }
.piecework-period { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.piecework-period > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.piecework-period-trigger { min-width: 215px; text-align: left; }
.piecework-range-picker { position: absolute; z-index: 5; top: calc(100% - 6px); left: 24px; width: 310px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 14px 30px rgba(36, 47, 42, .18); }
.piecework-calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.piecework-calendar-head .icon-button { min-width: 36px; min-height: 36px; font-size: 22px; line-height: 1; }
.piecework-calendar-weekdays, .piecework-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.piecework-calendar-weekdays { margin-top: 8px; color: var(--muted); font-size: 10px; }
.piecework-calendar-grid { margin-top: 5px; }
.piecework-calendar-day, .piecework-calendar-empty { min-height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font: inherit; }
.piecework-calendar-day { cursor: pointer; }
.piecework-calendar-day:hover, .piecework-calendar-day.is-selected { background: var(--brand-soft); }
.piecework-calendar-day.is-range-start, .piecework-calendar-day.is-range-end { background: var(--brand); color: #fff; font-weight: 800; }
.piecework-range-picker p { margin: 10px 2px 0; color: var(--muted); font-size: 11px; }
#allowance-form { display: grid; gap: 14px; }
.allowance-date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.payroll-days-modal { --modal-width: 1100px; }
.payroll-modal-note { color: var(--muted); font-size: 12px; }
.payroll-days-table { min-width: 940px; }
.allowance-breakdown { display: grid; gap: 5px; margin-top: 15px; border-radius: 13px; padding: 13px 15px; background: var(--brand-soft); }
.allowance-breakdown span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.payroll-schedule-modal, .payroll-absence-modal { --modal-width: 640px; }
#schedule-form, #absence-form, #new-employee-form, #employee-profile-form { display: grid; gap: 14px; }
#schedule-form > label, #absence-form > label, #new-employee-form label, #employee-profile-form > label { display: grid; gap: 7px; }
#schedule-form label > span, #absence-form label > span, #new-employee-form label > span, #employee-profile-form > label > span, .schedule-weekdays > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
#schedule-form input, #schedule-form select, #absence-form input, #absence-form select, #absence-form textarea, #new-employee-form input, #new-employee-form select, #employee-profile-form > label input, #employee-profile-form > label select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; color: var(--ink); }
#new-employee-form input:focus, #new-employee-form select:focus, #employee-profile-form input:focus, #employee-profile-form select:focus { outline: 3px solid rgba(222,139,56,.18); border-color: var(--accent); }
#absence-form textarea { min-height: 95px; resize: vertical; }
.schedule-weekdays { display: grid; gap: 8px; }
.schedule-weekdays > div { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; }
.schedule-weekdays label { position: relative; }
.schedule-weekdays input { position: absolute; opacity: 0; pointer-events: none; }
.schedule-weekdays b { min-height: 43px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.schedule-weekdays input:checked + b { border-color: var(--brand); background: var(--brand); color: #fff; }
.schedule-weekdays small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.schedule-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.schedule-form-grid label { display: grid; gap: 7px; }
.employee-create-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.employee-field-wide { grid-column: 1 / -1; }
.employee-modal-actions { display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); padding-top: 15px; }
.employee-modal-actions button { min-width: 150px; }
.schedule-history { display: grid; gap: 6px; margin-top: 17px; border-top: 1px solid var(--line); padding-top: 14px; }
.schedule-history span { border-radius: 9px; padding: 8px 10px; background: #f5f5f2; color: var(--muted); font-size: 11px; }
.timesheet-card, .absence-register { overflow: hidden; }
.timesheet-wrap { margin: 0; max-height: 66vh; }
.timesheet-table { min-width: max-content; border-collapse: separate; border-spacing: 0; }
.timesheet-table th, .timesheet-table td { min-width: 43px; padding: 7px 5px; text-align: center; }
.timesheet-table th { position: sticky; top: 0; z-index: 2; background: #f2f2ee; }
.timesheet-table th small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.timesheet-table .timesheet-person-head, .timesheet-table .timesheet-person { min-width: 210px; position: sticky; left: 0; z-index: 3; text-align: left; background: #fff; box-shadow: 1px 0 var(--line); }
.timesheet-table .timesheet-person-head { z-index: 4; background: #f2f2ee; }
.timesheet-person strong, .timesheet-person small, .timesheet-total strong, .timesheet-total small { display: block; }
.timesheet-person small, .timesheet-total small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.timesheet-day b { font-size: 11px; }
.timesheet-day span { color: #a5aaa7; }
.timesheet-day.worked { background: #e9f4ef; color: var(--success); }
.timesheet-day.worked_day_off { background: #fff0dc; color: #965718; }
.timesheet-day.absence, .timesheet-day.absence_with_work { background: #eee8f6; color: #68468f; }
.timesheet-day.scheduled_no_work { background: #fbece9; color: var(--danger); }
.timesheet-day.day_off { background: #f1f1ee; }
.timesheet-total { min-width: 125px !important; background: #fafaf8; text-align: left !important; }
.timesheet-legend { display: flex; flex-wrap: wrap; gap: 13px; border-top: 1px solid var(--line); padding: 13px 18px; background: #fafaf8; }
.timesheet-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.timesheet-legend i { width: 12px; height: 12px; border-radius: 3px; background: #eee; }
.timesheet-legend i.worked { background: #e9f4ef; }
.timesheet-legend i.worked_day_off { background: #fff0dc; }
.timesheet-legend i.absence { background: #eee8f6; }
.timesheet-legend i.scheduled_no_work { background: #fbece9; }
.timesheet-legend i.day_off { background: #f1f1ee; }
.absence-table { min-width: 980px; }
.absence-table tr.is-inactive { opacity: .58; background: #f5f5f2; }
.absence-type { display: inline-flex; border-radius: 999px; padding: 5px 8px; background: #eee8f6; color: #68468f; font-size: 10px; font-weight: 850; }
.absence-calendar-toolbar { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(360px, 1.3fr); gap: 14px; padding: 0 24px 18px; align-items: end; }
.absence-calendar-toolbar label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.absence-calendar-toolbar select { min-height: 44px; border: 1px solid var(--line); border-radius: 11px; background: #fff; padding: 0 11px; font: inherit; }
.absence-type-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.absence-type-choice { min-height: 44px; border: 2px solid transparent; border-radius: 11px; font-weight: 850; cursor: pointer; }
.absence-type-choice.vacation, .absence-calendar-day.vacation, .absence-calendar-legend .vacation { background: #dff2e8; color: #23644c; }
.absence-type-choice.sick_leave, .absence-calendar-day.sick_leave, .absence-calendar-legend .sick_leave { background: #e4edfb; color: #315b94; }
.absence-type-choice.unpaid_leave, .absence-calendar-day.unpaid_leave, .absence-calendar-legend .unpaid_leave { background: #fff0d7; color: #8a5816; }
.absence-type-choice.other, .absence-calendar-day.other, .absence-calendar-legend .other, .absence-type.other { background: #fde5e2; color: #a3362d; }
.absence-problem { color: #b42318; }
.absence-type-choice.is-active { border-color: currentColor; box-shadow: 0 0 0 2px #fff inset; }
.absence-calendar-day.is-range-selected { outline: 2px solid var(--brand); outline-offset: -3px; }
.absence-range-hint { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 12px; padding: 10px 12px; background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 750; }
.absence-range-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.absence-range-actions button { min-height: 40px; border-radius: 10px; padding: 8px 16px; font: inherit; font-size: 13px; font-weight: 900; cursor: pointer; }
.absence-range-save { border: 1px solid var(--brand); background: var(--brand); color: #fff; }
.absence-range-clear { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.absence-calendar-weekdays, .absence-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; padding: 0 24px; }
.absence-calendar-weekdays { margin-bottom: 7px; color: var(--muted); text-align: center; font-size: 11px; }
.absence-calendar-day { display: grid; min-height: 74px; padding: 9px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.absence-calendar-day span { font-size: 16px; font-weight: 900; }
.absence-calendar-day b { justify-self: end; align-self: end; }
.absence-calendar-day i { justify-self: end; align-self: end; color: var(--muted); font-size: 9px; font-style: normal; }
.absence-calendar-day.is-range-start { outline: 3px solid var(--brand); outline-offset: 2px; }
.absence-calendar-legend { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 24px 4px; }
.absence-calendar-legend span { border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 850; }
.absence-register-head { margin-top: 18px; border-top: 1px solid var(--line); }
.absence-summary-range { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.absence-summary-range label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.absence-summary-range input { min-height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 9px; background: #fff; color: var(--ink); }
.absence-rules-card, .import-issues-card { grid-column: 1 / -1; }
.absence-rule-list { display: grid; gap: 8px; margin-top: 16px; }
.absence-pay-rule-form { display: grid; grid-template-columns: minmax(180px, 1fr) 130px 150px 100px; gap: 10px; align-items: end; padding: 11px; border: 1px solid var(--line); border-radius: 12px; }
.absence-pay-rule-form > span, .absence-pay-rule-form label { display: grid; gap: 3px; }
.absence-pay-rule-form small, .absence-pay-rule-form label span { color: var(--muted); font-size: 10px; }
.absence-pay-rule-form input { min-height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 9px; }
.absence-pay-rule-form button { min-height: 38px; border: 0; border-radius: 9px; background: var(--brand); color: #fff; font-weight: 850; }
.rule-gap-note { margin-bottom: 0; color: #8a5816 !important; }
.import-issues-card ul { display: grid; gap: 8px; padding: 0; list-style: none; }
.import-issues-card li { display: grid; gap: 3px; padding: 11px 13px; border-left: 4px solid #e4a94f; border-radius: 8px; background: #fff8e8; }
.import-issues-card li span, .import-issues-card li small { color: var(--muted); }

@media (max-width: 760px) {
  .orders-statistics-head { align-items: stretch; flex-direction: column; }
  .orders-period-form { display: grid; grid-template-columns: 1fr 1fr; }
  .orders-period-form button { grid-column: 1 / -1; }
  .absence-calendar-toolbar { grid-template-columns: 1fr; padding-inline: 14px; }
  .absence-type-picker { grid-template-columns: repeat(2, 1fr); }
  .absence-range-hint { align-items: stretch; flex-direction: column; }
  .absence-range-actions { display: grid; grid-template-columns: 1fr; }
  .absence-calendar-weekdays, .absence-calendar-grid { padding-inline: 14px; gap: 4px; }
  .absence-calendar-day { min-height: 58px; padding: 6px; }
  .absence-pay-rule-form { grid-template-columns: 1fr 1fr; }
  .topbar { height: 68px; padding-inline: 17px; }
  .quiet-link { padding: 10px 8px; font-size: 13px; }
  .shell, .admin-shell { width: min(100% - 20px, 920px); margin-top: 16px; }
  .work-card { padding: 22px 18px; min-height: calc(100vh - 104px); border-radius: 18px; }
  .board-card { padding: 19px 14px; border-radius: 18px; }
  .production-page .board-heading { padding-right: 0; padding-top: 58px; }
  .production-detail-view .board-heading { padding-right: 0; }
  .section-board-grid { grid-template-columns: 1fr; }
  .section-selector-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .section-selector { min-height: 86px; padding: 13px; }
  .section-selector > span { font-size: 15px; }
  .selected-new-work { width: 100%; padding-inline: 10px; }
  .section-work-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-work-list .open-work-card { min-height: 100px; padding: 12px; }
  .step-header { align-items: center; }
  .production-detail-view .step-header { padding: 58px 0 0; }
  .step-header .lede { display: none; }
  .option-grid, .option-grid.sections, .employee-choice-columns { grid-template-columns: 1fr; }
  .section-card { min-height: 96px; }
  .section-card::before { width: 35px; height: 35px; border-width: 6px; top: 14px; }
  .quantity-layout { grid-template-columns: 1fr; }
  .current-grid { grid-template-columns: 1fr; }
  .action-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-actions { flex-direction: column; }
  .production-detail-view .summary-hero { margin-top: 58px; padding-right: 24px; }
  .reason-list { grid-template-columns: 1fr; }
  .admin-intro { display: block; }
  .prototype-badge { display: inline-flex; margin-top: 17px; }
  .admin-card { border-radius: 17px; }
  .history-filters { grid-template-columns: 1fr 1fr; padding: 16px; }
  .history-search { grid-column: span 2; }
  .history-groups { padding: 10px; }
  .shipments-shell, .access-shell, .payroll-shell { width: min(100% - 20px, 920px); margin-top: 20px; }
  .shipments-intro { display: block; }
  .shipments-intro-main { justify-content: space-between; }
  .shipments-intro .module-menu-trigger { width: 100%; margin-top: 10px; }
  .inventory-actions { display: grid; }
  .inventory-actions .compact-btn { margin-top: 0; }
  .inventory-intro-main { display: grid; }
  .production-page .module-topbar { top: 48px; right: 32px; }
  .shipment-summary-grid { grid-template-columns: 1fr 1fr 1fr; gap: 7px; }
  .shipment-summary { min-height: 76px; display: grid; gap: 4px; padding: 13px; }
  .shipment-summary strong { font-size: 26px; }
  .shipment-toolbar { grid-template-columns: 1fr; padding: 15px; }
  .shipment-card-head { grid-template-columns: 1fr auto; }
  .shipment-card-controls { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
  .shipment-date-block { justify-items: start; }
  .shipment-card-body { grid-template-columns: 1fr; padding-inline: 15px; }
  .shipment-facts { grid-template-columns: 1fr 1fr; }
  .shipment-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .shipment-form-grid { grid-template-columns: 1fr; }
  .shipment-form-actions { display: grid; }
  .shipment-form-actions .primary-btn, .shipment-form-actions .danger-btn { width: 100%; }
  .shipment-lines-head { display: grid; }
  .shipment-line { grid-template-columns: 1fr; }
  .access-grid { grid-template-columns: 1fr; }
  .access-role-card { min-height: 170px; }
  .inventory-shell { width: min(100% - 20px, 920px); margin-top: 20px; }
  .inventory-summary { grid-template-columns: 1fr 1fr 1fr; gap: 7px; }
  .inventory-summary > div { min-height: 58px; display: grid; padding: 9px 11px; }
  .inventory-summary strong { font-size: 23px; }
  .inventory-sync-status { align-items: flex-start; flex-direction: column; gap: 5px; }
  .inventory-sync-status span { text-align: left; }
  .inventory-product { grid-template-columns: 1fr auto; gap: 10px; padding: 15px; }
  .inventory-product button { grid-column: span 2; }
  .inventory-stock-scroll { overflow-x: auto; }
  .inventory-stock-table { min-width: 760px; }
  .sku-catalog-row { align-items: flex-start; padding: 14px 15px; }
  .marketplace-article-row { grid-template-columns: 1fr auto; align-items: start; padding: 13px 14px; }
  .marketplace-article-list { grid-column: 1 / -1; }
  .marketplace-article-add { grid-column: 2; grid-row: 1; }
  .marketplace-article-form-grid { grid-template-columns: 1fr; }
  .movement-row { grid-template-columns: 58px 1fr; }
  .movement-actor { grid-column: 2; }
  .payroll-intro { display: grid; }
  .payroll-period { min-width: 0; justify-self: end; }
  .payroll-summary-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .payroll-summary-grid > div { min-height: 82px; display: grid; padding: 13px; }
  .payroll-summary-grid strong { font-size: 23px; }
  .payroll-card-head { display: grid; padding: 17px; }
  .payroll-employee-tools { display: grid; }
  .payroll-rule-chip { white-space: normal; }
  .payroll-rules-grid { grid-template-columns: 1fr; padding: 10px; }
  .payroll-schedule-card { grid-column: auto; }
  .allowance-manager-head { display: grid; }
  .allowance-date-grid { grid-template-columns: 1fr; }
  .schedule-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .piecework-form { grid-template-columns: 1fr 1fr; }
  .piecework-summary-card { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

.auth-shell { width: min(520px, calc(100% - 28px)); }
/* Keep the login card out of view while a saved session is being checked. */
.session-check-pending > :is(.topbar, .access-shell) { visibility: hidden; }
.auth-card, .access-admin-card { border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); padding: clamp(24px, 5vw, 38px); }
.auth-card h1, .access-admin-card h1 { margin: 5px 0 12px; }
.auth-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.auth-form { display: grid; gap: 15px; margin-top: 24px; }
.auth-form label, .account-create-form label { display: grid; gap: 7px; }
.auth-form label span, .account-create-form label span { color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.auth-form input, .account-create-form input, .account-create-form select, .account-table input, .account-table select { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 11px; padding: 9px 11px; background: #fff; color: var(--ink); }
.auth-form .primary-btn { width: 100%; margin-top: 4px; }
.access-admin-shell { width: min(1500px, calc(100% - 32px)); margin: 34px auto 70px; display: grid; gap: 18px; }
.access-admin-card { overflow: hidden; }
.access-admin-card .section-heading { margin-bottom: 20px; }
.access-admin-card .section-heading h2 { margin: 0 0 6px; }
.access-admin-card .section-heading p { margin: 0; color: var(--muted); line-height: 1.5; }
.permission-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 15px; }
.permission-table { width: max-content; min-width: 100%; border-collapse: collapse; background: #fff; }
.permission-table th, .permission-table td { min-width: 84px; width: 84px; padding: 7px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.permission-table thead th { position: sticky; top: 0; z-index: 2; background: #f3f5f1; }
.permission-table thead th strong { display: block; max-width: 88px; overflow-wrap: normal; word-break: normal; hyphens: none; font-size: 10px; line-height: 1.15; }
.permission-table thead th strong span { display: block; white-space: nowrap; }
.permission-table th:first-child { position: sticky; left: 0; z-index: 3; min-width: 122px; width: 122px; max-width: 122px; background: #f7f7f3; }
.permission-table th small, .permission-role small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.permission-toggle { display: flex; align-items: center; gap: 5px; margin: 2px 0; font-size: 10px; font-weight: 750; }
.permission-toggle input { width: 15px; height: 15px; accent-color: var(--brand); }
.account-table { width: 100%; border-collapse: collapse; }
.account-table th, .account-table td { padding: 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.account-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.account-actions button { min-height: 38px; padding: 7px 10px; }
.account-create-form { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)) auto; align-items: end; gap: 12px; }
.personal-user-picker { width: min(460px, 100%); display: grid; gap: 7px; margin-bottom: 14px; }
.personal-user-filters { display: grid; grid-template-columns: repeat(2, minmax(220px, 460px)); gap: 12px; }
.personal-user-picker span { color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.personal-user-picker select, .personal-permission-table select { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; background: #fff; color: var(--ink); }
.personal-permission-table { width: 100%; }
.personal-permission-table th:first-child { min-width: 260px; }
.personal-selection-summary { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--brand-soft); }
.personal-selection-summary span, .personal-selection-summary small { color: var(--muted); font-size: 11px; }
.personal-selection-summary strong { color: var(--brand); }
.status-pill { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 850; white-space: nowrap; }
.status-pill.status-warning { background: var(--accent-soft); color: #965718; }
.nav-logout, .tablet-logout { border: 0; border-radius: 11px; padding: 11px 14px; background: var(--brand-soft); color: var(--brand); font-weight: 850; cursor: pointer; }
.tablet-logout { margin-left: auto; }
.matrix-editable.is-readonly { cursor: default; }
.inline-action { display: inline-flex; width: fit-content; margin-top: 16px; text-decoration: none; }

@media (max-width: 900px) {
  .account-create-form { grid-template-columns: 1fr 1fr; }
  .account-create-form .primary-btn { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .account-create-form { grid-template-columns: 1fr; }
  .access-admin-shell { width: min(100% - 20px, 1500px); margin-top: 20px; }
  .personal-user-filters { grid-template-columns: 1fr; }
  .employee-create-grid { grid-template-columns: 1fr; }
  .employee-field-wide { grid-column: auto; }
  .employee-modal-actions { display: grid; }
  .employee-modal-actions button { width: 100%; }
}

.audit-shell { max-width: 1500px; }
.audit-intro { min-height: 0; }
.audit-intro h1 { margin: 0; }
.audit-filter-card { padding-block: 18px; }
.audit-filters { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); align-items: end; gap: 10px; }
.audit-filters label { display: grid; gap: 6px; }
.audit-filters label > span { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.audit-filters input, .audit-filters select { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; background: #fff; color: var(--ink); }
.audit-search { grid-column: span 2; }
.audit-filter-actions { display: flex; gap: 7px; }
.audit-filter-actions button { min-height: 40px; padding: 8px 12px; }
.audit-list-card { padding: 0; overflow: hidden; }
.audit-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.audit-list-head small { color: var(--muted); }
.audit-table { width: 100%; min-width: 980px; border-collapse: collapse; }
.audit-table th, .audit-table td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.audit-table thead th { color: var(--muted); font-size: 10px; letter-spacing: .055em; text-transform: uppercase; }
.audit-table tbody tr:hover { background: #fafaf8; }
.audit-table td strong, .audit-table td small { display: block; }
.audit-table td small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.audit-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.audit-module { display: inline-flex; border-radius: 999px; padding: 5px 8px; background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 850; white-space: nowrap; }
.audit-details { min-width: 100px; }
.audit-details summary { color: var(--brand); font-size: 11px; font-weight: 850; cursor: pointer; }
.audit-details[open] { min-width: 360px; }
.audit-details > div { margin-top: 9px; border-radius: 10px; padding: 10px; background: #f4f5f2; }
.audit-details-grid { display: grid; gap: 7px; margin: 0; }
.audit-details-grid > div { display: grid; grid-template-columns: minmax(100px, .7fr) minmax(150px, 1.3fr); gap: 10px; }
.audit-details-grid dt { color: var(--muted); font-size: 10px; }
.audit-details-grid dd { margin: 0; overflow-wrap: anywhere; font-size: 11px; }
.audit-detail-list { display: grid; gap: 5px; margin: 0; padding-left: 18px; }
.audit-muted { color: var(--muted); }

@media (max-width: 1000px) {
  .audit-filters { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}

@media (max-width: 620px) {
  .audit-filters { grid-template-columns: 1fr; }
  .audit-search { grid-column: auto; }
  .audit-filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .audit-list-head { display: grid; gap: 4px; }
}

/* Active work is a tablet control screen: navigation and the main
   actions stay in the first viewport, while work facts remain compact. */
.active-work-view .shell { margin-top: 70px; }
.active-work-card {
  min-height: 0;
  padding: 26px 28px;
}
.active-work-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}
.active-work-title { min-width: 0; }
.active-work-title h1 {
  margin: 5px 0 4px;
  font-size: clamp(26px, 4vw, 36px);
}
.active-work-title > p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.active-work-actions { margin-bottom: 12px; }
.active-work-actions .blocking-note { margin-top: 8px; }
.active-work-card .action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.active-pause-context {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 4px 12px;
  margin: 12px 0;
  padding: 10px 13px;
  border: 1px solid rgba(222, 139, 56, 0.22);
  border-radius: 13px;
  background: var(--accent-soft);
}
.active-pause-context > span { color: #76502b; font-size: 11px; font-weight: 750; }
.active-pause-context > strong { overflow-wrap: anywhere; }
.active-pause-context > p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: #76502b;
  font-size: 12px;
  line-height: 1.4;
}
.active-work-card .legacy-sku-warning { margin: 12px 0; }
.active-work-card .current-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 12px 0 0;
  border-radius: 14px;
}
.active-work-card .current-item { min-width: 0; padding: 10px 12px; }
.active-work-card .current-item small { margin-bottom: 3px; font-size: 10px; }
.active-work-card .current-item strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.25;
}
.work-quantity-modal { --modal-width: 480px; }
.work-quantity-form { display: grid; gap: 13px; }
.work-quantity-form > label { color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.work-quantity-form .quantity-control { grid-template-columns: 52px minmax(90px, 1fr) 52px; }
.work-quantity-form .quantity-control button { min-height: 58px; }
.work-quantity-form .quantity-control input { min-height: 58px; font-size: 28px; }
.work-quantity-form .hint { margin: 0; }
.work-quantity-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 3px; }
.work-quantity-actions button { min-height: 52px; padding: 11px 16px; }

@media (max-width: 900px) {
  .active-work-card .current-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .active-work-view .shell { margin-top: 104px; }
  .active-work-card { min-height: 0; padding: 16px 14px; }
  .active-work-header { gap: 10px; margin-bottom: 12px; }
  .production-detail-view .active-work-header { padding-right: 0; }
  .active-work-title h1 { font-size: 25px; }
  .active-work-title > p { font-size: 11px; }
  .active-work-card .action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .active-work-card .action-grid button { min-height: 90px; padding-inline: 10px; font-size: 16px; }
  .active-work-card .current-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .active-work-card .current-item { padding: 9px 10px; }
}

@media (max-width: 540px) {
  .active-work-card .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .active-work-card .active-work-edit-btn { grid-column: 1 / -1; min-height: 58px; }
  .active-work-card .current-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .active-work-title h1 { font-size: 22px; }
  .production-page .module-topbar { right: 14px; gap: 6px; }
  .production-context-back, .production-page .module-topbar .module-menu-trigger, .production-page .module-topbar .tablet-logout { padding-inline: 10px; font-size: 13px; }
}

/* Finance: compact payment calendar prototype. */
.cashflow-shell { width: min(1420px, calc(100% - 32px)); margin: 38px auto 72px; }
.cashflow-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 18px; }
.cashflow-intro > div:first-child { max-width: 820px; }
.cashflow-intro h1 { margin: 3px 0 8px; font-size: clamp(36px, 5vw, 54px); }
.cashflow-intro p:not(.eyebrow) { margin: 0; color: var(--muted); line-height: 1.5; }
.cashflow-horizon { display: flex; gap: 9px; }
.cashflow-horizon-value { min-width: 180px; display: grid; align-content: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; background: #fff; }
.cashflow-horizon-value span { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.cashflow-horizon-value strong { font-size: 13px; }
.cashflow-horizon-value small { color: var(--muted); font-size: 8px; }
.cashflow-horizon label, .cashflow-settings > label, .cashflow-form-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.cashflow-horizon input, .cashflow-horizon select, .cashflow-settings input, .cashflow-settings select, .cashflow-form-grid input, .cashflow-form-grid select { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; background: #fff; color: var(--ink); font: inherit; }
.cashflow-settings { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); align-items: end; gap: 11px; margin-bottom: 11px; padding: 14px; }
.cashflow-settings .primary-btn { min-height: 42px; white-space: nowrap; }
.cashflow-add-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.cashflow-add-actions button { min-height: 42px; padding-inline: 12px; white-space: nowrap; }
.cashflow-demo-note { margin: 0 0 11px; border: 1px solid rgba(222,139,56,.28); border-radius: 11px; padding: 9px 13px; background: var(--accent-soft); color: #79502a; font-size: 11px; line-height: 1.4; }
.money-input { display: grid; grid-template-columns: 1fr auto; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.money-input input { min-width: 0; border: 0 !important; border-radius: 0 !important; }
.money-input b { padding: 0 12px; color: var(--brand); font-size: 14px; }
.cashflow-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 11px; }
.cashflow-summary > div { min-height: 84px; display: grid; align-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; background: #fff; }
.cashflow-summary span { color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.cashflow-summary strong { font-size: clamp(18px, 2vw, 25px); white-space: nowrap; }
.cashflow-summary strong.positive { color: var(--brand); }
.cashflow-summary .has-warning { border-color: rgba(222,139,56,.38); background: var(--accent-soft); }
.cashflow-summary .has-warning strong { color: #a45e18; }
.cashflow-summary .has-danger { border-color: rgba(163,59,50,.4); background: var(--danger-soft); }
.cashflow-summary .has-danger strong { color: var(--danger); }
.cashflow-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 11px; align-items: start; }
.cashflow-main { min-width: 0; overflow: hidden; }
.cashflow-section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px 12px; }
.cashflow-section-head h2, .cashflow-side h2 { margin: 2px 0 0; font-size: 22px; }
.cashflow-section-head > div:first-child > small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.cashflow-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.cashflow-legend span { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 8px; font-size: 9px; font-weight: 850; }
.cashflow-legend span::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.cashflow-legend .is-own { background: var(--brand-soft); color: var(--brand); }
.cashflow-legend .is-overdraft { background: var(--accent-soft); color: #a45e18; }
.cashflow-legend .is-gap { background: var(--danger-soft); color: var(--danger); }
.cashflow-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cashflow-table th { position: sticky; top: 0; z-index: 1; padding: 9px 12px; background: #f5f7f6; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.cashflow-table td { height: 48px; border-top: 1px solid var(--line); padding: 7px 12px; vertical-align: middle; }
.cashflow-table td:first-child { width: 105px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: capitalize; white-space: nowrap; }
.cashflow-table td:nth-child(2) { min-width: 205px; }
.cashflow-table td:nth-child(2) strong, .cashflow-table td:nth-child(2) small { display: block; }
.cashflow-table td:nth-child(2) small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.cashflow-table .money-cell { text-align: right; white-space: nowrap; }
.cashflow-operation-link { width: 100%; border: 0; padding: 0; background: none; color: inherit; cursor: pointer; text-align: left; }
.cashflow-operation-link:hover strong { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.cashflow-week-row td { height: auto; border-top: 2px solid rgba(23,54,47,.14); padding: 8px 12px 6px; background: var(--brand-soft); color: var(--brand) !important; font-size: 10px !important; font-weight: 900 !important; letter-spacing: .04em; text-transform: uppercase !important; }
.cashflow-table .is-income { color: var(--brand); font-weight: 800; }
.cashflow-table .is-expense { color: #8a4c35; }
.cashflow-table .balance-cell { color: var(--ink); font-weight: 900; }
.cashflow-table tr.is-overdraft { background: rgba(255, 238, 215, .62); }
.cashflow-table tr.is-overdraft .balance-cell { color: #a45e18; }
.cashflow-table tr.is-cash-gap { background: var(--danger-soft); }
.cashflow-table tr.is-cash-gap .balance-cell, .cashflow-table tr.is-cash-gap .cashflow-status { color: var(--danger); }
.cashflow-status { display: inline-flex; border-radius: 999px; padding: 4px 7px; background: #f0f3f2; color: var(--muted); font-size: 9px; font-weight: 850; white-space: nowrap; }
.cashflow-weeks { display: grid; gap: 10px; padding: 0 12px 12px; }
.cashflow-flow-tabs { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto; gap: 7px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 9px 12px; background: #fafbfa; }
.cashflow-flow-tabs > button:not(.primary-btn) { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; color: var(--muted); cursor: pointer; text-align: left; }
.cashflow-flow-tabs > button:not(.primary-btn) span { font-size: 12px; font-weight: 900; }
.cashflow-flow-tabs > button:not(.primary-btn) strong { font-size: 13px; }
.cashflow-flow-tabs > button.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.cashflow-flow-tabs .primary-btn { min-height: 42px; }
.cashflow-filtered-table { width: 100%; border-collapse: collapse; }
.cashflow-filtered-table th { padding: 8px 11px; background: #f5f7f6; color: var(--muted); font-size: 9px; font-weight: 900; text-align: left; text-transform: uppercase; }
.cashflow-filtered-table td { border-top: 1px solid var(--line); padding: 8px 11px; font-size: 10px; vertical-align: middle; }
.cashflow-filtered-table td:first-child { width: 105px; color: var(--muted); white-space: nowrap; }
.cashflow-filtered-table td:nth-child(2) { min-width: 210px; }
.cashflow-filtered-table td:nth-child(3) { width: 120px; text-align: right; white-space: nowrap; }
.cashflow-filtered-table td:nth-child(4) { width: 110px; }
.cashflow-filtered-table .cashflow-operation-link small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.cashflow-filtered-table b.is-income { color: var(--brand); }
.cashflow-filtered-table b.is-expense { color: #8a4c35; }
.cashflow-filtered-week td { border-top: 2px solid rgba(23,54,47,.14); padding: 8px 11px; background: var(--brand-soft); }
.cashflow-filtered-week td > div { display: flex; align-items: baseline; gap: 12px; }
.cashflow-filtered-week span { color: var(--brand); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.cashflow-filtered-week strong { margin-left: auto; font-size: 12px; }
.cashflow-filtered-week small { color: var(--muted); font-size: 8px; }
.cashflow-filtered-week small b.is-overdraft { color: #a45e18; }
.cashflow-filtered-week small b.is-gap { color: var(--danger); }
.cashflow-week-block { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.cashflow-week-block > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 13px; background: #f5f7f6; }
.cashflow-week-block > header > div { display: grid; gap: 2px; }
.cashflow-week-block > header span { color: var(--brand); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.cashflow-week-block > header small { color: var(--muted); font-size: 9px; }
.cashflow-week-block > header > strong { display: grid; justify-items: end; font-size: 17px; }
.cashflow-week-block > header > strong.is-overdraft { color: #a45e18; }
.cashflow-week-block > header > strong.is-gap { color: var(--danger); }
.cashflow-week-columns { display: grid; grid-template-columns: 1fr 1fr; }
.cashflow-flow-column + .cashflow-flow-column { border-left: 1px solid var(--line); }
.cashflow-flow-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding: 8px 10px; }
.cashflow-flow-head > div { display: grid; gap: 1px; }
.cashflow-flow-head span { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.cashflow-flow-head strong { font-size: 13px; }
.cashflow-flow-column.is-income .cashflow-flow-head strong { color: var(--brand); }
.cashflow-flow-head button { border: 0; border-radius: 8px; padding: 6px 8px; background: var(--brand-soft); color: var(--brand); font-size: 9px; font-weight: 850; cursor: pointer; }
.cashflow-flow-item { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 44px; border-top: 1px solid rgba(23,54,47,.08); padding: 6px 10px; }
.cashflow-flow-head + .cashflow-flow-item { border-top: 0; }
.cashflow-flow-item time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.cashflow-flow-item .cashflow-operation-link strong { font-size: 10px; }
.cashflow-flow-item .cashflow-operation-link small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.cashflow-flow-item > b { font-size: 11px; white-space: nowrap; }
.cashflow-flow-column.is-income .cashflow-flow-item > b { color: var(--brand); }
.cashflow-flow-column > .empty { padding: 14px 10px; }
.cashflow-side { display: grid; gap: 11px; }
.cashflow-side .card { padding: 17px; }
.overdraft-card { border-color: rgba(222,139,56,.28); background: linear-gradient(145deg, #fff 0%, #fff7eb 100%); }
.overdraft-value { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 10px; margin-top: 16px; }
.overdraft-value span, .overdraft-value small, .overdraft-due span { color: var(--muted); font-size: 10px; }
.overdraft-value strong { font-size: 25px; }
.overdraft-value small { grid-column: 1 / -1; }
.overdraft-progress { height: 8px; margin: 10px 0 15px; border-radius: 999px; background: rgba(222,139,56,.18); overflow: hidden; }
.overdraft-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.overdraft-due { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid rgba(222,139,56,.2); padding-top: 12px; }
.overdraft-card > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.recurring-card ul { display: grid; gap: 0; margin: 13px 0; padding: 0; list-style: none; }
.recurring-card li { display: grid; gap: 2px; border-top: 1px solid var(--line); padding: 9px 0; }
.recurring-card li strong { font-size: 11px; }
.recurring-card li span { color: var(--muted); font-size: 9px; }
.recurring-card .secondary-btn { width: 100%; min-height: 38px; }
.cashflow-modal { --modal-width: 560px; }
.cashflow-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 15px; }
.cashflow-form-grid .wide { grid-column: 1 / -1; }

@media (max-width: 1100px) {
  .cashflow-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cashflow-layout { grid-template-columns: 1fr; }
  .cashflow-side { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .cashflow-shell { width: min(100% - 20px, 920px); margin-top: 20px; }
  .cashflow-intro { display: grid; gap: 14px; }
  .cashflow-horizon { display: grid; grid-template-columns: 1fr 1fr; }
  .cashflow-settings { grid-template-columns: 1fr 1fr; }
  .cashflow-add-actions { grid-column: 1 / -1; }
  .cashflow-summary { grid-template-columns: 1fr 1fr; }
  .cashflow-side { grid-template-columns: 1fr; }
  .cashflow-section-head { align-items: flex-start; flex-direction: column; }
  .cashflow-flow-tabs { grid-template-columns: 1fr 1fr; }
  .cashflow-flow-tabs .primary-btn { grid-column: 1 / -1; }
  .cashflow-week-columns { grid-template-columns: 1fr; }
  .cashflow-flow-column + .cashflow-flow-column { border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 460px) {
  .cashflow-horizon, .cashflow-settings, .cashflow-form-grid { grid-template-columns: 1fr; }
  .cashflow-form-grid .wide, .cashflow-add-actions { grid-column: auto; }
  .cashflow-summary > div { min-height: 72px; padding: 11px; }
  .cashflow-summary strong { font-size: 18px; }
  .cashflow-flow-tabs { grid-template-columns: 1fr; }
  .cashflow-flow-tabs .primary-btn { grid-column: auto; }
  .cashflow-filtered-week td > div { align-items: flex-start; flex-wrap: wrap; }
  .cashflow-filtered-week strong { margin-left: 0; }
}
.claims-shell{max-width:1440px;margin:0 auto;padding:20px 28px 48px}.claims-intro{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:14px}.claims-intro h1{margin:2px 0 5px;font-size:clamp(28px,3.5vw,43px)}.claims-intro p{max-width:720px;margin:0;color:var(--muted)}.claims-intro .primary-btn{min-height:42px;padding:0 18px}.claims-summary{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;margin-bottom:10px}.claims-summary>div{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border:1px solid var(--line);border-radius:13px;background:#fff}.claims-summary span{color:var(--muted);font-size:12px}.claims-summary strong{font-size:22px}.claims-summary .has-danger{border-color:#e9aaa2;background:#fff4f2;color:#9f2f22}.claims-board{padding:0;overflow:hidden}.claims-toolbar{display:flex;justify-content:space-between;align-items:end;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line)}.claims-filters{display:grid;grid-template-columns:repeat(5,minmax(125px,1fr));gap:8px;flex:1}.claims-filters label,.claims-search{display:block}.claims-filters span,.claims-search span{display:block;margin-bottom:4px;font-size:10px;color:var(--muted);font-weight:800}.claims-filters input,.claims-filters select,.claims-search input{width:100%;min-height:38px;border:1px solid var(--line);border-radius:9px;padding:0 10px;background:#fff;color:var(--ink);font:inherit}.claims-search{min-width:230px}.claims-table-wrap{overflow:auto}.claims-table{width:100%;border-collapse:collapse;min-width:1050px}.claims-table th{padding:10px 12px;text-align:left;color:var(--muted);font-size:11px;background:#f7f8f5;border-bottom:1px solid var(--line)}.claims-table td{padding:11px 12px;border-bottom:1px solid var(--line);vertical-align:middle}.claims-table td>strong,.claim-link strong{display:block}.claims-table td>small,.claim-link small{display:block;margin-top:3px;color:var(--muted)}.claim-link{padding:0;border:0;background:none;text-align:left;color:var(--ink);cursor:pointer}.claim-link:hover strong{text-decoration:underline}.claim-status{display:inline-flex;padding:6px 9px;border-radius:999px;background:#eef1ed;font-size:11px;font-weight:800;white-space:nowrap}.claim-status.is-new{background:#fff0d2;color:#845b00}.claim-status.is-review,.claim-status.is-production{background:#e8f0ff;color:#28589c}.claim-status.is-ready,.claim-status.is-shipped{background:#e4f3e8;color:#23633a}.claim-status.is-closed{color:#66726c}.claims-table .is-overdue{color:#a12d21;font-weight:700}.claims-table .is-overdue small{display:block}.claim-card{--modal-width:760px}.claim-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:20px}.claim-card-grid label span,.claim-comments label span{display:block;margin-bottom:7px;font-size:12px;color:var(--muted)}.claim-card-grid .wide{grid-column:1/-1}.claim-card-grid input,.claim-card-grid select,.claim-card-grid textarea,.claim-comments input{width:100%}.claim-card-grid textarea{min-height:78px;resize:vertical}.claim-comments{margin:0 20px 6px;padding:16px;border-radius:14px;background:#f6f7f3}.claim-comments h3{margin:0 0 12px}.claim-comments p{margin:8px 0;padding:10px 12px;border-radius:10px;background:#fff}.claim-comments label{display:block;margin-top:14px}@media(max-width:1050px){.claims-summary{grid-template-columns:repeat(3,1fr)}.claims-toolbar{align-items:stretch;flex-direction:column}.claims-filters{grid-template-columns:repeat(3,1fr)}.claims-search{min-width:0;width:100%}}@media(max-width:760px){.claims-shell{padding:16px 14px 38px}.claims-intro{align-items:stretch;flex-direction:column}.claims-intro .primary-btn{width:100%}.claims-summary{grid-template-columns:repeat(2,1fr)}.claims-filters{grid-template-columns:1fr 1fr}.claim-card-grid{grid-template-columns:1fr}.claim-card-grid .wide{grid-column:auto}}
.overdraft-amount-edit{display:flex;align-items:baseline;justify-content:flex-end;gap:4px}.overdraft-amount-edit input{width:118px;border:0;border-bottom:1px dashed rgba(23,54,47,.35);padding:0;background:transparent;color:var(--ink);font:inherit;font-size:25px;font-weight:850;text-align:right}.overdraft-amount-edit b{font-size:18px}.overdraft-due input{width:142px;border:0;border-bottom:1px dashed rgba(23,54,47,.28);padding:2px 0;background:transparent;color:var(--ink);font:inherit;font-weight:800}.overdraft-amount-edit input:focus,.overdraft-due input:focus{outline:0;border-bottom-color:var(--accent)}
.claim-card-grid label{display:block}.claim-card-grid label>span{font-weight:800;letter-spacing:.02em}.claim-card-grid input,.claim-card-grid select,.claim-card-grid textarea,.claim-comments input{min-height:48px;border:1px solid #d7dfd9;border-radius:12px;padding:0 14px;background:#fbfcfa;color:var(--ink);font:inherit;box-shadow:0 1px 0 rgba(18,48,41,.03);transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}.claim-card-grid textarea{min-height:92px;padding:12px 14px;line-height:1.45}.claim-card-grid input::placeholder,.claim-card-grid textarea::placeholder,.claim-comments input::placeholder{color:#9aa49e}.claim-card-grid input:focus,.claim-card-grid select:focus,.claim-card-grid textarea:focus,.claim-comments input:focus{outline:0;border-color:#4f8073;background:#fff;box-shadow:0 0 0 3px rgba(56,112,97,.12)}.claim-card-grid label:focus-within>span,.claim-comments label:focus-within>span{color:#2e6d5c}.claim-product-field{padding:13px 14px 15px;border:1px solid rgba(55,111,95,.18);border-radius:14px;background:#f2f7f3}.claim-product-field input{background:#fff;font-size:16px;font-weight:800}.claim-comments input{padding:0 14px}
.claim-product-field select{background:#fff;font-size:16px;font-weight:800}.claim-comments article{margin:9px 0;padding:11px 12px;border:1px solid #e1e7e2;border-radius:11px;background:#fff}.claim-comments article>div{display:flex;align-items:center;justify-content:space-between;gap:12px}.claim-comments article time{color:var(--muted);font-size:11px}.claim-comments article p{margin:6px 0 0;padding:0;background:transparent}.claim-comments>label{margin-top:14px}
.claim-action-field{padding:13px 14px 15px;border:1px solid rgba(218,145,54,.22);border-radius:14px;background:#fff8ed}.claim-action-field select{background:#fff;font-weight:800}
.logistics-page{max-width:1440px;margin:0 auto;padding:18px 24px}.logistics-intro{display:flex;align-items:flex-start;justify-content:space-between;min-height:76px;padding-right:140px;margin-bottom:12px}.logistics-intro h1{margin:4px 0 0}.logistics-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:12px}.logistics-summary>div{background:#fff;border:1px solid #e5e9ef;border-radius:14px;padding:12px 16px}.logistics-summary span,.logistics-table small{display:block;color:#788391;font-size:12px}.logistics-summary strong{font-size:24px}.logistics-panel{background:#fff;border:1px solid #e5e9ef;border-radius:16px;overflow:hidden}.logistics-toolbar{display:flex;gap:10px;align-items:center;padding:12px;border-bottom:1px solid #e5e9ef}.logistics-toolbar input{flex:1}.logistics-toolbar input,.logistics-toolbar select{height:38px;border:1px solid #d8dee7;border-radius:10px;padding:0 12px}.segmented{display:flex;background:#f0f3f7;border-radius:10px;padding:3px}.segmented button{border:0;background:transparent;padding:8px 14px;border-radius:8px}.segmented button.is-active{background:#fff;box-shadow:0 1px 4px #0002}.logistics-table td{vertical-align:middle}.cargo-direction{display:inline-flex;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:700}.cargo-direction.is-incoming{background:#e5f7ed;color:#167342}.cargo-direction.is-outgoing{background:#e9efff;color:#3457a7}@media(max-width:800px){.logistics-page{padding-inline:16px}.logistics-intro{padding-right:120px}.logistics-summary{grid-template-columns:repeat(2,1fr)}.logistics-toolbar{flex-wrap:wrap}.logistics-toolbar input{min-width:100%}}

.tasks-shell{width:min(1320px,calc(100% - 32px));margin:36px auto 70px}.tasks-intro{display:flex;align-items:flex-end;justify-content:space-between;gap:28px;margin-bottom:18px}.tasks-intro>div{max-width:820px}.tasks-intro h1{font-size:clamp(36px,5vw,56px)}.tasks-intro p:not(.eyebrow){margin:0;color:var(--muted);line-height:1.55}.tasks-add{min-width:190px;min-height:50px;padding:11px 18px}.tasks-pilot-note{display:grid;grid-template-columns:auto 1fr;gap:15px;border:1px solid rgba(222,139,56,.32);border-radius:15px;padding:14px 17px;background:var(--accent-soft);color:#70491f}.tasks-pilot-note span{line-height:1.45}.tasks-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:14px 0}.tasks-summary>div{display:grid;gap:5px;border:1px solid var(--line);border-radius:15px;padding:15px 17px;background:#fff}.tasks-summary span{color:var(--muted);font-size:11px;font-weight:800}.tasks-summary strong{color:var(--brand);font-size:25px}.tasks-board{display:grid;gap:14px}.task-card{overflow:hidden;border:1px solid var(--line);border-radius:18px;background:#fff;box-shadow:0 8px 28px rgba(23,54,47,.06)}.task-card>header{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:17px 19px;border-bottom:1px solid var(--line);background:#fafbf9}.task-title{display:grid;gap:3px;border:0;padding:0;background:transparent;color:var(--ink);text-align:left;cursor:pointer}.task-title small{color:var(--muted)}.task-title strong{font-size:21px}.task-status{border-radius:999px;padding:7px 10px;background:#eef1ed;color:var(--muted);font-size:11px;font-weight:850}.task-status.released{background:var(--brand-soft);color:var(--brand)}.task-status.cancelled{background:var(--danger-soft);color:var(--danger)}.task-facts{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:var(--line)}.task-facts>div{display:grid;gap:4px;padding:13px 19px;background:#fff}.task-facts span{color:var(--muted);font-size:10px;font-weight:800;text-transform:uppercase}.task-material-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:10px;padding:16px 18px;background:#f5f4ef}.task-material-grid section{display:grid;gap:5px;border:1px solid var(--line);border-radius:14px;padding:15px;background:#fff}.task-material-grid span,.task-material-grid small{color:var(--muted)}.task-material-grid strong{font-size:23px}.task-note{margin:0;padding:0 18px 15px;color:var(--muted)}.task-card>footer{display:flex;justify-content:flex-end;gap:10px;border-top:1px solid var(--line);padding:13px 18px}.task-card>footer button{min-height:42px;padding:8px 14px}.tasks-empty{min-height:280px;display:grid;place-items:center;align-content:center;border:1px dashed var(--line);border-radius:18px;background:#fff;color:var(--muted);text-align:center}.tasks-empty strong{color:var(--ink);font-size:22px}.tasks-empty p{margin:7px 0 0}.task-modal{--modal-width:640px}.task-form{display:grid;gap:15px}.task-form label{display:grid;gap:7px}.task-form label>span{color:var(--muted);font-size:11px;font-weight:850;text-transform:uppercase}.task-form input,.task-form select,.task-form textarea{width:100%;min-height:48px;border:1px solid var(--line);border-radius:11px;padding:10px 12px;background:#fff;color:var(--ink);font:inherit}.task-form textarea{resize:vertical}.task-form small{color:var(--muted)}.task-form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.task-form-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.task-form-actions button{min-height:50px;padding:10px 15px}@media(max-width:760px){.tasks-shell{width:min(100% - 20px,920px);margin-top:20px}.tasks-intro{align-items:stretch;flex-direction:column}.tasks-add{width:100%}.tasks-pilot-note{grid-template-columns:1fr}.tasks-summary{grid-template-columns:1fr 1fr}.task-facts,.task-form-row{grid-template-columns:1fr}.task-form-actions{grid-template-columns:1fr}.task-form-actions .primary-btn{order:-1}}@media(max-width:460px){.tasks-summary{grid-template-columns:1fr}.task-card>footer{display:grid}.task-card>footer button{width:100%}}
.cargo-status{display:inline-flex;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:800;white-space:nowrap}.cargo-status.is-success{background:#dcf7e7;color:#137541}.cargo-status.is-warning{background:#fff1c7;color:#8a5a00}.cargo-status.is-danger{background:#ffe0e0;color:#a52c2c}.cargo-status.is-neutral{background:#eef1f5;color:#596575}
.cargo-carrier{display:inline-flex;margin:0 7px 4px 0;padding:3px 7px;border-radius:999px;background:var(--brand-soft);color:var(--brand);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.inventory-family-controls { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 14px; }
.inventory-family-section { border-top: 1px solid var(--line); }
.inventory-family-toggle { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 10px; border: 0; padding: 10px 14px; background: var(--brand-soft); color: var(--ink); text-align: left; cursor: pointer; }
.inventory-family-toggle span { width: 18px; color: var(--brand); font-size: 18px; }
.inventory-family-toggle strong { flex: 1; }
.inventory-family-toggle small { color: var(--muted); }
.task-material.not_started .task-material-head b{background:#eef1ed;color:var(--muted)}.task-material.in_progress{border-color:rgba(222,139,56,.42)}.task-material.in_progress .task-material-head b{background:var(--accent-soft);color:#70491f}
.task-material-grid .task-material{gap:13px;padding:16px}.task-material.completed{border-color:rgba(28,112,79,.34);background:#f6fbf8}.task-material-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.task-material-head>div{display:grid;gap:4px}.task-material-head>div>span{color:var(--ink);font-weight:850}.task-material-head b{border-radius:999px;padding:5px 8px;background:var(--brand-soft);color:var(--brand);font-size:10px}.task-material-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.task-material-metrics>div{display:grid;gap:2px;border-radius:10px;padding:10px;background:#f5f4ef;text-align:center}.task-material-metrics span{font-size:9px;font-weight:800;text-transform:uppercase}.task-material-metrics strong{color:var(--ink);font-size:22px}.task-material-metrics small{font-size:10px}.task-progress-form{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;border-top:1px solid var(--line);padding-top:12px}.task-progress-form label{display:grid;gap:4px}.task-progress-form label span{font-size:9px;font-weight:800;text-transform:uppercase}.task-progress-form input{width:100%;min-width:0;min-height:40px;border:1px solid var(--line);border-radius:9px;padding:7px 9px;font:inherit}.task-progress-form button{min-height:40px;padding:7px 11px}.task-progress-form .task-progress-quick{grid-column:auto}.task-progress-form .task-progress-quick:first-of-type{grid-column:3}.task-progress-hint{margin:0;color:var(--muted);font-size:12px;line-height:1.4}@media(max-width:720px){.task-material-metrics{grid-template-columns:1fr}.task-material-metrics>div{grid-template-columns:1fr auto auto;align-items:center;text-align:left}.task-progress-form{grid-template-columns:1fr 1fr}.task-progress-form button,.task-progress-form .task-progress-quick:first-of-type{grid-column:auto}}@media(max-width:460px){.task-progress-form{grid-template-columns:1fr}.task-progress-form button,.task-progress-form .task-progress-quick:first-of-type{grid-column:1}}
.team-tasks-shell { width: min(1380px, calc(100% - 32px)); margin: 112px auto 48px; }
.team-tasks-intro, .team-section-head { display:flex; justify-content:space-between; align-items:flex-end; gap:24px; }
.team-tasks-intro h1, .team-section-head h2 { margin:4px 0 6px; }
.team-date-control { display:flex; align-items:center; gap:9px; min-width:0; padding:5px 7px 5px 11px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.team-date-control label { font-size:12px; font-weight:800; color:var(--muted); }
.team-date-control input { min-height:34px; border:0; border-radius:9px; padding:5px 8px; background:var(--brand-soft); color:var(--ink); }
.team-task-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:8px 0 10px; }
.team-task-tabs button { flex:0 0 auto; min-height:36px; border:1px solid var(--line); background:var(--surface); border-radius:999px; padding:7px 14px; font-weight:800; color:var(--muted); cursor:pointer; }
.team-task-tabs button:hover { color:var(--brand); border-color:#aebbb6; }
.team-task-tabs button.active { color:#fff; background:var(--brand); border-color:var(--brand); }
#team-task-content { box-sizing:border-box; padding:18px; }
.team-task-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:20px; }
.team-task-summary > div { padding:16px; border:1px solid var(--line); border-radius:16px; background:#f8faf8; display:grid; gap:4px; }
.team-task-summary span { color:var(--muted); font-size:12px; font-weight:700; }
.team-task-summary strong { font-size:22px; }
.team-task-section, .team-project-section { border:1px solid var(--line); border-radius:18px; padding:18px; margin-top:16px; background:#fff; }
.team-project-section > .team-section-head > span { padding:7px 11px; border-radius:999px; background:#edf5f1; color:var(--green); font-weight:800; font-size:12px; }
.team-task-row { display:grid; grid-template-columns:auto minmax(210px,1fr) minmax(260px,1.4fr) auto; gap:14px; align-items:center; padding:16px 0; border-top:1px solid var(--line); }
.team-task-row:first-of-type { border-top:0; }
.team-task-row.done { opacity:.72; }
.team-task-check input { position:absolute; opacity:0; }
.team-task-check span { position:relative; width:28px; height:28px; border:2px solid #9eb2a9; border-radius:9px; display:block; }
.team-task-check input:checked + span { background:#236245; border-color:#236245; }
.team-task-check input:checked + span::after { content:""; position:absolute; left:8px; top:3px; width:7px; height:13px; border:solid #fff; border-width:0 3px 3px 0; transform:rotate(45deg); }
.team-task-copy p { margin:4px 0; color:var(--muted); font-size:13px; }
.team-task-copy small { color:var(--brand); font-weight:700; }
.team-task-comment { display:grid; gap:5px; min-width:0; }
.team-task-comment span, .team-metric-grid span { font-size:11px; font-weight:800; color:var(--muted); }
.team-task-comment textarea { resize:vertical; }
.team-metric-grid { grid-column:2 / -1; display:grid; grid-template-columns:repeat(6,minmax(100px,1fr)); gap:10px; }
.team-metric-grid label { display:grid; gap:5px; }
.team-metric-grid input { width:100%; }
.standard-modal-form { display:grid; gap:14px; padding-top:12px; }
.standard-modal-form > label, .standard-modal-form .task-form-row label { display:grid; gap:7px; }
.standard-modal-form label > span { font-size:12px; font-weight:800; color:var(--muted); }
.team-modal { --modal-width: 680px; }
.team-modal .modal-head { padding-bottom:12px; margin-bottom:0; border-bottom:1px solid var(--line); }
.team-modal .modal-head h2 { margin:3px 0 6px; font-size:clamp(25px,4vw,31px); }
.team-modal .modal-head p:not(.eyebrow) { margin:0; max-width:520px; color:var(--muted); line-height:1.45; }
.team-modal .icon-button { flex:0 0 42px; width:42px; height:42px; padding:0; border-radius:50%; font-size:24px; line-height:1; }
.standard-modal-form input,.standard-modal-form select,.standard-modal-form textarea,.team-task-comment textarea { width:100%; min-width:0; min-height:44px; border:1px solid var(--line); border-radius:11px; padding:9px 12px; background:#fff; color:var(--ink); font:inherit; }
.standard-modal-form textarea { min-height:82px; resize:vertical; line-height:1.45; }
.team-task-comment textarea { line-height:1.45; }
.standard-modal-form input:hover,.standard-modal-form select:hover,.standard-modal-form textarea:hover,.team-task-comment textarea:hover { border-color:#aeb8b3; }
.standard-modal-form input:focus,.standard-modal-form select:focus,.standard-modal-form textarea:focus,.team-task-comment textarea:focus { outline:0; border-color:var(--brand); box-shadow:0 0 0 3px rgba(23,54,47,.12); }
.team-task-comment textarea::placeholder { color:var(--muted); opacity:1; }
.standard-modal-form .modal-actions { display:flex; justify-content:flex-end; gap:10px; padding-top:12px; margin-top:2px; border-top:1px solid var(--line); }
.standard-modal-form .modal-actions button { min-width:128px; min-height:40px; padding:7px 14px; border-radius:12px; }
.team-manager-group { margin-top:26px; }
.team-manager-head { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin:0 2px 12px; }
.team-manager-head h2 { margin:3px 0 0; }
.team-manager-head>span { color:var(--muted); font-size:13px; font-weight:800; }
.team-account-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:start; }
.team-account-card { overflow:hidden; border:1px solid var(--line); border-radius:18px; background:#fff; box-shadow:0 8px 26px rgba(23,54,47,.06); }
.team-account-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding:18px 20px; background:#fafbf9; border-bottom:1px solid var(--line); }
.team-account-head h2 { margin:9px 0 4px; font-size:22px; }
.team-account-head p { margin:0; color:var(--muted); font-size:13px; }
.team-account-head>strong { flex:0 0 auto; border-radius:999px; padding:7px 10px; background:var(--brand-soft); color:var(--brand); font-size:12px; }
.team-account-body { display:grid; gap:18px; padding:16px; }
.team-task-group { display:grid; gap:9px; }
.team-task-group h3 { margin:0; padding:0 2px; font-size:15px; }
.team-account-card .team-task-row { grid-template-columns:auto minmax(0,1fr); padding:14px 2px; }
.team-account-card .team-task-comment,.team-account-card .team-task-row>button,.team-account-card .team-metric-grid { grid-column:2; }
.team-account-card .team-metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.team-account-card .team-task-row>button { justify-self:start; min-width:132px; }
.marketplace-badge { display:inline-flex; align-items:center; min-height:25px; padding:4px 9px; border-radius:999px; font-size:11px; font-weight:900; }
.marketplace-badge.ozon { background:#e8efff; color:#1754d1; }
.marketplace-badge.wildberries { background:#f8e8f6; color:#9b217e; }
.team-board-controls { display:grid; grid-template-columns:1fr 1fr; gap:22px; padding:18px 20px; border:1px solid var(--line); border-radius:18px; background:#fff; }
.team-board-controls .eyebrow { margin-bottom:9px; }
.team-switcher { display:flex; flex-wrap:wrap; gap:8px; }
.team-switcher button { display:inline-flex; align-items:center; gap:8px; min-height:42px; border:1px solid var(--line); border-radius:12px; padding:9px 14px; background:#f7f8f6; color:var(--muted); font-weight:800; cursor:pointer; }
.team-switcher button.active { border-color:var(--brand); background:var(--brand); color:#fff; box-shadow:0 7px 18px rgba(23,54,47,.14); }
.marketplace-dot { width:9px; height:9px; border-radius:50%; background:#aaa; }
.marketplace-dot.ozon { background:#246bff; }.marketplace-dot.wildberries { background:#b72a93; }
.team-workspace { overflow:hidden; margin-top:14px; border:1px solid var(--line); border-radius:20px; background:#fff; box-shadow:var(--shadow); }
.team-workspace>header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 18px; border-bottom:1px solid var(--line); background:linear-gradient(135deg,#fbfcfa,#f3f6f4); }
.team-workspace>header > div:not(.team-progress) { display:flex; flex-wrap:wrap; align-items:center; gap:5px 10px; min-width:0; }
.team-workspace>header h2 { min-width:0; margin:0; font-size:22px; line-height:1.2; overflow-wrap:anywhere; }.team-workspace>header p { flex-basis:100%; margin:0; color:var(--muted); font-size:12px; }
.team-progress { display:grid; flex:0 0 140px; gap:3px; min-width:0; text-align:right; }.team-progress strong { font-size:20px; }.team-progress span { color:var(--muted); font-size:11px; font-weight:700; }
.team-progress i { display:block; width:100%; height:7px; overflow:hidden; margin-top:5px; border-radius:99px; background:#dfe6e2; }.team-progress b { display:block; height:100%; border-radius:inherit; background:var(--success); }
.team-workspace-body { display:grid; gap:20px; padding:20px 24px 26px; }.team-clean-group { display:grid; gap:0; }.team-clean-group h3 { margin:0; padding:0 0 10px; font-size:16px; }
.team-workspace .team-task-row { grid-template-columns:auto minmax(190px,1fr) minmax(240px,1.1fr) auto; padding:14px 0; }
.team-workspace .team-metric-grid { grid-column:2/-1; }
.team-cabinet-home { padding:4px 0; }
.team-cabinet-title { margin-bottom:18px; }.team-cabinet-title h2 { margin:4px 0 6px; font-size:30px; }.team-cabinet-title p:last-child { margin:0; color:var(--muted); }
.team-cabinet-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.team-cabinet-tile { display:grid; grid-template-columns:1fr auto; gap:7px 14px; min-height:178px; border:1px solid var(--line); border-radius:18px; padding:20px; background:#fff; color:var(--ink); text-align:left; cursor:pointer; box-shadow:0 8px 24px rgba(23,54,47,.05); transition:.15s ease; }
.team-cabinet-tile:hover { transform:translateY(-2px); border-color:#aebbb6; box-shadow:0 12px 30px rgba(23,54,47,.1); }
.team-cabinet-tile .marketplace-badge { justify-self:start; grid-column:1/-1; }.team-cabinet-tile strong { font-size:22px; }.team-cabinet-tile small { grid-column:1/-1; color:var(--muted); }
.team-cabinet-tile i { grid-column:1/-1; align-self:end; display:block; height:7px; overflow:hidden; border-radius:99px; background:#e2e7e4; }.team-cabinet-tile i b { display:block; height:100%; background:var(--success); }
.team-cabinet-tile em { color:var(--muted); font-size:12px; font-style:normal; font-weight:700; }.team-cabinet-tile u { justify-self:end; color:var(--brand); font-size:12px; font-weight:900; text-decoration:none; }
.team-back-button { min-height:40px; margin:0 0 12px; border:0; border-radius:10px; padding:8px 12px; background:transparent; color:var(--brand); font-weight:850; cursor:pointer; }.team-back-button:hover { background:var(--brand-soft); }
.link-button { border:0; background:none; padding:0; font:inherit; font-weight:800; color:var(--brand); cursor:pointer; text-align:left; }
.sticky-table-wrap td small { display:block; color:var(--muted); margin-top:4px; }
@media (max-width: 900px) {
  .team-account-grid { grid-template-columns:1fr; }
  .team-workspace .team-task-row { grid-template-columns:auto 1fr; }
  .team-workspace .team-task-comment,.team-workspace .team-task-row>button,.team-workspace .team-metric-grid { grid-column:2; }
  .team-workspace .team-metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .team-task-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .team-task-row { grid-template-columns:auto 1fr; }
  .team-task-comment, .team-task-row > button, .team-metric-grid { grid-column:2; }
  .team-metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (min-width:621px) and (max-width:900px) {
  .team-workspace .team-task-row { grid-template-columns:auto minmax(170px,1fr) minmax(210px,.9fr) auto; gap:12px; }
  .team-workspace .team-task-comment { grid-column:3; }
  .team-workspace .team-task-row>button { grid-column:4; width:auto; min-width:106px; }
  .team-workspace .team-metric-grid { grid-column:2/-1; grid-template-columns:repeat(3,minmax(0,1fr)); }
  .team-workspace .team-task-comment textarea { min-height:46px; height:46px; }
}
@media (max-width: 620px) {
  .team-tasks-intro { align-items:stretch; flex-direction:column; }
  .team-date-control { width:100%; }
  .team-task-tabs { display:grid; grid-template-columns:1fr 1fr; overflow:visible; }
  .team-task-tabs button { width:100%; padding-inline:10px; }
  #team-task-content { padding:14px; }
  .team-task-summary { grid-template-columns:1fr 1fr; }
  .team-section-head { align-items:stretch; flex-direction:column; }
  .team-section-head .primary-btn { width:100%; }
  #team-task-content > .sticky-table-wrap { margin-inline:0; }
  .team-modal { width: min(var(--modal-width), 100%); }
  .team-board-controls { grid-template-columns:1fr; padding:15px; }
  .team-workspace>header { align-items:center; flex-direction:row; gap:10px; padding:12px; }
  .team-workspace>header h2 { font-size:18px; }
  .team-progress { flex-basis:100px; width:auto; text-align:right; }
  .team-progress strong { font-size:18px; }
  .team-progress span { font-size:10px; }
  .team-hypotheses-panel { padding:12px; }
  .team-hypotheses-head > button { width:100%; }
  .team-workspace-body { padding:16px; }
  .team-cabinet-list { grid-template-columns:1fr; }
  .standard-modal-form .task-form-row { grid-template-columns:1fr; }
  .standard-modal-form .modal-actions { display:grid; grid-template-columns:1fr; }
  .standard-modal-form .modal-actions button { width:100%; }
}
.task-recut-form { display:grid; gap:15px; border:1px solid rgba(222,139,56,.35); border-radius:14px; padding:15px; background:var(--accent-soft); }
.task-recut-form[hidden] { display:none; }
.task-recut-details { display:grid; gap:5px; margin:0; padding:14px 18px; border-top:1px solid var(--line); background:#fff8ed; color:#5e4b37; }
.task-recut-details strong { color:var(--ink); font-size:11px; text-transform:uppercase; }

/* Optional density: scoped to phones; tablet and desktop layouts stay intact. */
.phone-density-setting { display:none; }
@media (max-width:600px) {
  .phone-density-setting { display:grid; gap:4px; padding:10px 16px; border-bottom:1px solid var(--line); }
  .phone-density-setting button { width:100%; min-height:44px; white-space:normal; }
  .phone-density-setting button[aria-pressed="true"] { background:var(--brand); color:#fff; }
  .phone-density-setting small { color:var(--muted); font-size:12px; }
  body.phone-compact:not(.production-page) .module-topbar { height:0; min-height:0; }
  body.phone-compact .module-page-intro { gap:8px; margin-bottom:8px; }
  body.phone-compact .module-page-intro h1 { font-size:22px; }
  body.phone-compact :is(.calendar-shell,.family-shell,.team-tasks-shell,.payroll-shell,.tasks-shell,.cashflow-shell,.access-admin-shell) { width:calc(100% - 16px); margin-top:10px; padding-top:8px; }
  body.phone-compact :is(.calendar-toolbar,.family-toolbar) { gap:6px; margin:8px 0; }
  body.phone-compact .calendar-toolbar h2 { font-size:20px; }
  body.phone-compact :is(.calendar-upcoming,.calendar-quarter-month) { padding:10px; }
  body.phone-compact .calendar-upcoming h2 { font-size:20px; margin-bottom:8px; }
  body.phone-compact .calendar-layout { gap:8px; }
  body.phone-compact .calendar-hour { min-height:42px; grid-template-columns:46px 1fr; }
  body.phone-compact .calendar-timeline { padding:6px 8px; }
  body.phone-compact .calendar-grid.view-week .calendar-day { min-height:90px; }
  body.phone-compact .family-week { padding:4px; gap:4px; }
  body.phone-compact .family-day { padding:5px; }
  body.phone-compact .family-day h2 { margin:0 0 4px; padding:5px; font-size:13px; }
  body.phone-compact .family-event { padding:6px; gap:3px; min-height:44px; }
  body.phone-compact .family-day-events { gap:4px; }
  body.phone-compact .family-control-group { flex-wrap:wrap; max-width:100%; }
  body.phone-compact .family-empty { padding:6px; }
  body.phone-compact :is(.team-board-controls,.team-workspace-body,#team-task-content,.team-hypotheses-panel) { padding:10px; gap:10px; }
  body.phone-compact .team-workspace>header { padding:8px 10px; }
  body.phone-compact .team-workspace .team-task-row { padding:8px 0; gap:8px; }
  body.phone-compact .team-cabinet-tile { padding:12px; min-height:130px; gap:5px; }
  body.phone-compact .team-cabinet-tile strong { font-size:19px; }
  body.phone-compact :is(.statistics-tab-body,.statistics-tab-panel) { padding:10px; }
  body.phone-compact .data-table :is(th,td) { padding:7px 8px; }
  body.phone-compact :is(.logistics-page,.dialog-page) { padding:8px; }
  body.phone-compact .logistics-toolbar { padding:8px; gap:6px; }
  body.phone-compact .logistics-summary { gap:6px; margin-bottom:8px; }
  body.phone-compact :is(.primary-btn,.secondary-btn,.calendar-view-switch button,.family-toolbar button) { min-height:44px; padding:8px 10px; }
  body.phone-compact :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) { font-size:16px; }
}

/* Shared compact page rhythm: keep typography, reclaim vertical workspace. */
.module-page-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 0;
  margin: 0 0 10px;
  padding: 0 132px 0 0;
}
.module-page-intro h1 {
  margin: 0;
  font-size: clamp(24px, 2.5vw, 30px);
  line-height: 1.15;
}
.module-page-intro .eyebrow,
.module-page-intro > div > p:not(.eyebrow) {
  display: none;
}
.payroll-shell, .cashflow-shell, .tasks-shell, .access-admin-shell, .team-tasks-shell {
  margin-top: 18px;
  margin-bottom: 48px;
}
.admin-intro, .payroll-intro, .cashflow-intro, .tasks-intro,
.shipments-intro, .claims-intro, .team-tasks-intro {
  align-items: center;
  margin-bottom: 12px;
}
.admin-intro .eyebrow, .payroll-intro .eyebrow, .cashflow-intro .eyebrow,
.tasks-intro .eyebrow, .shipments-intro .eyebrow, .claims-intro .eyebrow,
.team-tasks-intro .eyebrow {
  margin-bottom: 3px;
}
.admin-intro h1, .payroll-intro h1, .cashflow-intro h1, .tasks-intro h1,
.shipments-intro h1, .claims-intro h1, .team-tasks-intro h1 {
  margin-top: 0;
  margin-bottom: 2px;
  font-size: clamp(24px, 2.5vw, 30px);
}
.admin-intro > div > .eyebrow, .payroll-intro > div > .eyebrow,
.cashflow-intro > div > .eyebrow, .tasks-intro > div > .eyebrow,
.shipments-intro .eyebrow, .claims-intro .eyebrow,
.team-tasks-intro .eyebrow {
  display: none;
}
.admin-intro > .prototype-badge { display: none; }
.tasks-intro p:not(.eyebrow), .team-tasks-intro p:not(.eyebrow),
.cashflow-intro p:not(.eyebrow), .claims-intro p:not(.eyebrow),
.inventory-intro p:not(.eyebrow), .absences-intro p:not(.eyebrow) {
  display: none;
}
@media (max-width: 620px) {
  .module-page-intro { padding-top: 46px; padding-right: 0; }
}
.calendar-scope-switch { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:min(100%,360px); gap:4px; margin:0 0 12px; padding:4px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.calendar-scope-switch a { display:flex; align-items:center; justify-content:center; min-width:0; min-height:44px; padding:8px 14px; border-radius:10px; color:var(--muted); font-size:14px; font-weight:800; text-decoration:none; }
.calendar-scope-switch a:hover { background:var(--brand-soft); color:var(--brand); }
.calendar-scope-switch a[aria-current="page"] { background:var(--brand); color:#fff; }
.calendar-shell{width:min(1440px,calc(100% - 32px));margin:0 auto;padding:32px 0 48px}.calendar-intro{display:flex;align-items:flex-end;justify-content:space-between;gap:24px}.calendar-toolbar{display:flex;align-items:center;gap:10px;margin:24px 0 14px}.calendar-toolbar h2{min-width:240px;margin:0;text-align:center;text-transform:capitalize}.calendar-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:18px}.calendar-panel,.calendar-upcoming{border:1px solid var(--line,#d9e2de);border-radius:18px;background:var(--surface,#fff);box-shadow:0 12px 32px rgba(25,55,46,.06)}.calendar-weekdays,.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.calendar-weekdays{border-bottom:1px solid var(--line,#d9e2de);padding:10px 0;color:#62736d;font-size:13px;font-weight:700;text-align:center}.calendar-day{min-height:132px;padding:8px;border-right:1px solid #e6ece9;border-bottom:1px solid #e6ece9;background:#fff}.calendar-day:nth-child(7n){border-right:0}.calendar-day.is-empty{background:#f6f8f7}.calendar-day.is-today{background:#f0f8f4}.calendar-day-number{width:30px;height:30px;border:0;border-radius:50%;background:transparent;font-weight:700;cursor:pointer}.calendar-day.is-today .calendar-day-number{background:#17362f;color:#fff}.calendar-day-events{display:grid;gap:5px;margin-top:5px}.calendar-event,.calendar-upcoming-item{border:0;text-align:left;cursor:pointer}.calendar-event{display:flex;gap:6px;width:100%;padding:6px 7px;border-radius:8px;background:#e8f1ed;color:#17362f;font-size:12px}.calendar-event time{font-weight:700}.calendar-event span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.calendar-event.status-done{opacity:.55;text-decoration:line-through}.calendar-event.status-cancelled{opacity:.45}.calendar-event.category-personal{background:#f4e9ff}.calendar-event.category-meeting{background:#e7efff}.calendar-event.category-call{background:#fff0dc}.calendar-upcoming{padding:20px}.calendar-upcoming h2{margin:0 0 16px}.calendar-upcoming-list{display:grid;gap:8px}.calendar-upcoming-item{display:grid;width:100%;gap:4px;padding:12px;border-radius:12px;background:#f4f7f5}.calendar-upcoming-item span{color:#62736d;font-size:13px}.calendar-form-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}.calendar-modal{--modal-width:640px}.checkbox-field{display:flex!important;align-items:center;align-self:end;gap:9px;padding:0 0 12px}.standard-modal-form .checkbox-field input{width:18px;min-height:18px;height:18px;flex:0 0 18px}.checkbox-field span{white-space:nowrap}.calendar-modal textarea{resize:vertical}.empty-state{color:#71817c}@media(max-width:900px){.calendar-layout{grid-template-columns:1fr}.calendar-upcoming{order:-1}.calendar-day{min-height:94px;padding:5px}.calendar-event{display:block}.calendar-event time{display:block}.calendar-form-row{grid-template-columns:1fr}.calendar-intro{align-items:flex-start;flex-direction:column}.calendar-toolbar{flex-wrap:wrap}.calendar-toolbar h2{order:-1;width:100%}}
.calendar-view-switch{display:flex;padding:3px;border:1px solid var(--line,#d9e2de);border-radius:12px;background:#f4f7f5}.calendar-view-switch button{border:0;border-radius:9px;background:transparent;padding:9px 13px;color:#50635d;font:inherit;font-weight:750;cursor:pointer}.calendar-view-switch button.is-active{background:#17362f;color:#fff}.calendar-grid.view-today,.calendar-grid.view-quarter{display:block}.calendar-timeline{padding:8px 18px 18px}.calendar-hour{display:grid;grid-template-columns:64px 1fr;min-height:54px;border-bottom:1px solid #e6ece9}.calendar-hour>time{padding:10px 10px 0 0;color:#71817c;font-size:12px;text-align:right}.calendar-hour>div{display:grid;align-content:start;gap:5px;padding:5px 0 5px 12px;border-left:1px solid #d9e2de}.calendar-all-day{display:grid;grid-template-columns:74px 1fr;gap:10px;padding:12px 18px;border-bottom:1px solid #d9e2de}.calendar-all-day>div{display:grid;gap:5px}.calendar-grid.view-week{grid-template-columns:repeat(7,minmax(0,1fr))}.calendar-grid.view-week .calendar-day{min-height:440px}.calendar-week-day-head{display:flex;align-items:center;justify-content:space-between;color:#62736d;text-transform:capitalize}.calendar-grid.view-quarter{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;padding:18px}.calendar-quarter-month{border:1px solid #e2e9e5;border-radius:14px;padding:14px}.calendar-quarter-month h3{margin:0 0 12px;text-transform:capitalize}.calendar-mini-weekdays,.calendar-mini-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}.calendar-mini-weekdays{margin-bottom:5px;color:#71817c;font-size:10px;text-align:center}.calendar-mini-grid button{position:relative;min-height:34px;border:0;border-radius:8px;background:#f5f8f6;cursor:pointer}.calendar-mini-grid button.is-today{background:#17362f;color:#fff}.calendar-mini-grid button i{position:absolute;right:3px;bottom:2px;min-width:14px;border-radius:8px;background:#d8eadf;color:#17362f;font-size:9px;font-style:normal}@media(max-width:900px){.calendar-view-switch{width:100%;overflow:auto}.calendar-view-switch button{flex:1}.calendar-grid.view-quarter{grid-template-columns:1fr}.calendar-panel:has(.calendar-grid.view-week) .calendar-weekdays{display:none}.calendar-grid.view-week{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:8px}.calendar-grid.view-week .calendar-day{min-height:132px;border:1px solid #e6ece9;border-radius:12px}.calendar-grid.view-week .calendar-day:last-child{grid-column:1/-1}}
.calendar-date-picker{display:flex;align-items:center;gap:7px;color:#62736d;font-size:12px;font-weight:750}.calendar-date-picker input{min-height:40px;border:1px solid var(--line,#d9e2de);border-radius:10px;background:#fff;padding:0 9px;font:inherit}
.calendar-day{min-width:0;overflow:hidden}.calendar-event{max-width:100%;min-width:0;box-sizing:border-box;overflow:hidden;align-items:flex-start;flex-wrap:wrap}.calendar-event span{min-width:0;white-space:normal;overflow-wrap:anywhere;line-height:1.3}.calendar-event time{flex:0 0 auto}
/* Personal workout diary. */
.workout-shell{width:min(1240px,calc(100% - 32px));margin:0 auto;padding:32px 0 48px}.workout-intro{margin-bottom:22px}.workout-tabs,.muscle-groups{display:flex;flex-wrap:wrap;gap:8px}.workout-tabs{margin-bottom:20px}.workout-tabs button,.muscle-groups button{border:1px solid var(--line);border-radius:999px;background:#fff;padding:10px 16px;font-weight:800;cursor:pointer}.workout-tabs .is-active,.muscle-groups .is-active{background:var(--brand);color:#fff}.workout-toolbar,.exercise-head{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin-bottom:18px}.workout-toolbar label,.workout-stats-filters label{display:grid;gap:6px;font-size:12px;font-weight:800;color:var(--muted)}.workout-toolbar input,.workout-stats-filters select,.modal-body input{min-height:44px;border:1px solid var(--line);border-radius:11px;padding:0 11px;font:inherit;background:#fff}.exercise-head{margin-top:20px}.exercise-head h2{margin:0}.exercise-grid{display:grid;gap:8px}.exercise-card{display:grid;grid-template-columns:minmax(150px,1fr) 190px 84px 112px;align-items:center;gap:8px;border:1px solid var(--line);border-radius:13px;padding:10px 12px;background:#fff}.exercise-name{border:0;background:none;padding:0;text-align:left;font-size:16px;font-weight:900;cursor:pointer}.weight-stepper{display:grid;grid-template-columns:34px 70px 34px 20px;align-items:center}.weight-stepper button{height:38px;border:1px solid var(--line);background:#f5f8f7;font-size:20px;cursor:pointer}.weight-stepper input{width:70px;height:38px;min-height:0;border:1px solid var(--line);border-radius:0;text-align:center;padding:0}.weight-stepper small{margin-left:5px}.exercise-card select,.modal-body select{min-height:38px;border:1px solid var(--line);border-radius:9px;background:#fff;padding:0 8px;font:inherit}.compact-save{min-height:38px;padding:0 12px}.last-sets{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px}.last-sets:empty{display:none}.last-sets span{padding:4px 7px;border-radius:8px;background:#eef5f2;font-size:11px}.progress-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:18px 0}.progress-cards article{display:grid;gap:6px;padding:18px;border:1px solid var(--line);border-radius:15px;background:#fff}.progress-cards strong{font-size:24px}.workout-stats-filters{margin-bottom:12px}.workout-stats-filters select{min-width:280px}.workout-shell table{width:100%;border-collapse:collapse}.workout-shell th,.workout-shell td{padding:11px;border-bottom:1px solid var(--line);text-align:left}.modal-body{display:grid;gap:14px;padding:18px 0}.modal-body label{display:grid;gap:6px;font-weight:800}
@media(max-width:640px){.workout-shell{width:min(100% - 20px,1240px);padding-top:20px}.exercise-card{grid-template-columns:1fr 84px 104px}.exercise-name{grid-column:1/-1}.weight-stepper{grid-template-columns:30px 60px 30px 18px}.weight-stepper input{width:60px}.progress-cards{grid-template-columns:1fr}.workout-toolbar>*{width:100%}.workout-toolbar input{width:100%;box-sizing:border-box}}
.workout-training-layout{display:grid;grid-template-columns:180px minmax(0,1fr);gap:20px;align-items:start}.workout-training-layout .muscle-groups{display:flex;flex-direction:column;align-items:stretch}.workout-training-layout .muscle-groups button{text-align:left}
@media(max-width:640px){.workout-training-layout{grid-template-columns:1fr}.workout-training-layout .muscle-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}}
.workout-training-layout{display:block}.workout-training-layout .muscle-groups{display:grid;grid-template-columns:1fr;gap:10px}.muscle-accordion{background:transparent}.muscle-accordion-head{display:flex;align-items:center;width:min(100%,280px);box-sizing:border-box;border:1px solid var(--line);border-radius:11px;background:#f7f9f8;padding-right:6px}.muscle-accordion-head button{border:0;background:transparent}.muscle-group-name{flex:1;min-width:0;padding:10px 8px 10px 13px!important;font-size:15px;text-align:left}.muscle-group-toggle{flex:0 0 32px;width:32px;height:32px;margin-left:auto;border:1px solid var(--line)!important;border-radius:8px!important;background:#fff!important;font-size:18px;text-align:center!important}.muscle-accordion .exercise-grid{margin-top:8px;padding:10px;border:1px solid var(--line);border-radius:13px;background:#fff}
@media(max-width:640px){.workout-training-layout .muscle-groups{display:grid;grid-template-columns:1fr}.exercise-card{grid-template-columns:1fr 84px 104px}}
.muscle-group-toggle{display:grid!important;place-items:center;padding:0!important;line-height:1!important}
.muscle-group-toggle{position:relative;color:transparent!important}.muscle-group-toggle::before{content:"+";position:absolute;left:50%;top:50%;transform:translate(-50%,-54%);color:var(--brand);font-size:25px;font-weight:700;line-height:1}.muscle-group-toggle[aria-expanded="true"]::before{content:"−";transform:translate(-50%,-58%)}
.last-sets .previous-workout{background:#fff0b8;color:#6f5510;font-weight:800}
.last-sets .previous-workout:not(:last-of-type){display:none}
.last-sets .previous-workout{display:inline-flex!important}.last-sets .previous-workout:has(+ .previous-workout){display:none!important}
.stats-toolbar{display:flex;justify-content:flex-end;margin-bottom:14px}.stats-toolbar label{display:grid;gap:5px;color:var(--muted);font-size:12px;font-weight:800}.stats-toolbar select{min-height:40px;border:1px solid var(--line);border-radius:10px;background:#fff;padding:0 10px}.stats-browser{display:grid;gap:8px;margin-bottom:16px}.stats-group{border:1px solid var(--line);border-radius:12px;background:#fff;overflow:hidden}.stats-group>button{display:flex;justify-content:space-between;width:100%;border:0;background:#f6f8f7;padding:11px 14px;text-align:left;font-weight:850;cursor:pointer}.stats-group>button.is-active{color:var(--brand)}.stats-group>div{display:flex;flex-wrap:wrap;gap:7px;padding:10px;border-top:1px solid var(--line)}.stats-group>div button{border:1px solid var(--line);border-radius:999px;background:#fff;padding:7px 11px;cursor:pointer}.stats-group>div button.is-active{background:var(--brand);color:#fff}.progress-panel{border:1px solid var(--line);border-radius:17px;background:#fff;padding:18px;margin-bottom:16px}.progress-panel header{display:flex;justify-content:space-between;align-items:start;gap:16px}.progress-panel h2{margin:3px 0}.progress-panel small{color:var(--muted);font-weight:800}.trend{border-radius:999px;background:#eef2f0;padding:7px 11px;font-weight:900}.trend.up{background:#dff2e8;color:#23644c}.trend.down{background:#fde5e2;color:#a3362d}.progress-chart{margin-top:14px;overflow:hidden}.progress-chart svg{display:block;width:100%;height:auto;max-height:330px}.progress-chart line{stroke:#ccd8d3;stroke-width:1}.progress-chart polyline{fill:none;stroke:var(--brand);stroke-width:4;stroke-linecap:round;stroke-linejoin:round}.progress-chart circle{fill:#fff;stroke:var(--brand);stroke-width:3}.progress-chart text{fill:var(--muted);font-size:11px}.chart-note{margin:4px 0 0;color:var(--muted);font-size:12px}.chart-empty{padding:45px 10px}.workout-journal-details{border:1px solid var(--line);border-radius:13px;background:#fff;overflow:hidden}.workout-journal-details summary{padding:13px 15px;font-weight:850;cursor:pointer}.workout-journal-details .sticky-table-wrap{border-top:1px solid var(--line)}

/* Плотный рабочий режим для десятидюймовых планшетов в альбомной ориентации. */
@media (min-width:700px) and (max-width:1180px) and (orientation:landscape) {
  .shell,.admin-shell,.payroll-shell,.shipments-shell,.access-shell,.access-admin-shell,.inventory-shell,.cashflow-shell,.tasks-shell,.team-tasks-shell,.calendar-shell,.workout-shell,.audit-shell,.claims-shell,.logistics-shell,.dialog-page{width:calc(100% - 20px);margin-top:12px;margin-bottom:32px}
  .calendar-shell,.workout-shell{padding-top:12px;padding-bottom:32px}
  .module-page-intro{padding-right:170px}
  .claims-shell,.dialog-page{padding:0}
  .logistics-page{width:calc(100% - 20px);max-width:none;margin:0 auto;padding:12px 0 32px}
  .admin-intro,.payroll-intro,.claims-intro,.shipments-intro,.inventory-intro,.cashflow-intro,.tasks-intro,.team-tasks-intro,.calendar-intro,.workout-intro,.audit-intro,.logistics-intro,.dialog-intro{min-height:0;margin-bottom:9px}
  .payroll-intro{padding-right:170px}
  .admin-intro h1,.payroll-intro h1,.claims-intro h1{font-size:28px}
  .tabs{gap:5px;margin-bottom:9px}
  .tab{border-radius:10px;padding:6px 10px;font-size:12px}
  .admin-card{min-height:320px}
  .admin-card-head,.team-section-head{gap:12px;padding:13px 15px}
  .admin-card-head h2,.team-section-head h2{font-size:21px}
  .sticky-table-wrap{max-height:72vh}
  table{min-width:660px}
  th,td{padding:7px 8px}
  th{font-size:10px;line-height:1.2;white-space:normal}
  td{font-size:12px;line-height:1.25}
  td strong,td small{overflow-wrap:anywhere}
  .work-card{width:min(100%,920px);min-height:0;padding:18px 22px}
  .section-board-grid{gap:10px}
  .section-work-list{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
  .section-work-list .open-work-card{min-height:82px;padding:9px 10px}
  .open-work-card>strong{font-size:14px;line-height:1.2}
  .open-work-card>span:not(.work-status),.open-work-card>small{font-size:11px;line-height:1.2}
  .claims-shell{padding:12px 14px 32px}
  .claims-summary{gap:6px;margin-bottom:8px}
  .claims-summary>div{padding:9px 10px}
  .claims-toolbar{gap:8px;padding:9px 10px}
  .claims-filters{gap:6px}
  .claims-filters input,.claims-filters select,.claims-search input{min-height:34px}
  .claims-table{min-width:900px;table-layout:fixed}
  .claims-table th,.claims-table td{padding:7px 8px;font-size:11px}
  .payroll-settings-table{min-width:900px}
  .payroll-settings-table th:nth-child(1){width:165px}
  .payroll-settings-table th:nth-child(2),.payroll-settings-table th:nth-child(3),.payroll-settings-table th:nth-child(4){width:105px}
  .payroll-settings-table th:nth-child(5),.payroll-settings-table th:nth-child(6),.payroll-settings-table th:nth-child(7){width:120px}
  .timesheet-table th,.timesheet-table td{min-width:32px;padding:5px 3px;font-size:10px}
  .timesheet-table .timesheet-person-head,.timesheet-table .timesheet-person{min-width:155px;width:155px;max-width:155px}
  .timesheet-total{min-width:105px!important;white-space:normal}
  #absence-manager-form{grid-template-columns:minmax(190px,1.3fr) 120px 145px 145px minmax(155px,1fr) auto;gap:7px;padding:10px 12px}
  #absence-manager-form input,#absence-manager-form select,#absence-manager-form button{min-height:40px}
  .absence-register .payroll-empty{min-height:150px}
  .payroll-days-table,.absence-table,.audit-table{min-width:900px}
  .downtime-table{min-width:820px;table-layout:fixed}
  .team-history-filters{margin-bottom:10px;padding:9px}
  .shipment-summary-grid{gap:6px;margin-bottom:8px}
  .shipment-summary{min-height:62px;padding:9px 11px}
  .shipment-toolbar{grid-template-columns:minmax(220px,1.4fr) minmax(150px,.7fr) auto;gap:8px;padding:10px 12px}
  .shipment-toolbar input,.shipment-toolbar select{min-height:38px;padding-block:6px}
  .shipment-card-head{grid-template-columns:minmax(210px,1fr) minmax(250px,auto) auto;gap:9px;padding:8px 10px 6px}
  .shipment-card-body{grid-template-columns:minmax(220px,1.2fr) minmax(320px,1fr);gap:8px;padding:0 10px 8px}
  .shipment-plan-table{min-width:680px}
  .shipment-plan-table th,.shipment-plan-table td{min-width:78px;padding:7px 8px}
  .shipment-plan-table th:first-child{min-width:185px;max-width:230px}
  .inventory-summary{gap:6px;margin-bottom:8px}
  .inventory-summary>div{min-height:62px;padding:9px 11px}
  .inventory-card .inventory-card-head{padding:8px 10px}
  .inventory-stock-head,.inventory-stock-row{padding:7px 10px}
  .sku-catalog-row,.marketplace-article-row{padding:8px 10px}
  .inventory-family-toggle{min-height:40px;padding:7px 10px}
  .inventory-actions{gap:7px}
  .inventory-actions button,.inventory-family-controls button,.inventory-card-head button{min-height:40px;padding:7px 12px}
  .inventory-family-controls{gap:6px;padding:0 12px 9px}
  .movement-row{padding:8px 10px}
  .access-grid{gap:8px}
  .access-role-card{min-height:150px;gap:8px;padding:14px}
  .module-group-card{min-height:68px;grid-template-columns:38px minmax(0,1fr) auto;padding:9px 10px}
  .access-admin-card{padding:16px 18px}
  .access-admin-card h1{font-size:27px;margin-block:0 8px}
  .access-admin-card .section-heading{margin-bottom:10px}
  .access-admin-card .section-heading p{display:none}
  .account-create-form{gap:8px}
  .permission-table th,.permission-table td{min-width:74px;width:74px;padding:4px 3px}
  .permission-table th:first-child{min-width:110px;width:110px;max-width:110px}
  .permission-table thead th strong,.permission-toggle{font-size:9px}
  .audit-filter-card{padding-block:11px}
  .audit-filters{gap:7px}
  .audit-filters input,.audit-filters select,.audit-filter-actions button{min-height:36px}
  .audit-list-head{padding:10px 12px}
  .audit-table{min-width:880px;table-layout:fixed}
  .audit-table th,.audit-table td{padding:7px 8px;font-size:11px;line-height:1.25}
  .cashflow-settings{gap:7px;margin-bottom:8px;padding:9px 10px}
  .cashflow-horizon input,.cashflow-horizon select,.cashflow-settings input,.cashflow-settings select{min-height:36px}
  .cashflow-summary{gap:6px;margin-bottom:8px}
  .cashflow-summary>div{min-height:62px;gap:3px;padding:8px 10px}
  .cashflow-summary strong{font-size:18px}
  .cashflow-layout{grid-template-columns:minmax(0,1fr) 235px;gap:8px}
  .cashflow-side,.cashflow-side .card{min-width:0;overflow:hidden}
  .overdraft-due{align-items:flex-start;flex-direction:column;gap:6px}
  .recurring-card li strong,.recurring-card li span{overflow-wrap:anywhere}
  .cashflow-section-head{gap:10px;padding:10px 12px 8px}
  .cashflow-table th{padding:6px 8px}
  .cashflow-table td{height:38px;padding:5px 8px}
  .overdraft-card{padding:11px}
  .tasks-summary{gap:7px;margin-bottom:9px}
  .tasks-summary>div{min-height:62px;padding:9px 11px}
  .tasks-toolbar{gap:8px;padding:9px 11px}
  .task-card{margin-bottom:9px}
  .task-card>header{padding:10px 12px}
  .task-facts>div{padding:8px 11px}
  .task-material-grid{gap:7px;padding:10px 12px}
  .task-material-grid .task-material{gap:8px;padding:10px}
  .task-card>footer{padding:8px 12px}
  .team-tasks-shell{margin-top:18px}
  #team-task-content{padding:11px}
  .team-task-tabs{gap:5px;margin:5px 0 7px}
  .team-task-tabs button{min-height:32px;padding:5px 10px;font-size:12px}
  .team-task-summary{gap:7px;margin-bottom:10px}
  .team-task-summary>div{padding:9px 11px}
  .team-cabinet-list{gap:9px}
  .team-cabinet-tile{min-height:126px;gap:4px 10px;padding:12px 14px}
  .team-workspace>header{padding:13px 15px}
  .team-workspace-body{gap:12px;padding:12px 15px 16px}
  .team-workspace .team-task-row{padding:9px 0}
  .team-task-comment textarea{min-height:40px;height:40px}
  .calendar-toolbar{gap:7px;margin:9px 0 8px}
  .calendar-toolbar h2{min-width:190px;font-size:20px}
  .calendar-layout{grid-template-columns:minmax(0,1fr) 250px;gap:9px}
  .calendar-weekdays{padding:6px 0;font-size:11px}
  .calendar-day{min-height:91px;padding:5px}
  .calendar-day-number{width:25px;height:25px}
  .calendar-day-events{gap:3px;margin-top:3px}
  .calendar-event{gap:4px;padding:4px 5px;font-size:10px}
  .calendar-upcoming{padding:11px}
  .calendar-upcoming h2{margin-bottom:9px;font-size:19px}
  .calendar-upcoming-list{gap:5px}
  .calendar-upcoming-item{gap:2px;padding:7px 8px}
  .calendar-grid.view-week .calendar-day{min-height:330px}
  .calendar-grid.view-quarter{gap:8px;padding:10px}
  .calendar-quarter-month{padding:9px}
  .calendar-mini-grid button{min-height:27px}
  .calendar-hour{min-height:42px}
  .workout-tabs{gap:5px;margin-bottom:10px}
  .workout-tabs button,.muscle-groups button{padding:7px 11px;font-size:12px}
  .workout-toolbar,.exercise-head{margin-bottom:10px}
  .muscle-accordion-head{width:min(100%,240px)}
  .muscle-accordion .exercise-grid{margin-top:5px;padding:7px}
  .exercise-card{gap:6px;padding:7px 9px}
  .progress-cards{gap:7px;margin:10px 0}
  .progress-cards article{padding:10px 12px}
  .progress-panel{padding:11px;margin-bottom:9px}
  .dialog-workspace{height:calc(100vh - 108px);min-height:0}
  .dialog-summary{padding:6px 9px}
  .dialog-list-item{padding:8px 10px}
  .dialog-thread-head{padding:9px 11px}
  .dialog-messages{padding:10px}
  .dialog-composer{padding:8px 10px}
  .logistics-toolbar{gap:7px;padding:9px 10px}
  .logistics-summary{gap:6px;margin-bottom:8px}
  .logistics-summary>div{padding:8px 10px}
  .logistics-summary strong{font-size:20px}
  .logistics-table th,.logistics-table td{padding:7px 8px;font-size:11px}
}
@media(max-width:640px){.progress-panel{padding:13px}.stats-toolbar{justify-content:stretch}.stats-toolbar label,.stats-toolbar select{width:100%}}
.exercise-card.cardio-row{grid-template-columns:minmax(140px,1fr) 110px 125px 95px 105px;align-items:end}.cardio-row label{display:grid;min-width:0;gap:4px;color:var(--muted);font-size:11px;font-weight:800}.cardio-row input{box-sizing:border-box;width:100%;min-width:0;min-height:38px;border:1px solid var(--line);border-radius:9px;padding:0 9px;font:inherit}.maximum-entry{display:grid;grid-template-columns:minmax(180px,1fr) 170px 170px 120px;align-items:end;gap:10px;margin-bottom:18px}.maximum-entry label{display:grid;gap:5px;color:var(--muted);font-size:12px;font-weight:800}.maximum-entry input{min-height:42px;border:1px solid var(--line);border-radius:10px;padding:0 10px;font:inherit}.maximum-list{display:grid;gap:8px}.maximum-list article{display:grid;grid-template-columns:1fr auto 40px;align-items:center;gap:12px;border:1px solid var(--line);border-radius:13px;background:#fff;padding:12px 14px}.maximum-list article div{display:grid;gap:3px}.maximum-list article small{color:var(--muted)}.maximum-list article b{font-size:20px}
.exercise-card.timed-row{grid-template-columns:minmax(150px,1fr) 130px 105px;align-items:end}.timed-row label{display:grid;min-width:0;gap:4px;color:var(--muted);font-size:11px;font-weight:800}.timed-row input{box-sizing:border-box;width:100%;min-width:0;min-height:38px;border:1px solid var(--line);border-radius:9px;padding:0 9px;font:inherit}
@media(max-width:640px){.exercise-card.cardio-row{grid-template-columns:repeat(3,minmax(0,1fr));align-items:end}.cardio-row .exercise-name,.cardio-row .last-sets{grid-column:1/-1}.cardio-row .exercise-name{min-height:32px}.exercise-card.timed-row{grid-template-columns:minmax(90px,1fr) minmax(82px,105px) 100px;align-items:end}.timed-row .exercise-name{grid-column:auto;align-self:end;min-width:0;padding-bottom:10px}.timed-row .compact-save{grid-column:auto;width:100%}.timed-row .last-sets{grid-column:1/-1}.maximum-entry{grid-template-columns:1fr}.maximum-entry>*{width:100%;box-sizing:border-box}}
.maximum-entry{grid-template-columns:minmax(180px,1fr) 130px 110px;align-items:center;gap:8px;max-width:620px;padding:10px;border:1px solid var(--line);border-radius:14px;background:#fff}.maximum-entry>input,.maximum-weight-field input{width:100%;height:42px;min-height:42px;box-sizing:border-box;border:1px solid var(--line);border-radius:10px;padding:0 10px;font:inherit}.maximum-weight-field{position:relative}.maximum-weight-field input{padding-right:30px}.maximum-weight-field span{position:absolute;right:9px;top:50%;transform:translateY(-50%);color:var(--muted);font-size:12px}.maximum-entry .primary-btn{height:42px;min-height:42px;padding:0 12px}
@media(max-width:640px){.maximum-entry{grid-template-columns:minmax(0,1fr) 92px 90px;padding:8px}.maximum-entry>*{width:auto}.maximum-entry .primary-btn{padding:0 8px;font-size:12px}}
.weight-stepper{gap:5px;grid-template-columns:40px 78px 40px 22px}.weight-stepper button{display:grid;place-items:center;width:40px;height:40px;padding:0;border:1px solid #bfcfc8;border-radius:50%;background:#fff;color:var(--brand);font-size:27px;font-weight:700;line-height:1;box-shadow:0 2px 7px rgba(23,54,47,.09)}.weight-stepper input{width:78px;height:42px;border-radius:10px;font-size:18px;font-weight:850}.exercise-card select{height:42px;font-size:18px;font-weight:850;text-align:center}.modal-head [data-close]{display:grid;place-items:center;width:38px;height:38px;padding:0;border:1px solid var(--line);border-radius:50%;background:#f6f8f7;color:var(--ink);font-size:25px;font-weight:500;line-height:1;cursor:pointer}.modal-actions{align-items:center}.workout-delete-btn{margin-right:auto;min-height:42px;border:1px solid #e2aaa4;border-radius:10px;background:#fff;color:#a3362d;padding:0 14px;font-weight:850;cursor:pointer}
@media(max-width:640px){.weight-stepper{grid-template-columns:38px 70px 38px 20px}.weight-stepper button{width:38px;height:38px}.weight-stepper input{width:70px}.exercise-card select{font-size:17px}}
.workout-shell~#workout-modal-root .modal-actions>button{height:auto;margin:0;justify-content:center;text-align:center}
.journal-delete{display:grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid #e2aaa4;border-radius:50%;background:#fff;color:#a3362d;font-size:21px;line-height:1;cursor:pointer}.journal-delete:hover{background:#fde5e2}
.exercise-card .compact-save{display:inline-flex;align-items:center;justify-content:center;min-height:42px;border:1px solid #166453;background:#166453;color:#fff;font-size:0;font-weight:900;line-height:1.1;white-space:nowrap;box-shadow:0 4px 12px rgba(22,100,83,.18)}
.exercise-card .compact-save::after{content:"Сохранить";font-size:13px}
@media(max-width:640px){.exercise-card:not(.timed-row) .compact-save{grid-column:1/-1;width:100%}.exercise-card.timed-row .compact-save{grid-column:auto;width:100%}}
@media(max-width:640px){.exercise-card:not(.cardio-row):not(.timed-row){grid-template-columns:minmax(0,1fr) 72px;align-items:end}.exercise-card:not(.cardio-row):not(.timed-row) .exercise-name{grid-column:1/-1;min-height:32px}.exercise-card:not(.cardio-row):not(.timed-row) .weight-stepper{grid-column:1;min-width:0}.exercise-card:not(.cardio-row):not(.timed-row)>select{grid-column:2;width:72px}.exercise-card:not(.cardio-row):not(.timed-row) .compact-save{grid-column:1/-1}}
@media(max-width:360px){.exercise-card.timed-row{grid-template-columns:minmax(0,1fr) 96px}.timed-row .exercise-name{grid-column:1}.timed-row label{grid-column:2}.exercise-card.timed-row .compact-save{grid-column:1/-1}.exercise-card.cardio-row{column-gap:6px;padding-left:9px;padding-right:9px}.cardio-row label span{font-size:10px}}
.downtime-directory-table{width:100%;min-width:760px;border-collapse:collapse}.downtime-directory-table th,.downtime-directory-table td{padding:12px 14px;border-bottom:1px solid var(--line);text-align:left}.downtime-directory-table tr.is-inactive{background:#f5f5f2;color:var(--muted)}.switch-row{display:flex!important;align-items:center;gap:10px}.switch-row input{width:20px;min-height:20px!important}
.team-account-picker{border:1px solid var(--line);border-radius:12px;padding:8px 10px 10px;min-width:0}.team-account-picker legend{padding:0 5px;font-weight:700}.team-picker-toggle{border:0;background:none;color:var(--brand);padding:2px 0 7px;font:inherit;font-size:12px;font-weight:850;cursor:pointer}.team-picker-list{display:grid;gap:2px;max-height:220px;overflow:auto}.team-account-picker label{display:flex;align-items:center;justify-content:space-between;gap:7px;min-height:28px;padding:2px 3px;border-radius:6px}.team-account-picker label:hover{background:var(--soft-bg,#f6f7f9)}.team-account-picker input{width:16px;height:16px;margin:0;flex:0 0 auto}.team-account-picker label span{font-size:13px;line-height:1.2}
.team-picker-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.team-account-picker legend small{font-weight:400;color:var(--muted)}@media(max-width:720px){.team-picker-row{grid-template-columns:1fr}}
.team-history-filters{display:grid;grid-template-columns:auto 140px 140px 190px 112px;align-items:end;gap:10px;margin:0 0 16px;padding:13px;border:1px solid var(--line);border-radius:15px;background:#f8faf9}.team-history-quick{display:flex;gap:6px}.team-history-quick button{min-height:42px;border:1px solid #b6c8bf;border-radius:11px;background:#fff;padding:0 12px;font-weight:800;color:#315c4c}.team-history-filters label{display:grid;gap:5px;font-size:12px;font-weight:800;color:var(--muted)}.team-history-filters input,.team-history-filters select{box-sizing:border-box;width:100%;min-height:42px;border:1px solid #c7d4cf;border-radius:11px;background:#fff;padding:0 10px;font:inherit;color:var(--ink)}.team-history-filters button{min-height:42px}.team-history-status{display:inline-flex;padding:5px 8px;border-radius:999px;background:#f3e5e5;color:#8d3434;font-weight:700}.team-history-status.done{background:#dff2e9;color:#236245}.team-review-button{border:1px solid #b6c8bf;background:#fff;border-radius:999px;padding:6px 10px;font-weight:700;color:#315c4c}.team-review-button.checked{background:#e7f2c9;border-color:#b7cf70}@media(max-width:720px){.team-history-filters{grid-template-columns:1fr 1fr}.team-history-quick{grid-column:1/-1}.team-history-account,.team-history-filters>button.primary-btn{grid-column:1/-1}}
.team-picker-item{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px}.team-picker-item>label{display:flex;align-items:center;justify-content:space-between;gap:10px}
.team-modal:has(#template-form){scrollbar-width:thin;scrollbar-color:#b9c6c0 transparent}
.team-modal:has(#template-form)::-webkit-scrollbar{width:7px}.team-modal:has(#template-form)::-webkit-scrollbar-track{background:transparent}.team-modal:has(#template-form)::-webkit-scrollbar-thumb{border-radius:999px;background:#b9c6c0}
#template-form{gap:9px;padding-top:9px}
#template-form>label,#template-form .task-form-row label{gap:4px}
#template-form input,#template-form select{min-height:38px;padding:7px 10px}
#template-form textarea{min-height:66px;height:66px;padding:7px 10px;resize:vertical}
#template-form .team-picker-row{gap:9px}
#template-form .team-account-picker{padding:5px 8px 7px}
#template-form .team-picker-toggle{padding-bottom:3px}
#template-form .team-picker-list{max-height:142px;scrollbar-width:thin;scrollbar-color:#b9c6c0 transparent}
#template-form .team-account-picker label{min-height:25px}
#template-form .modal-actions{padding-top:8px;margin-top:0}
.dialog-page{max-width:1280px;margin:0 auto;padding:24px}.dialog-intro{display:flex;align-items:center;justify-content:space-between}.dialog-summary{display:flex;align-items:baseline;gap:6px;padding:10px 16px;border-radius:16px;background:#f2e8c9;color:#5b4516}.dialog-summary strong{font-size:24px}.dialog-workspace{display:grid;grid-template-columns:340px minmax(0,1fr);height:calc(100vh - 190px);min-height:520px;overflow:hidden;padding:0}.dialog-sidebar{display:flex;min-width:0;flex-direction:column;border-right:1px solid #dce4df}.dialog-filters{display:flex;gap:6px;padding:12px;border-bottom:1px solid #dce4df}.dialog-filters button{border:0;border-radius:999px;padding:8px 12px;background:#eef2ef;color:#344c45}.dialog-filters button.is-active{background:#17362f;color:white}.dialog-list{overflow:auto}.dialog-list-item{display:flex;width:100%;flex-direction:column;gap:7px;padding:14px 16px;border:0;border-bottom:1px solid #e4e9e6;background:white;text-align:left;color:#243b35}.dialog-list-item:hover,.dialog-list-item.is-selected{background:#f2f6f3}.dialog-list-item.is-new{box-shadow:inset 4px 0 #d2a526}.dialog-list-top,.dialog-list-meta{display:flex;align-items:center;justify-content:space-between;gap:10px}.dialog-list-top small{border-radius:999px;padding:3px 7px;background:#e9f0ed}.dialog-list-preview{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#61726c}.dialog-list-meta small{color:#75847f}.dialog-list-meta b{display:grid;min-width:22px;height:22px;place-items:center;border-radius:50%;background:#d2a526;color:#fff;font-size:12px}.dialog-list-empty,.dialog-empty{display:grid;height:100%;place-content:center;gap:6px;padding:24px;text-align:center;color:#74817d}.dialog-thread{display:grid;min-width:0;grid-template-rows:auto auto minmax(0,1fr) auto}.dialog-thread-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:14px 18px;border-bottom:1px solid #dce4df}.dialog-thread-head div{display:flex;min-width:0;flex-direction:column}.dialog-thread-head div span{color:#73817c}.dialog-thread-head select,.dialog-assignment select{border:1px solid #cad5d0;border-radius:10px;padding:9px;background:white}.dialog-back{display:none;border:0;background:transparent;font-size:22px}.dialog-assignment{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 18px;background:#f6f8f7}.dialog-messages{display:flex;overflow:auto;flex-direction:column;gap:10px;padding:18px;background:#edf2ef}.dialog-message{max-width:min(76%,620px);padding:10px 13px;border-radius:15px;background:white;box-shadow:0 2px 8px #17362f12}.dialog-message.is-outgoing{align-self:flex-end;background:#dcebe4}.dialog-message small{display:block;margin-top:5px;color:#71807a}.dialog-composer{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:12px;border-top:1px solid #dce4df}.dialog-composer textarea{min-width:0;resize:none;border:1px solid #bdcbc5;border-radius:12px;padding:11px 13px;font:inherit}.dialog-composer .primary-btn{align-self:stretch}.dialog-list-empty{height:auto;min-height:180px}
@media(max-width:720px){.dialog-page{padding:12px}.dialog-intro{align-items:flex-start}.dialog-workspace{display:block;height:calc(100vh - 155px);min-height:460px}.dialog-sidebar{height:100%;border:0}.dialog-thread{position:fixed;inset:0;z-index:40;display:none;background:white}.dialog-thread.is-open{display:grid}.dialog-back{display:block}.dialog-thread-head{padding-top:max(14px,env(safe-area-inset-top))}.dialog-assignment{align-items:stretch;flex-direction:column}.dialog-assignment .primary-btn,.dialog-assignment select{width:100%}.dialog-message{max-width:88%}.dialog-composer{padding-bottom:max(12px,env(safe-area-inset-bottom))}.dialog-composer .primary-btn{padding-inline:12px}.dialog-summary{padding:7px 11px}.dialog-summary strong{font-size:20px}}
@media (min-width:700px) and (max-width:1180px) and (orientation:landscape) {
  .exercise-card,.exercise-card.cardio-row,.exercise-card.timed-row{gap:6px;padding:7px 9px}
  .maximum-entry{gap:6px;margin-bottom:10px;padding:7px}
  .maximum-list article{gap:8px;padding:8px 10px}
  .downtime-directory-table th,.downtime-directory-table td{padding:7px 8px;font-size:11px}
  .team-history-filters{gap:7px;margin-bottom:9px;padding:8px}
  .team-history-quick button,.team-history-filters input,.team-history-filters select,.team-history-filters button{min-height:36px}
  .team-account-picker{padding:5px 8px 7px}
  .team-picker-list{max-height:150px}
  .dialog-page{max-width:none;padding:0}
  .dialog-workspace{grid-template-columns:290px minmax(0,1fr);height:calc(100vh - 108px);min-height:0}
  .dialog-summary{padding:6px 9px}
  .dialog-list-item{gap:4px;padding:8px 10px}
  .dialog-filters{gap:4px;padding:7px 8px}
  .dialog-filters button{padding:6px 9px}
  .dialog-thread-head{padding:9px 11px}
  .dialog-assignment{padding:7px 11px}
  .dialog-messages{gap:7px;padding:10px}
  .dialog-composer{gap:7px;padding:8px 10px}
}


/* Единые компактные окна: один предел по экрану, общий ритм форм и доступные действия. */
.modal-card.modal-card-compact { --modal-width: 480px; }
.modal-card.standard-modal-form { padding: var(--modal-pad); }
.modal-card [hidden] { display: none !important; }
.modal-card .modal-head h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.modal-card .modal-head p:not(.eyebrow) { margin: 4px 0 0; line-height: 1.35; }
.modal-card .modal-head { margin-bottom: 8px; padding-bottom: 8px; }
.modal-card .modal-head .icon-button { min-height: 36px; padding: 6px 10px; }
.modal-card .modal-head .icon-button[aria-label] { min-width: 36px; width: auto; height: auto; flex-basis: auto; }
.modal-card :is(.standard-modal-form, .task-form, .adjustment-form, .sheet-material-form, .work-quantity-form, .modal-body, .matrix-item-editor-form, #template-form, #schedule-form, #absence-form, #new-employee-form, #employee-profile-form, #allowance-form) {
  gap: 8px;
  padding: 0;
  margin-top: 0;
}
.modal-card :is(.task-form-row, .calendar-form-row, .shipment-form-grid, .marketplace-article-form-grid, .schedule-form-grid, .employee-create-grid, .allowance-date-grid, .team-picker-row, .matrix-item-editor-grid, .cashflow-form-grid) { gap: 8px; }
.modal-card .cashflow-form-grid { margin-top: 8px; }
.modal-card label { min-width: 0; gap: 4px; }
.modal-card label > span { overflow-wrap: anywhere; }
.modal-card .catalog-active-toggle { padding: 8px 10px; }
.modal-card .employee-section-picker { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); padding: 8px 10px; }
.modal-card .employee-section-picker .catalog-active-toggle { min-height: 36px; border: 0; padding: 4px 0; }
.modal-card :is(#new-employee-form, #employee-profile-form, #schedule-form) input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; padding: 0; }
.modal-card .modal-form-grid { gap: 8px; }
.modal-card :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]), select, textarea) {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  font-size: 14px;
}
.modal-card textarea, .modal-card #absence-form textarea { min-height: 66px; resize: vertical; }
.modal-card .checkbox-field { gap: 8px; padding-bottom: 0; }
.modal-card .checkbox-field span { white-space: normal; }
.modal-card .matrix-item-editor-field { padding: 0; border: 0; background: transparent; }
.modal-card .claim-card-grid { gap: 8px; padding: 0; }
.modal-card .claim-card-grid label > span, .modal-card .claim-comments label > span { margin-bottom: 4px; }
.modal-card .claim-product-field { padding: 8px; }
.modal-card .claim-comments { margin: 12px 0 0; padding: 10px; }
.modal-card .claim-comments h3 { margin-bottom: 8px; }
.modal-card .claim-comments label { margin-top: 8px; }
.modal-card .comment-field { margin-top: 8px; }
.modal-card .comment-field label { margin-bottom: 4px; }
.modal-card .reason-choice span { min-height: 44px; padding: 8px 10px; }
.modal-card .shipment-lines-section { margin-top: 12px; padding-top: 12px; }
.modal-card .shipment-line { padding: 8px; }
.modal-card .auto-date-note { min-height: 0; padding: 8px 10px; gap: 4px; }
.modal-card .form-note { margin: 8px 0 0; }
.modal-card :is(.modal-actions, .summary-actions, .employee-modal-actions, .inventory-sku-form-actions, .marketplace-article-form-actions, .shipment-form-actions, .matrix-item-editor-actions, .sheet-cut-confirm-actions, .task-form-actions) {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 8px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--line);
  background: #fff;
}
.modal-card :is(.modal-actions, .summary-actions, .employee-modal-actions, .inventory-sku-form-actions, .marketplace-article-form-actions, .shipment-form-actions, .matrix-item-editor-actions, .sheet-cut-confirm-actions, .task-form-actions) > button,
.modal-card form > :is(.primary-btn, .secondary-btn, .danger-btn, .warning-btn) {
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  white-space: normal;
}
/* В табличных окнах прокручивается только таблица, шапка остаётся снаружи. */
.modal-card:has(> .sticky-table-wrap) { display: flex; flex-direction: column; overflow: hidden; }
.modal-card:has(> .sticky-table-wrap) > :not(.sticky-table-wrap) { flex-shrink: 0; }
.modal-card > .sticky-table-wrap { min-height: 0; max-height: none; overflow: auto; }
@media (min-width: 541px) {
  .modal-card :is(.task-form-row, .calendar-form-row, .schedule-form-grid, .employee-create-grid, .allowance-date-grid, .team-picker-row) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .modal-backdrop { --modal-pad: 12px; --modal-screen-gap: 8px; }
  .modal-form-grid { grid-template-columns: minmax(0, 1fr); }
  .modal-card .modal-head h2 { font-size: 20px; }
  .modal-card :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]), select, textarea) { font-size: 16px; }
  .modal-card :is(.modal-actions, .summary-actions, .employee-modal-actions, .inventory-sku-form-actions, .marketplace-article-form-actions, .shipment-form-actions, .matrix-item-editor-actions, .sheet-cut-confirm-actions, .task-form-actions) { display: grid; grid-template-columns: minmax(0, 1fr); }
  .modal-card :is(.modal-actions, .summary-actions, .employee-modal-actions, .inventory-sku-form-actions, .marketplace-article-form-actions, .shipment-form-actions, .matrix-item-editor-actions, .sheet-cut-confirm-actions, .task-form-actions) > button { width: 100%; }
}
@media (max-height: 640px) and (min-width: 541px) {
  .modal-backdrop { --modal-pad: 12px; --modal-screen-gap: 8px; }
}
@media (pointer: coarse) {
  .modal-card :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]), select) { min-height: 44px; }
  .modal-card :is(button.primary-btn, button.secondary-btn, button.danger-btn, button.warning-btn), .modal-card .modal-head .icon-button { min-height: 44px; }
  .modal-card .modal-head .icon-button[aria-label] { min-width: 44px; }
}

/* Shared module headers use real flow; no guessed space for floating controls. */
.module-page-intro.has-module-header {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  padding: 0;
}
.module-page-intro.has-module-header > * { min-width: 0; max-width: 100%; }
.module-page-intro.has-module-header > :first-child:not(.module-topbar) { flex: 1 1 220px; }
.module-page-intro.has-module-header h1 { overflow-wrap: anywhere; }
.module-page-intro.has-module-header :is(button.primary-btn, button.secondary-btn) { min-width: 0; min-height: 40px; max-width: 100%; padding: 8px 10px; font-size: 14px; white-space: normal; }
.module-page-intro.has-module-header > .module-topbar { flex: 0 1 auto; margin-left: auto; }
.module-topbar.module-header-inline,
.production-page .module-topbar:has(.module-header-actions),
body.phone-compact:not(.production-page) .module-topbar.module-header-inline {
  position: static;
  inset: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: auto;
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  overflow: visible;
  z-index: auto;
}
.module-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: stretch; gap: 6px; min-width: 0; max-width: 100%; }
.module-header-actions > :is(button, a) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  width: auto;
  height: auto;
  min-height: 40px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--brand);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.module-header-actions .module-menu-trigger { position: static; inset: auto; flex: 0 0 46px; width: 46px; min-height: 44px; padding: 10px; justify-content: center; margin: 0; z-index: auto; }
.module-header-actions .module-menu-trigger i { flex: 0 0 24px; }
.module-header-actions .developer-feedback-trigger { display: flex; flex-direction: column; justify-content: center; flex: 0 0 auto; width: 124px; min-height: 44px; padding: 5px 10px; gap: 0; color: #fff; background: #17665f; border-color: #17665f; font-size: 13px; line-height: 1.2; }
.module-header-actions .developer-feedback-trigger:hover { background: #12554f; }
.module-header-actions > :is(button, a):hover { background: var(--brand-soft); }
.module-header-actions [hidden] { display: none !important; }
.module-page-intro.has-module-header :is(.inventory-intro-main, .shipments-intro-main, .inventory-actions) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.module-page-intro.has-module-header :is(.inventory-intro-main, .shipments-intro-main) > :first-child { min-width: 0; }
.module-page-intro.has-module-header :is(.inventory-actions, .shipments-intro-main) > button { min-width: 0; max-width: 100%; white-space: normal; }
/* The worker page mounts the same header inside its current card. */
.production-card-header { flex-wrap: wrap; gap: 8px 12px; min-width: 0; margin-bottom: 10px; }
.production-card-title { flex: 1 1 220px; min-width: 0; max-width: 100%; }
.production-card-title :is(h1, h2) { overflow-wrap: anywhere; }
.production-card-navigation { flex: 0 1 auto; min-width: 0; max-width: 100%; margin-left: auto; }
.production-card-header :is(.board-heading, .step-header, .active-work-header) { padding-top: 0; padding-right: 0; margin-bottom: 0; }
.production-card-header .summary-hero { padding-right: 24px; margin-top: 0; margin-bottom: 0; }
.production-page .module-topbar:has(.module-header-actions) > .production-context-back { max-width: 100%; white-space: normal; }
.active-work-view:has(.production-card-navigation .module-header-actions) .shell { margin-top: 16px; }
/* Drawer sections shrink in flow, including the optional local phone setting. */
.module-nav-drawer { display: flex; flex-direction: column; min-height: 0; max-height: 100vh; max-height: 100dvh; }
.module-nav-drawer > :is(header, footer, .phone-density-setting) { flex-shrink: 0; }
.module-nav-drawer > header { min-width: 0; }
.module-nav-drawer > header > div { min-width: 0; overflow-wrap: anywhere; }
.module-nav-drawer > header > button { flex: 0 0 40px; }
.module-nav-drawer > nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.module-nav-copy { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .module-page-intro.has-module-header > .module-topbar.has-developer-feedback { flex: 1 1 100%; }
  .module-topbar.has-developer-feedback .module-header-actions { display: flex; justify-content: flex-end; width: 100%; }
  .production-card-navigation:has(.has-developer-feedback) { flex: 1 1 100%; }
  .production-card-navigation .module-topbar.has-developer-feedback { width: 100%; }
  .production-card-navigation .module-header-actions { flex: 1 1 100%; }
  .module-header-actions > :is(button, a), .module-page-intro.has-module-header :is(button.primary-btn, button.secondary-btn) { min-height: 44px; }
  .module-nav-drawer > header { gap: 8px; padding: 12px; }
}

/* Form controls shrink with their grid, then move to a new row before dates become cramped. */
:is(.piecework-form, .claims-filters) > label { min-width: 0; }
:is(.piecework-form, .claims-filters) :is(input, select) { width: 100%; min-width: 0; max-width: 100%; }
.piecework-form > button { min-width: 0; min-height: 44px; padding: 8px 12px; white-space: normal; }
#absence-manager-form { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 8px; padding: 14px; }
@media (max-width: 900px) {
  .piecework-form { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 8px; padding: 14px; }
}
@media (max-width: 760px) {
  .claims-filters { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
}

/* Column ordering keeps its own hit target, separate from truncated operation names. */
.operation-matrix thead .reference-drag-handle[data-matrix-operation-handle] { display: inline-grid; place-items: center; vertical-align: middle; overflow: visible; -webkit-line-clamp: unset; line-clamp: unset; }
@media (pointer: coarse) {
  .operation-matrix thead .reference-drag-handle[data-matrix-operation-handle] { width: 44px; min-width: 44px; height: 44px; min-height: 44px; touch-action: manipulation; }
}
@media (max-width: 640px) {
  .operation-matrix:not(.sheet-cut-matrix) .matrix-id { position: static; }
  .operation-matrix:not(.sheet-cut-matrix) .matrix-product { left: 0; width: min(180px, 42vw); min-width: min(180px, 42vw); max-width: min(180px, 42vw); }
}

/* Align MAX logistics controls independently of helper-text height. */
#logistics-max-form { align-items: start; gap: 10px 12px; }
#logistics-max-form > label { align-content: start; gap: 4px; }
#logistics-max-form select { height: 44px; }
#logistics-max-form > p { margin: 0; font-size: 13px; color: var(--muted); }
#logistics-max-form small { font-size: 12px; line-height: 1.4; color: var(--muted); }
#logistics-max-error:empty { display: none; }
@media (max-width: 540px) { #logistics-max-form { grid-template-columns: minmax(0,1fr); } }

#cargo-max-settings { border-color:#bacbe3; background:#edf3fc; color:#244d7c; font-weight:600; }
#cargo-max-settings:hover { background:#e0ebfa; border-color:#7195c3; }
#logistics-max-title { font-size:20px; }
