/* Catalog list screens (public/js/pages/masterdata.js): small additions on top of the list toolkit styles. */

/* Code tag in front of the name: one width so the names line up */
.code-tag.lc-code {
  flex-shrink: 0;
  min-width: 52px;
  text-align: center;
}

/* Zero counts recede so the rows that hold data stand out */
.lc-zero {
  color: var(--muted);
}

/* Status tag + "cần rà soát" side by side */
.lc-tags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Long single-line text in a secondary column (legal entity names) */
.lc-clip {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

/* Position of an employee: managers and supervisors highlighted */
.lc-pos {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  line-height: 1.6;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
}
.lc-pos.tone-info {
  background: var(--info-soft);
  color: var(--info);
  font-weight: 600;
}

.lc-contact {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 220px;
}

.avatar.lc-off {
  opacity: 0.45;
}

/* Card band by state (the asset class bands live in app.css) */
.lk-card .band.band-ok {
  background: var(--ok);
}
.lk-card .band.band-warn {
  background: var(--warn);
}
.lk-card .band.band-bad {
  background: var(--bad);
}
.lk-card .band.band-info {
  background: var(--info);
}
.lk-card .band.band-off {
  background: var(--line-2);
}

/* Cards opened with a click (no link): keyboard focus ring like a link */
.lk-card[role='button']:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Two lines in one cell (city over region) */
.lc-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Toolkit gap: on desktop the page toolbar is a wrapping row, so a filter bar with few quick views would only be as
   wide as its chips. The filter bar always takes the full row. */
@media (min-width: 1024px) {
}
/* Stacked tags in a narrow table column */
.lc-tags.v {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

/* Catalog item photo in a form (catalog editor, quick add while counting): image or placeholder + photo buttons */
.sp {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.sp.busy .sp-img {
  opacity: 0.6;
}
.sp-img {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-3);
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: zoom-in;
}
.sp-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sp-img.ph {
  cursor: default;
  border-style: dashed;
  border-color: var(--line-2);
  background: var(--surface-2);
  color: var(--muted);
  align-content: center;
  gap: 2px;
}
.sp-img.ph .icon {
  width: 22px;
  height: 22px;
}
.sp-img.ph small {
  font-size: 11px;
}
.sp-img:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.sp-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.sp-acts label.btn {
  cursor: pointer;
}
.sp-del {
  color: var(--bad);
}

/* Every photo of a saved catalog item: tiles (main one tagged) + add buttons; old photos are never replaced */
.spg {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.spg-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.spg-it {
  position: relative;
  width: 76px;
  height: 76px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-3);
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: zoom-in;
}
.spg-it.main {
  border: 2px solid var(--primary);
}
.spg-it img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.spg-it:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.spg-tag {
  position: absolute;
  left: 2px;
  bottom: 2px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 10px;
  background: var(--primary);
  color: var(--on-primary);
}
.spg-wait {
  cursor: progress;
  color: var(--muted);
  border-style: dashed;
}
.spg-wait .icon {
  animation: spg-pulse 1.2s ease-in-out infinite;
}
@keyframes spg-pulse {
  50% {
    opacity: 0.35;
  }
}
@media (prefers-reduced-motion: reduce) {
  .spg-wait .icon {
    animation: none;
  }
}
.spg .sp-acts label.btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Catalog item form: photo + source below the fields */
.sn-extra {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.sn-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  font-size: 13px;
  color: var(--text-2);
}
.sn-source .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
@media (max-width: 639px) {
  .sn-extra {
    grid-template-columns: minmax(0, 1fr);
  }
}
