/* EXTRADRUK OS / referencja UI v0.31. Samodzielna makieta, dane demonstracyjne. */
:root {
  --bg: #f7f8fa;
  --sidebar: #f2f3f5;
  --surface: #fff;
  --text: #24272e;
  --muted: #787e89;
  --line: #e4e6eb;
  --blue: #2869cb;
  --yellow: #946700;
  --green: #248049;
  --black: #242424;
  --urgent: #ff0067;
  --today: #800d35;
  --radius: 7px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font:
    13px -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  color: var(--text);
  background: var(--bg);
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: default;
  opacity: 0.4;
}
button,
input,
select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}
button {
  padding: 9px 13px;
}
button:hover:not(:disabled) {
  background: #edf0f4;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
input,
select {
  padding: 9px 11px;
  color: var(--text);
}
[hidden] {
  display: none !important;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.brand {
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 23px;
  gap: 9px;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.7px;
}
.brand span {
  font-weight: 500;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
  border-left: 1px solid #cbd0d8;
  padding-left: 9px;
}
.brand b {
  color: var(--urgent);
}
nav {
  padding: 14px 12px;
  overflow: auto;
  flex: 1;
}
.section-label {
  font-size: 10px;
  letter-spacing: 1.3px;
  color: #8c919b;
  margin: 3px 12px 15px;
  font-weight: 700;
}
.nav-head,
.module {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  border: 0;
  text-align: left;
  font-weight: 600;
  margin: 3px 0;
  padding: 11px 12px;
}
.nav-head .chevron {
  margin-left: auto;
}
.nav-head.current {
  background: #e5e8ed;
}
.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 17px;
  color: #636b78;
}
.subnav {
  margin: 7px 0 20px;
}
.nav-status {
  border: 0;
  background: transparent;
  width: 100%;
  padding: 8px 10px 8px 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-size: 12px;
  gap: 5px;
}
.nav-status.active {
  background: white;
  font-weight: 650;
  box-shadow: 0 1px 3px #19202c0c;
}
.count {
  font-size: 10px;
  font-weight: 750;
  min-width: 25px;
  padding: 3px 5px;
  border-radius: 4px;
  text-align: center;
  background: #dfe3e9;
  color: #535b69;
}
.blue {
  background: var(--blue);
  color: white;
}
.yellow {
  background: var(--yellow);
  color: white;
}
.green {
  background: var(--green);
  color: white;
}
.black {
  background: var(--black);
  color: white;
}
.sidebar-bottom {
  border-top: 1px solid var(--line);
  padding: 13px 16px;
}
.version {
  font-size: 11px;
  color: var(--muted);
  padding: 8px 9px;
}
.workspace {
  margin-left: 238px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: 64px;
  flex-shrink: 0;
  background: white;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}
.breadcrumb {
  color: var(--muted);
  font-size: 12px;
}
.breadcrumb span {
  margin: 0 10px;
  color: #c1c5cc;
}
.profile {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  border-radius: 50%;
  background: #e9edf2;
  color: #576171;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.demo {
  font-size: 10px;
  letter-spacing: 0.8px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 5px 8px;
  border-radius: 4px;
  margin-right: 14px;
}
.main {
  padding: 27px 28px 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}
h1 {
  font-size: 25px;
  letter-spacing: -0.65px;
  margin: 0 0 7px;
  font-weight: 650;
}
h1 span {
  color: #a3a8b0;
  font-weight: 350;
  margin: 0 9px;
}
h1 small {
  font-size: 23px;
  font-weight: 450;
}
.subtext {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.primary {
  background: #282d36;
  color: white;
  border-color: #282d36;
  font-weight: 600;
}
.primary:hover:not(:disabled) {
  background: #414957;
}
.toolbar {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 14px;
}
.search-wrap {
  position: relative;
  max-width: 440px;
  flex: 1;
}
.search-wrap span {
  position: absolute;
  left: 13px;
  top: 9px;
  color: #858b95;
  font-size: 18px;
}
.search-wrap input {
  width: 100%;
  padding-left: 38px;
}
.toolbar .hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}
.table-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}
.table-scroll {
  overflow: auto;
  flex: 1;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 12px;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fafbfc;
  color: #747b87;
  font-weight: 550;
  text-align: left;
  border-bottom: 1px solid var(--line);
  height: 41px;
  padding: 0 11px;
}
th button {
  border: 0;
  background: none;
  padding: 0;
  font-size: 11px;
  color: inherit;
}
td {
  border-bottom: 1px solid #edf0f3;
  padding: 9px 11px;
  height: 45px;
}
tr.order:hover {
  background: #fafbfe;
}
tr.order.expanded {
  background: #f7f9fc;
}
td:first-child,
th:first-child {
  padding-left: 17px;
  padding-right: 4px;
  width: 30px;
}
input[type="checkbox"] {
  accent-color: #555f70;
  margin: 0;
  width: 14px;
  height: 14px;
  vertical-align: middle;
}
.id-cell {
  display: flex;
  align-items: center;
  gap: 7px;
}
.expand {
  border: 0;
  background: transparent;
  padding: 0;
  width: 20px;
  height: 23px;
  font-size: 19px;
  color: #818894;
}
.order-link {
  font-weight: 650;
  font-size: 12px;
  border: 0;
  background: none;
  padding: 0;
}
.badge {
  display: inline-block;
  border-radius: 4px;
  padding: 5px 7px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}
.standard {
  background: #e1f1d9;
  color: #3b6530;
}
.urgent {
  background: var(--urgent);
  color: white;
}
.today {
  background: var(--today);
  color: white;
}
.noname {
  background: #df242b;
  color: white;
  font-weight: 800;
  font-size: 9px;
  padding: 4px 5px;
  margin-left: 5px;
  border-radius: 3px;
}
.money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
}
.date {
  color: #727987;
  font-variant-numeric: tabular-nums;
}
.ship {
  font-size: 10px;
  font-weight: 650;
}
.late {
  color: #c22c35;
}
.detail td {
  background: #f8fafc;
  padding: 14px 24px 17px 69px;
  white-space: normal;
}
.detail-title {
  font-size: 10px;
  color: #818996;
  letter-spacing: 0.8px;
  font-weight: 700;
  margin-bottom: 9px;
}
.items {
  display: grid;
  gap: 7px;
  max-width: 630px;
}
.item {
  display: flex;
  justify-content: space-between;
  gap: 25px;
}
.item span {
  color: #6c7380;
}
.pagination {
  border-top: 1px solid var(--line);
  padding: 12px 17px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #747b87;
  font-size: 11px;
}
.pagination select {
  padding: 6px 25px 6px 9px;
  font-size: 11px;
}
.pages {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
}
.pages button {
  padding: 5px 10px;
  font-size: 14px;
}
.footnote {
  display: flex;
  justify-content: space-between;
  color: #9298a2;
  font-size: 10px;
  margin-top: 12px;
}
.empty {
  padding: 65px;
  text-align: center;
  color: var(--muted);
}
.empty strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  margin-bottom: 10px;
}
.selection {
  padding: 10px 16px;
  background: #eff3f9;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 15px;
}
.selection button {
  padding: 4px 9px;
}
.filter-summary {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 12px;
}
.filter-summary button {
  border: 0;
  background: none;
  text-decoration: underline;
  padding: 0 8px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  width: 540px;
  max-width: calc(100vw - 32px);
  color: var(--text);
  box-shadow: 0 20px 80px #1b233327;
}
dialog::backdrop {
  background: #222c3c35;
}
dialog h2 {
  font-size: 20px;
  margin: 0 0 8px;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 22px;
}
.dialog-head button {
  border: 0;
  font-size: 20px;
  padding: 0 4px;
}
.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  color: #606976;
}
.dialog-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 25px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
#notice p {
  line-height: 1.7;
  color: #69717e;
}
#notice .items {
  margin: 20px 0;
}
.sortmark {
  font-size: 10px;
  margin-left: 4px;
}
.owner {
  display: flex;
  align-items: center;
  gap: 7px;
}
.owner i {
  font-style: normal;
  width: 22px;
  height: 22px;
  font-size: 9px;
}
.muted {
  color: var(--muted);
}
@media (min-width: 1600px) {
  td {
    height: 47px;
  }
  table {
    font-size: 13px;
  }
  .badge {
    font-size: 11px;
  }
}
@media (max-width: 1200px) {
  .sidebar {
    width: 218px;
  }
  .workspace {
    margin-left: 218px;
  }
  .main {
    padding: 22px 18px;
  }
  .topbar {
    padding: 0 18px;
  }
  table {
    min-width: 1120px;
  }
  .toolbar .hint {
    display: none;
  }
}
@media (max-width: 700px) {
  .sidebar {
    width: 200px;
  }
  .workspace {
    margin-left: 200px;
    min-width: 480px;
  }
  .heading {
    gap: 12px;
  }
  h1 {
    font-size: 22px;
  }
  h1 small {
    font-size: 18px;
  }
}

