:root {
  --sidebar: #081c2f;
  --sidebar2: #0b243b;

  --bg: #f5f8fc;
  --panel: #ffffff;

  --text: #17212b;
  --muted: #7e8998;
  --line: #dfe6ef;

  --blue: #087cf0;
  --blue-soft: #eaf4ff;

  --green: #169b52;
  --green-soft: #eaf8f0;

  --orange: #ef9b18;
  --orange-soft: #fff6e5;

  --purple: #8751d5;
  --purple-soft: #f3edff;

  --red: #d83b32;
  --red-soft: #fff0ef;

  --radius: 7px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);

  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
}


/* ========================================================= */
/* SIDEBAR */
/* ========================================================= */

.sidebar {
  position: fixed;
  z-index: 20;

  left: 0;
  top: 0;
  bottom: 0;

  width: 248px;

  display: flex;
  flex-direction: column;

  padding: 22px 12px 14px;

  color: white;

  background:
    linear-gradient(
      180deg,
      var(--sidebar2),
      var(--sidebar)
    );
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;

  padding: 2px 9px 22px;
}

.logo-mark {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  border-radius: 50%;

  background: linear-gradient(135deg,#0284ff,#e84b58);

  font-size: 17px;
  font-weight: 800;
}

.logo-title {
  font-size: 16px;
  font-weight: 700;
}

.logo-subtitle {
  color: #91a5b8;
  font-size: 10px;
  margin-top: 2px;
}

.menu {
  flex: 1;
  overflow-y: auto;
}

.menu-section {
  margin-bottom: 17px;
}

.menu-main {
  width: 100%;
  height: 40px;

  border: 0;
  border-radius: 5px;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 0 11px;

  background: transparent;
  color: #d5e0eb;

  font-weight: 600;
  font-size: 13px;

  text-align: left;
}

.menu-main.active {
  color: white;
  background: linear-gradient(90deg,#0578e8,#0d87ff);
}

.menu-main:hover:not(.disabled) {
  background-color: rgba(255,255,255,.06);
}

.menu-icon {
  width: 18px;
  text-align: center;
}

.submenu {
  padding: 6px 0 0 37px;
}

.submenu-item {
  width: 100%;

  min-height: 29px;

  border: 0;
  background: transparent;

  color: #b8c6d5;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 5px;

  text-align: left;
  font-size: 11px;
}

.submenu-item.active,
.submenu-item:hover:not(.disabled) {
  color: white;
}

.disabled {
  cursor: default !important;
  opacity: .72;
}

.counter {
  min-width: 21px;

  padding: 2px 6px;

  border-radius: 10px;

  text-align: center;

  background: var(--blue);
  color: white;

  font-size: 9px;
}

.muted-counter {
  background: #173552;
  color: #93a7ba;
}

.sidebar-footer {
  padding: 10px 10px 4px;

  color: #879bad;
  font-size: 10px;
}

.sidebar-status {
  margin-top: 8px;

  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #728396;
}

.status-dot.good {
  background: #34c777;
}

.status-dot.bad {
  background: #ef4b49;
}


/* ========================================================= */
/* WORKSPACE */
/* ========================================================= */

.workspace {
  margin-left: 248px;
  min-height: 100vh;
}

.topbar {
  height: 61px;

  padding: 0 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  background: #fff;

  border-bottom: 1px solid var(--line);
}

.topbar-right {
  margin-left: auto;

  display: flex;
  align-items: center;

  gap: 22px;
}

.factory-select {
  display: flex;
  align-items: center;
  gap: 7px;

  font-size: 11px;
}

.factory-icon {
  font-size: 17px;
  color: #345c84;
}

.notification {
  position: relative;
  font-size: 18px;
}

.notification-count {
  position: absolute;

  right: -8px;
  top: -7px;

  min-width: 15px;
  height: 15px;

  border-radius: 8px;

  display: grid;
  place-items: center;

  background: #ea2e25;
  color: white;

  font-size: 8px;
}

.profile {
  display: flex;
  align-items: center;
  gap: 8px;

  font-size: 11px;
}

.profile-avatar {
  width: 34px;
  height: 34px;

  border-radius: 8px;

  display: grid;
  place-items: center;

  background: var(--sidebar);
  color: white;

  font-weight: 700;
}

.profile > div:nth-child(2) {
  display: flex;
  flex-direction: column;
}

.profile span {
  color: var(--muted);
  font-size: 9px;
  margin-top: 2px;
}

.profile-arrow {
  padding-left: 3px;
}


/* ========================================================= */
/* PAGES */
/* ========================================================= */

.page {
  display: none;
  padding: 18px;
}

.page.active {
  display: block;
}

.page-header {
  min-height: 47px;

  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  margin-bottom: 12px;
}

.page-header h1 {
  margin: 0;

  font-size: 18px;
  letter-spacing: -.02em;
}

.page-header p {
  margin: 3px 0 0;

  color: var(--muted);
  font-size: 10px;
}

.updated {
  color: var(--muted);
  font-size: 9px;

  display: flex;
  align-items: center;
  gap: 4px;
}

.refresh-button {
  width: 25px;
  height: 25px;

  border: 0;
  background: transparent;

  font-size: 16px;
  color: #53687d;
}


/* ========================================================= */
/* KPI */
/* ========================================================= */

.kpi-grid {
  display: grid;

  grid-template-columns: repeat(5,minmax(0,1fr));

  gap: 12px;

  margin-bottom: 13px;
}

.kpi-card {
  min-height: 77px;

  padding: 15px;

  border: 1px solid var(--line);
  border-radius: var(--radius);

  background: white;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-value {
  font-size: 21px;
  line-height: 1;
  font-weight: 700;
}

.kpi-label {
  margin-top: 8px;

  font-size: 10px;
  color: #4e5966;
}

.kpi-icon {
  width: 39px;
  height: 39px;

  border-radius: 7px;

  display: grid;
  place-items: center;

  font-size: 20px;
}

.blue {
  color: var(--blue);
}

.orange {
  color: var(--orange);
}

.green {
  color: var(--green);
}

.purple {
  color: var(--purple);
}

.blue-icon {
  background: var(--blue-soft);
  color: var(--blue);
}

.orange-icon {
  background: var(--orange-soft);
  color: var(--orange);
}

.green-icon {
  background: var(--green-soft);
  color: var(--green);
}

.purple-icon {
  background: var(--purple-soft);
  color: var(--purple);
}


/* ========================================================= */
/* MAIN GRID */
/* ========================================================= */

.content-grid {
  display: grid;

  grid-template-columns:
    minmax(0,1fr)
    300px;

  gap: 12px;
}

.left-column,
.right-column {
  min-width: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);

  background: white;

  overflow: hidden;
}


/* ========================================================= */
/* FILTERS */
/* ========================================================= */

.filters {
  min-height: 67px;

  padding: 11px;

  display: grid;

  grid-template-columns:
    1.2fr
    1fr
    .9fr
    1fr
    84px;

  gap: 8px;

  border-bottom: 1px solid var(--line);

  align-items: end;
}

.filter-group {
  min-width: 0;
}

.filter-group label {
  display: block;

  margin-bottom: 5px;

  color: #4e5966;

  font-size: 9px;
  font-weight: 600;
}

.filter-group select,
.filter-group input,
.fake-input {
  width: 100%;
  height: 31px;

  border: 1px solid #d9e1ea;
  border-radius: 4px;

  background: white;

  padding: 0 9px;

  font-size: 10px;

  outline: none;
}

.fake-input {
  display: flex;
  align-items: center;
  justify-content: space-between;

  color: #4d5863;
}

.filter-button {
  height: 31px;
}


/* ========================================================= */
/* BUTTONS */
/* ========================================================= */

.primary-button {
  border: 0;
  border-radius: 4px;

  background: var(--blue);
  color: white;

  font-size: 10px;
  font-weight: 600;
}

.outline-button {
  height: 31px;

  padding: 0 14px;

  border: 1px solid var(--blue);
  border-radius: 4px;

  color: var(--blue);
  background: white;

  font-size: 10px;
}

.disabled-button {
  opacity: .55;
}


/* ========================================================= */
/* ORDERS TABLE */
/* ========================================================= */

.orders-table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;

  border-collapse: collapse;
}

th {
  height: 35px;

  padding: 0 11px;

  border-bottom: 1px solid var(--line);

  text-align: left;

  color: #647080;

  font-size: 9px;
  font-weight: 700;

  white-space: nowrap;
}

td {
  height: 38px;

  padding: 0 11px;

  border-bottom: 1px solid #edf1f5;

  font-size: 10px;

  white-space: nowrap;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: #f4f9ff;
}

.order-link {
  color: #1674cf;
  font-weight: 600;
}

.status-badge {
  display: inline-flex;

  padding: 3px 7px;

  border-radius: 4px;

  font-size: 9px;
  font-weight: 600;
}

.status-badge.new {
  color: #2476d1;
  background: #e9f3ff;
}

.status-badge.accepted {
  color: #2476d1;
  background: #e9f3ff;
}

.status-badge.planned {
  color: #b96c00;
  background: #fff2d9;
}

.status-badge.production {
  color: #bc6c00;
  background: #fff1d3;
}

.status-badge.production_done {
  color: #6545d2;
  background: #efeaff;
}

.status-badge.shipment {
  color: #6941c6;
  background: #f0eaff;
}

.status-badge.completed {
  color: #148344;
  background: #e5f5eb;
}

.status-badge.attention,
.status-badge.error {
  color: #c5332a;
  background: #ffebe9;
}

.status-badge.neutral {
  color: #65717f;
  background: #f0f2f5;
}

.view-button {
  width: 25px;
  height: 22px;

  border: 1px solid #dbe3eb;
  border-radius: 4px;

  background: white;

  font-size: 10px;

  color: #546274;
}


/* ========================================================= */
/* NEED */
/* ========================================================= */

.need-panel {
  margin-top: 12px;
}

.panel-title-row {
  min-height: 54px;

  padding: 10px 12px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid var(--line);
}

.panel-title-row h2 {
  margin: 0;
  font-size: 13px;
}

.panel-title-row p {
  margin: 3px 0 0;

  color: var(--muted);
  font-size: 9px;
}

.need-table {
  min-height: 130px;
}

.panel-link {
  height: 38px;

  border-top: 1px solid var(--line);

  padding: 0 12px;

  display: flex;
  align-items: center;
  gap: 7px;

  color: #317ec7;

  font-size: 9px;
}


/* ========================================================= */
/* RIGHT SIDE */
/* ========================================================= */

.right-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-panel {
  min-height: 305px;
}

.detail-header {
  min-height: 54px;

  padding: 11px 12px;

  border-bottom: 1px solid var(--line);

  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.detail-header h2 {
  margin: 0;
  font-size: 13px;
}

.detail-header p {
  margin: 3px 0 0;

  font-size: 9px;
  color: var(--muted);
}

.detail-content {
  padding: 12px;
}

.detail-row {
  min-height: 24px;

  display: grid;
  grid-template-columns: 100px 1fr;

  gap: 8px;

  font-size: 9px;
}

.detail-row span:first-child {
  color: #788493;
}

.detail-products-title {
  margin: 11px 0 7px;

  font-size: 10px;
  font-weight: 700;
}

.detail-products {
  border: 1px solid var(--line);
  border-radius: 4px;

  overflow: hidden;
}

.detail-product {
  min-height: 33px;

  padding: 6px 7px;

  display: grid;
  grid-template-columns: 1fr 35px 50px;

  gap: 6px;

  border-bottom: 1px solid #edf1f5;

  font-size: 8.5px;
}

.detail-product:last-child {
  border-bottom: 0;
}

.detail-product-head {
  background: #fafbfd;
  color: #667281;
  font-weight: 600;
}

.detail-actions {
  margin-top: 10px;

  display: grid;
  grid-template-columns: 1fr 1fr;

  gap: 8px;
}

.detail-button {
  height: 31px;

  border-radius: 4px;

  font-size: 9px;
  font-weight: 600;
}

.detail-button.secondary {
  border: 1px solid var(--blue);

  color: var(--blue);
  background: white;
}

.detail-button.primary {
  border: 0;

  color: white;
  background: var(--blue);
}

.detail-button[disabled] {
  opacity: .55;
}


/* ========================================================= */
/* QUICK ACTIONS */
/* ========================================================= */

.quick-panel,
.events-panel {
  padding: 11px;
}

.small-panel-title {
  margin-bottom: 9px;

  font-size: 11px;
  font-weight: 700;
}

.quick-action {
  width: 100%;
  min-height: 45px;

  margin-top: 7px;

  border-radius: 5px;

  display: flex;
  align-items: center;

  gap: 9px;

  padding: 7px 10px;

  text-align: left;
}

.quick-action span:nth-child(2) {
  display: flex;
  flex-direction: column;
}

.quick-action strong {
  font-size: 9px;
}

.quick-action small {
  margin-top: 2px;

  color: #788493;

  font-size: 8px;
}

.quick-icon {
  font-size: 19px;
}

.green-action {
  border: 1px solid #c7e8d2;

  background: #eefaf2;
  color: #1c8c4c;
}

.orange-action {
  border: 1px solid #f0d8a8;

  background: #fff7e7;
  color: #e19713;
}

.gray-action {
  border: 1px solid #e1e5ea;

  background: #f8f9fb;
  color: #59687a;
}

.quick-action:disabled {
  cursor: default;
}

.readonly-note {
  margin-top: 9px;

  text-align: center;

  color: var(--muted);
  font-size: 8px;
}


/* ========================================================= */
/* EVENTS */
/* ========================================================= */

.event {
  min-height: 30px;

  display: grid;
  grid-template-columns: 14px 1fr auto;

  gap: 6px;

  align-items: start;

  padding: 5px 0;

  border-bottom: 1px solid #edf1f5;

  font-size: 8px;
}

.event:last-child {
  border-bottom: 0;
}

.event-icon.good {
  color: var(--green);
}

.event-icon.blue {
  color: var(--blue);
}

.event-icon.orange {
  color: var(--orange);
}

.event-time {
  color: var(--muted);
}


/* ========================================================= */
/* SYSTEM */
/* ========================================================= */

.system-grid {
  display: grid;

  grid-template-columns: repeat(3,minmax(0,1fr));

  gap: 12px;
}

.system-card {
  min-height: 110px;

  padding: 16px;

  border: 1px solid var(--line);
  border-radius: var(--radius);

  background: white;
}

.system-card strong {
  font-size: 13px;
}

.system-card span {
  display: block;

  margin-top: 7px;

  color: var(--muted);
  font-size: 10px;
}


/* ========================================================= */
/* GENERAL */
/* ========================================================= */

.loading,
.empty {
  padding: 28px 15px;

  color: var(--muted);

  text-align: center;

  font-size: 9px;
}

.footer {
  padding: 15px;

  color: #a5afbb;
  text-align: center;

  font-size: 8px;
}


/* ========================================================= */
/* RESPONSIVE */
/* ========================================================= */

@media (max-width: 1200px) {

  .kpi-grid {
    grid-template-columns: repeat(3,1fr);
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .right-column {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .detail-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 800px) {

  .sidebar {
    position: static;
    width: 100%;

    min-height: auto;
  }

  .workspace {
    margin-left: 0;
  }

  .menu-section:not(:first-child) {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar {
    display: none;
  }

  .page {
    padding: 10px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2,1fr);
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .filter-button {
    grid-column: 1 / -1;
  }

  .right-column {
    display: flex;
  }

  .system-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================================= */
/* WEB 0.2 LARGE UI TUNING */
/* ========================================================= */

.sidebar {
  width: 270px;
}

.workspace {
  margin-left: 270px;
}

.logo-title {
  font-size: 18px;
}

.logo-subtitle {
  font-size: 11px;
}

.menu-main {
  height: 46px;
  font-size: 14px;
}

.submenu {
  padding-left: 40px;
}

.submenu-item {
  min-height: 34px;
  font-size: 12px;
}

.sidebar-footer {
  font-size: 11px;
}

.topbar {
  height: 68px;
  padding: 0 28px;
}

.factory-select {
  font-size: 12px;
}

.profile {
  font-size: 12px;
}

.profile-avatar {
  width: 38px;
  height: 38px;
}

.page {
  padding: 24px;
}

.page-header {
  min-height: 56px;
  margin-bottom: 16px;
}

.page-header h1 {
  font-size: 22px;
}

.page-header p {
  font-size: 11px;
}

.updated {
  font-size: 10px;
}

.kpi-grid {
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-card {
  min-height: 94px;
  padding: 18px;
}

.kpi-value {
  font-size: 28px;
}

.kpi-label {
  font-size: 11px;
}

.kpi-icon {
  width: 46px;
  height: 46px;
  font-size: 23px;
}

.content-grid {
  grid-template-columns:
    minmax(0, 1fr)
    360px;
  gap: 14px;
}

.filters {
  min-height: 82px;
  padding: 14px;

  grid-template-columns:
    1.15fr
    1fr
    .95fr
    1fr
    96px;

  gap: 10px;
}

.filter-group label {
  font-size: 10px;
  margin-bottom: 6px;
}

.filter-group select,
.filter-group input,
.fake-input {
  height: 38px;
  font-size: 11px;
  padding: 0 11px;
}

.filter-button {
  height: 38px;
  font-size: 11px;
}

th {
  height: 43px;
  padding: 0 14px;
  font-size: 10px;
}

td {
  height: 48px;
  padding: 0 14px;
  font-size: 11px;
}

.status-badge {
  padding: 5px 9px;
  font-size: 10px;
}

.view-button {
  width: 30px;
  height: 27px;
  font-size: 11px;
}

.detail-panel {
  min-height: 360px;
}

.detail-header {
  min-height: 67px;
  padding: 14px 16px;
}

.detail-header h2 {
  font-size: 15px;
}

.detail-header p {
  font-size: 10px;
}

.detail-content {
  padding: 16px;
}

.detail-row {
  min-height: 30px;
  grid-template-columns: 118px 1fr;
  font-size: 10px;
}

.detail-products-title {
  margin-top: 15px;
  font-size: 11px;
}

.detail-product {
  min-height: 42px;
  padding: 8px 9px;
  grid-template-columns: 1fr 42px 56px;
  font-size: 9.5px;
}

.detail-actions {
  margin-top: 14px;
  gap: 10px;
}

.detail-button {
  height: 38px;
  font-size: 10px;
}

.quick-panel,
.events-panel {
  padding: 14px;
}

.small-panel-title {
  font-size: 12px;
}

.quick-action {
  min-height: 55px;
  padding: 9px 12px;
}

.quick-action strong {
  font-size: 10px;
}

.quick-action small {
  font-size: 9px;
}

.quick-icon {
  font-size: 22px;
}

.event {
  min-height: 38px;
  font-size: 9px;
}

.panel-title-row {
  min-height: 64px;
  padding: 12px 15px;
}

.panel-title-row h2 {
  font-size: 15px;
}

.panel-title-row p {
  font-size: 10px;
}

.need-table {
  min-height: 160px;
}

.panel-link {
  height: 44px;
  font-size: 10px;
}

.footer {
  font-size: 9px;
}


/* Large monitors */
@media (min-width: 1500px) {
  .page {
    padding: 26px 28px;
  }

  .content-grid {
    grid-template-columns:
      minmax(0, 1fr)
      385px;
  }

  th {
    font-size: 10.5px;
  }

  td {
    font-size: 11.5px;
  }
}


/* Keep tablet/mobile layout working */
@media (max-width: 800px) {
  .sidebar {
    width: 100%;
  }

  .workspace {
    margin-left: 0;
  }
}

/* ========================================================= */
/* PRODUCTION WEB 0.3 */
/* ========================================================= */

.production-kpi {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.production-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 14px;
}

.production-detail-panel {
  min-height: 620px;
}

.production-detail-content {
  padding: 16px;
}

.production-section {
  margin-top: 20px;
}

.production-section:first-child {
  margin-top: 0;
}

.production-section-title {
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 700;
}

.production-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 9px;
}

.production-summary-card {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.production-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.production-summary-card strong {
  display: block;
  margin-top: 5px;
  font-size: 11px;
}

.production-items {
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.production-item {
  padding: 11px;
  border-bottom: 1px solid #edf1f5;
}

.production-item:last-child {
  border-bottom: 0;
}

.production-item-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.production-item-name {
  font-size: 10.5px;
  font-weight: 600;
}

.production-item-qty {
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}

.production-item-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.production-source {
  margin-top: 7px;
  padding: 7px 9px;
  background: #f7f9fc;
  border-radius: 4px;
  font-size: 9px;
}

.production-document {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  margin-top: 7px;
}

.production-document:first-child {
  margin-top: 0;
}

.production-document-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 5px;
  font-size: 9px;
}

.production-document-row:first-child {
  margin-top: 0;
}

.production-document-row span:first-child {
  color: var(--muted);
}

.production-warning {
  padding: 10px;
  border-radius: 5px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 9px;
}

@media (max-width: 1300px) {
  .production-layout {
    grid-template-columns: 1fr;
  }

  .production-detail-panel {
    min-height: auto;
  }
}

@media (max-width: 800px) {
  .production-kpi {
    grid-template-columns: repeat(2, 1fr);
  }

  .production-summary {
    grid-template-columns: 1fr;
  }
}

/* ========================================================= */
/* PRODUCTION NEED WEB 0.4 */
/* ========================================================= */

.need-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 14px;
}

.need-detail-panel {
  min-height: 520px;
}

.need-bottom-panel {
  margin-top: 14px;
}

.need-row {
  cursor: pointer;
}

.need-row:hover {
  background: #f8fafc;
}

.need-row.selected {
  background: #f0f5ff;
}

.need-source-card {
  padding: 12px;
  border-bottom: 1px solid #edf1f5;
}

.need-source-card:last-child {
  border-bottom: 0;
}

.need-source-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  font-size: 11px;
}

.need-source-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.need-total {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.need-total-label {
  color: var(--muted);
  font-size: 9px;
}

.need-total-value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
}

.need-empty-ok {
  padding: 22px;
  text-align: center;
}

.need-empty-ok strong {
  display: block;
  font-size: 13px;
}

.need-empty-ok span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 1300px) {
  .need-layout {
    grid-template-columns: 1fr;
  }
}


/* ========================================================= */
/* WEB 0.3 — OPERATIONAL ORDER STATES */
/* ========================================================= */

.status-badge.ready_to_post {
  color: #a15d00;
  background: #fff0d2;
}

.status-badge.shipment_planned {
  color: #6350b5;
  background: #f0edff;
}

.status-badge.picking {
  color: #7351c7;
  background: #eee9ff;
}

.status-badge.ready_to_ship {
  color: #087a48;
  background: #e3f8ec;
}

.status-badge.shipped {
  color: #087541;
  background: #ddf5e7;
}

.submenu-item[data-order-scope].active {
  color: #ffffff;
  font-weight: 600;
}

.submenu-item[data-order-scope].active .counter {
  background: #138cff;
  color: #ffffff;
}



/* ========================================================= */
/* WEB 0.4 — PRODUCTION OPERATOR SESSION */
/* ========================================================= */

.operator-session {
  padding: 14px;
  border: 1px solid #dce7f3;
  border-radius: 7px;
  background: #fbfdff;
}

.production-session-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.production-session-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.production-session-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.production-session-meta > div {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: white;
}

.production-session-meta span {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.production-session-meta strong {
  display: block;
  margin-top: 4px;
  font-size: 9px;
}

.production-session-items {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: white;
}

.production-session-item {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    80px
    minmax(130px, .8fr);
  gap: 10px;
  align-items: center;

  min-height: 50px;
  padding: 9px;

  border-bottom: 1px solid #edf1f5;
  font-size: 9px;
}

.production-session-item:last-child {
  border-bottom: 0;
}

.production-session-item-head {
  min-height: 34px;
  background: #f7f9fc;
  color: var(--muted);
  font-weight: 600;
}

.production-session-item strong {
  display: block;
}

.production-session-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.production-session-plan {
  font-weight: 600;
}

.actual-editor {
  display: flex;
  align-items: center;
  gap: 5px;
}

.actual-editor input {
  width: 90px;
  height: 31px;

  padding: 0 7px;

  border: 1px solid #ccd7e2;
  border-radius: 4px;

  background: white;
}

.actual-editor span {
  color: var(--muted);
  font-size: 9px;
}

.production-note-input {
  width: 100%;
  height: 30px;

  margin-top: 6px;
  padding: 0 7px;

  border: 1px solid #d6dee7;
  border-radius: 4px;

  background: white;
  font-size: 9px;
}

.production-session-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;

  margin-top: 12px;
}

.production-session-button {
  min-height: 34px;

  border-radius: 5px;

  font-size: 9px;
  font-weight: 600;
}

.production-session-button.primary {
  border: 0;
  background: var(--blue);
  color: white;
}

.production-session-button.secondary {
  width: 100%;

  margin-top: 6px;

  border: 1px solid #b9d6f2;
  background: #f5faff;
  color: #1e6fb7;
}

.production-session-button.success {
  border: 0;
  background: var(--green);
  color: white;
}

.production-session-button:disabled {
  cursor: default;
  opacity: .48;
}

.production-session-warning {
  margin-top: 10px;

  padding: 9px 10px;

  border: 1px solid #f0d39d;
  border-radius: 5px;

  background: #fff8e9;
  color: #91600c;

  font-size: 8.5px;
  line-height: 1.45;
}

.production-session-empty {
  padding: 14px;

  border: 1px dashed #d7e0e9;
  border-radius: 5px;

  color: var(--muted);
  font-size: 9px;
}

.production-item-note {
  color: #627182 !important;
  line-height: 1.35;
}

@media (max-width: 1150px) {
  .production-session-item {
    grid-template-columns: 1fr;
  }

  .production-session-actions {
    grid-template-columns: 1fr;
  }
}



/* ========================================================= */
/* WEB 0.5 — LIVE PRODUCTION CONFIRMATION */
/* ========================================================= */

.production-session-button.success:not(:disabled) {
  cursor: pointer;
}

.production-session-button.success:not(:disabled):hover {
  filter: brightness(.96);
}



/* ========================================================= */
/* WEB 0.7.1 — SHIPMENT SIDEBAR */
/* ========================================================= */

.shipment-session {
  margin-top: 14px;
}

.shipment-session .production-session-item-head {
  display: none;
}

.shipment-session .production-session-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;

  padding: 11px;
  font-size: 9px;
}

.shipment-session .production-session-item > div {
  min-width: 0;
}

.shipment-session .production-session-item strong {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.shipment-session .production-session-item small {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.shipment-session .production-session-plan {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  width: fit-content;
  padding: 4px 7px;

  border-radius: 4px;
  background: #f4f7fa;
}

.shipment-session .production-session-plan::before {
  content: "План:";
  color: var(--muted);
  font-weight: 400;
}

.shipment-session .actual-editor {
  width: 100%;
}

.shipment-session .actual-editor input {
  width: 100%;
  min-width: 0;
}

.shipment-session .production-session-actions {
  grid-template-columns: 1fr;
}

.shipment-session .production-session-button {
  width: 100%;
}

.shipment-session .production-session-meta {
  grid-template-columns: 1fr 1fr;
}



/* ========================================================= */
/* WEB 0.8 — ADMIN CLEANUP */
/* ========================================================= */

.operator-help {
  padding: 12px;

  display: flex;
  flex-direction: column;
  gap: 7px;

  font-size: 9px;
  line-height: 1.5;

  color: #607080;
}

.operator-help strong {
  color: #26394b;
  font-size: 10px;
}

.menu-main,
.submenu-item {
  cursor: pointer;
}

.menu-main.active {
  box-shadow:
    inset 3px 0 0 rgba(255,255,255,.65);
}

.submenu-item.active {
  font-weight: 600;
}

.sidebar-version {
  font-weight: 600;
  color: #a8bacb;
}

.system-card span {
  line-height: 1.4;
}



/* ========================================================= */
/* WEB 0.8.1 — FINAL ADMIN POLISH */
/* ========================================================= */

@media (min-width: 1201px) {
  .content-grid {
    grid-template-columns:
      minmax(0, 1fr)
      380px;
  }
}

.detail-panel {
  min-width: 0;
}

.detail-content {
  padding: 14px;
}

.shipment-session {
  margin-top: 16px;
}

.shipment-session .production-session-header {
  gap: 10px;
}

.shipment-session .production-session-subtitle {
  margin-top: 4px;
  line-height: 1.35;
}

.shipment-session .production-session-meta {
  gap: 8px;
}

.shipment-session .production-session-meta > div {
  min-width: 0;
}

.shipment-session .production-session-meta strong {
  overflow-wrap: anywhere;
}

.detail-products {
  margin-bottom: 2px;
}



/* ========================================================= */
/* WEB 0.9 — AUTHENTICATION & USERS */
/* ========================================================= */

.app.auth-pending {
  visibility: hidden;
}

.login-screen {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: none;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 15%, rgba(14,130,255,.12), transparent 30%),
    #eef3f8;
}

.login-screen.visible {
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(100%, 980px);
  min-height: 570px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr);
  overflow: hidden;
  border: 1px solid rgba(17,45,73,.08);
  border-radius: 18px;
  background: white;
  box-shadow: 0 28px 70px rgba(21,47,75,.16);
}

.login-brand {
  position: relative;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 80% 18%, rgba(31,142,255,.42), transparent 31%),
    radial-gradient(circle at 14% 87%, rgba(231,72,89,.20), transparent 30%),
    linear-gradient(145deg, #071b2d, #0b2943 58%, #0d3556);
}

.login-brand::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 45px rgba(255,255,255,.025),
    0 0 0 90px rgba(255,255,255,.018);
}

.login-brand-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 42px 44px 36px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 13px;
}

.login-logo-mark,
.login-mobile-mark {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0087ff, #e94c58);
  color: white;
  font-weight: 800;
}

.login-logo-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 19px;
}

