.orders-title-sub {
  display:block;
  font-size:12px;
  font-weight:400;
  color:var(--muted);
  margin-top:6px;
  letter-spacing:0
}

.orders-page .page-head .btn {
  display:flex;
  align-items:center
}

.orders-overview {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin:12px 0 14px
}
@media(min-width:1101px) { .orders-overview.has-profit { grid-template-columns:repeat(5,minmax(0,1fr)) } }
@media(min-width:761px) and (max-width:1100px) { .orders-overview.has-profit { grid-template-columns:repeat(3,minmax(0,1fr)) } }

.orders-stat {
  background:#fff;
  border:1px solid #edf0f4;
  border-radius:10px;
  padding:14px;
  min-height:94px;
  display:flex;
  align-items:flex-start;
  gap:14px;
  min-width:0
}

.orders-stat>div {
  min-width:0;
  flex:1
}

.orders-stat-icon {
  background:#eaf0ff;
  color:#0752ec;
  display:grid;
  place-items:center;
  width:46px;
  height:46px;
  border-radius:12px;
  flex-shrink:0
}

.orders-stat.green .orders-stat-icon {
  background:#e6f5ef;
  color:#16986f
}

.orders-stat.red .orders-stat-icon {
  background:#ffedf0;
  color:#ed5369
}

.orders-stat-label {
  font-size:11px;
  line-height:1.2;
  color:#667085;
  margin:0 0 5px
}

.orders-stat-value {
  font-size:18px;
  line-height:1.2;
  font-weight:750;
  letter-spacing:-.3px;
  overflow-wrap:anywhere
}

.orders-stat.blue .orders-stat-value {
  font-size:24px
}

.orders-stat-note {
  font-size:10px;
  color:#707a8b;
  margin-top:3px;
  line-height:1.3
}

.orders-stat-track {
  height:6px;
  border-radius:5px;
  background:#f3f6f9;
  margin-top:4px;
  overflow:hidden
}

.orders-stat-track i {
  display:block;
  height:100%;
  background:#17a275;
  border-radius:5px
}

.orders-stat.red .orders-stat-track i {
  background:#f46a78
}

.orders-filters.card {
  padding:11px 14px;
  margin-bottom:14px
}

.orders-search-row {
  display:flex;
  align-items:center;
  gap:16px;
  margin-bottom:6px
}

.orders-search {
  position:relative;
  flex:1;
  max-width:520px
}

.orders-search>.ui-icon {
  position:absolute;
  left:12px;
  top:10px;
  color:#667085
}

.orders-search .inp {
  padding-left:36px;
  font-size:12px
}

.orders-reset {
  margin-left:auto;
  border:0;
  background:none;
  color:#1760de;
  font-size:11px;
  cursor:pointer;
  white-space:nowrap
}

.orders-filters .btn {
  font-size:11px
}

.orders-filters .filters {
  margin:0;
  gap:8px
}

.orders-filters .filters>select {
  flex:1;
  min-width:125px;
  max-width:170px;
  font-size:12px
}

.orders-date-range {
  display:flex;
  align-items:center;
  gap:6px;
  border:1px solid var(--border);
  border-radius:8px;
  padding:0 9px;
  background:white
}

.orders-date-range>.ui-icon {
  color:#667085;
  flex-shrink:0
}

.orders-filters .orders-date-range .inp {
  min-width:0;
  width:120px;
  border:0;
  padding:7px 0;
  font-size:11px;
  background:transparent;
  box-shadow:none
}

.orders-more-filters {
  display:flex;
  gap:20px;
  flex-wrap:wrap;
  padding-top:12px;
  border-top:1px solid var(--border);
  margin-top:12px
}

.orders-more-filters[hidden] {
  display:none
}

.orders-more-filters .mg-tg {
  font-size:12px;
  margin:0
}

.orders-table-card.card {
  padding:0 14px 0;
  border-color:#edf0f4;
  overflow:visible
}

.orders-table-scroll {
  overflow-x:auto;
  min-width:0;
  max-width:100%;
  padding-bottom:48px;
  margin-bottom:-48px
}

.orders-table {
  min-width:920px
}

.orders-table th {
  background:#f7f9fc;
  font-size:10px;
  padding:10px 8px
}

.orders-table td {
  padding:9px 8px;
  font-size:12px;
  border-bottom:1px solid #f0f2f6
}

.orders-table .sub {
  font-size:11px;
  margin-top:4px
}

.orders-table .order-list-number {
  font-size:13px;
  font-weight:700;
  display:flex;
  align-items:center;
  gap:6px
}

