/* Conteo final overrides extracted from dispatch cleanup. */

/* Conteo location card final alignment: same header/content style as lower cards. */
#count .count-location-zone {
  position: relative;
  min-height: 146px;
  padding: 18px 22px 20px;
  display: grid;
  grid-template-columns: minmax(280px, 360px) auto auto minmax(160px, 1fr);
  grid-template-rows: auto 1px auto;
  align-content: start;
  align-items: center;
  gap: 12px;
  border: 1px solid #dbe4f2;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(7, 26, 68, 0.06);
}

#count .count-location-zone::before,
#count .count-location-zone::after,
#count .count-location-zone label::before {
  content: none;
  display: none;
}

#count .count-location-heading {
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 11px;
  border-bottom: 1px solid #dbe4f2;
}

#count .count-location-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e8f0ff;
  position: relative;
  flex: 0 0 auto;
}

#count .count-location-icon::before {
  content: "";
  position: absolute;
  inset: 5px;
  background: #0057d9;
  -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='M12 21s7-5.2 7-11a7 7 0 1 0-14 0c0 5.8 7 11 7 11Z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%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='M12 21s7-5.2 7-11a7 7 0 1 0-14 0c0 5.8 7 11 7 11Z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

#count .count-location-heading h2 {
  margin: 0;
  color: #071a44;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 900;
}

#count .count-location-input-label {
  grid-column: 1;
  grid-row: 3;
  margin: 0;
  display: block;
  align-self: center;
  font-size: 0;
}

#count .count-location-input-label > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#count .count-location-zone .count-location-input-label input {
  width: 100%;
  height: 42px;
  min-height: 42px;
  margin: 0;
  border: 1px solid #c8d8ef;
  border-radius: 7px;
  background: #ffffff;
  color: #071a44;
  font-size: 13px;
  font-weight: 800;
}

#count .count-location-zone #useLocationBtn,
#count .count-location-zone #finishLocationBtn {
  grid-row: 3;
  width: 96px;
  height: 42px;
  min-height: 42px;
  margin: 0;
  align-self: center;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 900;
}

#count .count-location-zone #useLocationBtn {
  grid-column: 2;
}

#count .count-location-zone #finishLocationBtn {
  grid-column: 3;
}

#count .count-location-zone #activeLocationStatus {
  grid-column: 4;
  grid-row: 3;
  min-height: 42px;
  margin: 0;
  align-self: center;
  display: flex;
  align-items: center;
  color: #536487;
  font-size: 13px;
  font-weight: 800;
}

/* Conteo location card compact input correction. */
#count .count-location-zone label.count-location-input-label {
  grid-column: 1;
  grid-row: 3;
  width: 330px;
  max-width: 330px;
  flex: 0 0 330px;
  display: block;
  gap: 0;
  margin: 0;
  padding: 0;
  align-self: center;
  color: transparent;
  font-size: 0;
  line-height: 0;
  position: static;
}

#count .count-location-zone label.count-location-input-label::before {
  content: none;
  display: none;
}

#count .count-location-zone label.count-location-input-label input#scanLocationInput {
  width: 330px;
  max-width: 330px;
  height: 42px;
  min-height: 42px;
  margin: 0;
  padding: 0 14px;
}

#count .count-progress-panel {
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 14px 30px rgba(7, 26, 68, 0.06);
}

#count .count-progress-card {
  min-height: 154px;
}

@media (max-width: 1240px) {
  #count .count-progress-panel,
  #count .count-progress-card {
    grid-template-columns: 1fr;
  }

  #count .count-donut {
    justify-self: center;
  }
}

/* Conteo: compact top analytics and give more working room to the tables. */
#count .count-layout {
  gap: 16px;
}

#count .count-progress-panel {
  padding: 10px 12px;
  gap: 12px;
}

#count .count-progress-card {
  min-height: 112px;
  padding: 10px 16px;
  grid-template-columns: minmax(140px, 1fr) 96px minmax(160px, 1fr);
  gap: 14px;
}

#count .count-progress-copy h2 {
  font-size: 16px;
}