.login-logo-title {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -.2px;
}

.login-logo-subtitle {
  margin-top: 3px;
  color: #8eabc2;
  font-size: 10px;
  letter-spacing: .4px;
}

.login-brand-copy {
  margin: auto 0;
}

.login-kicker {
  margin-bottom: 18px;
  color: #6eb8ff;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.6px;
}

.login-brand-copy h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 47px);
  line-height: 1.05;
  letter-spacing: -1.8px;
}

.login-brand-copy p {
  max-width: 380px;
  margin: 24px 0 0;
  color: #a8bacb;
  font-size: 14px;
  line-height: 1.65;
}

.login-brand-footer {
  color: #718da5;
  font-size: 10px;
}

.login-form-side {
  display: grid;
  place-items: center;
  padding: 48px;
}

.login-card {
  width: 100%;
  max-width: 340px;
}

.login-card-head {
  margin-bottom: 32px;
}

.login-card-head h2 {
  margin: 0;
  color: #152334;
  font-size: 27px;
  letter-spacing: -.7px;
}

.login-card-head p {
  margin: 8px 0 0;
  color: #8290a0;
  font-size: 12px;
}

.login-mobile-mark {
  display: none;
  width: 42px;
  height: 42px;
  margin-bottom: 22px;
  border-radius: 12px;
}

