/* Ubicaciones visual refresh. Header/sidebar and behavior stay unchanged. */
body[data-active-view="locations"] #locations.view.active {
  padding: var(--dm-work-top) var(--dm-work-x) var(--dm-work-bottom);
  overflow: auto;
}

#locations .locations-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(560px, 1.08fr);
  gap: 18px;
  align-items: start;
}

#locations .locations-layout > .panel {
  border: 1px solid #e3e8f3;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(7, 26, 68, 0.07);
  padding: 18px;
  min-height: 0;
}

#locations .panel-heading {
  min-height: 30px;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#locations .panel-heading h2 {
  margin: 0;
  color: #071a44;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 900;
}

#locations .map-actions {
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

#locations #addLocationBtn {
  width: 180px;
  height: 42px;
  min-height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 6px;
  background: #1767d8;
  border: 1px solid #1767d8;
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(23, 103, 216, 0.18);
  font-size: 14px;
  font-weight: 900;
}

#locations #addLocationBtn::before {
  content: "";
  width: 17px;
  height: 17px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 5v14M5 12h14' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/%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%3Cpath d='M12 5v14M5 12h14' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

#locations .location-zone {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}

#locations .location-zone label {
  flex: 1 1 auto;
  max-width: 310px;
  margin: 0;
  color: #536487;
  font-size: 13px;
  font-weight: 800;
}

#locations .location-zone input,
#locations #locationRowFilter {
  height: 38px;
  min-height: 38px;
  border: 1px solid #d9e1f2;
  border-radius: 6px;
  background: #ffffff;
  color: #071a44;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
}

#locations .location-zone input {
  margin-top: 9px;
  padding: 0 14px;
}

#locations #useLocationActiveBtn,
#locations #finishLocationActiveBtn {
  width: 84px;
  height: 38px;
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid #b7cdf8;
  background: #ffffff;
  color: #0057d9;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

#locations #finishLocationActiveBtn {
  width: 92px;
}

#locations #locationActiveStatus {
  margin-left: 6px;
  padding-bottom: 10px;
  color: #536487;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

#locations #warehouseMapGrid {
  margin: 0;
  padding: 12px;
  border: 1px solid #d9e1f2;
  border-radius: 6px;
  background: linear-gradient(180deg, #f9fbff 0%, #f2f7ff 100%);
  overflow: hidden;
}

#locations #warehouseMapGrid .warehouse-grid {
  display: grid;
  grid-template-columns: 74px repeat(4, minmax(58px, 1fr)) 72px 44px 44px;
  grid-template-rows: 48px 36px 48px 36px 48px 36px 48px 36px 48px 86px;
  gap: 6px;
  align-items: stretch;
}

#locations #warehouseMapGrid .warehouse-grid > * {
  min-width: 0;
}

#locations #warehouseMapGrid .map-row-label {
  display: grid;
  align-content: center;
  justify-items: start;
  color: #09265a;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.05;
}

#locations #warehouseMapGrid .map-row-label span {
  color: #536487;
  font-size: 11px;
  font-weight: 800;
}

#locations #warehouseMapGrid .shelf-zone {
  min-height: 0;
  border: 1px solid #8db5ff;
  border-radius: 4px;
  background: linear-gradient(180deg, #f6fbff 0%, #e5f1ff 100%);
  color: #073b89;
  box-shadow: inset 0 0 0 2px rgba(23, 103, 216, 0.16);
  display: grid;
  align-content: center;
  justify-items: center;
  font-size: 16px;
  font-weight: 900;
}

#locations #warehouseMapGrid .shelf-zone span {
  margin: 0;
  color: #09265a;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
}

#locations #warehouseMapGrid .shelf-zone.has-stock:not(.target) {
  border-color: #22c55e;
  background: linear-gradient(180deg, #f6fff8 0%, #e8f8ed 100%);
  color: #0f8a40;
  box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.18);
}

#locations #warehouseMapGrid .shelf-zone.row-selected:not(.target) {
  border-color: #1767d8;
  background: #edf5ff;
}

#locations #warehouseMapGrid .shelf-zone.target {
  border-color: #ef1736;
  background: #fff0f3;
  color: #ef1736;
}

