:root {
  --bg-body: #000000;
  --bg-panel: rgba(15, 23, 42, 0.7); /* Biraz daha koyu transparan */
  --accent: #38bdf8;       /* Ana Mavi */
  --accent-glow: rgba(56, 189, 248, 0.3);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --danger: #ef4444;
  --success: #22c55e;
  --warn: #fbbf24;
  --border: rgba(148, 163, 184, 0.2);
  --header-height: 50px;
  --ticker-height: 32px;
}

/* RESET & BASE */
* { box-sizing: border-box; outline: none; user-select: none; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #000; font-family: system-ui, -apple-system, sans-serif; color: var(--text-main); }

/* LAYOUT GRID */
.cockpit-layout {
  display: grid;
  grid-template-rows: var(--header-height) 1fr var(--ticker-height);
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at center, #1e293b 0%, #000 90%);
}

/* 1. HEADER */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; background: rgba(2, 6, 23, 0.9); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 800; letter-spacing: 1.5px; color: var(--accent); font-size: 1.2rem; text-shadow: 0 0 10px var(--accent-glow); }
.status-display { font-family: 'Courier New', monospace; font-size: 0.85rem; color: var(--text-muted); }
.status-val { color: #fff; font-weight: bold; margin-right: 15px; margin-left: 5px; }
.status-bad { color: var(--danger); } .status-good { color: var(--success); }

/* 2. DASHBOARD MAIN */
.dashboard-container {
  padding: 10px;
  display: grid;
  grid-template-columns: 300px 1fr 320px; /* Sol - Orta - Sağ */
  gap: 12px;
  height: 100%;
  overflow: hidden;
}

/* PANELLER GENEL */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex; flex-direction: column;
  backdrop-filter: blur(12px);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.panel-header {
  padding: 8px 12px; background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-muted);
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}

/* SOL KOLON: MAKRO & AKTÖRLER */
.col-left { display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 0; }

.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
.metric-box { background: rgba(0,0,0,0.4); padding: 8px; border-radius: 4px; text-align: center; border: 1px solid rgba(255,255,255,0.05); }
.metric-lbl { font-size: 0.65rem; color: var(--text-muted); display: block; margin-bottom: 2px; }
.metric-val { font-size: 1.1rem; font-weight: 700; color: #fff; }

.feed-list { flex: 1; overflow-y: auto; padding: 0; list-style: none; margin: 0; }
.feed-item {
  padding: 10px; border-bottom: 1px solid var(--border);
  transition: background 0.2s; display: flex; gap: 10px; align-items: flex-start;
}
.feed-item:hover { background: rgba(255,255,255,0.02); }
.actor-icon { font-size: 1.5rem; line-height: 1; }
.actor-content { flex: 1; }
.actor-header { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 600; margin-bottom: 2px; color: var(--accent); }
.actor-quote { font-size: 0.75rem; color: var(--text-muted); font-style: italic; line-height: 1.3; }
.happiness-bar { height: 3px; background: #334155; margin-top: 5px; border-radius: 2px; overflow: hidden; }
.happiness-fill { height: 100%; background: var(--success); width: 50%; transition: width 0.5s; }

/* ORTA KOLON: GRAFİK & AI */
.col-center { display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 0; }

/* Üst Kısım: Grafikler (Height %55) */
.chart-section { flex: 5.5; min-height: 0; display: flex; flex-direction: column; }
.tab-nav { display: flex; gap: 2px; background: rgba(0,0,0,0.6); padding: 4px; border-bottom: 1px solid var(--border); }
.tab-btn {
  flex: 1; background: transparent; border: none; color: var(--text-muted);
  padding: 6px; cursor: pointer; font-size: 0.7rem; font-weight: 700; border-radius: 4px;
}
.tab-btn.active { background: var(--accent); color: #000; box-shadow: 0 0 10px var(--accent-glow); }
.chart-container { flex: 1; position: relative; padding: 10px; min-height: 0; }

/* Alt Kısım: AI Danışman (Height %45) */
.ai-section { flex: 4.5; min-height: 0; display: flex; flex-direction: column; border-top: 2px solid var(--accent); }
.ai-content { 
  flex: 1; overflow-y: auto; padding: 15px; font-size: 0.9rem; line-height: 1.6; color: #e2e8f0; 
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.05), transparent);
}
.ai-theory { font-size: 0.75rem; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; font-weight: bold; letter-spacing: 1px; }
.ai-msg { margin-bottom: 10px; }
.ai-prof { font-style: italic; color: var(--text-muted); border-left: 3px solid var(--warn); padding-left: 10px; margin-top: 10px; }

/* SAĞ KOLON: KONTROLLER */
.col-right { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.control-pad { padding: 15px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 20px; }

.control-group { background: rgba(0,0,0,0.3); padding: 10px; border-radius: 6px; border: 1px solid var(--border); }
.control-header { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; }
.control-math { font-family: 'Courier New', monospace; font-size: 0.8rem; color: var(--accent); text-align: right; margin-top: 5px; }
.control-math span { color: #fff; font-weight: bold; }

input[type=range] { width: 100%; accent-color: var(--accent); cursor: pointer; }

.btn-action {
  width: 100%; padding: 15px; background: linear-gradient(135deg, var(--accent), #0284c7);
  border: none; border-radius: 6px; color: #fff; font-weight: 800; font-size: 0.9rem;
  cursor: pointer; text-transform: uppercase; letter-spacing: 1px; box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
  transition: transform 0.1s, filter 0.2s; margin-top: auto;
}
.btn-action:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-action:active { transform: translateY(1px); }
.btn-action:disabled { background: #334155; color: #94a3b8; cursor: not-allowed; box-shadow: none; }

/* TICKER */
.news-ticker { background: #000; border-top: 1px solid var(--danger); display: flex; align-items: center; overflow: hidden; }
.ticker-label { background: var(--danger); color: #fff; padding: 0 15px; height: 100%; display: flex; align-items: center; font-size: 0.7rem; font-weight: 900; z-index: 5; }
.ticker-scroll { padding-left: 100%; display: inline-block; white-space: nowrap; animation: scroll 40s linear infinite; color: var(--accent); font-family: monospace; font-size: 0.85rem; }
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 100; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.modal-box { width: 400px; background: #0f172a; padding: 25px; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 0 50px rgba(56,189,248,0.1); }
.modal-box select { width: 100%; padding: 10px; margin-bottom: 15px; background: #1e293b; color: white; border: 1px solid #334155; border-radius: 4px; }