/* Finance Assistant AI Bot: Binance masaüstü uygulamasından esinlenen koyu/açık tasarım. Kendi simge ve markamız kullanılır. */
:root {
  --bg: #F5F5F5; --card: #FFFFFF; --card2: #FAFAFA; --line: #EAECEF; --text: #1E2329; --muted: #707A8A; --faint: #B7BDC6;
  --accent: #F0B90B; --on-accent: #181A20; --up: #03A66D; --down: #E0364D; --info: #2563EB; --warn: #C27C00;
  --shadow: 0 1px 2px rgba(20,21,26,.05);
  --rail: 78px; --bar: 34px; --r: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0E11; --card: #181A20; --card2: #1E2329; --line: #2B3139; --text: #EAECEF; --muted: #848E9C; --faint: #474D57;
    --accent: #FCD535; --up: #0ECB81; --down: #F6465D; --info: #6EA8FF; --warn: #F0B90B; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B0E11; --card: #181A20; --card2: #1E2329; --line: #2B3139; --text: #EAECEF; --muted: #848E9C; --faint: #474D57;
  --accent: #FCD535; --up: #0ECB81; --down: #F6465D; --info: #6EA8FF; --warn: #F0B90B; --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.45;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { min-height: 100vh; min-height: 100dvh; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); } .info { color: var(--info); } .warn { color: var(--warn); } .muted { color: var(--muted); }
.hide { display: none !important; }

/* ---------- iskelet ---------- */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.rail { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 6px calc(var(--bar) + 10px); background: var(--bg); border-right: 1px solid var(--line); z-index: 20; }
.rail .logo { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 10px; }
.rail .logo svg { width: 30px; height: 30px; }
.rail a.nav { width: 64px; padding: 9px 2px 7px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--muted); font-size: 11px; font-weight: 500; text-align: center; }
.rail a.nav svg { width: 22px; height: 22px; }
.rail a.nav:hover { color: var(--text); background: var(--card); }
.rail a.nav.on { color: var(--text); background: var(--card); }
.rail a.nav.on svg { color: var(--accent); }
.rail .spacer { flex: 1; }
.rail button.ib { width: 40px; height: 40px; border: 0; background: none; color: var(--muted); border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.rail button.ib:hover { background: var(--card); color: var(--text); }
.rail button.ib svg { width: 22px; height: 22px; }
.dot-badge { position: relative; }
.dot-badge::after { content: ""; position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; border: 2px solid var(--bg); }

.main { min-width: 0; padding: 18px 24px calc(var(--bar) + 28px); }
.wrap { max-width: 1240px; margin: 0 auto; }

/* üst şerit */
.top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }
.who b { font-size: 17px; display: block; }
.who small { color: var(--muted); font-size: 12px; }
.top .grow { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--card); border: 1px solid var(--line); white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: block; }
.pill.up { color: var(--up); } .pill.down { color: var(--down); } .pill.warn { color: var(--warn); } .pill.info { color: var(--info); }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }

.banner { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r); margin-bottom: 12px; border: 1px solid var(--line); background: var(--card); font-size: 13px; }
.banner.bad { border-color: var(--down); } .banner.warn { border-color: var(--warn); }
.banner a { color: var(--accent); font-weight: 600; text-decoration: underline; }