.login-field {
  display: block;
  margin-bottom: 18px;
}

.login-field > span {
  display: block;
  margin: 0 0 7px;
  color: #465568;
  font-size: 11px;
  font-weight: 650;
}

.login-field input {
  width: 100%;
  height: 47px;
  outline: none;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  padding: 0 13px;
  background: #fbfcfe;
  color: #152334;
  font-size: 13px;
  transition:
    border-color .15s ease,
    box-shadow .15s ease,
    background .15s ease;
}

.login-field input:focus {
  border-color: #1688f5;
  background: white;
  box-shadow: 0 0 0 3px rgba(8,124,240,.10);
}

.login-field input::placeholder {
  color: #a9b3be;
}

.login-error {
  min-height: 18px;
  margin: -3px 0 9px;
  color: var(--red);
  font-size: 10px;
  line-height: 1.4;
}

.login-button {
  width: 100%;
  height: 47px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #087cf0, #0b8bf8);
  color: white;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(8,124,240,.20);
}

.login-button:hover:not(:disabled) {
  filter: brightness(.98);
}

.login-button:disabled {
  cursor: default;
  opacity: .65;
}

.login-security {
  margin-top: 18px;
  color: #99a5b2;
  text-align: center;
  font-size: 9px;
}

.current-user {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 5px 4px 6px;
  border: 1px solid #e1e7ed;
  border-radius: 8px;
  background: white;
}

.current-user-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(135deg, #087cf0, #46a5ff);
  color: white;
  font-size: 11px;
  font-weight: 750;
}

.current-user-copy {
  min-width: 80px;
  display: flex;
  flex-direction: column;
}

.current-user-copy strong {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #263648;
  font-size: 10px;
}

.current-user-copy span {
  margin-top: 2px;
  color: #8491a0;
  font-size: 8px;
}

.logout-button {
  height: 28px;
  border: 0;
  border-radius: 6px;
  padding: 0 9px;
  background: #f2f5f8;
  color: #637180;
  font-size: 9px;
  font-weight: 600;
}

