/*
 * الشواهد، وتقرير الفريق، و«تقدّمي»، والأرشفة.
 * كل القيم من tokens.css عبر var(--...)؛ لا أرقام ألوان ولا أسماء خطوط هنا.
 */

/* ─── الشاهد في صفحة التوثيق ─── */
.check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--color-action-bg);
}

.evidence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  line-height: var(--leading-relaxed);
}

.evidence svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--color-link);
}

.evidence__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-link);
  overflow-wrap: anywhere;
}

.evidence__when {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.evidence--archived {
  background: var(--status-info-bg);
  color: var(--status-info-ink);
}

.evidence--archived svg {
  color: currentColor;
}

.evidence-field__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.evidence-field__required {
  color: var(--status-warning-ink);
  font-size: var(--text-sm);
}

/* ─── تقرير الفريق ─── */
.report-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.week-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.week-picker__step {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--color-border-field);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text);
}

.week-picker__step svg {
  width: 18px;
  height: 18px;
}

.week-picker__range {
  min-width: 200px;
  font-weight: var(--weight-medium);
  text-align: center;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.report {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.report th,
.report td {
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--color-rule);
  text-align: center;
}

.report thead th {
  background: var(--color-page-end);
  color: var(--color-text-secondary);
  font-weight: var(--weight-semibold);
}

.report tbody th {
  text-align: start;
}

.report__name {
  display: block;
  font-weight: var(--weight-medium);
}

.report__unit {
  display: block;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
}

.report__num--2 { color: var(--status-done-ink); }
.report__num--3 { color: var(--status-partial-ink); }
.report__num--4 { color: var(--status-notdone-text); }

.report__rate {
  white-space: nowrap;
}

.report__rate span {
  margin-inline-start: var(--space-2);
  font-weight: var(--weight-semibold);
}

.meter--short {
  width: 90px;
  vertical-align: middle;
}

.meter--wide {
  width: 100%;
  height: 12px;
}

.report-notes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-10);
  margin-top: var(--space-4);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-loose);
}

.report-notes p {
  max-width: 460px;
  margin: 0;
}

/* ─── «تقدّمي» ─── */
.bars {
  margin: var(--space-5) 0 var(--space-8);
}

.bars__row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  align-items: end;
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--color-border-field);
}

.bars__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.bars__value {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.bars__col--current .bars__value {
  color: var(--color-text);
}

.bars__svg {
  width: 100%;
  height: 140px;
}

.bars__bar { fill: var(--color-bar); }
.bars__col--current .bars__bar { fill: var(--color-bar-current); }

.bars__label {
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  text-align: center;
}

.tally-list,
.plan-share {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-6);
}

.plan-share {
  gap: var(--space-3);
  line-height: var(--leading-loose);
}

.plan-share p {
  margin: 0;
}

.tally-list__title {
  margin: 0 0 var(--space-2);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.tally-list__row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-rule);
}

.tally-list__value { font-weight: var(--weight-semibold); }
.tally-list__value--done { color: var(--status-done-ink); }
.tally-list__value--partial { color: var(--status-partial-ink); }
.tally-list__value--not-done { color: var(--status-notdone-text); }

/* ─── الأرشفة ─── */
.batches {
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

.batches__row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-rule);
}

.batches__state,
.batches__none {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.batches__action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-danger-link);
  font-size: var(--text-sm);
}

.field__input--code {
  max-width: 220px;
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-wide);
  direction: ltr;
  text-align: center;
}

/* ─── زر اختيار الشاهد: الحقل الأصلي مخفي بصريًا ويبقى قابلًا للتركيز ─── */
.file-pick {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-pick__button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.file-pick__button svg {
  width: 20px;
  height: 20px;
}

.file-input:focus-visible + .file-pick__button {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.file-pick__name {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