/* Zmiany v0.31 */
.brand .wordmark {
  display: flex;
  gap: 0;
  white-space: nowrap;
}
.brand b {
  color: #6eb80e;
}
.brand {
  gap: 9px;
}
.nav-icon svg {
  width: 19px;
  height: 19px;
  display: block;
}
.items {
  max-width: none;
}
.item {
  justify-content: flex-start;
  gap: 18px;
}
.item span {
  white-space: nowrap;
}
.global-search {
  position: relative;
  flex: 0 1 280px;
  width: 280px;
  max-width: 300px;
  min-width: 140px;
}
.global-search > span {
  position: absolute;
  left: 10px;
  top: 6px;
  font-size: 21px;
  color: #858b95;
}
.global-search input {
  width: 100%;
  border-color: transparent;
  background: #f6f7f9;
  padding-left: 36px;
}
.global-search input:focus {
  background: white;
  border-color: #cad0da;
}
#global-results {
  position: absolute;
  top: 42px;
  left: 0;
  width: 100%;
  min-width: 350px;
  max-height: 440px;
  overflow: auto;
  z-index: 8;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px #202b3820;
  padding: 7px;
}
.global-result {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  font-size: 12px;
  padding: 10px;
}
.global-result small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.global-label {
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 8px;
}
.basic-filters {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 13px;
  margin-bottom: 14px;
}
.basic-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.2fr 0.85fr 0.8fr 1.1fr auto;
  gap: 10px;
  align-items: end;
}
.basic-grid input,
.basic-grid select {
  min-width: 0;
  width: 100%;
  padding: 8px;
  font-size: 12px;
}
.basic-grid label {
  font-size: 11px;
}
.basic-actions {
  display: flex;
  gap: 6px;
}
.basic-actions button {
  padding: 8px 10px;
  font-size: 11px;
}
.toolbar .hint {
  display: none;
}
.table-scroll table {
  min-width: 1220px;
}
.technical-expand {
  width: 29px;
  padding-left: 0;
  padding-right: 0;
}
.row-actions {
  width: 38px;
  padding: 0 9px;
}
.row-actions button {
  border: 0;
  background: none;
  padding: 7px;
  font-weight: bold;
  letter-spacing: 1px;
}
.payment {
  font-size: 11px;
  color: #616b78;
}
.payment[data-payment="Nieopłacone"] {
  color: #a54831;
}
.payment[data-payment="Opłacone"] {
  color: #397455;
}
#row-menu {
  position: fixed;
  z-index: 20;
  min-width: 190px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 7px 24px #202b3820;
  padding: 5px;
}
#row-menu button {
  display: block;
  border: 0;
  text-align: left;
  width: 100%;
  font-size: 12px;
}
#columns-dialog {
  width: 480px;
  max-height: 90vh;
}
#column-list {
  max-height: 49vh;
  overflow: auto;
  margin: 12px 0;
}
.column-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px;
  margin-bottom: 5px;
  background: #fff;
}
.column-item.dragging {
  opacity: 0.45;
}
.column-item.drag-over {
  border-top: 3px solid var(--blue);
}
.drag-handle {
  cursor: grab;
  color: #9299a3;
  font-size: 18px;
}
.column-item label {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  font-size: 12px;
}
.column-item button {
  padding: 2px 6px;
  font-size: 13px;
}
.column-note {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}
.locked {
  font-size: 10px;
  color: #8c929d;
}
dialog {
  max-height: 90vh;
  overflow: auto;
}
.filter-summary {
  line-height: 1.7;
}
.search-wrap {
  max-width: 470px;
}
.heading {
  margin-bottom: 22px;
}
.money {
  white-space: nowrap;
}
@media (max-width: 1450px) {
  .basic-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
  .basic-actions {
    align-self: end;
  }
  .main {
    padding-top: 21px;
  }
  .heading {
    margin-bottom: 18px;
  }
}
@media (max-width: 900px) {
  .basic-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

/* v0.31: wszystkie filtry w dwóch rzędach oraz płatności jako badge'e. */
.filter-scroll {
  overflow-x: auto;
  padding-bottom: 2px;
}
.basic-grid {
  grid-template-columns: repeat(3, minmax(110px, 1fr)) repeat(
      2,
      minmax(220px, 1.7fr)
    ) repeat(2, minmax(130px, 1.15fr));
  grid-template-rows: repeat(2, auto);
  gap: 12px 10px;
  min-width: 1100px;
}
.basic-grid .field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #606976;
  font-size: 11px;
  min-width: 0;
}
.range-inputs {
  display: flex;
  align-items: center;
  gap: 4px;
}
.range-inputs input {
  flex: 1;
  width: 0;
  padding-left: 5px;
  padding-right: 5px;
}
.range-inputs input[type="date"] {
  font-size: 10px;
}
.basic-filters {
  flex-shrink: 0;
}
.payment {
  font-size: 10px;
  color: white;
  letter-spacing: 0.15px;
}
.payment-paid {
  background: #248049;
}
.payment-unpaid {
  background: #d92b35;
}
.payment-partial {
  background: #b95d00;
}
.payment-overpaid {
  background: #8053b6;
}
.payment-deferred {
  background: #2869cb;
}
/* Widok zlecenia — te same kolory, fonty i kontrolki co lista. */
.order-view {
  padding: 20px 28px 16px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.order-view h2 {
  font-size: 14px;
  font-weight: 650;
  margin: 0;
}
.order-view h3 {
  font-size: 12px;
  margin: 0 0 12px;
}
.order-back {
  border: 0;
  background: none;
  padding: 0;
  color: #747b87;
  font-size: 12px;
}
.order-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 0 0 12px;
}
.order-title-row h1 {
  font-size: 23px;
  margin: 0;
}
.order-context {
  display: grid;
  justify-items: start;
  gap: 6px;
  margin: 4px 0 12px;
}
.order-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.order-status-badges {
  display: contents;
}
.order-status .noname {
  margin-left: 0;
  font-size: 10px;
  padding: 5px 7px;
}
.order-title-row .order-client {
  font-size: 15px;
  color: #626b78;
  font-weight: 500;
}
.order-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.save-state {
  font-size: 11px;
  color: #7a818d;
  margin-right: 4px;
}
.save-state.dirty {
  color: #946700;
}
.order-operations {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(130px, 0.9fr) minmax(0, 1.2fr) repeat(3, max-content);
  gap: 8px;
  background: white;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 7px;
  margin-bottom: 14px;
}
.order-view label.field {
  font-size: 11px;
}
.order-view label.field input,
.order-view label.field select,
.order-view textarea {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
}
.check-field {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}
.order-operations .check-field {
  align-self: end;
  height: 33px;
}
.order-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  overflow-x: auto;
}
.order-tabs button {
  border: 0;
  border-radius: 0;
  background: none;
  padding: 11px 1px;
  font-size: 12px;
  white-space: nowrap;
  color: #7b8290;
  border-bottom: 2px solid transparent;
}
.order-tabs button[aria-selected="true"] {
  border-bottom-color: #282d36;
  color: #282d36;
  font-weight: 650;
}
.tab-count {
  background: #e8ebef;
  color: #697280;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 10px;
  margin-left: 4px;
}
.order-scroll {
  overflow: auto;
  min-height: 0;
  flex: 1;
}
.order-content {
  padding: 16px 0 0;
}
.order-block {
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-bottom: 15px;
  overflow: hidden;
}
.block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.block-head .actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.order-lines-head,
.order-lines-head .actions {
  flex-wrap: wrap;
}
.order-lines-head .actions {
  justify-content: flex-end;
  margin-left: auto;
}
.block-body {
  padding: 15px 16px;
}
.contacts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.contact-summary {
  font-size: 12px;
  line-height: 1.75;
  color: #68717e;
  min-height: 96px;
}
.contact-summary strong {
  color: #303640;
  font-weight: 600;
}
.contact-summary p {
  margin: 0;
}
.small-button {
  padding: 5px 8px;
  font-size: 11px;
}
.text-button {
  border: 0;
  background: none;
  padding: 0;
  color: #536c90;
  font-size: 11px;
  text-align: left;
}
.contact-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 11px;
}
.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.contact-form .wide {
  grid-column: 1/-1;
}
.recipient {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 14px;
}
.order-table-wrap {
  overflow: auto;
}
.order-view table {
  font-size: 12px;
  min-width: 0;
}
.order-view th {
  position: static;
}
.order-view td {
  height: 43px;
}
.line-table {
  min-width: 1030px !important;
}
.line-table input,
.line-table select {
  padding: 6px;
  width: 70px;
  font-size: 12px;
}
.line-table input[data-line-field="name"] {
  min-width: 180px;
  width: 100%;
  border-color: transparent;
  background: transparent;
  font-weight: 600;
}
.line-table input[data-line-field="price"] {
  width: 87px;
}
.line-table td:first-child,
.order-view th:first-child {
  width: auto;
  padding-left: 13px;
  padding-right: 9px;
}
.line-table td {
  padding: 8px;
}
.line-name {
  min-width: 210px;
}
.files-summary {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: #747e8d;
}
.files-summary.missing {
  color: #a66008;
}
.line-files td {
  white-space: normal;
  background: #f8fafc;
  padding: 15px 25px !important;
}
.file-list {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  max-width: 720px;
}
.file-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.file-entry span {
  flex: 1;
}
.file-entry button {
  border: 0;
  background: none;
  color: #9a5960;
  padding: 4px;
}
.line-file-actions {
  display: flex;
  gap: 12px;
  align-items: start;
  max-width: 800px;
}
.line-file-actions textarea {
  height: 74px;
  resize: vertical;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: 12px inherit;
}
.totals {
  display: flex;
  justify-content: flex-end;
  gap: 28px;
  padding: 16px;
  background: #fcfcfd;
  border-top: 1px solid var(--line);
}
.total {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  color: #7b8390;
}
.total strong {
  font-size: 14px;
  color: #343a43;
  font-variant-numeric: tabular-nums;
}
.total:last-child strong {
  font-size: 17px;
}
.payment-summary {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.payment-summary .actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.order-view .invoice-note-button:not(:disabled) {
  background: white;
}
.order-view .invoice-note-button:has(span:not([hidden])):not(:disabled) {
  background: #b62a35;
  border-color: #b62a35;
  color: white;
}
.detail-dialog textarea[name="accounting"] {
  width: 100%;
  min-height: 100px;
  resize: vertical;
}
.notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.order-view textarea.note {
  border: 1px solid var(--line);
  border-radius: 7px;
  resize: vertical;
  min-height: 82px;
  font:
    12px -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  line-height: 1.5;
  padding: 9px;
}
.note-label {
  display: block;
  font-size: 11px;
  color: #69717e;
  margin-bottom: 7px;
}
.order-footer {
  display: flex;
  justify-content: flex-end;
  color: #9298a2;
  font-size: 10px;
  margin-top: 10px;
  flex-shrink: 0;
}
.order-empty {
  padding: 32px 20px;
  color: #818894;
  text-align: center;
  line-height: 1.8;
}
.order-view .table-actions {
  display: flex;
  gap: 7px;
}
.order-view .table-actions button {
  padding: 5px 8px;
  font-size: 11px;
}
.financial-settings {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
}
.financial-settings label {
  min-width: 180px;
}
.history-list {
  padding: 0 16px;
}
.history-entry {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.history-entry:last-child {
  border: 0;
}
.history-entry .when {
  font-size: 11px;
  color: #7d8591;
  line-height: 1.6;
}
.history-entry .change {
  color: #68717e;
  font-size: 11px;
  margin-top: 5px;
}
.order-error {
  color: #be303a;
  font-size: 12px;
  padding: 10px 0;
  margin: 0;
}
.detail-dialog {
  width: 640px;
}
.detail-dialog label.field {
  font-size: 12px;
}
.detail-dialog .dialog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.detail-dialog .dialog-grid .wide {
  grid-column: 1/-1;
}
.detail-dialog textarea {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
  min-height: 90px;
  resize: vertical;
}
.shipment-payment-warning {
  padding: 12px;
  border-left: 4px solid #b66a00;
  background: #fff4d6;
  color: #754400;
  font-weight: 600;
}
.form-note {
  font-size: 11px;
  line-height: 1.6;
  color: #77808d;
}
.inline-notice {
  padding: 9px 12px;
  margin-bottom: 12px;
  border: 1px solid #d4dfd2;
  background: #f0f6ed;
  border-radius: 6px;
  font-size: 12px;
  color: #4c6945;
}
.order-menu {
  position: absolute;
  right: 0;
  top: 40px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px;
  box-shadow: 0 8px 25px #202b3817;
  z-index: 9;
  width: 180px;
}
.order-menu button {
  display: block;
  width: 100%;
  border: 0;
  text-align: left;
  font-size: 12px;
}
.order-menu-wrap {
  position: relative;
}
.attachment-name {
  font-weight: 550;
}
.edit-contact-dialog {
  max-height: 85vh;
  overflow: auto;
}
.line-delete {
  border: 0;
  background: none;
  color: #8a9099;
  padding: 5px;
}
.order-view .note-sub {
  font-size: 11px;
  color: #838b97;
  margin: 5px 0 0;
}
.upload-drop {
  border: 1px dashed #bbc3ce;
  border-radius: 7px;
  padding: 20px;
  text-align: center;
  color: #747d8a;
  margin-bottom: 15px;
  font-size: 12px;
}
.order-view .contact-summary .noname {
  margin-left: 0;
  margin-bottom: 7px;
}
.order-header-summary {
  font-size: 11px;
  color: #7b8390;
}
.order-scroll-hint {
  font-size: 10px;
  color: #8d95a0;
}
.document-preview {
  white-space: pre-wrap;
  font:
    12px/1.7 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  background: #f8f9fb;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.line-table .expand {
  border: 0;
  width: 20px;
  padding: 0;
}
.order-view button.primary {
  color: white;
}
.order-view .financial-settings select {
  width: 100%;
}
.order-view .badge {
  vertical-align: middle;
}
.contact-form input {
  width: 100%;
  min-width: 0;
}
.order-scroll :focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
@media (max-width: 1300px) {
  .order-view {
    padding: 18px;
  }
  .order-title-row {
    align-items: flex-start;
  }
  .order-title-row h1 {
    font-size: 21px;
  }
  .contacts {
    gap: 10px;
  }
  .block-head {
    padding: 11px 12px;
  }
  .block-body {
    padding: 12px;
  }
  .payment-summary {
    gap: 16px;
  }
  .order-actions {
    gap: 5px;
  }
  .order-actions > button {
    padding: 8px;
    font-size: 12px;
  }
  .save-state {
    display: none;
  }
  .order-tabs {
    gap: 17px;
  }
}
@media (max-width: 1050px) {
  .contacts {
    grid-template-columns: 1fr;
  }
  .contact-summary {
    min-height: 0;
  }
  .order-title-row {
    flex-wrap: wrap;
  }
  .notes-grid {
    grid-template-columns: 1fr;
  }
  .order-view {
    min-width: 600px;
  }
}

/* v0.31: produkt katalogowy i dodawanie bez modala. */
.product-source {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 6px;
  font-size: 10px;
  color: #8a919c;
  white-space: normal;
}
.product-source .text-button {
  font-size: 10px;
  white-space: nowrap;
}
.product-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.line-table input[data-product-picker] {
  width: 100%;
  min-width: 200px;
  font-size: 11px;
  background: white;
  border: 1px solid var(--line);
  font-weight: 400;
}
.product-picker .text-button {
  font-size: 10px;
}
.add-line-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.add-line-footer .text-button {
  font-size: 12px;
}
.module:disabled {
  opacity: 0.65;
}
.dashboard-placeholder {
  margin: 0 0 22px;
}
.invoice-request {
  margin: 0 0 16px;
}
/* DRUK: operacyjna tabela w istniejącym systemie wizualnym. */
.print-view {
  padding: 27px 28px 18px;
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.print-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
}
.print-heading h1 {
  font-size: 25px;
}
.active-roll {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 12px;
}
.active-roll strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  border-radius: 5px;
  background: #e9edf2;
  font-size: 15px;
}
.active-roll button {
  padding: 5px 8px;
  font-size: 11px;
}
.print-tabs {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.print-tabs button {
  font-size: 12px;
  padding: 7px 11px;
}
.print-tabs button[aria-pressed="true"] {
  background: #e5e8ed;
  border-color: #cbd1da;
  font-weight: 650;
}
.print-tabs .count {
  margin-left: 7px;
}
.print-search {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 12px;
}
.print-search input {
  max-width: 450px;
  width: 100%;
}
.print-search .print-sort {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: #747e8b;
}
.print-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  margin-bottom: 12px;
}
.print-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: #67717f;
}
.print-filters input,
.print-filters select {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  font-size: 11px;
}
.print-filters .filter-check {
  flex-direction: row;
  align-items: center;
  align-self: end;
  padding: 8px 0;
}
.print-filters .filter-check input {
  width: 14px;
}
.print-alert {
  border: 1px solid #e3d6ae;
  background: #fffaf0;
  border-radius: 7px;
  margin-bottom: 12px;
  font-size: 11px;
  color: #876b22;
}
.print-alert summary {
  cursor: pointer;
  padding: 10px 12px;
}
.print-alert ul {
  list-style: none;
  max-height: 170px;
  overflow: auto;
  padding: 0 12px;
  margin: 0 0 10px;
}
.print-alert li {
  padding: 6px 0;
  border-top: 1px solid #eee4c9;
  display: flex;
  align-items: center;
  gap: 12px;
}
.print-alert li span {
  flex: 1;
}
.print-alert button {
  font-size: 10px;
  padding: 4px 7px;
}
.print-table-scroll {
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.print-table {
  min-width: 1780px;
  font-size: 12px;
}
.print-table th {
  white-space: nowrap;
  font-size: 11px;
}
.print-table td {
  padding: 10px;
  height: 49px;
  vertical-align: middle;
}
.print-table td:first-child {
  width: 32px;
  padding: 8px;
}
.print-table .file-cell {
  min-width: 230px;
  max-width: 290px;
  white-space: normal;
}
.print-file-name {
  font-weight: 600;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.print-subline {
  display: block;
  font-size: 10px;
  color: #878f9c;
  margin-top: 4px;
  line-height: 1.4;
}
.print-warning {
  color: #a2690b;
}
.print-change {
  color: #b53040;
}
.print-progress {
  font-variant-numeric: tabular-nums;
  min-width: 86px;
  font-weight: 600;
}
.progress-track {
  width: 78px;
  height: 4px;
  border-radius: 3px;
  background: #e8ecf0;
  margin-top: 6px;
  overflow: hidden;
}
.progress-track span {
  height: 100%;
  display: block;
  background: #a57b15;
}
.progress-track.complete span {
  background: #248049;
}
.print-status.waiting {
  background: #2869cb;
  color: white;
}
.print-status.working {
  background: #946700;
  color: white;
}
.print-status.done {
  background: #248049;
  color: white;
}
.print-rolls {
  font-size: 11px;
  font-weight: 600;
  max-width: 90px;
  white-space: normal;
}
.print-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}
.print-actions button {
  padding: 5px 7px;
  font-size: 10px;
  white-space: nowrap;
}
.print-actions .complete-button {
  color: #287247;
}
.print-detail td {
  background: #f8fafc;
  white-space: normal !important;
  padding: 16px 22px 18px 52px !important;
}
.print-detail-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.5fr) minmax(260px, 1fr);
  gap: 25px;
}
.print-detail h3 {
  font-size: 12px;
  margin: 0 0 12px;
}
.print-detail table {
  font-size: 11px;
  min-width: 0;
  width: 100%;
}
.print-detail th {
  position: static;
  background: transparent;
  font-size: 10px;
}
.print-detail td {
  background: transparent;
  padding: 7px !important;
  height: auto;
}
.print-detail .undone {
  text-decoration: line-through;
  color: #9a9faa;
}
.print-detail p {
  font-size: 12px;
  line-height: 1.6;
  margin: 8px 0;
}
.print-detail .action-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.print-detail button {
  font-size: 11px;
  padding: 6px 9px;
}
.print-summary-roll {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
.print-summary-roll span {
  background: #e9edf2;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 11px;
}
.print-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 10px;
  color: #939aa4;
}
.print-filter-summary {
  font-size: 11px;
  color: #7b8390;
  margin-bottom: 10px;
}
.print-nav-active {
  background: white !important;
  font-weight: 650;
  box-shadow: 0 1px 3px #19202c0c;
}
.print-order-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  padding: 11px 16px;
}
.print-order-summary strong {
  font-size: 12px;
}
.print-flash {
  font-size: 11px;
  color: #3c6f37;
  margin-bottom: 10px;
  min-height: 14px;
}
.print-target {
  font-size: 12px;
  display: flex;
  gap: 25px;
  margin: 18px 0;
}
.print-target strong {
  display: block;
  font-size: 20px;
  margin-top: 6px;
}
.print-view .table-card {
  min-height: 150px;
}
.print-date {
  font-size: 10px;
  color: #78818e;
  line-height: 1.6;
}
.print-inline-dim {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  font-size: 11px;
  color: #737e8c;
}
.print-inline-dim input {
  width: 180px !important;
}
.print-note {
  max-width: 200px;
  white-space: normal;
  font-size: 11px;
  line-height: 1.4;
}
.print-state-note {
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff6e5;
  border: 1px solid #ecdbb5;
  color: #906513;
  font-size: 11px;
  line-height: 1.6;
}
.print-view .pagination {
  flex-shrink: 0;
}
.print-row-changed {
  box-shadow: inset 3px 0 #b53040;
}
.print-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.print-table th button {
  white-space: nowrap;
}
.print-view [hidden] {
  display: none !important;
}
@media (max-width: 1300px) {
  .print-view {
    padding: 21px 18px 16px;
  }
  .print-filters {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }
  .print-search {
    flex-wrap: wrap;
  }
  .print-search .print-sort {
    margin-left: auto;
  }
}
@media (max-width: 1000px) {
  .print-view {
    min-width: 630px;
  }
  .print-filters {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }
}