.logout-button:hover {
  background: #e9eef3;
  color: #2f4357;
}

.users-placeholder {
  max-width: 760px;
  margin: 0 24px;
  padding: 60px 30px;
  text-align: center;
}

.users-placeholder-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: var(--blue-soft);
  font-size: 22px;
}

.users-placeholder h2 {
  margin: 0;
  font-size: 18px;
}

.users-placeholder p {
  max-width: 430px;
  margin: 9px auto 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

@media (max-width: 780px) {
  .login-screen {
    padding: 14px;
  }

  .login-shell {
    display: block;
    min-height: 0;
    border-radius: 14px;
  }

  .login-brand {
    display: none;
  }

  .login-form-side {
    min-height: 520px;
    padding: 40px 28px;
  }

  .login-mobile-mark {
    display: grid;
  }

  .current-user-copy {
    display: none;
  }

  .logout-button {
    padding: 0 7px;
  }
}


/* ========================================================= */
/* WEB 0.9.1 — USERS ADMIN */
/* ========================================================= */

.profile-user {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
}

.profile-user-button {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 9px;
  padding: 5px 9px;
  background: transparent;
  color: var(--text);
}

.profile-user-button:hover {
  background: #f4f7fa;
}

.profile-user-arrow {
  color: #8996a3;
  font-size: 10px;
}

.profile-dropdown {
  position: absolute;
  z-index: 100;
  right: 0;
  top: calc(100% + 7px);
  width: 190px;
  display: none;
  overflow: hidden;
  border: 1px solid #dfe6ed;
  border-radius: 9px;
  background: white;
  box-shadow: 0 14px 35px rgba(25,47,68,.16);
}

.profile-dropdown.visible {
  display: block;
}

.profile-dropdown button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  padding: 0 14px;
  background: white;
  color: #33465a;
  text-align: left;
  font-size: 11px;
}

.profile-dropdown button:last-child {
  border-bottom: 0;
}

.profile-dropdown button:hover {
  background: #f6f9fc;
}

.profile-dropdown .profile-logout {
  color: #d8403a;
}


/* PAGE */

.users-admin-panel {
  margin: 0 24px 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.users-admin-toolbar {
  display: grid;
  grid-template-columns:
    minmax(220px,1fr)
    190px
    230px
    auto
    auto;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.users-search-wrap {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d9e2eb;
  border-radius: 6px;
  padding: 0 11px;
  background: white;
  color: #7d8b99;
}

.users-search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
}

.users-admin-toolbar select {
  height: 40px;
  border: 1px solid #d9e2eb;
  border-radius: 6px;
  padding: 0 10px;
  background: white;
  color: #34475a;
  font-size: 10px;
}

.users-primary-button,
.users-secondary-button {
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 10px;
  font-weight: 650;
}

.users-primary-button {
  border: 0;
  background: var(--blue);
  color: white;
}

.users-primary-button:hover {
  filter: brightness(.97);
}

.users-primary-button:disabled {
  opacity: .55;
  cursor: default;
}

.users-secondary-button {
  border: 1px solid #d9e2eb;
  background: white;
  color: #466178;
}

.users-table-wrap {
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.users-table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: #637285;
  text-align: left;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 700;
}

.users-table td {
  min-height: 52px;
  padding: 12px 14px;
  border-bottom: 1px solid #e8edf2;
  color: #2c3b4a;
  vertical-align: middle;
}

.users-table tbody tr:hover {
  background: #fbfdff;
}

.user-role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 5px;
  padding: 0 8px;
  font-size: 9px;
  font-weight: 650;
}

.user-role-badge.admin {
  background: #f0e9ff;
  color: #7843c9;
}

.user-role-badge.operator {
  background: #e8f3ff;
  color: #087cf0;
}

.user-role-badge.viewer {
  background: #edf1f5;
  color: #506477;
}

.user-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.user-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.user-status.enabled i {
  background: #16ad5f;
}

.user-status.disabled i {
  background: #e34141;
}

.user-actions {
  display: flex;
  gap: 6px;
}

.user-actions button {
  width: 31px;
  height: 31px;
  border: 1px solid #d7e2ed;
  border-radius: 6px;
  background: #f8fbfe;
  color: #367bb7;
  font-size: 13px;
}

.user-actions button.password {
  border-color: #cfe8d9;
  background: #f1fbf5;
  color: #159550;
}

.user-actions button.sessions {
  border-color: #f2dcb6;
  background: #fff9ee;
  color: #e18a0b;
}

.user-actions button:hover {
  filter: brightness(.97);
}

.users-table-footer {
  padding: 16px 14px;
  color: #758395;
  font-size: 10px;
}

.users-empty,
.users-error {
  padding: 50px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.users-error {
  color: var(--red);
}


/* MODAL */

.user-modal {
  position: fixed;
  z-index: 1500;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.user-modal.visible {
  display: flex;
}

.user-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7,25,41,.48);
  backdrop-filter: blur(2px);
}

.user-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  overflow: hidden;
  border-radius: 11px;
  background: white;
  box-shadow: 0 24px 70px rgba(7,25,41,.27);
}

.user-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.user-modal-header h2 {
  margin: 0;
  font-size: 17px;
}

.user-modal-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.user-modal-close {
  width: 31px;
  height: 31px;
  border: 0;
  border-radius: 6px;
  background: #f2f5f8;
  color: #627182;
  font-size: 18px;
}

.user-form-field {
  display: block;
  margin: 17px 22px 0;
}

.user-form-field > span {
  display: block;
  margin-bottom: 6px;
  color: #425365;
  font-size: 10px;
  font-weight: 650;
}

.user-form-field input,
.user-form-field select {
  width: 100%;
  height: 40px;
  border: 1px solid #d8e1ea;
  border-radius: 6px;
  padding: 0 10px;
  outline: none;
  background: white;
  color: var(--text);
  font-size: 11px;
}

.user-form-field input:focus,
.user-form-field select:focus {
  border-color: #1688f5;
  box-shadow: 0 0 0 3px rgba(8,124,240,.08);
}

.user-form-field input:disabled {
  background: #f4f6f8;
  color: #798594;
}

.user-form-field small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
}

.user-switch-row {
  margin: 19px 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px;
  border: 1px solid #e0e6ed;
  border-radius: 7px;
  background: #fafcfe;
}

.user-switch-row > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.user-switch-row strong {
  color: #34475a;
  font-size: 10px;
}

.user-switch-row small {
  color: var(--muted);
  font-size: 8px;
}

.user-switch-row input {
  width: 17px;
  height: 17px;
}

.user-form-error {
  min-height: 15px;
  margin: 12px 22px 0;
  color: var(--red);
  font-size: 9px;
}

.user-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  padding: 15px 22px 20px;
}

@media (max-width: 1150px) {
  .users-admin-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .users-search-wrap {
    grid-column: 1 / -1;
  }
}


/* =========================================================
   Web 0.9.2 — role-aware UI
   Backend RBAC remains authoritative.
   ========================================================= */

/*
 * Viewer is strictly read-only.
 * Actual quantity editors are also suppressed by JS;
 * this rule additionally hides all operational action areas.
 */
html[data-user-role="viewer"] .production-session-actions {
  display: none !important;
}

html[data-user-role="viewer"] [data-save-production-item],
html[data-user-role="viewer"] [data-save-shipment-item],
html[data-user-role="viewer"] [data-start-production-session],
html[data-user-role="viewer"] [data-confirm-production-session],
html[data-user-role="viewer"] [data-start-shipment-session],
html[data-user-role="viewer"] [data-confirm-shipment-session] {
  display: none !important;
}

/* Admin-only navigation */
html:not([data-user-role="admin"]) #usersMenuItem,
html:not([data-user-role="admin"]) #profileUsersButton {
  display: none !important;
}

/* ========================================================= */
/* WEB 0.10.1 — PASSWORD RESET                              */
/* ========================================================= */

.login-card[hidden] {
  display: none !important;
}

.login-text-button {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  color: #475569;
}

.login-text-button:hover {
  text-decoration: underline;
}

.login-notice {
  min-height: 0;
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.45;
}

.login-notice:empty {
  display: none;
}

.login-error:empty {
  display: none;
}

/* ========================================================= */
/* WEB 0.11.0 — STAGED LIVE SHIPMENT                         */
/* ========================================================= */

.shipment-execution {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #dce7f3;
}

.shipment-execution-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.shipment-execution-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.shipment-execution-step {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #dfe6ee;
  border-radius: 6px;
  background: #fff;
}

.shipment-execution-step > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #eef2f7;
  font-size: 10px;
  font-weight: 700;
}

.shipment-execution-step > div {
  min-width: 0;
}

.shipment-execution-step strong,
.shipment-execution-step small {
  display: block;
}

.shipment-execution-step small {
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.3;
}

.shipment-execution-step.active {
  border-color: #9db9dc;
  background: #f7fbff;
}

.shipment-execution-step.done {
  border-color: #b8dac5;
  background: #f5fbf7;
}

.shipment-execution-step.done > span {
  background: #dff3e6;
}

.shipment-document-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.shipment-document-card {
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
}

.shipment-document-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.shipment-document-title small {
  color: var(--muted);
  text-align: right;
}

.shipment-document-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 9px;
}

.shipment-document-sides > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px;
  border-radius: 5px;
  background: #f7f9fc;
}

.shipment-document-sides span {
  color: var(--muted);
}

.shipment-side-status.done {
  color: #187443;
}

.shipment-side-status.waiting {
  color: #64748b;
}

.shipment-side-status.uncertain,
.shipment-side-status.failed {
  color: #b42318;
}

.shipment-document-error {
  margin-top: 8px;
  padding: 7px;
  border-radius: 5px;
  background: #fff4f2;
  color: #b42318;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.shipment-documents-empty {
  margin-top: 12px;
  padding: 10px;
  border-radius: 6px;
  background: #f7f9fc;
  color: var(--muted);
}

.shipment-execution-blocked {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #f3c5bd;
  border-radius: 6px;
  background: #fff5f3;
  color: #9f291e;
}

.shipment-execution-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html[data-user-role="viewer"] .shipment-execution-actions {
  display: none !important;
}

@media (max-width: 1150px) {
  .shipment-execution-progress {
    grid-template-columns: 1fr 1fr;
  }

  .shipment-execution-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .shipment-execution-progress {
    grid-template-columns: 1fr;
  }

  .shipment-document-sides {
    grid-template-columns: 1fr;
  }

  .shipment-document-title {
    display: grid;
  }

  .shipment-document-title small {
    text-align: left;
  }
}

/* ========================================================= */
/* WEB 0.11.1 — FULL WIDTH ORDER DETAIL                      */
/* ========================================================= */

.order-detail-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.order-detail-back {
  flex: 0 0 auto;

  min-height: 34px;
  padding: 0 12px;

  border: 1px solid #cfdbea;
  border-radius: 6px;

  background: #fff;
  color: #2674c8;

  font-size: 10px;
  font-weight: 700;

  cursor: pointer;
}

.order-detail-back:hover {
  background: #f4f8fd;
  border-color: #aac7e8;
}

.order-detail-back[hidden] {
  display: none !important;
}


