/* ===================== choose warehouse ===================== */
.vendorPortal-header {
  font-size: 1.5rem;
  text-align: center;
  font-weight: bold;
}

.stocktaking-choose {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

.stocktaking-choose-subtitle {
  text-align: center;
  font-size: 1.1rem;
  margin-top: 24px;
}

.stocktaking-open-count {
  margin: 20px auto 0;
  padding: 16px;
  border: 1px solid #D0D0D0;
  border-radius: 12px;
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stocktaking-open-count-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}

.stocktaking-open-count-title {
  font-weight: bold;
  font-size: 1.15rem;
}

.stocktaking-open-count-details {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 4px;
  color: #555555;
  font-size: 0.95rem;
}

.stocktaking-open-count-status {
  padding: 2px 12px;
  border-radius: 12px;
  background: #FFF4E0;
  color: #8A5A00;
  font-size: 0.85rem;
}

.stocktaking-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.stocktaking-summary-item {
  padding: 8px 4px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  background: #FAFAFA;
  text-align: center;
}

  .stocktaking-summary-item b {
    display: block;
    font-size: 1.4rem;
  }

  .stocktaking-summary-item span {
    font-size: 0.85rem;
    color: #666666;
  }

  .stocktaking-summary-item.is-gap {
    background: #FFF3E0;
    border-color: #FFB74D;
  }

.stocktaking-open-count-remark {
  margin-top: 10px;
  color: #444444;
  white-space: pre-line;
}

.stocktaking-open-count-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.stocktaking-details {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #E0E0E0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stocktaking-details-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

  .stocktaking-details-tools .stocktaking-list-filter {
    flex: 1;
    min-width: 180px;
  }

.stocktaking-group {
  border: 1px solid #E0E0E0;
  border-radius: 10px;
  overflow: hidden;
}

.stocktaking-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 10px 12px;
  background: #F7F7F7;
  cursor: pointer;
}

  .stocktaking-group-head.is-open {
    border-bottom: 1px solid #E0E0E0;
  }

.stocktaking-group-arrow {
  font-size: 0.8rem;
  color: #777777;
}

.stocktaking-group-name {
  font-weight: bold;
  flex: 1;
  min-width: 0;
}

.stocktaking-group-count {
  color: #555555;
  font-size: 0.9rem;
}

.stocktaking-group-gaps {
  padding: 1px 10px;
  border-radius: 10px;
  background: #FFF3E0;
  color: #E65100;
  font-size: 0.85rem;
  font-weight: bold;
}

.stocktaking-group-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.warehouse-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: 1fr;
  gap: 14px;
  width: 100%;
  margin-top: 14px;
}

.warehouse-item-main {
  min-width: 0;
}

/* all tiles get the same size - long names / addresses are clamped (full text in the tooltip) */
.warehouse-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  box-sizing: border-box;
  padding: 14px 12px;
  text-align: center;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

  .warehouse-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

.warehouse-name {
  font-size: 1.1rem;
  color: #FFFFFF;
  font-weight: bold;
  line-height: 1.3;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.warehouse-address {
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  padding-top: 8px;
  color: #FFFFFF;
  font-size: 0.9rem;
  line-height: 1.3;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.warehouse-counted {
  margin-top: auto;
  align-self: center;
  padding: 2px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: #222222;
  font-size: 0.85rem;
  font-weight: bold;
}

  .warehouse-counted.is-empty {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    font-weight: normal;
  }

/* "differences only" / "show all" - one button, its label is the action it will do */
.stocktaking-filter-button {
  padding: 6px 14px;
  border: 1px solid #FFB74D;
  border-radius: 8px;
  background: #FFF3E0;
  color: #E65100;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
}

  .stocktaking-filter-button.is-active {
    border-color: #B5B5B5;
    background: #FFFFFF;
    color: #333333;
  }

/* ===================== counting screen ===================== */
.stock-taking-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 90px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stocktaking-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 10px 0;
  background: #F4F5F7;
  border-bottom: 1px solid #E0E0E0;
}

.stocktaking-topbar-warehouse {
  display: flex;
  flex-direction: column;
}

.stocktaking-topbar-title {
  font-size: 0.85rem;
  color: #666666;
}

.stocktaking-topbar-name {
  font-size: 1.2rem;
  font-weight: bold;
}

.stocktaking-topbar-count {
  font-size: 0.95rem;
  color: #444444;
}

.stocktaking-link-button {
  background: none;
  border: 0;
  padding: 4px 0;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.95rem;
}

/* scan */
.stocktaking-scan-row {
  display: flex;
  align-items: stretch;
  border: 2px solid #B5B5B5;
  border-radius: 10px !important;
  background: #FFFFFF;
  overflow: hidden;
}

  .stock-taking-main .stocktaking-scan-row.has-error {
    border-color: #D93025 !important;
  }

.stocktaking-scan-input {
  flex: 1;
  min-width: 0;
  height: 52px;
  border: 0 !important;
  padding: 0 14px;
  font-size: 1.15rem;
  background: transparent;
}

  .stocktaking-scan-input:focus {
    outline: none;
  }

  .stocktaking-scan-input:disabled {
    background: #F0F0F0;
  }

.stocktaking-scan-name {
  width: 52px;
  border: 0;
  border-inline-start: 1px solid #E0E0E0;
  background: #FAFAFA;
  font-size: 1.1rem;
  cursor: pointer;
}

.stocktaking-scan-error {
  margin-top: 6px;
  color: #D93025;
  font-weight: bold;
}

.stocktaking-name-search {
  margin-top: 8px;
}

/* product card */
.stocktaking-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px;
  border: 2px solid #B5B5B5;
  border-radius: 12px;
  background: #FFFFFF;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.stocktaking-card-close {
  position: absolute;
  top: 8px;
  inset-inline-end: 10px;
  border: 0;
  background: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: #888888;
}

