/* ==================================================================
   modules/projects.css · Projeler (önek pj-)
   Renkler yalnız token'lardan; Açık, Yarı koyu ve Koyu temada aynı kurallar.
================================================================== */

/* Durum renkleri (rozet dışı: nokta, çubuk) */
[data-pjst="planlandi"] { --pj-c: var(--accent); --pj-t: var(--t-blue); --pj-tb: var(--t-blue-bg); }
[data-pjst="aktif"] { --pj-c: var(--green); --pj-t: var(--t-green); --pj-tb: var(--t-green-bg); }
[data-pjst="beklemede"] { --pj-c: var(--orange); --pj-t: var(--t-amber); --pj-tb: var(--t-amber-bg); }
[data-pjst="tamamlandi"] { --pj-c: var(--t-purple); --pj-t: var(--t-purple); --pj-tb: var(--t-purple-bg); }
[data-pjst="arsiv"] { --pj-c: var(--text-3); --pj-t: var(--t-gray); --pj-tb: var(--t-gray-bg); }
.pj-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--pj-c, var(--text-3)); }

/* Select görselleri: durum ve alan rengi noktaları */
.dot.pj-planlandi { background: var(--accent); }
.dot.pj-aktif { background: var(--green); }
.dot.pj-beklemede { background: var(--orange); }
.dot.pj-tamamlandi { background: var(--t-purple); }
.dot.pj-arsiv { background: var(--text-3); }
.dot.pj-tone-blue { background: var(--t-blue); }
.dot.pj-tone-purple { background: var(--t-purple); }
.dot.pj-tone-pink { background: var(--t-pink); }
.dot.pj-tone-teal { background: var(--t-teal); }
.dot.pj-tone-amber { background: var(--t-amber); }
.dot.pj-tone-green { background: var(--t-green); }
.dot.pj-tone-red { background: var(--t-red); }
.dot.pj-tone-gray { background: var(--t-gray); }

/* İlerleme çubuğu */
.pj-prog-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pj-prog { display: block; flex: 1; min-width: 48px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pj-prog > i { display: block; height: 100%; background: var(--green); border-radius: inherit; transition: width 240ms var(--ease-out); }
.pj-prog.lg { height: 8px; border-radius: 4px; }
.pj-prog-n { flex: none; font-size: 12px; color: var(--text-2); }

/* Liste */
.pj-search { width: 220px; }
.pj-table .pj-col-prog { width: 15%; }
.pj-table .pj-col-n { width: 56px; }
.pj-table tr.pj-arch td, .pj-sub-table tr.pj-arch td { color: var(--text-2); }
.pj-table tr.pj-arch .t { font-weight: 500; }
.pj-sub-table { margin-top: 4px; }
.pj-sub-table .pj-act-cell { width: 40px; text-align: right; }
.pj-sub-table .pj-prog-cell { max-width: 220px; }
.pj-thumb { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--thumb); overflow: hidden; }
.pj-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pj-thumb i { display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 2px; font: 600 8px/1 var(--font); font-style: normal; color: var(--text-3); }

/* Pano */
.pj-board .column-head .pj-dot { margin-right: -2px; }
.pj-card .card-title { margin-bottom: 6px; }
.pj-card-space { display: flex; margin: 0 0 8px; }
.pj-card .pj-prog-cell { margin: 0 0 9px; }
.pj-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Zaman çizelgesi (Gantt) */
.pj-gantt { --pj-lab: 300px; flex: 1; min-height: 0; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overscroll-behavior: contain; }
.pj-gantt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pj-g-inner { position: relative; min-width: 760px; min-height: 100%; }
.pj-g-head { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: var(--pj-lab) minmax(0, 1fr); background: var(--surface); border-bottom: 1px solid var(--line); height: 52px; }
.pj-g-head .pj-g-lab { position: sticky; left: 0; z-index: 1; display: flex; align-items: flex-end; padding: 0 16px 9px; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface); border-right: 1px solid var(--line); }
.pj-g-scale { position: relative; overflow: hidden; }
.pj-g-mon { position: absolute; top: 8px; padding-left: 6px; font-size: 12.5px; font-weight: 650; white-space: nowrap; border-left: 1px solid var(--line-strong); line-height: 16px; }
.pj-g-wk { position: absolute; bottom: 8px; padding-left: 4px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pj-g-nowlbl { position: absolute; bottom: 7px; transform: translateX(-50%); padding: 1px 6px; border-radius: 999px; background: var(--red); color: var(--bg); font-size: 10.5px; font-weight: 700; line-height: 15px; z-index: 1; }
.pj-g-rows { position: relative; }
.pj-g-grid { position: absolute; top: 0; bottom: 0; left: var(--pj-lab); right: 0; pointer-events: none; z-index: 0; }
.pj-g-grid i { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.pj-g-now { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px solid var(--red); z-index: 2; }
.pj-g-row { position: relative; display: grid; grid-template-columns: var(--pj-lab) minmax(0, 1fr); min-height: 54px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pj-g-row:hover .pj-g-track { background: var(--hover); }
.pj-g-row:hover .pj-g-lab { background: linear-gradient(var(--hover), var(--hover)) var(--surface); }
.pj-g-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pj-g-row.pj-arch { opacity: .7; }
.pj-g-lab { position: sticky; left: 0; z-index: 2; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 16px; background: var(--surface); border-right: 1px solid var(--line); }
.pj-g-name { display: grid; min-width: 0; }
.pj-g-name strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-g-name span { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-g-track { position: relative; z-index: 1; min-width: 0; }
.pj-g-bar { position: absolute; top: 50%; height: 24px; margin-top: -12px; min-width: 6px; border-radius: 6px; background: var(--pj-tb); color: var(--pj-t); overflow: hidden; display: flex; align-items: center; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pj-t) 28%, transparent); }
.pj-g-bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--pj-t) 24%, transparent); }
.pj-g-bar > em { position: relative; padding: 0 8px; font-style: normal; font-size: 11.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pj-g-due { position: absolute; top: 50%; width: 8px; height: 8px; margin: 15px 0 0 -4px; border-radius: 2px; transform: rotate(45deg); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--text-2); z-index: 1; }
.pj-g-due.late { box-shadow: inset 0 0 0 1.5px var(--red); background: var(--red-soft); }
.pj-g-none { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-3); }

