* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  color: #1a1a2e;
  background: #f0f2f8;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid #dde1ee;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar h1 { margin: 0 0 4px; font-size: 20px; }
.btn-link {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}
.meta { margin: 0; color: #667; font-size: 12px; }
.meta.warn { color: #b45309; }
#uploadForm { display: flex; gap: 8px; align-items: center; }
#uploadForm button {
  background: #4f46e5;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 20px;
}
.metric-focus-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  font-weight: 600;
  flex-wrap: wrap;
}
#metricFocus {
  min-width: 280px;
  max-width: 420px;
  width: 320px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 12px;
  background: #fff;
}
#metricFocus option {
  padding: 4px 6px;
}
.metric-focus-hint {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 400;
}
.focus-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 20px 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  color: #312e81;
  font-size: 14px;
}
.focus-banner[hidden] { display: none !important; }
.focus-banner__icon { font-size: 18px; }
.focus-banner strong { font-weight: 700; }
.focus-banner__meta {
  margin-left: auto;
  font-size: 12px;
  color: #6366f1;
  opacity: 0.85;
}
body.metric-focus .col-problems { display: none; }
#searchLogin {
  padding: 8px 12px;
  border: 1px solid #ccd;
  border-radius: 8px;
  min-width: 260px;
}
.chk { display: flex; align-items: center; gap: 6px; color: #445; }
.legend { display: flex; gap: 10px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.dot.green { background: #22c55e; }
.dot.yellow { background: #eab308; }
.dot.red { background: #ef4444; }
.dot.neutral { background: #cbd5e1; }
.legend-compare {
  font-size: 11px;
  color: #4338ca;
  padding: 2px 8px;
  background: #eef2ff;
  border-radius: 999px;
}
.legend-unchanged {
  font-size: 11px;
  color: #64748b;
  padding: 2px 8px;
  background: #f1f5f9;
  border-radius: 999px;
}
.mark-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}
.mark-badge.mark-done { background: #dbeafe; color: #1d4ed8; }
.mark-badge.mark-rework { background: #ffedd5; color: #c2410c; }
.mark-badge.mark-na { background: #f1f5f9; color: #64748b; }
.alert {
  margin: 12px 20px;
  padding: 10px 14px;
  border-radius: 8px;
}
.alert-error { background: #fee2e2; color: #991b1b; }
.alert.ok { background: #dcfce7; color: #166534; }
.table-wrap {
  margin: 0 12px 24px;
  overflow: auto;
  max-height: calc(100vh - 180px);
  background: #fff;
  border: 1px solid #dde1ee;
  border-radius: 10px;
}
.report { border-collapse: separate; border-spacing: 0; min-width: max-content; width: 100%; }
.report th, .report td {
  border-bottom: 1px solid #eef1f7;
  border-right: 1px solid #eef1f7;
  padding: 6px 8px;
  vertical-align: middle;
}
.report td {
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.report thead th {
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 10;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  min-height: 80px;
  max-width: 118px;
  min-width: 88px;
  vertical-align: bottom;
  padding: 10px 8px;
  overflow: visible;
  text-overflow: unset;
}
.report thead th.sticky {
  min-height: 48px;
  white-space: nowrap;
  max-width: none;
  vertical-align: middle;
}
.sticky { position: sticky; background: #fff; z-index: 5; }
thead .sticky { background: #f8fafc; z-index: 15; }
.col-toggle { left: 0; min-width: 36px; text-align: center; }
.col-login { left: 36px; min-width: 130px; }
.col-name { left: 166px; min-width: 160px; }
.col-problems { left: 326px; min-width: 36px; text-align: center; font-weight: 700; color: #dc2626; }
.report tbody tr:nth-child(4n+1) .sticky { background: #fff; }
.report tbody tr:nth-child(4n+3) .sticky { background: #fafbff; }
.client-row:hover .sticky { background: #f1f5ff; }
.btn-expand {
  width: 24px; height: 24px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
}
.btn-expand.open { background: #eef2ff; border-color: #818cf8; }
.cell {
  text-align: center;
  font-size: 12px;
  position: relative;
  vertical-align: middle;
  white-space: normal;
  line-height: 1.25;
  cursor: pointer;
}
.cell-value { display: block; font-weight: 600; pointer-events: none; }
.cell-mark {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
}
.cell-mark--done { color: #1d4ed8; }
.cell-mark--rework { color: #c2410c; }
.cell-mark--na { color: #64748b; }
.cell-compare {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 500;
  color: #4338ca;
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
}
.cell-compare--same {
  color: #64748b;
  font-weight: 400;
}
.cell-changed { box-shadow: inset 0 0 0 1px #818cf8; }
.cell-same { box-shadow: inset 0 0 0 1px #e2e8f0; }
.mark-done { outline: 2px solid #3b82f6; outline-offset: -2px; }
.mark-rework { outline: 2px solid #f97316; outline-offset: -2px; }
.mark-na { outline: 2px solid #94a3b8; outline-offset: -2px; }
.color-green { background: #dcfce7; }
.color-yellow { background: #fef9c3; }
.color-red { background: #fee2e2; }
.color-neutral { background: #f8fafc; color: #64748b; }
.color-empty { background: #fff; color: #cbd5e1; }
.campaign-container td { padding: 0; background: #f8fafc; }
.campaign-panel { padding: 10px 10px 10px 42px; overflow: auto; }
.campaign-table { border-collapse: collapse; min-width: max-content; }
.campaign-table th, .campaign-table td {
  border: 1px solid #e2e8f0;
  padding: 4px 6px;
  font-size: 11px;
}
.campaign-table th {
  background: #eef2ff;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  min-height: 72px;
  max-width: 110px;
  min-width: 84px;
  vertical-align: bottom;
  padding: 8px 6px;
}
.campaign-table td {
  white-space: nowrap;
}
.campaign-table .camp-id { font-weight: 600; color: #4338ca; min-width: 90px; }
.empty { text-align: center; padding: 40px; color: #94a3b8; }
.campaign-loading { color: #64748b; font-style: italic; }
.campaign-only-client-note {
  margin: 0 0 8px;
  padding: 8px 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  font-size: 12px;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal:not([hidden]) { display: flex; }
.modal__box {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: min(420px, 92vw);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .2);
}
.modal__metric { font-size: 13px; color: #475569; }
.modal__value { font-size: 18px; font-weight: 700; margin: 8px 0 16px; }
.modal__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.modal__actions button {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
.btn-done { background: #dbeafe; color: #1d4ed8; }
.btn-na { background: #f1f5f9; color: #475569; }
.btn-rework { background: #ffedd5; color: #c2410c; }
.btn-clear, .btn-cancel { background: #e2e8f0; color: #334155; }
