/* Flow Step — Talepler
   Sayfa stilleri #page-requests altında. Pencereler (openModal) <body>'ye eklendiği için
   pencere içi sınıflar .modal altında (competitions.css ile aynı ayrım).
   Liste: ortak sınıflar (.filter-chip, .card, .badge, .btn, .empty-state) + rq- önekli; detay penceresi rq-d- önekli;
   form penceresi ve rozet renkleri req- önekli. Yalnızca variables.css token'ları; aydınlık ve koyu temada çalışır. */

/* ─── Ortak ───────────────────────────────────────────────── */
.modal .req-muted { color: var(--text-muted); font-size: 12px; }

#page-requests .req-error {
  margin-bottom: 12px; padding: 10px 14px; font-size: 13px; font-weight: 500; color: var(--accent-danger);
  background: color-mix(in srgb, var(--accent-danger) 10%, transparent); border-radius: var(--radius-md);
}

/* ─── Rozetler ────────────────────────────────────────────── */
.modal .req-badge {
  display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-full);
  white-space: nowrap; color: var(--text-secondary); background: var(--bg-tertiary); border: none;
}

/* Talep durumu: pending gri, revision turuncu, approved mavi, rejected kırmızı, completed yeşil, cancelled soluk gri */
#page-requests .req-st-pending,   .modal .req-st-pending   { color: var(--text-secondary); background: var(--bg-tertiary); }
#page-requests .req-st-revision,  .modal .req-st-revision  { color: var(--c-orange); background: color-mix(in srgb, var(--c-orange) 13%, transparent); }
#page-requests .req-st-approved,  .modal .req-st-approved  { color: var(--c-blue);   background: color-mix(in srgb, var(--c-blue) 11%, transparent); }
#page-requests .req-st-rejected,  .modal .req-st-rejected  { color: var(--c-red);    background: color-mix(in srgb, var(--c-red) 11%, transparent); }
#page-requests .req-st-completed, .modal .req-st-completed { color: var(--c-green);  background: color-mix(in srgb, var(--c-green) 13%, transparent); }
#page-requests .req-st-cancelled, .modal .req-st-cancelled { color: var(--text-muted); background: var(--bg-tertiary); opacity: .75; }

/* Belge durumu */
.modal .req-doc-st-issued { color: var(--c-orange); background: color-mix(in srgb, var(--c-orange) 13%, transparent); }
.modal .req-doc-st-signed { color: var(--c-green);  background: color-mix(in srgb, var(--c-green) 13%, transparent); }
.modal .req-doc-st-void   { color: var(--c-red);    background: color-mix(in srgb, var(--c-red) 11%, transparent); }

/* ─── Liste: araç çubuğu ──────────────────────────────────── */
#page-requests .rq-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 20px;
}
#page-requests .rq-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
#page-requests .rq-toolbar-right { display: flex; align-items: center; gap: 8px; }
#page-requests .rq-toolbar-right:empty { display: none; }
#page-requests .rq-toolbar-right .msr,
#page-requests .rq-empty .btn .msr { font-size: 18px; }
#page-requests .rq-chip-count {
  margin-left: 4px;
  font-size: var(--fs-small); font-weight: 500; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
#page-requests .filter-chip.active .rq-chip-count { color: inherit; opacity: .75; }

/* ─── Liste: kart ve satırlar ─────────────────────────────── */
#page-requests .rq-card { padding: 0; overflow: hidden; }
#page-requests .rq-list { display: flex; flex-direction: column; }
#page-requests .rq-row {
  display: flex; align-items: center; gap: 14px;
  min-height: 72px; padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--t-fast, .15s);
}
#page-requests .rq-row:last-child { border-bottom: none; }
#page-requests .rq-row:hover { background: var(--bg-tertiary); }
#page-requests .rq-row:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: -2px; }

#page-requests .rq-icon,
.modal .rq-d-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-control);
  background: var(--rq-bg, var(--bg-tertiary));
  color: var(--rq-fg, var(--text-muted));
}
#page-requests .rq-icon .msr,
.modal .rq-d-icon .msr { font-size: 20px; color: inherit; }

#page-requests .rq-main { flex: 1 1 auto; min-width: 0; }
#page-requests .rq-title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
#page-requests .rq-title {
  min-width: 0;
  font-size: 15px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#page-requests .rq-flag {
  flex-shrink: 0;
  background: var(--warning-soft); color: var(--accent-warning);
  font-size: 11px; font-weight: 600;
}
#page-requests .rq-meta {
  margin-top: 3px;
  font-size: 13px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

#page-requests .rq-side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
#page-requests .rq-docno {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
  white-space: nowrap;
}
#page-requests .rq-status { white-space: nowrap; }
#page-requests .rq-date {
  min-width: 44px; text-align: right;
  font-size: 13px; color: var(--text-muted);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}

#page-requests .rq-empty > .msr { font-size: 40px; }
#page-requests .rq-empty .btn { margin-top: 12px; }

/* 700px altı: sağ blokta yalnızca durum rozeti */
@media (max-width: 700px) {
  #page-requests .rq-row { padding: 14px 16px; gap: 12px; }
  #page-requests .rq-side > :not(.rq-status) { display: none; }
}

/* ─── Pencere: detay ──────────────────────────────────────── */
.modal .rq-d-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.modal .rq-d-head-text { min-width: 0; }
.modal .rq-d-title { font-size: 18px; font-weight: 600; color: var(--text-primary); line-height: 1.3; overflow-wrap: anywhere; }
.modal .rq-d-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }

/* Düzeltme / ret kutusu: sol kenarlı */
.modal .req-notice {
  margin-bottom: 14px; padding: 10px 14px 10px 12px;
  font-size: 13px; line-height: 1.5; color: var(--text-primary);
  border-left: 3px solid var(--border-strong); border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--bg-tertiary); white-space: pre-wrap; overflow-wrap: anywhere;
}
.modal .req-notice strong { font-weight: 600; }
.modal .req-notice-warn {
  border-left-color: var(--c-orange);
  background: color-mix(in srgb, var(--c-yellow) 14%, transparent);
}
.modal .req-notice-warn strong { color: var(--c-orange); }
.modal .req-notice-danger {
  border-left-color: var(--accent-danger);
  background: color-mix(in srgb, var(--accent-danger) 9%, transparent);
}
.modal .req-notice-danger strong { color: var(--accent-danger); }

/* Bilgiler: etiket solda, değer sağda */
.modal .rq-d-props { display: flex; flex-direction: column; }
.modal .rq-d-prop {
  display: grid; grid-template-columns: 140px minmax(0, 1fr); align-items: center; gap: 12px;
  min-height: 36px;
}
.modal .rq-d-prop-label { font-size: 13px; color: var(--text-muted); }
.modal .rq-d-prop-value {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  font-size: 14px; color: var(--text-primary); overflow-wrap: anywhere;
}
.modal .rq-d-person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.modal .rq-d-muted { font-size: 13px; color: var(--text-muted); }
.modal .rq-d-text {
  margin: 12px 0 0;
  font-size: 14px; line-height: 1.6; color: var(--text-secondary);
  white-space: pre-wrap; overflow-wrap: anywhere;
}

.modal .rq-d-section { margin-top: 20px; }
.modal .rq-d-section-title { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.modal .rq-d-section .rq-d-text { margin-top: 0; }

/* Ek dosya kartı */
.modal .rq-d-file {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px; font: inherit; text-align: left;
  color: var(--text-primary); background: transparent;
  border: 1px solid var(--border-default); border-radius: var(--radius-control);
  cursor: pointer;
  transition: background var(--t-fast, .15s);
}
.modal .rq-d-file:hover { background: var(--bg-tertiary); }
.modal .rq-d-file:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.modal .rq-d-file-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary); color: var(--text-secondary);
}
.modal .rq-d-file-icon .msr { font-size: 18px; color: inherit; }
.modal .rq-d-file-name {
  flex: 1 1 auto; min-width: 0;
  font-size: 14px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.modal .rq-d-file-open { font-size: 18px; color: var(--text-muted); }

/* Belge kartları */
.modal .rq-d-docs { display: flex; flex-direction: column; gap: 8px; }
.modal .rq-d-doc { padding: 12px; border: 1px solid var(--border-default); border-radius: var(--radius-control); }
.modal .rq-d-doc.is-void { opacity: .7; }
.modal .rq-d-doc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.modal .rq-d-doc-no { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--text-primary); }
.modal .rq-d-doc-date { margin-left: auto; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.modal .rq-d-doc-reason { margin-top: 6px; font-size: 13px; color: var(--text-secondary); white-space: pre-wrap; overflow-wrap: anywhere; }
.modal .rq-d-doc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.modal .rq-d-doc-actions .msr { font-size: 16px; }

/* Geçmiş: solda 2px dikey çizgi, 10px renkli noktalar */
.modal .rq-d-timeline { position: relative; margin: 0; padding: 0 0 0 22px; list-style: none; }
.modal .rq-d-timeline::before {
  content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px;
  border-radius: 2px; background: var(--border-default);
}
.modal .rq-d-tl-item { position: relative; padding-bottom: 16px; --rq-dot: var(--text-muted); }
.modal .rq-d-tl-item:last-child { padding-bottom: 0; }
.modal .rq-d-tl-item.is-blue   { --rq-dot: var(--team-blue); }
.modal .rq-d-tl-item.is-orange { --rq-dot: var(--team-orange); }
.modal .rq-d-tl-item.is-green  { --rq-dot: var(--team-green); }
.modal .rq-d-tl-item.is-red    { --rq-dot: var(--team-red); }
.modal .rq-d-tl-dot {
  position: absolute; left: -22px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--rq-dot);
  box-shadow: 0 0 0 3px var(--bg-secondary);
}
.modal .rq-d-tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.modal .rq-d-tl-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.modal .rq-d-tl-meta { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.modal .rq-d-tl-note { margin-top: 4px; font-size: 13px; color: var(--text-secondary); white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 560px) {
  .modal .rq-d-prop { grid-template-columns: 110px minmax(0, 1fr); }
}

/* Pencere alt bilgisi: Geri Çek solda, kırmızı */
.modal .req-danger-btn { margin-right: auto; color: var(--accent-danger); }

/* ─── Pencere: form ───────────────────────────────────────── */
.modal .req-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 12px; }

.modal .req-current-file {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin-bottom: 6px; padding: 8px 10px; font-size: 13px;
  background: var(--bg-tertiary); border-radius: var(--radius-md);
}
.modal .req-current-file .msr { font-size: 18px; color: var(--text-muted); }
.modal .req-current-file-name { flex: 1 1 auto; min-width: 0; color: var(--text-primary); overflow-wrap: anywhere; }
.modal .req-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.modal .req-check input { width: 15px; height: 15px; accent-color: var(--accent-primary); }
.modal .req-hint { display: block; margin-bottom: 6px; }

.modal .req-form-error {
  margin-top: 6px; padding: 8px 12px; font-size: 13px; font-weight: 500; color: var(--accent-danger);
  background: color-mix(in srgb, var(--accent-danger) 10%, transparent); border-radius: var(--radius-md);
}
.modal .req-form-error[hidden] { display: none; }