#locations #warehouseMapGrid .aisle-label {
  min-height: 0;
  border: 0;
  border-top: 1px dashed #d4dce8;
  border-bottom: 1px dashed #ffffff;
  color: #09265a;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}

#locations #warehouseMapGrid .map-room,
#locations #warehouseMapGrid .main-aisle {
  min-height: 0;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 900;
}

#locations #warehouseMapGrid .map-room.receiving {
  border: 1px solid #a8d9b3;
  background: #f0fbef;
  color: #15803d;
}

#locations #warehouseMapGrid .main-aisle {
  border: 1px dashed #8db5ff;
  background: #f8fbff;
  color: #09265a;
}

#locations #warehouseMapGrid .map-room.dispatch {
  border: 1px solid #f7d27a;
  background: #fff8e8;
  color: #d97706;
}

#locations #warehouseMapGrid .warehouse-grid > :nth-child(1) { grid-column: 1; grid-row: 1; }
#locations #warehouseMapGrid [data-zone="A-A1"] { grid-column: 2 / 4; grid-row: 1; }
#locations #warehouseMapGrid [data-zone="A-A2"] { grid-column: 4 / 6; grid-row: 1; }
#locations #warehouseMapGrid .warehouse-grid > :nth-child(4) { grid-column: 1 / 6; grid-row: 2; }
#locations #warehouseMapGrid .warehouse-grid > :nth-child(5) { grid-column: 6; grid-row: 2 / 4; }
#locations #warehouseMapGrid [data-zone="B-B1"] { grid-column: 7; grid-row: 2 / 4; }
#locations #warehouseMapGrid [data-zone="B-B2"] { grid-column: 8; grid-row: 2 / 4; }
#locations #warehouseMapGrid .warehouse-grid > :nth-child(8) { grid-column: 1 / 6; grid-row: 4; }
#locations #warehouseMapGrid .warehouse-grid > :nth-child(9) { grid-column: 6; grid-row: 4 / 6; }
#locations #warehouseMapGrid [data-zone="C-C1"] { grid-column: 7; grid-row: 4 / 6; }
#locations #warehouseMapGrid [data-zone="C-C2"] { grid-column: 8; grid-row: 4 / 6; }
#locations #warehouseMapGrid .warehouse-grid > :nth-child(12) { grid-column: 1 / 6; grid-row: 6; }
#locations #warehouseMapGrid .warehouse-grid > :nth-child(13) { grid-column: 6; grid-row: 6 / 8; }
#locations #warehouseMapGrid [data-zone="D-D1"] { grid-column: 7; grid-row: 6 / 8; }
#locations #warehouseMapGrid [data-zone="D-D2"] { grid-column: 8; grid-row: 6 / 8; }
#locations #warehouseMapGrid .warehouse-grid > :nth-child(16) { grid-column: 1 / 6; grid-row: 8; }
#locations #warehouseMapGrid .warehouse-grid > :nth-child(17) { grid-column: 6; grid-row: 8 / 10; }
#locations #warehouseMapGrid [data-zone="E-E1"] { grid-column: 7; grid-row: 8 / 10; }
#locations #warehouseMapGrid [data-zone="E-E2"] { grid-column: 8; grid-row: 8 / 10; }
#locations #warehouseMapGrid .map-room.receiving { grid-column: 1 / 4; grid-row: 10; }
#locations #warehouseMapGrid .main-aisle { grid-column: 4 / 7; grid-row: 10; }
#locations #warehouseMapGrid .map-room.dispatch { grid-column: 7 / 9; grid-row: 10; }

#locations #warehouseMapLegend {
  min-height: 54px;
  margin-top: 16px;
  padding: 0 16px 0 42px;
  display: flex;
  align-items: center;
  border: 1px solid #e3e8f3;
  border-radius: 6px;
  background: #ffffff;
  color: #536487;
  font-size: 13px;
  font-weight: 700;
  position: relative;
}

#locations #warehouseMapLegend::before {
  content: "";
  position: absolute;
  left: 16px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1767d8;
  -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%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8h.01M11 12h1v5h1'/%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%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8h.01M11 12h1v5h1'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