/*
 * When an order is opened:
 * - hide KPI / filters / orders list
 * - hide auxiliary quick panel
 * - use the whole workspace for the order card
 */

#ordersPage.order-detail-open > .page-header {
  display: none;
}

#ordersPage.order-detail-open > .kpi-grid {
  display: none;
}

#ordersPage.order-detail-open .content-grid {
  display: block;
}

#ordersPage.order-detail-open .content-grid > :first-child {
  display: none;
}

#ordersPage.order-detail-open .right-column {
  display: block;
  width: 100%;
  max-width: none;
}

#ordersPage.order-detail-open .right-column > .quick-panel {
  display: none;
}

#ordersPage.order-detail-open .detail-panel {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 40px);
  margin: 0;
}

#ordersPage.order-detail-open .detail-header {
  position: sticky;
  z-index: 20;
  top: 0;

  align-items: center;

  min-height: 70px;
  padding: 14px 20px;

  background: #fff;
}

#ordersPage.order-detail-open .detail-header h2 {
  font-size: 18px;
}

#ordersPage.order-detail-open .detail-header p {
  font-size: 11px;
}

#ordersPage.order-detail-open .detail-content {
  max-width: none;
  padding: 20px;
}


/* Order information is easier to read across a wide page */

#ordersPage.order-detail-open .detail-row {
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 32px;
  font-size: 11px;
}

#ordersPage.order-detail-open .detail-products-title {
  margin-top: 20px;
  font-size: 12px;
}

#ordersPage.order-detail-open .detail-product {
  grid-template-columns:
    minmax(260px, 1fr)
    100px
    120px;

  min-height: 44px;
  padding: 9px 12px;

  font-size: 10px;
}


/* Production / picking blocks now use available horizontal space */

#ordersPage.order-detail-open .operator-session {
  padding: 18px;
}

#ordersPage.order-detail-open .shipment-session
.production-session-item-head {
  display: grid;
}

#ordersPage.order-detail-open .shipment-session
.production-session-item {
  grid-template-columns:
    minmax(300px, 1fr)
    120px
    minmax(220px, 320px);

  gap: 16px;
  align-items: center;

  padding: 12px 14px;
  font-size: 10px;
}

#ordersPage.order-detail-open .shipment-session
.production-session-plan {
  width: auto;
}

#ordersPage.order-detail-open .shipment-session
.production-session-plan::before {
  display: none;
}

#ordersPage.order-detail-open .shipment-session
.production-session-actions {
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
}


/* Shipment execution */

#ordersPage.order-detail-open
.shipment-execution-progress {
  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 10px;
}

#ordersPage.order-detail-open
.shipment-execution-step {
  min-height: 74px;
  padding: 12px;
}

#ordersPage.order-detail-open
.shipment-document-list {
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 12px;
}

#ordersPage.order-detail-open
.shipment-document-card {
  padding: 14px;
}

#ordersPage.order-detail-open
.shipment-document-title {
  align-items: flex-start;
}

#ordersPage.order-detail-open
.shipment-document-sides {
  gap: 12px;
}

#ordersPage.order-detail-open
.shipment-execution-actions {
  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 10px;
}


/* Medium screens */

@media (max-width: 1200px) {

  #ordersPage.order-detail-open
  .shipment-session
  .production-session-item {
    grid-template-columns:
      minmax(220px, 1fr)
      90px
      minmax(180px, 260px);
  }

  #ordersPage.order-detail-open
  .shipment-document-list {
    grid-template-columns: 1fr;
  }

  #ordersPage.order-detail-open
  .shipment-execution-actions {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }
}


/* Narrow/mobile screens */

@media (max-width: 800px) {

  #ordersPage.order-detail-open
  .detail-header {
    position: static;
    display: grid;
    gap: 12px;
  }

  .order-detail-heading {
    display: grid;
  }

  #ordersPage.order-detail-open
  .detail-content {
    padding: 14px;
  }

  #ordersPage.order-detail-open
  .shipment-session
  .production-session-item {
    grid-template-columns: 1fr;
  }

  #ordersPage.order-detail-open
  .shipment-execution-progress,
  #ordersPage.order-detail-open
  .shipment-execution-actions {
    grid-template-columns: 1fr;
  }
}

/* ========================================================= */
/* WEB 0.11.2 — LARGE ORDER WORKSPACE                        */
/* ========================================================= */

/*
 * Main order page typography.
 */

#ordersPage.order-detail-open .detail-panel {
  border-radius: 8px;
}

#ordersPage.order-detail-open .detail-header {
  min-height: 82px;
  padding: 16px 24px;
}

#ordersPage.order-detail-open .detail-header h2 {
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.25px;
}

#ordersPage.order-detail-open .detail-header p {
  margin-top: 5px;
  font-size: 13px;
}

#ordersPage.order-detail-open .detail-header .status-badge {
  padding: 7px 12px;
  font-size: 12px;
}

#ordersPage.order-detail-open .order-detail-back {
  min-height: 42px;
  padding: 0 15px;
  font-size: 12px;
}


/*
 * General order information.
 */

#ordersPage.order-detail-open .detail-content {
  padding: 24px;
}

#ordersPage.order-detail-open .detail-row {
  grid-template-columns: 180px minmax(0, 1fr);
  min-height: 40px;
  gap: 16px;

  font-size: 13px;
  line-height: 1.4;
}

#ordersPage.order-detail-open .detail-row span:first-child {
  font-size: 13px;
}

#ordersPage.order-detail-open .detail-row strong {
  font-size: 13px;
}


/*
 * Product list.
 */

#ordersPage.order-detail-open .detail-products-title {
  margin: 24px 0 10px;
  font-size: 14px;
}

#ordersPage.order-detail-open .detail-products {
  border-radius: 7px;
}

#ordersPage.order-detail-open .detail-product {
  grid-template-columns:
    minmax(320px, 1fr)
    120px
    140px;

  min-height: 52px;
  padding: 11px 14px;
  gap: 12px;

  font-size: 12px;
}


/*
 * Production / shipment cards.
 */

#ordersPage.order-detail-open .production-session,
#ordersPage.order-detail-open .shipment-session {
  margin-top: 22px;
}

#ordersPage.order-detail-open .production-session-header {
  padding-bottom: 4px;
}

#ordersPage.order-detail-open .production-section-title {
  font-size: 15px;
  line-height: 1.3;
}

#ordersPage.order-detail-open .production-session-subtitle {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.45;
}

#ordersPage.order-detail-open .production-session-header
.status-badge {
  padding: 7px 11px;
  font-size: 11px;
}


/*
 * Session metadata — Started / Confirmed.
 */

#ordersPage.order-detail-open .production-session-meta {
  gap: 12px;
  margin-top: 14px;
}

#ordersPage.order-detail-open
.production-session-meta > div {
  min-height: 58px;
  padding: 11px 13px;
}

#ordersPage.order-detail-open
.production-session-meta span {
  font-size: 10px;
}

#ordersPage.order-detail-open
.production-session-meta strong {
  margin-top: 4px;
  font-size: 12px;
}


/*
 * Picking table.
 */

#ordersPage.order-detail-open
.shipment-session
.production-session-items {
  margin-top: 14px;
  border-radius: 7px;
}

#ordersPage.order-detail-open
.shipment-session
.production-session-item {
  grid-template-columns:
    minmax(420px, 1fr)
    140px
    160px;

  min-height: 86px;
  gap: 22px;
  padding: 14px 18px;

  font-size: 12px;
}

#ordersPage.order-detail-open
.shipment-session
.production-session-item strong {
  font-size: 13px;
  line-height: 1.35;
}

#ordersPage.order-detail-open
.shipment-session
.production-session-item small {
  font-size: 10px;
  line-height: 1.45;
}

#ordersPage.order-detail-open
.shipment-session
.production-session-item-head {
  min-height: 46px;
  padding-top: 0;
  padding-bottom: 0;

  font-size: 11px;
  font-weight: 700;
}

#ordersPage.order-detail-open
.shipment-session
.production-session-plan {
  min-height: 32px;
  padding: 7px 10px;

  border-radius: 5px;

  font-size: 12px;
  font-weight: 700;
}

#ordersPage.order-detail-open
.shipment-session
.production-session-actual {
  font-size: 13px;
  font-weight: 700;
}


/*
 * Operational buttons.
 */

#ordersPage.order-detail-open
.production-session-actions {
  gap: 12px;
  margin-top: 14px;
}

#ordersPage.order-detail-open
.production-session-button {
  min-height: 44px;
  padding: 9px 14px;

  font-size: 11px;
  font-weight: 700;
}


/*
 * Completed picking:
 * visually de-emphasize obsolete controls.
 */

#ordersPage.order-detail-open
.shipment-session:has(
  .status-badge.shipped
)
.production-session-actions {
  display: none;
}


/*
 * Shipment documents.
 */

#ordersPage.order-detail-open .shipment-execution {
  margin-top: 24px;
  padding-top: 20px;
}

#ordersPage.order-detail-open
.shipment-execution-head {
  align-items: center;
}

#ordersPage.order-detail-open
.shipment-execution-progress {
  gap: 12px;
  margin-top: 16px;
}

#ordersPage.order-detail-open
.shipment-execution-step {
  min-height: 92px;
  gap: 11px;
  padding: 15px;
  border-radius: 7px;
}

#ordersPage.order-detail-open
.shipment-execution-step > span {
  flex-basis: 30px;
  width: 30px;
  height: 30px;

  font-size: 12px;
}

#ordersPage.order-detail-open
.shipment-execution-step strong {
  font-size: 13px;
  line-height: 1.3;
}

#ordersPage.order-detail-open
.shipment-execution-step small {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
}


/*
 * Shipment document cards.
 */

#ordersPage.order-detail-open
.shipment-document-list {
  gap: 14px;
  margin-top: 16px;
}

#ordersPage.order-detail-open
.shipment-document-card {
  min-height: 125px;
  padding: 16px;
  border-radius: 7px;
}

#ordersPage.order-detail-open
.shipment-document-title strong {
  font-size: 15px;
  line-height: 1.25;
}

#ordersPage.order-detail-open
.shipment-document-title small {
  max-width: 220px;
  font-size: 11px;
  line-height: 1.35;
}

#ordersPage.order-detail-open
.shipment-document-sides {
  margin-top: 14px;
}

#ordersPage.order-detail-open
.shipment-document-sides > div {
  min-height: 42px;
  padding: 10px 12px;
}

#ordersPage.order-detail-open
.shipment-document-sides span {
  font-size: 11px;
}

#ordersPage.order-detail-open
.shipment-side-status {
  font-size: 13px;
}


/*
 * Final completed state.
 */

.shipment-completed-summary {
  display: flex;
  align-items: center;
  gap: 12px;

  margin-top: 16px;
  padding: 14px 16px;

  border: 1px solid #b8dac5;
  border-radius: 7px;

  background: #f4fbf6;
}

.shipment-completed-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 34px;
  width: 34px;
  height: 34px;

  border-radius: 50%;

  background: #dff3e6;
  color: #187443;

  font-size: 18px;
  font-weight: 800;
}

.shipment-completed-summary strong,
.shipment-completed-summary small {
  display: block;
}

