.backoffice-branch-switcher {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 230px;
  padding: 10px 18px;
  border-left: 1px solid rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .58);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.backoffice-branch-switcher select {
  width: 100%;
  min-height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  outline: 0;
  background: #1d2631;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}
body:has(#adminPanels:not(.hidden)) .admin-top-navigation {
  grid-template-columns: 280px minmax(0, 1fr) 250px;
}
body:has(#adminPanels:not(.hidden)) .admin-top-navigation-scroll {
  grid-template-columns: repeat(8, minmax(112px, 1fr));
}
body:has(#adminPanels:not(.hidden)) .admin-layout.admin-sidebar-collapsed .admin-top-navigation {
  grid-template-columns: 82px minmax(0, 1fr) 250px;
}

.backoffice-panel {
  color: #273341;
}
.backoffice-panel-head,
.backoffice-section-head,
.backoffice-actions,
.backoffice-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.backoffice-panel-head {
  margin-bottom: 18px;
}
.backoffice-eyebrow {
  margin-bottom: 5px;
  color: #d8761d;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}
.backoffice-actions {
  flex: 0 0 auto;
}
.backoffice-actions .btn,
.backoffice-section-head .btn {
  width: auto;
  margin: 0;
  white-space: nowrap;
}
.backoffice-actions .btn-small,
.backoffice-section-head .btn-small {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 11px;
}
.backoffice-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.backoffice-metric {
  padding: 15px;
  border: 1px solid #e0e5ea;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(35, 48, 63, .05);
}
.backoffice-metric span,
.backoffice-section-head span,
.backoffice-toolbar-meta {
  display: block;
  margin-top: 3px;
  color: #74808d;
  font-size: 11px;
}
.backoffice-metric strong {
  display: block;
  margin-top: 7px;
  color: #253140;
  font-size: 24px;
}
.backoffice-split {
  display: grid;
  grid-template-columns: minmax(300px, .85fr) minmax(430px, 1.35fr);
  gap: 14px;
}
.backoffice-split-warehouse {
  grid-template-columns: minmax(300px, .72fr) minmax(500px, 1.28fr);
}
.backoffice-surface {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dfe4ea;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 7px 24px rgba(30, 44, 59, .045);
}
.backoffice-section-head {
  min-height: 62px;
  padding: 12px 15px;
  border-bottom: 1px solid #e7ebef;
  background: #fafbfc;
}
.backoffice-section-head strong {
  font-size: 14px;
}
.backoffice-card-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}
.backoffice-compact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e6eb;
  border-radius: 9px;
  background: #fff;
}
.backoffice-compact-card small { display: block; margin-top: 3px; color: #74808d; }
.backoffice-card {
  width: 100%;
  padding: 13px;
  border: 1px solid #e2e6eb;
  border-radius: 9px;
  background: #fff;
  color: #2a3644;
  text-align: left;
}
button.backoffice-card {
  cursor: pointer;
}
button.backoffice-card:hover,
button.backoffice-card.active {
  border-color: #eea05a;
  background: #fff8f1;
}
.backoffice-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.backoffice-card small {
  display: block;
  margin-top: 5px;
  color: #74808d;
  line-height: 1.35;
}
.backoffice-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f5;
  color: #576473;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}
.backoffice-badge.good { background: #eaf7ef; color: #267346; }
.backoffice-badge.warn { background: #fff2e3; color: #a75d17; }
.backoffice-badge.bad { background: #fdecec; color: #ac3e3e; }
.backoffice-table-wrap {
  min-width: 0;
  overflow: auto;
}
.backoffice-table {
  width: 100%;
  border-collapse: collapse;
  color: #344152;
  font-size: 12px;
}
.backoffice-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  border-bottom: 1px solid #dfe4e9;
  background: #f6f8fa;
  color: #667382;
  font-size: 10px;
  letter-spacing: .04em;
  text-align: left;
  text-transform: uppercase;
}
.backoffice-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf0f3;
  vertical-align: middle;
}
.backoffice-table tbody tr:hover td { background: #fffaf5; }
.backoffice-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.backoffice-row-actions button {
  min-height: 27px;
  padding: 4px 8px;
  border: 1px solid #d8dde3;
  border-radius: 6px;
  background: #fff;
  color: #465463;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.backoffice-row-actions button.primary { border-color: #ee9a4c; color: #bd6415; }
.backoffice-row-actions button.danger { border-color: #efc3c3; color: #af4141; }
.backoffice-toolbar {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #dfe4ea;
  border-radius: 10px;
  background: #fff;
}
.backoffice-toolbar select,
.backoffice-search {
  min-height: 36px;
  border: 1px solid #dce1e6;
  border-radius: 8px;
  background: #fff;
}
.backoffice-toolbar select { padding: 0 32px 0 10px; color: #344152; }
.backoffice-report-parameters {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #dfe4ea;
  border-radius: 10px;
  background: #fff;
}
.backoffice-report-parameters .wide { grid-column: span 2; }
.backoffice-report-parameters [hidden] { display: none !important; }
.backoffice-report-check { align-content: end; }
.backoffice-report-check input { width: auto; min-height: auto; margin-right: 6px; }
.backoffice-search { display: flex; align-items: center; width: min(420px, 100%); padding: 0 10px; }
.backoffice-search span { color: #87919d; font-size: 18px; }
.backoffice-search input { width: 100%; border: 0; outline: 0; padding: 8px; background: transparent; color: #344152; }
.backoffice-empty,
.backoffice-error {
  padding: 28px 18px;
  color: #74808d;
  text-align: center;
  font-size: 12px;
}
.backoffice-error { color: #a94444; }
.backoffice-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 15px;
  border-radius: 9px;
  background: #263443;
  color: #fff;
  box-shadow: 0 10px 34px rgba(21, 32, 44, .28);
  font-size: 12px;
}
.backoffice-toast.error { background: #a64242; }
.backoffice-dialog {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 20, 27, .58);
  backdrop-filter: blur(5px);
}
.backoffice-dialog-card {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 14px;
  background: #fff;
  color: #2b3745;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .3);
}
.backoffice-dialog-card:has(.backoffice-lines-editor) { width: min(1040px, 100%); }
.backoffice-dialog-head,
.backoffice-dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; }
.backoffice-dialog-head { border-bottom: 1px solid #e4e8ec; }
.backoffice-dialog-head strong { font-size: 17px; }
.backoffice-dialog-close { border: 0; background: transparent; color: #697584; font-size: 24px; cursor: pointer; }
.backoffice-dialog-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding: 18px 20px; }
.backoffice-dialog-body .wide { grid-column: 1 / -1; }
.backoffice-field { display: grid; gap: 6px; color: #5d6977; font-size: 11px; font-weight: 750; }
.backoffice-field input,
.backoffice-field select,
.backoffice-field textarea {
  width: 100%;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid #d7dde3;
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: #2c3948;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}
.backoffice-field textarea { min-height: 74px; resize: vertical; }
.backoffice-field input:focus,
.backoffice-field select:focus,
.backoffice-field textarea:focus { border-color: #e7964c; box-shadow: 0 0 0 3px rgba(231, 150, 76, .12); }
.backoffice-dialog-actions { justify-content: flex-end; border-top: 1px solid #e4e8ec; background: #fafbfc; }
.backoffice-dialog-actions .btn { width: auto; margin: 0; }
.backoffice-form-note { grid-column: 1 / -1; padding: 10px 12px; border-radius: 8px; background: #f5f7f9; color: #667382; font-size: 11px; line-height: 1.45; }
.backoffice-recipe-insight { display: grid; gap: 9px; padding: 12px; border: 1px solid #e1e6eb; border-radius: 10px; background: #fafbfc; }
.backoffice-warning-text { color: #a44f2a !important; }
.backoffice-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.backoffice-detail-grid strong { padding: 10px 12px; border: 1px solid #e2e7eb; border-radius: 8px; background: #fafbfc; font-size: 12px; }
.backoffice-lines-editor { grid-column: 1 / -1; display: grid; gap: 10px; }
.backoffice-lines-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.backoffice-lines-head strong { color: #344150; font-size: 12px; }
.backoffice-lines-head button { width: auto; margin: 0; }
.backoffice-lines-list { display: grid; gap: 9px; }
.backoffice-lines-row { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(100px, 1fr) minmax(90px, .8fr) minmax(100px, .9fr) minmax(100px, .9fr) 34px; gap: 8px; align-items: end; padding: 10px; border: 1px solid #e1e6eb; border-radius: 10px; background: #fafbfc; }
.backoffice-lines-row.recipe { grid-template-columns: minmax(200px, 2fr) minmax(100px, 1fr) minmax(100px, .8fr) minmax(90px, .7fr) 34px; }
.backoffice-line-remove { min-height: 39px; border: 1px solid #e4c5c5; border-radius: 8px; background: #fff; color: #aa4747; font-size: 19px; cursor: pointer; }
.backoffice-line-remove:disabled { opacity: .35; cursor: default; }
.backoffice-access-help { display: grid; gap: 5px; margin-bottom: 14px; padding: 14px 16px; border: 1px solid #f0d7bd; border-radius: 10px; background: #fff8f0; color: #66513d; }
.backoffice-access-help strong { color: #9b571a; font-size: 13px; }
.backoffice-access-help span { font-size: 12px; line-height: 1.5; }
.backoffice-access-table td:nth-child(2) { min-width: 170px; }
.backoffice-access-table td:nth-child(3) { min-width: 220px; }
.backoffice-audit-table code { font-size: 11px; word-break: break-all; }
.backoffice-audit-table details summary { cursor: pointer; color: #9b571a; }
.backoffice-audit-diff { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr); gap: 10px; margin-top: 8px; }
.backoffice-audit-diff pre { max-height: 260px; overflow: auto; margin: 5px 0 0; padding: 9px; border-radius: 8px; background: #f7f3ee; font-size: 11px; white-space: pre-wrap; }
@media (max-width: 900px) { .backoffice-audit-diff { grid-template-columns: 1fr; } }
.backoffice-link-button { border: 0; background: transparent; color: #c56a1b; font: inherit; font-weight: 800; cursor: pointer; }
.backoffice-check-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 12px; border: 1px solid #dfe4e9; border-radius: 9px; }
.backoffice-check-group legend { padding: 0 5px; color: #5d6977; font-size: 11px; font-weight: 800; }
.backoffice-check-group label { display: flex; align-items: flex-start; gap: 8px; padding: 9px; border-radius: 7px; background: #f7f9fa; cursor: pointer; }
.backoffice-check-group label span { display: grid; gap: 2px; }
.backoffice-check-group label small { color: #7d8894; font-size: 9px; }
.backoffice-check-group label small input { width: 70px; min-height: 26px; margin: 3px 2px 0; padding: 3px 5px; border: 1px solid #d7dde3; border-radius: 5px; background: #fff; font-size: 10px; }
.backoffice-toggle { display: flex; align-items: center; gap: 8px; color: #4d5a68; font-size: 12px; font-weight: 750; }

@media (max-width: 1120px) {
  body:has(#adminPanels:not(.hidden)) .admin-top-navigation,
  body:has(#adminPanels:not(.hidden)) .admin-layout.admin-sidebar-collapsed .admin-top-navigation { grid-template-columns: 220px minmax(0, 1fr); }
  .backoffice-branch-switcher { position: fixed; right: 14px; bottom: 14px; z-index: 80; min-width: 220px; border: 0; border-radius: 10px; background: #18212b; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
  .backoffice-split, .backoffice-split-warehouse { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .backoffice-panel-head { align-items: flex-start; flex-direction: column; }
  .backoffice-actions { width: 100%; }
  .backoffice-actions .btn { flex: 1; }
  .backoffice-metrics { grid-template-columns: 1fr; }
  .backoffice-toolbar { align-items: stretch; flex-direction: column; }
  .backoffice-report-parameters { grid-template-columns: 1fr; }
  .backoffice-report-parameters .wide { grid-column: auto; }
  .backoffice-dialog-body { grid-template-columns: 1fr; }
  .backoffice-dialog-body .wide { grid-column: auto; }
  .backoffice-lines-editor { grid-column: auto; }
  .backoffice-detail-grid { grid-template-columns: 1fr; }
  .backoffice-lines-row, .backoffice-lines-row.recipe { grid-template-columns: 1fr; }
  .backoffice-line-remove { width: 100%; }
  .backoffice-check-group { grid-template-columns: 1fr; }
  .backoffice-table { min-width: 680px; }
  .backoffice-branch-switcher { right: 10px; bottom: 10px; max-width: calc(100vw - 20px); }
}
@media (max-width: 980px) {
  body:has(#adminPanels:not(.hidden)) .admin-top-navigation,
  body:has(#adminPanels:not(.hidden)) .admin-layout.admin-sidebar-collapsed .admin-top-navigation {
    grid-template-columns: 1fr;
  }
}
.backoffice-catalog-layout{display:grid;grid-template-columns:minmax(210px,280px) minmax(0,1fr);gap:16px;align-items:start}
.backoffice-category-tree{position:sticky;top:12px;max-height:70vh;overflow:auto}
.backoffice-category-node{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 10px 9px calc(10px + var(--category-level,0)*16px);border:0;border-radius:8px;background:transparent;color:inherit;text-align:left;cursor:pointer}
.backoffice-category-node:hover,.backoffice-category-node.active{background:var(--surface-soft,#eef2ff);color:var(--accent,#3346d3)}
.backoffice-category-node small{opacity:.65}
.backoffice-inline-checks{display:flex;flex-wrap:wrap;gap:6px 10px;font-size:12px}
.backoffice-inline-checks label{display:inline-flex;align-items:center;gap:4px}
@media(max-width:900px){.backoffice-catalog-layout{grid-template-columns:1fr}.backoffice-category-tree{position:static;max-height:260px}}
