/* Faza 2: hierarki e qartë, statuse të lexueshme dhe raporte për printim. */
.workspace .wrap {
  max-width: 1380px;
}
.workspace .page-title {
  padding-top: 26px;
  padding-bottom: 18px;
}
.workspace .page-title h1 {
  font-size: clamp(30px, 3vw, 44px);
}
.workspace .adminbar {
  background: #faf9f6;
  gap: 12px 20px;
}
.workspace .adminbar a {
  padding: 5px 0;
}
.workspace .form-panel {
  border: 1px solid #e3e0da;
  border-radius: 8px;
  padding: 24px;
}
.workspace input,
.workspace select,
.workspace textarea {
  box-sizing: border-box;
}
.workspace input:focus,
.workspace select:focus,
.workspace textarea:focus {
  outline: 2px solid #aa233b;
  outline-offset: 2px;
}
.workspace input[type="checkbox"] {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  accent-color: #aa233b;
}
.workspace button,
.workspace .button {
  border-radius: 5px;
  min-height: 42px;
}
.workspace .table-scroll {
  margin: 18px 0;
}
.workspace table th {
  background: #eeeae4;
  color: #24221f;
}
.workspace table td {
  vertical-align: top;
  line-height: 1.55;
}
.workspace table tr:hover td {
  background: #fcfaf5;
}
.workspace .actions {
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.workspace details > summary {
  padding: 12px 0;
  cursor: pointer;
}
.badge {
  display: inline-block;
  border-radius: 20px;
  padding: 5px 11px;
  font:
    600 12px/1.4 Arial,
    sans-serif;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge.draft,
.badge.pending {
  background: #edf0f4;
  color: #414a59;
  border-color: #cfd5df;
}
.badge.submitted {
  background: #fff0c7;
  color: #754700;
  border-color: #eac76c;
}
.badge.verified,
.badge.approved {
  background: #dceffb;
  color: #154d78;
  border-color: #aacde4;
}
.badge.published,
.badge.passed,
.badge.closed {
  background: #dff3e6;
  color: #165d35;
  border-color: #a6d6b9;
}
.badge.rejected,
.badge.error,
.badge.open {
  background: #fce4e3;
  color: #922e2b;
  border-color: #e8b6b4;
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 30px 0;
}
.pagination a {
  border: 1px solid #d5d0c8;
  padding: 9px 14px;
  border-radius: 4px;
}
.pagination a[aria-current="page"] {
  color: white;
  background: #aa233b;
  border-color: #aa233b;
}
.reading-description {
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.reading-description p {
  margin: 8px 0 12px;
}
.reading-description a {
  text-decoration: underline;
}
.home-reading .reading-description {
  font-size: 14px;
}
.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 10px;
}
.rich-toolbar button {
  background: #f5f2ed;
  color: #282522;
  border: 1px solid #ccc5bb;
  font-size: 13px;
  padding: 6px 12px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.metric {
  min-width: 0;
}
@media (max-width: 700px) {
  .workspace .form-panel {
    padding: 16px;
  }
  .workspace .actions > button,
  .workspace .actions > .button {
    max-width: 100%;
  }
  .workspace .filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace .filters > * {
    min-width: 0;
  }
}
@media print {
  .no-print,
  .rich-toolbar,
  .pagination {
    display: none !important;
  }
  .metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .workspace .wrap {
    max-width: none;
  }
  .table-scroll {
    overflow: visible;
  }
  table {
    width: 100%;
  }
  table th,
  table td {
    font-size: 8px;
    padding: 5px;
  }
  .badge,
  .bar i {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

.badge.open {
  background: #fff0c7;
  color: #754700;
  border-color: #eac76c;
}
.badge.done {
  background: #dff3e6;
  color: #165d35;
}
.badge.running {
  background: #dceffb;
  color: #154d78;
}
.fw-state[data-state="done"],
.fw-state[data-state="skipped"] {
  color: #165d35;
}
.fw-state[data-state="error"] {
  color: #922e2b;
  background: #fff0ee;
}
.fw-state[data-state="running"] {
  color: #154d78;
}

/* Study quality: text labels accompany every colour. */
.fw-q-red {
  background: #fff0ee;
  border-left: 5px solid #bb3027;
}
.fw-q-amber {
  background: #fff7df;
  border-left: 5px solid #b87a00;
}
.fw-q-reviewed {
  background: #eaf6ed;
  border-left: 5px solid #287744;
}
.fw-q-automatic {
  background: #f4f4f4;
  border-left: 5px solid #777;
}
.fw-q-omitted {
  background: #eee;
  border-left: 5px solid #555;
}
.fw-q-label {
  font-weight: 700;
}
.fw-q-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
.fw-q-body {
  max-height: 85vh;
  overflow: auto;
  white-space: normal;
  line-height: 1.75;
  padding: 18px;
  border: 1px solid #ddd;
}
.fw-q-editor textarea {
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 850px) {
  .fw-q-columns {
    grid-template-columns: 1fr;
  }
  .fw-q-body {
    max-height: 45vh;
  }
}
@media print {
  .fw-q-body {
    max-height: none;
    overflow: visible;
  }
}

/* Laptop review: keep the source visible while moving down the form. */
@media (min-width: 851px) {
  .fw-q-columns > div:first-child {
    position: sticky;
    top: 12px;
  }
  .fw-q-body {
    max-height: 70vh;
  }
}
.fw-q-decision {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 12px;
  border-top: 1px solid #ccc;
  box-shadow: 0 -3px 12px #0000000d;
  z-index: 2;
}
.fw-q-editor textarea {
  font-size: 14px;
  font-weight: 400;
}
.fw-repair-panel summary {
  cursor: pointer;
  font-weight: 700;
  padding: 10px 0;
}
.fw-repair-panel [role="status"] {
  padding: 12px;
  background: #f5f4f1;
}
@media print {
  .fw-q-columns > div:first-child,
  .fw-q-decision {
    position: static;
  }
  .fw-repair-panel {
    display: none;
  }
}

/* Review workspace: keep context compact and place the article first. */
.fw-q-overview,
.fw-q-list {
  margin: 18px 0 24px;
}
.fw-q-overview > summary,
.fw-q-list > summary {
  cursor: pointer;
  padding: 14px;
  background: #f3f2ef;
  font-weight: 700;
}
.fw-q-editor .notice li {
  margin: 12px 0;
  line-height: 1.6;
}
.fw-q-editor h3 {
  font:
    700 17px/1.4 Arial,
    sans-serif;
}
.fw-q-editor [data-use-evidence] {
  margin-top: 12px;
}
.fw-q-decision {
  flex-direction: column;
  align-items: stretch;
}
.fw-q-decision button {
  min-height: 44px;
  font-size: 14px;
}
.workspace:has(.fw-q-editor) .masthead {
  height: 88px;
}
.workspace:has(.fw-q-editor) .masthead .logo {
  height: 76px;
  width: 290px;
}
.workspace:has(.fw-q-editor) .page-title {
  padding-top: 20px;
  padding-bottom: 10px;
}
.workspace:has(.fw-q-editor) .page-title h1 {
  font-size: 32px;
}
@media (min-width: 851px) {
  .fw-q-editor .fw-q-body {
    max-height: 54vh;
  }
}