.shipment-completed-summary strong {
  color: #187443;
  font-size: 13px;
}

.shipment-completed-summary small {
  margin-top: 3px;
  color: #557060;
  font-size: 11px;
  line-height: 1.4;
}


/*
 * Give the content some breathing room at the bottom.
 */

#ordersPage.order-detail-open .detail-content {
  padding-bottom: 50px;
}


/*
 * Responsive adjustments.
 */

@media (max-width: 1200px) {

  #ordersPage.order-detail-open
  .shipment-session
  .production-session-item {
    grid-template-columns:
      minmax(300px, 1fr)
      110px
      130px;

    gap: 14px;
  }
}

@media (max-width: 800px) {

  #ordersPage.order-detail-open .detail-header h2 {
    font-size: 18px;
  }

  #ordersPage.order-detail-open .detail-row {
    grid-template-columns: 120px 1fr;
    font-size: 11px;
  }

  #ordersPage.order-detail-open
  .shipment-session
  .production-session-item {
    grid-template-columns: 1fr;
  }

  #ordersPage.order-detail-open
  .shipment-document-card {
    min-height: 0;
  }
}

/* ========================================================= */
/* WEB 0.11.3 — SHIPMENT DOCUMENT ARCHIVE                    */
/* ========================================================= */

.shipment-document-side {
  display: grid !important;
  gap: 9px;
}

.shipment-document-side-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.shipment-document-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shipment-document-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 30px;
  padding: 0 9px;

  border: 1px solid #c9d8e8;
  border-radius: 5px;

  background: white;
  color: #2674c8;

  font-size: 10px;
  font-weight: 700;

  text-decoration: none;
  white-space: nowrap;
}

.shipment-document-links a:hover {
  border-color: #8fb7df;
  background: #f5f9fd;
}

#ordersPage.order-detail-open
.shipment-document-side {
  min-height: 86px;
  padding: 10px 12px;
}

#ordersPage.order-detail-open
.shipment-document-links a {
  min-height: 34px;
  padding: 0 11px;
  font-size: 11px;
}

@media (max-width: 800px) {
  .shipment-document-links {
    display: grid;
    grid-template-columns: 1fr;
  }

  .shipment-document-links a {
    width: 100%;
  }
}


/* =========================================================
   SIMPLE DIRECT SHIPMENT — Web 0.12
   ========================================================= */

.simple-workflow {
  margin-top: 22px;
  margin-bottom: 28px;
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 16px;
  background: rgba(0, 0, 0, .018);
}

.simple-workflow-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.simple-workflow-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.simple-workflow-meta > div {
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: 12px;
  background: rgba(255, 255, 255, .65);
}

.simple-workflow-meta span,
.simple-workflow-meta strong {
  display: block;
}

.simple-workflow-meta span {
  margin-bottom: 4px;
  font-size: 12px;
  opacity: .58;
}

.simple-workflow-meta strong {
  overflow-wrap: anywhere;
}

.simple-workflow-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 4px 0 20px;
}

.simple-workflow-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 12px;
  opacity: .55;
}

.simple-workflow-step > span {
  display: flex;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .08);
  font-weight: 700;
}

.simple-workflow-step strong,
.simple-workflow-step small {
  display: block;
}

.simple-workflow-step small {
  margin-top: 3px;
  opacity: .65;
}

.simple-workflow-step.active {
  opacity: 1;
  border-color: rgba(0, 0, 0, .18);
}

.simple-workflow-step.done {
  opacity: 1;
}

.simple-workflow-step.done > span {
  background: rgba(0, 0, 0, .88);
  color: #fff;
}

.simple-workflow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.simple-workflow-note {
  margin-top: 12px;
  font-size: 12px;
  opacity: .6;
}

@media (max-width: 760px) {
  .simple-workflow-meta,
  .simple-workflow-progress {
    grid-template-columns: 1fr;
  }

  .simple-workflow-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .simple-workflow-actions {
    flex-direction: column;
  }

  .simple-workflow-actions
  .production-session-button {
    width: 100%;
  }
}


/* SURIMI UNREAD ORDERS */

#ordersTable tbody tr.order-unread {
  background: rgba(37, 99, 235, 0.075);
}

#ordersTable tbody tr.order-unread:hover {
  background: rgba(37, 99, 235, 0.12);
}

#ordersTable tbody tr.order-unread td:first-child {
  box-shadow: inset 3px 0 0 #2563eb;
}

#ordersTable tbody tr.order-unread .order-link {
  font-weight: 700;
}

.unread-order-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
  color: #2563eb;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  vertical-align: middle;
  white-space: nowrap;
}

.unread-order-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

#ordersTable tbody tr.order-unread.selected {
  background: rgba(37, 99, 235, 0.14);
}


/* ========================================================= */
/* WEB 0.13.0 — RESTAURANTS ADMIN */
/* ========================================================= */

.restaurants-admin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.restaurants-summary-card {
  background: var(--panel, #fff);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.restaurants-summary-card span {
  font-size: 13px;
  opacity: .65;
}

.restaurants-summary-card strong {
  font-size: 27px;
  line-height: 1;
}

.restaurants-summary-card.ready strong {
  color: #16834b;
}

.restaurants-summary-card.attention strong {
  color: #b65b16;
}

.restaurants-table td {
  vertical-align: middle;
}

.restaurant-row-subtitle {
  display: block;
  margin-top: 4px;
  opacity: .55;
  font-size: 12px;
}

.restaurant-mono {
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;
  font-size: 12px;
}

.restaurant-details-button {
  min-width: 34px;
  height: 32px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

.restaurant-details-button:hover {
  background: rgba(0, 0, 0, .04);
}

.restaurant-details-row td {
  padding: 0 !important;
}

.restaurant-details-row > td {
  background: rgba(0, 0, 0, .018);
}

.restaurant-tech-grid {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
  padding: 20px 22px 12px;
}

.restaurant-tech-grid > div {
  min-width: 0;
}

.restaurant-tech-grid span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .5;
  margin-bottom: 5px;
}

.restaurant-tech-grid strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.restaurant-tech-grid small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: .55;
  overflow-wrap: anywhere;
}

.restaurant-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 22px 20px;
}

.restaurant-check {
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.restaurant-check.ok {
  background: rgba(22, 131, 75, .09);
  color: #16834b;
}

.restaurant-check.bad {
  background: rgba(184, 72, 51, .10);
  color: #b84833;
}

.restaurant-attention-row {
  background: rgba(182, 91, 22, .035);
}

@media (max-width: 1100px) {
  .restaurants-admin-summary,
  .restaurant-tech-grid {
    grid-template-columns: 1fr;
  }
}


/* ========================================================= */
/* WEB 0.14.0 — RESTAURANT CONFIGURATION EDITOR              */
/* ========================================================= */

.restaurant-row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.restaurant-edit-button {
  min-width: 34px;
  height: 32px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
}

.restaurant-edit-button:hover {
  background: rgba(0, 0, 0, .04);
}

.restaurant-editor-row > td {
  padding: 0 !important;
  background: rgba(0, 0, 0, .018);
}

.restaurant-editor-form {
  padding: 22px;
  border-top: 1px solid rgba(0, 0, 0, .07);
}

.restaurant-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.restaurant-editor-head strong {
  display: block;
  font-size: 15px;
}

.restaurant-editor-head small {
  display: block;
  margin-top: 5px;
  opacity: .58;
}

.restaurant-editor-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.restaurant-editor-grid label {
  min-width: 0;
}

.restaurant-editor-grid label > span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
}

.restaurant-editor-grid input,
.restaurant-editor-grid select,
.restaurant-editor-grid textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid rgba(0, 0, 0, .14);
  border-radius: 8px;
  background: var(--panel, #fff);
  font: inherit;
}

.restaurant-editor-grid textarea {
  resize: vertical;
  min-height: 90px;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;
  font-size: 12px;
}

.restaurant-editor-grid input[readonly],
.restaurant-editor-grid input:disabled {
  background: rgba(0, 0, 0, .035);
  opacity: .75;
}

.restaurant-editor-grid label > small {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  opacity: .55;
}

.restaurant-editor-wide {
  grid-column: 1 / -1;
}

.restaurant-editor-enabled {
  display: flex;
  align-items: center;
  gap: 9px;
}

.restaurant-editor-enabled input {
  width: auto;
  min-height: 0;
}

.restaurant-editor-enabled > span {
  margin: 0 !important;
}

.restaurant-editor-validation {
  margin-top: 18px;
  padding: 13px 15px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 9px;
  background: rgba(0, 0, 0, .018);
}

.restaurant-validation-ok {
  color: #16834b;
  font-weight: 600;
}

.restaurant-validation-error {
  color: #b84833;
  margin-top: 6px;
}

.restaurant-validation-warning {
  color: #9b6417;
  margin-top: 6px;
}

.restaurant-validation-resolved {
  margin-top: 8px;
  font-size: 12px;
  opacity: .72;
}

.restaurant-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.restaurant-save-button {
  width: auto;
  min-width: 130px;
  margin: 0;
}

@media (max-width: 900px) {
  .restaurant-editor-grid {
    grid-template-columns: 1fr;
  }

  .restaurant-editor-wide {
    grid-column: auto;
  }

  .restaurant-editor-head {
    flex-direction: column;
  }
}


/* Web 0.14.1 — restaurant creation */
.restaurant-admin-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.restaurant-create-panel {
  margin-bottom: 18px;
}

.restaurant-create-panel .restaurant-editor-form {
  margin: 0;
}

/* Web 0.14.2 — RMS administration */
.restaurant-admin-toolbar {
  gap: 10px;
  flex-wrap: wrap;
}

.rms-create-form {
  margin: 0;
}


/* ========================================================= */
/* WEB 0.14.3 — ORDER BLANK SYNC STATUS */
/* ========================================================= */

.sync-system-card {
  min-height: 130px;
}

.sync-system-card.good {
  border-color: rgba(31, 157, 100, .28);
}

.sync-system-card.warning {
  border-color: rgba(221, 151, 35, .42);
  background: rgba(255, 249, 235, .72);
}

.sync-system-card.bad {
  border-color: rgba(205, 67, 67, .30);
  background: rgba(255, 245, 245, .72);
}

.sync-system-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sync-state {
  display: inline-flex !important;
  width: fit-content;
  margin-top: 0 !important;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 9px !important;
  font-weight: 700;
  white-space: nowrap;
}

.sync-state.good {
  color: #16784c;
  background: rgba(31, 157, 100, .10);
}

.sync-state.warning {
  color: #986413;
  background: rgba(221, 151, 35, .14);
}

.sync-state.bad {
  color: #a33636;
  background: rgba(205, 67, 67, .10);
}

.sync-system-count {
  margin-top: 14px;
  font-size: 18px;
  font-weight: 700;
  color: #26394b;
}

.sync-system-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.sync-blocked-list {
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.sync-blocked-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  padding: 5px 0;
  font-size: 10px;
}

.sync-blocked-item b {
  color: #986413;
}

.sync-blocked-item span {
  margin: 0 !important;
  color: #394b5c;
}

.sync-blocked-item small {
  grid-column: 2;
  color: var(--muted);
}