/* Detay */
.strip > .pj-strip-static { cursor: default; }
.strip > .pj-strip-static:hover { background: none; }
.strip > .pj-strip-static.red b { color: var(--red); }
.pj-act { margin: 0; padding: 12px 16px; }
.pj-switch { justify-content: space-between; width: 100%; }
.pj-switch input:disabled { opacity: .45; cursor: not-allowed; }
.pm-aside .field-btn:disabled { opacity: .55; cursor: not-allowed; }

/* Diyaloglar: seçim listesi, alanlar */
.pj-pick { display: flex; flex-direction: column; max-height: min(52vh, 440px); overflow-y: auto; background: var(--surface-2); border-radius: var(--r-m); }
.pj-pick-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 52px; }
.pj-pick-row + .pj-pick-row { border-top: 1px solid var(--line); }
.pj-pick-row:hover { background: var(--hover); }
.pj-pick-main { display: grid; flex: 1; min-width: 0; }
.pj-pick-main strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-pick-main span { color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-pick-row .due { font-size: 12.5px; flex: none; }
.pj-sp-list { margin-bottom: 12px; }
.pj-sp-list .row-item { gap: 10px; }
.pj-sw { width: 12px; height: 12px; flex: none; border-radius: 4px; background: var(--tone, var(--t-gray)); }
.pj-sp-list [data-locked] { opacity: .45; }
.field-btn:disabled { opacity: .55; cursor: not-allowed; }

/* Dar masaüstü (≤1680 px): başlık çubuğu taşmasın; görünüm düğmeleri yalnız simge (ad, erişilebilir ad olarak kalır) */
@media (max-width: 1680px) and (min-width: 761px) {
  .view-switch [data-pjv] { font-size: 0; gap: 0; }
  .view-switch [data-pjv] .i { margin: 0; }
  .pj-search { width: 160px; }
}
@media (max-width: 1520px) and (min-width: 761px) {
  #pjSpacesBtn .label { display: none; }
  .toolbar .pj-search { overflow: hidden; }
  .toolbar .pj-search .input { width: 100%; min-width: 0; }
  #toolbar:has(#pjSpacesBtn) { gap: 4px; padding-right: 8px; }
  .toolbar .pj-search { width: 36px; flex: none; transition: width 160ms var(--ease-out); }
  .pj-search:focus-within, .pj-search:has(input:not(:placeholder-shown)) { width: 200px; }
}
@media (max-width: 1360px) and (min-width: 761px) {
  .status-switch [data-pjs] .seg-n { display: none; }
  #toolbar:has(#pjSpacesBtn) [data-act="page"] .label { display: none; }
}
/* Daha darda başlık çubuğu sayfayı taşırmaz, kendi içinde kayar (çekirdeğin telefon davranışı) */
@media (max-width: 1240px) and (min-width: 761px) {
  #toolbar:has(#pjSpacesBtn) { overflow-x: auto; scrollbar-width: none; }
}

@media (max-width: 760px) {
  .toolbar .pj-search { width: 36px; flex: none; transition: width 160ms var(--ease-out); }
  .toolbar .pj-search:focus-within, .toolbar .pj-search:has(input:not(:placeholder-shown)) { width: 180px; }
  #pjSpacesBtn .label { display: none; }
  .toolbar .pj-search { overflow: hidden; }
  .toolbar .pj-search .input { width: 100%; min-width: 0; }
  #toolbar:has(#pjSpacesBtn) { gap: 4px; padding-right: 8px; }
  .pj-gantt { --pj-lab: 148px; }
  .pj-g-inner { min-width: 640px; }
  .pj-g-lab { padding: 8px 10px; gap: 8px; }
  .pj-g-name span { display: none; }
  .pj-page .table-wrap { padding-bottom: 96px; }
}
@media (prefers-reduced-motion: reduce) { .pj-prog > i { transition: none; } }

/* Talep önerisi: sağlayıcı bağlı değil uyarısı */
.pj-nc { margin-bottom: 12px; }