.orders-table .order-list-deal,.orders-table .order-list-created {
  display:none
}

.orders-table .order-list-code {
  margin-top:3px
}

.orders-table .badge,.orders-table .st-badge {
  font-size:10px;
  padding:3px 9px;
  border:0;
  font-weight:650
}

.orders-table .orders-check-col {
  width:32px;
  padding-left:3px;
  padding-right:8px
}

.orders-table input[type=checkbox],.orders-selection input[type=checkbox] {
  width:14px;
  height:14px;
  accent-color:#0752ec;
  cursor:pointer
}

.orders-table .mg td:first-child {
  box-shadow:none
}

.orders-table .mg {
  --mgbg:transparent;
  --mgbgh:#f8faff
}

.orders-table .mg td:nth-child(8) {
  color:var(--mg)
}

.orders-row-menu {
  position:relative;
  display:inline-block;
  text-align:left
}

.orders-row-menu summary {
  display:grid;
  place-items:center;
  list-style:none;
  cursor:pointer;
  width:28px;
  height:28px;
  color:#515b6c;
  border-radius:5px
}

.orders-row-menu summary::-webkit-details-marker {
  display:none
}

.orders-row-menu summary:hover {
  background:var(--accent-light)
}

.orders-row-menu>div {
  position:absolute;
  right:0;
  top:30px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  padding:5px;
  box-shadow:0 10px 30px #25355222;
  min-width:175px;
  z-index:30
}

.orders-row-menu button {
  display:flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
  width:100%;
  text-align:left;
  background:none;
  border:0;
  padding:9px;
  font-size:12px;
  cursor:pointer;
  border-radius:5px
}

.orders-row-menu button:hover {
  background:#f3f6fa
}

.orders-row-menu .del {
  color:var(--danger)
}

.orders-table-card .orders-pagination {
  font-size:11px;
  gap:8px
}

.orders-table-card .orders-pagination .help {
  color:#475467;
  font-size:11px
}

.orders-table-card .orders-pagination label {
  margin-left:auto;
  font-size:11px;
  gap:6px
}

.orders-table-card .orders-pagination select {
  padding:5px 8px;
  font-size:11px
}

.orders-table-card .orders-page-buttons {
  flex-wrap:nowrap
}

.orders-table-card .orders-page-buttons .btn {
  font-size:11px;
  padding:6px 9px;
  min-width:28px;
  border-radius:6px
}

.orders-page-buttons .btn>.ui-icon {
  width:12px;
  height:12px
}

.orders-table-card .orders-page-buttons [aria-current=page] {
  background:#0752ec
}

.orders-table-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  flex-shrink:0;
  gap:8px 16px;
  min-height:48px;
  padding:8px 12px;
  margin-top:auto;
  border-top:1px solid var(--border);
  background:var(--card,#fff)
}

.orders-table-footer .orders-pagination {
  flex:1;
  min-width:0;
  margin:0;
  justify-content:flex-end
}

.orders-selection {
  display:flex;
  align-items:center;
  gap:10px;
  font-size:11px;
  color:#667085;
  flex-shrink:0
}

.orders-selection .inp {
  font-size:11px;
  width:auto;
  padding:6px 8px
}

@media(max-width:1100px) {
  .orders-overview {
    gap:8px
  }
  .orders-stat {
    padding:14px 10px;
    gap:8px
  }
  .orders-stat-icon {
    width:38px;
    height:38px
  }
  .orders-stat-value {
    font-size:16px
  }
  .orders-stat-note {
    font-size:10px
  }
  .orders-filters .filters>select {
    max-width:none
  }
}

@media(max-width:760px) {
  .orders-overview {
    grid-template-columns:repeat(2,minmax(0,1fr));
    margin-top:14px
  }
  .orders-search-row {
    flex-wrap:wrap;
    gap:10px
  }
  .orders-search {
    flex-basis:100%;
    max-width:none
  }
  .orders-reset {
    margin-left:0;
    margin-right:auto
  }
  .orders-filters .filters>select {
    min-width:calc(50% - 8px);
    font-size:11px
  }
  .orders-date-range {
    width:100%;
    justify-content:center
  }
  .orders-filters .orders-date-range .inp {
    flex:1;
    width:0
  }
  .orders-stat-value {
    font-size:15px
  }
  .orders-stat {
    gap:8px;
    padding:12px 9px
  }
  .orders-stat-icon {
    width:32px;
    height:36px
  }
  .orders-stat-icon svg {
    width:20px
  }
  .orders-stat-label {
    font-size:10px
  }
  .orders-table-card.card {
    padding:0 10px
  }
  .orders-table-card .orders-page-buttons {
    width:auto;
    flex-wrap:wrap
  }
  .orders-table-footer .orders-pagination {
    flex-basis:100%
  }
  .orders-table-footer .orders-page-buttons {
    flex-basis:100%;
    gap:3px
  }
  .orders-table-footer .orders-page-buttons .btn {
    min-width:26px;
    padding:5px 7px
  }
  .orders-selection {
    width:100%;
    justify-content:flex-start
  }
  .orders-title-sub {
    font-size:11px;
    line-height:1.5
  }
  .orders-page .page-head .acts {
    width:100%;
    gap:6px
  }
  .orders-page .page-head .acts .btn {
    flex:1;
    font-size:11px;
    padding:9px 7px
  }
}

