/* Ayarlar → Worker'lar: durum kartları ve canlı log görünümü (workers.js). */
.wk-head-actions { display: flex; align-items: center; gap: 10px; }
.wk-warning { margin-bottom: 14px; line-height: 1.5; }
.wk-nav-alert { padding: 1px 7px; border-radius: 10px; background: #fdecec; color: #c0392b; font-weight: 700; }
.wk-nav-alert.hidden { display: none; }

.wk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 14px; margin-bottom: 16px; }
.wk-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; border-left: 3px solid #d9dbe5; }
.wk-card.running { border-left-color: var(--green); }
.wk-card.idle { border-left-color: #3976b8; }
.wk-card.starting { border-left-color: #d2873e; }
.wk-card.dead { border-left-color: #c0392b; }
.wk-card.stopped { opacity: .78; }
.wk-card.paused { border-left-color: #b8892b; }
.wk-paused { padding: 8px 10px; border-radius: 6px; background: #fff7e6; color: #8a6414; font-size: 12px; line-height: 1.45; }
.wk-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.wk-card-head h2 { margin: 0 0 3px; font-size: 15px; }
.wk-key { font-size: 11px; color: var(--muted); }

.wk-health { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.wk-health:before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ''; }
.wk-health.running { color: #278b65; background: #eaf7f0; }
.wk-health.running:before { animation: wk-pulse 1.4s ease-in-out infinite; }
.wk-health.idle { color: #3976b8; background: #eaf3ff; }
.wk-health.starting { color: #d2873e; background: #fff4e7; }
.wk-health.stopped { color: #86899a; background: #f1f2f5; }
.wk-health.dead { color: #c0392b; background: #fdecec; }
.wk-health.paused { color: #8a6414; background: #fff4dc; }
@keyframes wk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .wk-health.running:before, .wk-spinner { animation: none !important; } }

.wk-activity { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; background: #f6f7fb; font-size: 12px; overflow-wrap: anywhere; }
.wk-spinner { flex: none; width: 10px; height: 10px; border: 2px solid #cfd2de; border-top-color: var(--purple); border-radius: 50%; animation: wk-spin .9s linear infinite; }
@keyframes wk-spin { to { transform: rotate(360deg); } }

.wk-facts { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; margin: 0; font-size: 12px; }
.wk-facts dt { color: var(--muted); }
.wk-facts dd { margin: 0; overflow-wrap: anywhere; }
.wk-model { color: inherit; text-decoration: none; }
.wk-model:hover code { text-decoration: underline; }
.wk-model code { font-size: 11.5px; }
.wk-run.running { color: var(--green); font-weight: 600; }
.wk-run.ok { color: #278b65; font-weight: 600; }
.wk-run.fail, .wk-bad { color: #c0392b; font-weight: 600; }
.wk-error { padding: 8px 10px; border-radius: 8px; background: #fdecec; color: #8e2a20; font-size: 12px; max-height: 76px; overflow: auto; overflow-wrap: anywhere; }
/* Son turun sayaçları (WorkerStatus.SetMetrics) ve uyarı (SetWarning). */
.wk-metrics { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.wk-metrics span { padding: 3px 8px; border-radius: 999px; background: #f1f3f9; color: #4a5066; }
.wk-metrics b { color: #1f2433; }
.wk-warning { padding: 8px 10px; border-radius: 8px; background: #fff6e0; color: #7a5200; font-size: 12px; overflow-wrap: anywhere; }

.wk-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.wk-counts { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
.wk-counts:hover { color: var(--ink); }
.wk-counts .warn { color: #b9770e; font-weight: 600; }
.wk-counts .error { color: #c0392b; font-weight: 600; }
.wk-actions { display: flex; gap: 6px; }

/* Log görünümü */
.wk-log-panel { position: relative; }
.wk-log-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wk-log-toolbar .search-box { flex: 1 1 200px; }
.wk-follow { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.wk-live { font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.wk-live:before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ''; }
.wk-live.on { color: var(--green); }
.wk-live.on:before { animation: wk-pulse 1.4s ease-in-out infinite; }
.wk-live.off { color: #c0392b; }
.wk-live.paused { color: var(--muted); }

.wk-log { height: 520px; overflow: auto; background: #161827; color: #d6d9e6; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; padding: 8px 0; border-radius: 0 0 12px 12px; }
.wk-log:focus { outline: 2px solid var(--purple); outline-offset: -2px; }
.wk-log .empty-state { color: #8a8ea3; }
.wk-log-more { text-align: center; }
.wk-log-more .text-button { color: #a9a2ff; font-size: 12px; padding: 4px 8px; }
.wk-line { padding: 1px 14px; white-space: pre; }
.wk-log.wrap .wk-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.wk-line:hover { background: rgba(255, 255, 255, .04); }
.wk-line.warn { background: rgba(241, 196, 15, .07); }
.wk-line.error { background: rgba(231, 76, 60, .12); }
details.wk-line > summary { cursor: pointer; list-style: none; }
details.wk-line > summary::-webkit-details-marker { display: none; }
details.wk-line > summary .wk-m:after { content: '  ▸ ayrıntı'; color: #8a8ea3; }
details.wk-line[open] > summary .wk-m:after { content: '  ▾'; }
details.wk-line pre { margin: 4px 0 6px 0; padding: 8px 10px; background: rgba(0, 0, 0, .3); border-radius: 6px; color: #f0b6ae; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.wk-t { color: #7f849c; margin-right: 8px; }
.wk-l { display: inline-block; min-width: 30px; margin-right: 8px; font-weight: 700; }
.wk-l.trace { color: #7f849c; }
.wk-l.info { color: #6fcf97; }
.wk-l.warn { color: #f2c94c; }
.wk-l.error { color: #ff6b6b; }
.wk-src { color: #a9a2ff; margin-right: 8px; }
.wk-c { color: #56b6c2; margin-right: 8px; }
.wk-m { color: #e3e6f0; }
.wk-log-jump { position: absolute; right: 22px; bottom: 18px; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }

@media (max-width: 720px) {
  .wk-cards { grid-template-columns: 1fr; }
  .wk-log { height: 420px; }
}
