:root {
  --ink: #203436;
  --muted: #647674;
  --line: #dce3df;
  --paper: #f5f5f1;
  --green: #1d6257;
  --green-soft: #e9f1ed;
  --amber: #8d662f;
  --amber-soft: #f7f0e2;
  --red: #a34c3e;
  --red-soft: #faebe7;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
.material-gallery { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); gap:12px; margin-top:12px; }
.material-photo { margin:0; min-width:0; }
.photo-preview { display:block; width:100%; padding:0; overflow:hidden; background:white; }
.photo-preview img { display:block; width:100%; height:160px; object-fit:contain; }
.material-photo figcaption { margin-top:5px; overflow-wrap:anywhere; }
.photo-dialog { width:min(1100px,96vw); max-height:94dvh; }
.otk-check { border:0; border-top:1px solid #e3e8ed; margin:18px 0; padding:12px 0 0; display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.otk-check legend { font-weight:600; font-size:14px; }
.otk-check[data-result="FAILED"] { border-color:#b13b36; }
.otk-evidence { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; }
@media(max-width:600px){.otk-check{grid-template-columns:1fr;}}
#photo-image { display:block; max-width:100%; max-height:75dvh; margin:auto; object-fit:contain; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-size: 1.2rem; line-height: 1.2; margin-bottom: 0; }
h2 { font-size: clamp(1.8rem, 2.5vw, 2.1rem); letter-spacing: -.045em; line-height: 1.18; margin-bottom: .45rem; font-weight: 730; }
h3 { font-size: 1.08rem; letter-spacing: -.02em; margin-bottom: .8rem; }
.muted { color: var(--muted); }
.small { font-size: .79rem; }
.eyebrow, .section-kicker {
  color: #87968d;
  font-size: .7rem;
  font-weight: 720;
  letter-spacing: .13em;
  text-transform: uppercase;
  margin-bottom: .55rem;
}
.error { color: var(--red); font-size: .84rem; margin: .55rem 0; min-height: 1.1rem; }
.notice { border: 1px solid #bad3c6; background: var(--green-soft); color: var(--green); border-radius: 7px; padding: .7rem .9rem; margin-bottom: 1rem; }

button {
  min-height: 40px;
  padding: .55rem .9rem;
  border: 1px solid #bbc9c1;
  border-radius: 7px;
  background: #fff;
  color: #25594f;
  font-weight: 650;
  transition: background .15s, border-color .15s;
}
button:hover { background: #f3f7f4; border-color: #a7bdb0; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #93c0ad;
  outline-offset: 2px;
}
.primary { background: var(--green); color: white; border-color: var(--green); }
.primary:hover { background: #154e45; border-color: #154e45; }
.danger { border-color: #e2b4a9; color: var(--red); }
.danger:hover { border-color: #d5998a; background: var(--red-soft); }
.ghost { background: transparent; }
.link-button { border: none; background: transparent; padding: .3rem 0; min-height: 32px; color: var(--green); }
.link-button:hover { background: transparent; color: #154e45; text-decoration: underline; }
.action-main { padding: .74rem 1.15rem; min-height: 44px; white-space: nowrap; }

label { display: grid; gap: .38rem; font-size: .81rem; font-weight: 650; color: #53675e; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cdd8d1;
  border-radius: 6px;
  padding: .62rem .75rem;
  color: #263d34;
  background: white;
}
input::placeholder { color: #96a69c; }
textarea { min-height: 6rem; resize: vertical; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--paper); }
.login-card { width: min(100%, 470px); padding: 2.2rem; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 18px 50px #203c3420; }
.login-card h1 { font-size: 2rem; margin-bottom: 1rem; }
.login-card p { line-height: 1.55; color: var(--muted); }
.login-card form { display: grid; gap: 1rem; margin: 1.4rem 0; }
.personal-login .login-shell { background:#f6f7f9; }
.personal-login .login-card { width:min(100%,390px); padding:32px; border-color:#e1e6eb; box-shadow:0 8px 28px #243e3908; }
.personal-login .login-card h1 { font-size:25px; letter-spacing:-.6px; margin:12px 0 8px; }
.personal-login .login-card p { font-size:14px; }
.personal-login .login-card input { min-height:46px; font-size:16px; }
.personal-login #login-password { letter-spacing:.3em; }
.personal-login #login-password::placeholder { letter-spacing:0; }
.personal-login .login-card button { min-height:46px; }
.personal-login #login-error:empty { display:none; }
#access-dialog { width:min(510px,95vw); }
#access-dialog p { font-size:14px; }
#access-link { font-size:13px; margin-bottom:15px; }

#app { max-width: 1520px; min-height: 100vh; margin: auto; background: #fff; box-shadow: 0 0 0 1px #e3e7e3; }
.topbar { min-height: 72px; padding: .75rem 2.5rem; display: flex; align-items: center; gap: 1.3rem; border-bottom: 1px solid var(--line); background: #fff; }
.brand { display: flex; align-items: center; flex: none; }
.topbar h1 { color: #143d39; font-size: 1.2rem; letter-spacing: -.04em; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; font-size: .79rem; color: #596d67; }
.top-actions .ghost { color: #536961; border-color: transparent; font-weight: 600; padding: .45rem .55rem; min-height: 36px; }
.top-actions .ghost:hover { background: #f3f7f4; }
.connection-status { display: inline-flex; align-items: center; gap: .4rem; color: #6b8076; font-size: .73rem; line-height: 1.35; white-space: nowrap; }
.connection-status::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #b7aa7e; }
.connection-status.connected::before { background: #5c9978; }
.connection-status.disconnected { color: var(--red); }
.connection-status.disconnected::before { background: var(--red); }
.tabs { display: flex; align-items: center; gap: .25rem; min-width: 0; white-space: nowrap; }
.tabs button { border: 0; border-radius: 7px; color: #526763; background: transparent; padding: .6rem .85rem; min-height: 40px; font-weight: 650; }
.tabs button:hover { background: #f3f7f4; color: var(--green); }
.tabs button.selected { background: var(--green-soft); color: #19584f; }

main { max-width: 1120px; margin: auto; padding: 2.5rem 2.5rem 5rem; }
.page { min-height: 65vh; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; margin-bottom: 1.8rem; }
.section-heading p { color: var(--muted); margin-bottom: 0; line-height: 1.45; font-size: .93rem; }
.refresh-time { font-size: .77rem; color: #8b9990; white-space: nowrap; margin-top: .4rem; }
.stats, .manager-stats { display: grid; gap: 0; margin-bottom: 2rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; overflow: hidden; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.manager-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat, .manager-stat { min-width: 0; padding: 1.15rem 1.25rem; border-right: 1px solid var(--line); background: #fff; }
.stat:last-child, .manager-stat:last-child { border-right: 0; }
.stat .num, .manager-stat strong { display: block; font-size: 1.55rem; font-weight: 720; letter-spacing: -.04em; line-height: 1.15; color: var(--ink); }
.stat .label, .manager-stat span { display: block; margin-top: .35rem; font-size: .79rem; color: #71837a; }

.board-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); grid-template-areas: "working waiting" "blocked waiting" "ready ready"; gap: 1.5rem 1.75rem; align-items: start; }
.board-grid > .board-column:nth-child(1) { grid-area: waiting; background: #fafbf9; }
.board-grid > .board-column:nth-child(2) { grid-area: working; }
.board-grid > .board-column:nth-child(3) { grid-area: blocked; }
.board-grid > .board-column:nth-child(4) { grid-area: ready; }
.board-column, .panel { min-width: 0; margin-bottom: 0; padding: 1.3rem; border: 1px solid var(--line); border-radius: 9px; background: white; }
.board-column h3 { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .35rem; }
.board-column h3 span { display: grid; place-items: center; min-width: 1.55rem; height: 1.55rem; padding: 0 .3rem; border-radius: 5px; background: #eef2ef; color: #4d6b5e; font-size: .77rem; }
.board-column > .small { margin: .4rem 0 1rem; }
.shipped-column { margin-top: 1.5rem; }
.review-column { border-color: #e0c7a7; background: #fffdf8; margin-bottom: 1.5rem; }
.review-item { padding: .8rem 0 0; }
.review-item + .review-item { border-top: 1px solid #ecdfcc; margin-top: 1rem; }
.review-item > strong { display: block; font-size: .95rem; }
.review-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin: .85rem 0; }
.review-link { padding: .75rem .85rem; border: 1px solid #e5e4d9; border-radius: 6px; background: #fff; overflow-wrap: anywhere; }
.review-link span { display: block; margin-bottom: .3rem; color: #87968d; font-size: .69rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.review-link strong { font-size: .8rem; font-weight: 650; }
.review-hint { margin: -.2rem 0 .7rem; color: #75634a; font-size: .78rem; }
.review-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.empty, .empty-state { color: #829187; font-size: .87rem; line-height: 1.5; padding: .85rem 0; }
.empty-state { padding: 2rem 1rem; text-align: center; border: 1px dashed #cbd8d1; border-radius: 7px; background: #fafbf9; }

.request-card { display: flex; flex-direction: column; margin-top: .7rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.request-card.blocked { border-color: #e8cec8; }
.card-top, .card-heading { display: flex; align-items: flex-start; gap: .72rem; }
.card-top { justify-content: space-between; }
.queue-number { flex: none; width: 2.65rem; height: 2.65rem; display: grid; place-items: center; border-radius: 7px; background: var(--amber-soft); color: var(--amber); font-size: 1.2rem; font-weight: 730; }
.card-identifier { font-size: .74rem; color: #7f9087; margin-bottom: .2rem; }
.card-customer { display: block; font-size: 1rem; line-height: 1.3; color: var(--ink); letter-spacing: -.01em; }
.tag { display: inline-flex; align-items: center; gap: .4rem; flex: none; padding: .28rem .58rem; border-radius: 5px; background: #eef2ef; color: #4d6b5e; font-size: .71rem; line-height: 1.3; font-weight: 690; white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.warn { background: var(--amber-soft); color: var(--amber); }
.tag.bad { background: var(--red-soft); color: var(--red); }
.tag.good { background: var(--green-soft); color: var(--green); }
.next-action { order: 5; margin-top: .85rem; padding: .8rem 0 0; border-top: 1px solid #edf0ed; color: #3e6a5d; font-size: .8rem; font-weight: 650; line-height: 1.4; }
.next-action.queue { color: var(--amber); }
.next-action.blocked { color: var(--red); }
.next-action.ready { color: var(--green); }
.card-meta { display: flex; flex-wrap: wrap; gap: .25rem .8rem; margin-top: .6rem; color: #77887f; font-size: .74rem; line-height: 1.5; }
.queue-note { margin-top: .5rem; color: var(--amber); font-size: .75rem; }
.card-items { display: grid; gap: .45rem; margin-top: .7rem; }
.item-summary { display: grid; gap: .18rem; padding: .65rem .75rem; border: 1px solid #e8ede8; border-radius: 6px; background: #fafbf9; font-size: .79rem; line-height: 1.4; }
.item-summary strong { color: #30443b; }
.item-state { color: #3e6a5d; font-weight: 650; }
.item-state.bad { color: var(--red); }
.item-state.good { color: var(--green); }
.card-updated { margin-top: .65rem; color: #91a096; font-size: .71rem; }
.card-actions { order: 6; display: flex; align-items: center; justify-content: flex-end; gap: .7rem; margin-top: .6rem; }
.card-actions button { min-height: 32px; font-size: .75rem; }

.cabinet-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 1.75rem; align-items: start; }
.request-panel { padding: 0; border: 0; background: transparent; }
.events-panel { padding: 1.3rem; background: #fafbf9; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: .95rem; }
.panel-heading h3 { margin: 0; }
.my-request { margin-bottom: .7rem; padding: 1.25rem 1.3rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.my-request:last-child { margin-bottom: 0; }
.my-request-top, .my-request-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.my-request-foot { flex-wrap: wrap; }
.my-request-title { font-size: 1.08rem; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.my-request-status { margin-top: .65rem; color: #3e6a5d; font-size: .84rem; font-weight: 650; }
.my-request-status.attention { color: var(--amber); }
.my-request-spec { margin-top: .35rem; color: #50645c; font-size: .86rem; line-height: 1.5; }
.my-request-foot { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid #edf0ed; }
.my-request-foot .link-button { font-size: .76rem; white-space: nowrap; }
.small-action { min-height: 32px; padding: .3rem .55rem; color: var(--amber); border-color: #e2c99d; background: #fff9ee; font-size: .73rem; }
.notification { border-top: 1px solid #e8ede8; padding: .9rem 0; font-size: .82rem; line-height: 1.5; color: #4d6159; }
.notification:first-child { border-top: 0; }
.notification time { display: block; margin-bottom: .2rem; color: #93a096; font-size: .72rem; }
.notification button { margin-top: .55rem; font-size: .74rem; }
.panel form { display: grid; gap: 1rem; }

.bot-shell { width: min(100%, 800px); overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: white; }
.chat-log { display: flex; flex-direction: column; gap: .65rem; min-height: 260px; max-height: 58vh; overflow: auto; padding: 1.1rem; background: #fafbf9; }
.bubble { max-width: 86%; padding: .7rem .85rem; border-radius: 8px; white-space: pre-wrap; line-height: 1.45; font-size: .85rem; }
.bubble.bot { align-self: flex-start; background: #ebf1ec; }
.bubble.user { align-self: flex-end; background: #dbece3; }
.chat-buttons { display: flex; flex-wrap: wrap; gap: .45rem; max-height: 170px; overflow: auto; padding: .8rem 1rem; }
#chat-form { display: flex; gap: .5rem; padding: .8rem; border-top: 1px solid var(--line); }
#chat-form input { flex: 1; }
#chat-form button { flex: none; }
.worker-shell { max-width: 620px; }
.worker-shell .chat-log { min-height: 0; max-height: none; background: white; }
.worker-shell .bubble { max-width: 100%; padding: 0; background: transparent; }
.worker-shell .chat-buttons { max-height: none; border-top: 1px solid var(--line); }
.worker-shell .chat-buttons button { min-height: 44px; }
.worker-shell .chat-buttons .primary { flex: 1 0 100%; }
.worker-card h3 { margin: 0; font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.worker-subtitle { margin: .2rem 0; color: #59675f; font-size: .85rem; }
.worker-checks { padding: 0; margin: .9rem 0; list-style: none; }
.worker-checks li { display: flex; align-items: center; gap: .65rem; min-height: 44px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.worker-mark { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 21px; height: 21px; border: 1px solid #85998c; border-radius: 4px; color: #fff; }
.worker-checks .done .worker-mark { background: #286448; border-color: #286448; }
.worker-status { font-weight: 600; font-size: .9rem; margin: .7rem 0; }
.worker-detail { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.6; font-size: .85rem; margin-bottom: 0; }
.worker-notice { color: #286448; font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

dialog { width: min(820px, calc(100% - 2rem)); max-height: 88vh; overflow: auto; border: 0; border-radius: 10px; padding: 1.5rem; background: white; box-shadow: 0 25px 75px #102c2a3d; }
dialog::backdrop { background: #1a302d96; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .7rem; margin-bottom: .8rem; }
.dialog-head h2 { margin-bottom: 0; }
.wizard-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; margin: 1.25rem 0 1.6rem; }
.wizard-progress span { padding: .55rem .5rem .7rem; border-bottom: 2px solid #d5ddd7; color: #81918b; font-size: .78rem; font-weight: 650; }
.wizard-progress span.current { border-bottom-color: var(--green); color: var(--green); }
.wizard-progress span.complete { border-bottom-color: #69ab88; color: #3a8061; }
.wizard-step h3 { font-size: 1.2rem; margin-bottom: .25rem; }
.wizard-step > p { font-size: .84rem; line-height: 1.45; margin-bottom: 1.25rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-bottom: .9rem; }
#item-fields { display: grid; gap: .8rem; }
.item-entry { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; align-items: start; padding: 1.1rem; border: 1px solid #d6e2dc; border-radius: 10px; background: #fbfcfa; }
.item-entry-heading { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-bottom: .55rem; border-bottom: 1px solid #e8eeea; }
.item-entry-title { font-size: 1rem; color: #234e43; }
.item-entry .ghost { font-size: .75rem; min-height: 32px; padding: .3rem .6rem; }
.item-entry label input[hidden] { display: none; }
.item-entry label input:not([hidden]) { margin-top: .4rem; }
.add-item { margin-top: .9rem; border-style: dashed; width: 100%; padding: .8rem; background: #f8fbf9; }
.item-count { margin: .4rem 0 0; text-align: right; color: var(--muted); font-size: .78rem; }
.request-summary { display: grid; gap: .45rem; margin: 1.1rem 0; padding: 1rem 1.1rem; border: 1px solid #d6e2dc; border-radius: 10px; background: #fbfcfa; font-size: .84rem; line-height: 1.5; }
.request-summary strong { font-size: .88rem; }
.request-summary .summary-item { padding-top: .35rem; border-top: 1px solid #e1eae5; color: #315e5c; }
.summary-warning { color: #91651c; font-weight: 700; }
.checkbox { display: flex; align-items: flex-start; gap: .55rem; line-height: 1.45; }
.checkbox input { width: auto; min-height: 0; margin-top: .2rem; }
.wizard-actions { display: flex; align-items: center; gap: .65rem; position: sticky; bottom: -1.5rem; margin: 1.2rem -1.5rem -1.5rem; padding: .9rem 1.5rem; border-top: 1px solid #e2eae5; background: white; }
.wizard-spacer { flex: 1; }
.wizard-actions button { min-width: 130px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.detail-grid div { padding: .7rem; border: 1px solid #e4ece9; border-radius: 8px; background: #f8faf8; font-size: .8rem; line-height: 1.5; }
.detail-grid .detail-label { display: block; color: #7b908f; font-size: .72rem; margin-bottom: .2rem; }
.detail-grid strong { font-weight: 740; overflow-wrap: anywhere; }
.detail-item { margin: .5rem 0 .9rem; padding: .85rem; border: 1px solid #e2eae6; border-radius: 10px; background: #f9fbf9; }
.detail-item-heading { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.detail-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; margin: .75rem 0; }
.detail-step { display: grid; gap: .15rem; padding: .5rem; border-radius: 7px; background: #edf1ef; color: #6a7e7d; font-size: .7rem; }
.detail-step strong { font-size: .74rem; }
.detail-step.done { background: #e4f2e9; color: #327253; }
.detail-step.failed { background: #fbe9e4; color: #a94f41; }
.event { margin: 0 0 0 .2rem; padding: .45rem .8rem; border-left: 2px solid #b9d6cd; font-size: .8rem; line-height: 1.4; }
.event time { color: #7c9293; margin-right: .5rem; }

@media (max-width: 1220px) {
  .topbar { flex-wrap: wrap; padding: .85rem 1.7rem; gap: .55rem 1.2rem; }
  .tabs { order: 3; flex: 1 1 100%; }
}
@media (max-width: 980px) {
  .board-grid { grid-template-columns: 1fr; grid-template-areas: "working" "waiting" "blocked" "ready"; }
  .cabinet-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .topbar { padding: .8rem 1rem; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; gap: .15rem .35rem; }
  #current-user { display: block; flex: 1 1 100%; color: #647674; font-size: .73rem; }
  .connection-status { white-space: normal; }
  button, input, select, .link-button, .card-actions button, .small-action, .notification button, .chat-buttons button, .item-entry .ghost { min-height: 44px; }
  .checkbox { min-height: 44px; }
  .tabs { gap: .15rem; overflow-x: auto; }
  .tabs button { flex: 0 0 auto; padding: .7rem .65rem; font-size: .81rem; line-height: 1.18; text-align: center; }
  main { padding: 1.6rem 1rem 4rem; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; }
  .manager-heading .action-main { width: 100%; }
  .manager-stats, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(2), .manager-stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2), .manager-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .form-row, .item-entry, .detail-grid { grid-template-columns: 1fr; }
  .review-links { grid-template-columns: 1fr; }
  .detail-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item-entry-heading { grid-column: 1; }
  .card-top, .my-request-top, .my-request-foot { align-items: flex-start; }
  dialog { width: 100vw; max-width: none; height: 100dvh; max-height: 100dvh; min-height: 100dvh; margin: 0; inset: 0; border-radius: 0; padding: 1rem; }
  .request-dialog[open] { display: flex; flex-direction: column; }
  #request-form { display: flex; flex: 1; flex-direction: column; }
  .wizard-step:not([hidden]) { flex: 1; }
  .wizard-step[data-step="2"]:not([hidden]) { padding-bottom: 6rem; }
  .wizard-actions { bottom: -1rem; margin: auto -1rem -1rem; padding: .8rem 1rem; }
}
@media (max-width: 440px) {
  .topbar h1 { font-size: 1.06rem; }
  .top-actions { width: 100%; margin-left: 0; justify-content: flex-end; }
  .top-actions .connection-status { flex: 1 1 auto; }
  .top-actions .ghost { padding: .35rem .4rem; font-size: .73rem; }
  .stat, .manager-stat { padding: .8rem; }
  .card-top, .my-request-top { flex-wrap: wrap; }
  .card-actions { justify-content: space-between; }
  .wizard-progress span { font-size: .67rem; padding: .5rem .15rem; }
}

.work-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin: .7rem 0; }
.work-meta-field { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.work-meta-field strong { font-size: .8rem; overflow-wrap: anywhere; }
.manager-actions { margin-bottom: 1rem; border-left: 4px solid var(--teal, #28766b); }
#manager-action-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.manager-action { text-align: left; white-space: normal; }
.service-note { margin: .6rem 0; color: var(--red); font-size: .85rem; overflow-wrap: anywhere; }
@media (max-width: 420px) { .work-meta { grid-template-columns: 1fr; } }

/* Service workspace: a compact queue, with secondary actions on demand. */
.stage-strip { display:flex; gap:6px; flex-wrap:wrap; margin:8px 0; font-size:12px; }
.stage-strip span { padding:3px 7px; border-radius:5px; }
.stage-done { color:#16614f; background:#eaf5ef; }
.stage-pending { color:#697480; background:#f1f3f5; }
.service-workspace #app { background:#f6f7f9; box-shadow:none; }
.service-workspace { background:#f6f7f9; color:#202a36; }
.service-workspace .topbar { min-height:68px; padding:12px 28px; box-shadow:none; border-bottom:1px solid #e6e9ee; gap:24px; }
.service-workspace .brand h1 { font-size:16px; letter-spacing:-.4px; color:#253830; white-space:nowrap; }
.service-workspace .tabs { gap:4px; }
.service-workspace .tabs button { padding:9px 12px; font-size:13px; border-radius:6px; }
.service-workspace .top-actions { gap:12px; }
.service-workspace #current-user { max-width:170px; font-size:12px; line-height:1.4; color:#677280; }
.service-workspace .connection-status { font-size:0; }
.service-workspace .connection-status:before { width:7px; height:7px; margin:0; }
.service-workspace .connection-status.disconnected { font-size:12px; max-width:180px; }
.service-workspace #pilot-report-link { font-size:12px; background:transparent; padding:0; color:#697586; text-decoration:none; white-space:nowrap; }
.service-workspace #refresh-board,.service-workspace #logout { font-size:12px; padding:6px 8px; min-height:32px; border:0; }
.service-workspace main { width:min(1440px,100%); padding:32px 28px 60px; margin:0 auto; }
.service-workspace #page-error:empty { display:none; }
.service-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:0 0 26px; }
.service-eyebrow { font-size:10px; color:#788592; letter-spacing:.11em; font-weight:650; margin-bottom:8px; }
.service-heading h2 { font-size:26px; font-weight:700; letter-spacing:-.8px; line-height:1.3; margin:0; }
#service-team-count { font-size:11px; padding-left:5px; color:#7c8794; }
.service-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; }
.service-filters { display:flex; gap:5px; flex-wrap:wrap; }
.service-filter { border:1px solid transparent; color:#657180; background:transparent; font-size:12px; padding:7px 10px; min-height:34px; font-weight:500; display:flex; align-items:center; gap:7px; }
.service-filter:hover { background:#edf0f3; border-color:transparent; }
.service-filter[aria-pressed=true] { background:#243f3c; border-color:#243f3c; color:#fff; }
.filter-count { font-size:10px; font-weight:650; min-width:17px; line-height:17px; text-align:center; border-radius:4px; background:#e6eaee; color:#647181; }
.service-filter[aria-pressed=true] .filter-count { background:#ffffff24; color:white; }
.service-filter.has-overdue:not([aria-pressed=true]) .filter-count { background:#f8e9e6; color:#a55243; }
.service-stage-action { cursor:pointer; border:1px solid transparent; text-align:left; font:inherit; }
.service-stage-action:hover { border-color:currentColor; }
.service-stage-action:focus-visible { outline:2px solid #2d7064; outline-offset:3px; }
.service-stage-action:after { content:' ›'; }
.service-search-label { flex:0 1 290px; min-width:180px; }
.service-search-label input { font-size:12px; background:white; border:1px solid #dfe4e9; border-radius:7px; min-height:36px; padding:8px 11px; box-shadow:0 1px 2px #1e293b03; }
.service-table { border:1px solid #e0e5eb; border-radius:10px; background:white; box-shadow:0 2px 4px #253d3603; }
.service-table-head,.service-row { display:grid; grid-template-columns:165px minmax(300px,1fr) 155px 95px 36px; gap:18px; align-items:center; padding:16px 20px; }
.service-table-head { padding-top:12px; padding-bottom:12px; border-bottom:1px solid #e5e9ee; background:#fafbfc; border-radius:10px 10px 0 0; color:#84909d; font-size:11px; font-weight:600; }
.service-table-head>div,.service-unit { display:grid; grid-template-columns:minmax(150px,1fr) 145px; gap:14px; align-items:center; }
.service-row { border-bottom:1px solid #eef0f3; min-height:94px; transition:background .15s; }
.service-row:last-child { border-bottom:0; border-radius:0 0 10px 10px; }
.service-row:hover { background:#fcfdfd; }
.service-identity { display:grid; grid-template-columns:20px 1fr; align-items:center; column-gap:8px; min-width:0; }
.service-position { font-size:11px; color:#a5aeba; font-variant-numeric:tabular-nums; }
.service-order-link { text-align:left; color:#243e39; font-size:13px; font-weight:700; letter-spacing:.1px; border:0; background:transparent; padding:3px 0; min-height:26px; overflow-wrap:anywhere; }
.service-order-link:hover,.service-unit-link:hover,.service-owner-link:hover { text-decoration:underline; background:transparent; border-color:transparent; }
.service-manager { grid-column:2; color:#84909b; font-size:11px; line-height:1.4; margin-top:2px; overflow-wrap:anywhere; }
.service-units { display:grid; gap:16px; min-width:0; }
.service-unit-spec { display:grid; gap:3px; min-width:0; }
.service-unit-link { text-align:left; font-size:12px; font-weight:600; line-height:1.4; border:0; background:transparent; padding:0; min-height:23px; color:#3a4653; overflow-wrap:anywhere; }
.service-vin { font-size:10px; color:#909aa6; line-height:1.4; overflow-wrap:anywhere; }
.service-stage { display:inline-flex; align-items:center; justify-self:start; gap:6px; max-width:100%; padding:4px 8px; border-radius:5px; font-size:11px; font-weight:550; line-height:1.4; background:#edf1f7; color:#506887; }
.service-stage:before { content:''; width:5px; height:5px; border-radius:50%; background:currentColor; flex:none; }
.service-stage.waiting { background:#f1f3f5; color:#7e8995; }
.service-stage.issue { background:#faeae6; color:#a25042; }
.service-stage.ready { background:#e8f4ed; color:#357354; }
.service-stage.review { background:#f5efdf; color:#94732d; }
.service-owner { min-width:0; }
.service-owner-link { padding:0; min-height:26px; border:0; background:transparent; font-size:12px; line-height:1.5; text-align:left; font-weight:500; color:#5d6977; overflow-wrap:anywhere; }
.service-assign { font-size:11px; min-height:30px; padding:4px 9px; border:1px solid #ccddd6; background:#f3f9f6; color:#35745c; }
.service-due { display:grid; gap:3px; font-size:10px; color:#8c96a3; }
.service-due strong { font-size:12px; font-weight:500; color:#53606f; }
.service-due.is-overdue span { color:#a25446; }
.service-missing-date { font-size:11px; font-weight:400; min-height:28px; text-align:left; border:0; background:transparent; color:#8995a2; padding:0; text-decoration:underline dotted; text-underline-offset:3px; }
.service-row-actions { display:flex; align-items:center; justify-content:flex-end; }
.service-menu { position:relative; }
.service-menu summary { list-style:none; display:flex; justify-content:center; align-items:center; width:32px; height:32px; border-radius:6px; cursor:pointer; font-weight:700; font-size:20px; letter-spacing:1px; color:#7e8b97; }
.service-menu summary::-webkit-details-marker { display:none; }
.service-menu[open] summary,.service-menu summary:hover { background:#edf1f4; color:#293c49; }
.service-menu summary:focus-visible { outline:3px solid #93c0ad; }
.service-menu-list { position:absolute; right:0; top:38px; width:224px; z-index:20; padding:5px; background:white; border:1px solid #dfe5eb; box-shadow:0 8px 24px #23354620; border-radius:9px; }
.service-menu-list button { display:block; width:100%; text-align:left; border:0; background:transparent; color:#526171; font-size:12px; font-weight:500; padding:9px 11px; min-height:36px; }
.service-menu-list button:hover { background:#f2f5f7; }
.service-menu-list .service-menu-danger { color:#a35042; border-top:1px solid #eef0f3; border-radius:0 0 5px 5px; }
.service-footer { display:flex; justify-content:space-between; gap:18px; margin-top:13px; font-size:11px; color:#8b96a2; }
.service-empty { padding:45px 20px; text-align:center; color:#8894a0; font-size:13px; }
.service-empty strong { display:block; color:#526170; margin-bottom:7px; }
.service-empty p { margin:0 0 14px; }
.service-team-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; margin:8px 0 20px; }
.service-team-heading h3 { margin:0 0 3px; font-size:17px; color:#344252; }
.service-team-heading p { margin:0; font-size:12px; color:#8a95a2; }
.service-team-heading .primary { font-size:12px; min-height:36px; padding:8px 12px; }
.service-team-list { background:white; border:1px solid #e0e5eb; border-radius:10px; }
.employee-row { display:grid; grid-template-columns:minmax(230px,1.3fr) 150px minmax(170px,1fr) 120px; gap:24px; align-items:center; padding:20px; border-bottom:1px solid #edf0f3; }
.employee-row:last-child { border-bottom:0; }
.employee-identity { display:flex; gap:12px; align-items:center; min-width:0; }
.employee-avatar { display:flex; align-items:center; justify-content:center; width:36px; height:36px; flex:none; border-radius:10px; background:#eef2f6; color:#738195; font-size:11px; font-weight:600; }
.employee-identity>div { display:grid; gap:3px; }
.employee-identity strong { font-size:13px; font-weight:600; }
.employee-identity div>span { font-size:11px; color:#909ba6; }
.employee-work { display:flex; gap:3px 8px; flex-wrap:wrap; align-items:center; font-size:11px; }
.employee-work strong { flex-basis:100%; font-weight:500; color:#788594; }
.service-employee-order { font-size:11px; padding:0; min-height:25px; color:#527c6e; background:transparent; border:0; font-weight:500; }
.employee-actions { display:flex; align-items:center; justify-content:flex-end; gap:12px; }
.employee-leave { display:flex; align-items:center; flex-direction:row; gap:6px; font-size:11px; font-weight:500; color:#7c8795; cursor:pointer; }
.employee-leave input { width:16px; height:16px; min-height:16px; accent-color:#32735e; margin:0; }
.service-team-note { font-size:11px; color:#8b96a2; margin:14px 0 0; }
#service-fields { display:grid; gap:16px; margin:24px 0; }
#service-dialog { width:min(500px,95vw); border:1px solid #e2e8ed; border-radius:14px; padding:24px; }
#service-dialog h2 { font-size:20px; letter-spacing:-.5px; }
#service-dialog-description { color:#7a8693; font-size:13px; line-height:1.6; }
#service-dialog .dialog-head { align-items:center; gap:20px; }
#service-dialog .dialog-head button { font-size:12px; padding:6px 9px; min-height:32px; border:0; }
#service-submit { width:100%; }
#service-error:empty { display:none; }
#detail-dialog.service-detail { width:min(620px,100%); height:100dvh; max-height:100dvh; margin:0 0 0 auto; inset:0; border-radius:0; padding:24px; border-left:1px solid #e3e8ed; color:#344252; }
.service-detail>.dialog-head { position:sticky; top:-24px; padding:20px 0 16px; margin-top:-20px; background:white; z-index:2; border-bottom:1px solid #edf0f3; align-items:center; }
.service-detail>.dialog-head h2 { font-size:21px; letter-spacing:-.5px; }
.service-detail>.dialog-head button { font-size:12px; min-height:32px; border:0; }
.service-detail-overview { display:grid; grid-template-columns:1fr 1fr; gap:20px; padding:18px 0; }
.service-detail-overview div { display:grid; gap:4px; }
.service-detail-overview span { color:#8a95a0; font-size:11px; }
.service-detail-overview strong { font-size:13px; font-weight:550; }
.service-detail-actions { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:20px; }
.service-detail-actions button { font-size:12px; padding:7px 10px; min-height:34px; }
.service-detail-more,.service-history { border-top:1px solid #e8edf2; padding:14px 0; }
.service-detail-more>summary,.service-history>summary { cursor:pointer; font-size:12px; color:#708293; margin-bottom:12px; }
.service-detail-more .detail-grid { font-size:12px; }
.service-detail #detail-body>h3 { font-size:14px; margin:10px 0 14px; }
.service-detail .detail-item { padding:16px; background:#fafbfc; border:1px solid #e4e9ee; border-radius:9px; margin-bottom:14px; }
.service-detail .detail-item-heading { align-items:flex-start; flex-wrap:wrap; }
.service-detail .detail-item-heading>strong { font-size:12px; }
.service-detail .detail-item-heading .tag { font-size:10px; }
.service-detail .detail-steps { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.service-detail .detail-step { background:#edf0f4; color:#7e8b99; padding:9px; }
.service-detail .detail-step strong { font-size:11px; overflow-wrap:anywhere; }
.service-detail .detail-step.done { background:#e7f2ec; color:#39735c; }
.service-detail .detail-step.failed { background:#f9e9e6; color:#a25042; }
.service-detail .stage-editor { border:1px solid transparent; text-align:left; cursor:pointer; width:100%; align-content:start; }
.service-detail .stage-editor:hover { border-color:#658b80; filter:brightness(.98); }
.service-detail .stage-editor:focus-visible { outline:2px solid #2d7064; outline-offset:2px; }
.stage-edit-hint { font-size:10px; font-weight:500; margin-top:4px; opacity:.8; }
.stage-failure { margin:12px 0; padding:12px; border-left:3px solid #b9523d; background:#fff1ed; color:#873e30; font-size:12px; }
.stage-failure p { margin:6px 0 0; white-space:pre-wrap; overflow-wrap:anywhere; }
#detail-feedback:not(:empty) { position:sticky; top:0; z-index:2; padding:12px; border-radius:8px; background:#fff5e9; color:#83471f; }
#detail-feedback.notice:not(:empty) { background:#e7f2ec; color:#2d6252; }
@media(max-width:600px) { .service-detail .detail-steps { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.service-detail .service-note { font-size:12px; color:#758493; }
.service-detail .small { font-size:11px; }
@media(max-width:1150px) {
  .service-workspace .topbar { gap:10px 20px; flex-wrap:wrap; }
  .service-workspace .tabs { order:0; flex:initial; }
  .service-workspace #current-user { max-width:130px; }
  .service-workspace #pilot-report-link { display:none; }
  .service-table-head,.service-row { grid-template-columns:130px minmax(270px,1fr) 120px 85px 30px; gap:12px; padding-left:16px; padding-right:16px; }
  .service-table-head>div,.service-unit { grid-template-columns:minmax(130px,1fr) 128px; gap:10px; }
  .service-toolbar { flex-wrap:wrap; }
  .service-search-label { flex:1 1 250px; max-width:350px; }
}
@media(max-width:850px) {
  .service-workspace main { padding:24px 20px 40px; }
  .service-workspace .topbar { padding:12px 20px; }
  .service-workspace .top-actions { margin-left:auto; }
  .service-workspace .tabs { order:3; flex:1 1 100%; }
  .service-table-head { display:none; }
  .service-row { position:relative; grid-template-columns:minmax(0,1fr) auto; gap:15px; padding:18px; }
  .service-identity { grid-column:1; padding-right:40px; }
  .service-units { grid-column:1/-1; grid-row:2; gap:14px; }
  .service-unit { grid-template-columns:minmax(0,1fr) 145px; }
  .service-owner { grid-column:1; grid-row:3; }
  .service-owner:before { content:'Исполнитель · '; font-size:11px; color:#98a1ad; }
  .service-due { grid-column:2; grid-row:3; text-align:right; }
  .service-row-actions { position:absolute; top:16px; right:14px; }
  .service-footer>span:last-child { display:none; }
  .employee-row { grid-template-columns:minmax(0,1fr) auto; gap:18px; }
  .employee-row>.service-stage { justify-self:end; }
  .employee-work { grid-column:1; }
  .employee-actions { grid-column:2; }
}
@media(max-width:560px) {
  .service-workspace .topbar { padding:10px 16px; gap:10px; }
  .service-workspace .brand h1 { font-size:14px; }
  .service-workspace #current-user { max-width:100px; font-size:10px; }
  .service-workspace .top-actions { width:auto; gap:4px; flex-wrap:nowrap; }
  .service-workspace #current-user { flex:initial; }
  .service-workspace #refresh-board { display:none; }
  .service-workspace .tabs { display:flex; overflow-x:auto; margin:0 -4px; }
  .service-workspace .tabs button { padding:8px 9px; font-size:11px; white-space:nowrap; }
  .service-workspace main { padding:22px 14px 40px; }
  .service-heading { display:block; margin-bottom:19px; }
  .service-heading h2 { font-size:22px; }
  .service-toolbar { gap:12px; margin-bottom:12px; }
  .service-filters { flex-wrap:wrap; width:100%; gap:4px; }
  .service-filter { flex:none; min-height:36px; padding:7px 9px; font-size:11px; }
  .service-search-label { flex:1 1 100%; max-width:none; }
  .service-search-label input { min-height:40px; font-size:13px; }
  .service-unit { grid-template-columns:minmax(0,1fr) 128px; gap:12px; }
  .service-order-link,.service-owner-link,.service-unit-link { min-height:30px; }
  .service-menu summary { width:36px; height:36px; }
  .service-menu-list button { min-height:44px; }
  .service-unit-link { font-size:12px; }
  .service-stage { font-size:10px; }
  .service-team-heading { align-items:flex-start; }
  .service-team-heading .primary { font-size:11px; max-width:150px; }
  .employee-row { gap:16px 8px; padding:16px; }
  .employee-identity { gap:9px; }
  .employee-identity strong { font-size:12px; }
  .employee-avatar { width:30px; height:30px; font-size:10px; }
  .employee-actions { gap:5px; }
  .employee-leave { min-height:44px; }
  #service-dialog { width:100%; max-width:none; border-radius:0; padding:20px; }
}
#app .brand h1 span {display:block;font-size:10px;font-weight:400;color:#778391;margin-top:4px;letter-spacing:0;}
.service-heading p {color:#7b8794;font-size:13px;margin:9px 0 0;max-width:650px;line-height:1.5;}
.orders-toolbar {display:flex;align-items:center;justify-content:space-between;gap:18px;margin:24px 0 16px;flex-wrap:wrap;}
.order-search {width:260px!important;min-height:42px;border:1px solid #dee5eb;background:white;border-radius:8px;padding:10px 13px;font-size:13px;}
.orders-table {background:white;border:1px solid #e3e8ee;border-radius:10px;}
.orders-head,.orders-row {display:grid;grid-template-columns:minmax(135px,1fr) minmax(165px,1.4fr) minmax(150px,1.1fr) minmax(115px,.8fr) 100px 94px;gap:18px;padding:18px 22px;align-items:center;}
.orders-head {padding-top:13px;padding-bottom:13px;background:#fafbfc;color:#8893a0;font-size:11px;border-radius:10px 10px 0 0;border-bottom:1px solid #e7ebef;}
.orders-row {border-bottom:1px solid #edf0f3;font-size:13px;min-width:0;}
.orders-row:last-child {border-bottom:0;}
.orders-row>div {min-width:0;}
.orders-row strong {font-size:12px;font-weight:550;overflow-wrap:anywhere;}
.order-identity,.order-units,.order-stages,.order-owner,.order-source {display:grid;gap:7px;}
.order-units>div {min-height:42px;}
.order-stages .service-stage {min-height:42px;display:flex;align-items:center;}
.row-sub {display:block;color:#8894a1;font-size:11px;line-height:1.5;margin-top:3px;overflow-wrap:anywhere;}
.order-due {font-size:11px;}.is-overdue strong,.is-overdue .row-sub {color:#b76748;}
.order-actions {display:flex;gap:6px;align-items:center;justify-content:flex-end;flex-wrap:wrap;}
.order-actions button {font-size:11px;min-height:36px;padding:8px 11px;}
.orders-footer {padding:14px 22px;color:#8893a0;font-size:11px;}
.finance-table .orders-head,.finance-table .orders-row {grid-template-columns:minmax(170px,1.2fr) minmax(130px,1fr) minmax(160px,1.2fr) 170px;}
.review-table .orders-head,.review-table .orders-row {grid-template-columns:minmax(180px,1.2fr) minmax(200px,1.6fr) minmax(150px,1fr) 100px;}
.source-link {display:block;font-size:12px;color:#52779a;overflow-wrap:anywhere;line-height:1.5;}
.detail-role-actions {display:flex;gap:8px;flex-wrap:wrap;margin-top:16px;}
.detail-role-actions button {font-size:12px;min-height:40px;}
.sticker-links {display:grid;gap:7px;margin-top:15px;padding-top:12px;border-top:1px solid #e2e7ed;}
.source-settings {margin-top:28px;border-top:1px solid #e4e9ef;padding-top:18px;}
.source-settings summary {cursor:pointer;color:#708293;font-size:13px;}
.source-rule {display:grid;grid-template-columns:140px minmax(0,1fr) 85px;align-items:center;gap:15px;padding:14px 0;border-bottom:1px solid #e7ebef;}
.source-rule strong {font-size:12px;overflow-wrap:anywhere;}
.source-settings>button {margin-top:16px;}
.director-summary {display:flex;gap:40px;margin:25px 0 28px;}
.director-stat {display:flex;gap:12px;align-items:center;}.director-stat strong {font-size:26px;font-weight:500;color:#34526b;}.director-stat span {font-size:12px;color:#778594;max-width:140px;}
.orders-row .service-order-link {text-align:left;overflow-wrap:anywhere;white-space:normal;}
@media(max-width:1100px){.orders-head,.orders-row{gap:12px;padding:16px;grid-template-columns:minmax(115px,1fr) minmax(135px,1.2fr) minmax(130px,1fr) 100px 85px 70px;}.order-search{width:230px!important;}}
@media(max-width:850px){
  .orders-head{display:none!important;}.orders-row,.finance-table .orders-row,.review-table .orders-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;position:relative;padding:18px;}
  .orders-row .order-identity{grid-column:1/-1;padding-right:80px;}
  .orders-row .order-units{grid-column:1;grid-row:2;}.orders-row .order-stages{grid-column:2;grid-row:2;}
  .orders-row .order-owner{grid-column:1;grid-row:3;}.orders-row .order-due{grid-column:2;grid-row:3;text-align:right;}
  .orders-row .order-actions{position:absolute;right:14px;top:16px;max-width:170px;}
  .finance-table .order-actions,.review-table .order-actions{position:static;grid-column:1/-1;justify-content:flex-start;max-width:none;}
  .review-table .order-source{grid-column:1/-1;}.review-table .orders-row>div:nth-child(3){grid-column:1/-1;}
  .source-rule{grid-template-columns:1fr auto;}.source-rule a{grid-column:1;grid-row:2;}.source-rule button{grid-column:2;grid-row:1/3;}
}
@media(max-width:560px){
  .orders-toolbar{gap:12px;margin-top:20px;}.order-search{width:100%!important;}.orders-row{padding:16px;gap:14px 10px;}
  .orders-row .order-actions button{min-height:42px;}.service-heading>button{margin-top:16px;}.director-summary{gap:20px;flex-wrap:wrap;}.director-stat{flex:1 1 130px;}
  .order-units>div,.order-stages .service-stage{min-height:53px;}.orders-row .service-stage{font-size:11px;}.service-heading p{font-size:12px;}
}

/* One compact sales form, with no messenger hand-off. */
#sales-dialog{width:min(760px,calc(100vw - 24px));max-height:94dvh;padding:28px;border-radius:14px;overflow:auto}
#sales-dialog h2{font-size:25px}
#sales-fields{border:0;padding:0;margin:0;min-width:0}
.sales-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.sales-section{margin:24px 0;padding:20px 0;border-block:1px solid var(--line)}
.sales-section h3{margin-bottom:14px}
.sales-item{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) auto;gap:12px;align-items:end;margin-bottom:12px}
.sales-item button{min-height:44px}
.sales-section p{margin:8px 0 0}
.sales-attestation{display:flex;align-items:center;gap:10px;margin:20px 0 0;font-weight:500}
.sales-attestation input{width:18px;min-height:18px;height:18px;flex-shrink:0}
#sales-urgency{margin-top:18px}
.sales-footer{display:flex;justify-content:space-between;gap:20px;align-items:center;border-top:1px solid var(--line);padding-top:18px}
.sales-footer span{max-width:330px}.sales-footer button{min-height:44px;flex-shrink:0}
@media(max-width:600px){#sales-dialog{padding:20px 16px}.sales-grid{grid-template-columns:1fr;gap:14px}.sales-item{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}.sales-item button{grid-column:1/-1;justify-self:end;min-height:36px}.sales-footer{flex-direction:column;align-items:stretch;gap:12px}.sales-footer span{max-width:none}}

.dispatch-delays{padding:16px;border:1px solid #e6ba79;background:#fff7e8;border-radius:12px;margin-bottom:18px;display:flex;flex-wrap:wrap;gap:10px;align-items:center}.dispatch-delays[hidden]{display:none}.employee-identity{min-width:0}.employee-identity span{overflow-wrap:anywhere}

.leadership-counters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:16px 0 28px}
.leadership-counter{padding:20px;background:#fff;border:1px solid var(--line);border-radius:12px;display:flex;flex-direction:column;gap:10px}.leadership-counter strong{font-size:26px;color:var(--ink)}.leadership-counter span{font-size:13px;color:var(--muted)}
.leadership-table-wrap{overflow-x:auto;margin-top:16px;border:1px solid var(--line);border-radius:12px;background:#fff}.leadership-table{width:100%;border-collapse:collapse;text-align:left;font-size:14px}.leadership-table th,.leadership-table td{padding:18px 16px;border-bottom:1px solid var(--line)}.leadership-table th{font-size:12px;color:var(--muted);background:#f6f8f7}.leadership-table tr:last-child td{border:0}
.leadership-filters{display:flex;gap:16px;align-items:end;margin:20px 0}.leadership-filters label{flex:1;min-width:0}.leadership-filters input,.leadership-filters select{width:100%}
.audit-entry{background:#fff;padding:20px 24px;border:1px solid var(--line);border-radius:10px;margin-bottom:10px}.audit-entry-head{display:flex;justify-content:space-between;gap:20px;margin-bottom:8px}.audit-entry time{font-size:12px;color:var(--muted);white-space:nowrap}.audit-entry p{margin:10px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px}.audit-entry .link-button{padding:0;min-height:28px}
.leadership-access{display:grid;gap:12px;margin:24px 0}.leadership-person{display:flex;justify-content:space-between;gap:20px;padding:20px;background:#fff;border:1px solid var(--line);border-radius:10px}.leadership-person span{color:var(--muted);font-size:14px}#new-head-access{margin-top:20px;overflow-wrap:anywhere}
@media(max-width:800px){.leadership-counters{grid-template-columns:repeat(2,minmax(0,1fr))}.leadership-filters{flex-wrap:wrap}.leadership-filters label{flex:1 1 180px}.leadership-person{flex-direction:column;gap:8px}.audit-entry-head{flex-direction:column;gap:8px}.audit-entry{padding:16px}.leadership-table{min-width:650px}}
.sales-deadline{grid-column:1/-1;font-size:14px;font-weight:600}.deadline-shortcuts{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.deadline-shortcuts button[aria-pressed=true],#calendar-days button[aria-pressed=true]{background:#1e665b;color:white;border-color:#1e665b}.sales-deadline p{margin:10px 0 0;font-weight:400}#deadline-time{display:flex;align-items:end;gap:8px;margin-top:14px;font-weight:400}#deadline-time[hidden]{display:none}#deadline-time label{width:85px}#deadline-time>span{padding-bottom:12px}#deadline-calendar{max-width:350px;padding:12px;border:1px solid var(--line);border-radius:12px;margin-top:12px;background:#fff}.calendar-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.calendar-heading button{font-size:22px}.calendar-week,#calendar-days{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}.calendar-week{text-align:center;font-size:12px;color:var(--muted);margin-bottom:8px}#calendar-days button{padding:0;min-height:40px}#calendar-days button:disabled{opacity:.3}

#invite-dialog { width:min(480px,calc(100vw - 32px)); }
#invite-dialog .invite-code { font-size:48px; font-weight:700; letter-spacing:.18em; text-align:center; padding:20px; color:var(--accent,#21655c); background:#edf5f2; border-radius:12px; margin:16px 0; }
#invite-message { width:100%; box-sizing:border-box; min-height:110px; font:inherit; resize:vertical; }
#copy-invite { margin-top:16px; width:100%; }
.employee-identity .employee-profile { display:block; color:#52726d; font-size:12px; margin-top:5px; text-decoration:none; }
.employee-identity .employee-profile:hover { text-decoration:underline; }

.source-reminder{display:flex;align-items:center;gap:10px;margin:12px 0 0;color:var(--ink);font-size:15px;font-weight:500;line-height:1.5;cursor:pointer}.source-reminder input{width:18px;min-height:18px;height:18px;flex:0 0 18px;accent-color:var(--green);margin:0}.source-reminder[hidden]{display:none}