.orders-stat-icon>.ui-icon {
  width:24px;
  height:24px
}

.orders-filters .filters>select {
  padding:6px 10px
}

.orders-filters .orders-date-range .inp {
  padding:5px 0
}

.orders-table .idcp-crm-link {
  width:18px;
  height:18px;
  margin-left:3px;
  padding:0;
  border:0;
  background:none;
  border-radius:3px
}

.orders-table tr.mg td {
  background:transparent
}

.orders-table tr.mg:hover td {
  background:#fafbff
}

.orders-table [data-order-state="Новый"] .st-badge {
  background:#eaf1ff!important;
  color:#1767ed!important
}

@media(min-width:901px) {
  body.orders-page #app {
    height:calc(100dvh - var(--orders-top-offset,48px));
    display:flex;
    flex-direction:column;
    padding-bottom:12px
  }
  body.orders-page #app>.page-head,body.orders-page #app>.orders-overview,body.orders-page #app>.orders-filters {
    flex-shrink:0
  }
  body.orders-page #app>.orders-table-card {
    display:flex;
    flex-direction:column;
    flex:1;
    min-height:140px;
    margin-bottom:0
  }
  .orders-table-scroll {
    flex:1;
    min-height:0;
    overflow:auto;
    padding-bottom:0;
    margin-bottom:0
  }
  .orders-table-footer {
    flex-shrink:0
  }
  .orders-table thead {
    position:sticky;
    top:0;
    z-index:10
  }
  .orders-table th {
    height:30px
  }
  .orders-table-footer {
    min-height:48px
  }
}

@media print {
  body.orders-page #app {
    height:auto;
    display:block
  }
  .orders-table-scroll {
    overflow:visible
  }
  .orders-table-card {
    display:block
  }
  .orders-table thead {
    position:static
  }
}

.orders-table {
  table-layout:fixed
}

.orders-table .order-list-identity {
  min-width:110px;
  max-width:none
}

.orders-table th {
  padding:8px
}

.orders-table td {
  padding-top:8px;
  padding-bottom:8px
}

.orders-table th:nth-child(2) {
  width:10%
}

.orders-table th:nth-child(3),.orders-table th:nth-child(4) {
  width:14%
}

.orders-table th:nth-child(5) {
  width:15%
}

.orders-table th:nth-child(6) {
  width:9%
}

.orders-table th:nth-child(7) {
  width:10%
}

.orders-table th.orders-margin-col {
  width:7%
}

.orders-table th.orders-status-col {
  width:10%
}

.orders-table th:last-child {
  width:68px
}

.orders-table td {
  overflow-wrap:anywhere
}

.orders-table .order-list-number {
  line-height:1.2
}

.orders-table .sub {
  line-height:1.2
}

.orders-table input[type=checkbox],.orders-selection input[type=checkbox] {
  margin:0;
  vertical-align:middle
}

.orders-filters .filters>select {
  height:30px
}

.orders-date-range {
  height:30px
}

.orders-filters .orders-date-range .inp {
  height:28px;
  padding:3px 0
}

.orders-page .page-head [data-act=qtNew] {
  color:var(--accent)
}

.orders-search {
  display:block;
  line-height:0
}

.orders-search .inp {
  display:block;
  line-height:normal
}

.orders-table th {
  padding-top:7px;
  padding-bottom:7px
}

.orders-table .idcp-crm-link {
  height:16px
}

.orders-table tr.mg td:nth-child(2) {
  box-shadow:inset 2px 0 var(--mg)
}

@media(min-width:901px) {
  .orders-table-footer {
    min-height:40px
  }
}

