/* ── ملحق تقرير الثقة: جداول وخطوات بنفس رموز التصميم (report.css) ── */

.tbl-wrap {
  margin-block: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-1);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font: 400 15px/1.75 var(--sans);
  color: var(--ink);
  min-width: 560px;
}
.tbl th {
  font: 700 13px/1.5 var(--kufi);
  color: var(--muted);
  text-align: start;
  padding: 16px 20px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { font-weight: 600; color: var(--ink-2); }
.tbl.num td { font-variant-numeric: tabular-nums; }
.tbl.num td:not(:first-child) { text-align: center; }
.tbl.num th:not(:first-child) { text-align: center; }

.night .tbl-wrap { background: rgba(255,255,255,.03); border-color: var(--night-line); box-shadow: none; }
.night .tbl { color: var(--on-night); }
.night .tbl th { background: rgba(255,255,255,.05); color: var(--on-night-2); border-color: var(--night-line); }
.night .tbl td { border-color: var(--night-line); }
.night .tbl td:first-child { color: var(--on-night); }

.tsteps {
  list-style: none;
  counter-reset: ts;
  margin: clamp(28px, 4vw, 48px) 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.tsteps > li {
  counter-increment: ts;
  display: grid;
  grid-template-columns: 52px 1fr;
  column-gap: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.tsteps > li::before {
  content: counter(ts);
  grid-row: span 2;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--petrol);
  color: var(--silver-2);
  font: 800 18px/1 var(--kufi);
}
.tsteps > li > b { font: 700 18px/1.6 var(--kufi); color: var(--ink); }
.tsteps > li > span { color: var(--ink-2); line-height: 1.85; }
.night .tsteps > li { background: rgba(255,255,255,.03); border-color: var(--night-line); }
.night .tsteps > li > b { color: var(--on-night); }
.night .tsteps > li > span { color: var(--on-night-2); }
.night .tsteps > li::before { background: var(--teal); }

.sec code {
  font: 500 .88em/1 var(--mono);
  background: rgba(13,115,119,.09);
  color: var(--petrol-deep);
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
}
.night code { background: rgba(155,231,224,.12); color: var(--ice); }

.duo-asides { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
@media (max-width: 900px) { .duo-asides { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .tbl th, .tbl td { padding: 12px 14px; }
  .tsteps > li { grid-template-columns: 40px 1fr; padding: 18px; }
  .tsteps > li::before { width: 34px; height: 34px; font-size: 15px; }
}
@media print { .tbl-wrap { box-shadow: none; overflow: visible; } .tsteps > li { break-inside: avoid; } }

/* اقتباس الغلاف على خلفية الليل: لون فاتح بدل البترولي الغامق */
.cover .pull { color: var(--ice); border-inline-start-color: var(--red); }
.cover .pull small { color: var(--on-night-2); }

/* ── الموبايل: كل صف بيبقى كارت، وكل خانة عليها اسم عمودها — من غير تمرير جانبي ── */
@media (max-width: 620px) {
  .tbl-wrap { overflow: visible; background: transparent; border: 0; box-shadow: none; }
  .tbl { min-width: 0; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--card);
    padding: 6px 0;
  }
  .tbl td { border: 0; padding: 8px 16px; }
  .tbl td[data-label]::before {
    content: attr(data-label);
    display: block;
    font: 700 11.5px/1.4 var(--kufi);
    color: var(--muted);
    margin-bottom: 3px;
  }
  .tbl td:first-child { font: 700 16px/1.55 var(--kufi); padding-top: 12px; }
  .tbl td:first-child::before { display: none; }
  .tbl.num td:not(:first-child) { text-align: start; display: inline-block; width: 50%; }
  .night .tbl tr { background: rgba(255,255,255,.04); border-color: var(--night-line); }
  .night .tbl td[data-label]::before { color: var(--on-night-3); }
  .sec code { white-space: normal; word-break: break-all; }
}

/* مخطط البنية */
.arch { margin: clamp(28px, 4vw, 48px) 0 0; padding: clamp(18px, 3vw, 34px); background: var(--card);
        border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.arch svg { display: block; width: 100%; height: auto; }
.arch .arch-tall { display: none; max-width: 380px; margin-inline: auto; }
@media (max-width: 760px) { .arch .arch-wide { display: none; } .arch .arch-tall { display: block; } }