#locations .location-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}

#locations .location-summary-card {
  min-height: 108px;
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0 14px;
  padding: 18px;
  border: 1px solid #d9e1f2;
  border-radius: 8px;
  background: #ffffff;
}

#locations .location-summary-card::before {
  content: "";
  grid-row: 1 / span 2;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--loc-soft, #eef3ff);
}

#locations .location-summary-card::after {
  content: "";
  position: absolute;
  left: 29px;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  background: var(--loc-color, #1767d8);
  -webkit-mask: var(--loc-icon) center / contain no-repeat;
  mask: var(--loc-icon) center / contain no-repeat;
}

#locations .location-summary-card:nth-child(1) {
  --loc-color: #1767d8;
  --loc-soft: #e8f0ff;
  --loc-icon: 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.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 8-9-5-9 5 9 5 9-5Z'/%3E%3Cpath d='M3 8v8l9 5 9-5V8'/%3E%3Cpath d='M12 13v8'/%3E%3C/g%3E%3C/svg%3E");
}

#locations .location-summary-card:nth-child(2) {
  --loc-color: #16a34a;
  --loc-soft: #e9fbea;
  --loc-icon: 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.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 8-9-5-9 5 9 5 9-5Z'/%3E%3Cpath d='M3 8v8l9 5 9-5V8'/%3E%3Cpath d='M12 13v8'/%3E%3Cpath d='M7 5.8 16.8 11'/%3E%3C/g%3E%3C/svg%3E");
}

#locations .location-summary-card:nth-child(3) {
  --loc-color: #f59e0b;
  --loc-soft: #fff1dc;
  --loc-icon: 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.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 8-9-5-9 5 9 5 9-5Z'/%3E%3Cpath d='M3 8v8l9 5 9-5V8'/%3E%3Cpath d='m15 9 5 5'/%3E%3Cpath d='m20 9-5 5'/%3E%3C/g%3E%3C/svg%3E");
}

#locations .location-summary-card span,
#locations .location-summary-card strong {
  grid-column: 2;
  margin: 0;
  min-width: 0;
}

#locations .location-summary-card span {
  color: #536487;
  font-size: 13px;
  line-height: 1.15;
  font-weight: 700;
}

#locations .location-summary-card strong {
  color: #020817;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

#locations .form-grid {
  display: block;
  margin: 0 0 16px;
}

#locations .form-grid label {
  width: 220px;
  margin: 0;
  color: #536487;
  font-size: 13px;
  font-weight: 800;
}

#locations #locationRowFilter {
  width: 220px;
  margin-top: 8px;
  padding: 0 14px;
}

#locations .location-table-wrap {
  max-height: 410px;
  overflow: auto;
  border: 1px solid #e3e8f3;
  border-radius: 8px;
}

#locations .location-table-wrap table {
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  color: #09265a;
  font-size: 13px;
}

#locations .location-table-wrap th,
#locations .location-table-wrap td {
  height: 54px;
  padding: 10px 16px;
  border-bottom: 1px solid #edf1f7;
  color: #09265a;
  font-size: 13px;
  vertical-align: middle;
}

#locations .location-table-wrap th {
  height: 42px;
  background: linear-gradient(180deg, #f8fbff 0%, #edf4ff 100%);
  color: #08295b;
  font-weight: 900;
}

#locations .location-table-wrap td:not(:first-child),
#locations .location-table-wrap th:not(:first-child) {
  text-align: center;
}

#locations .location-table-wrap td:first-child {
  font-weight: 700;
}

#locations .location-table-wrap .number-mark {
  width: 48px;
  min-width: 48px;
  height: 30px;
  min-height: 30px;
  border: 1px solid #d7e7ff;
  border-radius: 6px;
  background: #f1f7ff;
  color: #0057d9;
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
}

#locations .location-table-wrap .mini-window-button {
  width: 94px;
  height: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #8db5ff;
  border-radius: 6px;
  background: #ffffff;
  color: #0057d9;
  font-size: 12px;
  font-weight: 900;
}

#locations .location-table-wrap .mini-window-button::before {
  content: "";
  width: 13px;
  height: 13px;
  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.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%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.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