@media(max-width:900px) {
  body.orders-page #app:has(>.orders-table-card) {
    height:calc(100dvh - var(--orders-top-offset,48px));
    display:flex;
    flex-direction:column;
    padding-bottom:max(12px,env(safe-area-inset-bottom))
  }
  body.orders-page #app:has(>.orders-table-card)>.orders-filters,
  body.orders-page #app:has(>.orders-table-card)>.orders-overview {
    flex-shrink:0;
    max-height:35dvh;
    overflow:auto
  }
  body.orders-page #app:has(>.orders-table-card)>.orders-filters {
    max-height:45dvh
  }
  body.orders-page #app>.orders-table-card {
    display:flex;
    flex-direction:column;
    flex:1;
    min-height:0;
    margin-bottom:0
  }
  .orders-table-scroll {
    flex:1;
    min-height:0;
    overflow:auto;
    padding-bottom:0;
    margin-bottom:0
  }
}

/* On short phones the toolbar and footer must not hide all order rows. */
@media(max-width:520px) and (max-height:800px) {
  body.orders-page #app:has(>.orders-table-card) {
    height:auto
  }
  body.orders-page #app>.orders-table-card {
    flex:none
  }
  body.orders-page #app>.orders-table-card>.orders-table-scroll {
    flex:none;
    max-height:55dvh
  }
}

@media print {
  body.orders-page #app:has(>.orders-table-card) { height:auto;display:block }
  body.orders-page #app>.orders-table-card { display:block }
  .orders-table-scroll { overflow:visible }
  .orders-table-footer { display:none }
}

