/* Status and touch-target fixes: text and symbols always accompany color. */
.badge.age-unknown,.badge.age-missing,.match-missing,.match-conflict,.audit-pill.pending,.listing.missing,.site-price.no-listing,.site-price.invalid,.savebar-pill.unset{color:#991b1b;background:#fef2f2;border:1px solid #fca5a5}
.match-exact,.badge.age-fresh,.badge.age-new,.audit-pill.matched{color:#166534;background:#f0fdf4;border-color:#86efac}
.reference-identity-warning{border:2px solid #dc2626;color:#991b1b;background:#fef2f2;font-size:16px}
.edit-button,.use-suggestion,.reference-actions a,.reference-search-result a,.text-button{min-height:44px;min-width:44px}
.reference-actions a,.reference-search-result a{display:inline-flex;align-items:center}
.grade-card small,.helper,.site-price small,.site-price span,.subline,.physical-summary small,.count-grade small{font-size:14px;line-height:1.6}
.reference-search-result{border:1px solid #d1d5db;border-radius:10px;padding:12px;margin:8px 0;overflow-wrap:anywhere}
.reference-search-result button{display:flex;justify-content:space-between;gap:12px;text-align:start;width:100%;min-height:48px;background:#f8fafc;padding:10px}
.reference-search-result button span span,.reference-search-result button small{display:block}
.reference-search-result button:disabled{opacity:.65;cursor:not-allowed}
.manual-website textarea{display:block;width:100%;min-height:90px;font-size:16px;margin:8px 0}
.my-work-filters{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}
.my-work-filters .selected{background:#0f5132;color:white}
.my-work-product{padding:18px 0;border-bottom:1px solid #d1d5db}
.my-work-product>b{font-size:17px}.my-work-product .physical-statuses{margin-top:12px}
#reference-source,#my-work-search{min-height:44px;width:100%;font-size:16px}
.reference-conflict>td:nth-child(2)>.price,.rejected-reference-price{color:#991b1b;text-decoration:line-through}


/* ===== 2026-11-03: Centered & Complete Staff Performance View ===== */
main:has(#performance-view:not([hidden])) .page-heading {
  justify-content: center;
  text-align: center;
  padding: 18px 0 14px;
}
main:has(#performance-view:not([hidden])) .page-heading > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
main:has(#performance-view:not([hidden])) .page-heading .muted {
  font-size: 14.5px;
  color: #42566d;
  font-weight: 500;
}
#performance-view .performance-filters {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(21,49,83,0.04);
}
#performance-view .performance-filters-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
#performance-view .performance-filters label {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#performance-view .performance-filters > span {
  font-size: 13.5px;
  color: #42566d;
  font-weight: 500;
}
#performance-view .performance-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
#performance-view .perf-summary-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 5px;
  box-shadow: 0 1px 2px rgba(21,49,83,0.04);
}
#performance-view .perf-summary-box strong {
  font: 700 32px/1.15 'Segoe UI', Arial, sans-serif;
  color: #53647a;
  font-variant-numeric: tabular-nums;
}
#performance-view .perf-summary-box.active-stat {
  border-color: #9ab7d8;
  background: #f6faff;
}
#performance-view .perf-summary-box.active-stat strong {
  color: var(--blue);
}
#performance-view .perf-summary-box span {
  font-size: 14px;
  font-weight: 600;
  color: #24384f;
}
#performance-view .employee-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
#performance-view .employee-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  gap: 12px;
  padding: 18px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(21,49,83,0.05);
}
#performance-view .employee-card:hover {
  border-color: #9ab7d8;
  box-shadow: 0 4px 12px rgba(21,49,83,0.08);
}
#performance-view .employee-card.selected {
  border: 2px solid var(--blue);
  padding: 17px 15px;
  background: #f2f7fd;
  box-shadow: 0 4px 14px rgba(0,91,171,0.10);
}
#performance-view .employee-card-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}
#performance-view .employee-avatar {
  height: 48px;
  width: 48px;
  border-radius: 50%;
  background: #e4edf7;
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 700;
  margin: 0 auto;
}
#performance-view .employee-card.selected .employee-avatar {
  background: var(--blue);
  color: #fff;
}
#performance-view .employee-card strong {
  font-size: 20px;
  color: var(--ink);
}
#performance-view .employee-status-pill {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 999px;
}
#performance-view .employee-status-pill.active {
  background: var(--good-soft);
  color: var(--good);
  border: 1px solid #bfe3cf;
}
#performance-view .employee-status-pill.idle {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}
#performance-view .employee-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 6px;
}
#performance-view .employee-card.selected .employee-mini-grid {
  background: #fff;
  border-color: #c6dcf3;
}
#performance-view .employee-mini-grid > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3px;
}
#performance-view .employee-mini-grid b {
  font: 700 20px/1.2 'Segoe UI', Arial, sans-serif;
  color: #475569;
  font-variant-numeric: tabular-nums;
}
#performance-view .employee-mini-grid b.highlight-num {
  color: var(--blue);
}
#performance-view .employee-mini-grid small {
  font-size: 13px;
  font-weight: 600;
  color: #334963;
  line-height: 1.3;
}
#performance-view .employee-meta-line {
  font-size: 13px;
  font-weight: 500;
  color: #42566d;
  width: 100%;
  text-align: center;
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
}
#performance-view .performance-detail {
  padding: 20px;
}
#performance-view .performance-section-head {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid #e7edf4;
  padding-bottom: 12px;
}
#performance-view .performance-section-head h2 {
  font-size: 21px;
  margin: 0;
}
#performance-view .performance-section-head span {
  font-size: 14px;
  color: #42566d;
  font-weight: 500;
}
#performance-view .activity-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
#performance-view .activity-totals button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 14px 10px;
  min-height: 92px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}