.stocktaking-card-title {
  font-size: 1.25rem;
  font-weight: bold;
  text-align: center;
  padding: 0 28px;
}

.stocktaking-card-codes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  color: #555555;
  font-size: 0.95rem;
}

.stocktaking-card-mode {
  text-align: center;
  font-weight: bold;
  color: #8A5A00;
}

.stocktaking-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stocktaking-stat {
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
  background: #FAFAFA;
}

  .stocktaking-stat.is-match {
    background: #E8F5E9;
    border-color: #A5D6A7;
  }

  .stocktaking-stat.is-gap {
    background: #FFF3E0;
    border-color: #FFB74D;
  }

.stocktaking-stat-label {
  font-size: 0.85rem;
  color: #666666;
}

.stocktaking-stat-value {
  font-size: 1.4rem;
  font-weight: bold;
}

.stocktaking-qty-label {
  text-align: center;
  font-weight: bold;
}

.stocktaking-qty {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.stocktaking-qty-button {
  width: 56px;
  height: 56px;
  border: 1px solid #B5B5B5;
  border-radius: 10px;
  background: #F4F5F7;
  font-size: 1.6rem;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

.stocktaking-qty-input {
  width: 140px;
  height: 56px;
  border: 2px solid #B5B5B5 !important;
  border-radius: 10px !important;
  text-align: center;
  font-size: 1.6rem !important;
  font-weight: bold;
}

  /* border color comes from the theme (preset.less) */
  .stocktaking-qty-input:focus {
    outline: none;
  }

.stocktaking-qty-total {
  text-align: center;
  color: #444444;
}

.stocktaking-remark {
  width: 100%;
  min-height: 70px !important;
  padding: 8px 10px;
  border: 1px solid #B5B5B5;
  border-radius: 8px;
  font-size: 1rem;
  resize: vertical;
}

.stocktaking-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

button.finish-Stock-counting.stocktaking-primary {
  min-width: 160px;
  height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 10px;
  color: #FFFFFF;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  margin: 0;
}

  button.finish-Stock-counting.stocktaking-primary:disabled {
    opacity: 0.6;
    cursor: default;
  }

.stocktaking-secondary,
.stocktaking-danger {
  height: 48px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  background: #FFFFFF;
}

/* border and text color come from the theme (preset.less) */
.stocktaking-secondary {
  border: 1px solid;
}

.stocktaking-danger {
  border: 1px solid #D93025;
  color: #D93025;
}

/* counted list */
.stocktaking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stocktaking-list-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.stocktaking-list-title {
  font-weight: bold;
  font-size: 1.05rem;
}

.stocktaking-only-gaps {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.95rem;
}

.stocktaking-list-filter {
  height: 40px;
  border: 1px solid #B5B5B5 !important;
  border-radius: 8px !important;
  padding: 0 10px;
}

.stocktaking-list-empty {
  padding: 24px 12px;
  text-align: center;
  color: #777777;
  border: 1px dashed #C8C8C8;
  border-radius: 10px;
}

.stocktaking-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #E0E0E0;
  border-inline-start: 4px solid #81C784;
  border-radius: 8px;
  background: #FFFFFF;
  cursor: pointer;
}

  .stocktaking-line.is-gap {
    border-inline-start-color: #FFA726;
  }

  .stocktaking-line:hover {
    background: #FAFAFA;
  }

.stocktaking-line-info {
  flex: 1;
  min-width: 0;
}

.stocktaking-line-name {
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stocktaking-line-sku {
  color: #666666;
  font-size: 0.9rem;
}

.stocktaking-line-remark {
  margin-top: 2px;
  color: #8A5A00;
  font-size: 0.85rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.stocktaking-line.is-readonly {
  cursor: default;
}

  .stocktaking-line.is-readonly:hover {
    background: #FFFFFF;
  }

.stocktaking-line-numbers {
  display: flex;
  gap: 12px;
  text-align: center;
}

  .stocktaking-line-numbers span {
    display: block;
    font-size: 0.75rem;
    color: #777777;
  }

  .stocktaking-line-numbers b {
    font-size: 1.05rem;
  }

.stocktaking-line.is-gap .stocktaking-line-gap b {
  color: #E65100;
}

.stocktaking-line-delete {
  border: 0;
  background: none;
  color: #999999;
  font-size: 1.05rem;
  padding: 6px;
  cursor: pointer;
}

  .stocktaking-line-delete:hover {
    color: #D93025;
  }

/* footer */
.stocktaking-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid #E0E0E0;
}

button.finish-Stock-counting.stocktaking-update {
  width: 100%;
  max-width: 360px;
}

/* toast */
.stocktaking-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 10px;
  color: #FFFFFF;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

  .stocktaking-toast.is-success {
    background: #2E7D32;
  }

  .stocktaking-toast.is-error {
    background: #C62828;
  }

@media (max-width: 600px) {
  .warehouse-item-main {
    width: 100%;
  }

  .warehouse-item {
    min-height: 0;
  }

  .stocktaking-line {
    flex-wrap: wrap;
  }

  .stocktaking-line-info {
    flex-basis: calc(100% - 40px);
  }

  .stocktaking-line-numbers {
    order: 3;
    width: 100%;
    justify-content: space-around;
  }

  .stocktaking-stat-value {
    font-size: 1.2rem;
  }

  .stocktaking-card-actions button {
    flex: 1;
  }
}
