/* GBF'lerim sayfası (/sds) — design-system/chemoris/pages/dashboard.md. Yalnız tokens.css jetonları. */

/* Özet kartları */
.dash-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { display: flex; align-items: flex-start; gap: 14px; padding: 20px; }
.stat-ico {
  flex: none; width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary);
}
.stat-ico .sh-ic { width: 20px; height: 20px; }
.stat-label { margin: 0; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
.stat-value { margin: 4px 0 0; font-size: var(--fs-xl); font-weight: 700; line-height: var(--lh-tight);
  color: var(--text); font-variant-numeric: tabular-nums; }
.stat-value--sm { font-size: var(--fs-md); padding-top: 4px; }
.sk-num { width: 56px; height: 24px; }

/* Liste kartı */
.dash-list { overflow: hidden; }
.list-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.list-head h2 { margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.list-count { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--muted); min-height: 1.4em; }
.list-tools { display: flex; gap: 12px; flex-wrap: wrap; }
.search { position: relative; width: 280px; }
.search > .sh-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--subtle); pointer-events: none; }
.search .sh-input { padding-left: 38px; }
.sort { width: auto; min-width: 180px; cursor: pointer; }
.list-status:not(:empty) { padding: 16px 24px 0; }

/* Filtreler (K-35) */
.list-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 16px 24px;
  border-bottom: 1px solid var(--border); background: var(--bg); }
.flt { display: grid; gap: 4px; min-width: 150px; }
.flt-lbl { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.flt .sh-input { min-height: 38px; padding-top: 6px; padding-bottom: 6px; cursor: pointer; }
.flt-clear { min-height: 38px; background: transparent; border-color: transparent; color: var(--primary); }
.flt-clear:hover { background: var(--primary-soft); }

/* Tablo (masaüstü) */
.sds-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.sds-table th {
  padding: 12px 24px; text-align: left; font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.sds-table td { padding: 12px 24px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.sds-table tbody tr { transition: background-color .15s; }
.sds-table tbody tr:hover { background: var(--surface-2); }
.sds-table tbody tr:last-child td { border-bottom: 0; }
.c-name-in { display: flex; align-items: center; gap: 12px; min-width: 0; }
.doc-ico { flex: none; width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); }
.doc-ico .sh-ic { width: 18px; height: 18px; }
.row-link { color: var(--text); font-weight: 600; text-decoration: none; border-radius: 4px;
  overflow-wrap: anywhere; }
.row-link:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.row-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.c-name-txt { min-width: 0; display: grid; gap: 2px; }
.cell-main { display: block; color: var(--text); white-space: nowrap; }
.cell-sub { display: block; font-size: var(--fs-xs); color: var(--muted); }
.c-doc .cell-sub { white-space: nowrap; }

/* Durum rozetleri */
.st-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.6; white-space: nowrap; }
.st-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-draft { background: var(--surface-2); color: var(--text-2); }
.st-ready { background: var(--ok-soft); color: var(--ok); }
.st-changed { background: var(--warn-soft); color: var(--warn); }
.c-status .cell-sub { margin-top: 4px; }
.c-actions { width: 1%; white-space: nowrap; text-align: right; }
.c-actions .sh-icon-btn { color: var(--muted); }
.c-actions a.sh-icon-btn:hover, .c-actions .dl-btn:hover { color: var(--primary); background: var(--primary-soft); }
.dl-btn.is-busy { cursor: progress; opacity: .6; }
.dl-btn.is-busy .sh-ic { animation: dl-pulse 1s ease-in-out infinite; }
@keyframes dl-pulse { 50% { transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .dl-btn.is-busy .sh-ic { animation: none; } }

/* İskelet, hata, arama boş */
.sk-list { padding: 8px 24px; }
.sk-row { display: grid; grid-template-columns: 2fr 1.2fr 1fr; gap: 24px; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--border); }
.sk-row:last-child { border-bottom: 0; }
.sk-a { height: 14px; } .sk-b { height: 12px; width: 70%; } .sk-c { height: 12px; width: 50%; }
.list-error { margin: 20px 24px; flex-wrap: wrap; }
.no-match { padding: 40px 24px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.no-match p { margin: 0 0 4px; }
.no-match strong { color: var(--text); }
.no-match .sh-btn { margin-top: 16px; }

/* Boş durum */
.empty { padding: 48px 24px; text-align: center; }
.empty-art { width: 200px; height: 150px; display: block; margin: 0 auto 16px; }
.empty h2 { margin: 0 0 8px; font-size: var(--fs-lg); font-weight: 700; color: var(--text); }
.empty p { margin: 0 auto 24px; max-width: 52ch; color: var(--muted); font-size: var(--fs-sm); }

@media (max-width: 1100px) {
  .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .list-head { padding: 16px; }
  .list-tools { width: 100%; }
  .search { flex: 1 1 200px; width: auto; }
  .sort { flex: 1 1 150px; min-width: 0; }
  .list-status:not(:empty) { padding: 12px 16px 0; }
  .list-filters { padding: 12px 16px; gap: 8px; }
  .flt { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .flt-clear { flex: 1 1 100%; }
  .list-error { margin: 16px; }
  .sk-list { padding: 4px 16px; }

  /* Tablo → kart */
  .sds-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sds-table, .sds-table tbody { display: block; }
  .sds-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
  }
  .sds-table tbody tr:last-child { border-bottom: 0; }
  .sds-table td { display: block; padding: 0; border: 0; }
  .c-name { grid-column: 1; grid-row: 1; display: flex; }
  .c-actions { grid-column: 2; grid-row: 1 / span 3; align-self: center; width: auto; }
  .c-company, .c-doc, .c-status { grid-column: 1; padding-left: 48px !important; font-size: var(--fs-xs); }
  .c-company::before, .c-doc::before { content: attr(data-label) ": "; color: var(--muted); }
  .c-doc .cell-main, .c-doc .cell-sub { display: inline; white-space: normal; }
  .c-doc .cell-sub::before { content: " · "; }
  .c-status { display: flex !important; align-items: center; gap: 8px; flex-wrap: wrap; }
  .c-status .cell-sub { margin-top: 0; }
  /* K-35: eylemler kartın altında tam genişlik; metin sütunu daralmasın */
  .sds-table tr { grid-template-columns: minmax(0, 1fr); }
  .c-actions { grid-column: 1; grid-row: auto; display: flex !important; justify-content: flex-start; gap: 4px;
    padding-left: 40px !important; margin-top: 4px; }
}
@media (max-width: 480px) {
  .dash-stats { gap: 12px; }
  .stat { padding: 16px; gap: 10px; flex-direction: column; }
  .stat-value { font-size: var(--fs-lg); }
  .stat-value--sm { font-size: var(--fs-base); }
  .sh-head .sh-btn { width: 100%; }
}
