:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #17202a;
  background: #eef1f4;
  font-synthesis: none;
  --border: #d8dde3;
  --muted: #667085;
  --blue: #1769e0;
  --blue-soft: #eaf2ff;
  --green: #087a55;
  --green-soft: #e6f5ef;
  --orange: #bd5b00;
  --orange-soft: #fff1df;
  --red: #c73737;
  --red-soft: #fff0f0;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1180px; background: #eef1f4; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(460px, 620px) minmax(460px, 1fr);
  background: #f7f9fb;
}
.login-panel { padding: 56px 84px; display: flex; flex-direction: column; background: white; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup strong { display: block; font-size: 22px; }
.brand-lockup span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 2px solid #111820; color: #111820; font-weight: 700; font-size: 20px; transform: rotate(45deg); }
.brand-mark::first-letter { transform: rotate(-45deg); }
.login-copy { margin-top: auto; max-width: 460px; }
.login-copy h1 { font-size: 34px; margin: 6px 0 10px; }
.login-copy p:last-child { color: var(--muted); line-height: 1.55; }
.eyebrow { margin: 0; color: var(--muted); text-transform: uppercase; font-size: 10px; font-weight: 700; }
.login-form { margin: 28px 0 auto; max-width: 420px; display: grid; gap: 16px; }
.login-form small { color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.4; }
.login-operators { width: 100%; max-width: 420px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.login-operators > strong { display: block; margin-bottom: 8px; font-size: 11px; }
.login-operators-list { display: grid; gap: 6px; }
label { display: grid; gap: 6px; color: #344054; font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cfd6df; border-radius: 5px; padding: 10px 11px; color: #17202a; background: white; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(23,105,224,.12); }
#notes { min-height: clamp(190px, 26vh, 360px); max-height: 48vh; resize: vertical; }
.report-return-button { align-self: flex-start; margin: 8px 0 0; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 43px; }
.password-toggle { position: absolute; top: 50%; right: 4px; width: 34px; height: 34px; padding: 0; transform: translateY(-50%); display: grid; place-items: center; border: 0; border-radius: 4px; color: #667085; background: transparent; }
.password-toggle:hover { color: #17202a; background: #f1f4f7; }
.password-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.password-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.password-icon-hide { display: none; }
.password-toggle[aria-pressed="true"] .password-icon-show { display: none; }
.password-toggle[aria-pressed="true"] .password-icon-hide { display: block; }
.login-hint { margin: -4px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.login-link-button { justify-self: center; border: 0; background: transparent; color: var(--blue); font-size: 12px; font-weight: 700; }
.login-link-button:hover { text-decoration: underline; }
.login-context { background: #17202a; color: white; padding: 76px 8vw; display: flex; flex-direction: column; justify-content: center; }
.login-context h2 { font-size: 26px; margin: 30px 0 10px; }
.login-context p { max-width: 560px; color: #cbd5df; line-height: 1.6; }
.context-visual { background: white; color: #17202a; border-radius: 8px; padding: 18px; max-width: 560px; box-shadow: 0 28px 80px rgba(0,0,0,.24); }
.mini-order { display: flex; justify-content: space-between; align-items: center; padding: 15px 14px; border-bottom: 1px solid var(--border); }
.mini-order:last-child { border: 0; }
.mini-order b { padding: 4px 7px; background: #eef1f4; border-radius: 4px; font-size: 12px; }
.mini-order .urgent { background: var(--orange-soft); color: var(--orange); }
.mini-order .overdue { background: var(--red-soft); color: var(--red); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; box-sizing: border-box; border: 1px solid transparent; border-radius: 5px; min-height: 39px; padding: 8px 16px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; vertical-align: middle; }
.button.primary { color: white; background: var(--blue); }
.button.primary:hover { background: #0d59c5; }
.button.secondary { color: #27303a; border-color: #cdd4dd; background: white; }
.button.secondary:hover { background: #f5f7f9; }
.button.danger { color: #a32828; border-color: #e0bcbc; background: #fff7f7; }
.button.danger:hover { background: #ffeaea; }
.button.wide { width: 100%; }
.button.small { min-height: 34px; font-size: 12px; }
.icon-button { width: 34px; height: 34px; border: 1px solid transparent; background: transparent; border-radius: 5px; font-size: 18px; color: #495463; }
.icon-button:hover { border-color: var(--border); background: #f5f7f9; }

.app { height: 100vh; min-height: 720px; display: grid; grid-template-rows: 58px 1fr; background: white; overflow: hidden; }
.topbar { display: grid; grid-template-columns: 310px 1fr auto; align-items: center; border-bottom: 1px solid var(--border); padding: 0 16px; background: white; }
.brand-lockup.compact .brand-mark { width: 28px; height: 28px; font-size: 13px; }
.brand-lockup.compact strong { font-size: 16px; }
.brand-lockup.compact span { font-size: 10px; }
.point-chip { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; background: #f5f7f9; border-radius: 5px; font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.test-mode-badge { padding: 4px 7px; border: 1px solid #e8bd68; border-radius: 3px; color: #7a4a00; background: #fff4d6; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.network-state { font-size: 11px; font-weight: 700; color: var(--green); }
.network-state.offline { color: var(--orange); }
.user-menu { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.role-badge { padding: 3px 6px; border: 1px solid #b9d8d1; border-radius: 3px; color: #176b5b; background: #f0faf7; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.operator-menu-button { min-height: 34px; display: inline-flex; align-items: center; gap: 8px; padding: 0 9px 0 5px; border: 1px solid #cfd6df; border-radius: 5px; color: #17202a; background: white; font-size: 11px; font-weight: 700; }
.operator-menu-button:hover { background: #f5f7f9; }
.operator-count { min-width: 23px; height: 23px; display: inline-grid; place-items: center; border-radius: 3px; color: white; background: var(--green); font-size: 9px; }

.workspace { min-height: 0; display: grid; grid-template-columns: 74px 310px minmax(700px, 1fr); }
.primary-nav { min-height: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 7px; border-right: 1px solid var(--border); background: #17202a; }
.primary-nav-button { width: 100%; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #b9c4cf; font-size: 9px; font-weight: 700; }
.primary-nav-button:hover { color: white; background: #25303b; }
.primary-nav-button.active { color: white; border-color: #44515f; background: #2a3642; }
.primary-nav-icon { font-size: 19px; line-height: 1; }
.orders-panel { min-height: 0; display: flex; flex-direction: column; background: #fbfcfd; }
.orders-panel { border-right: 1px solid var(--border); padding: 14px 12px 12px; }
.panel-title-row { display: flex; justify-content: space-between; align-items: center; }
.panel-title-row h2 { margin: 3px 0 0; font-size: 18px; }
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); margin-top: 12px; }
.tab { border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; padding: 9px 3px 8px; font-weight: 700; font-size: 12px; }
.tab.active { color: var(--blue); border-color: var(--blue); }
.order-type-tabs { display: grid; grid-template-columns: 1fr .8fr 1.2fr; gap: 3px; margin-top: 9px; padding: 3px; border: 1px solid #d7dde4; border-radius: 5px; background: #f1f3f5; }
.order-type-tabs button { min-width: 0; height: 29px; padding: 0 5px; overflow: hidden; border: 0; border-radius: 3px; color: #667085; background: transparent; font-size: 8.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.order-type-tabs button.active { color: #164f9d; background: white; box-shadow: 0 1px 2px rgba(25, 38, 55, .12); }
.order-status-filter { margin-top: 8px; gap: 5px; font-size: 10px; }
.order-status-filter select { min-height: 34px; padding: 7px 8px; font-size: 11px; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin: 10px 0; }
.search-row input { min-width: 0; padding: 8px 9px; font-size: 11px; }
.density-control { display: flex; border: 1px solid #cfd6df; border-radius: 5px; overflow: hidden; background: white; }
.density-button { width: 31px; border: 0; border-left: 1px solid #dde2e8; color: #647080; background: white; }
.density-button:first-child { border-left: 0; }
.density-button.active { color: var(--blue); background: var(--blue-soft); }
.orders-list { flex: 1; overflow-y: auto; min-height: 0; scrollbar-width: thin; }
.order-list-item { position: relative; width: 100%; text-align: left; border: 1px solid transparent; border-bottom-color: #e4e8ed; background: transparent; color: #17202a; }
.orders-list.compact .order-list-item { min-height: 44px; padding: 2px 8px 2px 10px; line-height: 1.05; }
.orders-list.large .order-list-item { min-height: 94px; padding: 10px 11px; margin-bottom: 7px; border-color: #dfe4ea; border-radius: 5px; background: white; }
.order-list-item:hover { background: #f3f6fa; }
.order-list-item.selected { background: var(--blue-soft); border-color: #80adf2; }
.order-list-item.urgent::before, .order-list-item.overdue::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.order-list-item.urgent::before { background: #e57600; }
.order-list-item.overdue::before { background: var(--red); }
.order-line { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.order-line + .order-line { margin-top: 1px; }
.order-code { flex: 0 1 auto; min-width: 48px; overflow-wrap: anywhere; font-size: 11px; font-weight: 700; }
.order-code-wrap { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 5px; }
.order-type-mark { flex: 0 0 auto; padding: 2px 5px; border: 1px solid transparent; border-radius: 3px; font-size: 8.5px; font-weight: 700; line-height: 1.2; }
.order-type-mark.repair { color: #5a3d0b; border-color: #ead49f; background: #fbf1da; }
.order-type-mark.manufacture { color: #13515d; border-color: #b8dce2; background: #e2f3f5; }
.online-order-mark { flex: 0 0 auto; padding: 2px 4px; border-radius: 3px; color: #176b5b; background: #dff1ec; font-size: 7px; font-weight: 700; text-transform: uppercase; }
.test-order-mark { flex: 0 0 auto; padding: 2px 4px; border-radius: 3px; color: #7a4a00; background: #fff0c7; font-size: 7px; font-weight: 800; text-transform: uppercase; }
.order-sync-mark { flex: 0 0 auto; padding: 2px 4px; border-radius: 3px; font-size: 7px; font-weight: 700; }
.order-sync-mark.draft { color: #775309; background: #fff0c7; }
.order-sync-mark.pending { color: #1556a3; background: #e4efff; }
.order-time { flex: 0 0 auto; color: var(--muted); font-size: 9.5px; white-space: nowrap; }
.order-location, .order-item { min-width: 0; color: var(--muted); font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-client { max-width: 165px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-badge { display: inline-flex; align-items: center; min-height: 18px; padding: 2px 5px; border-radius: 3px; background: #eef1f4; color: #3c4652; font-size: 9px; font-weight: 700; }
.status-badge.work { color: #1457b8; background: #e9f1ff; }
.status-badge.ready { color: var(--green); background: var(--green-soft); }
.status-badge.urgent { color: var(--orange); background: var(--orange-soft); }
.status-badge.overdue { color: var(--red); background: var(--red-soft); }
.new-order { margin-top: 10px; }

.order-workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 15px 16px 0; background: white; }
.test-order-banner { margin: 10px 0 0; padding: 8px 10px; border: 1px solid #e8bd68; border-left: 4px solid #c78300; border-radius: 4px; color: #714600; background: #fff8e6; font-size: 11px; font-weight: 700; }
.order-workspace.has-no-order > :not(.empty-order-workspace) { display: none; }
.order-workspace:not(.has-no-order) > .empty-order-workspace { display: none; }
.empty-order-workspace { flex: 1; display: grid; place-items: center; min-height: 320px; text-align: center; }
.empty-order-workspace > div { max-width: 360px; }
.empty-order-workspace h2 { margin: 0; font-size: 20px; }
.empty-order-workspace p { margin: 8px 0 18px; color: var(--muted); font-size: 11px; }
.order-header { display: flex; justify-content: space-between; align-items: center; }
.order-header h1 { margin: 3px 0 0; font-size: 22px; }
.mobile-back-button { display: none; width: 34px; height: 34px; margin-right: 8px; border: 1px solid #cfd6df; border-radius: 5px; color: #27303a; background: white; font-size: 21px; }
.order-header-actions { display: flex; align-items: center; gap: 8px; }
.order-header-actions .button { min-height: 34px; white-space: nowrap; }
.transfer-inbox { margin: 8px 0; justify-content: space-between; }
.transfer-inbox span { border-radius: 999px; padding: 2px 8px; color: white; background: var(--blue); }
.transfer-history-button { margin: 0 0 8px; }
.order-transfer-reference { margin: 4px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.order-list-transfer-reference { display: block; margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.outgoing-transfer-status { font-size: 11px; font-weight: 700; color: var(--muted); }
.outgoing-transfer-status.accepted { color: var(--green); }
.order-transfer-notice { margin: 8px 0 12px; padding: 10px 12px; border: 1px solid #b8d4f4; border-radius: 8px; color: #23558e; background: #eef6ff; font-size: 12px; }
.order-transfer-notice button { margin-left: 10px; border: 0; color: #b13c36; background: transparent; cursor: pointer; font-weight: 700; }
.transfer-panel { max-height: min(720px, 90vh); display: flex; flex-direction: column; }
.transfer-form { padding: 18px; overflow: auto; display: grid; gap: 14px; }
.transfer-form label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; }
.transfer-form select, .transfer-form textarea { width: 100%; }
.transfer-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.incoming-transfers-list { padding: 16px; overflow: auto; display: grid; gap: 12px; }
.incoming-transfer-card { border: 1px solid var(--border); border-radius: 9px; padding: 14px; display: grid; gap: 6px; }
.incoming-transfer-card p { margin: 0; font-size: 12px; }
.incoming-transfer-card .modal-actions { margin-top: 8px; flex-wrap: wrap; }
.status-select { width: 130px; padding: 8px; font-weight: 700; }
.section-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin-top: 10px; }
.section-tabs button { border: 0; border-bottom: 2px solid transparent; padding: 9px 0 8px; color: #4e5967; background: transparent; font-size: 11px; }
.section-tabs button.active { color: var(--blue); border-color: var(--blue); font-weight: 700; }
.order-form { flex: 1; min-height: 0; overflow: auto; padding: 10px 2px 12px; }
.form-section { border-bottom: 1px solid #e4e8ed; padding: 10px 0 12px; }
.form-section.two-columns { display: grid; grid-template-columns: 1fr 1.08fr; gap: 20px; }
.form-section h3 { margin: 0 0 9px; font-size: 13px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.field-grid.four { grid-template-columns: 1.4fr 1fr .7fr .7fr; }
.field-grid.payment-grid { grid-template-columns: 1fr 1fr 1fr .9fr .9fr; align-items: end; }
.payment-heading { margin-bottom: 12px; }
.order-payment-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; background: #fbfcfd; }
.order-payment-summary > div { min-height: 68px; display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 10px 12px; border-right: 1px solid var(--border); }
.order-payment-summary > div:last-child { border-right: 0; }
.order-payment-summary span { color: var(--muted); font-size: 9px; line-height: 1.3; }
.order-payment-summary strong { font-size: 15px; }
.order-payment-summary .accent { background: #f1faf5; }
.order-payment-summary .accent strong { color: var(--green); }
.order-payment-ledger { margin-top: 16px; }
.order-payment-ledger h4 { margin: 0 0 8px; font-size: 11px; }
.order-payment-list { display: grid; gap: 8px; }
.order-payment-row { padding: 10px 12px; border: 1px solid var(--border); border-radius: 5px; background: white; }
.order-payment-row.reversed { opacity: .66; background: #f7f7f7; }
.order-payment-row-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.order-payment-row-main > div { min-width: 0; }
.order-payment-row-main strong, .order-payment-row-main span { display: block; }
.order-payment-row-main > div > strong { font-size: 11px; }
.order-payment-row-main > div > span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.order-payment-amount { flex: 0 0 auto; font-size: 14px; white-space: nowrap; }
.order-payment-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 8px; color: #425064; font-size: 9px; }
.order-payment-row > small { display: block; margin-top: 6px; color: #855600; font-size: 8.5px; }
.order-payment-admin-actions { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, max-content) minmax(0, max-content); gap: 7px; margin-top: 9px; }
.order-payment-admin-actions input { min-width: 0; height: 32px; border: 1px solid var(--line); border-radius: 5px; padding: 0 8px; }
.order-payment-admin-actions .button, .order-metal-payment-admin-actions .button { min-width: 0; height: auto; white-space: normal; }
.work-payment-form { display: grid; grid-template-columns: minmax(170px, .7fr) minmax(250px, 1fr) auto; gap: 10px; align-items: end; margin-top: 14px; padding: 12px; border: 1px solid #cdddf2; border-radius: 5px; background: #f4f8ff; }
.work-payment-form label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 9px; font-weight: 800; }
.work-payment-form input, .work-payment-form select { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 5px; background: white; padding: 0 9px; color: var(--ink); font: inherit; }
.work-payment-form .button { min-height: 36px; height: auto; padding-top: 7px; padding-bottom: 7px; white-space: normal; }
.work-payment-form > p { grid-column: 1 / -1; margin: 0; }
.field-grid input, .field-grid select { height: 34px; padding: 7px 9px; font-size: 11px; }
.due-field > span { display: block; margin-bottom: 4px; font-size: 10px; font-weight: 700; }
.due-field-inputs { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 6px; }
.due-field-inputs input { min-width: 0; }
.span-2 { grid-column: span 2; }
.span-4 { grid-column: span 4; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-heading h3 { margin-bottom: 0; }
.section-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.items-section { padding-top: 4px; }
.items-container { display: grid; gap: 12px; margin-top: 12px; }
.item-card { border: 1px solid #ccd5df; border-radius: 6px; background: white; overflow: hidden; }
.item-card-header { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 13px; border-bottom: 1px solid #dce2e8; background: #f7f9fb; }
.item-card-header strong { font-size: 12px; }
.item-card-header span { margin-left: 8px; color: var(--muted); font-size: 9px; font-weight: 400; }
.item-remove-button { border: 0; color: #a52626; background: transparent; font-size: 10px; font-weight: 700; }
.item-details { display: grid; grid-template-columns: 1.25fr .9fr .65fr 1fr .75fr .65fr; gap: 10px; padding: 13px; }
.item-details label { min-width: 0; font-size: 10px; }
.item-details .item-metal-source-field { grid-column: span 2; }
.item-details .item-defect-field { grid-column: 1 / -1; }
.manufacture-item-details .item-loss-field { grid-column: span 2; }
.manufacture-item-details .item-final-weight-field { grid-column: span 1; }
.manufacture-item-details .item-defect-field { grid-column: span 3; }
.item-field-title { min-height: 12px; display: flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.item-field-title b { color: #a52626; font-size: 9px; }
.item-input-with-unit { position: relative; display: block; }
.item-input-with-unit input { padding-right: 29px; }
.item-input-unit { position: absolute; top: 50%; right: 10px; color: var(--muted); font-size: 10px; font-weight: 700; transform: translateY(-50%); pointer-events: none; }
.item-field-note { color: var(--muted); font-size: 8px; font-weight: 400; line-height: 1.2; }
.item-loss-note { color: var(--muted); font-size: 8px; font-weight: 400; }
.manufacture-loss-summary { margin: 0 13px 13px; overflow: hidden; border: 1px solid #bad0ee; border-radius: 5px; background: #f5f9ff; }
.manufacture-loss-summary header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border-bottom: 1px solid #d5e2f3; background: #eaf3ff; }
.manufacture-loss-summary header strong { font-size: 10.5px; }
.manufacture-loss-summary header span { color: #315d98; font-size: 8.5px; font-weight: 800; }
.manufacture-loss-content { padding: 10px 11px; }
.manufacture-loss-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid #d8e4f3; border-radius: 4px; background: #d8e4f3; }
.manufacture-loss-grid span { min-width: 0; padding: 8px; color: var(--muted); background: white; font-size: 8.5px; }
.manufacture-loss-grid strong { display: block; margin-top: 4px; color: var(--ink); font-size: 10px; }
.manufacture-loss-rule, .manufacture-loss-empty { margin: 8px 0 0; color: #315d98; font-size: 9px; font-weight: 700; }
.manufacture-loss-empty { margin: 0; color: var(--muted); font-weight: 600; }
.manufacture-metal-intake { margin: 0 13px 13px; padding: 11px 12px; border: 1px solid #bad0ee; border-radius: 5px; background: #f5f9ff; }
.manufacture-metal-intake div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.manufacture-metal-intake div strong { font-size: 10.5px; }
.manufacture-metal-intake div span { color: #1769e0; font-size: 10px; font-weight: 800; }
.manufacture-metal-intake p { margin: 7px 0 0; color: #315d98; font-size: 9px; font-weight: 700; }
.manufacture-metal-intake small { display: block; margin-top: 6px; color: var(--muted); font-size: 8.5px; }
.manufacture-metal-intake.locked { border-color: #b9d8c8; background: #f3fbf6; }
.manufacture-metal-intake.locked div span, .manufacture-metal-intake.locked p { color: var(--green); }
.manufacture-metal-intake.workshop-payment { border-color: #b8d3ff; background: #f4f8ff; }
.manufacture-metal-intake.workshop-payment.locked { border-color: #b8d3ff; background: #f4f8ff; }
.manufacture-metal-intake.workshop-payment.locked div span, .manufacture-metal-intake.workshop-payment.locked p { color: #1769e0; }
.order-metal-payment-save-note { padding: 9px 10px; border-radius: 5px; background: #eaf2ff; }
.order-metal-payment-form { display: grid !important; grid-template-columns: minmax(160px, .8fr) minmax(210px, 1fr) auto; align-items: end !important; justify-content: stretch !important; gap: 10px !important; width: 100%; margin-top: 11px; padding-top: 11px; border-top: 1px solid #cfddf1; }
.order-metal-payment-form label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 9px; font-weight: 800; }
.order-metal-payment-form input, .order-metal-payment-form select { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 5px; background: white; padding: 0 9px; color: var(--ink); font: inherit; }
.order-metal-payment-form .historical-metal-toggle { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink); font-size: 10px; }
.order-metal-payment-form .historical-metal-toggle input { width: 16px; height: 16px; flex: none; margin: 0; }
.order-metal-payment-form .historical-metal-fields { grid-column: 1 / -1; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; padding: 10px; border: 1px solid #d8e2ee; border-radius: 6px; background: white; }
.order-metal-payment-form .historical-metal-fields.hidden { display: none !important; }
.order-metal-payment-form .historical-metal-fields small { grid-column: 1 / -1; margin: 0; }
.order-metal-payment-form button { min-height: 34px; white-space: normal; }
.order-metal-payment-history { display: grid !important; align-items: stretch !important; justify-content: stretch !important; gap: 7px !important; width: 100%; margin-top: 11px; padding-top: 10px; border-top: 1px solid #cfddf1; }
.order-metal-payment-history > strong { font-size: 10px; }
.order-metal-payment-row { display: grid !important; align-items: stretch !important; justify-content: stretch !important; gap: 3px !important; width: 100%; padding: 8px 9px; border: 1px solid #d7e2f1; border-radius: 5px; background: white; }
.order-metal-payment-row > div:first-child { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
.order-metal-payment-row > div:first-child span { color: var(--muted); font-weight: 700; }
.order-metal-payment-row > div:first-child strong { color: var(--ink); }
.order-metal-payment-row > span { color: var(--ink) !important; font-size: 9px !important; font-weight: 700 !important; }
.order-metal-payment-row > small { margin: 0; color: #855600; }
.order-metal-payment-row.reversed { opacity: .66; background: #f7f7f7; }
.order-metal-payment-admin-actions { display: grid !important; grid-template-columns: minmax(180px, 1fr) minmax(0, max-content) minmax(0, max-content); gap: 7px !important; margin-top: 5px; }
.order-metal-payment-admin-actions input { min-width: 0; height: 32px; border: 1px solid var(--line); border-radius: 5px; padding: 0 8px; }
.repair-residual-block { display: grid; gap: 9px; margin: 0 13px 12px; padding: 11px; border: 1px solid #d2dde8; border-radius: 5px; background: #fbfcfd; }
.repair-residual-block.posted { border-color: #b6d7c8; background: #f5fbf8; }
.repair-residual-block header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.repair-residual-block header strong { font-size: 11px; }
.repair-residual-block header span { color: var(--muted); font-size: 9px; }
.repair-residual-fields { display: grid; grid-template-columns: repeat(4, minmax(105px, 1fr)); gap: 8px; }
.repair-residual-fields label { min-width: 0; color: var(--muted); font-size: 9px; font-weight: 800; }
.repair-residual-fields input, .repair-residual-fields select, .repair-residual-confirm input { width: 100%; height: 34px; min-width: 0; border: 1px solid var(--line); border-radius: 5px; background: white; padding: 0 9px; color: var(--ink); font: inherit; }
.repair-residual-payout, .repair-residual-note, .repair-residual-clean-basis { grid-column: span 2; }
.repair-residual-clean-basis { display: flex; align-items: center; gap: 8px; min-height: 34px; line-height: 1.25; }
.repair-residual-clean-basis input { width: 16px; height: 16px; flex: 0 0 auto; }
.repair-residual-check { padding: 8px 9px; border: 1px solid #dce5ef; border-radius: 5px; color: #334155; background: white; font-size: 9px; line-height: 1.35; }
.repair-residual-check.warning { border-color: #f0c36a; color: #855600; background: #fffaf0; }
.repair-residual-warning { padding: 8px 9px; border: 1px solid #f0c36a; border-radius: 5px; color: #855600; background: #fffaf0; font-size: 9px; line-height: 1.35; }
.repair-residual-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid #d9e6de; border-radius: 4px; background: #d9e6de; }
.repair-residual-summary div { min-width: 0; padding: 8px; background: white; }
.repair-residual-summary span { display: block; color: var(--muted); font-size: 8.5px; }
.repair-residual-summary strong { display: block; margin-top: 3px; color: var(--ink); font-size: 10px; line-height: 1.25; }
.repair-residual-block p { margin: 0; color: #344054; font-size: 9px; line-height: 1.4; }
.repair-residual-above-norm { color: #9f1239; }
.repair-residual-custody-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; color: #344054; font-size: 9px; line-height: 1.35; }
.repair-residual-confirm { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 7px; align-items: center; }
.order-metal-flow-section { min-width: 0; }
.order-metal-flow-content { display: grid; gap: 14px; }
.order-metal-flow-empty { display: grid; gap: 5px; padding: 20px; border: 1px dashed var(--border); border-radius: 6px; color: var(--muted); font-size: 10px; text-align: center; }
.order-metal-flow-empty strong { color: var(--ink); font-size: 12px; }
.order-metal-lot { overflow: hidden; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.order-metal-lot > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: #f6f8fb; }
.order-metal-lot > header div { display: grid; gap: 3px; }
.order-metal-lot > header div span { color: var(--muted); font-size: 8.5px; font-weight: 700; text-transform: uppercase; }
.order-metal-lot > header div strong { font-size: 11px; }
.order-metal-status { padding: 6px 9px; border-radius: 999px; color: #1769e0; background: #eaf3ff; font-size: 9px; font-weight: 800; text-align: center; }
.manufacture-issue-review { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 10px; margin: 10px 0; padding: 10px; border: 1px solid #cfd8e3; border-radius: 6px; background: #f7fafc; font-size: 10px; }
.manufacture-issue-review strong { grid-column: 1 / -1; font-size: 11px; }
.manufacture-issue-review span { color: #334155; }
.manufacture-issue-review small { grid-column: 1 / -1; color: #8a5b00; }
.manufacture-issue-review.warning { border-color: #f0bd55; background: #fff8e8; }
.manufacture-issue-review.muted { color: var(--muted); background: #f4f6f8; }
.order-metal-current { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.order-metal-current div { min-width: 0; padding: 12px 14px; border-right: 1px solid var(--border); }
.order-metal-current div:last-child { border-right: 0; }
.order-metal-current span, .order-metal-current strong { display: block; }
.order-metal-current span { margin-bottom: 5px; color: var(--muted); font-size: 8.5px; }
.order-metal-current strong { font-size: 11px; overflow-wrap: anywhere; }
.order-metal-warning, .order-metal-workshop-sources { display: grid; gap: 4px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 9px; line-height: 1.35; }
.order-metal-warning { color: #744500; background: #fff8e8; }
.order-metal-workshop-sources { color: #1f3b57; background: #f1f8fb; }
.order-metal-warning strong, .order-metal-workshop-sources strong { color: var(--ink); font-size: 10px; }
.order-metal-actions { display: grid; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: #fffaf2; }
.order-metal-action-form { display: grid; grid-template-columns: minmax(165px, .7fr) minmax(240px, 1fr) auto; align-items: end; gap: 9px; }
.order-metal-action-form label { display: grid; gap: 4px; color: #344154; font-size: 9px; font-weight: 700; }
.order-metal-action-form input { height: 34px; font-size: 10px; }
.order-metal-action-form .button { width: max-content; min-height: 34px; white-space: nowrap; }
.order-metal-no-actions { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 9px; }
.order-metal-events { margin: 0; padding: 12px 14px 13px; list-style: none; }
.order-metal-event { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 8px; padding: 0 0 13px; }
.order-metal-event:last-child { padding-bottom: 0; }
.order-metal-event::before { content: ""; position: absolute; top: 10px; bottom: -1px; left: 4px; width: 1px; background: #cfd9e6; }
.order-metal-event:last-child::before { display: none; }
.order-metal-event-dot { position: relative; z-index: 1; width: 9px; height: 9px; margin-top: 2px; border: 2px solid #fff; border-radius: 50%; background: #1769e0; box-shadow: 0 0 0 1px #1769e0; }
.order-metal-event div { display: grid; gap: 2px; }
.order-metal-event strong { font-size: 10px; }
.order-metal-event span, .order-metal-event small { color: var(--muted); font-size: 8.5px; }
.order-metal-event small { margin-top: 2px; color: #344154; }
.item-works { padding: 0 13px 13px; }
.item-works-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 0 7px; }
.item-works-heading strong { font-size: 10px; }
.item-works .works-table { border-radius: 4px; }
.text-button { border: 0; color: var(--blue); background: transparent; font-size: 11px; font-weight: 700; }
.works-table { border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.work-row { display: grid; grid-template-columns: 34px 1fr 1.7fr 110px 34px; border-top: 1px solid var(--border); }
.work-row.repair-work-row { grid-template-columns: 34px minmax(190px, 1.45fr) minmax(130px, .85fr) minmax(118px, .7fr) 70px 120px 105px 34px; }
.work-row.manufacture-work-row { grid-template-columns: 34px minmax(128px, .9fr) minmax(170px, 1.3fr) minmax(130px, .8fr) 70px minmax(145px, .9fr) 116px 34px; }
.work-row.manufacture-work-row .work-description { grid-column: 2 / -1; border-top: 1px solid var(--border); }
.work-row:first-child { border-top: 0; }
.work-row > * { min-width: 0; border: 0; border-right: 1px solid var(--border); border-radius: 0; padding: 8px; background: white; font-size: 10.5px; }
.work-row > *:last-child { border-right: 0; }
.work-number { display: grid; place-items: center; color: var(--muted); }
.work-remove { color: #7b1f1f; }
.work-price-box { display: grid; gap: 2px; padding: 4px 7px !important; }
.manufacture-work-row .work-price-box { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.manufacture-work-row .work-price-box span { grid-column: 1 / -1; }
.work-price-box input { height: 25px; padding: 3px 5px; border: 1px solid #d7dde4; border-radius: 3px; font-weight: 700; }
.work-price-box span { color: var(--muted); font-size: 8px; white-space: nowrap; }
.work-quantity { text-align: center; font-weight: 700; }
.work-line-total { display: flex; align-items: center; justify-content: flex-end; font-size: 10px !important; white-space: nowrap; }
.work-row select:disabled, .work-row input:disabled { color: #89929d; background: #f5f7f9; }
.repair-work-columns, .manufacture-work-columns { display: grid; grid-template-columns: 34px minmax(190px, 1.45fr) minmax(130px, .85fr) minmax(118px, .7fr) 70px 120px 105px 34px; color: var(--muted); background: #f3f5f7; border: 1px solid var(--border); border-bottom: 0; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.manufacture-work-columns { grid-template-columns: 34px minmax(128px, .9fr) minmax(170px, 1.3fr) minmax(130px, .8fr) 70px minmax(145px, .9fr) 116px 34px; }
.repair-work-columns span, .manufacture-work-columns span { padding: 5px 8px; border-right: 1px solid var(--border); }
.repair-work-columns span:last-child { border-right: 0; }
.manufacture-work-columns span:last-child { border-right: 0; }
.work-catalog.needs-selection { color: var(--blue); background: #f1f6ff; font-weight: 700; }
.work-catalog-cell { display: grid; gap: 5px; padding: 4px !important; }
.work-catalog-cell select, .work-catalog-cell input { min-height: 29px; padding: 4px 6px; border: 1px solid #d7dde4; border-radius: 3px; font-size: 10px; }
.work-custom-name { color: #17202a; background: #fffdf5 !important; font-weight: 700; }
.money-summary { min-height: 48px; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; }
.money-summary span { color: var(--muted); font-size: 10px; }
.money-summary strong { font-size: 16px; margin-top: 4px; }
.money-summary.accent strong { color: var(--green); }
.manufacture-estimate-panel { display: grid; gap: 8px; margin: 10px 0 0; padding: 10px; border: 1px solid #d7dde4; border-radius: 5px; background: #fbfcfd; }
.manufacture-estimate-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.manufacture-estimate-status > div { display: grid; gap: 3px; min-width: 0; }
.manufacture-estimate-status strong { font-size: 11px; }
.manufacture-estimate-status span, .manufacture-estimate-panel small { color: var(--muted); font-size: 9px; }
.manufacture-estimate-status.changed strong { color: #9a5c00; }
.manufacture-estimate-panel details { display: grid; gap: 6px; color: #344154; font-size: 10px; }
.manufacture-estimate-panel details div { display: grid; gap: 2px; padding-top: 6px; border-top: 1px solid #e4e8ee; }
.history-note { color: var(--muted); font-size: 10px; }
.order-list-item.deleted { border-color: #d9b7b7; background: #fff8f8; }
.order-list-item.deleted.selected { border-color: #a84b4b; box-shadow: inset 3px 0 #a84b4b; }
.order-type-mark.deleted { color: #8b2f2f; background: #fde7e7; }
.deleted-reason span { display: block; max-width: 100%; overflow: hidden; color: #7a3540; text-overflow: ellipsis; white-space: nowrap; }
.history-list { border-left: 2px solid #dce3eb; margin: 14px 0 0 8px; padding-left: 20px; }
.history-entry { position: relative; display: grid; grid-template-columns: 145px 1fr; gap: 16px; padding: 0 0 20px; }
.history-entry::before { content: ""; position: absolute; left: -26px; top: 3px; width: 10px; height: 10px; border: 2px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px #aeb8c4; }
.history-time { color: var(--muted); font-size: 10px; }
.history-content strong { display: block; font-size: 12px; }
.history-content span { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.history-changes { margin: 8px 0 0; padding-left: 17px; color: var(--ink); font-size: 11px; line-height: 1.45; }
.history-changes li + li { margin-top: 4px; }
.history-content .history-details { color: var(--ink); }
.history-empty { color: var(--muted); font-size: 12px; padding: 18px 0; }
.history-sms { display: grid; gap: 4px; margin: 0 0 18px -8px; padding: 12px 14px; border: 1px solid #cbdcf7; border-radius: 8px; background: #f4f8ff; }
.history-sms span { color: var(--muted); font-size: 12px; }
.history-sms-delivered { border-color: #b7dfcc; background: #f1fbf6; }
.history-sms-failed, .history-sms-uncertain { border-color: #ecc6c3; background: #fff6f5; }
.history-sms-suppressed { border-color: #dde2e8; background: #f7f8fa; }
.form-actions { flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); background: white; }
.form-actions span { margin-right: auto; color: var(--muted); font-size: 10px; }

.schedule-workspace, .price-workspace, .settings-workspace, .analytics-workspace, .payroll-workspace, .metal-workspace, .communications-workspace { grid-column: 2 / -1; min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 18px 20px 12px; background: white; }
.settings-workspace { overflow: auto; }
.price-workspace { overflow-y: auto; overflow-x: hidden; }
.schedule-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.schedule-header h1 { margin: 4px 0 0; font-size: 24px; }
.schedule-header-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.permission-chip { padding: 7px 9px; border: 1px solid #dce2e8; border-radius: 4px; color: var(--muted); background: #f7f9fb; font-size: 10px; font-weight: 700; }

.price-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.price-header h1 { margin: 4px 0 0; font-size: 24px; }
.price-header-actions { display: flex; align-items: center; gap: 14px; }
.price-version { display: grid; gap: 3px; text-align: right; }
.price-version span { color: var(--muted); font-size: 9px; }
.price-version strong { font-size: 11px; }
.price-rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 14px 0; overflow: hidden; border: 1px solid #dce2e8; border-radius: 5px; background: #dce2e8; }
.price-rules div { min-width: 0; padding: 10px 12px; background: #f7f9fb; }
.price-rules strong, .price-rules span { display: block; }
.price-rules strong { font-size: 10px; }
.price-rules span { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.price-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 10px; }
.price-toolbar input { width: min(440px, 48%); height: 38px; font-size: 11px; }
.price-tabs { display: flex; overflow: hidden; border: 1px solid #cfd6df; border-radius: 5px; }
.price-tabs button { min-height: 36px; padding: 0 14px; border: 0; border-left: 1px solid #cfd6df; color: #4e5967; background: white; font-size: 10px; font-weight: 700; }
.price-tabs button:first-child { border-left: 0; }
.price-tabs button.active { color: var(--blue); background: var(--blue-soft); }
.brand-price-warning { margin-bottom: 10px; padding: 9px 11px; border: 1px solid #edc78e; border-radius: 5px; color: #865000; background: #fff7e8; font-size: 10px; font-weight: 700; }
.price-proposals { margin: 0 0 12px; border: 1px solid #cbd4de; border-radius: 6px; background: #fff; }
.price-proposals-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 13px; border-bottom: 1px solid #dde3e9; background: #f5f7f9; }
.price-proposals-header div { display: grid; gap: 2px; }
.price-proposals-header strong { font-size: 12px; }
.price-proposals-header span { color: var(--muted); font-size: 9px; }
.price-proposal-count { display: grid; place-items: center; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 4px; color: #fff !important; background: #1f6fe5; font-weight: 800; }
.price-proposal-list { display: grid; }
.price-proposal { display: grid; grid-template-columns: minmax(240px, 1.15fr) minmax(280px, 1.5fr); gap: 16px; padding: 12px 13px; border-bottom: 1px solid #e5e9ee; }
.price-proposal:last-child { border-bottom: 0; }
.price-proposal-summary { display: grid; align-content: start; gap: 4px; }
.price-proposal-summary strong { font-size: 11px; line-height: 1.35; }
.price-proposal-summary span, .price-proposal-summary small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.price-proposal-match { color: #126b51 !important; font-weight: 700; }
.price-proposal-actions { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto auto; align-items: center; gap: 7px; }
.price-proposal-actions select { min-width: 0; height: 34px; padding: 5px 8px; border-radius: 4px; font-size: 9px; }
.price-proposal-actions .button { min-height: 34px; padding: 0 10px; white-space: nowrap; }
.price-proposal-reject { color: #a32828; }
.price-proposal-empty { padding: 18px 13px; color: var(--muted); font-size: 10px; text-align: center; }
.price-edit-actions { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; padding: 8px 10px; border: 1px solid #b9cce6; border-radius: 5px; background: #f1f6fd; }
.price-edit-actions span { margin-right: auto; color: #526071; font-size: 9px; }
.price-edit-actions select { width: 245px; height: 34px; padding: 5px 7px; font-size: 9.5px; }
.price-effective-field { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 9px; color: #526071; }
.price-effective-field input { width: 128px; height: 34px; padding: 5px 7px; font-size: 9.5px; }
.price-table-wrap { flex: 0 0 auto; min-height: 0; max-width: 100%; overflow: auto; border: 1px solid var(--border); border-radius: 5px; }
.price-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.price-table th { position: sticky; top: 0; z-index: 1; padding: 9px 10px; border-bottom: 1px solid var(--border); color: #475467; background: #f1f4f7; text-align: left; }
.price-table td { padding: 8px 10px; border-bottom: 1px solid #e5e9ee; vertical-align: top; }
.price-table tr:last-child td { border-bottom: 0; }
.price-table th:first-child, .price-table td:first-child { width: 44px; text-align: center; }
.price-table th:nth-last-child(-n+3), .price-table td:nth-last-child(-n+3) { width: 120px; white-space: nowrap; }
.price-table td strong { display: block; line-height: 1.35; }
.price-table td small { display: block; max-width: 500px; margin-top: 4px; color: var(--muted); line-height: 1.35; }
.price-edit-row td { vertical-align: middle; }
.price-edit-row td:nth-child(3), .price-edit-row td:nth-child(4), .price-edit-row td:nth-child(5) { width: 120px; }
.price-edit-row td:last-child { width: 82px; text-align: center; }
.price-edit-main { display: grid; grid-template-columns: minmax(160px, .7fr) minmax(280px, 1.7fr); gap: 6px; }
.price-edit-main input, .price-edit-main select, .price-number-input { height: 31px; padding: 5px 7px; border-radius: 4px; font-size: 9.5px; }
.price-edit-main input[data-price-field="note"] { grid-column: 1 / -1; }
.price-delete-row { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 62px; height: 28px; padding: 0 9px; border: 1px solid #e0bcbc; border-radius: 4px; color: #a32828; background: #fff7f7; font-size: 10px; line-height: 1; white-space: nowrap; }
.price-delete-row:hover { background: #ffeaea; }
.price-table .price-category-row th { position: static; padding: 8px 12px; border-top: 1px solid #cbd3dc; border-bottom: 1px solid #cbd3dc; color: #24303d; background: #e7ebef; font-size: 10.5px; text-align: left; }
.price-table .price-category-row:first-child th { border-top: 0; }
.price-edit-category-row th div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price-edit-category-row button { min-height: 25px; padding: 0 9px; border: 1px solid #b5c0cc; border-radius: 4px; color: #344256; background: white; font-size: 8.5px; font-weight: 700; }
.price-unavailable { color: #a1a8b0; }
.price-empty { padding: 32px !important; color: var(--muted); text-align: center !important; }

.settings-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.settings-header h1 { margin: 4px 0 0; font-size: 24px; }
.settings-tabs { flex: 0 0 auto; display: flex; gap: 24px; border-bottom: 1px solid var(--border); }
.settings-tabs button { min-height: 44px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; color: #5d6877; background: transparent; font-size: 11px; font-weight: 700; }
.settings-tabs button.active { color: var(--blue); border-color: var(--blue); }
.settings-panel { flex: 0 0 auto; min-width: 0; }
.settings-section { padding: 18px 0; border-bottom: 1px solid #e1e5ea; }
.settings-section h2 { margin: 0 0 14px; font-size: 14px; }
.settings-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.access-section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 14px; }
.access-section-heading h2 { margin-bottom: 5px; }
.access-section-heading .settings-footnote { margin: 0; }
.access-role-legend { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.access-role-legend span { padding: 6px 8px; border: 1px solid #d9e0e7; border-radius: 4px; color: #5d6877; background: #f7f9fb; font-size: 9px; }
.access-role-legend strong { color: var(--ink); }
.user-admin-panel { margin-bottom: 14px; padding: 12px; border: 1px solid #dce2e8; border-radius: 5px; background: #f7f9fb; }
.add-form-panel { margin: 0 0 14px; padding: 0; border: 0; background: transparent; }
.add-form-panel summary { display: inline-flex; width: auto; cursor: pointer; list-style: none; }
.add-form-panel summary::-webkit-details-marker { display: none; }
.add-form-panel[open] summary { margin-bottom: 10px; }
.create-user-form { display: grid; grid-template-columns: 1.1fr .8fr .7fr .8fr .9fr auto; gap: 10px; align-items: end; }
.create-user-form input, .create-user-form select { height: 36px; font-size: 11px; }
.create-user-form button { white-space: nowrap; }
.create-user-form label { align-self: end; }
.create-user-form .test-account-field { align-self: stretch; justify-content: center; padding: 7px 9px; border: 1px solid #e8bd68; border-radius: 5px; background: #fff8e6; }
.test-account-field .inline-check { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; }
.test-account-field .inline-check input { width: 16px; height: 16px; }
.field-hint { display: block; min-height: 18px; margin-top: 4px; color: var(--muted); font-size: 8px; font-weight: 500; line-height: 1.25; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; max-width: 1050px; }
.settings-grid .settings-wide { grid-column: span 2; }
.settings-grid input { height: 38px; font-size: 11px; }
.ai-provider-settings { max-width: 900px; }
.ai-provider-status { display: grid; gap: 5px; margin: 10px 0 14px; padding: 12px; border: 1px solid #d6e2df; border-radius: 6px; background: #f7fbfa; }
.ai-provider-status strong, .ai-provider-status small { display: block; overflow-wrap: anywhere; }
.ai-provider-status small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.ai-provider-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ai-provider-form label { display: grid; gap: 5px; min-width: 0; color: #334155; font-size: 11px; font-weight: 700; }
.ai-provider-form input, .ai-provider-form select { width: 100%; min-width: 0; height: 38px; border: 1px solid #cfd8e3; border-radius: 5px; padding: 7px 9px; font: inherit; background: #fff; }
.ai-provider-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.ai-provider-form .settings-footnote { grid-column: 1 / -1; min-height: 18px; margin: 0; overflow-wrap: anywhere; }
.security-settings { max-width: 780px; }
.security-status { display: grid; gap: 6px; margin: 12px 0 16px; padding: 12px; border: 1px solid var(--border); border-radius: 5px; background: #f8fafc; font-size: 12px; }
.security-status strong { font-size: 14px; }
.security-status small { color: var(--muted); line-height: 1.45; }
.security-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; align-items: end; gap: 12px; }
.security-form .field-error { grid-column: 1 / -1; }
.location-admin-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; max-width: 1150px; }
.location-admin-heading h2 { margin-bottom: 10px; }
.location-admin-heading span { color: var(--muted); font-size: 9px; }
.create-location-form { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(360px, 1.6fr) auto; gap: 10px; align-items: end; max-width: 1150px; margin-bottom: 14px; padding: 12px; border: 1px solid #dce2e8; border-radius: 5px; background: #f7f9fb; }
.create-location-form input { height: 36px; font-size: 11px; }
.create-location-form button { white-space: nowrap; }
.owner-config-button { align-self: flex-start; margin: 4px 0 10px; }
.communications-channel-state { gap: 10px; flex-wrap: wrap; }
.sms-placeholder-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.sms-template-preview { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--surface-muted); }
.sms-template-preview p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.location-admin-list { display: grid; max-width: 1150px; gap: 12px; }
.location-admin-row { padding: 14px; border: 1px solid var(--border); border-radius: 5px; background: white; }
.location-admin-row.inactive { background: #f6f7f8; }
.location-admin-row input { height: 36px; font-size: 11px; }
.location-admin-primary { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(340px, 1.45fr) auto; gap: 10px; align-items: end; }
.location-business-grid { display: grid; grid-template-columns: minmax(280px, 1.5fr) minmax(130px, .55fr) minmax(180px, .8fr) minmax(210px, 1fr); gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #e4e8ed; }
.location-admin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; align-items: center; }
.location-admin-actions .button { min-height: 36px; padding: 0 12px; white-space: nowrap; }
.location-status { display: inline-block; margin-left: 7px; padding: 2px 5px; border-radius: 3px; color: #087a50; background: #e8f7f0; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.location-status.inactive { color: #6c7480; background: #e5e8ec; }
.workstation-status { display: inline-block; margin-left: 5px; padding: 2px 5px; border-radius: 3px; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.workstation-status.current { color: #1457b8; background: #eaf2ff; }
.workstation-status.configured { color: #087a50; background: #e8f7f0; }
.workstation-status.missing { color: #8a5a00; background: #fff3d6; }
.location-hours { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e4e8ed; }
.location-hours-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.location-hours-heading h3 { margin: 0; font-size: 12px; }
.location-hours-heading span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.location-hours-heading .button { min-height: 34px; padding: 0 12px; white-space: nowrap; }
.location-hours-grid { display: grid; grid-template-columns: repeat(7, minmax(118px, 1fr)); gap: 8px; }
.location-hours-day { min-width: 0; padding: 9px; border: 1px solid #dfe5eb; border-radius: 4px; background: #f8fafc; }
.location-hours-day-heading { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 8px; }
.location-day-off { display: flex; align-items: center; gap: 4px; color: #5f6a79; font-size: 8px; font-weight: 600; }
.location-day-off input { width: 14px; height: 14px; margin: 0; }
.location-hours-times { display: grid; grid-template-columns: 1fr; gap: 6px; }
.location-hours-times label { color: var(--muted); font-size: 8px; }
.location-hours-times input { height: 32px; margin-top: 3px; padding: 0 6px; font-size: 10px; }
.settings-rules { display: flex; align-items: end; gap: 18px; }
.settings-rules label { width: 300px; }
.settings-rules select { height: 38px; margin-top: 5px; }
.settings-rules p { max-width: 650px; margin: 0 0 7px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(300px, 1fr)); gap: 14px; max-width: 1180px; }
.rules-grid.single { grid-template-columns: minmax(280px, 560px); }
.rule-block { padding: 14px; border: 1px solid var(--border); border-radius: 5px; background: #f8fafc; }
.rule-block-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.rule-block-heading > div > strong, .rule-block.compact > strong { display: block; margin: 0; font-size: 13px; }
.rule-block-heading > div > span, .rule-block.compact > span { display: block; margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.rule-block.compact { display: grid; gap: 10px; align-content: start; }
.rule-block label { display: grid; gap: 5px; color: #344154; font-size: 10px; font-weight: 700; }
.rule-block select, .rule-block input { height: 36px; font-size: 11px; }
.rule-options-list { display: flex; flex-wrap: wrap; gap: 7px; min-height: 31px; margin: 11px 0; }
.rule-option { display: inline-flex; align-items: center; gap: 5px; height: 29px; padding: 0 5px 0 10px; border: 1px solid #cfd8e3; border-radius: 4px; background: white; font-size: 10px; }
.rule-option button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 3px; color: #a52d2d; background: transparent; font-size: 16px; line-height: 1; cursor: pointer; }
.rule-option button:hover:not(:disabled) { background: #fff0f0; }
.rule-option button:disabled { color: #aeb6c0; cursor: default; }
.rule-option-add { display: grid; grid-template-columns: minmax(110px, 1fr) auto; gap: 8px; align-items: end; }
.rule-option-add .button { min-height: 36px; white-space: nowrap; }
.permission-matrix { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); min-height: 520px; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; background: white; }
.employee-directory { min-width: 0; border-right: 1px solid var(--border); background: #f7f9fb; }
.employee-directory-heading { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 12px; border-bottom: 1px solid var(--border); }
.employee-directory-heading strong { font-size: 11px; }
.employee-directory-heading span { color: var(--muted); font-size: 9px; }
.employee-directory-list { display: grid; max-height: 650px; overflow-y: auto; }
.employee-directory-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) 8px; gap: 9px; align-items: center; min-height: 56px; padding: 8px 12px; border: 0; border-bottom: 1px solid #e5e9ee; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.employee-directory-item:hover { background: #eef3f8; }
.employee-directory-item.active { background: #e8f1ff; box-shadow: inset 3px 0 var(--blue); }
.employee-directory-item.inactive { opacity: .62; }
.employee-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #1f4f46; background: #dff1eb; font-size: 12px; font-weight: 800; }
.employee-avatar.large { width: 42px; height: 42px; font-size: 16px; }
.employee-directory-copy { min-width: 0; }
.employee-directory-copy strong, .employee-directory-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.employee-directory-copy strong { font-size: 10px; }
.employee-directory-copy small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.employee-state-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.employee-state-dot.inactive { background: #9da6b1; }
.employee-editor-wrap { min-width: 0; }
.employee-editor { min-width: 0; }
.employee-editor.attention { outline: 2px solid #e39b28; outline-offset: -2px; background: #fffaf1; }
.employee-editor-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 70px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.employee-title { display: flex; gap: 11px; align-items: center; min-width: 0; }
.employee-title h2 { margin: 0 0 3px; font-size: 15px; }
.employee-title span { color: var(--muted); font-size: 9px; }
.employee-status { padding: 4px 7px; border-radius: 3px; color: #0b7652; background: #e4f5ee; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.employee-status.inactive { color: #68717d; background: #e9edf1; }
.employee-facts { display: grid; grid-template-columns: minmax(140px, .55fr) minmax(260px, 1fr) minmax(150px, .6fr); gap: 1px; border-bottom: 1px solid var(--border); background: var(--border); }
.employee-fact { min-width: 0; padding: 12px 16px; background: white; }
.employee-fact span, .employee-fact strong { display: block; }
.employee-fact span { color: var(--muted); font-size: 8px; }
.employee-fact strong { margin-top: 4px; overflow-wrap: anywhere; font-size: 10px; }
.employee-settings-row { display: grid; grid-template-columns: repeat(2, minmax(240px, 1fr)); gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.employee-role-profiles { margin: 12px 0; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; }
.employee-role-profiles summary { cursor: pointer; font-weight: 700; }
.password-reset-actions a.button { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.employee-role-profile-form { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 12px; margin: 12px 0; }
.employee-role-profile-form label { display: grid; gap: 5px; font-size: 9px; font-weight: 700; }
.employee-role-profile-permissions { grid-column: 1 / -1; }
.role-profile-checks { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)); gap: 8px; margin-top: 8px; }
.role-profile-checks label { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.employee-role-profile-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.employee-role-profile-row strong, .employee-role-profile-row small { display: block; }
.employee-role-profile-row small { color: var(--muted); }
.employee-role-change { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); align-items: end; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.employee-role-impact { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 9px; }
.employee-role-change .user-role-save { justify-self: start; }
.employee-setting-field > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 700; }
.employee-permissions-heading { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 7px; }
.employee-permissions-heading h2 { margin: 0 0 3px; font-size: 13px; }
.employee-permissions-heading span { color: var(--muted); font-size: 8px; }
.employee-permission-groups { display: grid; grid-template-columns: repeat(2, minmax(240px, 1fr)); gap: 0 20px; padding: 0 16px 14px; }
.employee-permission-group { padding: 10px 0; border-top: 1px solid #e5e9ee; }
.employee-permission-group h3 { margin: 0 0 5px; color: #566273; font-size: 9px; text-transform: uppercase; }
.employee-permission-list { display: grid; }
.permission-toggle { position: relative; display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 34px; color: #263140; font-size: 9px; font-weight: 600; cursor: pointer; }
.permission-toggle input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.permission-toggle i { position: relative; flex: 0 0 32px; width: 32px; height: 18px; border-radius: 9px; background: #cfd6df; transition: .15s ease; }
.permission-toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: white; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: .15s ease; }
.permission-toggle input:checked + i { background: var(--blue); }
.permission-toggle input:checked + i::after { transform: translateX(14px); }
.permission-toggle input:focus-visible + i { outline: 2px solid #74a9f7; outline-offset: 2px; }
.permission-toggle input:disabled + i { opacity: .55; }
.permission-group-note { margin: 6px 0 0; color: var(--muted); font-size: 8.5px; line-height: 1.35; }
.metal-policy-editor { grid-column: 1 / -1; }
.metal-policy-editor > .permission-group-note { margin: 5px 0 12px; }
.metal-policy-grid > div { padding: 10px; border: 1px solid var(--border); border-radius: 5px; background: #f8fafc; align-content: start; }
.metal-policy-grid { display: grid; grid-template-columns: repeat(2, minmax(240px, 1fr)); gap: 12px 18px; }
.metal-policy-grid > div, .metal-policy-checks { display: grid; gap: 8px; min-width: 0; }
.metal-policy-grid strong, .metal-policy-checks strong { color: #2f3b4a; font-size: 11px; }
.metal-policy-scope { display: grid; gap: 7px; min-width: 0; align-content: start; }
.segmented-control { display: grid; grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); gap: 4px; }
.segmented-control label { position: relative; min-width: 0; }
.segmented-control input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.segmented-control span { min-height: 28px; display: grid; place-items: center; padding: 4px 7px; border: 1px solid #cfd6df; border-radius: 4px; color: #4b5766; background: #fff; font-size: 8.5px; font-weight: 800; text-align: center; line-height: 1.15; }
.segmented-control input:checked + span { border-color: var(--blue); color: #124f9f; background: #eaf2ff; }
.segmented-control input:focus-visible + span { outline: 2px solid #74a9f7; outline-offset: 2px; }
.segmented-control input:disabled + span { opacity: .55; }
.metal-policy-picks, .metal-policy-checks { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; }
.metal-policy-picks .inline-check, .metal-policy-checks .inline-check { max-width: 260px; align-items: flex-start; line-height: 1.25; white-space: normal; }
.metal-policy-editor .inline-check { font-size: 10px; }
.metal-policy-editor .segmented-control span { min-height: 32px; font-size: 9.5px; }
.metal-policy-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 12px; gap: 8px 14px; }
.metal-policy-checks > strong { grid-column: 1 / -1; }
.metal-policy-picks small { color: var(--muted); font-size: 8.5px; }
.metal-policy-editor [data-save-metal-policy] { justify-self: start; margin-top: 8px; }
.employee-permissions-readonly { display: grid; gap: 4px; margin: 14px 16px; padding: 12px; border: 1px solid #dbe2ea; border-radius: 4px; background: #f7f9fb; }
.employee-permissions-readonly strong { font-size: 10px; }
.employee-permissions-readonly span { color: var(--muted); font-size: 9px; }
.employee-editor-actions { display: flex; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--border); }
.employee-editor-empty { display: grid; place-items: center; min-height: 300px; color: var(--muted); font-size: 11px; }

.client-directory-workspace { grid-column: 2 / -1; min-width: 0; min-height: 0; overflow: auto; background: #f4f6f8; }
.client-directory-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); background: white; }
.client-directory-header h1 { margin: 0 0 4px; font-size: 22px; }
.client-directory-header span { color: var(--muted); font-size: 10px; }
.client-directory-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap: 10px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--border); background: white; }
.client-directory-archive-toggle { display: inline-flex; gap: 7px; align-items: center; color: #263140; font-size: 11px; font-weight: 700; white-space: nowrap; }
.client-directory-archive-toggle input[type="checkbox"] { width: 16px; height: 16px; min-width: 16px; flex: 0 0 16px; margin: 0; }
.client-directory-toolbar .client-directory-archive-toggle { justify-content: flex-start; }
.client-directory-layout { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); gap: 14px; padding: 14px 22px 22px; }
.client-directory-list-panel, .client-directory-card { min-width: 0; border: 1px solid var(--border); border-radius: 5px; background: white; }
.client-directory-list-panel { overflow: hidden; }
.client-directory-count { min-height: 40px; padding: 12px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 9px; font-weight: 700; }
.client-directory-list { display: grid; max-height: 610px; overflow-y: auto; }
.client-directory-item { display: grid; gap: 3px; padding: 12px; border: 0; border-bottom: 1px solid #e5e9ee; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.client-directory-item:hover { background: #eef3f8; }
.client-directory-item.active { background: #e8f1ff; box-shadow: inset 3px 0 var(--blue); }
.client-directory-item strong, .client-directory-item span, .client-directory-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-directory-item strong { font-size: 14px; }
.client-directory-item span { font-size: 12px; }
.client-directory-item small { color: var(--muted); font-size: 11px; }
.client-directory-pages { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.client-directory-card { padding: 16px; }
.client-card-back { display: none; width: auto; height: auto; min-height: 34px; max-width: 100%; padding: 7px 10px; margin-bottom: 10px; font-size: 13px; white-space: nowrap; }
.client-card-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.client-card-header h2 { margin: 0; overflow-wrap: anywhere; font-size: 18px; }
.client-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 0; }
.client-contact-edit-form { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 12px; margin: 12px 0; }
.client-contact-edit-form label { min-width: 0; font-size: 11px; font-weight: 700; }
.client-contact-edit-form input { margin-top: 6px; }
.client-contact-edit-form label:nth-child(3), .client-contact-edit-form .field-error, .client-contact-actions { grid-column: 1 / -1; }
.client-contact-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.client-card-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; margin: 12px 0; background: var(--border); border: 1px solid var(--border); }
.client-card-facts div, .client-directory-metrics div { min-width: 0; padding: 11px 12px; background: white; }
.client-card-facts span, .client-directory-metrics span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.client-card-facts strong, .client-directory-metrics strong { display: block; margin-top: 4px; overflow-wrap: anywhere; font-size: 14px; }
.client-directory-analytics h2 { margin: 4px 0 10px; font-size: 13px; }
.client-directory-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: 5px; background: var(--border); }
.client-directory-note { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.client-directory-note.attention { color: #8b5b08; }
.client-directory-history { margin-top: 16px; }
.client-directory-orders-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 5px; }
.client-directory-orders { width: 100%; min-width: 720px; border-collapse: collapse; background: white; font-size: 12px; }
.client-directory-orders th, .client-directory-orders td { padding: 9px 10px; border-bottom: 1px solid #e5e9ee; text-align: left; vertical-align: middle; white-space: nowrap; }
.client-directory-orders th { color: var(--muted); background: #f7f9fb; font-size: 10px; text-transform: uppercase; }
.user-restore-controls { display: grid; grid-template-columns: minmax(210px, 1fr) auto; gap: 7px; align-items: center; margin-top: 8px; }
.user-restore-controls input { height: 34px; padding: 6px 42px 6px 8px; font-size: 10px; }
.user-restore-controls .button { min-height: 34px; padding: 0 10px; white-space: nowrap; }
.employee-editor-actions { gap: 8px; flex-wrap: wrap; }
.receipt-prefix-editor { display: grid; grid-template-columns: minmax(90px, 1fr) auto; gap: 6px; align-items: center; }
.receipt-prefix-editor input { height: 34px; padding: 5px 7px; font-size: 10px; }
.receipt-prefix-editor button { min-height: 34px; white-space: nowrap; }
.user-location-editor { display: grid; grid-template-columns: minmax(110px, 1fr) auto; gap: 6px; align-items: center; margin-top: 7px; }
.user-location-editor select { height: 34px; padding: 4px 6px; font-size: 9px; }
.user-location-editor button { min-height: 34px; white-space: nowrap; }
.muted-field { opacity: .55; }
.settings-footnote { color: var(--muted); font-size: 10px; }
.expense-type-form { display: grid; grid-template-columns: minmax(130px, .55fr) minmax(220px, 1.2fr) 110px minmax(170px, .8fr) minmax(150px, .75fr) auto; gap: 10px; align-items: end; max-width: 1150px; margin-bottom: 14px; padding: 12px; border: 1px solid #dce2e8; border-radius: 5px; background: #f7f9fb; }
.expense-type-form input { height: 36px; font-size: 11px; }
.expense-type-form button { white-space: nowrap; }
.expense-types-list { display: grid; gap: 10px; max-width: 1150px; }
.expense-type-row { display: grid; grid-template-columns: minmax(160px, .9fr) minmax(220px, 1.2fr) 90px minmax(160px, .8fr) minmax(145px, .7fr) auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 5px; background: white; }
.expense-type-row.inactive { background: #f6f7f8; }
.expense-type-row input { height: 34px; font-size: 10px; }
.expense-type-key strong, .expense-type-key span { display: block; }
.expense-type-key strong { font-size: 11px; }
.expense-type-key span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.expense-type-actions { display: flex; gap: 7px; justify-content: flex-end; }
.expense-type-actions .button { white-space: nowrap; }

@media (max-width: 980px) {
  .rules-grid { grid-template-columns: 1fr; }
  .expense-type-form, .expense-type-row { grid-template-columns: 1fr 1fr; }
  .expense-type-actions { justify-content: flex-start; }
}

.analytics-workspace, .payroll-workspace, .metal-workspace, .communications-workspace { overflow: auto; }
.analytics-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.analytics-header h1 { margin: 4px 0 2px; font-size: 24px; }
.analytics-header span { color: var(--muted); font-size: 10px; }
.analytics-toolbar { display: grid; grid-template-columns: minmax(190px, 1.2fr) 125px minmax(150px, .9fr) minmax(150px, .9fr) minmax(190px, .9fr) minmax(190px, auto); align-items: end; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.analytics-toolbar:has(#analyticsEmployeeField:not(.hidden)) { grid-template-columns: minmax(190px, 1.2fr) 125px minmax(150px, .9fr) minmax(150px, .9fr) 190px; }
.analytics-toolbar:has(#analyticsMasterField.hidden):has(#analyticsEmployeeField.hidden) { grid-template-columns: minmax(190px, 1fr) 125px 190px; }
.analytics-workspace.master-scope .analytics-toolbar { grid-template-columns: minmax(160px, 220px) 190px; }
.analytics-toolbar label { font-size: 10px; font-weight: 700; }
.analytics-toolbar select { height: 38px; margin-top: 5px; font-size: 11px; }
.analytics-toolbar .button { min-width: 190px; height: 38px; white-space: nowrap; }
#analyticsBuildButton { font-size: 13px; }
.analytics-custom-range { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; padding: 0 0 14px; border-bottom: 1px solid var(--border); }
.analytics-custom-range.hidden { display: none; }
.analytics-custom-range label { display: grid; gap: 5px; min-width: 155px; font-size: 10px; font-weight: 700; }
.analytics-custom-range input { width: 100%; height: 38px; }
.analytics-custom-range span { align-self: center; color: var(--muted); font-size: 10px; }
.analytics-summary { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--border); }
.analytics-metric { min-height: 76px; padding: 14px 16px; border-right: 1px solid var(--border); }
.analytics-metric:first-child { padding-left: 0; }
.analytics-metric:last-child { border-right: 0; }
.analytics-metric span, .analytics-metric strong { display: block; }
.analytics-metric span { color: var(--muted); font-size: 9px; }
.analytics-metric strong { margin-top: 8px; font-size: 19px; }
.analytics-metric small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.analytics-metric.alert strong { color: var(--red); }
.analytics-metric.ok { background: #f0f8f3; box-shadow: inset 0 3px #2f8f5b; }
.analytics-metric.warn { background: #fff8ea; box-shadow: inset 0 3px #c88916; }
.analytics-metric.danger { background: #fff1f1; box-shadow: inset 0 3px #c94a4a; }
.analytics-metric.info { background: #edf5ff; box-shadow: inset 0 3px #2672d9; }
.analytics-metric.violet { background: #f3efff; box-shadow: inset 0 3px #7759bf; }
.analytics-details { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding-top: 18px; }
.analytics-details.single { grid-template-columns: minmax(0, 1fr); }
.analytics-block h2 { margin: 0 0 10px; font-size: 13px; }
.analytics-block h3 { margin: 0 0 8px; font-size: 11px; }
.analytics-summary.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.master-indicators { min-width: 0; }
.analytics-note { margin: 0 0 12px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.my-indicators-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; border: 1px solid var(--border); border-radius: 7px; background: #eef2f6; }
.my-indicators-tabs button { min-height: 34px; padding: 0 14px; border: 1px solid transparent; border-radius: 5px; color: #3d4958; background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.my-indicators-tabs button:hover { background: #f8fafc; }
.my-indicators-tabs button.active { border-color: #b8c7d8; color: #15375d; background: white; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.my-indicators-content { display: grid; gap: 16px; min-width: 0; }
.my-indicators-panel { display: grid; gap: 16px; min-width: 0; }
.my-indicators-panel .analytics-block { min-width: 0; }
.my-indicator-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--border); border-radius: 7px; background: white; }
.my-indicator-grid.overview-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.my-indicator-grid .analytics-metric { min-width: 0; border-bottom: 1px solid var(--border); }
.indicator-badge { display: inline-flex; align-items: center; min-height: 22px; max-width: 100%; padding: 3px 8px; border-radius: 999px; color: #405064; background: #edf1f5; font-size: 9px; font-weight: 800; line-height: 1.2; white-space: normal; }
.indicator-badge.ok { color: #17643d; background: #dff3e8; }
.indicator-badge.warn { color: #7a520b; background: #fff0c9; }
.indicator-badge.danger { color: #943232; background: #ffe1e1; }
.indicator-badge.neutral { color: #405064; background: #edf1f5; }
.my-indicators-table td { vertical-align: top; }
.master-load-days { display: grid; width: 100%; min-width: 0; max-width: 100%; grid-template-columns: repeat(14, minmax(138px, 1fr)); gap: 8px; overflow-x: auto; padding: 2px 2px 10px; }
.master-load-day { display: grid; align-content: start; gap: 7px; min-height: 148px; padding: 12px; border: 1px solid #c9daf0; border-radius: 7px; background: #f1f7ff; }
.master-load-day strong { font-size: 11px; }
.master-load-day span, .master-load-day small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.master-load-day b { font-size: 14px; }
.master-load-day.off, .master-load-day.unknown { border-color: var(--border); background: #f4f6f8; }
.master-load-day.lower { border-color: #b7dfc7; background: #eef9f2; }
.master-load-day.higher { border-color: #f0d29c; background: #fff7e8; }
.master-load-track { height: 7px; overflow: hidden; border-radius: 99px; background: #dce3eb; }
.master-load-track i { display: block; height: 100%; border-radius: inherit; background: #2672d9; }
.master-load-day.lower .master-load-track i { background: #2f8f5b; }
.master-load-day.higher .master-load-track i { background: #c88916; }
.master-load-warning { margin: 8px 0 0; padding: 9px 12px; border-radius: 5px; color: #8c3b25; background: #fff0e5; font-size: 10px; font-weight: 700; }
.master-comparison-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.master-comparison-card { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.master-comparison-main { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.master-comparison-main h3 { margin: 0 0 7px; font-size: 16px; }
.master-comparison-main > strong { white-space: nowrap; font-size: 17px; }
.master-comparison-track { overflow: hidden; height: 9px; margin: 13px 0; border-radius: 99px; background: #e8edf4; }
.master-comparison-track i { display: block; height: 100%; border-radius: inherit; background: #2970d6; }
.master-comparison-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; font-size: 11px; }
.master-comparison-stats span { display: grid; gap: 3px; color: var(--muted); }
.master-comparison-stats b { color: var(--text); font-size: 12px; }
.master-comparison-warning { margin: 12px 0 0; color: #8c3b25; font-size: 11px; font-weight: 700; }
.master-comparison-days { display: flex; gap: 3px; max-width: 100%; overflow: hidden; margin-top: 14px; }
.master-comparison-day { flex: 1 1 0; min-width: 2px; height: 22px; border-radius: 3px; background: #e9edf2; }
.master-comparison-day.low { background: #acdcbf; }
.master-comparison-day.medium { background: #efc778; }
.master-comparison-day.high { background: #dc8066; }
.master-comparison-day.off { background: #d9dee5; }
.analytics-two-columns { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; padding-top: 14px; }
.analytics-table-wrap { overflow-x: auto; }
.master-payment-table { min-width: 590px; }
.repair-payout-list { grid-column: 1 / -1; min-width: 0; }
.repair-payout-list .analytics-table { min-width: 850px; }
.repair-payout-list input { min-width: 220px; width: 100%; }
.repair-payout-list td:nth-child(1), .repair-payout-list td:nth-child(2), .repair-payout-list td:nth-child(5) { white-space: nowrap; }
.analytics-orders-table { min-width: 1160px; }
.analytics-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); font-size: 10px; }
.analytics-table th, .analytics-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.analytics-table th { color: var(--muted); background: #f3f5f7; }
.analytics-table td:last-child, .analytics-table th:last-child { text-align: right; }
.analytics-table tr:last-child td { border-bottom: 0; }
.analytics-table tbody tr:hover td { background: #f7fbff; }
.analytics-receipt-link { border: 0; border-bottom: 1px solid currentColor; border-radius: 0; background: transparent; color: var(--blue); padding: 0; font: inherit; font-weight: 800; cursor: pointer; }
.analytics-receipt-link:hover { color: #0f4fa8; }
.analytics-receipt-link:focus-visible { outline: 2px solid #1f6feb; outline-offset: 3px; }
.order-expenses-list { display: grid; gap: 8px; margin-bottom: 12px; }
.order-expense-row { display: grid; grid-template-columns: minmax(180px, 1fr) 120px 150px minmax(180px, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 5px; background: #fbfcfd; font-size: 9px; }
.order-expense-row > div strong, .order-expense-row > div span { display: block; }
.order-expense-row > div strong { font-size: 11px; }
.order-expense-row > div span { margin-top: 3px; color: var(--muted); }
.order-expense-row > span { color: var(--muted); }
.order-expense-amount { font-size: 12px; white-space: nowrap; }
.order-expense-form { display: grid; grid-template-columns: minmax(170px, .8fr) 130px minmax(240px, 1.2fr) auto; gap: 9px; align-items: end; padding: 12px; border: 1px solid #d7dee7; border-radius: 5px; background: #f8fafc; }
.order-expense-form > label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 9px; font-weight: 800; }
.order-expense-form select, .order-expense-form input { width: 100%; height: 34px; font-size: 10px; }
.order-expense-form #orderExpenseRuleText { grid-column: 1 / -1; }
.order-expense-form #orderExpenseOverrides { grid-column: 1 / -1; }
.order-expense-note-field { grid-column: 3; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: #526071; font-size: 9px; font-weight: 700; }
.inline-check input { width: 15px; height: 15px; }
.payroll-toolbar input, .payroll-toolbar select { height: 38px; margin-top: 5px; font-size: 11px; }
.payroll-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.payroll-actions h2 { margin: 0 0 8px; font-size: 13px; }
.payroll-action-row { display: grid; grid-template-columns: minmax(140px, 1fr) auto; gap: 8px; }
.point-cash-row { grid-template-columns: 110px 150px minmax(180px, 1fr) auto; }
.payroll-action-row input { height: 36px; font-size: 11px; }

.metal-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.metal-header h1 { margin: 4px 0 2px; font-size: 24px; }
.metal-header span { color: var(--muted); font-size: 10px; }
.metal-toolbar { display: grid; grid-template-columns: minmax(190px, 1.2fr) repeat(3, minmax(125px, .7fr)) auto; align-items: end; gap: 10px; padding: 14px 0; }
.metal-toolbar label, .metal-movement-form label { display: grid; gap: 5px; color: #344154; font-size: 10px; font-weight: 700; }
.metal-toolbar select, .metal-toolbar input, .metal-movement-form select, .metal-movement-form input { height: 36px; font-size: 10px; }
.metal-toolbar .button { min-height: 36px; }
.metal-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.metal-summary-group { min-height: 96px; padding: 13px 15px; border-right: 1px solid var(--border); }
.metal-summary-group:first-child { padding-left: 0; }
.metal-summary-group:last-child { border-right: 0; }
.metal-summary-group span, .metal-summary-group strong, .metal-summary-group em, .metal-summary-group small { display: block; }
.metal-summary-group span { margin-bottom: 7px; color: var(--muted); font-size: 9px; }
.metal-summary-group strong { margin-top: 3px; font-size: 11px; }
.metal-summary-group em, .metal-summary-group small { margin-top: 6px; color: var(--muted); font-size: 9px; font-style: normal; }
.metal-responsibility-note { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.metal-movement-panel { padding: 17px 0 18px; border-bottom: 1px solid var(--border); }
.metal-movement-panel .section-heading { margin-bottom: 10px; }
.metal-movement-panel .section-heading h2, .metal-table-section .section-heading h2 { margin: 0; font-size: 13px; }
.metal-movement-panel .section-heading p, .metal-table-section .section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.metal-movement-form { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: end; }
.metal-movement-form .metal-note-field { grid-column: span 2; }
.metal-movement-form .button { width: 100%; min-width: 0; min-height: 36px; justify-self: stretch; white-space: normal; }
.metal-movement-form .required-field::after { content: "Для этой операции заказ обязателен"; color: #a75b00; font-size: 8px; font-weight: 600; }
.metal-sale-fields { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(170px, .7fr) minmax(230px, 1fr) minmax(260px, 1.4fr); gap: 10px; align-items: end; padding: 11px; border: 1px solid #ead1aa; border-radius: 5px; background: #fffaf2; }
.metal-sale-total { min-height: 36px; display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; align-content: center; padding: 7px 10px; border-radius: 4px; background: #fff; }
.metal-sale-total span { color: #7b4c13; font-size: 9px; font-weight: 800; }
.metal-sale-total strong { color: #a75b00; font-size: 14px; text-align: right; }
.metal-sale-total small { grid-column: 1 / -1; color: var(--muted); font-size: 8px; }
.accountability-due strong { color: var(--red); font-size: 15px; }
.metal-money { font-weight: 800; white-space: nowrap; }
.metal-money.due { color: var(--red); }
.metal-money.settled { color: var(--green); }
.metal-table-section { padding: 17px 0 2px; }
.metal-table-section + .metal-table-section { margin-top: 8px; }
.metal-table-section .section-heading { margin-bottom: 9px; }
.metal-table-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--border); border-radius: 5px; }
.metal-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 10px; }
.metal-table th, .metal-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.metal-table th { color: var(--muted); background: #f3f5f7; font-size: 9px; }
.metal-table tr:last-child td { border-bottom: 0; }
.metal-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 8.5px; line-height: 1.35; }
.metal-settings-lists { display: grid; gap: 16px; }
.metal-settings-card { min-width: 0; }
.metal-settings-card h3 { margin: 0 0 10px; font-size: 1rem; }
.metal-settings-create-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 18px; }
.metal-setting-form { display: grid; align-content: start; gap: 10px; min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 7px; background: #f8fafc; }
.metal-setting-form > strong { font-size: 13px; }
.metal-setting-form label { display: grid; gap: 5px; color: #344154; font-size: 10px; font-weight: 700; }
.metal-setting-form input, .metal-setting-form select { width: 100%; min-width: 0; height: 36px; }
.metal-setting-form .button { width: 100%; min-width: 0; height: auto; min-height: 36px; white-space: normal; }
.metal-archive-toggle { margin: 0 0 14px; }
.metal-table tr.is-archived { background: #f7f7f8; color: #677386; }
.metal-setting-editor { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(120px, auto) repeat(4, auto); align-items: center; gap: 9px; }
.metal-setting-editor input { min-width: 0; height: 34px; }
.metal-setting-fixed { color: var(--muted); font-size: 10px; white-space: nowrap; }
.metal-setting-editor .inline-check { white-space: nowrap; }
.metal-setting-editor .button { min-width: 0; white-space: normal; }
.metal-usage-panel { width: min(860px, 96vw); height: min(780px, 92vh); }
.metal-usage-panel .modal-body { min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; }
.metal-usage-panel .modal-body > * { flex: 0 0 auto; }
.metal-usage-panel .modal-actions { flex-wrap: wrap; }
.metal-usage-summary { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 7px; background: #f8fafc; }
.metal-usage-summary strong { overflow-wrap: anywhere; }
.metal-usage-summary span { color: var(--muted); font-size: 11px; }
.metal-usage-details { display: grid; gap: 12px; min-height: 0; }
.metal-usage-details section { display: grid; gap: 8px; }
.metal-usage-details h3 { margin: 0; font-size: 12px; }
.metal-usage-details ul { margin: 0; padding-left: 18px; display: grid; gap: 7px; }
.metal-usage-details li { overflow-wrap: anywhere; line-height: 1.35; }
.link-button { appearance: none; border: 0; padding: 0; margin-left: 6px; background: transparent; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer; }
.physical-metal-form { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: end; }
.physical-metal-form label { display: grid; gap: 5px; min-width: 0; color: #344154; font-size: 10px; font-weight: 700; }
.physical-metal-form input, .physical-metal-form select { width: 100%; min-width: 0; height: 36px; }
.physical-metal-note { grid-column: span 2; }
.physical-metal-form .button { width: 100%; min-width: 0; min-height: 36px; height: auto; white-space: normal; }
.metal-operation-hint { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
#finishedGoodsTable input, #finishedGoodsTable select { width: 100%; min-width: 120px; height: 32px; }
#finishedGoodsTable td:last-child { display: grid; gap: 6px; min-width: 170px; }
.metal-balance-value { font-weight: 800; white-space: nowrap; }
.metal-weight { font-weight: 800; white-space: nowrap; }
.metal-weight.positive { color: var(--green); }
.metal-weight.negative { color: var(--red); }
.metal-row-reversed { color: #8a929d; background: #f8f9fa; }
.metal-row-reversed strong { text-decoration: line-through; }
.metal-empty { padding: 22px 0; color: var(--muted); font-size: 11px; }
.metal-empty-cell { padding: 24px !important; color: var(--muted); text-align: center !important; }

.communications-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.communications-header h1 { margin: 4px 0 0; font-size: 24px; }
.communications-heading-line { display: flex; align-items: center; gap: 9px; }
.experimental-badge { padding: 3px 6px; border: 1px solid #e6a35d; border-radius: 3px; color: #98500b; background: var(--orange-soft); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.communications-channel-state { min-width: 170px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid #e3c29e; border-radius: 5px; background: #fffaf4; }
.communications-channel-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: white; background: #2997d6; font-size: 13px; }
.communications-channel-state strong, .communications-channel-state small { display: block; }
.communications-channel-state strong { font-size: 10px; }
.communications-channel-state small { margin-top: 2px; color: var(--orange); font-size: 8.5px; }
.communications-section-tabs { display: flex; gap: 6px; padding-top: 12px; }
.communications-section-tabs button { min-height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 5px; color: #526174; background: #fff; font-size: 10px; font-weight: 700; }
.communications-section-tabs button.active { border-color: #2675d6; color: #1766c7; background: #edf5ff; }
.communications-section-tabs span { margin-left: 5px; color: #6d7c8c; }
.communications-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(265px, 320px) minmax(420px, 1fr) minmax(230px, 280px); grid-template-rows: minmax(0, 1fr); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; margin-top: 14px; }
.communications-applications-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(250px, 340px) minmax(0, 1fr); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; margin-top: 12px; }
.communications-applications-list-panel { display: flex; min-width: 0; min-height: 0; flex-direction: column; border-right: 1px solid var(--border); background: #fbfcfd; }
.communications-applications-list { min-height: 0; overflow: auto; }
.communications-application-item { display: block; width: 100%; padding: 12px; border: 0; border-bottom: 1px solid var(--border); background: #fff; text-align: left; }
.communications-application-item.selected { box-shadow: inset 3px 0 #2675d6; background: #edf5ff; }
.communications-application-item strong, .communications-application-item small { display: block; }
.communications-application-item strong { color: #283646; font-size: 11px; }
.communications-application-item small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.communications-application-card { min-width: 0; min-height: 0; overflow: auto; padding: 18px; }
.communications-application-card h2 { margin: 0 0 5px; font-size: 18px; }
.communications-application-card h3 { margin: 20px 0 9px; font-size: 12px; }
.communications-application-card p { font-size: 10px; line-height: 1.5; }
.communications-application-meta { display: flex; flex-wrap: wrap; gap: 10px 20px; color: var(--muted); font-size: 10px; }
.communications-assignment { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 20px; padding: 12px; border: 1px solid var(--border); border-radius: 5px; background: #f8fafc; }
.communications-assignment label { min-width: min(280px, 100%); flex: 1; font-size: 10px; font-weight: 700; }
.communications-assignment select { margin-top: 5px; }
.communications-application-messages { display: grid; gap: 7px; }
.communications-application-message { max-width: 760px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 5px; background: white; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 10px; }
.communications-application-message.out { border-color: #c2ddee; background: #edf7fc; }
.communications-application-message small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.communications-inbox { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--border); background: #fbfcfd; }
.communications-search { padding: 11px; border-bottom: 1px solid var(--border); }
.communications-search input { height: 36px; font-size: 10px; }
.communications-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 9px 11px; border-bottom: 1px solid var(--border); }
.communications-filters button { min-width: 0; min-height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 0 8px; border: 1px solid transparent; border-radius: 4px; color: #5f6b7a; background: transparent; font-size: 8.5px; font-weight: 700; }
.communications-filters button span { color: #8a94a2; }
.communications-filters button:hover { background: #f0f3f6; }
.communications-filters button.active { border-color: #ebbc8b; color: #8e4a0c; background: var(--orange-soft); }
.communications-folder-filters { display: flex; flex-wrap: wrap; gap: 5px; padding: 9px 11px 3px; }
.communications-folder-filters button { min-height: 27px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid #dce3eb; border-radius: 5px; color: #536276; background: #fff; font-size: 9px; font-weight: 700; cursor: pointer; }
.communications-folder-filters button.active { border-color: #8fb5ed; color: #1459ae; background: #eaf3ff; }
.communications-folder-filters button span { color: #77889b; }
.communications-manage-folders { width: fit-content; margin: 4px 11px 9px; padding: 3px 0; border: 0; color: #1766c7; background: transparent; font-size: 9px; font-weight: 700; cursor: pointer; }
.communications-folder-manager { max-height: 190px; overflow: auto; padding: 8px 11px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #f4f7fb; }
.communications-folder-form { display: flex; gap: 4px; margin: 4px 0; }
.communications-folder-form input { min-width: 0; flex: 1; height: 28px; padding: 4px 6px; font-size: 9px; }
.communications-folder-form button { min-width: 28px; border: 1px solid #cbd8e8; border-radius: 4px; color: #1459ae; background: #fff; font-size: 9px; font-weight: 700; cursor: pointer; }
.communications-empty-list, .communications-dialog-empty { flex: 1; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 24px; color: var(--muted); text-align: center; }
.communications-empty-list strong, .communications-dialog-empty strong { color: #344154; font-size: 11px; }
.communications-empty-list span:last-child { font-size: 9px; }
.communications-empty-icon { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #d8dde3; border-radius: 50%; color: #7b8796; background: white; }
.communications-thread-list { min-height: 0; overflow: auto; }
.communications-load-more { display: block; width: calc(100% - 20px); margin: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 5px; color: #185a9d; background: white; font-size: 10px; font-weight: 700; cursor: pointer; }
.communications-load-more:hover { background: #eef6ff; }
.communications-thread { width: 100%; min-height: 64px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--border); background: white; text-align: left; }
.communications-thread:hover { background: #f6f8fa; }
.communications-thread.selected { box-shadow: inset 3px 0 #1f7fb8; background: #eef7fc; }
.communications-thread.unread { background: #f5faff; }
.communications-thread.unread strong { font-weight: 800; }
.communications-unread-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #1b65c9; vertical-align: middle; }
.communications-layout.history-only .communications-composer,
.communications-layout.history-only .communications-status-select,
.communications-layout.history-only #communicationsCreateApplication { display: none; }
.communications-history-notice { margin: 0; padding: 10px 14px; border-top: 1px solid var(--border); color: #566476; background: #f6f8fb; font-size: 10px; }
.communications-photo-modal { position: fixed; z-index: 1500; inset: 0; display: flex; align-items: center; justify-content: center; padding: 52px 24px 24px; background: rgba(10, 17, 27, .92); }
.communications-photo-modal.hidden { display: none; }
.communications-photo-modal img { max-width: 100%; max-height: 100%; object-fit: contain; }
.communications-photo-error { max-width: 340px; color: white; text-align: center; font-size: 14px; }
.communications-photo-close { position: absolute; top: 12px; right: 16px; width: 38px; height: 38px; border: 0; border-radius: 50%; color: white; background: rgba(255,255,255,.17); font-size: 28px; cursor: pointer; }
.communications-thread strong, .communications-thread small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.communications-thread strong { color: #25303d; font-size: 10.5px; }
.communications-thread small { margin-top: 4px; color: var(--muted); font-size: 8.5px; }
.communications-thread em { padding: 3px 6px; border-radius: 4px; color: #51606f; background: #eef1f4; font-size: 8px; font-style: normal; font-weight: 700; white-space: nowrap; }
.communications-dialog { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: white; }
.communications-dialog-header { min-height: 57px; display: flex; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--border); }
.communications-dialog-header > div { min-width: 0; flex: 1; }
.communications-dialog-header strong, .communications-dialog-header span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.communications-mark-unread { flex: none; max-width: 155px; min-height: 31px; margin-left: 8px; padding: 4px 7px; border: 1px solid #cbd7e4; border-radius: 5px; color: #185a9d; background: #fff; font-size: 9px; font-weight: 700; cursor: pointer; }
.communications-mark-unread:disabled { color: #637386; background: #f2f5f8; cursor: default; }
.communications-details-toggle { display: none; }
.communications-back-to-list { display: none; flex: none; margin-right: 10px; border: 0; color: #1766c7; background: transparent; font-size: 24px; cursor: pointer; }
.communications-dialog-header strong, .communications-dialog-header span { display: block; }
.communications-dialog-header strong { font-size: 11px; }
.communications-dialog-header span { margin-top: 3px; color: var(--muted); font-size: 8.5px; }
.communications-messages { flex: 1; min-height: 0; overflow: auto; padding: 12px; background: #f7f9fb; }
.communications-message { max-width: 82%; margin: 0 0 9px; padding: 8px 10px; border: 1px solid #dfe5eb; border-radius: 6px; background: white; }
.communications-message.out { margin-left: auto; border-color: #b8d9ec; background: #eaf6fc; }
.communications-message.deleted { color: #8b3a3a; background: #fff2f2; }
.communications-message p { margin: 0; white-space: pre-wrap; font-size: 10px; line-height: 1.45; }
.communications-message small { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; }
.communications-media-list { display: grid; gap: 7px; margin-top: 8px; }
.communications-photo { display: block; width: min(220px, 100%); border-radius: 5px; overflow: hidden; border: 1px solid #dfe5eb; background: #f2f5f7; }
.communications-photo img { display: block; width: 100%; max-height: 240px; object-fit: contain; }
.communications-audio { display: block; width: min(260px, 100%); height: 34px; }
.communications-video { display: block; width: min(320px, 100%); max-height: 300px; border-radius: 5px; background: #111; }
.communications-document, .communications-media-pending { display: inline-flex; max-width: 100%; min-height: 30px; align-items: center; padding: 6px 8px; border-radius: 5px; font-size: 9px; font-weight: 700; overflow-wrap: anywhere; }
.communications-document { border: 1px solid #c7d9e6; color: #1b638d; background: #eef8ff; text-decoration: none; }
.communications-media-pending { border: 1px solid #e0d6c5; color: #7a5b28; background: #fff8e9; }
.communications-composer { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: #fbfcfd; }
.communications-composer textarea { min-height: 42px; resize: none; font-size: 10px; }
.communications-composer > #communicationsSendButton { border: 0; border-radius: 5px; color: white; background: #aab2bc; font-size: 17px; }
.communications-context { min-width: 0; min-height: 0; overflow: auto; padding: 15px; border-left: 1px solid var(--border); background: #fbfcfd; }
.communications-context h2 { margin: 0 0 12px; font-size: 12px; }
.communications-status-select { display: block; margin-top: 12px; font-size: 9px; }
.communications-status-select select { margin-top: 5px; }
.communications-context dl { margin: 0; }
.communications-context dl div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 9px; }
.communications-context dt { color: var(--muted); }
.communications-context dd { margin: 0; color: #344154; font-weight: 700; text-align: right; }
.communications-filing { margin: 12px 0; padding: 10px; border: 1px solid #dce3eb; border-radius: 6px; background: #fff; font-size: 9px; }
.communications-filing > strong { font-size: 10px; }
.communications-filing p { margin: 4px 0 9px; color: #657487; line-height: 1.4; }
.communications-filing-checkboxes { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 10px; }
.communications-filing-checkboxes label { display: inline-flex; align-items: center; gap: 4px; }
.communications-employee-link { display: block; margin-bottom: 9px; font-weight: 700; }
.communications-employee-link select { width: 100%; margin-top: 4px; }
.communications-filing .button { width: 100%; min-height: 30px; }
.communications-context .button:disabled { opacity: .58; cursor: default; }

.schedule-toolbar { min-height: 58px; display: grid; grid-template-columns: auto 210px minmax(180px, 1fr) auto auto auto; align-items: center; gap: 14px; margin-top: 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.schedule-only-mine-toggle { min-height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; white-space: nowrap; }
.week-navigation { display: flex; align-items: center; gap: 7px; }
.icon-button.bordered { border-color: #cfd6df; background: white; font-size: 23px; }
.week-title { justify-self: center; font-size: 14px; }
.schedule-mode-toggle { display: inline-flex; border: 1px solid #cfd6df; border-radius: 5px; overflow: hidden; background: white; }
.schedule-mode-toggle button { min-height: 30px; padding: 0 12px; border: 0; border-left: 1px solid #dfe4ea; color: #596574; background: white; font-size: 9px; font-weight: 700; white-space: nowrap; }
.schedule-mode-toggle button:first-child { border-left: 0; }
.schedule-mode-toggle button.active { color: #1457b8; background: var(--blue-soft); }
.schedule-role-filter { display: inline-flex; border: 1px solid #cfd6df; border-radius: 5px; overflow: hidden; background: white; }
.schedule-role-filter button { min-height: 30px; padding: 0 11px; border: 0; border-left: 1px solid #dfe4ea; color: #596574; background: white; font-size: 9px; font-weight: 700; }
.schedule-role-filter button:first-child { border-left: 0; }
.schedule-role-filter button.active { color: #1457b8; background: var(--blue-soft); }
.schedule-legend { display: flex; align-items: center; justify-content: flex-end; gap: 13px; color: var(--muted); font-size: 9px; }
.schedule-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: #9aa4b1; }
.legend-dot.arrived { background: var(--green); }
.legend-dot.expected { background: #d49a00; }
.legend-dot.day-off { background: #b5bdc7; }
.schedule-summary { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--border); }
.schedule-summary div { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-right: 1px solid var(--border); }
.schedule-summary div:first-child { padding-left: 0; }
.schedule-summary div:last-child { border-right: 0; padding-right: 0; }
.schedule-summary span { color: var(--muted); font-size: 10px; }
.schedule-summary strong { font-size: 17px; }
.schedule-table-wrap { flex: 1; min-height: 0; overflow: auto; border-bottom: 1px solid var(--border); }
.schedule-table { width: 100%; min-width: 1040px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.schedule-table th { position: sticky; top: 0; z-index: 2; height: 52px; padding: 8px 10px; border-right: 1px solid #dfe4ea; border-bottom: 1px solid #ccd3db; background: #f7f9fb; text-align: left; vertical-align: middle; font-size: 11px; }
.schedule-table th:last-child { border-right: 0; }
.schedule-table th span, .schedule-table th small { display: block; }
.schedule-table th small { margin-top: 3px; color: var(--muted); font-size: 8.5px; font-weight: 400; }
.schedule-table .date-column { width: 104px; }
.schedule-table .manager-column { width: 205px; background: #f4faf8; }
.schedule-table .day-off-column { width: 155px; background: #f2f4f6; }
.schedule-table.filter-master .manager-column { display: none; }
.schedule-table.filter-manager .master-column { display: none; }
.schedule-table.filter-manager { min-width: 560px; }
.schedule-table.filter-manager .manager-column { width: auto; }
.schedule-table td { height: 72px; padding: 7px 8px; border-right: 1px solid #e0e5eb; border-bottom: 1px solid #e0e5eb; vertical-align: top; background: white; }
.schedule-table td:last-child { border-right: 0; background: #fafbfc; }
.schedule-row.today td { background: #f5f9ff; }
.schedule-row.today td:last-child { background: #f1f5fa; }
.schedule-row.today td.manager-column { background: #eef8f5; }
.schedule-date strong, .schedule-date span { display: block; }
.schedule-date strong { font-size: 12px; }
.schedule-date span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.today-label { display: inline-block; margin-top: 7px; padding: 2px 5px; border-radius: 3px; color: #1457b8; background: #e6f0ff; font-size: 8px; font-weight: 700; }
.shift-list { display: grid; gap: 5px; }
.shift-entry { min-height: 25px; display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid #dde3e9; border-radius: 4px; background: white; }
.schedule-workspace.editing .shift-entry { grid-template-columns: 7px minmax(0, 1fr) auto 22px; }
.shift-entry.replacement { border-color: #e7b360; background: #fffaf1; }
.shift-entry.missing { border-color: #e5b1b1; background: #fff8f8; }
.shift-status { width: 7px; height: 7px; border-radius: 50%; background: #d49a00; }
.shift-entry.arrived .shift-status { background: var(--green); }
.shift-entry.late .shift-status { background: var(--red); }
.shift-entry.missing .shift-status { background: var(--red); }
.shift-entry.planned .shift-status { background: #8793a1; }
.shift-person { min-width: 0; font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-entry.master .shift-person { color: #245f9e; }
.shift-person small { margin-left: 5px; padding: 2px 4px; border-radius: 3px; color: #596574; background: #edf0f3; font-size: 7px; font-weight: 700; }
.shift-entry.manager { border-color: #b9d8d1; background: #f5fbf9; }
.shift-entry.manager .shift-person { color: #176b5b; }
.shift-entry.manager .shift-person small { color: #176b5b; background: #dff1ec; }
.shift-entry.administrator { border-color: #d8c6a1; background: #fffaf0; }
.shift-entry.administrator .shift-person { color: #805b16; }
.shift-entry.administrator .shift-person small { color: #805b16; background: #f4e7c9; }
.schedule-workspace.editing .shift-entry, .schedule-workspace.editing .day-off-person { cursor: grab; }
.schedule-workspace.editing .shift-entry:active, .schedule-workspace.editing .day-off-person:active { cursor: grabbing; }
.shift-entry.dragging, .day-off-person.dragging { opacity: .45; }
.schedule-drop-zone.drag-over { outline: 2px solid #4b8fe8; outline-offset: -3px; background: #edf5ff !important; }
.shift-time { color: var(--muted); font-size: 8.5px; white-space: nowrap; }
.shift-fact-badge { grid-column: 2 / -1; justify-self: start; display: inline-flex; align-items: center; min-height: 18px; padding: 3px 7px; border-radius: 999px; color: #405064; background: #edf1f5; font-size: 9px; font-weight: 800; line-height: 1.2; }
.shift-fact-badge.active { color: #176b46; background: #e2f4ea; }
.shift-fact-badge.late, .shift-fact-badge.missing { color: #9f2727; background: #fdeaea; }
.shift-fact-badge.attention { color: #825700; background: #fff0cb; }
.shift-note { grid-column: 2 / -1; color: var(--orange); font-size: 8px; font-weight: 700; }
.shift-remove-button { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid #e1a5a5; border-radius: 3px; color: #a52626; background: #fff7f7; font-size: 14px; line-height: 1; }
.shift-remove-button:hover { color: white; background: var(--red); }
.shift-edit-controls { grid-column: 2 / -1; display: grid; grid-template-columns: 22px 22px minmax(80px, 1fr) 22px; gap: 4px; align-items: center; }
.shift-edit-controls button { min-height: 20px; border: 1px solid #cfd6df; border-radius: 3px; background: white; color: #3d4754; font-size: 12px; }
.shift-edit-controls select { min-width: 0; height: 22px; padding: 2px 4px; border: 1px solid #cfd6df; border-radius: 3px; background: white; font-size: 8px; }
.cell-add-shift { display: grid; grid-template-columns: minmax(80px, 1fr) 54px 54px; gap: 4px; margin-top: 6px; }
.cell-add-shift select, .cell-add-shift input { min-width: 0; height: 24px; padding: 2px 4px; border: 1px solid #cfd6df; border-radius: 3px; background: white; font-size: 8px; }
.cell-add-shift .cell-edit-button { grid-column: 1 / -1; }
.day-off-list { display: flex; flex-wrap: wrap; gap: 4px; }
.day-off-person { padding: 4px 6px; border-radius: 3px; color: #5e6875; background: #eceff2; font-size: 9px; }
.empty-shift { display: inline-block; padding: 6px 0; color: #98a2ae; font-size: 9px; }
.cell-edit-button { width: 100%; min-height: 25px; border: 1px dashed #8bb2e8; border-radius: 4px; color: var(--blue); background: #f6f9ff; font-size: 9px; font-weight: 700; }
.cell-edit-button:hover { background: var(--blue-soft); }
.schedule-workspace.editing .schedule-table td:not(.schedule-date) { background: #fcfdff; }
.schedule-footer { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 9px; }
.actual-table { min-width: 940px; }
.actual-table th, .actual-table td { height: auto; padding: 10px; font-size: 10px; vertical-align: middle; }
.actual-table td strong, .actual-table td small { display: block; }
.actual-table td small { margin-top: 3px; color: var(--muted); font-size: 8.5px; }
.actual-status { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 7px; border-radius: 4px; background: #edf0f3; color: #3d4754; font-weight: 700; }
.actual-status.on_time { background: #e7f5ed; color: #1f7a4d; }
.actual-status.late, .actual-status.late_different_location, .actual-status.not_started { background: #fff0f0; color: #a52626; }
.actual-status.different_location { background: #fff6df; color: #8a5b00; }
.actual-status.unclosed { background: #fff6df; color: #8a5b00; }
.lateness-ignore-toggle { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: #586474; font-size: 9px; font-weight: 700; line-height: 1.25; }
.lateness-ignore-toggle input { width: 14px; height: 14px; margin: 0; accent-color: var(--blue); }
.actual-row button { min-height: 28px; }
.actual-shift-panel { position: relative; width: min(760px, 94vw); max-height: 92vh; display: flex; flex-direction: column; border-radius: 7px; background: white; box-shadow: 0 28px 80px rgba(0,0,0,.28); overflow: hidden; }
.actual-shift-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 16px; overflow: auto; }
.actual-shift-fact { padding: 10px; border: 1px solid var(--border); border-radius: 5px; background: #fbfcfd; }
.actual-shift-fact span { display: block; color: var(--muted); font-size: 9px; }
.actual-shift-fact strong { display: block; margin-top: 4px; font-size: 12px; }
.actual-shift-fact.full { grid-column: 1 / -1; }
.actual-correction-history { grid-column: 1 / -1; }
.actual-correction-history h3 { margin: 0 0 8px; font-size: 13px; }
.actual-correction-history article { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.actual-correction-history article strong { font-size: 10px; }
.actual-correction-history article span, .actual-correction-history article small { color: var(--muted); font-size: 9px; }
.actual-correction-history article p { grid-column: 1 / -1; margin: 0; font-size: 10px; }
.actual-shift-correction { padding: 0 16px 16px; overflow: auto; }
.actual-shift-correction h3 { margin: 0 0 10px; font-size: 13px; }
.actual-shift-correction textarea { min-height: 74px; resize: vertical; }
.form-error { margin: 8px 0; color: var(--red); font-size: 10px; font-weight: 700; }

.modal { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 28px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 32, .62); }
.modal-panel { position: relative; width: min(820px, 94vw); height: min(880px, 92vh); display: flex; flex-direction: column; border-radius: 7px; background: white; box-shadow: 0 28px 80px rgba(0,0,0,.28); overflow: hidden; }
.modal-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 3px 0 0; font-size: 18px; }
.modal-actions { display: flex; align-items: center; gap: 8px; }
#settingsMoreMenu { position: relative; }
.settings-more-menu summary { list-style: none; cursor: pointer; }
.settings-more-menu summary::-webkit-details-marker { display: none; }
.settings-more-menu summary::after { content: ""; flex: 0 0 6px; width: 6px; height: 6px; margin-left: 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-1px) rotate(45deg); transition: transform .16s ease; opacity: .72; }
.settings-more-menu[open] summary { color: var(--blue); border-color: var(--blue); background: var(--blue-soft); }
.settings-more-menu[open] summary::after { transform: translateY(2px) rotate(225deg); }
.settings-more-list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; display: grid; gap: 6px; min-width: 220px; padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: white; box-shadow: 0 12px 30px rgba(22,32,43,.16); }
.settings-more-list .button { width: 100%; justify-content: flex-start; margin: 0; white-space: normal; }
#smsTemplateModal { align-items: center; }
#smsTemplateModal .modal-panel { width: min(640px, 94vw); height: auto; max-height: min(720px, 92vh); }
#smsTemplateModal .modal-body { display: grid; gap: 14px; min-height: 0; padding: 20px 22px 22px; overflow: auto; }
#smsTemplateModal textarea { min-height: 120px; resize: vertical; }
.sms-placeholder-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.sms-template-preview { border: 1px solid var(--border); border-radius: 6px; padding: 12px; background: var(--surface-muted); }
.sms-template-preview p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.receipt-print-summary { padding: 6px 8px; border: 1px solid #d3d9e0; border-radius: 4px; color: #586575; background: #f7f9fb; font-size: 10px; font-weight: 700; }
.order-type-panel { position: relative; width: min(650px, 94vw); border-radius: 7px; background: white; box-shadow: 0 28px 80px rgba(0,0,0,.28); overflow: hidden; }
.order-type-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 22px; }
.order-type-option { min-height: 190px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; padding: 22px; border: 1px solid #ccd4de; border-radius: 6px; color: #17202a; background: white; text-align: left; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.order-type-option:hover, .order-type-option:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,224,.12); transform: translateY(-1px); outline: none; }
.order-type-option.manufacture { border-top: 4px solid #1769e0; }
.order-type-option.repair { border-top: 4px solid #168267; }
.order-type-option strong { margin-top: 28px; font-size: 22px; }
.order-type-option > span:last-child { margin-top: 7px; color: var(--muted); font-size: 12px; }
.order-type-number { color: #7b8694; font-size: 11px; font-weight: 700; }
.client-lookup-panel { position: relative; width: min(540px, 94vw); border-radius: 7px; background: white; box-shadow: 0 28px 80px rgba(0,0,0,.28); overflow: hidden; }
.operator-panel { width: min(520px, 94vw); }
.operator-body { display: grid; gap: 16px; max-height: min(720px, 80vh); overflow: auto; padding: 18px; }
.operator-list { display: grid; gap: 7px; }
.operator-row { width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid #d6dde5; border-radius: 5px; color: #17202a; background: white; text-align: left; }
.operator-row.current { border-color: #9dcbbf; background: #f2faf7; }
.operator-row span, .operator-row strong, .operator-row small { display: block; }
.operator-row small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 400; }
.operator-row b { color: var(--blue); font-size: 9px; }
.operator-row.current b { color: var(--green); }
.operator-form { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.operator-form > strong { font-size: 13px; }
.operator-note { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.operator-actions { display: flex; justify-content: flex-end; gap: 8px; }
.shift-close-reminder-panel { position: relative; width: min(520px, 94vw); display: grid; grid-template-columns: 8px 1fr; border-radius: 7px; background: white; box-shadow: 0 28px 80px rgba(0,0,0,.32); overflow: hidden; }
.shift-close-reminder-accent { background: #c88916; }
.shift-close-reminder-body { display: grid; gap: 10px; padding: 24px; }
.shift-close-reminder-body h2 { margin: 0; font-size: 24px; }
.shift-close-reminder-body > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.shift-close-reminder-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.shift-close-reminder-actions .button { min-width: 160px; }
.client-lookup-form { display: grid; gap: 14px; padding: 22px; }
.workstation-pair-panel { width: min(460px, 94vw); }
.install-help-panel { width: min(520px, 94vw); }
.install-help-body { display: grid; gap: 12px; padding: 22px; }
.install-help-body p { margin: 0; color: #4e5b6b; font-size: 12px; line-height: 1.55; }
.install-help-body p:first-child { color: #17202a; font-size: 14px; font-weight: 700; }
.pairing-code-panel { width: min(500px, 94vw); }
.pairing-code-body { display: grid; gap: 16px; padding: 22px; }
.pairing-code-body > strong { font-size: 13px; }
.pairing-code-body > p { margin: 0; color: var(--muted); font-size: 11px; }
.pairing-code-value { padding: 18px; border: 1px solid #b9cce6; border-radius: 5px; color: #124f9f; background: #f1f6fd; font-size: 30px; font-weight: 800; letter-spacing: 0; text-align: center; }
.client-phone-field { font-size: 12px; font-weight: 700; }
.client-phone-field input { height: 50px; margin-top: 7px; font-size: 18px; }
.client-phone-field input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 2px rgba(201,56,56,.12); }
.field-error { margin: -7px 0 0; color: var(--red); font-size: 11px; font-weight: 700; }
.existing-client-result { display: grid; gap: 5px; padding: 16px; border: 1px solid #b9d8d1; border-left: 4px solid var(--green); border-radius: 5px; background: #f5fbf9; }
.existing-client-result strong { font-size: 18px; }
.existing-client-result > span:not(.result-label) { color: var(--muted); font-size: 12px; }
.existing-client-address { overflow-wrap: anywhere; }
.result-label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.correction-trigger { justify-self: start; margin-top: 6px; padding: 0; }
.new-client-fields, .client-correction-fields { padding: 16px; border: 1px solid #d7dee7; border-radius: 5px; background: #f8fafc; }
.new-client-fields .field-grid, .client-correction-fields .field-grid { margin-top: 10px; }
.client-correction-fields { display: grid; gap: 10px; }
.client-correction-fields .button { justify-self: start; }
.correction-state { margin: 0; color: var(--green); font-size: 11px; font-weight: 700; }
.client-lookup-actions { display: flex; justify-content: flex-end; padding-top: 4px; }
.client-lookup-actions .button { min-width: 190px; }
.password-reset-panel { width: min(560px, 94vw); }
.password-reset-body { display: grid; gap: 14px; padding: 22px; }
.password-reset-body p { margin: 0; color: #4e5b6b; font-size: 12px; line-height: 1.55; }
.password-reset-target { display: grid; gap: 4px; padding: 12px; border: 1px solid #d7dee7; border-radius: 5px; background: #f8fafc; }
.password-reset-target span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.password-reset-target strong { overflow-wrap: anywhere; font-size: 16px; }
.password-reset-target small { color: var(--muted); font-size: 11px; }
.password-reset-target b { color: #17202a; overflow-wrap: anywhere; }
.password-reset-secret { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 16px; font-weight: 700; }
.password-reset-actions { gap: 8px; }
.receipt-preview { flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 22px; background: #e9edf1; }
.receipt-paper { width: 595px; min-height: 842px; background: white; color: #111; padding: 14px 15px; box-shadow: 0 1px 4px rgba(0,0,0,.14); font-family: Arial, sans-serif; }
.receipt-document { width: 595px; display: grid; gap: 22px; color: #111; font-family: Arial, sans-serif; }
.receipt-page { position: relative; }
.receipt-half { min-height: 400px; padding: 3px 0 0; }
.receipt-half + .receipt-half { border-top: 1px solid #111; margin-top: 5px; padding-top: 4px; }
.receipt-title { text-align: center; font-weight: 700; font-size: 12px; margin: 0 0 12px; }
.receipt-transfer-reference { text-align: center; font-size: 7px; margin: -8px 0 6px; }
.receipt-jwt-header { position: relative; }
.receipt-test-label { margin-bottom: 8px; padding: 4px 6px; border: 2px solid #111; font-size: 11px; font-weight: 800; text-align: center; letter-spacing: 0; }
.receipt-header-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; align-items: start; }
.receipt-header-columns .receipt-meta { grid-template-columns: 71px 1fr; gap: 2px 3px; font-size: 8px; }
.receipt-header-columns .receipt-meta > span { min-height: 12px; overflow-wrap: anywhere; line-height: 1.15; }
.receipt-header-columns .receipt-meta > span:nth-child(odd) { text-align: right; padding-right: 1px; }
.receipt-header-columns .receipt-meta > span:nth-child(even) { border-bottom: 1px solid #111; }
.receipt-header-columns .receipt-meta > span:nth-last-child(-n + 4):nth-child(even) { max-width: 110px; }
.receipt-company { padding-top: 2px; font-size: 8px; font-weight: 700; font-style: italic; line-height: 1.22; overflow-wrap: anywhere; }
.receipt-company strong { font-size: inherit; }
.receipt-company p { margin: 10px 0 0; }
.receipt-service-meta { margin: 5px 0; font-size: 6.5px; line-height: 1.2; }
.receipt-page-number { margin-bottom: 4px; text-align: center; font-size: 8px; }
.receipt-continuation-meta { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid #555; border-bottom: 1px solid #555; font-size: 9px; }
.receipt-meta { display: grid; grid-template-columns: 120px 1fr; gap: 4px; font-size: 10px; }
.receipt-table { width: 100%; border-collapse: collapse; margin-top: 3px; font-size: 8px; table-layout: fixed; }
.receipt-table th, .receipt-table td { border: 1px solid #111; padding: 1px; text-align: left; vertical-align: middle; overflow-wrap: anywhere; font-weight: 400; line-height: 1.05; }
.receipt-table th { text-align: center; }
.receipt-table small { font-size: 6.5px; }
.receipt-material-table thead { height: 76px; }
.receipt-material-table td:not(:first-child):not(:nth-child(2)) { text-align: center; }
.receipt-material-table tfoot th { border: 0; font-weight: 700; font-style: italic; }
.receipt-material-table tfoot td { font-weight: 700; font-style: italic; }
.receipt-blank-row td { height: 10px; }
.receipt-jwt-bottom { display: grid; grid-template-columns: 57% 23% 20%; align-items: stretch; margin-top: 3px; font-size: 8px; line-height: 1.15; }
.receipt-jwt-work-table { margin-top: 0; }
.receipt-jwt-work-table thead { height: 23px; }
.receipt-jwt-work-table .receipt-blank-row td { height: 10px; }
.receipt-work-description { display: block; font-size: 6.5px; }
.receipt-money { white-space: nowrap; }
.receipt-jwt-signatures, .receipt-jwt-notes { padding: 0 1px; overflow-wrap: anywhere; }
.receipt-jwt-signatures { border-right: 1px solid #111; }
.receipt-continued { font-size: 9px; overflow-wrap: anywhere; white-space: normal; }
.receipt-bottom-heading { min-height: 24px; text-align: center; }
.receipt-jwt-notes p { margin: 5px 2px; font-size: 6.5px; }
.receipt-note-text { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.receipt-jwt-totals { font-size: 6.5px; line-height: 1.25; }
.receipt-jwt-totals > div:not(.receipt-work-total) { margin-top: 3px; }
.receipt-work-total { display: grid; grid-template-columns: 67% 18% 15%; font-size: 8px; font-style: italic; font-weight: 700; text-align: center; }
.receipt-work-total strong { border: 1px solid #111; border-top: 0; padding: 1px; }
.receipt-weight-note { margin-top: 3px; font-size: 6px; line-height: 1.15; }
.receipt-paid-summary { margin: 15px 0 16px; font-style: italic; font-weight: 700; text-decoration: underline; }
.receipt-sign-line { display: inline-block; width: 100%; min-height: 9px; border-bottom: 1px solid #111; }
.receipt-sign small { display: block; text-align: center; }
.receipt-jwt-signatures .employee-sign .receipt-sign-line { width: 68%; }
.receipt-total { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; margin-top: 6px; border: 1px solid #111; border-right: 0; font-size: 7.5px; font-weight: 700; }
.receipt-total span { padding: 3px; border-right: 1px solid #111; overflow-wrap: anywhere; }
.manufacture-receipt-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 6px; border: 1px solid #111; background: #111; font-size: 7.5px; }
.manufacture-receipt-totals > div { display: grid; gap: 1px; min-width: 0; padding: 3px 4px; background: white; }
.manufacture-receipt-totals > .receipt-preliminary { grid-column: 1 / -1; display: flex; justify-content: space-between; }
.manufacture-receipt-totals strong { font-size: 8px; }
.manufacture-receipt-totals .accent strong { color: #111; }
.receipt-notes { margin-top: 6px; border: 1px solid #111; padding: 3px 4px; font-size: 7.5px; line-height: 1.25; overflow-wrap: anywhere; }
.receipt-notes strong { display: block; margin-bottom: 2px; }
.receipt-notes span { display: block; min-height: 1.35em; }
.receipt-sign { margin-top: 6px; font-size: 8px; text-align: left; }
.receipt-sign.employee-sign { margin-top: 4px; }
.delete-order-panel { width: min(620px, calc(100vw - 28px)); }
.delete-order-form { display: grid; gap: 12px; padding: 18px; }
.delete-order-receipt { margin: 0; font-size: 20px; font-weight: 800; }
.delete-mode-option { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid #cfd8e3; border-radius: 6px; background: #fff; cursor: pointer; }
.delete-mode-option input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }
.delete-mode-option span { display: grid; gap: 3px; }
.delete-mode-option small { color: #667085; font-size: 12px; line-height: 1.4; }
.delete-mode-option.danger-option { border-color: #e7bbbb; background: #fffafa; }
.delete-order-form textarea { resize: vertical; min-height: 76px; }
.draft-delete-warning, .draft-delete-note { margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.draft-delete-warning { padding: 12px; border: 1px solid #e7bbbb; border-radius: 6px; color: #8a1f1f; background: #fffafa; font-weight: 700; }
.draft-delete-note { color: #4e5967; font-size: 12px; }
.receipt-continued { margin-top: 14px; color: #444; font-size: 9px; text-align: right; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 18px); padding: 11px 16px; border-radius: 5px; background: #17202a; color: white; font-size: 12px; opacity: 0; pointer-events: none; transition: .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.print-sheet { display: none; }
.receipt-measure { position: fixed; left: -10000px; top: 0; width: 196mm; visibility: hidden; pointer-events: none; z-index: -1; color: #000; font-family: Arial, sans-serif; }
.receipt-measure .receipt-paper { width: 196mm; min-height: 0; padding: 0; box-shadow: none; background: white; color: #000; }
.receipt-measure .compact-receipt { min-height: 0; }
.receipt-measure .receipt-document { width: 196mm; display: block; }
.receipt-measure .receipt-page { min-height: 0; padding: 0; break-after: auto; page-break-after: auto; }
.receipt-measure .receipt-header-columns .receipt-meta { grid-template-columns: 25mm 1fr; gap: 3px 4px; font-size: 11px; }
.receipt-measure .receipt-header-columns .receipt-meta > span { padding: 0; min-height: 15px; }
.receipt-measure .receipt-header-columns .receipt-meta > span:nth-last-child(-n + 4):nth-child(even) { max-width: 36mm; }
.receipt-measure .receipt-company { font-size: 11px; padding-top: 3px; }
.receipt-measure .receipt-company strong { font-size: inherit; }
.receipt-measure .receipt-company p { margin-top: 3mm; }
.receipt-measure .receipt-service-meta { font-size: 9px; margin: 1.5mm 0; }
.receipt-measure .receipt-half { min-height: 0; break-inside: avoid; page-break-inside: avoid; }
.receipt-measure .compact-receipt .receipt-half { min-height: 132mm; }
.receipt-measure .receipt-title { font-size: 17px; margin: 0 0 3mm; }
.receipt-measure .receipt-meta { grid-template-columns: 34mm 1fr; gap: 4px; font-size: 10px; }
.receipt-measure .receipt-table { margin-top: .7mm; font-size: 11px; table-layout: fixed; }
.receipt-measure .receipt-table th, .receipt-measure .receipt-table td { padding: .2mm; }
.receipt-measure .receipt-table small { font-size: 9px; }
.receipt-measure .receipt-material-table thead { height: 22mm; }
.receipt-measure .receipt-table th { font-size: 9.5px; overflow-wrap: normal; }
.receipt-measure .receipt-blank-row td { height: 2.3mm; }
.receipt-measure .receipt-jwt-bottom { font-size: 11px; margin-top: .7mm; }
.receipt-measure .receipt-jwt-work-table { margin-top: 0; }
.receipt-measure .receipt-jwt-work-table thead { height: 7.5mm; }
.receipt-measure .receipt-jwt-totals, .receipt-measure .receipt-jwt-notes p { font-size: 9px; }
.receipt-measure .receipt-work-total { font-size: 11px; }
.receipt-measure .receipt-weight-note { font-size: 8px; }
.receipt-measure .receipt-bottom-heading { min-height: 9mm; }
.receipt-measure .receipt-paid-summary { margin: 5mm 0 6mm; }
.receipt-measure .receipt-total { margin-top: 1.2mm; font-size: 11px; }
.receipt-measure .manufacture-receipt-totals { margin-top: 1.2mm; font-size: 11px; }
.receipt-measure .manufacture-receipt-totals strong { font-size: 11px; }
.receipt-measure .receipt-notes { margin-top: 1.2mm; font-size: 11px; }
.receipt-measure .receipt-sign { margin-top: 1.5mm; font-size: 11px; }
.receipt-measure .receipt-sign.employee-sign { margin-top: 1.5mm; }
.receipt-measure .receipt-half + .receipt-half { margin-top: 2mm; padding-top: 1mm; }
.location-close-panel { width: min(610px, 94vw); }
.location-close-body { display: grid; gap: 16px; padding: 22px; }
.location-close-body p { margin: 0; line-height: 1.5; }
.location-close-body label { display: grid; gap: 7px; font-size: 11px; font-weight: 700; }
.location-close-rules { display: grid; gap: 6px; padding: 12px; border: 1px solid #d7dee7; border-radius: 5px; color: var(--muted); background: #f8fafc; font-size: 10px; }
.location-close-rules span::before { content: "✓"; margin-right: 7px; color: var(--green); font-weight: 800; }

@media (max-width: 1360px) {
  .workspace { grid-template-columns: 68px 285px minmax(700px, 1fr); }
  .topbar { grid-template-columns: 285px 1fr auto; }
  .schedule-workspace { padding-left: 16px; padding-right: 16px; }
  .schedule-toolbar { grid-template-columns: 1fr 180px minmax(150px, 1fr); gap: 9px; }
  .schedule-only-mine-toggle { justify-content: center; }
  .schedule-role-filter button { padding: 0 8px; }
  .schedule-legend { gap: 8px; }
  .create-location-form, .location-admin-primary { grid-template-columns: minmax(190px, .8fr) minmax(280px, 1.4fr) auto; }
  .location-business-grid { grid-template-columns: minmax(260px, 1.4fr) minmax(120px, .55fr) minmax(170px, .8fr) minmax(190px, 1fr); }
  .location-hours-grid { grid-template-columns: repeat(4, minmax(118px, 1fr)); }
  .expense-type-form, .expense-type-row { grid-template-columns: minmax(150px, .8fr) minmax(210px, 1.1fr) 90px minmax(150px, .75fr) minmax(140px, .7fr); }
  .expense-type-actions, .expense-type-form button { grid-column: 1 / -1; justify-content: flex-end; }
  .create-user-form { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
  .create-user-form > .button { justify-self: end; }
  .analytics-toolbar { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
  .analytics-toolbar:has(#analyticsEmployeeField:not(.hidden)), .analytics-toolbar:has(#analyticsMasterField.hidden):has(#analyticsEmployeeField.hidden) { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
  .analytics-toolbar .button { justify-self: end; min-width: 180px; }
  .physical-metal-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metal-settings-create-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .master-comparison-list { grid-template-columns: minmax(0, 1fr); }
  .master-comparison-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .master-comparison-main { flex-wrap: wrap; }
  body { min-width: 0; }
  .app { min-height: 0; height: 100svh; grid-template-rows: 54px minmax(0, 1fr); }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; padding: 0 9px; }
  .topbar > .brand-lockup { display: none; }
  .point-chip { min-width: 0; max-width: 150px; padding: 6px 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .point-chip span:last-child { overflow: hidden; text-overflow: ellipsis; }
  .topbar-actions { min-width: 0; gap: 5px; }
  .network-state, .role-badge { display: none !important; }
  .user-menu { min-width: 0; }
  #currentEmployeePlain { max-width: 112px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .operator-menu-button { max-width: 150px; }
  .operator-menu-button #currentEmployee { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

  .workspace { position: relative; display: block; min-height: 0; }
  .primary-nav { position: absolute; z-index: 12; left: 0; right: 0; bottom: 0; height: 62px; min-height: 62px; flex-direction: row; gap: 2px; padding: 4px; border: 0; border-top: 1px solid #394450; overflow-x: auto; }
  .primary-nav-button { flex: 1 0 58px; width: auto; min-width: 58px; min-height: 52px; gap: 3px; padding: 2px 3px; font-size: 8px; }
  .primary-nav-icon { font-size: 16px; }

  .orders-panel, .order-workspace, .schedule-workspace, .price-workspace, .settings-workspace, .analytics-workspace, .payroll-workspace, .metal-workspace, .communications-workspace, .client-directory-workspace {
    position: absolute; inset: 0 0 62px; width: auto; min-width: 0; min-height: 0; grid-column: auto; overflow: auto; padding: 12px;
  }
  .orders-panel { display: flex; border-right: 0; }
  .order-workspace { display: none; overflow: hidden; padding: 10px 10px 0; }
  .app.mobile-order-open .orders-panel { display: none; }
  .app.mobile-order-open .order-workspace { display: flex; }
  .panel-title-row h2 { font-size: 20px; }
  .tabs { margin-top: 7px; }
  .order-type-tabs { grid-template-columns: 1fr 1fr 1fr; }
  .orders-list.compact .order-list-item { min-height: 58px; padding: 6px 8px 6px 10px; }
  .order-client { max-width: 58vw; }

  .order-header { gap: 8px; align-items: flex-start; }
  .order-header > div:first-child { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .order-header .eyebrow { grid-column: 2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .order-header h1 { grid-column: 2; font-size: 18px; }
  .order-header .order-transfer-reference { grid-column: 2; min-width: 0; overflow-wrap: anywhere; }
  .mobile-back-button { grid-row: 1 / 3; display: block; }
  .order-header-actions { flex-direction: column-reverse; align-items: stretch; }
  .order-header-actions .button { min-height: 30px; padding: 0 8px; font-size: 9px; }
  .status-select { width: 112px; height: 34px; padding: 6px; font-size: 11px; }
  .section-tabs { gap: 18px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
  .section-tabs button { flex: 0 0 auto; }
  .order-form { padding-top: 5px; }
  .form-section.two-columns { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .field-grid, .field-grid.payment-grid, .field-grid.four { grid-template-columns: minmax(0, 1fr); }
  .order-payment-summary { grid-template-columns: 1fr 1fr; }
  .order-payment-summary > div { min-height: 58px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .order-payment-summary > div:nth-child(2n) { border-right: 0; }
  .order-payment-summary > div:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
  .order-payment-row-main { gap: 8px; }
  .order-payment-meta { display: grid; gap: 3px; }
  .order-payment-admin-actions, .work-payment-form { grid-template-columns: minmax(0, 1fr); }
  .work-payment-form .button { width: 100%; }
  .order-expense-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .order-expense-row .button { width: 100%; }
  .order-expense-form { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .order-expense-form #orderExpenseRuleText, .order-expense-form #orderExpenseOverrides, .order-expense-note-field { grid-column: auto; }
  .order-expense-form .button { width: 100%; }
  .span-2, .span-4 { grid-column: auto; }
  .due-field-inputs { grid-template-columns: minmax(0, 1fr) 92px; }
  .section-heading { align-items: flex-start; }
  .section-heading .button { padding: 0 9px; white-space: nowrap; }
  .item-details { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 10px; }
  .manufacture-item-details .item-loss-field { grid-column: auto; }
  .item-details .item-defect-field { grid-column: 1 / -1; }
  .manufacture-loss-summary { margin: 0 10px 10px; }
  .manufacture-loss-summary header { align-items: flex-start; flex-direction: column; gap: 3px; }
  .manufacture-loss-grid { grid-template-columns: 1fr 1fr; }
  .manufacture-loss-grid span:last-child { grid-column: 1 / -1; }
  .repair-residual-fields { grid-template-columns: 1fr 1fr; }
  .repair-residual-summary { grid-template-columns: 1fr 1fr; }
  .repair-residual-summary div:last-child { grid-column: 1 / -1; }
  .repair-residual-confirm { grid-template-columns: 1fr; }
  .repair-residual-confirm .button, .repair-residual-block > .button { width: 100%; }
  .order-metal-action-form { grid-template-columns: 1fr 1fr; }
  .order-metal-action-form .button { grid-column: 1 / -1; }
  .item-works { overflow-x: auto; padding: 0 10px 10px; }
  .works-table, .repair-work-columns, .manufacture-work-columns { min-width: 900px; }
  .money-summary { min-height: 42px; align-items: flex-start; }
  #notes { min-height: 180px; max-height: none; }
  .history-entry { grid-template-columns: 90px minmax(0, 1fr); gap: 10px; }
  .form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 8px 0; }
  .form-actions span { grid-column: 1 / -1; margin: 0; }
  .form-actions #previewReceiptButton { grid-column: 1 / -1; }
  .form-actions .button { min-width: 0; padding: 0 8px; font-size: 10px; }

  .schedule-header, .price-header, .analytics-header, .settings-header, .payroll-header, .metal-header, .communications-header, .client-directory-header { align-items: flex-start; gap: 8px; }
  .schedule-header h1, .price-header h1, .analytics-header h1, .settings-header h1, .payroll-header h1, .metal-header h1, .communications-header h1, .client-directory-header h1 { font-size: 20px; }
  .client-directory-header { padding: 14px; }
  .client-directory-header .button { flex: 0 0 auto; min-width: max-content; white-space: nowrap; }
  .client-directory-toolbar { grid-template-columns: 1fr; padding: 12px 14px; }
  .client-directory-layout { display: block; padding: 12px 14px 16px; }
  .client-directory-list-panel { display: block; }
  .client-directory-card { display: none; margin-top: 0; padding: 14px; }
  .app.mobile-client-open .client-directory-list-panel { display: none; }
  .app.mobile-client-open .client-directory-card { display: block; }
  .client-card-back { display: inline-grid; margin-bottom: 10px; }
  .client-card-header, .client-card-actions { display: grid; justify-content: stretch; }
  .client-contact-edit-form { grid-template-columns: 1fr; }
  .client-card-facts { grid-template-columns: 1fr; }
  .client-directory-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-directory-orders { min-width: 680px; }
  .schedule-header { flex-wrap: wrap; }
  .schedule-header-actions { width: 100%; align-items: stretch; justify-content: stretch; }
  .schedule-header-actions .button { flex: 1 1 180px; min-height: 38px; height: auto; padding: 8px 10px; white-space: normal; }
  .schedule-toolbar { grid-template-columns: 1fr; height: auto; padding: 9px 0; }
  .week-title { justify-self: start; }
  .schedule-mode-toggle, .schedule-mode-toggle button { width: 100%; }
  .schedule-mode-toggle button { flex: 1; }
  .schedule-legend { justify-content: flex-start; overflow-x: auto; }
  .schedule-summary { grid-template-columns: 1fr 1fr; }
  .schedule-summary div { padding: 8px; }
  .schedule-table-wrap:has(.actual-table) { overflow: visible; border-bottom: 0; }
  .actual-table { width: 100%; min-width: 0; border-collapse: separate; border-spacing: 0 8px; }
  .actual-table thead { display: none; }
  .actual-table tbody, .actual-table .actual-row { display: block; width: 100%; }
  .actual-table .actual-row { overflow: hidden; border: 1px solid var(--border); border-radius: 5px; background: white; }
  .actual-table .actual-row td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; width: auto; min-height: 38px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
  .actual-table .actual-row td:last-child { border-bottom: 0; }
  .actual-table .actual-row td::before { content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 700; }
  .actual-table .actual-row td:empty { display: none; }
  .actual-table .actual-row .actual-status { justify-self: start; }
  .actual-table .actual-row .lateness-ignore-toggle { justify-self: start; margin-top: 4px; }
  .actual-table .actual-row .button { width: 100%; }
  .actual-table .actual-empty-row td { display: block; width: 100%; padding: 16px 0; text-align: center; }
  .schedule-footer { display: none; }
  .actual-shift-details { grid-template-columns: 1fr; }
  .actual-shift-fact.full { grid-column: auto; }
  .price-toolbar, .price-edit-actions, .analytics-controls, .settings-tabs { align-items: stretch; flex-direction: column; }
  .create-location-form, .location-admin-primary, .location-business-grid { grid-template-columns: minmax(0, 1fr); }
  .location-admin-list, .location-admin-row { width: 100%; min-width: 0; }
  .location-admin-actions { justify-content: stretch; }
  .location-admin-actions .button { flex: 1 1 140px; }
  .price-proposal { grid-template-columns: 1fr; }
  .price-proposal-actions { grid-template-columns: 1fr 1fr; }
  .price-proposal-actions select { grid-column: 1 / -1; }
  .analytics-toolbar { grid-template-columns: 1fr; }
  .analytics-toolbar:has(#analyticsEmployeeField:not(.hidden)), .analytics-toolbar:has(#analyticsMasterField.hidden):has(#analyticsEmployeeField.hidden) { grid-template-columns: 1fr; }
  .analytics-workspace.master-scope .analytics-toolbar { grid-template-columns: 1fr; }
  .analytics-toolbar .button { width: 100%; min-width: 0; justify-self: stretch; }
  .analytics-custom-range label { flex: 1 1 140px; min-width: 0; }
  .analytics-custom-range span { flex: 1 1 100%; }
  .analytics-summary { grid-template-columns: 1fr 1fr; }
  .my-indicator-grid { grid-template-columns: 1fr 1fr; }
  .my-indicator-grid.overview-grid { grid-template-columns: 1fr 1fr; }
  .my-indicator-grid.overview-grid .analytics-metric:last-child { grid-column: span 2; }
  .my-indicators-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .my-indicators-tabs button { width: 100%; min-width: 0; }
  .my-indicators-panel .analytics-table-wrap { overflow: visible; }
  .my-indicators-table { width: 100%; min-width: 0; border: 0; border-collapse: separate; border-spacing: 0 8px; }
  .my-indicators-table thead { display: none; }
  .my-indicators-table tbody, .my-indicators-table tr { display: block; width: 100%; }
  .my-indicators-table tr { overflow: hidden; border: 1px solid var(--border); border-radius: 6px; background: white; }
  .my-indicators-table td { display: grid; grid-template-columns: minmax(88px, .42fr) minmax(0, 1fr); gap: 8px; width: auto; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--border); text-align: right; overflow-wrap: anywhere; }
  .my-indicators-table td:last-child { border-bottom: 0; }
  .my-indicators-table td::before { content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 700; text-align: left; }
  .my-indicators-table td[colspan] { display: block; text-align: center; }
  .my-indicators-table td[colspan]::before { display: none; }
  .analytics-summary.compact, .analytics-two-columns { grid-template-columns: 1fr; }
  .analytics-metric { padding: 11px; border-bottom: 1px solid var(--border); }
  .analytics-metric:first-child { padding-left: 11px; }
  .analytics-metric:nth-child(2n) { border-right: 0; }
  .analytics-details { grid-template-columns: 1fr; }
  .master-payment-table { min-width: 0; border-collapse: separate; border-spacing: 0 8px; border: 0; }
  .master-payment-table thead { display: none; }
  .master-payment-table tbody, .master-payment-table tr, .master-payment-table td { display: block; width: 100%; }
  .master-payment-table tr { overflow: hidden; border: 1px solid var(--border); border-radius: 5px; background: white; }
  .master-payment-table td { display: grid; grid-template-columns: 95px minmax(0, 1fr); gap: 10px; padding: 8px 10px; text-align: right; }
  .master-payment-table td::before { content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 700; text-align: left; }
  .master-payment-table td:first-child { text-align: left; font-weight: 700; }
  .price-toolbar input { width: 100%; }
  .price-tabs { overflow-x: auto; }
  .metal-toolbar { grid-template-columns: 1fr 1fr; }
  .metal-toolbar .button { width: 100%; }
  .metal-summary { grid-template-columns: 1fr 1fr; }
  .metal-summary-group { padding: 11px; border-bottom: 1px solid var(--border); }
  .metal-summary-group:first-child { padding-left: 11px; }
  .metal-summary-group:nth-child(2n) { border-right: 0; }
  .metal-movement-form { grid-template-columns: 1fr 1fr; }
  .metal-sale-fields { grid-template-columns: 1fr 1fr; }
  .metal-sale-total { grid-column: 1 / -1; }
  .metal-movement-form .metal-note-field { grid-column: 1 / -1; }
  .metal-movement-form .button { grid-column: 1 / -1; }
  .communications-workspace { padding: 10px; }
  .communications-channel-state { min-width: 145px; padding: 6px 8px; }
  .communications-layout { display: flex; flex-direction: column; min-height: 0; overflow: visible; border: 0; margin-top: 10px; }
  .communications-applications-layout { display: flex; flex-direction: column; min-height: 0; overflow: visible; border: 0; }
  .communications-applications-list-panel { max-height: 32svh; min-height: 160px; overflow: hidden; border: 1px solid var(--border); border-radius: 5px; }
  .communications-application-card { margin-top: 10px; min-height: 45svh; border: 1px solid var(--border); border-radius: 5px; }
  .communications-inbox { min-height: 220px; max-height: 38svh; border: 1px solid var(--border); border-radius: 5px; }
  .communications-dialog { min-height: 42svh; margin-top: 10px; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
  .communications-context { margin-top: 10px; border: 1px solid var(--border); border-radius: 5px; }
  .communications-layout:not(.mobile-dialog-open) .communications-inbox { max-height: calc(100svh - 250px); min-height: 52svh; }
  .communications-layout:not(.mobile-dialog-open) .communications-dialog,
  .communications-layout:not(.mobile-dialog-open) .communications-context { display: none; }
  .communications-layout.mobile-dialog-open .communications-inbox { display: none; }
  .communications-layout.mobile-dialog-open .communications-dialog { min-height: calc(100svh - 255px); margin-top: 0; }
  .communications-details-toggle:not(.hidden) { display: inline-flex; align-items: center; flex: none; min-height: 30px; margin-right: 5px; padding: 4px 7px; border: 1px solid #cbd7e4; border-radius: 5px; color: #185a9d; background: #fff; font-size: 9px; font-weight: 700; }
  .communications-layout.mobile-details-open .communications-dialog { min-height: 0; }
  .communications-layout.mobile-details-open .communications-messages,
  .communications-layout.mobile-details-open .communications-composer,
  .communications-layout.mobile-details-open .communications-history-notice { display: none; }
  .communications-layout.mobile-details-open .communications-context { max-height: calc(100svh - 265px); margin-top: 0; overflow: auto; }
  .communications-back-to-list { display: inline-flex; align-items: center; justify-content: center; }
  .communications-mark-unread { max-width: 112px; font-size: 8px; }
  .communications-message { max-width: 92%; }
  .communications-audio { width: 100%; max-width: 250px; }
  .communications-context .button.wide { width: 100%; white-space: normal; min-height: 40px; }
  .modal { padding: 10px; }
  .operator-panel { width: 100%; max-height: 94svh; }
  .operator-body { max-height: calc(94svh - 68px); padding: 14px; }
}

@media (max-width: 640px) {
  body:has(.login-screen:not(.hidden)) { min-width: 0; }
  .login-screen { grid-template-columns: minmax(0, 1fr); min-height: 100svh; }
  .login-panel { min-width: 0; padding: 32px 24px; }
  .login-copy { max-width: none; margin-top: clamp(72px, 16vh, 130px); }
  .mobile-login .login-copy { margin-top: clamp(42px, 10vh, 86px); }
  .login-copy h1 { font-size: 30px; }
  .login-form { width: 100%; max-width: none; margin-top: 24px; }
  .mobile-login .login-form { margin-bottom: auto; }
  .login-context { display: none; }
  .modal { padding: 16px; }
  .workstation-pair-panel, .pairing-code-panel { width: 100%; max-width: 100%; }
  .workstation-pair-panel .client-lookup-form, .pairing-code-body { padding: 18px 16px; }
  .workstation-pair-panel .client-lookup-actions, .pairing-code-panel .client-lookup-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .workstation-pair-panel .client-lookup-actions .button, .pairing-code-panel .client-lookup-actions .button { width: 100%; min-width: 0; }
  .pairing-code-value { padding: 14px 10px; font-size: 26px; }
  .shift-close-reminder-panel { width: 100%; }
  .shift-close-reminder-body { padding: 20px 16px; }
  .shift-close-reminder-body h2 { font-size: 21px; }
  .shift-close-reminder-actions { display: grid; grid-template-columns: 1fr; }
  .shift-close-reminder-actions .button { width: 100%; min-width: 0; }
  .delete-order-panel .client-lookup-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .delete-order-panel .client-lookup-actions .button { width: 100%; min-width: 0; }
  .order-type-options { grid-template-columns: 1fr; }
  .order-type-option { min-height: 140px; }
  .settings-tabs { flex-direction: row; gap: 16px; overflow-x: auto; }
  .settings-tabs button { flex: 0 0 auto; white-space: nowrap; }
  .ai-provider-settings .location-admin-heading { flex-direction: column; align-items: stretch; gap: 12px; }
.ai-provider-settings #aiProviderStaffLink { height: auto; min-height: 44px; white-space: normal; }
.settings-header-actions { width: 100%; align-items: stretch; }
#settingsMoreMenu { width: 100%; }
.settings-more-list { position: static; margin-top: 8px; box-shadow: none; }
.owner-config-button { align-self: stretch; margin: 0; }
.communications-channel-state { gap: 10px; flex-wrap: wrap; }
#smsTemplateModal .modal-panel { width: 100%; max-height: calc(100svh - 32px); }
#smsTemplateModal .modal-body { padding: 18px 16px; }
#smsTemplateModal .modal-actions, #smsTemplateModal .sms-placeholder-buttons { display: grid; grid-template-columns: 1fr; }
#smsTemplateModal .button { width: 100%; min-width: 0; white-space: normal; }
  .location-hours-heading { display: grid; }
  .location-hours-heading .button { width: 100%; }
  .location-hours-grid { grid-template-columns: minmax(0, 1fr); }
  .access-section-heading { display: grid; gap: 10px; }
  .access-role-legend { justify-content: flex-start; }
  .create-user-form { grid-template-columns: 1fr; }
  .create-user-form > .button { width: 100%; justify-self: stretch; }
  .permission-matrix { grid-template-columns: 1fr; min-height: 0; }
  .employee-directory { border-right: 0; border-bottom: 1px solid var(--border); }
  .employee-directory-list { grid-auto-flow: column; grid-auto-columns: minmax(190px, 75vw); max-height: none; overflow-x: auto; overflow-y: hidden; }
  .employee-directory-item { border-right: 1px solid #e5e9ee; border-bottom: 0; }
  .employee-directory-item.active { box-shadow: inset 0 -3px var(--blue); }
  .employee-facts, .employee-settings-row, .employee-permission-groups, .employee-role-change, .employee-role-profile-form, .role-profile-checks { grid-template-columns: 1fr; }
  .security-form { grid-template-columns: 1fr; }
  .metal-policy-grid { grid-template-columns: 1fr; }
  .segmented-control { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metal-policy-picks .inline-check, .metal-policy-checks .inline-check { max-width: none; width: 100%; }
  .employee-editor-header { align-items: flex-start; }
  .employee-editor-actions { display: grid; grid-template-columns: 1fr; }
  .user-restore-controls { grid-template-columns: 1fr; }
  .employee-editor-actions .button { width: 100%; min-width: 0; white-space: normal; }
  .password-reset-panel { width: 100%; max-width: 100%; }
  .password-reset-body { padding: 18px 16px; }
  .password-reset-actions { display: grid; grid-template-columns: 1fr; }
  .password-reset-actions .button { width: 100%; min-width: 0; }
  .expense-type-form, .expense-type-row { grid-template-columns: 1fr; }
  .expense-type-actions { justify-content: stretch; }
  .expense-type-actions .button { width: 100%; }
  .metal-toolbar, .metal-movement-form { grid-template-columns: 1fr; }
  .metal-movement-form .metal-note-field, .metal-movement-form .button { grid-column: auto; }
  .physical-metal-form, .metal-settings-create-grid, .metal-setting-editor { grid-template-columns: 1fr; }
  .physical-metal-note { grid-column: auto; }
  .metal-setting-fixed { white-space: normal; }
  .metal-settings-card .metal-table { display: block; min-width: 0; }
  .metal-settings-card .metal-table thead { display: none; }
  .metal-settings-card .metal-table tbody,
  .metal-settings-card .metal-table tr,
  .metal-settings-card .metal-table td { display: block; width: 100%; }
  .metal-settings-card .metal-table tr { margin-bottom: 8px; overflow: hidden; border: 1px solid var(--border); border-radius: 5px; background: white; }
  .metal-settings-card .metal-table td { padding: 10px; border-bottom: 1px solid var(--border); }
  .metal-settings-card .metal-table td:last-child { border-bottom: 0; }
  .ai-provider-form { grid-template-columns: 1fr; }
  .metal-setting-editor .button { width: 100%; min-width: 0; }
  .metal-sale-fields { grid-template-columns: 1fr; }
  .metal-sale-total { grid-column: auto; }
  .manufacture-metal-intake { margin: 0 10px 10px; }
  .repair-residual-block { margin: 0 10px 10px; }
  .repair-residual-block header { align-items: flex-start; flex-direction: column; gap: 3px; }
  .repair-residual-payout, .repair-residual-note, .repair-residual-clean-basis { grid-column: 1 / -1; }
  .manufacture-metal-intake div, .order-metal-lot > header { align-items: flex-start; flex-direction: column; }
  .order-metal-payment-form { grid-template-columns: 1fr; align-items: stretch !important; }
  .order-metal-payment-form .historical-metal-fields { grid-template-columns: 1fr; }
  .order-metal-payment-row > div:first-child { flex-direction: row; align-items: center; }
  .order-metal-payment-admin-actions { grid-template-columns: 1fr; }
  .order-metal-current { grid-template-columns: 1fr; }
  .order-metal-current div { border-right: 0; border-bottom: 1px solid var(--border); }
  .order-metal-current div:last-child { border-bottom: 0; }
  .order-metal-action-form { grid-template-columns: 1fr; }
  .order-metal-action-form .button { grid-column: auto; width: 100%; }
  .communications-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .communications-heading-line { align-items: flex-start; flex-direction: column; gap: 4px; }
  .communications-channel-state { min-width: 124px; }
  .communications-filters { grid-template-columns: 1fr 1fr; }
  .communications-thread { grid-template-columns: minmax(0, 1fr); }
  .communications-thread em { width: fit-content; max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
  .communications-composer { grid-template-columns: minmax(0, 1fr) 36px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .metal-table-wrap:has(.metal-journal-table), .metal-table-wrap:has(.metal-balance-table) { overflow: visible; border: 0; }
  .metal-journal-table, .metal-balance-table { min-width: 0; border-collapse: separate; border-spacing: 0 8px; }
  .metal-journal-table thead, .metal-balance-table thead { display: none; }
  .metal-journal-table tbody, .metal-balance-table tbody,
  .metal-journal-table tr, .metal-balance-table tr,
  .metal-journal-table td, .metal-balance-table td { display: block; width: 100%; }
  .metal-journal-table tr, .metal-balance-table tr { overflow: hidden; border: 1px solid var(--border); border-radius: 5px; background: white; }
  .metal-journal-table td, .metal-balance-table td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
  .metal-journal-table td:last-child, .metal-balance-table td:last-child { border-bottom: 0; }
  .metal-journal-table td::before, .metal-balance-table td::before { content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 700; }
  .metal-journal-table td:empty, .metal-balance-table td:empty { display: none; }
  .metal-journal-table .button { width: 100%; }
}

@media print {
  @page { size: A4 portrait; margin: 7mm; }
  :root, html, body { background: white !important; }
  body { min-width: 0; }
  body > :not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; color: #000; font-family: Arial, sans-serif; }
  .print-sheet .receipt-paper { width: 100%; padding: 0; box-shadow: none; }
  .print-sheet .compact-receipt { min-height: 0; }
  .print-sheet .receipt-document { width: 100%; display: block; }
  .print-sheet .receipt-page { min-height: 283mm; padding: 0; break-after: page; page-break-after: always; }
  .print-sheet .receipt-page:last-child { break-after: auto; page-break-after: auto; }
  .print-sheet .receipt-page-number { top: 0; right: 0; }
  .print-sheet .receipt-header-columns .receipt-meta { grid-template-columns: 25mm 1fr; gap: 3px 4px; font-size: 11px; }
  .print-sheet .receipt-header-columns .receipt-meta > span { padding: 0; min-height: 15px; }
  .print-sheet .receipt-header-columns .receipt-meta > span:nth-last-child(-n + 4):nth-child(even) { max-width: 36mm; }
  .print-sheet .receipt-company { font-size: 11px; padding-top: 3px; }
  .print-sheet .receipt-company strong { font-size: inherit; }
  .print-sheet .receipt-company p { margin-top: 3mm; }
  .print-sheet .receipt-service-meta { font-size: 9px; margin: 1.5mm 0; }
  .print-sheet .receipt-half { min-height: 132mm; break-inside: avoid; page-break-inside: avoid; }
  .print-sheet .receipt-title { font-size: 17px; margin: 0 0 3mm; }
  .print-sheet .receipt-meta { grid-template-columns: 34mm 1fr; gap: 4px; font-size: 10px; }
  .print-sheet .receipt-table { margin-top: .7mm; font-size: 11px; table-layout: fixed; }
  .print-sheet .receipt-table th, .print-sheet .receipt-table td { padding: .2mm; }
  .print-sheet .receipt-table small { font-size: 9px; }
  .print-sheet .receipt-material-table thead { height: 22mm; }
  .print-sheet .receipt-table th { font-size: 9.5px; overflow-wrap: normal; }
  .print-sheet .receipt-blank-row td { height: 2.3mm; }
  .print-sheet .receipt-jwt-bottom { font-size: 11px; margin-top: .7mm; }
  .print-sheet .receipt-jwt-work-table { margin-top: 0; }
  .print-sheet .receipt-jwt-work-table thead { height: 7.5mm; }
  .print-sheet .receipt-jwt-totals, .print-sheet .receipt-jwt-notes p { font-size: 9px; }
  .print-sheet .receipt-work-total { font-size: 11px; }
  .print-sheet .receipt-weight-note { font-size: 8px; }
  .print-sheet .receipt-bottom-heading { min-height: 9mm; }
  .print-sheet .receipt-paid-summary { margin: 5mm 0 6mm; }
  .print-sheet .receipt-total { margin-top: 1.2mm; font-size: 11px; }
  .print-sheet .manufacture-receipt-totals { margin-top: 1.2mm; font-size: 11px; }
  .print-sheet .manufacture-receipt-totals strong { font-size: 11px; }
  .print-sheet .receipt-notes { margin-top: 1.2mm; font-size: 11px; }
  .print-sheet .receipt-sign { margin-top: 1.5mm; font-size: 11px; }
  .print-sheet .receipt-sign.employee-sign { margin-top: 1.5mm; }
  .print-sheet .receipt-half + .receipt-half { margin-top: 2mm; padding-top: 1mm; }
}
/* V122 visual layer: "Ювелирная мастерская". No layout or business-flow changes. */
@media screen {
  :root {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #20303d;
    background: #fcfbf8;
    --border: #e4e5e1;
    --muted: #74818b;
    --blue: #29495a;
    --blue-soft: #edf2f2;
    --green: #287759;
    --green-soft: #e9f3eb;
    --orange: #936426;
    --orange-soft: #f6efe1;
    --red: #a64d49;
    --red-soft: #f8eeeb;
  }

  body, .app { background: #fcfbf8; color: #20303d; }
  .app { grid-template-rows: 66px 1fr; }
  .topbar { background: #fff; border-color: #ecebe5; padding-inline: 22px; }
  .brand-lockup.compact { gap: 13px; }
  .brand-lockup.compact strong { color: #223743; font-size: 16px; letter-spacing: .025em; }
  .brand-mark { border-color: #29495a; color: #29495a; }
  .point-chip { background: #f4f6f3; border-radius: 8px; color: #42565e; }
  .topbar-actions { gap: 15px; }
  .network-state, .user-menu { font-size: 12px; }
  .operator-count { border-radius: 6px; }

  .primary-nav { background: #253b4b; border-color: #253b4b; padding-top: 17px; gap: 7px; }
  .primary-nav-button { border-radius: 9px; color: #bdcad2; font-weight: 600; }
  .primary-nav-button:hover { background: #334d5e; }
  .primary-nav-button.active { background: #3b5565; border-color: transparent; color: #fff; }

  .orders-panel { background: #faf9f6; border-color: #e9e7e1; }
  .panel-title-row h2 { color: #263e4b; font-size: 21px; letter-spacing: -.035em; }
  .eyebrow { color: #8b8277; letter-spacing: .09em; }
  .tabs, .section-tabs, .settings-tabs { border-color: #e7e4dd; }
  .tab.active, .section-tabs button.active, .settings-tabs button.active { color: #29495a; border-color: #29495a; }
  .order-type-tabs { background: #f0f0eb; border-color: #e3e4df; border-radius: 9px; }
  .order-type-tabs button { border-radius: 6px; }
  .order-type-tabs button.active { background: #fff; color: #29495a; box-shadow: 0 1px 5px #253b4b12; }
  .density-control { border-color: #dadfdd; border-radius: 7px; }
  .density-button.active { color: #29495a; background: #e9efed; }
  .order-list-item { border-bottom-color: #e8e8e3; }
  .order-list-item:hover { background: #f3f1eb; }
  .order-list-item.selected { background: #f0ede5; border-color: #d4c9b8; }
  .orders-list.large .order-list-item { border-color: #e6e5df; border-radius: 8px; }
  .orders-list.large .order-list-item.selected { border-color: #c5b9a8; }
  .order-code { color: #29495a; }
  .order-client { color: #283b43; }
  .order-type-mark.repair { color: #795e38; border-color: #e7d8bd; background: #f7f0e4; }
  .order-type-mark.manufacture { color: #366772; border-color: #cde0e0; background: #eaf4f1; }
  .status-badge { background: #efefec; color: #52626a; border-radius: 5px; }
  .status-badge.work { color: #38566b; background: #eaf0f1; }

  .order-workspace,
  .schedule-workspace, .price-workspace, .settings-workspace, .analytics-workspace,
  .payroll-workspace, .metal-workspace, .communications-workspace,
  .client-directory-workspace { background: #fcfbf8; }
  .order-workspace { padding-inline: 21px; }
  .order-header h1 { color: #223743; font-size: 24px; letter-spacing: -.04em; }
  .section-tabs button { color: #62717b; }
  .form-section { border-color: #e7e4dd; }
  .form-section h3, .section-heading h3 { color: #263b45; }
  .form-actions { background: #fcfbf8; border-color: #e7e4dd; }
  .item-card { border-color: #e3e3dc; border-radius: 10px; box-shadow: 0 3px 14px #20303d08; }
  .item-card-header { background: #f6f5f1; border-color: #e8e6df; }
  .order-payment-summary { background: #f7f6f2; border-radius: 9px; }
  .order-payment-row { border-color: #e5e5df; border-radius: 8px; }

  .button { border-radius: 7px; }
  .button.primary { background: #29495a; }
  .button.primary:hover { background: #1f3c4d; }
  .button.secondary { background: #fff; color: #29495a; border-color: #d4dbd9; }
  .button.secondary:hover { background: #f4f5f1; }
  .icon-button { color: #566b75; border-radius: 7px; }
  .icon-button:hover { background: #f3f4ef; }
  input, select, textarea { background: #fff; color: #25343b; border-color: #d4dbd9; border-radius: 7px; }
  input:focus, select:focus, textarea:focus { border-color: #486e7d; box-shadow: 0 0 0 2px #29495a24; }
  label { color: #44535d; }
  :is(button, a, summary, input, select, textarea):focus-visible { outline: 2px solid #486e7d; outline-offset: 2px; }

  .login-screen { background: #fcfbf8; }
  .login-panel { background: #fcfbf8; }
  .login-context { background: #253b4b; }
  .context-visual { border-radius: 12px; }
  .login-copy h1 { color: #263e4b; letter-spacing: -.04em; }

  .schedule-header h1, .price-header h1, .settings-header h1,
  .analytics-header h1, .payroll-header h1, .metal-header h1,
  .communications-header h1, .client-directory-header h1 { color: #263e4b; letter-spacing: -.04em; }
  .price-table th, .metal-table th { background: #f1f1eb; color: #5c6d75; }
  .price-table .price-category-row th { background: #e9eeec; color: #29495a; }
  .price-tabs button.active { color: #29495a; background: #eaf0ee; }
}

@media screen and (max-width: 760px) {
  .app { grid-template-rows: 58px 1fr; }
  .topbar { padding-inline: 10px; }
  .primary-nav { background: #253b4b; border-color: #253b4b; padding-top: 0; }
  .primary-nav-button.active { background: #3b5565; }
  .order-workspace { padding-inline: 12px; }
}

.master-assistant-status {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.master-assistant-findings {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.master-assistant-finding {
  width: 100%;
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #fff;
  color: #17202a;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  text-align: left;
}

.master-assistant-finding strong,
.master-assistant-finding span {
  overflow-wrap: anywhere;
}

.master-assistant-finding.ok {
  border-left-color: var(--green);
}

.master-assistant-finding.recommendation { border-left-color: var(--orange); }
.master-assistant-finding.critical { border-left-color: var(--red); }
.master-assistant-finding.ai { border-left-color: var(--blue); background: #f7fbff; }
.master-assistant-empty,
.master-assistant-obsolete,
.master-assistant-error {
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  padding: 9px 11px;
}
.master-assistant-error { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.master-assistant-ai { display: grid; gap: 8px; margin-top: 8px; }
.master-assistant-ai > span { color: var(--muted); font-size: .86rem; }

.communications-composer { position: relative; }
.communications-composer:has(> .communications-assistant-suggest:not(.hidden)) {
  grid-template-columns: auto minmax(0, 1fr) 38px;
}
.communications-composer > textarea { min-width: 0; width: 100%; }
.communications-assistant-suggest {
  align-self: end;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-weight: 700;
  padding: 9px 12px;
}
.communications-assistant-composer-notice,
.communications-assistant-auto-offer {
  grid-column: 1 / -1;
  margin: 0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: .9rem;
}
.communications-assistant-composer-notice { background: var(--orange-soft); color: var(--orange); }
.communications-assistant-auto-offer {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  background: #eef6ff;
  color: #244b72;
  border: 1px solid #cfe3f7;
}
.communications-assistant-mini {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  padding: 11px 15px;
  box-shadow: 0 8px 24px rgba(21, 45, 66, .18);
}
.communications-assistant-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  justify-items: end;
  pointer-events: none;
}
.communications-assistant-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(17, 24, 39, .18);
  pointer-events: auto;
}
.communications-assistant-drawer {
  position: relative;
  pointer-events: auto;
  width: min(420px, calc(100vw - 28px));
  height: min(720px, calc(100vh - 28px));
  margin: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(23, 32, 42, .22);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}
.communications-assistant-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding: 12px;
}
.communications-assistant-handle { display: none; }
.communications-assistant-drawer { grid-template-rows: auto minmax(0, 1fr); }
.communications-assistant-drawer-header div { display: grid; gap: 2px; min-width: 0; }
.communications-assistant-drawer-header span { color: var(--muted); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.communications-assistant {
  overflow: auto;
  padding: 12px;
  display: grid;
  gap: 12px;
  align-content: start;
}
.communications-assistant-controls,
.communications-assistant-result,
.communications-assistant-feedback,
.communications-assistant-empty {
  display: grid;
  gap: 10px;
}
.communications-assistant-controls label {
  display: grid;
  gap: 5px;
}
.communications-assistant-note {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.35;
}
.communications-assistant-note.attention,
.communications-assistant-result.blocked {
  color: var(--red);
  background: var(--red-soft);
  border-radius: 8px;
  padding: 9px;
}
.communications-assistant-warning {
  border-left: 4px solid var(--orange);
  background: var(--orange-soft);
  border-radius: 8px;
  padding: 9px 10px;
}
.communications-assistant-warning p,
.communications-assistant-proposal p { margin: 4px 0 0; overflow-wrap: anywhere; }
.communications-assistant-proposal {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}
.communications-assistant-feedback textarea,
.communications-assistant-feedback input { width: 100%; }
.communications-assistant-feedback button {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  padding: 8px 10px;
}
.communications-assistant-auto-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

@media screen and (max-width: 760px) {
  .communications-assistant-overlay {
    align-items: end;
    justify-items: stretch;
  }
  .communications-assistant-drawer {
    width: auto;
    height: min(76vh, 680px);
    margin: 0;
    border-radius: 14px 14px 0 0;
    grid-template-rows: auto auto minmax(0, 1fr);
  }
  .communications-assistant-handle {
    display: block;
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: var(--border);
    margin: 8px auto 0;
  }
  .communications-assistant-auto-offer {
    display: grid;
    grid-template-columns: 1fr auto auto;
  }
  .communications-composer > textarea { font-size: 16px; min-height: 44px; }
  .communications-assistant-suggest { font-size: 12px; padding: 10px 8px; min-height: 44px; }
}


/* Native modal keeps the receipt inert and traps keyboard focus while reviewing. */
.master-assistant-card {
  position: fixed;
  right: 24px;
  bottom: 100px;
  z-index: 15;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  max-width: calc(100vw - 32px);
}
.master-assistant-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #cad6d9;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 4px 18px #233c5020;
  color: #29495a;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.master-assistant-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.master-assistant-lamp {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid #7e8a91;
  background: #dfe6e4;
  box-shadow: 0 0 0 3px rgba(126, 138, 145, .10);
}
.master-assistant-toggle.lamp-critical .master-assistant-lamp {
  --master-lamp-glow: 0 0 0 5px rgba(217, 65, 53, .10), 0 0 18px rgba(217, 65, 53, .58);
  border-color: #a9362f;
  background: #d94135;
  box-shadow: 0 0 0 3px rgba(217, 65, 53, .16), 0 0 12px rgba(217, 65, 53, .42);
}
.master-assistant-toggle.lamp-attention .master-assistant-lamp {
  --master-lamp-glow: 0 0 0 5px rgba(217, 145, 36, .12), 0 0 18px rgba(217, 145, 36, .48);
  border-color: #a66b14;
  background: #d99124;
  box-shadow: 0 0 0 3px rgba(217, 145, 36, .16), 0 0 12px rgba(217, 145, 36, .34);
}
.master-assistant-toggle.lamp-clear .master-assistant-lamp {
  border-color: #4d8068;
  background: #78a892;
  box-shadow: 0 0 0 3px rgba(78, 128, 104, .12);
}
.master-assistant-toggle.lamp-unavailable .master-assistant-lamp {
  border-color: #7d8790;
  background: #c4ccd2;
  box-shadow: 0 0 0 3px rgba(125, 135, 144, .10);
}
.master-assistant-toggle.has-unread-findings .master-assistant-lamp {
  animation: masterAssistantLampPulse 2.4s ease-in-out infinite;
}
@keyframes masterAssistantLampPulse {
  0%, 100% { opacity: .72; }
  45% { opacity: 1; box-shadow: var(--master-lamp-glow, 0 0 0 5px rgba(126, 138, 145, .10), 0 0 18px rgba(126, 138, 145, .36)); }
}
@media (prefers-reduced-motion: reduce) {
  .master-assistant-toggle.has-unread-findings .master-assistant-lamp { animation: none; }
}
.master-assistant-toggle strong { font-weight: 600; }
.master-assistant-toggle.has-findings { background: #fffbf1; border-color: #d9bf83; }
.master-assistant-details {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  width: min(440px, calc(100vw - 32px));
  max-height: min(620px, var(--master-panel-height, 60dvh));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  border: 1px solid #cdd9dd;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 36px #233c5030;
}
.master-assistant-details > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.master-assistant-details > header button { min-width: 44px; min-height: 44px; }
.master-assistant-details > footer { display: grid; gap: 8px; padding-top: 12px; }
.master-assistant-details > footer span { font-size: 12px; color: var(--muted); }
.master-assistant-details .master-assistant-finding strong { font-size: 14px; }
.master-assistant-details .master-assistant-finding span { font-size: 14px; }
.master-assistant-details [data-master-assistant-check] { min-height: 44px; white-space: normal; }
@media screen and (max-width: 760px) {
  .master-assistant-card { right: 12px; max-width: calc(100vw - 24px); }
  .master-assistant-toggle { font-size: 13px; gap: 8px; }
  .master-assistant-details { width: min(440px, calc(100vw - 24px)); padding: 12px; }
}
@media print { .master-assistant-card, .master-save-review { display: none !important; } }

.master-save-review {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  border: 1px solid #d4dedf;
  border-radius: 18px;
  background: #fff;
  color: #253b4b;
  box-shadow: 0 20px 70px #12273340;
  overflow-y: auto;
  box-sizing: border-box;
}
.master-save-review::backdrop { background: #182e3d80; }
.master-save-review-header h2 { margin: 0 0 10px; font-size: 24px; }
.master-save-review-header p, .master-save-review-note { color: #65747d; line-height: 1.5; }
.master-save-review-list { padding: 0; margin: 20px 0; list-style: none; }
.master-save-review-list li { padding: 14px; margin: 10px 0; background: #f7f6f0; border-left: 3px solid #b58a40; border-radius: 6px; overflow-wrap: anywhere; }
.master-save-review-list strong, .master-save-review-list span { display: block; line-height: 1.45; }
.master-save-review-list span { margin-top: 5px; }
.master-save-review-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.master-save-review-actions .button { flex: 1 1 220px; min-width: 0; white-space: normal; font-size: 16px; padding: 13px; }
.master-save-review-note { font-size: 13px; margin: 14px 0 0; }
@media screen and (max-width: 480px) {
  .master-save-review { padding: 18px; width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
  .master-save-review-header h2 { font-size: 22px; }
  .master-save-review-list { font-size: 15px; }
}

/* Keep disclosure controls aligned with header actions and readable on narrow screens. */
.settings-header-actions { align-items: flex-start; }
.settings-more-menu > summary { min-height: 39px; }
.settings-more-list { max-width: calc(100vw - 32px); }
.settings-more-list .button { min-height: 39px; padding: 9px 12px; text-align: left; }
@media (prefers-reduced-motion: reduce) {
  .settings-more-menu summary::after { transition: none; }
}
@media screen and (max-width: 760px) {
  .settings-header { flex-direction: column; align-items: stretch; gap: 14px; }
  .settings-header-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .settings-header-actions > *, .settings-more-menu > summary { width: 100%; min-width: 0; }
  .settings-header-actions .button { min-height: 44px; padding: 10px 12px; white-space: normal; }
  .settings-more-list { width: 100%; min-width: 0; max-width: none; }
  .location-admin-heading { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 10px; }
  .location-admin-heading h2 { margin-bottom: 0; }
  .location-admin-heading > span { line-height: 1.45; }
  #smsTemplateModal .sms-placeholder-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Keep a standalone correction action compact on desktop and tappable on phones. */
.order-payment-admin-actions > .button:only-child,
.order-metal-payment-admin-actions > .button:only-child { grid-column: 1 / -1; justify-self: end; max-width: 100%; }
@media (max-width: 700px) {
  .order-payment-admin-actions > .button:only-child,
  .order-metal-payment-admin-actions > .button:only-child { width: 100%; min-height: 44px; }
}

/* SMS cancellation uses the existing order-history panel on desktop and mobile. */
.history-sms-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.history-sms-actions:empty { display: none; }
.history-sms-cancelled { background: #f0f6f3; border-color: #b8d4c5; }
.history-sms-queued, .history-sms-cancelling, .history-sms-cancel_uncertain { background: #fff8ec; border-color: #e4c78c; }

/* Loose-stone intake: distinct from metal/work, with readable printed copies. */
.order-type-option.stone { order: 3; border-color: #98b9c5; }
.stone-intake-fields { display:grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap:16px; padding:18px; }
.stone-intake-fields label { display:flex; flex-direction:column; gap:8px; min-width:0; }
.stone-intake-fields input,.stone-intake-fields select { width:100%; min-width:0; }
.stone-intake-note { margin:0; padding:0 18px 18px; color:#596c76; font-size:14px; line-height:1.5; }
.stone-receipt-meta { padding:3mm 0; line-height:1.55; }
.stone-receipt-table { table-layout:fixed; width:100%; }
.stone-receipt-table td,.stone-receipt-table th { overflow-wrap:anywhere; white-space:normal; padding:2mm; }
.stone-receipt-bottom { font-size:9pt; line-height:1.4; overflow-wrap:anywhere; }
.stone-receipt-signatures { display:flex; justify-content:space-between; gap:15mm; margin-top:5mm; }
@media (max-width:600px) { .stone-intake-fields { grid-template-columns:1fr; padding:12px; } .order-kind-filter { flex-wrap:wrap; } }

.order-type-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); }
.order-type-options { grid-template-columns:repeat(2,minmax(0,1fr)); }
.stone-receipt-table td,.stone-receipt-table th { font-size:9pt; line-height:1.35; }
@media (max-width:600px) { .order-type-options { grid-template-columns:1fr; } }

.manufacture-stone-fields { display:grid; grid-template-columns:2fr 1fr 1fr 1fr 2fr; gap:12px; padding:16px; border-top:1px solid #dde3e5; }
.manufacture-stone-fields label { display:flex; flex-direction:column; gap:8px; min-width:0; }
.manufacture-stone-fields input,.manufacture-stone-fields select { width:100%; min-width:0; }
@media (max-width:900px) { .manufacture-stone-fields { grid-template-columns:1fr 1fr; } }
@media (max-width:600px) { .manufacture-stone-fields { grid-template-columns:1fr; } }

/* Role workday only; existing editors and accounting forms retain their layout. */
.workday-workspace{grid-column:2/-1;min-width:0;min-height:0;overflow:auto;background:#fafbf9;padding:28px 30px;color:#2a414c}.wd-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:23px}.wd-heading h1{font-size:29px;margin:5px 0 8px;letter-spacing:-.6px}.wd-heading .eyebrow{font-size:10px;letter-spacing:1.5px}.wd-subtitle{font-size:12px;color:#7c8e95;line-height:1.5;margin:7px 0}.wd-heading-actions{display:flex;gap:10px;align-items:center}.workday-workspace .button{font-size:12px;min-height:38px;line-height:1.3;padding:10px 13px;white-space:normal}.wd-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:24px}.wd-metric{display:flex;justify-content:space-between;align-items:center;gap:12px;background:white;border:1px solid #dce4e1;border-radius:10px;text-align:left;color:inherit;min-height:92px;padding:18px}.wd-metric>span{font-size:13px;color:#58717c}.wd-metric small{display:block;margin-top:7px;font-size:11px;color:#879994;line-height:1.4}.wd-metric strong{font-size:29px}.wd-metric.wd-danger{background:#fff7f4;border-color:#ead0c8}.wd-danger strong,.wd-red{color:#b44b42!important}.wd-columns{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:20px}.wd-panel,.wd-sidecard{background:white;border:1px solid #dde5e0;border-radius:11px;min-width:0;overflow:hidden}.wd-panel>header{padding:21px}.wd-panel h2,.wd-sidecard h2,.wd-help h2{font-size:16px;margin:0}.wd-panel footer{padding:13px 20px;border-top:1px solid #e5ebe5}.wd-panel footer .button{border:0;color:#346375;background:transparent}.wd-tabs{display:flex;gap:18px;padding:0 20px;border-bottom:1px solid #e2e8e2;overflow:auto}.wd-tabs button{background:none;border:0;border-bottom:3px solid transparent;border-radius:0;padding:12px 0;color:#839294;white-space:nowrap;font-size:12px}.wd-tabs button.active{color:#355a69;border-bottom-color:#355a69;font-weight:700}.wd-order{display:grid;grid-template-columns:minmax(0,1fr) 90px auto;align-items:center;gap:12px;padding:18px 20px;border-bottom:1px solid #edf0ec;min-height:102px}.wd-order.wd-overdue{background:#fff7f4;border-left:3px solid #c46055;padding-left:17px}.wd-order strong{font-size:13px}.wd-order p{color:#617c88;font-size:12px;line-height:1.5;margin:7px 0;overflow-wrap:anywhere}.wd-order small{color:#899a9e;font-size:11px}.wd-due{font-size:12px;font-weight:600}.wd-due small{display:block;font-size:10px;margin-top:7px;font-weight:400}.wd-sidecard{padding:21px;margin-bottom:18px}.wd-sidecard>p,.wd-help>p{color:#809293;font-size:12px;line-height:1.6;margin:10px 0 16px}.wd-sidecard>.button{width:100%;margin-top:10px}.wd-sidecard>small{display:block;color:#7a9199;font-size:11px}.wd-balance{display:flex;justify-content:space-between;gap:12px;font-size:12px;line-height:1.6;margin:14px 0}.wd-balance strong{font-size:14px;white-space:nowrap}.wd-note{border-radius:7px;padding:12px;background:#f3f6f0;font-size:11px!important}.wd-shift{color:#397d66!important;font-weight:600}.wd-help{border:1px dashed #cfdbd8;padding:18px;border-radius:10px}.wd-help p{margin-bottom:0}.wd-empty,.wd-state{padding:26px;color:#6d858c;font-size:13px;line-height:1.6}.wd-message{padding:17px 20px;border-bottom:1px solid #e7ece7}.wd-message-head{display:flex;align-items:center;gap:9px;min-width:0}.wd-message-head strong{font-size:13px;overflow-wrap:anywhere}.wd-message-head>small{font-size:10px;color:#8b9b9e;margin-left:auto;white-space:nowrap}.wd-channel{color:#54829a;background:#edf5f8;border-radius:5px;padding:4px 7px;font-size:10px}.wd-channel.call{background:#edf5ed;color:#567e61}.wd-message>p{font-size:13px;line-height:1.55;color:#4c6875;margin:14px 0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.wd-message-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.wd-message-actions>small{font-size:11px;color:#91a0a3;margin-right:auto}.wd-message-actions .button{font-size:11px;padding:8px 11px;min-height:34px}.wd-task{padding:14px 0;border-top:1px solid #e4eae4}.wd-task strong{font-size:12px;display:block;overflow-wrap:anywhere;line-height:1.5}.wd-task small{display:block;color:#82969d;margin:8px 0}.wd-task>div{display:flex;gap:8px}.wd-task .button{font-size:11px;min-height:32px;padding:7px 10px}.wd-updated{font-size:10px;color:#839994;margin:18px 0}.wd-updated .button{font-size:10px!important;border:0;background:transparent;padding:3px!important;min-height:0!important}.wd-dialog{width:min(460px,calc(100vw - 24px));border:1px solid #d3dfdc;border-radius:12px;padding:26px;color:#2b4451;box-shadow:0 18px 80px #15303d30}.wd-dialog::backdrop{background:#1e354b66}.wd-dialog h2{font-size:21px;margin:0 0 20px}.wd-dialog label{display:flex;flex-direction:column;gap:8px;font-size:13px;margin:15px 0}.wd-dialog input{width:100%;padding:12px;border-radius:7px;border:1px solid #cfdbde;font:inherit}.wd-dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}.wd-error{color:#b44b42;font-size:12px}.wd-dialog-actions .button{font-size:13px;padding:10px 15px}#workdayMoreNav{color:#c3d0d5;margin-top:auto;font-size:10px;min-width:0}#workdayMoreNav summary{padding:14px 5px;cursor:pointer;list-style:none}#workdayMoreNav>div{display:flex;flex-direction:column;gap:5px}.workday-home .workspace{grid-template-columns:205px minmax(0,1fr)}.workday-home .primary-nav{padding:23px 13px;gap:7px;overflow:auto}.workday-home .primary-nav-button{display:flex;flex-direction:row;justify-content:flex-start;gap:13px;min-height:47px;padding:10px 12px;font-size:13px;font-weight:500;border-radius:8px}.workday-home .primary-nav-button.active{background:#3c5b6b;font-weight:650}.workday-home .primary-nav-icon{font-size:18px}.workday-home #workdayMoreNav summary{font-size:12px;padding:16px 12px}
@media(min-width:761px) and (max-width:1150px){.workday-home .workspace{grid-template-columns:170px minmax(0,1fr)}.workday-workspace{padding:21px 18px}.wd-columns{grid-template-columns:minmax(0,1fr) 240px}.wd-metric{padding:14px}.wd-heading h1{font-size:25px}.wd-message-head{flex-wrap:wrap}.wd-message-head>small{width:100%;margin:0}.wd-order{grid-template-columns:minmax(0,1fr) 76px}.wd-order>.button{grid-column:1/-1;justify-self:end}.wd-metric>span{font-size:12px}.workday-home .primary-nav-button{font-size:12px}}
@media(max-width:760px){.workday-home .workspace{display:block}.workday-workspace{position:absolute;inset:0 0 62px;padding:18px 12px;width:auto;overflow:auto}.wd-heading{display:block;margin-bottom:18px}.wd-heading h1{font-size:24px}.wd-heading-actions{justify-content:space-between;margin-top:15px}.wd-heading-actions>.primary{flex:1}.wd-metrics{grid-template-columns:1fr 1fr;gap:9px;margin-bottom:18px}.wd-metric{padding:13px;min-height:83px;gap:8px}.wd-metric strong{font-size:24px}.wd-metric>span{font-size:12px}.wd-metric small{font-size:10px}.wd-columns{grid-template-columns:1fr;gap:18px}.wd-columns>aside{display:grid;gap:14px}.wd-sidecard{margin:0;padding:18px}.wd-help{display:none}.wd-panel>header{padding:18px}.wd-order{grid-template-columns:minmax(0,1fr) 70px;gap:10px;padding:16px}.wd-order>.button{grid-column:1/-1;justify-self:end}.wd-order.wd-overdue{padding-left:13px}.wd-message{padding:17px 15px}.wd-message-head{flex-wrap:wrap}.wd-message-head>small{width:100%;margin:2px 0 0}.wd-message-actions>small{width:100%}.wd-message-actions .primary{margin-left:auto}.wd-tabs{gap:18px;padding:0 16px}.workday-home .primary-nav{padding:4px;gap:2px;overflow:auto;flex-direction:row}.workday-home .primary-nav-button{flex-direction:column;justify-content:center;min-height:52px;min-width:58px;gap:3px;padding:3px;font-size:8px;font-weight:650}.workday-home .primary-nav-icon{font-size:16px}#workdayMoreNav{flex:0 0 58px;margin:0;min-width:58px;align-self:center}#workdayMoreNav summary,.workday-home #workdayMoreNav summary{font-size:9px;line-height:1.4;max-width:58px;padding:7px;text-align:center}#workdayMoreNav[open]>div{position:fixed;z-index:100;bottom:70px;right:8px;background:#263f4f;border:1px solid #668291;box-shadow:0 8px 30px #142a4666;padding:12px;border-radius:10px;max-height:65vh;overflow:auto;min-width:160px}#workdayMoreNav[open]>div .primary-nav-button{flex-direction:row;min-height:42px;justify-content:flex-start;padding:9px;font-size:12px}}

/* Errors are visible independently of optional assistant recommendations. */
.order-validation-summary{margin:0 0 16px;padding:14px 17px;border:1px solid #edc9c3;border-left:3px solid #bf5147;border-radius:10px;background:#fff7f5;color:#8d3d34;display:grid;gap:7px;min-width:0;max-height:min(28vh,240px);overflow:auto;flex:0 0 auto}
.order-validation-summary.hidden{display:none}.order-validation-summary>strong{font-size:15px}.order-validation-hint{font-size:12px;line-height:1.5;color:#87645e}.order-error-links{display:flex;flex-wrap:wrap;gap:5px 18px}.order-error-links button{display:inline-flex;align-items:center;min-height:36px;padding:3px 0;border:0;background:none;color:#9f4037;text-decoration:underline;text-underline-offset:3px;font:inherit;font-size:13px;text-align:left;cursor:pointer}.order-error-links button:focus-visible{outline:2px solid #315665;outline-offset:3px;border-radius:3px}
#orderWorkspace .order-invalid{border-color:#ba5148!important;outline:2px solid #f4ded9;outline-offset:1px;background-color:#fff9f7!important;scroll-margin-block:120px}#orderWorkspace .order-invalid:focus{outline:2px solid #bf5147;outline-offset:2px}
.order-field-error{display:block;font-size:12px;font-weight:500;line-height:1.5;color:#a73f36;white-space:normal;margin:7px 0 0;grid-column:1/-1;overflow-wrap:anywhere}.order-field-error:before{content:'• ';font-weight:700}.order-error-count{display:inline-flex;justify-content:center;align-items:center;min-width:18px;height:18px;padding:0 5px;border-radius:20px;background:#f7e4df;color:#9c443a;font-size:10px;line-height:1;margin-left:6px}
.order-weight-help,.order-optional-help{display:block;font-size:11px;font-weight:400;line-height:1.55;color:#6d8089;margin-top:7px;white-space:normal}.order-optional-help{padding:8px 10px;background:#f3f6f6;border-left:2px solid #b7cacf;border-radius:4px}.order-optional-help[hidden]{display:none}
@media(max-width:760px){.order-validation-summary{margin:0 0 12px;padding:11px 12px}.order-validation-summary>strong{font-size:14px}.order-error-links{gap:2px 14px}.order-error-links button{min-height:44px;font-size:12px}.order-error-count{margin-left:4px}}
@media print{.order-validation-summary,.order-field-error,.order-error-count,.order-weight-help,.order-optional-help{display:none!important}}

.order-manager-followup{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:11px 14px;margin:12px 0 2px;border:1px solid #d8e5dc;border-radius:9px;background:#f0f6f1;flex:0 0 auto}.order-manager-followup.hidden{display:none}.order-manager-followup strong{font-size:12px;display:block;color:#365e4b}.order-manager-followup span{display:block;font-size:11px;color:#688273;line-height:1.5;margin-top:4px}.order-manager-followup button{flex:0 0 auto;min-height:40px;white-space:nowrap}
.of-tasks{background:white;border:1px solid #dfe6de;border-radius:12px;margin-bottom:24px;overflow:hidden}.of-tasks>header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:17px 20px}.of-tasks h2{font-size:18px;margin:0 0 6px}.of-tasks header p{font-size:12px;color:#718477;margin:0}.of-filters{display:flex;flex-wrap:wrap;gap:5px;padding:0 15px 13px;border-bottom:1px solid #e3e9e0}.of-filters button{border:0;border-radius:6px;background:transparent;padding:9px 10px;font:inherit;font-size:11px;color:#657b6e;cursor:pointer}.of-filters button.active{background:#edf4ee;color:#355c49}.of-filters b{font-size:10px;margin-left:4px}.of-task{margin:15px;border:1px solid #dce6dd;border-radius:9px;overflow:hidden;padding:16px 17px 0}.of-task-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.of-task-heading strong{font-size:14px}.of-phase{font-size:10px;color:#476e7d;background:#eaf1f5;border-radius:4px;padding:5px 8px;white-space:nowrap}.of-phase.attention{background:#fff2db;color:#89642e}.of-task p{font-size:12px;line-height:1.6;margin:10px 0}.of-task .of-meta{font-size:11px;color:#74877b}.of-notes{border-left:3px solid #b8cdbb;padding:10px 12px;background:#f4f7f1;border-radius:4px;margin:12px 0}.of-notes strong{display:block;font-size:11px;color:#58715f;margin-bottom:7px}.of-notes>div{white-space:pre-wrap;overflow-wrap:anywhere;max-height:160px;overflow:auto;font-size:12px;line-height:1.65;color:#3e5448}.of-facts{display:grid;gap:12px;font-size:11px;line-height:1.7;margin:14px 0;color:#657b6e}.of-facts b,.of-facts span{display:block}.of-facts b{color:#415d4b}.of-money{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border:1px solid #dce6dc;border-radius:7px;background:#f7faf4;overflow:hidden;margin-top:13px}.of-money>div{padding:12px 14px;border-right:1px solid #e0e8df}.of-money>div:last-child{border:0;background:#edf6ef}.of-money small{display:block;font-size:10px;color:#748b7a;margin-bottom:6px}.of-money b{font-size:18px}.of-task .of-phone{font-size:11px;color:#61806b}.of-task footer{display:flex;align-items:center;gap:9px;margin:12px -17px 0;padding:12px 16px;border-top:1px solid #e5ebe1;background:#fcfdf9}.of-task footer>span{font-size:10px;line-height:1.5;color:#7c8f80;margin-right:auto;max-width:260px}.of-task .of-warning{font-size:11px;padding:9px 12px;background:#fff7e9;border:1px solid #eed9b1;color:#8b672e;border-radius:5px}.of-tasks>[data-of-expand]{margin:0 15px 15px}
@media(max-width:760px){.order-manager-followup{align-items:stretch;flex-direction:column;padding:10px 12px;gap:9px}.order-manager-followup button{min-height:44px;width:100%}.order-manager-followup span{font-size:10px}.of-tasks>header{padding:14px;align-items:flex-start}.of-tasks h2{font-size:16px}.of-task{margin:10px;padding:13px 12px 0}.of-task-heading{align-items:flex-start;flex-direction:column;gap:8px}.of-task footer{margin:12px -12px 0;display:grid;grid-template-columns:1fr 1fr;padding:11px 12px}.of-task footer>span{grid-column:1/-1;max-width:none}.of-task footer button{padding:7px 9px;min-height:44px;font-size:10px;white-space:normal}.of-money>div{padding:10px 8px}.of-money b{font-size:15px}.of-money small{font-size:9px}.of-filters{padding:0 8px 10px}.of-filters button{min-height:40px;padding:8px}.of-notes>div{font-size:12px;max-height:180px}}
@media print{.order-manager-followup,.of-tasks{display:none!important}}

/* Existing Analytics: read-only manager handoff report. */
.followup-report .analytics-filters{display:flex;flex-wrap:wrap;align-items:end;gap:12px}.followup-report .analytics-filters>label{flex:1 1 160px;min-width:0}.followup-report .analytics-filters>button{flex:0 0 auto}.followup-report .analytics-summary{grid-template-columns:repeat(6,minmax(0,1fr))}.followup-report-groups,.followup-report-orders{min-width:950px}.followup-report .analytics-block{margin-top:18px}.followup-report-note{line-height:1.6}.followup-report-previous{display:block;color:#71818b;margin-top:4px}.followup-report-phase{display:inline-block;padding:4px 7px;border-radius:5px;background:#edf3f0;white-space:nowrap}.followup-report-phase.attention{background:#fff0d9;color:#815615}
@media(max-width:900px){.followup-report .analytics-summary{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:560px){.followup-report .analytics-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.followup-report .analytics-filters>button{width:100%}.followup-report .analytics-filters>label{flex-basis:calc(50% - 12px)}}