#print-columns-dialog {
  width: 480px;
  max-height: 90vh;
}
#print-column-list {
  max-height: 49vh;
  overflow: auto;
  margin: 12px 0;
}
/* PRODUKTY: istniejące kontrolki, tabele i odstępy. */
.products-view {
  padding: 27px 28px 18px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.products-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 15px;
}
.products-heading h1 {
  font-size: 25px;
}
.products-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-bottom: 14px;
}
.products-tools input {
  flex: 1;
  min-width: 0;
  max-width: 460px;
}
@media (max-width: 600px) {
  .products-tools input[data-search] {
    flex-basis: 100%;
    max-width: 100%;
  }
}
.products-filters {
  display: flex;
  align-items: end;
  gap: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  margin-bottom: 14px;
}
.products-filters label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  color: #737d8b;
  min-width: 160px;
}
.products-filters select {
  font-size: 12px;
  padding: 8px;
}
.products-scroll {
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.products-table {
  min-width: 1070px;
}
.products-table th {
  font-size: 11px;
}
.products-table td {
  font-size: 12px;
  height: 47px;
}
.products-table td:first-child {
  width: 42px;
  padding-right: 12px;
  color: #8c94a0;
}
.products-table .product-name {
  font-weight: 600;
  text-align: left;
  padding: 0;
  border: 0;
  background: none;
}
.product-mini {
  font-size: 10px;
  color: #8b929d;
  display: block;
  margin-top: 4px;
}
.product-inactive {
  background: #e8eaf0;
  color: #6f7785;
}
.products-footer {
  display: flex;
  justify-content: space-between;
  color: #929aa5;
  font-size: 10px;
  margin-top: 12px;
}
.product-card-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.product-card-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 15px;
  align-items: start;
}
.product-card-grid .wide-block {
  grid-column: 1/-1;
}
.product-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.product-fields .wide {
  grid-column: 1/-1;
}
.product-fields label.field {
  font-size: 11px;
}
.product-fields input,
.product-fields select {
  width: 100%;
  min-width: 0;
  font-size: 12px;
  padding: 8px;
}
.product-fields textarea {
  font:
    12px/1.6 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  width: 100%;
  min-height: 85px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
}
.product-card-scroll .block-head h2 {
  font-size: 14px;
  margin: 0;
  font-weight: 650;
}
.product-gross {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafbfc;
  padding: 10px;
  font-size: 12px;
}
.product-gross strong {
  font-size: 17px;
  display: block;
  margin-top: 6px;
}
.product-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.product-card-meta {
  font-size: 11px;
  color: #88909c;
  margin-top: 7px;
}
.product-panel-note {
  font-size: 11px;
  color: #808a98;
  line-height: 1.7;
  margin: 12px 0 0;
}
.product-dict-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.product-dict-row select {
  flex: 1;
}
.product-dict-row button {
  padding: 7px 9px;
  font-size: 11px;
  white-space: nowrap;
}
.product-form-error {
  color: #bd3441;
  font-size: 12px;
  margin: 0 0 12px;
}
.product-planning {
  font-size: 12px;
  line-height: 1.7;
  background: #f7f9fb;
  padding: 12px;
  border-radius: 6px;
  margin-top: 14px;
}
.product-dimension-fields {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 10px;
  color: #7e8794;
  margin: 7px 6px;
  flex-wrap: wrap;
}
.line-table .product-dimension-fields input {
  width: 73px !important;
  min-width: 0;
  font-size: 11px;
}
.product-dimension-fields label {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sewing-hint {
  display: block;
  font-size: 10px;
  color: #7b8593;
  margin: 4px 6px;
  white-space: normal;
  line-height: 1.5;
}
.norm-dialog {
  width: 700px;
}
.norm-dialog table {
  min-width: 0;
  width: 100%;
  font-size: 12px;
}
.norm-dialog th {
  position: static;
  font-size: 11px;
}
.norm-dialog td {
  padding: 8px;
}
.norm-dialog input {
  width: 100%;
  padding: 7px;
  font-size: 12px;
}
.norm-dialog .norm-max {
  width: 100px;
}
.norm-dialog .norm-minutes {
  width: 85px;
}
.norm-dialog .remove-rule {
  border: 0;
  background: none;
  padding: 5px;
}
.norm-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0;
}
.product-rules-preview {
  font-size: 11px;
  border-collapse: collapse;
  min-width: 0 !important;
  width: 100%;
  margin-top: 12px;
}
.product-rules-preview td {
  height: auto;
  padding: 7px 9px;
}
.product-dictionary-list {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.product-dictionary-list span {
  font-size: 12px;
  background: #edf0f4;
  border-radius: 4px;
  padding: 6px 9px;
}
.products-view .order-back {
  margin-bottom: 14px;
}
.products-view h2 {
  font-size: 14px;
}
.products-empty {
  padding: 60px 25px;
  text-align: center;
  color: #7c8591;
}
.products-empty strong {
  display: block;
  color: #323b48;
  font-size: 16px;
  margin-bottom: 8px;
}
.product-card-grid .check-field {
  min-height: 33px;
}
.product-price-note {
  font-size: 10px;
  color: #8d94a0;
  margin-top: 5px;
}
.product-card-scroll .field input:read-only {
  background: #f5f6f8;
  color: #707b89;
}
.product-dictionary-dialog {
  width: 540px;
}
.product-field-message {
  color: #916a14;
  font-size: 11px;
  line-height: 1.6;
}
.product-archive-note {
  font-size: 11px;
  color: #848c99;
  line-height: 1.6;
}
.product-card-scroll .block-head {
  min-height: 46px;
}
@media (max-width: 1300px) {
  .products-view {
    padding: 21px 18px 16px;
  }
  .product-card-grid {
    grid-template-columns: 1fr 1fr;
  }
  .products-filters {
    flex-wrap: wrap;
  }
  .products-filters label {
    min-width: 145px;
  }
}
@media (max-width: 1000px) {
  .product-card-grid {
    grid-template-columns: 1fr;
  }
  .products-view {
    min-width: 570px;
  }
  .products-heading {
    align-items: flex-start;
  }
  .product-card-actions {
    flex-wrap: wrap;
  }
  .product-card-grid .wide-block {
    grid-column: auto;
  }
}

@media (max-width: 600px) {
  .products-view {
    min-width: 0;
  }
  .products-heading {
    flex-wrap: wrap;
  }
}

.shipments-view {
  padding: 27px 28px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.shipments-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.shipment-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.shipment-tabs button {
  font-size: 12px;
  padding: 8px 11px;
}
.shipment-tabs button[aria-pressed="true"] {
  background: #e5e8ed;
  border-color: #cbd1da;
  font-weight: 650;
}
.shipment-tabs .count {
  margin-left: 6px;
}
.shipment-tools {
  display: flex;
  gap: 9px;
  margin-bottom: 14px;
}
.shipment-tools input {
  width: 450px;
  max-width: 55%;
}
.shipment-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  margin-bottom: 14px;
}
.shipment-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: #727d8b;
}
.shipment-filters input,
.shipment-filters select {
  padding: 8px;
  font-size: 11px;
  min-width: 0;
  width: 100%;
}
.shipment-scroll {
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.shipment-table {
  min-width: 1400px;
}
.shipment-table td {
  height: 52px;
  padding: 10px;
  font-size: 12px;
}
.shipment-table td:first-child {
  padding-left: 17px;
  padding-right: 12px;
}
.shipment-table small {
  display: block;
  color: #9097a2;
  font-size: 10px;
  margin-top: 5px;
}
.shipment-actions {
  display: flex;
  gap: 6px;
}
.shipment-actions button {
  padding: 6px 8px;
  font-size: 11px;
}
.shipment-recipient {
  max-width: 190px;
  white-space: normal;
}
.shipment-problem-row {
  box-shadow: inset 3px 0 #800d35;
}
.shipments-footer {
  display: flex;
  justify-content: space-between;
  color: #929aa5;
  font-size: 10px;
  margin-top: 12px;
}
.shipment-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}
.shipment-detail-grid h3,
#notice h3 {
  font-size: 12px;
}
.shipment-detail-status {
  margin-top: 10px;
}
.shipment-timeline {
  border-left: 2px solid var(--line);
  margin: 20px 0;
  padding-left: 18px;
}
.shipment-timeline > div {
  margin-bottom: 18px;
}
.shipment-timeline small {
  display: block;
  font-size: 11px;
  color: #88919f;
  margin-bottom: 5px;
}
.shipment-timeline strong {
  font-size: 12px;
}
@media (max-width: 1300px) {
  .shipments-view {
    padding: 21px 18px 16px;
  }
  .shipment-filters {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }
}

