/* 5 FARKLI RENK SKALASI */
:root, body[data-palette="p1"] {
    --bg-main: #090514;
    --bg-gate: radial-gradient(circle at center, #1e1040 0%, #070310 100%);
    --bg-sidebar: linear-gradient(180deg, #170d33 0%, #0e0720 100%);
    --bg-card: rgba(30, 17, 60, 0.72);
    --bg-card-inner: rgba(16, 9, 35, 0.85);
    --border-color: rgba(167, 139, 250, 0.22);
    --text-main: #f5f3ff;
    --text-muted: #c4b5fd;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-glow: rgba(139, 92, 246, 0.38);
    --input-bg: #120926;
    --profit: #10b981;
    --loss: #f43f5e;
    --warning: #f59e0b;
    --shadow: 0 10px 32px -4px rgba(0, 0, 0, 0.55);
}
body.light-theme, body.light-theme[data-palette="p1"] {
    --bg-main: #fffaf5;
    --bg-gate: radial-gradient(circle at center, #fff7ed 0%, #ffedd5 100%);
    --bg-sidebar: linear-gradient(180deg, #fff3e6 0%, #ffedd5 100%);
    --bg-card: #ffffff;
    --bg-card-inner: #fff7ed;
    --border-color: #fed7aa;
    --text-main: #271203;
    --text-muted: #9a5b32;
    --accent: #f97316;
    --accent-hover: #ea580c;
    --accent-glow: rgba(249, 115, 22, 0.28);
    --input-bg: #fffaf5;
    --profit: #059669;
    --loss: #e11d48;
    --warning: #d97706;
    --shadow: 0 6px 24px rgba(249, 115, 22, 0.08);
}

body[data-palette="p2"] {
    --bg-main: #040d1a;
    --bg-gate: radial-gradient(circle at center, #0c254a 0%, #040d1a 100%);
    --bg-sidebar: linear-gradient(180deg, #0a1e3c 0%, #061226 100%);
    --bg-card: rgba(12, 34, 68, 0.72);
    --bg-card-inner: rgba(7, 20, 42, 0.85);
    --border-color: rgba(56, 189, 248, 0.22);
    --text-main: #f0f9ff;
    --text-muted: #7dd3fc;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --accent-glow: rgba(14, 165, 233, 0.38);
    --input-bg: #07162c;
}
body.light-theme[data-palette="p2"] {
    --bg-main: #f2fbf7;
    --bg-gate: radial-gradient(circle at center, #ecfdf5 0%, #d1fae5 100%);
    --bg-sidebar: linear-gradient(180deg, #e6f9f0 0%, #d1fae5 100%);
    --bg-card: #ffffff;
    --bg-card-inner: #ecfdf5;
    --border-color: #a7f3d0;
    --text-main: #062c1e;
    --text-muted: #047857;
    --accent: #10b981;
    --accent-hover: #059669;
    --accent-glow: rgba(16, 185, 129, 0.28);
    --input-bg: #f2fbf7;
    --shadow: 0 6px 24px rgba(16, 185, 129, 0.08);
}

body[data-palette="p3"] {
    --bg-main: #0b0b0e;
    --bg-gate: radial-gradient(circle at center, #221f1d 0%, #0b0b0e 100%);
    --bg-sidebar: linear-gradient(180deg, #1b1917 0%, #11100f 100%);
    --bg-card: rgba(34, 31, 29, 0.78);
    --bg-card-inner: rgba(20, 18, 17, 0.88);
    --border-color: rgba(251, 191, 36, 0.24);
    --text-main: #fefce8;
    --text-muted: #fde047;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --accent-glow: rgba(245, 158, 11, 0.35);
    --input-bg: #141210;
}
body.light-theme[data-palette="p3"] {
    --bg-main: #fff5f6;
    --bg-gate: radial-gradient(circle at center, #fff1f2 0%, #ffe4e8 100%);
    --bg-sidebar: linear-gradient(180deg, #ffe4e8 0%, #fecdd3 100%);
    --bg-card: #ffffff;
    --bg-card-inner: #fff1f2;
    --border-color: #fda4af;
    --text-main: #310912;
    --text-muted: #9f1239;
    --accent: #e11d48;
    --accent-hover: #be123c;
    --accent-glow: rgba(225, 29, 72, 0.25);
    --input-bg: #fff5f6;
    --shadow: 0 6px 24px rgba(225, 29, 72, 0.08);
}

body[data-palette="p4"] {
    --bg-main: #041210;
    --bg-gate: radial-gradient(circle at center, #0d302b 0%, #041210 100%);
    --bg-sidebar: linear-gradient(180deg, #092924 0%, #051815 100%);
    --bg-card: rgba(13, 48, 43, 0.72);
    --bg-card-inner: rgba(6, 28, 25, 0.85);
    --border-color: rgba(45, 212, 191, 0.24);
    --text-main: #f0fdfa;
    --text-muted: #5eead4;
    --accent: #14b8a6;
    --accent-hover: #0d9488;
    --accent-glow: rgba(20, 184, 166, 0.38);
    --input-bg: #07221e;
}
body.light-theme[data-palette="p4"] {
    --bg-main: #f5f7ff;
    --bg-gate: radial-gradient(circle at center, #eef2ff 0%, #dbe4ff 100%);
    --bg-sidebar: linear-gradient(180deg, #e8edff 0%, #dbe4ff 100%);
    --bg-card: #ffffff;
    --bg-card-inner: #eef2ff;
    --border-color: #c7d2fe;
    --text-main: #111638;
    --text-muted: #4338ca;
    --accent: #4f46e5;
    --accent-hover: #3730a3;
    --accent-glow: rgba(79, 70, 229, 0.25);
    --input-bg: #f5f7ff;
    --shadow: 0 6px 24px rgba(79, 70, 229, 0.08);
}

body[data-palette="p5"] {
    --bg-main: #141114;
    --bg-gate: radial-gradient(circle at center, #28161b 0%, #120f12 100%);
    --bg-sidebar: linear-gradient(180deg, #211317 0%, #151013 100%);
    --bg-card: rgba(38, 23, 28, 0.78);
    --bg-card-inner: rgba(24, 16, 19, 0.88);
    --border-color: rgba(201, 59, 75, 0.26);
    --text-main: #f5eff0;
    --text-muted: #d4959e;
    --accent: #c93b4b;
    --accent-hover: #ad2f3d;
    --accent-glow: rgba(201, 59, 75, 0.32);
    --input-bg: #1b1215;
    --shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.50);
}
body.light-theme[data-palette="p5"] {
    --bg-main: #f8f5f5;
    --bg-gate: radial-gradient(circle at center, #f5ebeb 0%, #ead8da 100%);
    --bg-sidebar: linear-gradient(180deg, #f0e4e6 0%, #e4d2d5 100%);
    --bg-card: #ffffff;
    --bg-card-inner: #faf3f4;
    --border-color: #d5bec1;
    --text-main: #1e1819;
    --text-muted: #783f46;
    --accent: #a82e3c;
    --accent-hover: #8c222f;
    --accent-glow: rgba(168, 46, 60, 0.22);
    --input-bg: #fcf9f9;
    --shadow: 0 6px 24px rgba(30, 24, 25, 0.07);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.25s, color 0.25s;
}

body:not(.app-unlocked) .app-header,
body:not(.app-unlocked) .app-body {
    display: none !important;
}

/* UST SERIT: solda menu butonu + logo + klasor adi (her zaman gorunur),
   sagda dil / renk skalasi / tema / oturum menusu. Sol panel bunun altinda daralir. */
.app-header {
    height: 70px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 22px 0 18px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 40;
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-palette-wrap { position: relative; }

.app-body {
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative; /* panel kenarindaki ac/kapa okunun konumu icin */
}

/* Panel kenarindaki ac/kapa oku: panelle ayni surede ve ayni egriyle kayar,
   dar modda ok saga doner. Yarisi panelin icinde, yarisi disinda durur. */
.sb-edge-toggle {
    position: absolute;
    top: 24px;
    left: calc(260px - 13px);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(var(--bg-card-inner), var(--bg-card-inner)), var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 25;
    box-shadow: var(--shadow);
    transition: left 0.22s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s, border-color 0.15s;
}
.sb-edge-toggle:hover { color: var(--accent); border-color: var(--accent); }
.sb-edge-toggle i { transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1); }
.sidebar.collapsed + .sb-edge-toggle { left: calc(72px - 13px); }
.sidebar.collapsed + .sb-edge-toggle i { transform: rotate(180deg); }

#bootShield {
    position: fixed;
    inset: 0;
    background: var(--bg-main);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
#bootShield.hidden {
    display: none !important;
}

.fullscreen-gate {
    position: fixed;
    inset: 0;
    background: var(--bg-gate, var(--bg-main));
    color: var(--text-main);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    transition: opacity 0.3s ease;
}

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

.master-login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 36px 32px;
    width: 100%;
    max-width: 410px;
    text-align: center;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.master-avatar-large {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    background: var(--accent);
    color: #fff;
    margin: 0 auto 16px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    font-weight: 800;
    overflow: hidden;
    border: 3px solid var(--border-color);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.master-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gate-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.gate-sub {
    color: var(--text-muted);
    margin-bottom: 34px;
    font-size: 14px;
}

.profiles-row {
    display: flex;
    gap: 26px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 920px;
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.22s ease;
    width: 140px;
    position: relative;
}

.profile-card:hover {
    transform: scale(1.08);
}

.profile-avatar {
    width: 124px;
    height: 124px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 800;
    color: var(--accent);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    transition: border-color 0.2s;
    position: relative;
}

.profile-card:hover .profile-avatar {
    border-color: var(--accent);
    box-shadow: 0 0 25px var(--accent-glow);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pin-lock-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #fbbf24;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.profile-name {
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

.motivation-box {
    margin-top: 48px;
    max-width: 680px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 22px;
    text-align: center;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    position: relative;
}

.motivation-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.motivation-text {
    font-size: 14px;
    font-style: italic;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-main);
}

/* SOL PANEL
   Ac/kapa animasyonunda yalnizca GENISLIK degisir. Ikonlar iki modda da ayni
   konumda durur (yer degistirmez), yazilar solarak kirpilir. Boylece panel
   ziplamaz / "zorla aciliyor" gibi gorunmez. */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-sidebar);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px 12px;
    border-right: 1px solid var(--border-color);
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
    position: relative;
}

/* Kisa ekranlarda genis panel kaydirilabilir */
.sidebar:not(.collapsed) { overflow-x: hidden; overflow-y: auto; }
/* Animasyon sirasinda tasan yazilar kirpilir (toggleSidebar ekler/kaldirir) */
.sidebar.sb-animating { overflow: hidden; }

/* DAR MOD (ikon rayi): 72px; uzerine gelince isim balonu (data-tip) */
.sidebar.collapsed {
    width: 72px;
    min-width: 72px;
}

.sb-label,
.nav-item span,
.nav-group-label span {
    white-space: nowrap;
    transition: opacity 0.16s ease 0.06s;
}

.sidebar.collapsed .sb-label,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-group-label span,
.sidebar.collapsed .sb-account-card {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.1s ease, visibility 0s linear 0.1s;
}

.sidebar.collapsed [data-tip] { position: relative; }
.sidebar.collapsed:not(.sb-animating) [data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 16px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card-inner);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: var(--shadow);
    z-index: 300;
    pointer-events: none;
    animation: tipIn 0.12s ease;
}

@keyframes tipIn { from { opacity: 0; } to { opacity: 1; } }

/* Alt basligi olan ogelerde isim balonu yerine alt baslik menusu acilir */
.sidebar.collapsed:not(.sb-animating) .nav-item.has-sub:hover::after { content: none; }

/* Sol panel alt baslik menusu (navFlyout): panelin disinda, sayfanin ustunde */
.nav-flyout {
    position: fixed;
    z-index: 400;
    display: none;
    min-width: 210px;
    max-width: 260px;
    /* koyu temalarda --bg-card-inner yari saydam: opak zeminin ustune bindirilir */
    background: linear-gradient(var(--bg-card-inner), var(--bg-card-inner)), var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 6px;
}
.nav-flyout.open { display: block; animation: tipIn 0.12s ease; }
.nav-flyout-title {
    display: none;
    padding: 6px 10px 6px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}
.nav-flyout.with-title .nav-flyout-title { display: block; }
.nav-flyout-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}
.nav-flyout-item:hover { background: var(--accent); color: #fff; }

/* Yeni Islem: ikonu menu ikonlariyla ayni hizada (dar modda yer degistirmez) */
.sb-new-trade {
    width: 100%;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px dashed var(--accent);
    background: transparent;
    color: var(--text-main);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    overflow: hidden;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.sb-new-trade i { width: 18px; flex-shrink: 0; text-align: center; color: var(--accent); }
.sb-new-trade:hover { background: var(--accent); border-style: solid; color: #fff; }
.sb-new-trade:hover i { color: #fff; }

/* Grup basligi: iki modda AYNI yukseklik (dar modda yazi yerine ince cizgi) */
.nav-group-label {
    position: relative;
    height: 36px;
    padding: 16px 15px 0;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

.nav-group-label::before {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    top: 22px;
    height: 1px;
    background: var(--border-color);
    opacity: 0;
    transition: opacity 0.16s ease;
}

.sidebar.collapsed .nav-group-label::before { opacity: 1; }

/* Canli hesap karti (genis mod): bugunku PnL + gunluk/toplam DD limitleri */
.sb-account-card {
    /* Sabit genislik: dar moda gecerken icerik sikisip yuksekligi ziplamasin */
    width: 235px;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 11px 12px;
    cursor: pointer;
    transition: border-color 0.2s, opacity 0.16s ease 0.06s;
}

.sb-account-card:hover { border-color: var(--accent); }
.sb-account-card:empty { display: none; }

.sb-acc-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.sb-acc-head span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-acc-pnl {
    font-size: 17px;
    font-weight: 800;
    margin: 3px 0 4px;
}

.sb-acc-pnl small { font-size: 11px; font-weight: 700; }

.sb-acc-row {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 7px;
}

.sb-account-card .progress-track { height: 5px; margin-top: 3px; }

.page-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

@keyframes flashFocus {
    0% { box-shadow: 0 0 0 0 var(--accent-glow); }
    30% { box-shadow: 0 0 0 5px var(--accent-glow); }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.flash-focus { animation: flashFocus 1.2s ease; }

/* Sol panel alt basligindan bir karta gidilince: sayfa asagi kayarken kart
   SUREKLI parlak kalir (flash-hold); kayma bitince yavasca soner (flash-fade).
   Sabit sureli animasyon kayma bitmeden sonuyordu. */
.flash-hold { box-shadow: 0 0 0 5px var(--accent-glow); border-color: var(--accent); }

@keyframes flashFade {
    from { box-shadow: 0 0 0 5px var(--accent-glow); border-color: var(--accent); }
    to { box-shadow: 0 0 0 0 transparent; border-color: var(--border-color); }
}

.flash-fade { animation: flashFade 1.4s ease forwards; }

/* Duzenlenip kaydedilen islemin tablodaki satiri (ayni tut, sonra son) */
.row-flash-hold > td { background: var(--accent-glow); }
@keyframes rowFlashFade { from { background: var(--accent-glow); } to { background: transparent; } }
.row-flash-fade > td { animation: rowFlashFade 1.4s ease forwards; }

.brand {
    font-size: 21px;
    letter-spacing: -0.2px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    white-space: nowrap;
}

.brand span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-logo-wrap {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.brand-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    overflow: hidden;
}

.mini-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* SAĞ ÜST OTURUM BANNER VE AÇILIR MENÜSÜ */
.user-banner-wrap {
    position: relative;
    z-index: 200;
}

.user-banner-trigger {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 6px 14px 6px 8px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    user-select: none;
}

.user-banner-trigger:hover {
    border-color: var(--accent);
    box-shadow: 0 0 18px var(--accent-glow);
}

.user-banner-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.user-banner-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-banner-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    max-width: 150px;
}

.user-banner-name {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-banner-sub {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

.user-banner-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: linear-gradient(var(--bg-card-inner), var(--bg-card-inner)), var(--bg-main); /* koyu temada yari saydam zemin opak yapilir */
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    z-index: 300;
}

.user-banner-dropdown.active {
    display: block;
    animation: fadeIn 0.18s ease;
}

.banner-menu-item {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-main);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.15s;
    text-align: left;
}

.banner-menu-item:hover {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.banner-menu-item.danger {
    color: var(--loss);
}

.banner-menu-item.danger:hover {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.3);
}

.banner-menu-item.banner-version {
    color: var(--text-muted);
    font-size: 12px;
    padding: 7px 12px;
}

/* Ayarlar > Motivasyon: cumle havuzu listesi */
.quotes-list { display: flex; flex-direction: column; gap: 8px; }
.quote-row > input { min-width: 0; }
.quote-row { display: flex; gap: 8px; align-items: center; background: var(--bg-card-inner); padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-color); }

/* Ayarlar > Yedekleme: kartlar alt alta (yedek listesi tam genislikte okunur) */
.settings-stack { flex-direction: column; gap: 18px; max-width: 980px; }

/* Ayarlar > Yedekleme: otomatik yedek bilgisi */
.auto-backup-info { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
.auto-backup-info .muted { font-size: 12px; }
.auto-backup-kinds { margin: 6px 0 8px; padding-left: 18px; }
.auto-backup-kinds li { margin: 2px 0; }
.auto-backup-kinds b { color: var(--text-main); }
.auto-backup-title { margin-top: 14px; font-size: 12px; font-weight: 800; color: var(--text-main); }
.auto-backup-table td, .auto-backup-table th { font-size: 12px; white-space: nowrap; }
.auto-backup-table td:first-child { color: var(--text-muted); }
.auto-backup-file { font-size: 10.5px; opacity: .75; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
/* Uc tablo (gunluk / acilis / geri yukleme oncesi) ayni sutun genisliklerinde alt alta */
.auto-backup-table { table-layout: fixed; width: 100%; min-width: 640px; }
.auto-backup-table th:nth-child(1) { width: 22%; }
.auto-backup-table th:nth-child(2) { width: 24%; }
.auto-backup-table th:nth-child(3) { width: 28%; }
.auto-backup-table th:nth-child(4) { width: 26%; }
.auto-backup-table td { overflow: hidden; text-overflow: ellipsis; }
.backup-status { margin-top: 12px; font-size: 12px; font-weight: 700; color: var(--accent); }

/* Ayarlar > Surum Gecmisi */
.version-note { font-size: 12.5px; color: var(--text-muted); margin: 0 0 14px; line-height: 1.5; }
.version-row { border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; content-visibility: auto; contain-intrinsic-size: auto 150px; }
.trade-detail-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.version-row.current { border-color: var(--accent); }
.version-head { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.version-head span { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.version-head em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 800; color: var(--accent); }
.version-row ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }

.server-offline-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99998;
    padding: 10px 16px;
    background: var(--loss);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.server-offline-bar.active {
    display: block;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    padding: 11px 15px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.nav-item i { width: 18px; flex-shrink: 0; text-align: center; }

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 16px var(--accent-glow);
}

/* Dil dugmesi: renk paleti dugmesiyle ayni boyda, yalnizca dil kisaltmasi */
.lang-btn { font-size: 12px; font-weight: 800; letter-spacing: 0.5px; }
.lang-popover { width: 190px; }
.lang-code { font-size: 11px; font-weight: 800; color: var(--text-muted); }

.theme-btn, .icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: 0.2s;
}

.theme-btn:hover, .icon-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.palette-popover {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    background: linear-gradient(var(--bg-card-inner), var(--bg-card-inner)), var(--bg-main); /* koyu temada yari saydam zemin opak yapilir */
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px;
    box-shadow: var(--shadow);
    z-index: 100;
    backdrop-filter: blur(16px);
}

.palette-popover.active {
    display: block;
    animation: fadeIn 0.18s ease;
}

.palette-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    border: 1px solid transparent;
    margin-bottom: 4px;
    transition: 0.15s;
}

.palette-option:last-child { margin-bottom: 0; }
.palette-option:hover { background: var(--bg-card); }
.palette-option.active {
    border-color: var(--accent);
    background: var(--bg-card);
}

.swatch-pair {
    display: flex;
    align-items: center;
    gap: 4px;
}

.swatch-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.35);
}

.main-content {
    flex: 1;
    padding: 20px 26px;
    overflow-y: auto;
    min-width: 0;
}

/* Gizli sayfalar display:none yerine content-visibility:hidden ile saklanir:
   yer kaplamaz ve cizilmez, ama tarayici yerlesimini hafizada tutar; geri
   donus anlik olur. Gecis animasyonu yalnizca opaklik (ucuz ve akici). */
.page { content-visibility: hidden; }
.page.active { content-visibility: visible; animation: pageIn 0.16s ease; }

@keyframes pageIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 12px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
}

.compact-single-line-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 8px 10px;
    border-radius: 12px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: nowrap;
    width: 100%;
    margin-bottom: 12px;
    overflow-x: auto;
}

.compact-single-line-bar .filter-group {
    flex: 1 1 0;
    min-width: 68px;
}

.compact-single-line-bar .filter-group label {
    font-size: 9px;
    white-space: nowrap;
}

.compact-single-line-bar select,
.compact-single-line-bar input {
    padding: 6px 5px;
    font-size: 11px;
    width: 100%;
    min-width: 0;
}

.compact-single-line-bar .btn {
    padding: 7px 9px;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
    height: 31px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.file-hint {
    font-size: 9.5px;
    color: var(--text-muted);
    opacity: 0.85;
    font-weight: 500;
    text-transform: none;
}

input, select, textarea {
    background: var(--input-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border 0.2s;
}

input:focus, select:focus {
    border-color: var(--accent);
}

.btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 9px 15px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn:hover { background: var(--accent-hover); }
.btn-secondary { background: rgba(148, 163, 184, 0.16); color: var(--text-main); border: 1px solid var(--border-color); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-success { background: var(--profit); }
.btn-word { background: #2563eb; color: #fff; }
.btn-word:hover { background: #1d4ed8; }
.btn-danger { background: var(--loss); padding: 6px 9px; font-size: 12px; }
.btn-edit { background: var(--warning); padding: 6px 9px; font-size: 12px; color: #fff; }

/* Izgaralar sabit sutun sayisi yerine "sigdigi kadar sutun" kullanir: genis ekranda
   gorunum aynidir, dar pencerede (1024 px, tablet) kartlar tasmak yerine alt satira iner. */
.kpi-grid-6 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.kpi-grid-5 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.kpi-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 21px;
    font-weight: 800;
}

.kpi-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.prop-status-strip {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px 18px;
    margin-bottom: 18px;
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    box-shadow: var(--shadow);
}

.progress-track {
    width: 100%;
    height: 8px;
    background: var(--bg-card-inner);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 6px;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.35s ease;
}

.trade-checklist-box {
    display: none;
    background: var(--bg-card-inner);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.trade-checklist-box.active {
    display: block;
    animation: fadeIn 0.18s ease;
}

.trade-checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.mini-check-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.15s;
}

.mini-check-pill.checked {
    border-color: var(--profit);
    background: rgba(16, 185, 129, 0.14);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 18px;
}

.reports-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow);
    /* backdrop-filter kaldirildi: arka plan duz renk oldugu icin gorsel fark yoktu,
       ama her animasyon karesinde tum kartlari yeniden bulaniklastirip kasma yapiyordu */
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
    flex-wrap: wrap;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.cal-day {
    background: var(--bg-card-inner);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    min-height: 66px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 12px;
}

.cal-day.empty { background: transparent; border-color: transparent; }
.cal-day.win { background: rgba(16, 185, 129, 0.15); border-color: var(--profit); }
.cal-day.loss { background: rgba(244, 63, 94, 0.15); border-color: var(--loss); }

.cal-date { font-weight: 700; font-size: 11px; opacity: 0.75; }
.cal-pnl { font-weight: 800; font-size: 12px; text-align: right; }
.cal-count { font-size: 10px; color: var(--text-muted); text-align: right; }

.form-grid-5 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 11px;
    margin-bottom: 11px;
}

.form-row-bottom {
    display: grid;
    grid-template-columns: 1.3fr 1.1fr 1.6fr auto;
    gap: 11px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0; /* yan yana alanlarda kutular dar pencerede tasmadan daralabilsin */
}

.form-group input,
.form-group select { min-width: 0; }

.form-group label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auto-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--accent-glow);
    color: var(--text-main);
    font-weight: 700;
    text-transform: none;
}

.table-container { overflow-x: auto; margin-top: 8px; }

/* Aksiyon butonlari hucrenin ICINDEKI kutuda yan yana durur; hucrenin kendisi
   tablo hucresi kalir (td'ye display:flex verilince alt cizgisi satirdan kayiyordu). */
.cell-actions { display: flex; gap: 5px; align-items: center; }
.cell-actions-td { white-space: nowrap; }

/* Raporlar alt sirasi: maliyet ve kacirilan ozeti diger analiz kartlari boyutunda
   (auto-fill: iki kart olsa bile her biri ucte bir genislikte kalir) */
.reports-grid-fixed { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.reports-grid-fixed .cost-overview { grid-template-columns: 1fr; gap: 12px; }
.reports-grid-fixed .cost-stats,
.reports-grid-fixed .missed-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reports-grid-fixed .cost-stat b,
.reports-grid-fixed .missed-stat b { font-size: 15px; }

/* "Kacirilan" dugmesi acik olan rapor karti */
.missed-toggle { padding: 3px 8px; font-size: 11px; }
.card.missed-mode { border-style: dashed; border-color: var(--accent); }

/* Iki secenekli kucuk anahtar (Kacirilan Ozeti: Tablo / Grafik) */
.seg-toggle { display: inline-flex; border: 1px solid var(--border-color); border-radius: 7px; overflow: hidden; }
.seg-toggle button { background: transparent; border: 0; color: var(--text-muted); font-size: 11px; font-weight: 700; padding: 3px 10px; cursor: pointer; }
.seg-toggle button + button { border-left: 1px solid var(--border-color); }
.seg-toggle button.active { background: var(--accent); color: #fff; }

/* Kacirilan nedenleri cubuk grafigi */
.missed-bars { margin-top: 12px; display: flex; flex-direction: column; gap: 9px; }
.missed-bar-row { display: grid; grid-template-columns: minmax(0, 118px) minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12px; }
.missed-bar-label { font-weight: 700; line-height: 1.25; }
.missed-bar-label small { color: var(--text-muted); font-weight: 700; margin-left: 2px; }
.missed-bar-track { height: 12px; background: var(--input-bg); border-radius: 4px; overflow: hidden; }
.missed-bar { display: block; height: 100%; border-radius: 4px; }
.missed-bar.pos { background: var(--profit); }
.missed-bar.neg { background: var(--loss); }
.missed-bar-row b { font-size: 12px; white-space: nowrap; min-width: 44px; text-align: right; }
.missed-bar-row b.pos, .missed-curve-total.pos { color: var(--profit); }
.missed-bar-row b.neg, .missed-curve-total.neg { color: var(--loss); }

/* Kacirilan islem penceresi: istege bagli fiyatlar (giris / SL / TP / cikis) */
.mt-price-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mt-price-grid input { width: 100%; min-width: 0; }
.mt-price-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; min-height: 0; }
.mt-price-hint.warn { color: var(--loss); font-weight: 700; }

/* Kacirilan R egrisi karti */
.missed-curve-wrap { position: relative; height: 220px; }
.missed-curve-total { font-size: 15px; font-weight: 800; }

/* Islem Paneli "Ice Aktar" acilir menusu */
.import-menu { position: relative; }
.import-menu-list {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    padding: 8px;
    margin-top: 0;
    background: linear-gradient(var(--bg-card-inner), var(--bg-card-inner)), var(--bg-main); /* koyu temada yari saydam zemin opak yapilir */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 150;
}
/* Liste butonun hemen altinda baslar (bosluk yok): fare asagi inerken menu kapanmaz */
.import-menu:hover .import-menu-list,
.import-menu.open .import-menu-list { display: block; }
.table-more { display: flex; justify-content: center; }
.table-more:not(:empty) { margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--border-color); }
th { font-size: 10px; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
tr:hover { background: rgba(255,255,255,0.03); }

.badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
}
.badge-long { background: rgba(16, 185, 129, 0.18); color: var(--profit); }
.badge-short { background: rgba(244, 63, 94, 0.18); color: var(--loss); }
.badge-neutral { background: rgba(148, 163, 184, 0.18); color: var(--text-muted); }
.badge-warn { background: rgba(245, 158, 11, 0.18); color: var(--warning); cursor: pointer; }

/* Hizli islem girisi penceresi */
.qt-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.qt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.qt-dir { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.qt-dir-btn {
    padding: 8px 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-muted);
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    transition: 0.15s;
}

.qt-dir-btn.long.active { background: rgba(16, 185, 129, 0.18); border-color: var(--profit); color: var(--profit); }
.qt-dir-btn.short.active { background: rgba(244, 63, 94, 0.18); border-color: var(--loss); color: var(--loss); }

.qt-pnl { font-size: 20px; font-weight: 800; padding: 10px 12px; }

/* Kaydederken eksik kalan kritik alanlar */
input.field-missing,
input.field-missing:focus {
    border-color: var(--loss);
    box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.25);
}

/* PARCALI CIKIS paneli (Sonuc durumu "Parcali cikis" iken) */
.partial-panel {
    display: none;
    background: var(--bg-card-inner);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.partial-panel.active { display: block; animation: fadeIn 0.15s ease; }

.partial-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.partial-title { font-size: 11px; font-weight: 800; color: var(--accent); }
.partial-presets { display: flex; gap: 6px; flex-wrap: wrap; }

.chip-btn {
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 7px;
    padding: 4px 9px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.15s;
}

.chip-btn:hover { border-color: var(--accent); color: var(--text-main); }
.chip-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.partial-row {
    display: grid;
    grid-template-columns: 62px 78px auto 130px minmax(110px, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 12px;
}

.partial-idx { font-weight: 800; color: var(--text-muted); }
.partial-pct { display: flex; align-items: center; gap: 4px; }
.partial-pct input { width: 58px; padding: 6px 8px; }
.partial-levels { display: flex; gap: 4px; flex-wrap: wrap; }
.partial-price { padding: 6px 8px; }
.partial-pnl { font-weight: 800; white-space: nowrap; }
.partial-pnl.pos, .partial-summary .pos { color: var(--profit); }
.partial-pnl.neg, .partial-summary .neg { color: var(--loss); }
.partial-summary .muted { color: var(--text-muted); }

.partial-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.partial-slider { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.partial-slider input { width: 140px; padding: 0; }
.partial-summary { margin-left: auto; font-size: 12.5px; }

.partial-row .btn-danger { justify-self: end; }

/* Dar ekranda seviye butonlari alt satira iner; sil butonu ilk satirda kalir */
@media (max-width: 1100px) {
    .partial-row { grid-template-columns: 62px 78px 1fr auto auto; }
    .partial-levels { grid-column: 1 / -1; order: 5; }
}

.detail-partials {
    background: var(--bg-card-inner);
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 12.5px;
}

.detail-partial-row {
    display: grid;
    grid-template-columns: 70px 1fr 1fr auto;
    gap: 8px;
    padding: 5px 0;
    border-top: 1px dashed var(--border-color);
}

.detail-partials .detail-rating-label { margin-bottom: 6px; }

/* MALIYET satiri (islem formu): brut -> komisyon -> swap -> net */
.cost-line {
    display: none;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    padding: 9px 12px;
    margin-bottom: 12px;
    border-radius: 10px;
    background: var(--bg-card-inner);
    border: 1px dashed var(--border-color);
    font-size: 12.5px;
}

.cost-line.active { display: flex; }
.cost-line.manual .cost-swap { display: none; }
.cost-line .pos { color: var(--profit); }
.cost-line .neg { color: var(--loss); }
.cost-line .muted, .cost-note { color: var(--text-muted); }
.cost-note:empty { display: none; }
.cost-swap { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); font-weight: 700; }
.cost-swap input { width: 90px; padding: 5px 8px; }
#costNet { margin-left: auto; }

.detail-costs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    background: var(--bg-card-inner);
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 12.5px;
}

/* MALIYET ANALIZI (Raporlar) */
.cost-overview { display: grid; grid-template-columns: 1fr 230px; gap: 20px; align-items: center; }
.cost-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cost-stat { background: var(--bg-card-inner); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.cost-stat span { font-size: 10.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.cost-stat b { font-size: 17px; font-weight: 800; }
.cost-stat.total { border: 1px solid var(--accent); }
.cost-stats .pos { color: var(--profit); }
.cost-stats .neg { color: var(--loss); }
.cost-stat-note { grid-column: 1 / -1; font-size: 12.5px; line-height: 1.6; }
.cost-stat-note .muted { color: var(--text-muted); font-size: 11.5px; }
.cost-chart-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cost-chart-note { font-size: 11.5px; color: var(--text-muted); text-align: center; }
.cost-chart-note:empty { display: none; }

@media (max-width: 900px) {
    .cost-overview { grid-template-columns: 1fr; }
    .cost-stats { grid-template-columns: repeat(2, 1fr); }
}

/* KACIRILAN ISLEMLER */
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn.outcome-tp.active { background: var(--profit); border-color: var(--profit); }
.chip-btn.outcome-sl.active { background: var(--loss); border-color: var(--loss); }
.chip-btn.outcome-be.active { background: var(--text-muted); border-color: var(--text-muted); }

.missed-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.missed-stat { background: var(--bg-card-inner); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.missed-stat span { font-size: 10.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.missed-stat b { font-size: 18px; font-weight: 800; }
.missed-stat small { font-size: 11.5px; color: var(--text-muted); }
.missed-stat.total { border: 1px solid var(--accent); }
.missed-stats .pos { color: var(--profit); }
.missed-stats .neg { color: var(--loss); }
.missed-verdict { grid-column: 1 / -1; font-size: 12.5px; line-height: 1.6; }
.missed-verdict i { color: var(--accent); }
.missed-empty { grid-column: 1 / -1; font-size: 12.5px; color: var(--text-muted); }

/* YONETIM ANALIZI: formdaki "Dokunmasaydim ne olurdu?" satiri, rapor karti ve islem ayrintisi */
.untouched-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 2px 0 12px; }
.untouched-label { font-size: 10.5px; font-weight: 800; color: var(--text-muted); letter-spacing: 0.3px; margin-right: 4px; }
.untouched-row .cost-note { flex-basis: 100%; }
.mgmt-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reports-grid-fixed .mgmt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reports-grid-fixed .mgmt-stats .total { grid-column: 1 / -1; }
.mgmt-table th { font-size: 10px; }
.mgmt-table td, .mgmt-table th { padding: 7px 5px; }
.mgmt-table td { font-size: 12px; white-space: nowrap; }
.mgmt-table td:first-child { white-space: normal; }
.mgmt-table td small { color: var(--text-muted); font-size: 10.5px; }
.mgmt-table td:not(:first-child), .mgmt-table th:not(:first-child) { text-align: right; }
.detail-untouched { background: var(--bg-card-inner); padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; font-size: 12.5px; }
.detail-untouched i { color: var(--accent); margin-right: 4px; }

@media (max-width: 900px) {
    .missed-stats { grid-template-columns: repeat(2, 1fr); }
}

/* TP/SL secilince kilitlenen cikis fiyati */
#trExit:disabled { opacity: 0.65; cursor: not-allowed; }
#exitLockBadge:empty { display: none; }

/* SL / TP noktasindaki kar-zarar rozetleri ve lot modu rozeti */
.pnl-badge:empty { display: none; }
.pnl-badge.profit { background: rgba(16, 185, 129, 0.18); color: var(--profit); }
.pnl-badge.loss { background: rgba(244, 63, 94, 0.18); color: var(--loss); }
.pnl-badge.warn { outline: 1px dashed var(--warning); outline-offset: 1px; }
#lotModeBadge:empty { display: none; }
#lotModeBadge.is-manual { cursor: pointer; background: rgba(245, 158, 11, 0.22); color: var(--warning); }

/* ISLEM DEGERLENDIRME: 10 yildiz. DOM'da 10->1 sirali, row-reverse ile 1->10 gorunur;
   boylece uzerine gelinen yildiz ve solundakiler (~ kardes secicisi) birlikte dolar. */
.form-header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rating-picker { display: flex; align-items: center; gap: 8px; }
.rating-label { font-size: 12px; font-weight: 800; color: var(--text-muted); min-width: 48px; }

.star-rating { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star { position: relative; display: inline-block; font-size: 15px; line-height: 1; color: var(--warning); }
.star > i { opacity: 0.45; }
.star-fill { position: absolute; left: 0; top: 0; height: 100%; overflow: hidden; white-space: nowrap; pointer-events: none; }
.star-rating.interactive .star { cursor: pointer; transition: transform 0.1s; }
/* Uzerine gelince onizleme yalnizca fareli cihazda: dokunmatik ekranda "hover" son dokunulan
   yildizda takili kalir ve silinen puan hala dolu gorunurdu */
@media (hover: hover) {
    .star-rating.interactive .star:hover { transform: scale(1.18); }
    .star-rating.interactive:hover .star .star-fill { width: 0 !important; }
    .star-rating.interactive:hover .star:hover .star-fill,
    .star-rating.interactive:hover .star:hover ~ .star .star-fill { width: 100% !important; }
}
/* Hizli giris penceresindeki yildizlar: satira yayilir, parmakla basilacak kadar buyuk.
   .star'a ic bosluk verilmez (dolgu katmani kayar); dokunma alani ::before ile buyur */
.qt-rating-row { margin-bottom: 10px; }
.qt-stars { display: flex; justify-content: space-between; gap: 0; padding: 4px 2px; }
.qt-stars .star { font-size: 24px; }
.qt-stars .star::before { content: ''; position: absolute; inset: -9px -5px; }
.star-rating.large .star { font-size: 26px; }

.detail-rating {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--bg-card-inner);
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 13px;
}

.detail-rating-label { font-size: 10px; font-weight: 800; color: var(--text-muted); }

.rating-overview { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.rating-overview-avg { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.rating-avg-text { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
.rating-avg-text b { font-size: 26px; color: var(--text-main); }
.rating-chip { color: var(--warning); font-weight: 800; white-space: nowrap; }

@media (max-width: 900px) {
    .rating-overview { grid-template-columns: 1fr; }
}

/* TILT / INTIKAM MODU KESICISI */
.tilt-banner {
    margin: -2px 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(244, 63, 94, 0.14);
    border: 1px solid var(--loss);
    color: var(--loss);
    font-size: 12.5px;
    font-weight: 600;
}

.tilt-banner:empty { display: none; }

#tradeFormCard.tilt-warning {
    border-color: var(--loss);
    box-shadow: 0 0 0 1px var(--loss), 0 0 24px rgba(244, 63, 94, 0.25);
}

body.tilt-active .new-trade-btn,
body.tilt-active .mobile-add-btn {
    background: var(--loss) !important;
    border: 1px solid var(--loss) !important;
    color: #fff !important;
    animation: tiltPulse 1.8s ease-in-out infinite;
}

body.tilt-active .new-trade-btn i { color: #fff !important; }

@keyframes tiltPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.55); }
    50% { box-shadow: 0 0 0 6px rgba(244, 63, 94, 0); }
}

.tilt-dialog { max-width: 450px; border: 1px solid var(--loss); text-align: center; }
.tilt-icon { font-size: 36px; color: var(--loss); margin-bottom: 10px; }
.tilt-title { font-size: 18px; font-weight: 800; line-height: 1.35; margin-bottom: 12px; }
.tilt-detail { display: flex; flex-direction: column; gap: 6px; font-size: 13px; background: rgba(244, 63, 94, 0.12); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.tilt-hint { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.tilt-stop-btn { background: var(--loss); }
.tilt-stop-btn:hover { background: var(--loss); filter: brightness(1.1); }
.qt-error { min-height: 16px; font-size: 12px; font-weight: 700; color: var(--loss); }

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    flex-wrap: wrap;
}
.tab-btn {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.manage-grid { display: grid; grid-template-columns: 1fr 1.8fr; gap: 18px; }
.manage-grid-equal { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Dar pencerede iki sutunlu duzenler alt alta dizilir; tablolar kendi icinde kayar */
@media (max-width: 1200px) {
    .dashboard-grid,
    .manage-grid,
    .manage-grid-equal { grid-template-columns: minmax(0, 1fr); }
    .form-row-bottom { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .prop-status-strip { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important; }
}

.dashboard-grid > *, .manage-grid > *, .manage-grid-equal > *, .reports-grid-3 > * { min-width: 0; }

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    z-index: 9500;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(6px);
}
.modal.active { display: flex; }
.modal img { max-width: 92%; max-height: 90vh; border-radius: 12px; }

.dialog-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 26px;
    width: 100%;
    max-width: 390px;
    box-shadow: var(--shadow);
    text-align: center;
}

/* Pencere kapatma: "Kapat" yazisi yerine carpi simgesi */
.modal-close-btn {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    transition: 0.15s;
}
.modal-close-btn:hover { color: var(--loss); border-color: var(--loss); background: rgba(244, 63, 94, 0.1); }
/* Basligi olmayan pencerelerde sag ust kose */
.modal-close-corner { position: absolute; top: 14px; right: 14px; }

/* Metin gibi gorunen dugme ("Şifremi Unuttum", "Bu işleme girmedin mi?" vb.).
   Eskiden iki ayri tanim birbirini eziyordu; gorunum degismeden tek tanimda birlesti. */
.link-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
    margin-top: 12px;
}
.link-btn:hover { color: var(--accent); }
/* Cakisma secim penceresi (ayni kayit iki sekmede/cihazda farkli degistiyse) */
.dialog-card.merge-card { max-width: 620px; text-align: left; max-height: 90vh; overflow-y: auto; }
.merge-intro { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.merge-list { display: flex; flex-direction: column; gap: 12px; }
.merge-item { border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; }
.merge-item-title { font-weight: 800; font-size: 13px; margin-bottom: 8px; }
.merge-prof { font-weight: 600; font-size: 11px; color: var(--text-muted); margin-left: 6px; }
.merge-diff { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 10px; table-layout: fixed; }
.merge-diff th { text-align: left; font-size: 11px; color: var(--text-muted); font-weight: 700; padding: 4px 6px; }
.merge-diff td { padding: 4px 6px; border-top: 1px solid var(--border-color); overflow-wrap: anywhere; }
.merge-diff td:first-child, .merge-diff th:first-child { width: 28%; color: var(--text-muted); }
.merge-choose, .merge-all { display: flex; gap: 8px; }
.merge-choose .btn, .merge-all .btn { flex: 1; justify-content: center; }
.merge-all { margin-top: 14px; }

/* Hesap modu (internet surumu): giris / hesap acma / yeni sifre ekranlari */
#accountGate .master-login-card { text-align: center; }
.acc-gate-logo { width: 72px; height: 72px; font-size: 30px; border-radius: 20px; }
.acc-gate-title { font-size: 21px; font-weight: 800; margin-bottom: 4px; }
.acc-gate-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 18px; line-height: 1.5; }
.acc-field { text-align: left; margin-bottom: 12px; }
.acc-remember { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin: 2px 0 14px; cursor: pointer; text-align: left; }
.acc-remember input { width: auto; margin: 0; }
.acc-main-btn { width: 100%; justify-content: center; padding: 11px; }
.acc-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.acc-hint { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; margin: 10px 0 14px; text-align: left; }
.acc-code-input { font-family: Consolas, monospace; letter-spacing: 1px; text-transform: uppercase; }
.acc-key-icon { font-size: 26px; color: var(--accent); margin-bottom: 8px; }

/* Ayarlar > Hesaplar (yonetici) */
.adm-usage { font-size: 12px; color: var(--text-muted); }
.adm-usage.warn { color: var(--loss); font-weight: 700; }
.adm-invites { border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.adm-invites-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-sub-title { font-weight: 800; font-size: 13px; }
.adm-note { font-size: 11.5px; color: var(--text-muted); margin: 8px 0 0; line-height: 1.5; }
.adm-invite-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--border-color); margin-top: 8px; font-size: 12.5px; }
.adm-invite-code { font-family: Consolas, monospace; font-size: 14px; letter-spacing: 1px; font-weight: 700; }
.adm-temp-box { border: 1px solid var(--accent); border-radius: 12px; padding: 12px; margin-bottom: 14px; font-size: 13px; line-height: 1.6; }
.adm-table td, .adm-table th { white-space: nowrap; }
.adm-btns { display: flex; gap: 6px; justify-content: flex-end; }
.adm-btns .btn { padding: 5px 10px; font-size: 11.5px; }
.adm-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; border: 1px solid var(--border-color); }
.adm-tag.admin { color: var(--accent); border-color: var(--accent); }
.adm-tag.active { color: var(--profit); border-color: var(--profit); }
.adm-tag.wait { color: #d97706; border-color: #d97706; }
.adm-tag.closed { color: var(--text-muted); }

/* =====================================================================
   TELEFON (Asama 5B): yalnizca 767 px ve alti. Bilgisayar ve tablet degismez.
   Sol panel gizlenir; yerine alt menu (Ana Sayfa, Islemler, +, Raporlar, Menu) ve
   alttan acilan menu gelir. Ust seritte logo, sayfa adi ve profil kalir; dil, renk ve
   tema menuye tasinir. Islem tablosu kart kart, pencereler tam ekran.
   ===================================================================== */
.mobile-nav, .mobile-menu, .mobile-page-title, .mf-toggle, .mobile-add-btn, .mobile-fan { display: none; }
#sidebarLogoBox { cursor: pointer; }

/* Tablet ve dar pencere: islem tablosunun tek satirlik filtreleri sigmayinca alt satira iner
   (768 px'te sagdan tasiyordu; genis ekranda tek satir aynen kalir) */
@media (max-width: 1100px) {
    .compact-single-line-bar { flex-wrap: wrap; }
    .compact-single-line-bar .filter-group { flex: 1 1 110px; max-width: none !important; }
}

@media (max-width: 767px) {
    /* Adres cubugu acilip kapaninca alt menu ekranin disinda kalmasin */
    body { height: 100vh; height: 100dvh; }

    .app-header {
        height: calc(56px + env(safe-area-inset-top));
        min-height: calc(56px + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) 12px 0;
        gap: 10px;
    }
    .app-header-left { flex: 1; min-width: 0; }
    .brand { gap: 10px; }
    .brand-logo-wrap { width: 36px; height: 36px; min-width: 36px; border-radius: 10px; font-size: 16px; }
    #sidebarFolderName { display: none; }
    .mobile-page-title { display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
    .app-header-right > .header-palette-wrap,
    .app-header-right > .theme-btn { display: none; }
    .user-banner-info, .user-banner-trigger > .fa-chevron-down { display: none; }
    .user-banner-trigger { padding: 4px; border-radius: 12px; }

    .sidebar, .sb-edge-toggle, .nav-flyout { display: none !important; }
    .main-content { padding: 12px 12px calc(92px + env(safe-area-inset-bottom)); }

    /* Sayfa basligi ust seritte yaziyor; filtreler iki sutun */
    .page-header { margin-bottom: 12px; }
    .page-header .page-title { display: none; }
    .filter-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; padding: 10px; }
    .filter-bar > .filter-group:first-child { grid-column: 1 / -1; }
    .filter-bar > .btn { justify-content: center; }
    .filter-group { min-width: 0; }
    .filter-group > input, .filter-group > select { width: 100%; }
    /* Islem ve kacirilan islem tablolarinin tek satirlik filtreleri de iki sutun */
    .compact-single-line-bar { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .compact-single-line-bar > .filter-group { max-width: none !important; }
    .compact-single-line-bar > .btn { justify-content: center; }

    /* Filtreler gizli; "Filtrele" dugmesiyle acilir (toggleFilterPanel) */
    .mf-panel:not(.mf-open) { display: none !important; }
    .btn.mf-toggle { display: flex; width: 100%; justify-content: center; min-height: 44px; }
    .mf-count:empty { display: none; }
    .mf-count { min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; }
    .mf-chevron { font-size: 11px; transition: transform 0.15s; }
    .mf-toggle.open .mf-chevron { transform: rotate(180deg); }
    .compact-single-line-bar.mf-open { margin-top: 10px; }
    .card > .mf-toggle { margin-bottom: 10px; }
    /* Ana Sayfa: sira KPI kartlari > Filtrele > acilan filtre > diger kartlar */
    #page-dashboard { display: flex; flex-direction: column; }
    #page-dashboard > * { order: 5; }
    #page-dashboard > .kpi-grid-6 { order: 1; }
    #page-dashboard > .mf-toggle { order: 2; margin-bottom: 12px; }
    #page-dashboard > .page-header { order: 3; margin-bottom: 0; }
    #page-dashboard .mf-panel.mf-open { margin-bottom: 12px; }
    #page-reports > .page-header { gap: 8px; }

    /* Ice Aktar: listeyi dugmeye degil butun satira hizala (soldan tasiyordu);
       dokunmada :hover yapisip menuyu kapatmayi engellemesin diye yalnizca .open acar */
    #page-trades > .page-header > div { position: relative; }
    .import-menu { position: static; }
    .import-menu-list { left: 0; right: 0; min-width: 0; }
    .import-menu:hover:not(.open) .import-menu-list { display: none; }
    /* Islem formunun alt satiri: Checklist ve Kaydet dugmeleri tam genislikte, yan yana */
    .form-row-bottom > :last-child { grid-column: 1 / -1; }
    .form-row-bottom > :last-child > .btn { flex: 1; justify-content: center; height: auto !important; min-height: 46px; }
    /* Takvim: 7 sutun ekrana sigar, hucreler kucuk */
    .calendar-weekdays, .calendar-days { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
    .cal-day { min-height: 50px; padding: 4px 3px; border-radius: 7px; }
    .cal-date { font-size: 10px; }

    .card { padding: 14px; border-radius: 14px; }
    .kpi-grid-6, .kpi-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .kpi-value { font-size: 18px; overflow-wrap: anywhere; }
    .cal-pnl { font-size: 9px; letter-spacing: -0.2px; overflow-wrap: anywhere; }
    .cal-count { font-size: 8.5px; }
    .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .tab-btn { flex-shrink: 0; }

    /* Dokunma: kutular ve dugmeler parmaga gore; yazi 16 px (iPhone kutuya
       dokununca sayfayi kendiliginden buyutmesin) */
    .app-body input, .app-body select, .app-body textarea,
    .modal input, .modal select, .modal textarea { font-size: 16px; }
    .app-body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),
    .modal input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),
    .app-body select, .modal select { min-height: 44px; }
    .btn { min-height: 40px; }
    /* Giris, kayit ve profil secme ekranlari (.app-body disinda): kutuda yazi 16 px olmali, yoksa
       iPhone kutuya dokununca sayfayi kendiliginden buyutur; kutu ve dugme parmaga gore */
    body:not(.app-unlocked) input:not([type=checkbox]):not([type=radio]):not([type=file]) { font-size: 16px; min-height: 44px; }
    body:not(.app-unlocked) .btn { min-height: 44px; }

    /* Islem tablosu: her satir bir kart (sembol + yon + R / tarih + PnL / strateji / dugmeler).
       Seans, hesap, lot ve fiyatlar karta sigmasin diye gizli; goz dugmesi hepsini gosterir. */
    .trades-table thead { display: none; }
    .trades-table, .trades-table tbody { display: block; width: 100%; }
    .trades-table tr {
        display: grid;
        grid-template-columns: auto auto minmax(0, 1fr) auto;
        grid-template-areas: "sym dir . r" "date date date pnl" "strat strat strat strat" "act act act act";
        column-gap: 8px;
        row-gap: 3px;
        padding: 11px 12px;
        margin-bottom: 8px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        background: var(--bg-card-inner);
    }
    .trades-table td { display: block; padding: 0; border: 0; min-width: 0; }
    .trades-table td:nth-child(2), .trades-table td:nth-child(3),
    .trades-table td:nth-child(7), .trades-table td:nth-child(8) { display: none; }
    .trades-table td:nth-child(1) { grid-area: date; font-size: 12px; }
    .trades-table td:nth-child(4) { grid-area: sym; font-size: 15px; align-self: center; }
    .trades-table td:nth-child(5) { grid-area: strat; font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .trades-table td:nth-child(5) br, .trades-table td:nth-child(5) small { display: none; }
    .trades-table td:nth-child(6) { grid-area: dir; align-self: center; }
    .trades-table td:nth-child(9) { grid-area: r; text-align: right; font-size: 15px; align-self: center; }
    .trades-table td:nth-child(10) { grid-area: pnl; text-align: right; }
    .trades-table td:nth-child(11) { grid-area: act; }
    .trades-table .cell-actions { justify-content: flex-end; margin-top: 6px; }
    .trades-table .cell-actions .btn { min-height: 36px; min-width: 40px; justify-content: center; }

    /* Alt menu */
    .mobile-nav {
        display: flex;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 9000;
        align-items: center;
        justify-content: space-around;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        background: linear-gradient(var(--bg-card), var(--bg-card)), var(--bg-main);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.22);
    }
    .mnav-item {
        flex: 1;
        min-height: 50px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: none;
        border: 0;
        color: var(--text-muted);
        font-size: 10.5px;
        font-weight: 700;
        cursor: pointer;
    }
    .mnav-item i { font-size: 18px; }
    .mnav-item.active { color: var(--accent); }
    .mnav-plus {
        width: 56px; height: 56px;
        flex-shrink: 0;
        margin: -26px 4px 0;
        border-radius: 50%;
        border: 4px solid var(--bg-main);
        background: var(--accent);
        color: #fff;
        font-size: 22px;
        cursor: pointer;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    }

    .mnav-plus i { transition: transform 0.2s ease; }
    .mnav-plus.open i { transform: rotate(90deg); }

    /* Sag ustteki hizli islem (+): her sayfada */
    .mobile-add-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px; height: 40px;
        flex-shrink: 0;
        border: 0;
        border-radius: 12px;
        background: var(--accent);
        color: #fff;
        font-size: 18px;
        cursor: pointer;
        box-shadow: 0 4px 12px var(--accent-glow);
    }

    /* Yelpaze: alt menunun ustunde karartma + yay seklinde 5 oge */
    .mobile-fan {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 8900;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s;
    }
    .mobile-fan.open { opacity: 1; pointer-events: auto; }
    .mfan-item {
        position: fixed;
        left: 50%;
        bottom: calc(64px + env(safe-area-inset-bottom));
        width: 78px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        background: none;
        border: 0;
        padding: 0;
        color: #fff;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        opacity: 0;
        transform: translate(-50%, 50%) scale(0.3);
        transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.18s;
    }
    .mobile-fan.open .mfan-item { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(50% - var(--dy))) scale(1); }
    .mfan-icon {
        width: 50px; height: 50px;
        border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        background: linear-gradient(var(--bg-card), var(--bg-card)), var(--bg-main);
        border: 1px solid var(--accent);
        color: var(--accent);
        font-size: 19px;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    }
    .mfan-label { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); white-space: nowrap; }
    .mfan-1 { --dx: -112px; --dy: 42px; }
    .mfan-2 { --dx: -70px; --dy: 120px; transition-delay: 0.02s; }
    .mfan-3 { --dx: 0px; --dy: 152px; transition-delay: 0.04s; }
    .mfan-4 { --dx: 70px; --dy: 120px; transition-delay: 0.06s; }
    .mfan-5 { --dx: 112px; --dy: 42px; transition-delay: 0.08s; }

    /* KAYDIRMA TAKILMASI (kullanici 2026-11-11, Android Opera: Yedekleme ve Surum Gecmisi'nde
       sayfa donuyor, azar azar kayiyordu). Olcum: bostayken hicbir sey yeniden cizilmiyor, yerlesim
       1-3 ms; sorun dokunmatik kaydirmada. Uc onlem:
       1) Yana kayan kutular (tablolar, sekme seridi) dikey hareketi kendine cekmesin.
       2) (Kaldirildi, kullanici karari 2026-11-11: asagi cekip sayfayi yenileme calismali; overscroll-behavior ekleme.)
       3) Kapali menu ve yelpaze tam ekran katman olarak bellekte durmasin (visibility: hidden). */
    .table-container, .tabs { overflow-y: hidden; overscroll-behavior-x: contain; }
    .mobile-fan:not(.open), .mobile-menu:not(.open) { visibility: hidden; transition: opacity 0.2s, visibility 0s 0.25s; }
    .card { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16); }
    .trade-detail-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* Motivasyon cumlesi: yazi kutusu tam genislikte ustte, dugmeler altinda */
    .quote-row { flex-wrap: wrap; }
    .quote-row > input { flex: 1 1 100% !important; order: -1; }
    /* Yeni cumle satiri: kutu daralabilsin, Ekle dugmesi kucuk (360 px ekranda tasiyordu) */
    #set-mot input { min-width: 0; }
    #set-mot [data-click="addCustomQuote"] { padding: 8px 10px; font-size: 12px; flex-shrink: 0; }

    /* Alttan acilan menu */
    .mobile-menu {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 9400;
        background: rgba(0, 0, 0, 0.55);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s;
    }
    .mobile-menu.open { opacity: 1; pointer-events: auto; }
    .mobile-menu-sheet {
        position: absolute;
        left: 0; right: 0; bottom: 0;
        max-height: 88dvh;
        overflow-y: auto;
        background: linear-gradient(var(--bg-card), var(--bg-card)), var(--bg-main);
        border-top: 1px solid var(--border-color);
        border-radius: 18px 18px 0 0;
        padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
        transform: translateY(100%);
        transition: transform 0.22s ease;
    }
    .mobile-menu.open .mobile-menu-sheet { transform: none; }
    .mm-profile { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border-color); }
    .mm-profile-info { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
    .mm-profile-info b { font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mm-profile-info .link-btn { font-size: 12.5px; padding: 4px 0; }
    .mm-nav { padding: 4px 0; }
    .mm-group + .mm-group { border-top: 1px solid var(--border-color); }
    .mm-row { display: flex; align-items: center; }
    .mm-link {
        flex: 1;
        min-height: 48px;
        display: flex;
        align-items: center;
        gap: 12px;
        background: none;
        border: 0;
        color: var(--text-main);
        font-size: 15px;
        font-weight: 700;
        text-align: left;
        cursor: pointer;
    }
    .mm-link i { width: 20px; text-align: center; color: var(--accent); }
    .mm-group.current .mm-link { color: var(--accent); }
    .mm-expand { width: 44px; height: 44px; background: none; border: 0; color: var(--text-muted); cursor: pointer; }
    .mm-expand i { transition: transform 0.15s; }
    .mm-expand.open i { transform: rotate(180deg); }
    .mm-subs { display: flex; flex-direction: column; padding: 0 0 6px 32px; }
    .mm-sub { min-height: 40px; text-align: left; background: none; border: 0; color: var(--text-muted); font-size: 14px; font-weight: 600; cursor: pointer; }
    .mm-account-card { width: auto; margin: 6px 0 12px; }
    .mm-prefs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
    .mm-palettes { display: flex; gap: 6px; }
    .mm-palette {
        width: 40px; height: 40px;
        display: flex; align-items: center; justify-content: center; gap: 2px;
        border-radius: 10px;
        border: 2px solid var(--border-color);
        background: var(--bg-card-inner);
        cursor: pointer;
    }
    .mm-palette span { width: 11px; height: 11px; border-radius: 50%; }
    .mm-palette.active { border-color: var(--accent); }
    .mm-theme-btn { flex: 1; justify-content: center; min-width: 140px; }
    .mm-logout { width: 100%; min-height: 44px; }

    /* Pencereler: form pencereleri tam ekran, baslik ustte, Kaydet altta sabit */
    .modal { padding: 0; backdrop-filter: none; }
    #quickTradeModal .dialog-card, #missedTradeModal .dialog-card, #tradeDetailModal .dialog-card,
    #lotCalcModal .dialog-card, #recoveryModal .dialog-card, #mergeModal .dialog-card {
        max-width: none !important;
        width: 100% !important;
        height: 100%;
        max-height: none !important;
        overflow-y: auto;
        border: 0;
        border-radius: 0;
        background: linear-gradient(var(--bg-card), var(--bg-card)), var(--bg-main);
        padding: calc(14px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
        display: flex;
        flex-direction: column;
    }
    .modal .dialog-card > * { flex-shrink: 0; }
    .modal .dialog-card > .card-header:first-child {
        position: sticky;
        top: calc(-14px - env(safe-area-inset-top));
        z-index: 3;
        margin: calc(-14px - env(safe-area-inset-top)) -16px 10px;
        padding: calc(14px + env(safe-area-inset-top)) 16px 10px;
        background: linear-gradient(var(--bg-card), var(--bg-card)), var(--bg-main);
        border-bottom: 1px solid var(--border-color);
    }
    .modal-close-btn { width: 40px; height: 40px; font-size: 18px; }
    .modal .modal-actions {
        position: sticky;
        bottom: calc(-16px - env(safe-area-inset-bottom));
        z-index: 3;
        /* margin-top:auto: icerik kisa olsa da seritte ekranin en altinda durur */
        margin: auto -16px calc(-16px - env(safe-area-inset-bottom)) !important;
        padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
        background: linear-gradient(var(--bg-card), var(--bg-card)), var(--bg-main);
        border-top: 1px solid var(--border-color);
    }
    .modal .modal-actions .btn { min-height: 46px; margin-top: 0 !important; }
    .untouched-row .chip-btn { min-height: 40px; padding: 6px 12px; font-size: 13px; }
    .untouched-label { flex-basis: 100%; }
    .mt-price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Cok dar telefon (360 px alti): 10 buyuk yildiz karta sigsin; grafik, cevirme sirasinda kartindan tasmasin */
@media (max-width: 767px) { .card canvas { max-width: 100%; } }
@media (max-width: 359px) { .star-rating.large .star { font-size: 21px; } .qt-stars .star { font-size: 21px; } }
