/* Global request: remove the local-file warning from every page. */
#originWarning,
.main > .notice.origin-warning,
.origin-warning {
  display: none;
}

/* Shared page frame: one consistent work area for every module. */
:root {
  --dm-topbar-height: 112px;
  --dm-work-x: 26px;
  --dm-work-top: 18px;
  --dm-work-bottom: 22px;
}

.app-shell {
  min-height: 100vh;
  height: 100vh;
  grid-template-columns: 260px minmax(0, 1fr);
  overflow: hidden;
}

.main {
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: var(--dm-page);
}

.topbar,
body[data-active-view="dashboard"] .topbar {
  flex: 0 0 var(--dm-topbar-height);
  height: var(--dm-topbar-height);
  min-height: var(--dm-topbar-height);
  margin: 0;
  padding: 0 var(--dm-work-x);
  border: 0;
  border-bottom: 1px solid #dce5f2;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.view.active,
body[data-active-view="dashboard"] .view.active,
body[data-active-view="import"] .view.active,
body[data-active-view="products"] .view.active {
  flex: 1 1 auto;
  height: calc(100vh - var(--dm-topbar-height));
  min-height: 0;
  padding: var(--dm-work-top) var(--dm-work-x) var(--dm-work-bottom);
  overflow: auto;
}

#dashboard.view.active,
#import.view.active {
  padding: var(--dm-work-top) var(--dm-work-x) var(--dm-work-bottom);
}

.dashboard-frame {
  padding: 0;
}

#products.view.active {
  overflow: hidden;
}

#products .inventory-panel {
  height: 100%;
}

#products .inventory-table-wrap {
  min-height: 0;
}

.sidebar {
  padding: 0 18px 40px;
  overflow: hidden;
}

.brand {
  height: var(--dm-topbar-height);
  min-height: var(--dm-topbar-height);
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.brand-logo {
  width: 132px;
  height: 88px;
  object-fit: contain;
}

.brand span {
  margin: 0;
  padding: 0;
  text-align: center;
  font-size: 12px;
  line-height: 1;
}

.menu-tree {
  margin-top: 3px;
}

body[data-active-view="dashboard"] .dashboard-card:nth-child(8),
body[data-active-view="dashboard"] .dashboard-card:nth-child(9) {
  justify-content: flex-start;
}

body[data-active-view="dashboard"] #topDifferences,
body[data-active-view="dashboard"] #recentActivity {
  margin-top: 18px;
  align-content: start;
}

#products .inventory-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 0 0 12px;
  flex: 0 0 auto;
}

#products .inventory-search {
  width: min(460px, 100%);
  height: 42px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #d9e1f2;
  border-radius: 10px;
  background: #ffffff;
  color: #071a44;
}

#products .inventory-search-trigger {
  min-width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  appearance: none;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

#products .inventory-search-trigger:hover {
  border-color: #0057d9;
}

#products .inventory-search-trigger:hover::after {
  background: #0057d9;
}

#products .inventory-search input {
  min-height: 0;
  height: 40px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  color: #071a44;
  font-size: 13px;
  font-weight: 700;
}

#products .inventory-search input::placeholder {
  color: #8290ad;
}

#products #clearInventorySearchBtn {
  width: 112px;
  height: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#products #clearInventorySearchBtn .clear-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M19 6l-1 14H6L5 6'/%3E%3Cpath d='M10 11v5'/%3E%3Cpath d='M14 11v5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M19 6l-1 14H6L5 6'/%3E%3Cpath d='M10 11v5'/%3E%3Cpath d='M14 11v5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

#products .inventory-table-wrap th:nth-child(5),
#products .inventory-table-wrap th:nth-child(6),
#products .inventory-table-wrap th:nth-child(7),
#products .inventory-table-wrap th:nth-child(8),
#products .inventory-table-wrap td:nth-child(5),
#products .inventory-table-wrap td:nth-child(6),
#products .inventory-table-wrap td:nth-child(7),
#products .inventory-table-wrap td:nth-child(8) {
  text-align: center;
}

#products .inventory-table-wrap td:nth-child(4) {
  text-align: left;
  font-weight: 600;
}

#products .inventory-table-wrap th:nth-child(4) {
  text-align: left;
}

#products .inventory-table-wrap td:nth-child(3) {
  color: #536487;
  font-weight: 700;
}

#orders #orderScanBtn,
#orders #orderCameraBtn,
#orders #exportPackingBtn {
  display: none;
}

#reception .operational-placeholder,
#myTasks .operational-placeholder,
#pendingTasks .operational-placeholder {
  min-height: 220px;
}

#warehouseMap .warehouse-map-only {
  max-width: 920px;
  margin: 0 auto;
}

.stock-current-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

#stockCurrent .metric,
#stockByLocation .panel,
#inventoryAdjustment .panel,
#packing .panel {
  position: relative;
}

#stockCurrent .metric:nth-child(1) strong {
  color: #1767d8;
}

#stockCurrent .metric:nth-child(2) strong {
  color: #fb8500;
}

#stockCurrent .metric:nth-child(3) strong {
  color: #7c5ce1;
}

#stockCurrent .metric:nth-child(4) strong {
  color: #0f9f6e;
}

.inventory-adjustment-panel .settings-actions {
  margin-top: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.ok {
  background: #dcfce7;
  color: #118045;
}

.status-pill.pending {
  background: #edf2f7;
  color: #536487;
}

@media (max-width: 1100px) {
  .stock-current-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