#count .count-progress-copy span {
  margin-top: 3px;
  font-size: 11px;
}

#count .count-donut {
  width: 96px;
  box-shadow: 0 10px 18px rgba(7, 26, 68, 0.08);
}

#count .count-donut::after {
  inset: 26px;
}

#count .count-donut span {
  font-size: 17px;
}

#count .count-donut-legend {
  gap: 6px;
}

#count .count-donut-legend div {
  font-size: 11px;
}

#count .sticky-summary {
  min-height: 150px;
  padding: 14px 18px 16px;
}

#count .sticky-summary .panel-heading h2 {
  min-height: 26px;
  margin-bottom: 10px;
  padding-bottom: 10px;
}

#count .validation {
  gap: 12px;
  margin-top: 12px;
}

#count .validation div {
  min-height: 64px;
  padding: 10px 12px 10px 58px;
  gap: 4px;
}

#count .validation div::before {
  left: 14px;
  width: 34px;
  height: 34px;
}

#count .validation div::after {
  left: 23px;
  width: 17px;
  height: 17px;
}

#count .validation dt {
  font-size: 11px;
}

#count .validation dd {
  font-size: 15px;
}

#count .scan-dashboard {
  align-items: stretch;
  gap: 16px;
}

#count .scan-dashboard > section {
  min-height: 260px;
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
}

#count .scan-table-wrap {
  flex: 1 1 auto;
  min-height: 184px;
  max-height: none;
}

#count .scan-table-wrap td[colspan] {
  height: 92px;
}

@media (max-width: 1240px) {
  #count .count-progress-card {
    grid-template-columns: 1fr;
  }
}

/* Manual count dialog: compact operational layout. */
#manualCountDialog {
  width: min(760px, calc(100vw - 40px));
  max-width: 760px;
  max-height: calc(100vh - 32px);
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
}

#manualCountDialog::backdrop {
  background: rgba(10, 20, 42, 0.62);
  backdrop-filter: blur(2px);
}

#manualCountDialog .manual-count-card {
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 22px 24px 20px;
  border: 1px solid #dbe4f2;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 26px 60px rgba(7, 26, 68, 0.28);
}

#manualCountDialog .manual-count-heading {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

#manualCountDialog .manual-count-title {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

#manualCountDialog .manual-count-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #e8f0ff;
  position: relative;
}

#manualCountDialog .manual-count-icon::before {
  content: "";
  position: absolute;
  inset: 11px;
  background: #0057d9;
  -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%3Crect x='4' y='5' width='16' height='16' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M4 10h16M9 15l2 2 4-5'/%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%3Crect x='4' y='5' width='16' height='16' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M4 10h16M9 15l2 2 4-5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

#manualCountDialog .manual-count-title h2 {
  margin: 0;
  color: #071a44;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 900;
}

#manualCountDialog .manual-count-title p {
  margin: 4px 0 0;
  color: #536487;
  font-size: 12px;
  font-weight: 700;
}

#manualCountDialog .manual-close-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  color: #071a44;
  font-size: 24px;
  line-height: 1;
  box-shadow: none;
}

#manualCountDialog .manual-close-button span {
  display: block;
  transform: translateY(-1px);
}

#manualCountDialog .manual-search-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  align-items: end;
  gap: 12px;
  margin: 4px 0 0;
  padding: 14px;
  border: 1px solid #dbe7f7;
  border-radius: 10px;
  background: #f7fbff;
}

#manualCountDialog .manual-search-label {
  position: relative;
  gap: 7px;
  color: #0057d9;
  font-size: 12px;
  font-weight: 900;
}

#manualCountDialog .manual-search-label::before {
  content: "";
  position: absolute;
  left: 13px;
  bottom: 12px;
  width: 18px;
  height: 18px;
  background: #6d82a6;
  -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'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%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'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

#manualCountDialog #searchInput {
  height: 42px;
  min-height: 42px;
  padding: 0 14px 0 42px;
  border-color: #bfd2ff;
  border-radius: 8px;
  color: #071a44;
  font-size: 14px;
  font-weight: 700;
}

