/* BEYİN AI — true-black-flat + data-terminal Özel Stil Katmanı
   tasteskill v2 kuralları:
   - True black (#000000) zemin, yalnızca parlaklık basamağıyla derinlik (#111111 yüzeyi, #222222 iç oluk)
   - Sıfır gradyan, sıfır glow/neon gölge, sıfır backdrop-blur
   - Renk yalnızca veri ve durum üzerinde (Solar Amber #f2b33d)
   - Birincil buton ters çevrilmiş beyaz hap (#ffffff zemin, #000000 yazı)
   - Tüm sayılarda tabular-nums ve sağa hizalama */

:root[data-theme="dark"] {
  --ground: #000000;
  --surface: #111111;
  --raised: #1d1d1d;
  --active: #242424;
  --border: #1a1a1a;
  --rule: #161616;
  --control: #3a3a3a;
  --text: #ffffff;
  --muted: #b4b4b4;
  --faint: #949494;
  --accent: #f2b33d;
  --primary: #ffffff;
  --primary-ink: #000000;
  --positive: #3fc07a;
  --negative: #e5566f;
  --warning: #f2b33d;
  --pill-positive-bg: #14261c;
  --pill-positive-ink: #3fc07a;
  --pill-negative-bg: #2c1a20;
  --pill-negative-ink: #e5566f;
  --pill-warning-bg: #282011;
  --pill-warning-ink: #f2b33d;
  --pill-neutral-bg: #222222;
  --pill-neutral-ink: #ffffff;
  --chart-1: #f2b33d;
  --chart-2: #e6e6e6;
  --chart-3: #6b6b6b;
  --chart-muted: #383838;
  --grid: #242424;
  --axis-ink: #949494;
  --ink: #ffffff;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --sidebar-width: 224px;
  --pad: 28px;
  --gap: 16px;
  --card-pad: 22px;
  --radius-card: 16px;
  --radius-control: 999px;
  --control-height: 36px;
  --row-height: 52px;
  --nav-row: 36px;
}

.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

/* ---------- ŞİFRELİ GİRİŞ KAPISI (VAULT GATEKEEPER) ---------- */
.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--ground);
  display: grid;
  place-items: center;
  padding: 20px;
}

.gate-Overlay-hidden {
  display: none !important;
}

.gate-sheet {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px 28px;
}

.gate-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

.gate-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.gate-mark svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.gate-title {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.gate-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.gate-form {
  display: grid;
  gap: 16px;
}

.gate-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: var(--ground);
  border: 1px solid var(--control);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.gate-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.gate-error {
  color: var(--negative);
  font-size: 13px;
  min-height: 18px;
}

.gate-quick {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 10px;
}

.gate-quick-label {
  font-size: 12px;
  color: var(--faint);
}

.gate-quick-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gate-chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--raised);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease;
}

.gate-chip:hover {
  color: var(--text);
  border-color: var(--control);
}

/* ---------- RULED T-FRAME SHELL ---------- */
.shell-top {
  height: 60px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  background: var(--ground);
  position: sticky;
  top: 0;
  z-index: 15;
}

.shell-top-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shell-scope {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.shell-scope strong {
  color: var(--text);
  font-weight: 500;
}

.shell-top-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.switcher-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

.sidebar {
  border-right: 1px solid var(--border);
  background: var(--ground);
  padding: 18px 14px;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 12px;
}

.brand-header svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex: none;
}

.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-domain {
  font-size: 12px;
  color: var(--faint);
  margin-left: auto;
}

/* Dark mode nav rule: active item changes brightness from #b4b4b4 to #ffffff */
.nav-item {
  color: var(--muted);
  background: transparent;
  font-weight: 400;
}

.nav-item[aria-current="page"] {
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
}

.nav-badge {
  margin-left: auto;
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.sidebar-user {
  padding: 12px 8px 4px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.user-info {
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 12px;
  color: var(--faint);
}

/* ---------- SIGNATURE ELEMENT: HERMES TOPOLOGY FLOW STRIP ---------- */
.topology-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px var(--card-pad);
  margin-bottom: var(--gap);
}

.topology-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.topology-head h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.topology-nodes {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.topo-node {
  background: var(--ground);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.topo-node-label {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.topo-node-val {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.topo-node-val small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
}

.topo-node-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--faint);
}

.topo-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
}

.topo-link-label {
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
}

.topo-link-line {
  width: 48px;
  height: 2px;
  background: var(--accent);
}

/* ---------- BENTO / GRID ARITHMETIC ---------- */
.col-8 { grid-column: span 8; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-12 { grid-column: span 12; }

/* Card stretch prevention & balanced bottom edges */
.grid.balanced {
  align-items: stretch;
}
.panel-flex {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ---------- CANLI HERMES CONSOLE ---------- */
.console-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.console-feed {
  background: var(--ground);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  height: 158px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  display: grid;
  gap: 4px;
}

.msg-who {
  font-size: 12px;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
}

.msg-who strong {
  color: var(--text);
  font-weight: 500;
}

.msg.assistant .msg-who strong {
  color: var(--accent);
}

.msg-body {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-line;
}

.console-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--raised);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.preset-btn:hover {
  color: var(--text);
  border-color: var(--control);
}

.console-input-row {
  display: flex;
  gap: 8px;
}

.console-input-row .input {
  flex: 1;
  height: 36px;
  border-radius: 999px;
  background: var(--ground);
  padding: 0 14px;
}

/* ---------- PROJECT LIST CARDS ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--card-pad);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-title {
  font-size: 16px;
  font-weight: 600;
}

.project-cat {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.project-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--faint);
}

/* ---------- VIEW SWITCHING ---------- */
.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* ---------- CANLI PROJE ÖNİZLEME MODALI ---------- */
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.preview-modal.hidden {
  display: none !important;
}
.preview-window {
  width: 100%;
  max-width: 1280px;
  height: 90vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.preview-header {
  height: 52px;
  background: var(--ground);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}
.preview-title {
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.preview-iframe {
  width: 100%;
  flex: 1;
  border: 0;
  background: #ffffff;
}

/* ---------- DOSYA İNDİRME KARTLARI (/paylas/) ---------- */
.download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.download-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--card-pad);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}
.download-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* ---------- YÖNETİCİ ŞİFRE DEĞİŞTİRME PANELİ (ADMIN ONLY) ---------- */
.admin-key-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--card-pad);
  margin-top: var(--gap);
}
.admin-key-panel.hidden {
  display: none !important;
}
.admin-key-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.admin-key-row .input {
  max-width: 300px;
}

/* ---------- RESPONSIVE / PHONE FOLD ---------- */
@media (max-width: 960px) {
  .topology-nodes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .topo-link {
    display: none;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .shell-top {
    padding: 0 16px;
  }
  .shell-scope span.hide-sm,
  .hide-sm {
    display: none !important;
  }
  .topology-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

@media (max-width: 540px) {
  .topology-nodes {
    grid-template-columns: 1fr;
  }
}
