/* Platform paneline özgü eklemeler. Temel dil (renkler, paneller, hap rozetleri) site.css ve panels.css'ten gelir. */

.platform-tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 6px;
  background: var(--alc-accent-soft);
  color: var(--alc-accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-wide { max-width: 1180px; }

/* İstatistik kartları */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--alc-border);
  border-radius: 14px;
  background: var(--alc-bg);
  box-shadow: var(--alc-shadow-sm);
  color: inherit;
  text-decoration: none;
}

a.stat:hover { border-color: var(--alc-border-strong); background: var(--alc-bg-subtle); }
.stat-label { font-size: 0.78rem; color: var(--alc-text-secondary); font-weight: 500; }
.stat-value { font-size: 1.65rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-of { font-size: 1rem; color: var(--alc-text-tertiary); font-weight: 500; }
.stat-note { font-size: 0.78rem; color: var(--alc-text-tertiary); }

/* Anahtar-değer listesi */
.kv { margin: 0; padding: 0.25rem 1.25rem 1rem; }
.kv > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--alc-border); font-size: 0.86rem; }
.kv > div:last-child { border-bottom: 0; }
.kv dt { font-weight: 500; color: var(--alc-text-secondary); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv-inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); column-gap: 2rem; }

/* Tablo */
.table-wrap { overflow-x: auto; }
.admin-table { --bs-table-bg: transparent; font-size: 0.88rem; }
.admin-table thead th {
  font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--alc-text-secondary); border-bottom: 1px solid var(--alc-border); background: var(--alc-bg-subtle); white-space: nowrap;
}
.admin-table td, .admin-table th { padding: 0.7rem 1rem; }
.admin-table tbody tr { border-color: var(--alc-border); }
.admin-table tbody tr:hover { background: var(--alc-bg-subtle); }
.admin-table td code { font-size: 0.78rem; }

/* Sağlık */
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; align-items: start; }
.health-grid > .panel { margin-bottom: 0; }
.health-card { border-left-width: 4px; }
.health-card.status-ok { border-left-color: var(--alc-success); }
.health-card.status-degraded { border-left-color: var(--alc-warning); }
.health-card.status-down { border-left-color: var(--alc-danger); }
.health-detail { margin: 0.6rem 1.25rem 0.25rem; font-size: 0.85rem; color: var(--alc-text); }
.health-card.status-down .health-detail { color: var(--alc-danger); }
.health-card.status-degraded .health-detail { color: var(--alc-warning); }

.health-list { padding: 0.25rem 0 0.5rem; }
.health-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.5rem 1.25rem; border-bottom: 1px solid var(--alc-border); font-size: 0.88rem; }
.health-row:last-child { border-bottom: 0; }
.health-row .detail { display: block; font-size: 0.78rem; color: var(--alc-text-secondary); }

.chip-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip-list code { padding: 0.15rem 0.5rem; border-radius: 6px; background: var(--alc-bg-subtle); border: 1px solid var(--alc-border); font-size: 0.8rem; }

/* Ayarlar satırı (anahtar) */
.setting-row { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-start; padding: 0.85rem 0; border-top: 1px solid var(--alc-border); }
.setting-title { font-weight: 600; font-size: 0.9rem; }
.setting-desc { margin: 0.2rem 0 0; font-size: 0.82rem; color: var(--alc-text-secondary); max-width: 46ch; }

.activity-list { list-style: none; margin: 0; padding: 0.25rem 1.25rem 1rem; }
.activity-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--alc-border); }
.activity-list li:last-child { border-bottom: 0; }

.role-select { width: auto; min-width: 7.5rem; }

.panel-title { margin: 0; font-size: 1rem; font-weight: 600; }
.panel-desc { margin: 0.2rem 0 0; font-size: 0.82rem; color: var(--alc-text-secondary); }

/* Kullanıcı hücresi: ad ve e-posta alt alta (Web'de bu, satır düzeninin parçasıdır). */
.user-cell { display: flex; align-items: center; gap: 0.7rem; }
.user-cell .user-name { display: block; font-weight: 600; }
.user-cell .user-email { display: block; font-size: 0.8rem; color: var(--alc-text-secondary); }

.health-card .btn { white-space: nowrap; flex-shrink: 0; }

.audit-details { min-width: 14rem; }
.audit-details code { white-space: normal; word-break: break-word; }

/* --- Agent'lar ----------------------------------------------------------------------------------- */
.stat-value-sm { font-size: 1.15rem; }
.w-checkbox { width: 2.5rem; }