/* v0.31: zakres CRM oraz korekta szerokości checkboxów w karcie produktu */
.product-fields .check-field {
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}
.product-fields .check-field input[type="checkbox"] {
  width: 14px;
  min-width: 14px;
  flex: 0 0 14px;
  margin: 0;
  padding: 0;
}
.crm-view {
  padding: 27px 28px 18px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.crm-view .toolbar {
  flex-wrap: wrap;
}
.crm-view .toolbar label {
  display: flex;
  align-items: center;
  gap: 7px;
}
.crm-view .toolbar select {
  padding: 8px;
}
.crm-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 17px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 11px;
}
.crm-summary strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  margin-top: 8px;
}
.crm-content {
  margin: 18px 0;
}
.crm-records {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 15px;
}
.crm-view .table-card {
  overflow: auto;
}
.crm-view td {
  height: 52px;
}
.crm-view h1 small {
  font-size: 16px;
  color: var(--muted);
}

.order-payment-bar {
  flex-shrink: 0;
}
.order-payment-bar .payment-summary {
  gap: 18px;
  flex-wrap: wrap;
}
.order-payment-bar .field {
  min-width: 150px;
}
.status-picker {
  display: inline-flex;
  position: relative;
  font-size: 12px;
}
.status-picker select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.status-picker:has(select:focus-visible),
.status-picker.keyboard-focus:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 5px;
}
.autosave-note {
  font-size: 11px;
  color: #548130;
  font-weight: 400;
}
.order-payment-bar .block-body {
  padding: 12px 16px;
}
@media (width < 1280px) {
  .order-operations {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.load-view,
.production-admin-view {
  padding: 27px 28px 18px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.load-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.load-toolbar .print-tabs {
  margin: 0;
}
.load-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 7px;
  min-width: 900px;
  margin-bottom: 18px;
}
.load-weekday {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  padding: 8px;
}
.load-day {
  text-align: left;
  white-space: normal;
  padding: 10px;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  background: white;
}
.load-day.selected {
  outline: 2px solid #7c8797;
  outline-offset: 1px;
}
.load-day > small {
  font-size: 10px;
  color: var(--muted);
}
.load-metric {
  border-left: 3px solid #79a34a;
  background: #f2f7ee;
  border-radius: 4px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  margin-top: 5px;
}
.load-metric b {
  font-size: 12px;
}
.load-metric.near {
  background: #fff8e6;
  border-color: #c39824;
}
.load-metric.over {
  background: #fff0f1;
  border-color: #c84957;
}
.load-metric .badge {
  font-size: 9px;
  align-self: flex-start;
  white-space: normal;
}
.load-incomplete {
  font-size: 10px;
  color: #986011;
  font-weight: 600;
}
.load-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.load-summary .order-block {
  margin-bottom: 0;
}
.load-summary small {
  line-height: 1.7;
  color: var(--muted);
}
.load-view table,
.production-admin-view table {
  width: 100%;
  min-width: 700px;
}
.load-view td,
.production-admin-view td {
  padding: 12px;
}
.load-view #load-day-detail > .order-block {
  margin-top: 18px;
}
.load-view .print-alert {
  margin: 14px 0;
}
.production-admin-view .heading {
  margin-bottom: 22px;
}
.production-admin-view .form-note {
  margin: 0;
}

.load-day.load-day-off {
  background: #dfe2e6;
  border-color: #cbd0d7;
}
.load-holiday {
  font-size: 10px;
  color: #7b8089;
  line-height: 1.3;
}
.load-orders-table .load-products-summary {
  white-space: normal;
  max-width: 450px;
  font-size: 12px;
}
.load-orders-table small {
  display: block;
  margin-top: 5px;
}
.load-order-breakdown > td {
  background: #f8f9fb;
  padding: 14px 24px !important;
}
.load-orders-table tfoot {
  background: #f7f8fa;
}
.load-day-total {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: right;
  padding: 8px 12px;
  border-left: 3px solid #79a34a;
  background: #f2f7ee;
  border-radius: 4px;
}
.load-day-total.near {
  border-color: #c39824;
  background: #fff8e6;
}
.load-day-total.over {
  border-color: #c84957;
  background: #fff0f1;
}
.load-day-total small {
  font-size: 11px;
}
.load-inconsistencies {
  border: 1px solid #ead4a1;
  border-radius: 7px;
  padding: 12px 16px;
  margin: 14px 0;
  background: #fffaf0;
  font-size: 12px;
}
.load-inconsistencies p {
  margin: 8px 0;
}
.load-inconsistencies small {
  color: #797362;
}

.sewing-split-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
.sewing-split-summary > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  text-align: left;
}
.sewing-split-summary strong {
  font-size: 17px;
}
.sewing-split-summary span {
  font-size: 12px;
  color: var(--muted);
}
.external-mini {
  font-size: 10px;
  color: #52733a;
  background: #f2f7ee;
  padding: 6px;
  border-radius: 4px;
}
.external-mini.near {
  background: #fff8e6;
  color: #8b6b1a;
}
.external-mini.over {
  background: #fff0f1;
  color: #ad3241;
}
.sewing-transfer-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}
.external-line-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.external-line-check input {
  flex: 0 0 14px;
  width: 14px;
  margin-top: 3px;
}
.external-transfer-table {
  overflow: auto;
  margin-top: 18px;
}
.external-transfer-table table {
  min-width: 0;
  font-size: 12px;
}
.external-transfer-table td {
  padding: 9px;
  white-space: normal;
}
.external-transfer-table input {
  width: 85px;
}
.external-history-filters {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.external-history-filters input,
.external-history-filters select {
  padding: 8px;
}
.external-history-filters label {
  min-width: 150px;
}
.load-view .heading {
  gap: 15px;
}
.stats-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}
.stats-controls .field {
  min-width: 160px;
}
.stats-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 22px;
}
.stats-card {
  text-align: left;
  background: #fff;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.stats-card span,
.stats-summary span {
  color: var(--muted);
  font-size: 12px;
}
.stats-card strong,
.stats-summary strong {
  display: block;
  font-size: 23px;
  margin: 9px 0;
}
.stats-card small,
.stats-summary small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.stats-selected {
  border-color: #a7bcda;
  background: #f6f9fd;
}
.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 0 18px 20px;
}
.stats-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.stats-trend {
  max-height: 340px;
  overflow: auto;
}
.stats-bar-row {
  display: grid;
  grid-template-columns: 78px 1fr 115px;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
  font-size: 11px;
}
.stats-bar-row strong {
  text-align: right;
}
.stats-track {
  height: 12px;
  background: #eef1f5;
  border-radius: 3px;
  overflow: hidden;
}
.stats-track > div {
  height: 100%;
  background: #8ba8cf;
  border-radius: 3px;
}
@media (max-width: 1100px) {
  .stats-quick {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-split {
    grid-template-columns: 1fr;
  }
  .stats-summary strong {
    font-size: 19px;
  }
}
.dashboard-production {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
}
.dashboard-shipping {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}
.dashboard-tile {
  width: 100%;
  min-width: 0;
}
.dashboard-tile strong {
  font-size: 22px;
  overflow-wrap: anywhere;
}
.dashboard-tile.free {
  border-left: 3px solid #248049;
}
.dashboard-tile.near {
  border-left: 3px solid #b18927;
}
.dashboard-tile.over {
  border-left: 3px solid #c4384c;
  background: #fff7f8;
}
.dashboard-alerts {
  padding: 8px 16px 16px;
}
.dashboard-alerts > button {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  width: 100%;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  text-align: left;
}
.dashboard-alerts h3 {
  font-size: 12px;
  margin-top: 22px;
}
@media (max-width: 1100px) {
  .dashboard-shipping {
    grid-template-columns: 1fr;
  }
}
#product-back {
  align-self: flex-start;
  text-align: left;
}
.bundle-components td:first-child {
  min-width: 440px;
  width: 55%;
}
.bundle-components td:first-child input {
  width: 100%;
  min-width: 410px;
}
.bundle-components td:not(:first-child) input {
  width: 105px;
}
.attachment-download {
  background: #24272e !important;
  color: #fff !important;
  border-color: #24272e !important;
}
.line-table {
  min-width: 1480px !important;
  table-layout: auto;
}
.line-table th,
.line-table td {
  vertical-align: middle;
}
.line-table th:nth-child(6),
.line-table td:nth-child(6),
.line-table th:nth-child(7),
.line-table td:nth-child(7),
.line-table th:nth-child(9),
.line-table td:nth-child(9),
.line-table th:nth-child(11),
.line-table td:nth-child(11) {
  text-align: right;
  min-width: 125px;
}
.line-table td:nth-child(6) input,
.line-table td:nth-child(7) input {
  width: 110px;
  text-align: right;
}
.line-table th:nth-child(8),
.line-table td:nth-child(8) {
  min-width: 78px;
  text-align: left;
}
.line-table th:nth-child(10),
.line-table td:nth-child(10) {
  min-width: 100px;
  text-align: left;
}
.line-table td:nth-child(10) select {
  width: 95px;
}
.line-table th:last-child,
.line-table td:last-child {
  width: 32px;
  min-width: 32px;
}
.line-table .line-files td {
  text-align: left !important;
}
.source-order > summary,
.source-audit > summary {
  cursor: pointer;
  padding: 8px 0;
}
.source-order + .source-order {
  border-top: 1px solid var(--line);
}
.source-preview {
  padding: 12px 0;
}
.source-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}
.source-facts span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}
.source-facts strong {
  font-size: 12px;
}
.source-contacts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.source-contact {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 14px;
}
.source-preview h3 {
  font-size: 13px;
  margin: 16px 0 10px;
}
.source-contact h3 {
  margin-top: 0;
}
.source-contact p {
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.source-subline {
  display: block;
  color: var(--muted);
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.source-note p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.source-preview .totals {
  flex-wrap: wrap;
}
.source-preview table {
  min-width: 720px;
}
.source-audit {
  margin-top: 20px;
}
@media (max-width: 1100px) {
  .source-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .source-contacts {
    grid-template-columns: 1fr;
  }
}
[hidden] {
  display: none !important;
}
.login-card {
  max-width: 440px;
  margin: 70px auto;
  background: white;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.login-card form {
  display: grid;
  gap: 16px;
}
.login-card label {
  display: grid;
  gap: 6px;
}
.login-card input {
  padding: 10px;
}
.app-error {
  color: #b42318;
  margin: 12px 0;
}
.app-notice {
  padding: 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.editor-actions {
  display: flex;
  gap: 8px;
}
.editor-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.editor-fields textarea {
  min-height: 90px;
}
.editor-fields input,
.editor-fields select,
.editor-fields textarea {
  width: 100%;
}
.component-row {
  display: flex;
  gap: 12px;
  margin: 8px 0;
}
.component-row input:first-child {
  flex: 1;
}
.component-row input[type="number"] {
  width: 100px;
}
.app-content {
  padding: 27px 28px;
}
.profile button {
  margin-left: 10px;
}
/* Application interactions added while keeping the reference's layout tokens. */
.catalog-pick {
  display: block;
  width: 100%;
  text-align: left;
  margin: 6px 0;
  padding: 10px;
}
.history-entry {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.history-entry ul {
  padding-left: 20px;
  color: var(--muted);
}
.new-client-search {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.order-error:empty {
  display: none;
}
.order-content .line-table td input {
  min-width: 70px;
}
.order-content .line-name input {
  min-width: 190px;
}

/* Keep unsaved changes visible also in the narrower application panel. */
.order-actions .save-state {
  display: inline;
  font-size: 11px;
}
.order-actions {
  flex-wrap: wrap;
}

.sms-dialog {
  max-height: 85vh;
  overflow: auto;
}
.sms-dialog textarea {
  width: 100%;
}
.sms-dialog [data-recipients] {
  margin-top: 14px;
}

.app-content:has(.order-view) {
  padding: 0;
}
.order-view .order-back {
  align-self: flex-start;
}
.line-table input[data-key="name"] {
  min-width: 180px;
  width: 100%;
  font-weight: 600;
}

[data-admin-content] {
  padding-top: 18px;
}
.permission-chip {
  display: inline-block;
  padding: 5px 9px;
  margin: 3px;
  background: #f3f4f6;
  border-radius: 5px;
  font-size: 12px;
}

/* Parity audit: module roots already own v0.31 spacing. */
.app-content:has(.crm-view),
.app-content:has(.products-view) {
  padding: 0;
}
.app-error:empty,
[role="alert"]:empty {
  display: none;
}
.app-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.module.active {
  background: white;
  box-shadow: 0 1px 3px #19202c0c;
}
.crm-save-actions {
  justify-content: flex-start;
  margin: 18px 0;
}

.product-dimension-options {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.product-dimension-options .check-field {
  margin: 0;
}

.sms-message-text {
  white-space: pre-wrap;
}

.row-actions {
  position: relative;
}
.order-row-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 20;
  min-width: 190px;
  display: grid;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border, #e4e7eb);
  border-radius: 8px;
  box-shadow: 0 8px 24px #0002;
}
.order-row-menu button {
  text-align: left;
  white-space: nowrap;
}
.order-row-menu button:disabled {
  opacity: 0.5;
}

/* Keep the fixed header and the scrolling order and list areas inside the app shell. */
.app-content:has(.order-view),
.app-content:has(.orders-list-view) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app-content:has(.order-view) #view,
.app-content:has(.orders-list-view) #view {
  display: flex;
  flex: 1;
  min-height: 0;
}
.order-view,
.orders-list-view {
  flex: 1;
  min-width: 0;
  min-height: 0;
}
.order-view > :not(.order-scroll) {
  flex-shrink: 0;
}
.orders-list-view {
  display: flex;
  flex-direction: column;
}
.orders-list-view > .heading,
.orders-list-view > .toolbar,
.orders-list-view > .basic-filters,
.orders-list-view > .filter-summary {
  flex-shrink: 0;
}
.orders-list-view .table-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.orders-list-view .table-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
}
.orders-list-view .pagination {
  flex-shrink: 0;
}
/* Order workspace extracted from the reference card, with module-local state. */
.order-menu {
  min-width: 265px;
}
.order-menu button {
  white-space: nowrap;
  text-align: left;
  width: 100%;
  padding: 12px 20px;
}
.save-state {
  white-space: nowrap;
}
.order-actions .primary:disabled {
  background: #a3a6ac;
  border-color: #a3a6ac;
  color: white;
  opacity: 1;
}
.line-expand {
  border: 0;
  background: none;
  color: #8b95a5;
  font-size: 22px;
  padding: 0 5px;
}
.line-table .line-name > input {
  border-color: transparent;
  background: transparent;
  font-weight: 650;
}
.line-table .line-name > input:focus {
  border-color: #bac6d6;
  background: white;
}
.file-summary {
  font-size: 11px;
  color: #8b95a5;
  margin: 6px 0;
}
.file-warning {
  color: #b87012;
}
.line-files {
  background: #fafbfc;
}
.line-files-inner {
  padding: 16px 30px;
  max-width: 1000px;
}
.files-title {
  font-weight: 600;
  margin-bottom: 12px;
}
.file-dimensions,
.print-file-row,
.add-files {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
.print-file-row input:first-child {
  flex: 1;
  width: auto;
}
.print-file-row input[type="number"] {
  width: 85px;
}
.add-files textarea {
  flex: 1;
  min-height: 68px;
}
.file-dimensions input {
  width: 200px;
}
.print-summary {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 12px;
}
.upload-drop {
  border: 2px dashed #e1e5ed;
  padding: 28px;
  text-align: center;
  border-radius: 6px;
}
.order-tabs {
  white-space: nowrap;
  overflow-x: auto;
}
.print-workspace table {
  width: 100%;
}
.document-preview {
  width: 100%;
  height: 60vh;
  border: 0;
  grid-column: 1/-1;
}
.attachment-preview-image {
  max-width: 100%;
  grid-column: 1/-1;
}
.files-summary {
  display: block;
  font-size: 11px;
  margin-top: 5px;
}
.files-summary.missing {
  color: #b87012;
}
.line-files-inner {
  padding: 0;
  max-width: 800px;
}
.line-files-inner .file-entry {
  max-width: 720px;
  margin: 6px 0;
}
.line-files-inner .file-entry input:first-child {
  flex: 1;
  width: auto;
}
.line-files-inner .file-entry input[type="number"] {
  width: 75px;
}
.line-files-inner .line-file-actions {
  margin-top: 12px;
}
.line-files-inner .form-note {
  margin: 10px 0 0;
}
.print-inline-dim {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #7b8290;
  font-size: 11px;
}
.sales-document-preview,
.attachment-text {
  grid-column: 1/-1;
}
.sales-document-preview table {
  width: 100%;
  min-width: 0;
}
.attachment-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media print {
  body:has(.sales-document-preview) > *:not(dialog) {
    display: none !important;
  }
  dialog:has(.sales-document-preview) {
    position: static;
    display: block;
    max-width: none;
    max-height: none;
    width: 100%;
    margin: 0;
    border: 0;
    box-shadow: none;
  }
  dialog:has(.sales-document-preview) .dialog-head,
  dialog:has(.sales-document-preview) .dialog-actions {
    display: none;
  }
  .sales-document-preview {
    color: black;
    background: white;
  }
}
/* Shared interaction convention: confirmation on the left, dismissal on the right. */
.dialog-actions > .primary {
  order: -1;
}
.order-row-menu {
  position: fixed;
  z-index: 1000;
  min-width: 200px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px #15213b26;
  padding: 6px;
  display: flex;
  flex-direction: column;
}
.order-row-menu button {
  display: block;
  width: 100%;
  border: 0;
  background: white;
  text-align: left;
  white-space: nowrap;
  padding: 10px 12px;
}
.order-row-menu button:hover {
  background: #f0f3f8;
}
.orders-list-view .row-actions {
  position: sticky;
  right: 0;
  background: #fff;
  min-width: 44px;
  width: 44px;
  text-align: center;
}
.orders-list-view th.row-actions {
  background: #f8f9fb;
}
.selection {
  gap: 20px;
  padding: 12px 18px;
  flex-wrap: wrap;
}
.selection .bulk-status {
  width: auto;
  min-width: 120px;
  font-weight: 650;
  padding: 6px 9px;
  border: 0;
  cursor: pointer;
}
.selection .bulk-status option {
  background: white;
  color: #272b33;
}
.selection button {
  background: white;
  padding: 6px 12px;
}
.payment-cod {
  background: #286bcc;
  color: white;
}

/* Administration tables should not inherit the large order-list minimum width. */
.app-content:has([data-sewing-standard]) table {
  min-width: 0;
  width: 100%;
}

#global-results:empty {
  display: none;
}
.search-suggestion {
  display: block;
  width: 100%;
  text-align: left;
  margin: 3px 0;
  padding: 9px 12px;
}
.search-suggestion small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
[data-client-results],
[data-product-results] {
  max-height: 280px;
  overflow: auto;
}
.product-picker {
  display: block;
}

/* Extracted reporting views: contain inherited order-table sizing. */
.statistics-view .table-scroll table { min-width: 0; }
.statistics-view .stats-split > section { min-width: 0; }
.invoices-view #invoice-query { min-width: 350px; }
[data-invoice-columns-list] { grid-column: 1 / -1; width: 100%; }
.external-transfer-table, .external-transfer-note { grid-column: 1 / -1; }
.external-transfer-note { font-size: 12px; margin-top: 4px; }
.gus-nip-field { display: grid; grid-template-columns: minmax(100px, 1fr) auto; gap: 8px; align-items: end; }
.gus-nip-field button { white-space: nowrap; }
.gus-message { grid-column: 1 / -1; margin: 0; }
.gus-message:empty { display: none; }

.carrier-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
[data-carrier-integrations] > h2 { margin: 24px 0 12px; }
[data-carrier] [data-carrier-result] { max-width: 100ch; }

/* Global search uses compact rows; other suggestion pickers keep their layout. */
#global-results { padding: 0; }
#global-results .search-suggestion {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  margin: 0;
  box-shadow: none;
  background: white;
  padding: 10px 14px;
}
#global-results .search-suggestion:last-child { border-bottom: 0; }
#global-results .search-suggestion:hover,
#global-results .search-suggestion:focus-visible { background: #f1f4fa; }

/* Compact selection lists and order line controls. */
[data-product-results] .search-suggestion { display:flex; width:100%; border:0; border-radius:0; border-bottom:1px solid #e4e7ec; gap:12px; text-align:left; justify-content:space-between; box-shadow:none; margin:0; }
[data-product-results] { display:block; }
.line-moves { display:inline-flex; flex-direction:column; vertical-align:middle; margin-right:5px; }
.line-moves button { padding:0 5px; font-size:12px; }
[data-sewing-line] { margin-right:10px; }

a.module, a.nav-status, a.order-link, a.text-button, a.product-name { text-decoration:none; cursor:pointer; }
a.module, a.nav-status, a.order-link, a.product-name { color:inherit; }
a.module, a.nav-status { box-sizing:border-box; }
a.order-link, a.product-name { font-weight:600; }
a:focus-visible { outline:2px solid #2866cc; outline-offset:2px; }

/* Keep shipment downloads reachable when the wide register scrolls. */
.shipment-table th:last-child, .shipment-table td:last-child { position:sticky; right:0; background:var(--surface, #fff); z-index:1; box-shadow:-3px 0 5px #00000008; }

.line-table tr:not(.line-files) > td:first-child { min-width:65px; white-space:nowrap; }
[data-product-results] .search-suggestion small { margin-top:0; flex-shrink:0; }

/* Native order links retain the compact action-button presentation. */
.print-alert a[data-order] { display:inline-block; padding:6px 10px; margin:3px 6px; border:1px solid var(--line); border-radius:6px; background:white; color:var(--text); font-size:12px; text-decoration:none; }
.print-alert a[data-order]:hover { background:#f1f4fa; }
.line-drag { display:inline-block; user-select:none; cursor:grab; touch-action:none; padding:3px 7px; }
.line-drag:active { cursor:grabbing; }
.line-table tr.drag-target { outline:2px solid #71849a; outline-offset:-2px; }
.xlsx-actions { display:flex; gap:8px; align-items:center; }
.button-link { display:inline-block; padding:8px 12px; border:1px solid var(--line); border-radius:7px; background:white; color:var(--text); text-decoration:none; font-size:12px; }
.xlsx-dialog { width:min(900px,95vw); }
.xlsx-dialog .table-scroll { max-height:45vh; overflow:auto; }
.xlsx-dialog [data-import-report] { margin-top:16px; }

.shipping-prepare {max-width:1500px;margin:0 auto}.shipping-addresses {display:grid;grid-template-columns:1fr 1fr;gap:20px}.shipping-parcel {border:1px solid var(--border,#ddd);border-radius:8px;padding:16px;margin-bottom:14px}.shipping-prepare .product-fields {display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px}.shipping-prepare .wide {grid-column:1 / -1}.shipping-prepare [data-points] {display:flex;flex-direction:column;align-items:stretch;gap:4px}.shipping-prepare td {padding:12px}.shipping-prepare .dialog-actions {position:sticky;bottom:0;background:#fff;padding:16px;border-top:1px solid #ddd}@media(max-width:850px){.shipping-addresses{grid-template-columns:1fr}}

/* Shipping forms: checkboxes keep their intrinsic width inside field grids. */
.shipping-prepare .shipping-check {display:flex;flex-direction:row;align-items:center;align-self:center;justify-content:flex-start;gap:8px;line-height:1.5;min-height:36px;}
.shipping-prepare .shipping-check input[type="checkbox"] {width:16px;height:16px;min-width:16px;flex:0 0 16px;margin:0;}
.shipping-parcel-actions {display:flex;flex-wrap:wrap;gap:16px;padding:18px 4px 4px;margin-top:6px;}
.shipment-actions {flex-wrap:wrap;}
.shipment-actions .button {padding:6px 8px;font-size:11px;white-space:nowrap;}
.shipment-detail-content {grid-column:1 / -1;min-width:0;}
.shipment-detail-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
.shipment-detail-content p {overflow-wrap:anywhere;line-height:1.7;}
@media(max-width:600px){.shipment-detail-grid{grid-template-columns:1fr;}}
.shipping-prepare a.button, [data-results] a.button, .shipment-actions a.button {display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:var(--radius);padding:9px 13px;background:white;color:var(--text);text-decoration:none;cursor:pointer;font:inherit;}
.shipment-actions a.button {padding:6px 8px;font-size:11px;}
.shipping-prepare a.button:hover,[data-results] a.button:hover,.shipment-actions a.button:hover {background:#edf0f4;}
[data-wfirma] .actions {display:flex;flex-wrap:wrap;gap:8px;margin:12px 0;}
[data-wfirma] [data-vat] {display:grid;gap:10px;margin-top:12px;}

.document-issued-notice { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:8px 12px; margin:8px 0; width:fit-content; max-width:100%; justify-self:start; flex:0 0 auto; box-sizing:border-box; border:1px solid var(--border, #dfe3e9); border-radius:10px; background:#fff; grid-column:1 / -1; }
.document-issued-notice span { line-height:1.5; overflow-wrap:anywhere; }
.document-issued-notice .document-download-button { background:#222; color:#fff; border:1px solid #222; padding:6px 12px; white-space:nowrap; border-radius:8px; }
.archive-fields {display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;padding:20px;background:white;border:1px solid #dfe3e9;border-radius:10px;overflow-wrap:anywhere;}

/* Shipping and catalogue controls stay usable at narrow widths. */
.shipping-prepare .dialog-actions, .parcel-actions, .products-selection {display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.shipping-prepare .dialog-actions {z-index:5}
.parcel-actions {grid-column:1 / -1;margin-top:8px}
.allegro-prepare [data-parcel] {border-bottom:1px solid var(--line);padding:18px}
.allegro-prepare [data-add] {margin:16px}
.shipping-addresses > *, .shipping-prepare .product-fields > * {min-width:0}
.shipping-prepare input,.shipping-prepare select {max-width:100%;box-sizing:border-box}
.product-dictionary-item {display:flex;justify-content:space-between;gap:16px;align-items:center;padding:8px 0}
[data-material-list] { display:grid; gap:6px; max-height:54vh; overflow:auto; }
.product-material-label { display:grid; gap:3px; min-width:0; }
.product-material-label small { color:#555; overflow-wrap:anywhere; }
.product-material-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; max-width:56%; }

.products-selection {margin:12px 0}
.danger {color:#b42318}
#profile-name {font-weight:700}
.catalog-mappings {overflow:auto}

/* Zadania i operacyjny Dashboard */
.task-filters {display:flex;flex-wrap:wrap;gap:12px;align-items:end}
.task-filters .field {min-width:140px;flex:1}
.task-object-link {display:block;margin-top:6px}
.task-detail-meta {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px;margin:0}
.task-detail-meta dt {color:var(--muted);font-size:12px;margin-bottom:6px}
.task-detail-meta dd {margin:0;font-weight:600}
.task-detail-description {margin-top:22px;border-top:1px solid var(--line);padding-top:16px}
.task-description {white-space:pre-wrap;overflow-wrap:anywhere}
.task-detail-section {padding:20px;margin-top:16px}
.task-detail-section h2,.task-detail-description h2 {font-size:16px;margin:0 0 14px}
.task-detail-section form {display:grid;gap:12px}
.task-detail-section form button {justify-self:start}
.task-more summary {cursor:pointer;padding:10px 0;font-weight:600}
.task-more .field {margin-top:12px}
.task-complete {white-space:nowrap;border:1px solid var(--line);border-radius:6px;background:white;color:var(--green);padding:6px 10px;cursor:pointer}
.task-complete:hover {background:#edf8ef;border-color:var(--green)}
.task-status-select {min-width:142px;max-width:180px;border:1px solid var(--line);border-radius:6px;padding:7px 9px;background:white;font:inherit;cursor:pointer}
.task-row-actions {white-space:nowrap}
.task-row-actions button {margin-right:6px}
.dashboard-tasks {margin-bottom:16px}
.dashboard-tasks-body {padding:14px 18px}
.dashboard-task-counters {display:flex;flex-wrap:wrap;gap:10px;margin-bottom:12px}
.dashboard-task-counter {padding:8px 12px;border:1px solid var(--line);border-radius:6px;color:var(--text);text-decoration:none}
.dashboard-task-counter.overdue,.dashboard-task-counter.urgent {background:#fff1f0;color:#b42318}
.dashboard-task-list {display:grid;gap:0}
.dashboard-task-row {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:9px 0;border-bottom:1px solid var(--line)}
.dashboard-task-team {margin-top:14px}
.dashboard-task-team summary {cursor:pointer;font-weight:600;padding:10px 0}
.task-team-totals {font-weight:400;margin-left:12px;color:var(--muted)}
.dashboard-task-error:empty {display:none}
.task-notifications .notification {padding:12px;border-bottom:1px solid var(--line)}
.task-notifications .unread {background:#eef4ff}
#profile-button {display:flex;align-items:center;gap:7px}
.dashboard-production,.dashboard-shipping,.dashboard-alerts {padding:14px 18px;display:grid;gap:12px}
.dashboard-capacity .capacity-heading {display:flex;justify-content:space-between;gap:12px;margin-bottom:7px}
.capacity-track {width:100%;height:12px;display:block}
.capacity-track::-webkit-meter-bar {background:#e9edf2;border:0;border-radius:6px}
.capacity-track::-webkit-meter-optimum-value {background:#5a9369;border-radius:6px}
.dashboard-capacity.danger .capacity-track::-webkit-meter-optimum-value {background:#d04444}
.dashboard-capacity.warning .capacity-track::-webkit-meter-optimum-value {background:#dfa735}
.dashboard-alerts a {text-decoration:none;color:inherit}
.attention-item {padding:11px 13px;border-radius:6px;display:flex;justify-content:space-between;gap:12px;background:#fff5df;border-left:3px solid #dfa735}
.attention-item.danger {background:#fff0ef;color:#a92d26;border-left-color:#d04444}
.attention-clear {color:var(--muted);padding:8px 0}
.dashboard-tomorrow {margin:0 18px 16px;padding:12px;border:1px solid var(--line);border-radius:6px}
.dashboard-tomorrow.danger {background:#fff0ef;border-color:#f1bbb8}
.attention-note {display:block;margin-top:5px;color:var(--muted);font-size:12px}
.dashboard-sales {margin-top:16px}
.dashboard-sales .stats-card {padding:12px}
@media(max-width:800px){.task-detail-meta{grid-template-columns:repeat(2,minmax(0,1fr))}.task-team-totals{display:block;margin:6px 0}.dashboard-task-row{align-items:flex-start}}

body[data-tasks-write="false"] [data-task-object],.tasks-readonly [data-new],.tasks-readonly [data-rule],.tasks-readonly [data-child],.tasks-readonly [data-action],.tasks-readonly [data-comment] {display:none}
#profile-name {display:flex;align-items:center;gap:7px}
.dashboard-task-counter {display:inline-flex;gap:8px;align-items:center}
.dashboard-task-counter.today {background:#f3f5f9;color:var(--text)}
.dashboard-task-row > a {display:grid;gap:4px}
.dashboard-task-row .subtext {font-weight:400;color:var(--muted)}

.dashboard-logistics {margin-top:16px;align-items:stretch}
.dashboard-single {grid-template-columns:1fr}
.dashboard-dispatch .dashboard-shipping {grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:12px}
.dashboard-dispatch .stats-card {padding:10px;min-height:0}
.dashboard-dispatch .stats-card strong {font-size:22px;margin:5px 0}
.dashboard-next .dashboard-tomorrow {display:grid;gap:10px;width:calc(100% - 36px);text-align:left}
.dashboard-sales .dashboard-shipping {grid-template-columns:repeat(3,minmax(0,1fr))}
.dashboard-capacity.warning {color:#8a5b00}
.dashboard-capacity.danger {color:#b42318}
@media(max-width:800px){.dashboard-dispatch .dashboard-shipping,.dashboard-sales .dashboard-shipping{grid-template-columns:1fr}}
.dashboard-alerts > .attention-item.warning {background:#fff5df;border-left:3px solid #a96b00;color:#784c00}
.dashboard-alerts > .attention-item.danger {background:#fff0ef;border-left:3px solid #d04444;color:#a92d26}
.dashboard-capacity.warning .capacity-track::-webkit-meter-optimum-value {background:#a96b00}

/* Compact notifications anchored below the bell, in the browser top layer. */
.notifications-popover {margin:0;width:420px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 90px);padding:0;border:1px solid var(--line);border-radius:10px;background:white;color:var(--text);box-shadow:0 12px 35px #18243a26;overflow:auto}
.notifications-popover header,.notifications-popover footer {display:flex;justify-content:space-between;align-items:center;padding:14px 16px;gap:12px}
.notifications-popover header {border-bottom:1px solid var(--line)}
.notifications-items {max-height:380px;overflow:auto}
.notifications-popover .notification {display:grid;gap:7px;padding:14px 16px;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.notifications-popover .notification.unread {background:#f1f6ff}
.notifications-popover .notification a {color:var(--text);text-decoration:none;font-weight:600;line-height:1.45}
.notifications-popover .notification small {color:var(--muted)}
.notifications-popover .notification button {justify-self:start;font-size:12px}
.notifications-popover [role=alert]:empty {display:none}
.notifications-popover [role=alert] {padding:0 16px;color:#b42318}
.dashboard-alerts > .attention-item {padding:12px 16px;box-sizing:border-box;gap:16px;text-align:left}
.dashboard-alerts > .attention-item span {min-width:0;overflow-wrap:anywhere}
.dashboard-alerts > .attention-item strong {white-space:nowrap}
.dashboard-next .dashboard-tomorrow {margin:16px 18px;padding:14px 16px;box-sizing:border-box;line-height:1.5}
.dashboard-next .dashboard-tomorrow span {white-space:normal;overflow-wrap:anywhere}
.task-more-link {display:inline-block;margin-top:12px}
.dashboard-task-row > a {min-width:0;overflow-wrap:anywhere}
.dashboard-task-row .task-complete {flex-shrink:0}
.notifications-items > p {padding:14px 16px;margin:0;color:var(--muted)}

.tasks-view > .heading,.task-detail > .heading {justify-content:flex-end;gap:10px}
.tasks-view > .heading h1,.task-detail > .heading h1 {margin-right:auto}
a.button,a.button:visited,a.order-back,a.order-back:visited,.task-detail a,.task-detail a:visited,.crm-view a,.crm-view a:visited {color:var(--text);text-decoration:none}
a.button {display:inline-flex;align-items:center;gap:6px}
.task-detail > a.button,.heading a.order-back {display:inline-flex;margin:0 0 14px;padding:0;background:transparent;border:0}
.task-detail a:hover,.crm-view a:hover {color:var(--blue)}
#profile-name {height:38px;padding:0 12px;box-sizing:border-box}
#profile-name .avatar {width:24px;height:24px;font-size:11px}
#notifications-button.has-unread {background:#fff0d6;border-color:#d99b36;color:#794a00}
.logistics-note {margin-bottom:16px;background:#fff8e8}
.logistics-note p {white-space:pre-wrap;margin:8px 0 0}
#view a[href^="#/"],#view a[href^="/api/tasks/"] {color:var(--text);text-decoration:none}
#view a[href^="#/"]:hover,#view a[href^="/api/tasks/"]:hover {color:var(--blue)}
a.button {padding:9px 13px;border:1px solid var(--line);border-radius:var(--radius);background:white;line-height:normal}
.task-detail > a.button,.heading a.order-back {padding:0;border:0;background:transparent;margin-bottom:14px}
.load-view details > .toolbar {margin:12px 0}

.ps-product-target { display: grid; gap: 14px; }
.ps-rules-tabs button[aria-pressed="true"] { background: #262c35; color: #fff; border-color: #262c35; }

/* Order contact and merge previews */
.contact-summary .buyer-login { margin-bottom: 16px; }
.shipping-contact-warning { padding: 10px 12px; background: #fff5db; color: #805200; border-radius: 7px; margin-top: 12px; }
.contact-summary .source-delivery { margin-top: 24px; }
.merge-order-preview { min-width: 0; overflow-x: auto; }
.merge-order-preview p { margin: 16px 0; line-height: 1.5; }
.merge-order-preview table { width: 100%; table-layout: fixed; }
.merge-order-preview td, .merge-order-preview th { padding: 10px; overflow-wrap: anywhere; text-align: left; vertical-align: top; }

.task-members { display: grid; gap: 16px; }
.task-members form { border: 1px solid var(--border, #ddd); border-radius: 8px; padding: 16px; }
.task-member-options { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 12px 0; }
.detail-dialog .merge-order-preview th,
.detail-dialog .merge-order-preview td { width: auto; min-width: 0; max-width: none; white-space: normal; }
.detail-dialog .merge-order-preview th:nth-child(1),
.detail-dialog .merge-order-preview td:nth-child(1) { width: 24%; }
.detail-dialog .merge-order-preview th:nth-child(2),
.detail-dialog .merge-order-preview td:nth-child(2) { width: 16%; }
.detail-dialog .merge-order-preview th:nth-child(3),
.detail-dialog .merge-order-preview td:nth-child(3) { width: 34%; }
.detail-dialog .merge-order-preview th:nth-child(4),
.detail-dialog .merge-order-preview td:nth-child(4) { width: 26%; }

/* Hide application navigation until the session is confirmed. */
body.signed-out .sidebar,
body.signed-out .topbar { display: none; }
body.signed-out .workspace { margin-left: 0; }
body.checking-staff-session :is(.sidebar, .topbar, #mobile-menu-backdrop, #view, #message, #editor-dialog, [data-staff-overlay]) {
  display: none !important;
}
body.checking-staff-session .workspace { margin-left: 0; }
/* Issuance result occupies its own row, never pushes actions outside the viewport. */
.order-title-row { flex-wrap: wrap; }
.order-title-row > div { min-width: 0; }
.order-actions { flex-wrap: wrap; max-width: 100%; }
.document-issued-notice { min-width: 0; flex-shrink: 1; }

.orders-list-table [data-sort],
.orders-list-table .order-list-cell,
.orders-list-table .order-list-cell .badge {
  white-space: normal;
  overflow-wrap: anywhere;
}
.orders-list-table .order-list-cell {
  overflow: hidden;
}
.orders-list-table .order-list-cell .badge {
  max-width: 100%;
}
.order-list-status-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.order-list-status-badges > .badge {
  line-height: 1.2;
  padding-inline: 6px;
}

/* Keep customer names inside user-sized order columns, also under strict CSP. */
.order-client-name {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  overflow: hidden;
  line-height: 1.4;
}
.order-client-flag {
  display: inline-block;
  margin-right: 6px;
  line-height: 1;
  vertical-align: -1px;
}
svg.order-client-flag {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 18%);
}

.notification-actions {display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.notifications-popover .notification-actions .small-button {display:inline-flex;align-items:center;width:auto;margin:0;padding:5px 8px;border:1px solid var(--line);border-radius:6px;background:white;font-size:12px;font-weight:500;line-height:1.4;text-decoration:none}

/* Leave room for focus outlines and fixed-width selection controls. */
.basic-filters .filter-scroll {padding:5px 5px 7px}
.orders-list-table > thead > tr > th:first-child,
.orders-list-table > tbody > tr.order > td:first-child {padding-left:8px;padding-right:8px}
.orders-list-table :is([data-all], [data-check]) {
  width: 18px;
  height: 18px;
  min-width: 18px;
}
.print-table [data-print-select] {
  width: 16px;
  height: 16px;
}
.orders-list-table > tbody > tr.order:has(> td:first-child > [data-check]:checked),
.print-table > tbody > tr:has(> td:first-child > [data-print-select]:checked) {
  background-color: #edf3ff;
}
.orders-list-table > tbody > tr.order:has(> td:first-child > [data-check]:checked) > .row-actions {
  background-color: inherit;
}
.print-table > tbody > tr:has(> td:first-child > [data-print-select]:checked) .print-warning {
  color: #895a0b;
}

.packing-content-row { display:flex; gap:12px; align-items:center; margin:8px 0; }
.packing-content-row > span:first-child { flex:1; min-width:0; }
.packing-content-row input { width:100px; }

.noname.saturday-delivery { background: #fde047; color: #422006; }
.noname.next-day-delivery { background: #bbf7d0; color: #14532d; }
.order-own-tasks { flex: 0 0 auto; padding: 12px 16px; background: #fff8d6; border: 1px solid #e7ca62; border-radius: 6px; margin-bottom: 10px; }
.order-own-tasks a { display: block; padding: 5px 0; color: #624508; font-weight: 600; }

.order-own-task { display: flex; align-items: center; gap: 12px; }
.order-own-task a { flex: 1; }
.order-own-task .task-complete { flex-shrink: 0; }

.permission-group { border: 1px solid #e0e5ed; border-radius: 10px; padding: 12px 14px; }
.permission-group summary { cursor: pointer; font-weight: 600; }
.permission-group summary small { margin-left: 10px; color: #64748b; font-weight: 400; }
.permission-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; padding-top: 16px; }
.permission-options .check-field { align-items: flex-start; font-size: 14px; }
.permission-sensitive { color: #8a4f00; font-size: 11px; margin-left: 6px; }
.module-access-card { border: 1px solid #e0e5ed; border-radius: 12px; padding: 16px; }
.module-access-card h3 { margin: 0 0 8px; }
.module-access-card > .field { margin-bottom: 12px; }
@media (max-width: 650px) { .permission-options { grid-template-columns: 1fr; } }
.permission-role-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.permission-role-groups .wide { grid-column: auto !important; }
.permission-role-groups .permission-options { grid-template-columns: 1fr; }
.permission-role-groups summary small { display: block; margin: 4px 0 0 15px; }
@media (max-width: 650px) { .permission-role-groups { grid-template-columns: 1fr; } }

.notifications-popover footer {
  flex-wrap: wrap;
}
.notifications-popover footer small {
  flex-basis: 100%;
  color: var(--muted);
}
.notification-pages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

/* Local workflow: compact metadata and managed production finishing. */
.order-metadata {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px;
  margin-bottom: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.order-metadata .payment-summary {
  width: 100%;
  gap: 12px;
}
.order-metadata .payment-summary > .field {
  flex: 0 0 140px;
  min-width: 0;
}
.order-metadata .payment-summary > .field:nth-child(1) {
  flex-basis: 145px;
}
.order-metadata .payment-summary > .field:nth-child(3) {
  flex-basis: 170px;
}
.order-metadata .payment-summary > .field:nth-child(4) {
  flex-basis: 95px;
}
.order-metadata .payment-summary > .field:nth-child(5) {
  flex: 0 1 220px;
  max-width: 220px;
}
.order-operations .check-field {
  white-space: nowrap;
}
.finishing-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 2fr);
  gap: 12px;
  margin: 12px 0;
}
.line-files-inner .file-row {
  max-width: 720px;
  margin: 6px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e6e6e6;
}
.file-finishing {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 2fr);
  gap: 12px;
  margin-top: 6px;
}
.file-finishing textarea {
  min-height: 44px;
}
@media (max-width: 640px) {
  .file-finishing {
    grid-template-columns: 1fr;
  }
}
.finishing-fields textarea {
  min-height: 64px;
}
.finishing-fields > p {
  grid-column: 1 / -1;
}
@media (max-width: 640px) {
  .order-metadata .payment-summary > .field:nth-child(n) {
    flex: 1 1 100%;
    min-width: 0;
  }
  .order-operations {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .order-metadata .payment-summary .actions {
    flex-wrap: wrap;
    margin-left: 0;
  }
  .finishing-fields {
    grid-template-columns: 1fr;
  }
}

/* At-a-glance combined sewing capacity, available throughout the application. */
.sewing-summaries { flex: 0 0 410px; margin: 0 16px; }
.sewing-summary-title { display: block; color: var(--muted); font-size: 10px; line-height: 12px; }
.sewing-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sewing-summary { min-width: 0; text-decoration: none; color: var(--text); font-size: 11px; }
.topbar:has(.sewing-summaries) .global-search { flex: 0 1 240px; max-width: 260px; min-width: 140px; }
.sewing-summary > span:first-child { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 4px; }
.sewing-summary small { color: var(--muted); }
.sewing-summary strong { display: block; font-size: 12px; line-height: 18px; }
.sewing-summary { --sewing-color: #36a47a; }
.sewing-summary-bar { appearance: none; display: block; width: 100%; height: 5px; border: 0; border-radius: 4px; background: #e7edf2; overflow: hidden; accent-color: var(--sewing-color); }
.sewing-summary-bar::-webkit-progress-bar { background: #e7edf2; border-radius: 4px; }
.sewing-summary-bar::-webkit-progress-value { background: var(--sewing-color); border-radius: 4px; }
.sewing-summary-bar::-moz-progress-bar { background: var(--sewing-color); border-radius: 4px; }
.sewing-summary[data-tone="near"] { --sewing-color: #c58a20; }
.sewing-summary[data-tone="over"] { --sewing-color: #d65353; }
.sewing-summary[data-tone="unknown"] { --sewing-color: #8892a3; }
.task-assignment { border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.task-assignment .form-note { margin: 0 0 10px; }
.task-assignment-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.task-assignment-groups > div { max-height: 180px; overflow: auto; }
.task-assignment-groups strong { display: block; margin-bottom: 8px; }
.task-assignment-groups .check-field { margin-bottom: 7px; }
@media (max-width: 1100px) { .sewing-summaries { margin: 0 8px; flex-basis: 380px; } .sewing-summary-grid { gap: 8px; } }
@media (max-width: 1400px) { .topbar:has(.sewing-summaries) { height: auto; min-height: 64px; flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; } .sewing-summaries { order: 3; flex-basis: 100%; margin: 0; } }
@media (max-width: 700px) { .task-assignment-groups { grid-template-columns: 1fr; } }

@media (max-width: 640px) { .order-metadata .payment-summary > .field:nth-child(5) { max-width: 100%; } .sewing-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; } }

.sewing-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 18px 18px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.sewing-progress > div { display: grid; align-content: start; gap: 6px; min-width: 0; }
.sewing-progress span, .sewing-progress small { color: var(--muted); }
.sewing-progress strong { font-size: 22px; }
.sewing-progress progress { width: 100%; height: 8px; accent-color: #36a47a; }
.sewing-progress.over { border-color: #e7aaa4; background: #fff8f7; }
.sewing-progress.over > div:last-of-type strong { color: #b42318; }
.sewing-progress > p { grid-column: 1 / -1; margin: 0; }
@media (max-width: 700px) { .sewing-progress { grid-template-columns: 1fr; } }

.shop-mail-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.shop-mail-preview-toolbar [aria-pressed="true"] {
  color: #fff;
  background: #237c38;
  border-color: #237c38;
}
.shop-mail-preview-shell {
  padding: 12px;
  margin: 0 0 20px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}
.shop-mail-preview-frame {
  display: block;
  width: 100%;
  max-width: 880px;
  height: 780px;
  margin: 0 auto;
  border: 0;
  background: #fff;
}
.shop-mail-preview-frame.is-mobile {
  max-width: 375px;
}
.print-shop-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 6px 0 2px;
  font-size: 12px;
}
.print-shop-line .badge,
.print-shop-badge {
  background: #e8eefc;
  color: #1f3f8f;
}
.print-shop-lines {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #dddddd;
}