/* Keep the work area visible; secondary controls are opened on demand. */
.orders-filters.card { padding:10px 12px;margin-bottom:10px }
.orders-search-row { gap:8px;margin-bottom:0;min-width:0 }
.orders-search-row .orders-search { flex:1 1 240px;max-width:none;min-width:140px }
.orders-search-row>.inp { flex:0 1 190px;width:190px;min-width:120px;font-size:12px }
.orders-search-row>.btn { flex-shrink:0;min-height:34px;font-size:12px;gap:6px;white-space:nowrap }
.orders-search-row>.orders-view-switch { margin-left:auto }
.orders-search-row .orders-view-switch button { padding:7px 10px;font-size:12px;white-space:nowrap }
.orders-search-row .inp { height:36px }
.orders-search-row .orders-search>.ui-icon { top:10px }
.orders-search-row .has-filters { color:var(--accent);border-color:var(--accent) }
.orders-filter-count { display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 4px;border-radius:10px;background:var(--accent);color:#fff;font-size:10px }
.orders-active-filters { display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:8px }
.orders-filter-chip { display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:5px 8px;border:1px solid var(--border);border-radius:6px;background:var(--accent-light);color:var(--accent);font:inherit;font-size:11px;text-align:left;overflow-wrap:anywhere;cursor:pointer }
.orders-filter-chip>.ui-icon { flex-shrink:0 }
.orders-filter-chip:hover { border-color:var(--accent) }
.orders-filter-chip:focus-visible { outline:2px solid var(--accent);outline-offset:2px }
.orders-active-filters .orders-reset { padding:5px 4px }
.orders-more-filters { gap:12px 20px;margin-top:10px;padding-top:10px }
.orders-more-filters>.filters { flex-basis:100%;align-items:end;gap:10px }
.orders-filter-field { display:flex;flex:1;flex-direction:column;gap:5px;min-width:135px;font-size:11px;color:var(--muted) }
.orders-filter-field .inp { width:100%;height:36px;font-size:12px;color:var(--text) }
.orders-search-row>.orders-filter-field { flex:0 1 240px;flex-direction:row;align-items:center;gap:8px;min-width:200px }
.orders-search-row>.orders-filter-field>.inp { flex:1;min-width:0;width:0 }
.orders-more-filters .dr-trigger { height:36px }
.orders-more-filters>.check { font-size:12px }
.orders-overview { margin-top:0 }

@media(min-width:901px) {
  body.orders-page #app>.orders-filters { position:relative }
  .orders-more-filters>.filters>.orders-filter-field { max-width:230px }
}
@media(min-width:901px) and (max-width:1100px) {
  .orders-search-row { flex-wrap:wrap }
  .orders-search-row .orders-search { flex-basis:calc(100% - 210px) }
  .orders-search-row>.orders-view-switch { margin-left:auto }
}
@media(max-width:900px) {
  .orders-search-row { flex-wrap:wrap;gap:8px }
  .orders-search-row .orders-search { flex:1 0 100%;min-width:0 }
  .orders-search-row>.inp { flex:1 1 100%;width:100% }
  .orders-search-row>.orders-filter-field { flex:1 1 100%;min-width:0 }
  .orders-search-row>.orders-view-switch { margin-left:auto }
  .orders-more-filters>.filters { align-items:stretch }
  .orders-filter-field { flex-basis:calc(50% - 10px);min-width:120px }
  .orders-more-filters .filters>span { align-self:end }
}
@media(max-width:430px) {
  .orders-search-row { gap:6px }
  .orders-search-row .orders-view-switch button { padding:7px 6px;font-size:11px;gap:4px }
  .orders-search-row>.btn { padding:7px 6px;font-size:11px;gap:4px }
}

.orders-view-controls {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 10px;
  flex-shrink:0
}

.orders-view-switch { flex-shrink:0 }
.orders-view-switch button { display:flex;align-items:center;gap:6px }
.orders-view-switch button:disabled { opacity:.45;cursor:not-allowed }
.orders-kanban-card.card { padding:12px;min-width:0;margin-bottom:0 }
.orders-kanban-scroll { display:flex;gap:12px;overflow:auto;min-height:0;max-width:100%;padding-bottom:8px }
.orders-kanban-column { display:flex;flex-direction:column;flex:0 0 280px;min-width:0;background:#f5f7fb;border:1px solid var(--border);border-radius:10px;border-top:3px solid var(--stage-color);overflow:hidden }
.orders-kanban-column h2 { display:flex;align-items:center;gap:8px;justify-content:space-between;font-size:13px;line-height:1.4;margin:0;padding:12px;overflow-wrap:anywhere;flex-shrink:0 }
.orders-kanban-column h2 span { flex-shrink:0;border-radius:12px;background:#fff;color:var(--muted);font-size:11px;padding:2px 7px }
.orders-kanban-cards { padding:0 8px 8px;overflow:auto;min-height:0;scrollbar-gutter:stable }
.orders-kanban-order { position:relative;display:block;border:1px solid var(--border);border-radius:8px;padding:12px;background:#fff;color:var(--text);margin-bottom:8px;overflow-wrap:anywhere }
.orders-kanban-order:hover { border-color:var(--accent);box-shadow:0 2px 6px #25355215 }
.orders-kanban-open::after { content:"";position:absolute;inset:0;border-radius:8px }
.orders-kanban-open:focus-visible { outline:0 }
.orders-kanban-open:focus-visible::after { outline:2px solid var(--accent);outline-offset:-2px }
.orders-kanban-order.is-cancelled { opacity:.65 }
.orders-kanban-order .order-list-number { display:flex;align-items:center;gap:4px;font-weight:750;font-size:14px }
.orders-kanban-order .idcp-crm-link { position:relative;z-index:1;width:18px;height:18px;margin:0;padding:0;border:0;background:none }
.orders-kanban-order .order-list-code,.orders-kanban-order .order-list-created,.orders-kanban-order .order-list-deal { font-size:10px;color:var(--muted);margin-top:3px }
.orders-kanban-name { font-size:12px;font-weight:600;margin-top:10px }
.orders-kanban-client { margin-top:8px;font-size:12px }
.orders-kanban-client .ui-icon,.orders-kanban-deadline .ui-icon { width:13px;height:13px;vertical-align:middle }
.orders-kanban-money { display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0;font-size:13px;flex-wrap:wrap }
.orders-kanban-money .badge { font-size:10px }
.orders-kanban-deadline { font-size:11px;color:var(--muted);margin-bottom:5px }
.orders-kanban-deadline.is-late { color:var(--danger) }
.orders-kanban-order>.sub { font-size:11px;color:var(--muted) }
.orders-kanban-empty { padding:20px 8px;text-align:center;font-size:12px;color:var(--muted) }
.orders-kanban-more { width:100%;font-size:11px;white-space:normal }

@media(min-width:901px) {
  body.orders-page #app>.orders-kanban-card { display:flex;flex:1;min-height:140px }
  .orders-kanban-scroll { flex:1 }
}

@media(max-width:900px) {
  .orders-kanban-scroll { height:65dvh;min-height:300px }
}

@media(max-width:500px) {
  .orders-view-controls { flex-wrap:wrap }
  .orders-view-controls .help { flex-basis:100% }
  .orders-view-switch { margin-left:auto }
  .orders-kanban-column { flex-basis:260px }
  .orders-kanban-card.card { padding:8px }
}

/* Searchable finance pickers must shrink to their tile columns. */
#app .oc-fin-t .cc-sel2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#app .oc-fin-t .cc-sel2 > div {
  min-width: 0;
}
#app .oc-fin-t .cc-sel2 .ss-trigger {
  width: 100%;
}