/* Kaynak ağacı: alan → klasör → alt klasör. Üstü seçili düğümün altı "dahil" görünür ve kilitlenir. */
.source-tree, .source-tree ul { list-style: none; margin: 0; padding: 0; }
.source-tree ul { padding-left: 1.6rem; border-left: 1px dashed var(--alc-border); margin-left: 0.45rem; }
.source-tree > li { padding: 0.35rem 0; border-bottom: 1px solid var(--alc-border); }
.source-tree > li:last-child { border-bottom: 0; }
.source-node { display: flex; align-items: center; gap: 0.55rem; padding: 0.25rem 0; cursor: pointer; font-size: 0.9rem; }
.source-node .form-check-input { margin: 0; flex-shrink: 0; }
.source-tree > li > .source-node .source-name { font-weight: 600; }
.source-count { margin-left: auto; font-size: 0.78rem; color: var(--alc-text-tertiary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.source-node:has(input:disabled) { cursor: default; color: var(--alc-text-secondary); }

/* Test konsolu */
.console-log { display: flex; flex-direction: column; gap: 0.9rem; padding: 1.25rem; min-height: 16rem; max-height: 60vh; overflow-y: auto; }
.console-msg { max-width: 92%; padding: 0.7rem 0.9rem; border-radius: 0.75rem; font-size: 0.9rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.console-msg-user { align-self: flex-end; background: var(--alc-accent-soft); color: var(--alc-text); }
.console-msg-agent { align-self: flex-start; background: var(--alc-bg-subtle); border: 1px solid var(--alc-border); }
.console-msg-error { align-self: flex-start; color: var(--alc-danger); border: 1px solid var(--alc-danger); background: transparent; }
.console-meta { display: block; margin-top: 0.5rem; font-size: 0.76rem; color: var(--alc-text-tertiary); white-space: normal; }
.console-sources { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.8rem; color: var(--alc-text-secondary); white-space: normal; }
.console-warning { display: block; margin-top: 0.5rem; font-size: 0.8rem; color: var(--alc-warning); white-space: normal; }
.console-form { display: flex; gap: 0.6rem; align-items: flex-end; padding: 0.9rem 1.25rem; border-top: 1px solid var(--alc-border); }
.console-form textarea { resize: vertical; }

/* Agent sayfası sekmeleri */
.agent-tabs { margin-bottom: 1.25rem; border-bottom: 1px solid var(--alc-border); flex-wrap: nowrap; overflow-x: auto; }
.agent-tabs .nav-link { color: var(--alc-text-secondary); font-weight: 500; font-size: 0.92rem; white-space: nowrap; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; }
.agent-tabs .nav-link:hover { color: var(--alc-text); }
.agent-tabs .nav-link.active { color: var(--alc-accent); border-bottom-color: var(--alc-accent); background: transparent; }
.tab-count { display: inline-block; min-width: 1.35rem; margin-left: 0.3rem; padding: 0 0.4rem; border-radius: 999px; background: var(--alc-bg-subtle); border: 1px solid var(--alc-border); color: var(--alc-text-secondary); font-size: 0.72rem; text-align: center; font-variant-numeric: tabular-nums; }
.tab-narrow { max-width: 860px; }
.tab-pane-x[hidden] { display: none; }

/* Veri bağlantısı: şema listesi ve sihirbaz */
.wizard-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.75rem 1.25rem; border-top: 1px solid var(--alc-border); border-bottom: 1px solid var(--alc-border); background: var(--alc-bg-subtle); }
.wizard-progress { display: flex; align-items: center; gap: 0.6rem; min-width: 16rem; }
.wizard-progress .progress { flex: 1; height: 0.5rem; }
.schema-list { list-style: none; margin: 0; padding: 0; }
.schema-list > li { border-bottom: 1px solid var(--alc-border); }
.schema-list > li:last-child { border-bottom: 0; }
.schema-list summary { display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 1.25rem; cursor: pointer; list-style: none; }
.schema-list summary::-webkit-details-marker { display: none; }
.schema-list summary:hover { background: var(--alc-bg-subtle); }
.schema-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.schema-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.schema-body { padding: 0.5rem 1.25rem 1.25rem 3rem; }
.is-draft { border-style: dashed; background: var(--alc-accent-soft); }
.schema-list li.is-working { background: var(--alc-accent-soft); }
.console-sql { display: block; margin-top: 0.4rem; padding: 0.5rem 0.65rem; border-radius: 0.5rem; background: var(--alc-bg); border: 1px solid var(--alc-border); font-size: 0.78rem; white-space: pre-wrap; word-break: break-word; }
.gateway-snippet { padding: 0.75rem 0.9rem; margin: 0 0 1rem; border-radius: 0.6rem; background: var(--alc-bg-subtle); border: 1px solid var(--alc-border); font-size: 0.8rem; white-space: pre-wrap; word-break: break-all; }