.sync-error-text {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(205, 67, 67, .18);
  color: #a33636;
  font-size: 10px;
  line-height: 1.4;
}


/* ========================================================= */
/* WEB 0.14.4 — ORDERS LIVE REFRESH */
/* ========================================================= */

.orders-live-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.orders-auto-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(31, 157, 100, .10);
  color: #16784c;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.orders-auto-status.error {
  background: rgba(205, 67, 67, .10);
  color: #a33636;
}

.order-sound-toggle {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #34495e;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.order-sound-toggle:hover {
  background: rgba(44, 107, 237, .05);
}

.order-sound-toggle.muted {
  color: var(--muted);
  opacity: .72;
}

.orders-updated-label {
  white-space: nowrap;
}

.new-order-toast {
  position: fixed;
  z-index: 10000;
  top: 18px;
  right: 18px;
  width: min(360px, calc(100vw - 36px));
  padding: 15px 17px;
  border: 1px solid rgba(31, 157, 100, .24);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(35, 55, 75, .18);
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition:
    opacity .18s ease,
    transform .18s ease;
}

.new-order-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.new-order-toast strong {
  display: block;
  color: #16784c;
  font-size: 14px;
}

.new-order-toast span {
  display: block;
  margin-top: 4px;
  color: #425466;
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .orders-live-controls {
    justify-content: flex-start;
  }

  .new-order-toast {
    top: 10px;
    right: 10px;
    width: calc(100vw - 20px);
  }
}


/* ========================================================= */
/* WEB 0.15.0 — ADMINISTRATION */
/* ========================================================= */

.admin-overview {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-overview-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 110px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition:
    transform .15s ease,
    box-shadow .15s ease,
    border-color .15s ease;
}

.admin-overview-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(35,55,75,.08);
}

.admin-overview-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(44,107,237,.08);
  font-size: 20px;
}

.admin-overview-copy {
  min-width: 0;
}

.admin-overview-copy strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.admin-overview-copy span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.admin-overview-value {
  font-size: 22px;
  font-weight: 800;
}

.admin-overview-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.admin-overview-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
}

.admin-overview-section-header h2 {
  margin: 0 0 4px;
  font-size: 15px;
}

.admin-overview-section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.admin-status-grid {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-status-card {
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(248,250,252,.72);
}

.admin-status-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.admin-status-card strong {
  display: block;
  font-size: 15px;
}

.admin-status-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.admin-status-good {
  color: #16784c;
}

.admin-status-bad {
  color: #a33636;
}

@media (max-width: 1000px) {
  .admin-overview-grid,
  .admin-status-grid {
    grid-template-columns: 1fr;
  }
}


/* ========================================================= */
/* SURIMI_EDO_ADMIN_V1                                      */
/* ========================================================= */

.edo-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.edo-kpi-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.edo-kpi-card {
  background: var(--panel-bg, #fff);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.edo-kpi-card span {
  font-size: 13px;
  color: #6b7280;
}

.edo-kpi-card strong {
  font-size: 28px;
  line-height: 1.1;
}

.edo-kpi-card small {
  color: #9ca3af;
  font-size: 12px;
}

.edo-panel {
  background: var(--panel-bg, #fff);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 16px;
  overflow: hidden;
}

.edo-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, .07);
}

.edo-search-wrap {
  flex: 1;
  max-width: 440px;
}

.edo-toolbar select {
  min-width: 180px;
}

.edo-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.edo-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
}

.edo-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  background: rgba(0, 0, 0, .02);
  border-bottom: 1px solid rgba(0, 0, 0, .07);
  white-space: nowrap;
}

.edo-table td {
  padding: 14px;
  vertical-align: top;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  font-size: 13px;
}

.edo-table tbody tr:last-child td {
  border-bottom: 0;
}

.edo-document-cell,
.edo-restaurant-cell,
.edo-sbis-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.edo-document-cell strong,
.edo-restaurant-cell strong {
  white-space: nowrap;
}

.edo-document-cell small,
.edo-restaurant-cell small,
.edo-sbis-cell small,
.edo-shipment-status {
  color: #8a9099;
  font-size: 11px;
}

.edo-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.edo-status-badge.draft {
  background: #fff4d6;
  color: #8a5b00;
}

.edo-status-badge.pending {
  background: #eef2f7;
  color: #58616e;
}

.edo-status-badge.ready {
  background: #e8f5ed;
  color: #247244;
}

.edo-status-badge.sent,
.edo-status-badge.completed {
  background: #e7f4ec;
  color: #18713c;
}

.edo-status-badge.failed {
  background: #fdeaea;
  color: #a22b2b;
}

.edo-status-badge.review {
  background: #fff0df;
  color: #9a5411;
}

.edo-status-badge.neutral {
  background: #eef1f4;
  color: #646b74;
}

.edo-sbis-provider {
  font-weight: 600;
}

.edo-shipment-status {
  margin-top: 5px;
}

.edo-error {
  margin-top: 5px;
  max-width: 360px;
  color: #a22b2b;
  font-size: 11px;
  line-height: 1.35;
}

.edo-row-error {
  background: rgba(190, 35, 35, .025);
}

@media (max-width: 1100px) {
  .edo-kpi-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .edo-kpi-grid {
    grid-template-columns: 1fr;
  }

  .edo-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .edo-search-wrap {
    max-width: none;
  }
}



/* ========================================================= */
/* SURIMI_EDO_MAIN_NAV_V1                                   */
/* ========================================================= */

html[data-user-role="admin"] #edoMainMenuItem {
  display: flex !important;
}

.edo-document-link,
.edo-sbis-link {
  color: inherit;
  text-decoration: none;
}

.edo-document-link:hover strong {
  text-decoration: underline;
}

.edo-sbis-link {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.edo-sbis-link:hover .edo-sbis-provider {
  text-decoration: underline;
}

.edo-open-hint {
  font-size: 10px;
  color: #9ca3af;
}



/* ========================================================= */
/* SURIMI_EDO_ROW_CLICK_V1                                  */
/* ========================================================= */

.edo-document-row[data-edo-open] {
  cursor: pointer;
  transition:
    background-color .12s ease,
    box-shadow .12s ease;
}

.edo-document-row[data-edo-open]:hover td {
  background: rgba(31, 41, 55, .035);
}

.edo-document-row[data-edo-open]:focus {
  outline: none;
}

.edo-document-row[data-edo-open]:focus td {
  background: rgba(31, 41, 55, .045);
}

.edo-document-row[data-edo-open]:active td {
  background: rgba(31, 41, 55, .065);
}



/* ========================================================= */
/* SURIMI_EDO_SBIS_ACTIONS_V1                               */
/* ========================================================= */

.edo-sbis-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.edo-sbis-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 6px;
  background: #fff;
  color: #596270;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.edo-sbis-actions a:hover {
  background: #f5f6f7;
  color: #20242a;
  border-color: rgba(0, 0, 0, .18);
}


/* ========================================================= */
/* SURIMI_MOBILE_V1                                          */
/* Final mobile application shell                            */
/* ========================================================= */

.mobile-appbar,
.mobile-sidebar-backdrop {
  display: none;
}

@media (max-width: 800px) {

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  /* ------------------------------------------------------- */
  /* MOBILE APP BAR                                          */
  /* ------------------------------------------------------- */

  .mobile-appbar {
    position: sticky;
    z-index: 45;
    top: 0;

    height: 58px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding:
      env(safe-area-inset-top, 0)
      14px
      0;

    background: #17191c;
    color: #fff;

    border-bottom:
      1px solid rgba(255,255,255,.08);
  }

  .mobile-appbar-left {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-menu-button {
    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 10px;

    background: rgba(255,255,255,.08);
    color: #fff;

    font-size: 21px;
    line-height: 1;
  }

  .mobile-appbar-logo {
    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    object-fit: contain;
  }

  .mobile-appbar-copy {
    min-width: 0;
  }

  .mobile-appbar-title {
    overflow: hidden;

    color: #fff;

    font-size: 13px;
    font-weight: 800;

    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-appbar-subtitle {
    margin-top: 2px;

    overflow: hidden;

    color: rgba(255,255,255,.48);

    font-size: 9px;

    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-user-button {
    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    display: grid;
    place-items: center;

    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;

    background: rgba(255,255,255,.08);
    color: #fff;

    font-size: 11px;
    font-weight: 800;
  }


  /* ------------------------------------------------------- */
  /* DRAWER                                                   */
  /* ------------------------------------------------------- */

  .sidebar {
    position: fixed !important;

    z-index: 60;

    top: 0;
    bottom: 0;
    left: 0;

    width: min(86vw, 310px) !important;
    min-height: 100dvh;

    padding:
      calc(18px + env(safe-area-inset-top, 0))
      12px
      calc(14px + env(safe-area-inset-bottom, 0));

    transform: translateX(-105%);

    box-shadow:
      20px 0 60px rgba(0,0,0,.28);

    transition:
      transform .22s ease;

    overflow: hidden;
  }

  body.mobile-menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar .logo {
    padding-bottom: 15px;
  }

  .sidebar .menu {
    display: block !important;

    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .sidebar .menu-section {
    display: block !important;
  }

  .sidebar .menu-main {
    min-height: 46px;
    height: auto;
  }

  .sidebar .submenu {
    display: block;
  }

  .sidebar .submenu-item {
    min-height: 38px;
  }

  .sidebar-footer {
    display: block !important;
  }

  .mobile-sidebar-backdrop {
    position: fixed;

    z-index: 55;

    inset: 0;

    display: block;

    visibility: hidden;

    background: rgba(0,0,0,.48);

    opacity: 0;

    transition:
      opacity .2s ease,
      visibility .2s ease;
  }

  body.mobile-menu-open
  .mobile-sidebar-backdrop {
    visibility: visible;
    opacity: 1;
  }


  /* ------------------------------------------------------- */
  /* WORKSPACE                                                */
  /* ------------------------------------------------------- */

  .workspace {
    width: 100%;
    min-width: 0;

    margin-left: 0 !important;
  }

  .topbar {
    display: none !important;
  }

  .page {
    width: 100%;
    min-width: 0;

    padding:
      18px
      14px
      calc(40px + env(safe-area-inset-bottom, 0))
      !important;
  }

  #ordersPage {
    padding:
      18px
      14px
      calc(40px + env(safe-area-inset-bottom, 0))
      !important;
  }

  .page-header,
  .edo-page-header {
    min-height: 0;

    margin-bottom: 16px;

    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  #ordersPage .page-header h1,
  .page-header h1 {
    margin: 0;

    font-size: 27px !important;
    line-height: 1.08;
  }

  .page-header p {
    margin-top: 5px;

    font-size: 11px !important;
    line-height: 1.45;
  }


  /* ------------------------------------------------------- */
  /* ORDER LIVE CONTROLS                                      */
  /* ------------------------------------------------------- */

  .orders-live-controls {
    width: 100%;

    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
  }

  .orders-auto-status,
  .order-sound-toggle {
    min-height: 36px;
  }

  .orders-updated-label {
    width: 100%;

    font-size: 10px;
  }


  /* ------------------------------------------------------- */
  /* KPI                                                      */
  /* ------------------------------------------------------- */

  .kpi-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr))
      !important;

    gap: 9px;
    margin-bottom: 14px;
  }

  .kpi-card {
    min-width: 0;
    min-height: 76px;

    padding: 13px 14px;
  }

  .kpi-value,
  .kpi-value.blue,
  .kpi-value.orange,
  .kpi-value.green,
  .kpi-value.purple {
    font-size: 23px;
  }


  /* ------------------------------------------------------- */
  /* FILTERS                                                  */
  /* ------------------------------------------------------- */

  .filters {
    grid-template-columns: 1fr !important;

    gap: 9px;

    padding: 12px;
  }

  .filter-button {
    grid-column: auto !important;
  }

  .filters input,
  .filters select,
  .edo-toolbar input,
  .edo-toolbar select {
    width: 100%;
    min-width: 0;

    min-height: 42px;

    font-size: 16px;
  }


  /* ------------------------------------------------------- */
  /* MAIN CONTENT                                             */
  /* ------------------------------------------------------- */

  .content-grid,
  .production-layout,
  .need-layout {
    grid-template-columns: 1fr !important;

    gap: 12px;
  }

  .right-column {
    display: flex !important;
    flex-direction: column;

    min-width: 0;
  }

  .panel,
  .detail-panel,
  .production-detail-panel {
    min-width: 0;
  }


  /* ------------------------------------------------------- */
  /* FACTORY ORDER CARDS                                      */
  /* ------------------------------------------------------- */

  .factory-v3-list {
    padding-top: 2px;
  }

  .factory-v3-order {
    margin-top: 8px;

    padding: 15px 14px;

    border-radius: 13px;
  }

  .factory-v3-top {
    align-items: flex-start;
  }

  .factory-v3-info {
    min-width: 0;
  }

  .factory-v3-info h3 {
    font-size: 16px !important;
    line-height: 1.25;
  }

  .factory-v3-meta {
    flex-wrap: wrap;

    gap: 5px 10px;
  }

  .factory-v3-open {
    min-height: 40px;
  }


  /* ------------------------------------------------------- */
  /* EDO                                                      */
  /* ------------------------------------------------------- */

  .edo-kpi-grid {
    grid-template-columns:
      repeat(2, minmax(0,1fr))
      !important;

    gap: 9px;
  }

  .edo-kpi-card {
    min-width: 0;

    padding: 14px;
  }

  .edo-kpi-card strong {
    font-size: 23px;
  }

  .edo-toolbar {
    padding: 12px;

    align-items: stretch;
    flex-direction: column;

    gap: 9px;
  }

  .edo-search-wrap {
    width: 100%;
    max-width: none;
  }

  .edo-toolbar select {
    min-width: 0;
  }


  /* ------------------------------------------------------- */
  /* ADMIN                                                    */
  /* ------------------------------------------------------- */

  .admin-overview-grid,
  .admin-status-grid {
    grid-template-columns: 1fr !important;
  }

  .admin-overview-card {
    min-height: 88px;

    padding: 14px;
  }

  .admin-overview-section-header {
    align-items: flex-start;
    flex-direction: column;

    gap: 10px;
  }


  /* ------------------------------------------------------- */
  /* TABLE SAFETY                                             */
  /* ------------------------------------------------------- */

  .orders-table-wrap,
  .users-table-wrap,
  .restaurants-table-wrap,
  .edo-table-wrap,
  .need-table {
    max-width: 100%;

    overflow-x: auto;

    -webkit-overflow-scrolling: touch;
  }


  /* ------------------------------------------------------- */
  /* TOUCH                                                    */
  /* ------------------------------------------------------- */

  button,
  .button,
  a[role="button"] {
    touch-action: manipulation;
  }
}


@media (max-width: 420px) {

  .page,
  #ordersPage {
    padding-left: 11px !important;
    padding-right: 11px !important;
  }

  .kpi-grid,
  .edo-kpi-grid {
    grid-template-columns:
      repeat(2, minmax(0,1fr))
      !important;
  }

  #ordersPage .page-header h1,
  .page-header h1 {
    font-size: 25px !important;
  }
}