/* ---------- kartlar ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin: 0 0 10px; font-size: 16px; font-weight: 700; }
.card h3 .more { float: right; font-size: 12px; font-weight: 500; color: var(--muted); }
.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cols-eq { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 16px; }
.kpi .l { color: var(--muted); font-size: 12px; }
.kpi .v { font-size: 22px; font-weight: 700; margin-top: 2px; letter-spacing: -.01em; }
.kpi .s { color: var(--muted); font-size: 12px; margin-top: 1px; }
.stack > * + * { margin-top: 14px; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; align-items: stretch; }
.hero .lab { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.hero .big { font-size: 38px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 2px; }
.hero .big small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.hero .sub { font-size: 14px; color: var(--muted); }
.hero .sub b { font-weight: 600; }
.actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--card2); border-radius: 8px; padding: 8px 16px; font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.danger { color: var(--down); }
.btn[disabled] { opacity: .5; cursor: default; }
.chips { display: inline-flex; gap: 2px; background: var(--card2); border-radius: 8px; padding: 2px; }
.chips button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; font-size: 12px; color: var(--muted); cursor: pointer; font-weight: 600; }
.chips button.on { background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--line); }

/* sekmeler ve tablolar */
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin: -4px 0 6px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 8px 0 10px; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 8px; white-space: nowrap; }
td { padding: 11px 8px; border-top: 1px solid var(--line); white-space: nowrap; }
th.r, td.r { text-align: right; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--card2); }
.scroll-x { overflow-x: auto; }
.coin { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.coin i { width: 28px; height: 28px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; color: var(--muted); flex: none; }
.coin small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--card2); border: 1px solid var(--line); }
.tag.up { color: var(--up); } .tag.down { color: var(--down); } .tag.info { color: var(--info); }
.link { color: var(--accent); font-weight: 600; cursor: pointer; background: none; border: 0; padding: 0; }
.empty { padding: 28px 8px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
.insight { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.insight:first-of-type { border-top: 0; }
.insight .d { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.d.bad { background: var(--down); } .d.warn { background: var(--warn); } .d.info { background: var(--info); } .d.ok { background: var(--up); }
code { background: var(--card2); padding: 1px 6px; border-radius: 5px; font-size: 12px; }

/* grafik */
.chart { position: relative; width: 100%; height: 230px; touch-action: pan-y; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); box-shadow: 0 4px 14px rgba(0,0,0,.18); z-index: 3; }
.chart .tip b { display: block; font-size: 13px; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }

/* alt durum bandı */
.statusbar { position: fixed; left: var(--rail); right: 0; bottom: 0; height: var(--bar); display: flex; align-items: center; gap: 18px; padding: 0 16px; background: var(--bg); border-top: 1px solid var(--line); font-size: 12px; z-index: 15; overflow: hidden; }
.statusbar .tick { display: flex; gap: 18px; flex: 1; overflow: hidden; white-space: nowrap; }
.statusbar .tick span b { font-weight: 600; margin-right: 6px; }
.statusbar .ok { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.statusbar .led { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.statusbar .led.on { background: var(--up); } .statusbar .led.off { background: var(--down); }

/* açılır menü (ayarlar) */
.pop { position: fixed; z-index: 60; min-width: 250px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.28); }
.pop .row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 10px; border-radius: 8px; font-size: 14px; }
.pop .row.hov:hover { background: var(--card2); cursor: pointer; }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.scrim { position: fixed; inset: 0; z-index: 50; }

/* giriş (sade) */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login .box { width: 100%; max-width: 300px; }
.lg-brand { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 22px; }
.lg-brand svg { width: 22px; height: 22px; flex: none; }
.login h1 { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.login p { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
.lg-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.lg-form .inp { font-size: 14px; padding: 8px 10px; min-height: 36px; }
.lg-check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin: 2px 0; cursor: pointer; }
.lg-check input { width: 14px; height: 14px; margin: 0; }
.login .btn { width: 100%; justify-content: center; padding: 8px; font-size: 14px; min-height: 36px; }
.lg-back { align-self: center; font-size: 12.5px; margin-top: 4px; }
@media (max-width: 600px) { .lg-form .inp { font-size: 16px; } }   /* iOS odaklanınca yakınlaştırmasın */
.err { color: var(--down); font-size: 12.5px; margin: 0; min-height: 0; }
.err:empty { display: none; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input { width: 100%; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--card2); font-size: 16px; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* mobil alt menü */
.tabbar { display: none; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: var(--card); border-top-left-radius: 18px; border-top-right-radius: 18px; border: 1px solid var(--line); padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet a { display: flex; align-items: center; gap: 14px; padding: 14px 8px; border-top: 1px solid var(--line); font-size: 16px; }
.sheet a:first-of-type { border-top: 0; }
.sheet svg { width: 22px; height: 22px; color: var(--muted); }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .cols-2, .cols-eq { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail { display: none; }
  .main { padding: calc(10px + env(safe-area-inset-top)) 14px calc(84px + env(safe-area-inset-bottom)); }
  .statusbar { display: none; }
  .hero .big { font-size: 32px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--bg);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 600; padding: 4px 0; min-height: 48px; justify-content: center; cursor: pointer; }
  .tabbar svg { width: 23px; height: 23px; }
  .tabbar .on { color: var(--text); } .tabbar .on svg { color: var(--accent); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 15px 14px; }
  .chart { height: 200px; }
  .mticker { display: flex !important; }
}
.mticker { display: none; gap: 14px; overflow-x: auto; margin: 0 -14px 10px; padding: 0 14px; font-size: 12px; scrollbar-width: none; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- ortak form/bileşenler ---------- */
.inp { width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--card2); font-size: 14px; min-height: 38px; }
.inp:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
select.inp { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
textarea.inp { min-height: 84px; resize: vertical; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; margin-bottom: 12px; }
.filters .field { margin: 0; }
.hint { color: var(--muted); font-size: 12px; display: block; margin-top: 4px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn.danger-fill { background: var(--down); color: #fff; border-color: transparent; }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: 12px; }
.toasts { position: fixed; z-index: 100; right: 16px; bottom: calc(var(--bar) + 12px); display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--card2); border: 1px solid var(--line); border-left: 3px solid var(--up); border-radius: 8px; padding: 10px 14px; box-shadow: 0 8px 28px rgba(0,0,0,.3); font-size: 13px; }
.toast.bad { border-left-color: var(--down); } .toast.warn { border-left-color: var(--warn); }
.modal-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; width: 100%; max-width: 420px; }
.modal h3 { margin: 0 0 8px; }
.check { display: flex; gap: 10px; padding: 6px 0; font-size: 13px; }
.check b { width: 16px; flex: none; }
.bar { height: 6px; border-radius: 3px; background: var(--card2); overflow: hidden; margin: 6px 0; }
.bar i { display: block; height: 100%; background: var(--accent); }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.detail-head .t { font-size: 22px; font-weight: 800; }
.detail-head .p { font-size: 26px; font-weight: 700; }
.chart.candle { height: 380px; }
.chart.candle .tip { top: 30px; transform: translate(-50%, 0); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: 4px 0; }
.legend i { display: inline-block; width: 12px; height: 3px; margin-right: 5px; vertical-align: middle; }
.sticky-sel tr.sel td { background: var(--card2); }
.sub-nav { margin-bottom: 14px; }
.page-title { font-size: 20px; font-weight: 800; margin: 0 0 12px; }
@media (max-width: 860px) { .toasts { bottom: 86px; } .chart.candle { height: 300px; } .detail-head .p { font-size: 22px; } }

/* çubuk listesi */
.hbars { display: grid; gap: 8px; margin: 6px 0 10px; }
.hb { display: grid; grid-template-columns: fit-content(150px) minmax(0, 1fr) 96px; gap: 10px; align-items: center; font-size: 13px; }
.hb-l { font-weight: 600; }
.hb-t { position: relative; height: 12px; background: var(--card2); border-radius: 6px; }
.hb-t::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--faint); }
.hb-t i { position: absolute; top: 0; bottom: 0; border-radius: 6px; }
.hb-t i.pos { background: var(--up); } .hb-t i.neg { background: var(--down); }
.hb-v { text-align: right; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.form-grid .field { margin: 0; }
.plan { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.4fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.plan:first-of-type { border-top: 0; }
.plan small { display: block; color: var(--muted); font-size: 12px; }
.plan .acts { display: flex; gap: 6px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 13px; }
.check-row input { margin-top: 3px; }
@media (max-width: 860px) { .plan { grid-template-columns: 1fr 1fr; } .plan .acts { grid-column: 1 / -1; } .hb { grid-template-columns: fit-content(110px) minmax(0, 1fr) 84px; } }
table.heat td, table.heat th { text-align: right; } table.heat td:first-child, table.heat th:first-child { text-align: left; }
