@font-face {
  font-family: 'Inter';
  src: local('Inter');
}

:root {
  --bg-0: #10131a;
  --bg-1: #161a23;
  --bg-2: #1c212c;
  --border: #262c3a;
  --border-strong: #343c4e;

  --text-primary: #e6e9ef;
  --text-secondary: #8b93a7;
  --text-muted: #5c6479;

  --accent: #d9a441;
  --accent-dim: #8a6d2e;
  --accent-bg: rgba(217, 164, 65, 0.1);

  --long: #2fbf8f;
  --long-bg: rgba(47, 191, 143, 0.1);
  --short: #e8604c;
  --short-bg: rgba(232, 96, 76, 0.1);

  --font-sans: -apple-system, "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;

  --radius: 6px;
}

/* Gündüz — aynı amber/teal/coral dili, açık zeminde */
:root[data-theme="light"] {
  --bg-0: #f5f4f0;
  --bg-1: #ffffff;
  --bg-2: #ece9e1;
  --border: #ddd8cc;
  --border-strong: #c7c0af;
  --text-primary: #1c1d1f;
  --text-secondary: #5c5e63;
  --text-muted: #8b8d92;
  --accent: #a86a14;
  --accent-dim: #8a5710;
  --accent-bg: rgba(168, 106, 20, 0.1);
  --long: #188a63;
  --long-bg: rgba(24, 138, 99, 0.08);
  --short: #c1432c;
  --short-bg: rgba(193, 67, 44, 0.08);
}

/* Bloomberg Classic — saf siyah zemin, klasik amber terminal */
:root[data-theme="bloomberg"] {
  --bg-0: #000000;
  --bg-1: #0a0a0a;
  --bg-2: #141414;
  --border: #242424;
  --border-strong: #3a3a3a;
  --text-primary: #f2f2ec;
  --text-secondary: #a8a89c;
  --text-muted: #6b6b62;
  --accent: #ff9f1c;
  --accent-dim: #b3701a;
  --accent-bg: rgba(255, 159, 28, 0.12);
  --long: #3ddc84;
  --long-bg: rgba(61, 220, 132, 0.1);
  --short: #ff5c4d;
  --short-bg: rgba(255, 92, 77, 0.1);
}

/* Midnight Blue — lacivert zemin, elektrik mavi vurgu */
:root[data-theme="midnight"] {
  --bg-0: #0b1220;
  --bg-1: #111a2c;
  --bg-2: #182338;
  --border: #233150;
  --border-strong: #304569;
  --text-primary: #e3e9f5;
  --text-secondary: #8b9ab8;
  --text-muted: #576787;
  --accent: #4fc3f7;
  --accent-dim: #2f88ab;
  --accent-bg: rgba(79, 195, 247, 0.1);
  --long: #2fbf8f;
  --long-bg: rgba(47, 191, 143, 0.1);
  --short: #e8604c;
  --short-bg: rgba(232, 96, 76, 0.1);
}

/* Slate Mono — grafit gri, çok düşük doygunluk, mühendislik aracı hissi */
:root[data-theme="slate"] {
  --bg-0: #15171a;
  --bg-1: #1b1e22;
  --bg-2: #22262b;
  --border: #2c3136;
  --border-strong: #3d434a;
  --text-primary: #e4e6e8;
  --text-secondary: #8f959c;
  --text-muted: #5c6167;
  --accent: #8a97a6;
  --accent-dim: #647080;
  --accent-bg: rgba(138, 151, 166, 0.12);
  --long: #4fae86;
  --long-bg: rgba(79, 174, 134, 0.1);
  --short: #c96a56;
  --short-bg: rgba(201, 106, 86, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: 208px;
  flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  padding: 0 20px 18px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.brand span { color: var(--accent); }

.nav-group { padding: 0 10px; }

.theme-switcher {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 14px 20px 4px;
  border-top: 1px solid var(--border);
}
.theme-switcher label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.theme-switcher select { width: 100%; font-family: var(--font-sans); }

.logout-btn {
  margin: 8px 20px 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
  text-align: left;
  width: calc(100% - 40px);
}
.logout-btn:hover { color: var(--short); }

/* --- Mobil uyum --- */
@media (max-width: 720px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 16px;
    gap: 4px;
  }
  .brand { border-bottom: none; padding: 0 12px 0 0; margin: 0; }
  .nav-group { display: flex; flex-wrap: wrap; padding: 0; gap: 2px; }
  .nav-item { padding: 6px 8px; }
  .nav-item span, .nav-item { font-size: 12px; }
  .theme-switcher, .logout-btn { display: none; } /* mobilde yer kazanmak için gizlenir, masaüstünden yönetilir */
  .content { padding: 20px 16px; max-width: 100%; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 1px 0;
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  border-left: 2px solid transparent;
}
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: var(--bg-2); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent);
  border-left-color: var(--accent);
}
.nav-item.active svg { opacity: 1; }

/* --- Content --- */
.content {
  flex: 1;
  padding: 28px 36px;
  max-width: 920px;
}

h1 {
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 4px;
  color: var(--text-primary);
}
.subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 24px;
}
h2 {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 28px 0 10px;
}
h2:first-of-type { margin-top: 0; }

/* --- Panels --- */
.panel {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}
.row + .row { border-top: 1px solid var(--border); }
.row label { font-size: 13px; color: var(--text-secondary); }
.row .hint { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; }

/* --- Form elements --- */
input[type=number], input[type=text], select {
  background: var(--bg-0);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  border-radius: var(--radius);
  padding: 6px 9px;
  font-size: 13px;
  font-family: var(--font-mono);
}
input[type=number] { width: 80px; }
input:focus, select:focus { outline: none; border-color: var(--accent-dim); }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); }

button {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-sans);
}
button:hover { background: var(--bg-2); border-color: var(--text-muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: #1a1508; font-weight: 500; }
button.primary:hover { background: #e5b357; }
button.ghost { border-color: transparent; color: var(--text-secondary); padding: 6px 10px; font-size: 12px; }
button.ghost:hover { color: var(--text-primary); background: var(--bg-2); }

.status-msg { font-size: 12px; color: var(--long); margin-left: 10px; }

/* --- Table --- */
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 9px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
th {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.long { color: var(--long); }
.short { color: var(--short); }

.badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
}
.badge.long { background: var(--long-bg); color: var(--long); }
.badge.short { background: var(--short-bg); color: var(--short); }

.empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 48px 0;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.indicator-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.indicator-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.indicator-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.indicator-cat {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 2px;
}
.indicator-desc { font-size: 12px; color: var(--text-secondary); margin-top: 6px; line-height: 1.5; }

.tp-leg {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--bg-0);
}
.tp-leg-title { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