/* END SURIMI_MOBILE_V1 */


/* ========================================================= */
/* WEB 0.17.1 — SIDEBAR SYNC TILES                          */
/* ========================================================= */

.sidebar-sync {
  margin-bottom: 14px;
}

.sidebar-sync-caption {
  margin-bottom: 8px;

  color: rgba(255,255,255,.34);

  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sidebar-sync-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.sidebar-sync-tile {
  position: relative;

  min-width: 0;
  min-height: 58px;

  padding: 8px 9px;

  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px;

  background: rgba(255,255,255,.045);
}

.sidebar-sync-tile.good {
  border-color: rgba(52,199,119,.20);
}

.sidebar-sync-tile.warning {
  border-color: rgba(221,151,35,.35);
  background: rgba(221,151,35,.06);
}

.sidebar-sync-tile.bad {
  border-color: rgba(205,67,67,.35);
  background: rgba(205,67,67,.07);
}

.sidebar-sync-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.sidebar-sync-name {
  min-width: 0;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  color: rgba(255,255,255,.76);

  font-size: 10px;
  font-weight: 700;
}

.sidebar-sync-dot {
  width: 6px;
  height: 6px;

  flex: 0 0 6px;

  border-radius: 50%;

  background: #728396;
}

.sidebar-sync-dot.good {
  background: #34c777;
}

.sidebar-sync-dot.warning {
  background: #dda023;
}

.sidebar-sync-dot.bad {
  background: #cd4343;
}

.sidebar-sync-count {
  display: inline-block;

  margin-top: 6px;

  color: #fff;

  font-size: 17px;
  line-height: 1;
  font-weight: 750;
}

.sidebar-sync-unit {
  display: inline-block;

  margin-left: 3px;

  color: rgba(255,255,255,.32);

  font-size: 8px;
}

.sidebar-sync-empty {
  grid-column: 1 / -1;

  padding: 9px;

  border: 1px solid rgba(255,255,255,.07);
  border-radius: 9px;

  color: rgba(255,255,255,.36);

  font-size: 9px;
  text-align: center;
}


/* Mobile drawer: keep the same compact 2×2 grid */

@media (max-width: 1000px) {

  .sidebar-sync {
    margin-top: 10px;
    margin-bottom: 12px;
  }

  .sidebar-sync-tile {
    min-height: 54px;
  }

}


/* =========================================================
   WEB 0.18.0 — FACTORY CONTROL CENTER
   ========================================================= */

.control-center-menu {
  margin-bottom: 8px;
}

.control-page-header {
  align-items: center;
}

.control-refresh-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.control-kpi-card {
  min-height: 132px;
  padding: 20px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #e7ebef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(18, 27, 38, .035);
}

.control-kpi-value {
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.04em;
  color: #1f2933;
}

.control-kpi-value.blue {
  color: #3478f6;
}

.control-kpi-value.orange {
  color: #e68a20;
}

.control-kpi-value.violet {
  color: #7758d9;
}

.control-kpi-value.green {
  color: #20966b;
}

.control-kpi-value.red {
  color: #dc4949;
}

.control-kpi-label {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  color: #28323c;
}

.control-kpi-meta {
  margin-top: 5px;
  font-size: 11px;
  color: #8a949e;
}

.control-kpi-icon {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 19px;
  font-weight: 800;
}

.control-kpi-icon.blue {
  color: #3478f6;
  background: #eef5ff;
}

.control-kpi-icon.orange {
  color: #d47714;
  background: #fff4e8;
}

.control-kpi-icon.violet {
  color: #7355d6;
  background: #f3efff;
}

.control-kpi-icon.green {
  color: #1d8a62;
  background: #edf8f4;
}

.control-kpi-icon.red {
  color: #d94545;
  background: #fff0f0;
}

.control-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, .75fr);
  gap: 18px;
  align-items: start;
}

.control-main-column,
.control-side-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.control-panel {
  overflow: hidden;
  border: 1px solid #e7ebef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(18, 27, 38, .035);
}

.control-panel-head {
  min-height: 72px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #edf0f2;
}

.control-panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #202a33;
}

.control-panel-head p {
  margin: 5px 0 0;
  font-size: 11px;
  color: #89939d;
}

.control-link-button {
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: #4275d9;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.control-plan-grid,
.control-stage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 18px 20px;
}

.control-plan-stat,
.control-stage {
  min-height: 86px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 12px;
  background: #f7f9fa;
}

.control-plan-stat strong,
.control-stage strong {
  font-size: 24px;
  font-weight: 800;
  color: #27313a;
}

.control-plan-stat span,
.control-stage span {
  font-size: 11px;
  color: #7f8993;
}

.control-order-list {
  border-top: 1px solid #edf0f2;
}

.control-order-row {
  width: 100%;
  min-height: 66px;
  padding: 12px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 150px;
  gap: 14px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.control-order-row:last-child {
  border-bottom: 0;
}

.control-order-row:hover {
  background: #fafbfc;
}

.control-order-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.control-order-main strong {
  overflow: hidden;
  color: #26313a;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-order-main span,
.control-order-count {
  color: #87919b;
  font-size: 11px;
}

.control-attention-item {
  width: calc(100% - 32px);
  margin: 16px 16px 0;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: 1px solid #ffd9d9;
  border-radius: 12px;
  background: #fff8f8;
  text-align: left;
  cursor: pointer;
}

.control-attention-item:last-child {
  margin-bottom: 16px;
}

.control-attention-item strong {
  font-size: 12px;
  color: #a93636;
}

.control-attention-item span {
  font-size: 11px;
  color: #a66c6c;
}

.control-ok-state {
  min-height: 165px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #84908f;
  text-align: center;
}

.control-ok-state strong {
  color: #27352f;
  font-size: 13px;
}

.control-ok-state span {
  font-size: 11px;
}

.control-ok-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 5px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf8f4;
  color: #20966b;
  font-size: 18px;
  font-weight: 800;
}

.control-integration-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: #edf0f2;
}

.control-integration-stat {
  min-height: 96px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
}

.control-integration-stat span {
  font-size: 11px;
  color: #84909a;
}

.control-integration-stat strong {
  font-size: 24px;
  color: #27313a;
}

.control-error-value:not(:empty) {
  color: #d54a4a;
}

.control-placeholder {
  min-height: 145px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  background: #fbfcfd;
}

.control-placeholder strong {
  color: #37414a;
  font-size: 13px;
}

.control-placeholder span {
  color: #89939d;
  font-size: 11px;
  line-height: 1.55;
}

.control-empty {
  padding: 26px 20px;
  color: #89939d;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 1250px) {
  .control-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .control-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .control-kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .control-kpi-card {
    min-height: 112px;
    padding: 15px;
  }

  .control-kpi-value {
    font-size: 28px;
  }

  .control-kpi-icon {
    width: 38px;
    height: 38px;
  }

  .control-plan-grid,
  .control-stage-grid {
    grid-template-columns: 1fr;
  }

  .control-order-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .control-order-count {
    display: none;
  }

  .control-panel-head {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .control-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .control-kpi-card {
    min-width: 0;
  }

  .control-kpi-icon {
    display: none;
  }

  .control-integration-grid {
    grid-template-columns: 1fr 1fr;
  }
}