#performance-view .activity-totals button:hover {
  border-color: #9ab7d8;
  background: #f0f6fd;
}
#performance-view .activity-totals button strong {
  font: 700 28px/1.15 'Segoe UI', Arial, sans-serif;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
#performance-view .activity-totals button span {
  font-size: 14px;
  font-weight: 600;
  color: #24384f;
  line-height: 1.4;
  text-align: center;
}
#performance-view .activity-totals button.has-data {
  background: #fff;
  border-color: #9ab7d8;
  box-shadow: 0 2px 6px rgba(16,36,62,0.05);
}
#performance-view .activity-totals button.has-data strong {
  color: var(--blue);
}
#performance-view .activity-totals button.selected {
  background: var(--blue-soft);
  border: 2px solid var(--blue);
  padding: 13px 9px;
}
#performance-view .activity-totals button.selected strong {
  color: #004482;
}
#performance-view .performance-records-head {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin: 8px 0 14px;
}
#performance-view .performance-records-head h3 {
  margin: 0;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
#performance-view .records-count-badge {
  background: var(--blue-soft);
  color: var(--blue);
  font: 700 14px/1.4 'Segoe UI', Arial, sans-serif;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid #c6dcf3;
}
#performance-view .activity-records.single-record {
  grid-template-columns: minmax(0, 720px);
  justify-content: center;
}
#performance-view .activity-records article {
  background: #fbfcfe;
  border: 1px solid #d5e0ec;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#performance-view .activity-heading {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #e7edf4;
  padding-bottom: 8px;
  margin-bottom: 6px;
}
#performance-view .activity-heading > div {
  text-align: right;
}
#performance-view .activity-action-title {
  font-size: 15px;
  font-weight: 700;
  color: #0e2d52;
  margin: 6px 0;
}
#performance-view .activity-note {
  width: 100%;
  text-align: right;
}
#performance-view .workflow-actions {
  justify-content: center;
}
#performance-view .performance-footnote {
  text-align: center;
  margin: 18px auto 0;
  padding-top: 12px;
  border-top: 1px solid #e7edf4;
  color: #42566d;
  font-size: 13.5px;
  max-width: 880px;
}
@media (max-width: 760px) {
  #performance-view .performance-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  #performance-view .employee-cards {
    grid-template-columns: 1fr;
  }
  #performance-view .employee-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  #performance-view .activity-totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  #performance-view .activity-records {
    grid-template-columns: 1fr;
  }
}


/* === Grade F (تالف) & Quality Gate Styles (2026-11-03) === */
.grade.gf {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 800;
  width: auto;
  min-width: 68px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.count-grid.count-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.count-grade.count-grade-damaged {
  background: #fffafa;
  border-color: #fecaca;
}
.count-grade.count-grade-damaged input {
  border-color: #fca5a5;
  background: #fff;
}
.damaged-helper-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fef2f2;
  border: 1px dashed #fca5a5;
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 4px;
  text-align: center;
}
.damaged-helper-box strong {
  color: #991b1b;
  font-size: 0.82rem;
}
.damaged-helper-box small {
  color: #7f1d1d;
  font-size: 0.76rem;
  line-height: 1.45;
}
.count-damaged-summary.has-damaged {
  background: #fef2f2;
  border-color: #fca5a5;
}
.quality-gate-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  color: #92400e;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 0.95rem;
  font-weight: 600;
}
.quality-gate-inline {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 0;
  font-size: 0.88rem;
  font-weight: 700;
}
.audit-pill.quality-gate-pill {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  font-weight: 700;
}
.my-work-filters .filter-quality-gate {
  border-color: #f59e0b;
}
.my-work-filters .filter-quality-gate.selected {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
}
@media (max-width: 1100px) {
  .count-grid.count-grid-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .count-grid.count-grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .count-grid.count-grid-5 > :last-child {
    grid-column: 1 / -1;
  }
}

/* Polish overrides for 5-column Grade F grid & centered quality banner */
@media (min-width: 901px) {
  .inline-stock-fields .count-grid.count-grid-5,
  .stock-fields .count-grid.count-grid-5,
  .stock-comparison .count-grid.count-grid-5,
  .count-grid.count-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}
.quality-gate-banner {
  justify-content: center !important;
  text-align: center !important;
  gap: 8px !important;
}