#manualCountDialog #searchBtn {
  height: 42px;
  min-height: 42px;
  border-color: #0057d9;
  border-radius: 8px;
  background: #0057d9;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 12px 20px rgba(0, 87, 217, 0.18);
}

#manualCountDialog #searchResults {
  max-height: clamp(168px, 24vh, 228px);
  margin: 0;
  padding-right: 8px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#manualCountDialog #searchResults.empty-state,
#manualCountDialog #searchResults .empty-state {
  min-height: 40px;
  padding: 11px 14px;
  border: 1px dashed #d8e3f3;
  border-radius: 8px;
  background: #fbfdff;
  color: #667798;
  font-size: 12px;
  font-weight: 700;
}

#manualCountDialog #searchResults .result-item {
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid #dbe7f7;
  border-radius: 8px;
  background: #ffffff;
}

#manualCountDialog #searchResults:not(.empty-state) {
  padding: 2px 8px 2px 0;
  border: 0;
  background: transparent;
}

#manualCountDialog #searchResults .result-item + .result-item {
  margin-top: 6px;
}

#manualCountDialog .manual-count-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

#manualCountDialog .manual-count-grid label {
  gap: 7px;
  color: #273b60;
  font-size: 12px;
  font-weight: 900;
}

#manualCountDialog .manual-count-grid input,
#manualCountDialog .manual-count-grid textarea {
  min-height: 40px;
  border-color: #d5dfef;
  border-radius: 8px;
  color: #071a44;
  font-size: 13px;
  font-weight: 700;
}

#manualCountDialog .manual-count-grid input {
  height: 40px;
  padding: 0 12px;
}

#manualCountDialog .manual-count-grid textarea {
  min-height: 62px;
  padding: 10px 12px;
  resize: vertical;
}

#manualCountDialog .manual-count-grid input[readonly] {
  background: #f8fbff;
  color: #536487;
}

#manualCountDialog .manual-count-grid input:focus,
#manualCountDialog .manual-count-grid textarea:focus,
#manualCountDialog #searchInput:focus {
  border-color: #0057d9;
  box-shadow: 0 0 0 3px rgba(0, 87, 217, 0.12);
  outline: 0;
}

#manualCountDialog .manual-count-grid label:has(#photoInput) {
  min-height: 60px;
  padding: 10px 14px 10px 72px;
  border: 1px dashed #bfd2ff;
  border-radius: 10px;
  background: #fbfdff;
  position: relative;
  justify-content: center;
}

#manualCountDialog .manual-count-grid label:has(#photoInput)::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 50%;
  width: 38px;
  height: 38px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #e8f0ff;
}

#manualCountDialog .manual-count-grid label:has(#photoInput)::after {
  content: "";
  position: absolute;
  left: 30px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  background: #0057d9;
  -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='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%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='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

#manualCountDialog #photoInput {
  min-height: 0;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #536487;
  font-size: 12px;
  font-weight: 700;
}

#manualCountDialog #photoInput::file-selector-button {
  height: 34px;
  margin-right: 12px;
  padding: 0 14px;
  border: 1px solid #bfd2ff;
  border-radius: 8px;
  background: #ffffff;
  color: #0057d9;
  font-weight: 900;
  cursor: pointer;
}

#manualCountDialog .manual-count-actions {
  margin: 0;
  padding-top: 6px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#manualCountDialog .manual-count-actions button {
  min-width: 116px;
  height: 40px;
  min-height: 40px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

#manualCountDialog #saveCountBtn {
  min-width: 148px;
  background: #0057d9;
  border-color: #0057d9;
  box-shadow: 0 12px 20px rgba(0, 87, 217, 0.18);
}

@media (max-width: 760px) {
  #manualCountDialog {
    width: calc(100vw - 24px);
  }

  #manualCountDialog .manual-count-card {
    padding: 18px;
  }

  #manualCountDialog .manual-search-card,
  #manualCountDialog .manual-count-grid {
    grid-template-columns: 1fr;
  }

  #manualCountDialog .manual-count-actions {
    justify-content: stretch;
  }

  #manualCountDialog .manual-count-actions button {
    flex: 1 1 0;
  }
}
