aside {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #527177 #10363b;
}

aside nav {
  flex: 0 0 auto;
}

.account {
  flex: 0 0 auto;
  margin-top: 28px;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.catalog-toolbar .actions {
  margin: 0;
}

details.menu {
  position: relative;
}

details.menu > summary {
  list-style: none;
  cursor: pointer;
}

details.menu > summary::-webkit-details-marker {
  display: none;
}

.menu-panel {
  position: absolute;
  z-index: 30;
  right: 0;
  min-width: 220px;
  display: grid;
  gap: 3px;
  padding: 7px;
  background: white;
  border: 1px solid #d8d6cc;
  border-radius: 9px;
  box-shadow: 0 12px 28px #102f3630;
}

.menu-panel a,
.menu-panel button,
.menu-panel label {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: white;
  color: #15353a;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-panel a:hover,
.menu-panel button:hover,
.menu-panel label:hover {
  background: #e7f1ef;
}

.menu-panel button.danger {
  color: #87372e;
  background: #fff;
}

.kebab > summary {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #dce8e5;
  font: 700 20px Arial, sans-serif;
}

.kebab .menu-panel {
  position: fixed;
  right: auto;
  min-width: 210px;
  max-height: min(360px, calc(100vh - 20px));
  overflow-y: auto;
}

.instructions summary {
  cursor: pointer;
  color: #0d7770;
  font-weight: 700;
}

.instructions[open] {
  width: 100%;
  padding-top: 12px;
}

.catalog-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 240px);
  gap: 10px;
  margin: 16px 0;
}

.barcode-sheet {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.barcode-sheet svg {
  max-width: 100%;
  height: auto;
}

.import-errors {
  color: #87372e;
}

.ubigeo-lookup, .product-lookup { position: relative; }
.lookup-results {
  position: absolute;
  z-index: 40;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid #b9cac7;
  border-radius: 8px;
  box-shadow: 0 12px 28px #102f3630;
}
.lookup-results button {
  display: block;
  width: 100%;
  padding: 9px;
  border: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.lookup-results button:hover { background: #e7f1ef; }

.field-with-action { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
button.compact, .button.compact { padding: 8px 11px; white-space: nowrap; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.line-footer { display: flex; justify-content: flex-end; margin-top: 12px; padding-top: 10px; border-top: 1px solid #e4e1d7; }
.line-footer .link { color: #87372e; padding: 7px 10px; }
.quick-dialog { width: min(900px, 94vw); max-height: 90vh; overflow: auto; border: 0; border-radius: 14px; padding: 26px; color: #15353a; background: #fffefa; box-shadow: 0 24px 70px #102f3655; }
.quick-dialog::backdrop { background: #102f367a; }
.dialog-close { float: right; border: 0; background: transparent; color: #15353a; font: 28px/1 Arial,sans-serif; cursor: pointer; }
.form-result { color: #87372e; }
.totals { margin-left: auto; width: min(340px,100%); display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; padding-top: 18px; }
.totals dt { font-weight: 700; }
.totals dd { margin: 0; text-align: right; }
[hidden] { display: none !important; }
.pharma-section { border: 1px solid #cbdcd7; border-radius: 10px; padding: 14px; margin: 4px 0; background: #f6faf8; min-width: 0; }
.pharma-section legend { font: 700 14px Arial, sans-serif; color: #17686b; padding: 0 6px; }
.badge-evaluacion-parcial { background: #fff0ca; color: #82570b; }
.badge-aprobacion-parcial { background: #e3e0f0; color: #4d4670; }
.badge-rechazada { background: #f6d9d5; color: #87372e; }
.badge-cuarentena-revocacion, .badge-cuarentena-reevaluacion { background: #fff0ca; color: #82570b; }

@media print {
  aside, header, .no-print { display: none !important; }
  .shell { display: block; }
  main { padding: 0; }
  .panel { box-shadow: none; border: 0; }
}

@media (max-width: 850px) {
  aside { height: auto; overflow: visible; }
  .catalog-filters { grid-template-columns: 1fr; }
  details.menu:not(.kebab) .menu-panel { position: static; }
}
