@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --zen-stone: #475569;
    --neu-shadow-light: #ffffff;
    --neu-shadow-dark: #d1d9e6;
}

.zen-bg {
    background-color: rgb(249, 250, 252);
    position: relative;
}

/* ─── Liquid Glass — Ambient Blobs ───────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 50% at 18% 18%, rgba(99,102,241,0.14) 0%, transparent 65%),
        radial-gradient(ellipse 55% 60% at 82% 82%, rgba(16,185,129,0.12) 0%, transparent 65%),
        radial-gradient(ellipse 45% 50% at 78% 12%, rgba(251,191,36,0.10) 0%, transparent 65%),
        radial-gradient(ellipse 50% 45% at 22% 78%, rgba(59,130,246,0.11) 0%, transparent 65%);
}

/* ─── Liquid Glass — Stone Container ────────────────── */
.stone-container {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border-radius: 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.72);
    position: relative;
    z-index: 10;
}
.zen-bg::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255,255,255,0.4) 0%, transparent 70%),
        radial-gradient(ellipse at 80% 70%, rgba(255,255,255,0.4) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.stone-inset {
    background: rgba(241, 245, 249, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 1rem;
    box-shadow: none;
    border: 1px solid rgba(226,232,240,0.5);
}

.flowing-stream-container {
    background: transparent;
}

/* ─── Sidebar Buttons ─────────────────────────────────────── */
.sidebar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    padding: 8px 4px;
    border-radius: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #94a3b8;
    border: none;
    background: transparent;
}
.sidebar-btn:hover {
    background: rgba(255,255,255,0.7);
    color: #475569;
}
.sidebar-btn.active {
    background: rgba(255,255,255,0.85);
    color: #1e293b;
}
.sidebar-btn .material-symbols-outlined {
    font-size: 20px;
}
.sidebar-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── Mobile Nav ─────────────────────────────────────── */
.nav-stone-bottom {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08), 0 0 0 1px rgba(255,255,255,0.8);
    border-top: 1px solid rgba(226,232,240,0.5);
}
.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 0.75rem;
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
}
.mobile-nav-btn.active {
    color: #1e293b;
    background: transparent;
}

/* ─── Legacy nav-stone (kept for compatibility) ───────── */
.nav-stone {
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(16px);
    border-radius: 2rem;
    border: 1px solid rgba(255,255,255,0.9);
    box-shadow: 0 2px 8px rgba(148, 163, 184, 0.1);
    transition: all 0.3s ease;
}
.nav-stone.running {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}
.river-stone-btn {
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    color: #64748b;
}
.river-stone-btn:hover { transform: scale(1.05); }
.river-stone-btn.active { background: #475569; color: white; }

.status-dot {
    box-shadow: 0 0 12px currentColor;
}

/* ─── KPI Cards ─────────────────────────────────────── */
.kpi-card {
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border-radius: 1.25rem;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255,255,255,0.68);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.08);
}
.kpi-icon {
    width: 40px; height: 40px;
    border-radius: 0.875rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.kpi-icon .material-symbols-outlined { font-size: 20px; }
.kpi-body { flex: 1; min-width: 0; }
.kpi-label { font-size: 10px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.07em; }
.kpi-value { font-size: 22px; font-weight: 700; line-height: 1.2; margin: 1px 0; }
.kpi-sub { font-size: 10px; color: #94a3b8; }

/* ─── Stream Modules ─────────────────────────────────────── */
.stream-module {
    background: rgba(255,255,255,0.52);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border-radius: 1rem;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    border: 1px solid rgba(255,255,255,0.65);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.75), 0 1px 4px rgba(0,0,0,0.04);
    cursor: default;
    transition: background 0.2s, box-shadow 0.2s;
}
.stream-module:hover { background: rgba(255,255,255,0.78); box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 2px 8px rgba(0,0,0,0.07); }
.stream-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #cbd5e1;
    display: block;
    margin-bottom: 2px;
}
.stream-dot.active {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16,185,129,0.5);
    animation: pulse-ring 2s ease infinite;
}
.stream-dot.error { background: #f43f5e; box-shadow: 0 0 6px rgba(244,63,94,0.5); }
.stream-module-name { font-size: 9px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.06em; }
.stream-module-status { font-size: 9px; color: #94a3b8; }

/* ─── System Health ─────────────────────────────────────── */
.health-item {
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
    border-radius: 0.875rem;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.65);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 1px 3px rgba(0,0,0,0.04);
}
.health-label { font-size: 10px; font-weight: 600; color: #64748b; margin-bottom: 6px; }
.health-bar-wrap { height: 4px; background: rgba(226,232,240,0.6); border-radius: 2px; overflow: hidden; margin-bottom: 4px; }
.health-bar { height: 100%; border-radius: 2px; transition: width 0.5s ease; }
.health-val { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

/* ─── Live Badge ─────────────────────────────────────── */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 1rem;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
    position: relative;
}
.live-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse-ring 1.5s ease infinite;
}

/* ─── Criteria Tabs ─────────────────────────────────────── */
.crit-tab {
    padding: 6px 14px;
    border-radius: 2rem;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(226,232,240,0.5);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.crit-tab:hover { background: rgba(255,255,255,0.8); color: #334155; }
.crit-tab.active {
    background: #1e293b;
    color: white;
    border-color: #1e293b;
    box-shadow: 0 2px 8px rgba(30,41,59,0.25);
}
.crit-tab-panel { display: none; }
.crit-tab-panel.active { display: block; }

/* ─── Mode Badge ─────────────────────────────────────── */
.mode-badge {
    margin-left: auto;
    padding: 3px 8px;
    border-radius: 1rem;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(241,245,249,0.8);
    color: #64748b;
    border: 1px solid rgba(226,232,240,0.5);
}

/* ─── Crit extras ─────────────────────────────────────── */
.crit-desc {
    font-size: 12px;
    color: #475569;
    line-height: 1.6;
    margin: 10px 0 0;
}
.crit-example {
    font-size: 11px;
    color: #0369a1;
    background: #f0f9ff;
    border-radius: 0.75rem;
    padding: 8px 12px;
    margin-top: 14px;
    border-left: 3px solid #38bdf8;
    font-weight: 500;
}
.param-default { font-size: 9px; color: #94a3b8; font-weight: 400; }
.param-row.full { grid-column: 1 / -1; }

/* ─── Custom Select / Listbox ─────────────────────────── */
/* FOUC önleme: JS init olmadan ham select.select-styled görünmesin */
select.select-styled {
    position: absolute; width: 1px; height: 1px;
    opacity: 0; pointer-events: none; overflow: hidden;
    appearance: none; -webkit-appearance: none;
}
/* .select-sm — select-styled olmayan, ham kullanım için fallback stilleri */
.select-sm {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 8px 32px 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 0.875rem;
    background-color: rgba(255,255,255,0.85);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    border: 1.5px solid rgba(226,232,240,0.7);
    color: #334155;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.6);
}
.select-sm:hover {
    border-color: #94a3b8;
    background-color: rgba(255,255,255,0.95);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.6);
}
.select-sm:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
    background-color: white;
}
/* Override log filter select */
select#logLevelFilter {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 12px;
    padding-right: 22px;
    cursor: pointer;
}

/* ─── Custom Listbox Dropdown (.cselect) ─────────────── */
.cselect { position: relative; display: inline-flex; vertical-align: middle; width: 100%; }
.param-group .cselect,
.param-group .cselect-trigger { display: flex; width: 100%; } /* param-group içinde tam genişlik */
.cselect-trigger {
    position: relative;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 28px 8px 12px;
    font-size: 12px; font-weight: 600; font-family: inherit;
    border-radius: 0.875rem;
    background: rgba(255,255,255,0.85);
    border: 1.5px solid rgba(226,232,240,0.7);
    color: #334155; cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.6);
    white-space: nowrap; text-align: left; min-width: 72px;
    outline: none;
}
.cselect-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-trigger:hover {
    border-color: #94a3b8; background: rgba(255,255,255,0.95);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.6);
}
.cselect.open .cselect-trigger {
    border-color: #3b82f6; background: white;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
}
.cselect-icon { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 15px !important; color: #64748b; transition: transform 0.2s; user-select: none; pointer-events: none; line-height: 1; }
.cselect.open .cselect-icon { transform: translateY(-50%) rotate(180deg); }

/* Portal panel — appended to body, positioned via JS */
.cselect-panel {
    padding: 4px;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.75);
    border-radius: 0.875rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.07), inset 0 1.5px 0 rgba(255,255,255,0.9);
    overflow: hidden;
    animation: cselectIn 0.13s ease;
    max-height: 260px;
    overflow-y: auto;
}
@keyframes cselectIn { from { opacity:0; transform:translateY(-5px) scale(0.97); } to { opacity:1; transform:none; } }
.cselect-option {
    padding: 8px 12px; font-size: 12px; font-weight: 500; color: #475569;
    cursor: pointer; border-radius: 0.625rem;
    transition: background 0.1s, color 0.1s; white-space: nowrap;
}
.cselect-option:hover { background: #f1f5f9; color: #1e293b; }
.cselect-option.selected { color: #2563eb; font-weight: 700; background: #eff6ff; }

/* ─── Binance Chart Modal ─────────────────────────────── */
#binanceChartModal {
    display: none; position: fixed; inset: 0; z-index: 99999;
    align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.22s ease;
}
#binanceChartModal.open { opacity: 1; }
.binance-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(15,23,42,0.55);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.binance-modal-box {
    position: relative; z-index: 1;
    width: min(96vw, 1020px); height: min(88vh, 680px);
    background: #fff; border-radius: 1.25rem;
    box-shadow: 0 24px 80px rgba(0,0,0,0.22), 0 4px 16px rgba(0,0,0,0.08);
    display: flex; flex-direction: column; overflow: hidden;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
#binanceChartModal.open .binance-modal-box {
    transform: translateY(0) scale(1);
}
.binance-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid #e2e8f0;
    background: #f8fafc; flex-shrink: 0;
}
.binance-modal-frame { flex: 1; overflow: hidden; }
.binance-modal-frame iframe { width: 100%; height: 100%; display: block; border: none; }

/* ─── Bot Mode Badge — Gold Premium ──────────────────── */
.bot-mode-badge-gold {
    background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 50%, #fde68a 100%);
    border: 1.5px solid #f59e0b;
    box-shadow: none;
}
.bot-mode-badge-gold .pulse-dot { background: #f59e0b !important; }
.bot-mode-badge-gold .bot-mode-text { color: #92400e !important; font-weight: 800; }

/* ─── Trading Env Toggle — GERÇEK green glow ─────────── */
.env-toggle-wrap { transition: all 0.3s; }
.env-toggle-wrap.env-live {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-color: #34d399;
    box-shadow: none;
}
.env-toggle-wrap.env-live .env-label-live { color: #059669 !important; font-weight: 800; }
.env-toggle-wrap.env-paper {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fbbf24;
    box-shadow: none;
}
.env-toggle-wrap.env-paper .env-label-paper { color: #d97706 !important; font-weight: 800; }

/* ─── Status dot ─────────────────────────────────────── */
.status-dot {
    box-shadow: 0 0 8px currentColor;
}

/* ─── Pulse dot ─────────────────────────────────────── */
.pulse-dot {
    width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.pulse-dot.green { background: #10b981; animation: pulse-ring 2s ease infinite; }
.pulse-dot.red { background: #f43f5e; animation: pulse-ring 2s ease infinite; }
.pulse-dot.amber { background: #f59e0b; animation: pulse-ring 2s ease infinite; }
@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    50% { box-shadow: 0 0 0 4px transparent; }
}

.custom-scrollbar::-webkit-scrollbar { width: 3px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Pages */
.page { display: none; animation: fadeUp 0.25s ease; }
.page.active { display: block; }
#page-scanner.active { display: flex; flex-direction: column; gap: 1.5rem; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 11px; text-align: left; }
.tbl th { padding: 10px 12px; color: #94a3b8; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 9px; border-bottom: 1px solid rgba(226,232,240,0.5); background: rgba(248,250,252,0.5); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid rgba(226,232,240,0.3); color: #334155; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: rgba(255,255,255,0.5); }
.tbl .empty { text-align: center; padding: 24px; color: #94a3b8; font-style: italic; font-size: 11px; }

/* Forms & Inputs */
input[type="number"], input[type="text"], select {
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(226,232,240,0.7);
    border-style: none;
    border: 1px solid rgba(226,232,240,0.7);
    border-radius: 0.75rem;
    padding: 7px 11px;
    font-size: 12px;
    color: #334155;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: none;
}
#manualCoinSearchInput {
    padding: 12px 16px 12px 2.75rem !important;
}
input:focus, select:focus {
    background: rgba(255,255,255,0.9);
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148,163,184,0.15);
}

/* Buttons */
.btn {
    padding: 7px 14px;
    border-radius: 0.875rem;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: none;
}
.btn-primary { background: #334155; color: white; box-shadow: 0 2px 6px rgba(51,65,85,0.25); }
.btn-primary:hover { background: #1e293b; transform: translateY(-1px); }
.btn-success { background: #059669; color: white; box-shadow: 0 2px 6px rgba(5,150,105,0.25); }
.btn-success:hover { background: #047857; transform: translateY(-1px); }
.btn-danger { background: #e11d48; color: white; box-shadow: 0 2px 6px rgba(225,29,72,0.25); }
.btn-danger:hover { background: #be123c; transform: translateY(-1px); }
.btn-ghost { background: rgba(255,255,255,0.55); color: #64748b; border: 1px solid rgba(255,255,255,0.68); backdrop-filter: blur(8px) saturate(140%); -webkit-backdrop-filter: blur(8px) saturate(140%); box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 3px rgba(0,0,0,0.05); }
.btn-ghost:hover { background: rgba(255,255,255,0.88); color: #334155; box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 2px 8px rgba(0,0,0,0.08); }
.btn-sm { padding: 5px 11px; font-size: 10px; }
.btn-xs { padding: 3px 7px; font-size: 9px; border-radius: 0.5rem; }

/* Badges */
.badge { padding: 3px 7px; border-radius: 0.625rem; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-green { background: #d1fae5; color: #059669; }
.badge-red { background: #ffe4e6; color: #e11d48; }
.badge-blue { background: #dbeafe; color: #0284c7; }
.badge-yellow { background: #fef3c7; color: #d97706; }

/* Toggles */
.toggle { position: relative; display: inline-block; width: 34px; height: 18px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .3s; border-radius: 18px; }
.slider:before { position: absolute; content: ""; height: 12px; width: 12px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
input:checked + .slider { background-color: #10b981; }
input:checked + .slider:before { transform: translateX(16px); }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15,23,42,0.45); backdrop-filter: blur(12px) saturate(120%); -webkit-backdrop-filter: blur(12px) saturate(120%); display: none; align-items: center; justify-content: center; z-index: 1000; opacity: 0; transition: opacity 0.25s ease; }
.modal-overlay.active { display: flex; opacity: 1; }
.modal { background: rgba(255,255,255,0.82); backdrop-filter: blur(32px) saturate(180%); -webkit-backdrop-filter: blur(32px) saturate(180%); border-radius: 1.5rem; width: 90%; max-width: 420px; box-shadow: 0 24px 64px rgba(0,0,0,0.16), 0 6px 20px rgba(0,0,0,0.08), inset 0 1.5px 0 rgba(255,255,255,0.9); border: 1px solid rgba(255,255,255,0.8); transform: scale(0.96); transition: transform 0.25s ease; overflow: hidden; }
.modal-overlay.active .modal { transform: scale(1); }
.modal-hd { padding: 18px 22px; border-bottom: 1px solid rgba(226,232,240,0.5); display: flex; justify-content: space-between; align-items: center; }
.modal-hd h3 { font-size: 15px; font-weight: 700; color: #1e293b; display: flex; align-items: center; gap: 7px; }
.modal-hd button { background: none; border: none; color: #64748b; cursor: pointer; display: flex; }
.modal-bd { padding: 20px 22px; font-size: 13px; color: #475569; }
.modal-ft { padding: 14px 22px; border-top: 1px solid rgba(226,232,240,0.5); display: flex; justify-content: flex-end; gap: 10px; background: rgba(248,250,252,0.5); }

/* Toasts */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  max-width: 320px;
  width: 320px;
}
.toast {
  width: 320px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.75);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06), inset 0 1.5px 0 rgba(255,255,255,0.9);
  overflow: hidden;
  pointer-events: auto;
  animation: slideUpToast 0.32s ease-out;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.toast-header {
  background: rgba(255,255,255,0.6);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f0f2f5;
}
.toast-header-info { display: flex; align-items: center; gap: 9px; }
.toast-status-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.toast-header-title { font-size: 13px; font-weight: 700; color: #1a1d1f; line-height: 1; }
.toast-close-btn {
  background: none;
  border: none;
  color: #9aa1a9;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 4px;
  line-height: 1;
  transition: all .18s;
}
.toast-close-btn .material-symbols-outlined { font-size: 16px; }
.toast-close-btn:hover { color: #1a1d1f; background: #f0f2f5; }
.toast-body {
  padding: 14px 16px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.toast-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f4f6f8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast-icon-wrap .material-symbols-outlined { font-size: 20px; }
.toast-content-wrap { flex: 1; min-width: 0; padding-top: 2px; }
.toast-msg { font-size: 12.5px; color: #6f767e; line-height: 1.5; margin-bottom: 11px; word-break: break-word; }
.toast-actions { display: flex; gap: 7px; }
.toast-action-btn {
  border: none;
  border-radius: 10px;
  padding: 7px 13px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s;
  line-height: 1;
}
.toast-action-btn.primary { background: #00b36e; color: #fff; }
.toast-action-btn.primary:hover { background: #00985f; }
.toast-action-btn.secondary { background: #f0f2f5; color: #6f767e; }
.toast-action-btn.secondary:hover { background: #e4e7eb; color: #1a1d1f; }
/* type colours */
.toast.success .toast-status-dot { background: #00b36e; box-shadow: 0 0 0 3px rgba(0,179,110,0.15); }
.toast.success .toast-icon-wrap { background: #f0fdf8; color: #00b36e; }
.toast.error   .toast-status-dot { background: #f43f5e; box-shadow: 0 0 0 3px rgba(244,63,94,0.14); }
.toast.error   .toast-icon-wrap { background: #fff1f3; color: #f43f5e; }
.toast.warn    .toast-status-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.16); }
.toast.warn    .toast-icon-wrap { background: #fffbeb; color: #f59e0b; }
.toast.info    .toast-status-dot { background: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.toast.info    .toast-icon-wrap { background: #eff6ff; color: #3b82f6; }
/* animations */
.toast.fade-out { animation: fadeDownToast 0.28s ease-in forwards; }
@keyframes slideUpToast  { from { transform: translateY(18px); opacity: 0; } to { transform: translateY(0);   opacity: 1; } }
@keyframes fadeDownToast { from { transform: translateY(0);    opacity: 1; } to { transform: translateY(12px); opacity: 0; } }

/* Bot Log */
.bot-log { background: rgba(255,255,255,0.4); border-radius: 1rem; padding: 12px; height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; border: 1px solid rgba(226,232,240,0.4); }
.bot-log-entry { padding: 6px 10px; border-radius: 0.5rem; font-size: 10px; font-family: 'JetBrains Mono', monospace; background: rgba(255,255,255,0.6); display: flex; align-items: flex-start; gap: 6px; border-left: 2px solid transparent; white-space: pre-wrap; word-break: break-word; }
.bot-log-entry.info { color: #64748b; border-left-color: #94a3b8; }
.bot-log-entry.success { color: #059669; border-left-color: #10b981; }
.bot-log-entry.error { color: #e11d48; border-left-color: #f43f5e; }
.bot-log-entry.warn { color: #d97706; border-left-color: #f59e0b; }

/* Progress Bar */
.scan-progress { margin-bottom: 14px; }
.prog-bar { height: 4px; background: rgba(226,232,240,0.6); border-radius: 2px; overflow: hidden; }
.prog-fill { height: 100%; background: linear-gradient(90deg, #10b981, #3b82f6); transition: width 0.3s ease; border-radius: 2px; }
.prog-text { font-size: 10px; color: #94a3b8; margin-top: 3px; text-align: right; }

/* Criteria Grid */
.criteria-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.criterion-card {
  background: white;
  border-radius: 1.25rem;
  padding: 20px;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.criterion-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: #cbd5e1; }
.crit-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.crit-icon-wrap {
  width: 36px; height: 36px; border-radius: 0.875rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.crit-name { font-size: 13px; font-weight: 700; color: #1e293b; line-height: 1.2; }
.crit-sub { font-size: 10px; color: #94a3b8; font-weight: 500; margin-top: 1px; }
.crit-status {
  padding: 4px 10px; border-radius: 1rem;
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: #d1fae5; color: #059669;
  white-space: nowrap; flex-shrink: 0;
}
.crit-status.inactive { background: #f1f5f9; color: #94a3b8; }
.crit-params { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.param-row { display: flex; flex-direction: column; gap: 5px; }
.param-row label { font-size: 11px; font-weight: 600; color: #475569; }
.param-row input {
  width: 100%; font-size: 14px; font-weight: 600;
  padding: 9px 12px; border-radius: 0.75rem;
  border: 1.5px solid #e2e8f0; background: #f8fafc;
  color: #1e293b; outline: none; transition: border-color 0.2s, background 0.2s;
}
.param-row input:focus { border-color: #3b82f6; background: white; box-shadow: 0 0 0 3px rgba(59,130,246,0.08); }
.crit-check-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: #475569;
  cursor: pointer; padding: 8px 10px;
  background: #f8fafc; border-radius: 0.75rem;
  border: 1.5px solid #e2e8f0;
  transition: border-color 0.2s, background 0.2s;
}
.crit-check-label:hover { background: #f0f9ff; border-color: #bfdbfe; }
.crit-check-label input[type=checkbox] { accent-color: #3b82f6; width: 15px; height: 15px; flex-shrink: 0; }
.param-help { font-size: 10px; color: #94a3b8; margin-bottom: 4px; display: block; }

/* Mode Selector */
.mode-selector { display: flex; flex-direction: column; gap: 8px; }
.mode-opt { cursor: pointer; }
.mode-opt input { display: none; }
.mode-card { display: flex; align-items: center; gap: 12px; padding: 12px; background: rgba(255,255,255,0.5); border-radius: 1rem; border: 2px solid transparent; transition: all 0.2s ease; }
.mode-opt:has(input:checked) .mode-card { background: rgba(255,255,255,0.9); border-color: #334155; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.mode-icon { width: 36px; height: 36px; border-radius: 0.75rem; background: rgba(241,245,249,0.8); display: flex; align-items: center; justify-content: center; color: #64748b; flex-shrink: 0; }
.mode-opt:has(input:checked) .mode-icon { background: #334155; color: white; }
.mode-name { font-size: 12px; font-weight: 700; color: #1e293b; }
.mode-desc { font-size: 10px; color: #64748b; }

.param-group { display: flex; flex-direction: column; gap: 5px; }
.param-group label { font-size: 10px; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 0.05em; }

/* ─── Zararda İşleme Devam Et Switch ────────────────────────────────────── */
.continue-on-loss-wrap { transition: background 0.3s ease, border-color 0.3s ease; }
.continue-on-loss-wrap.active {
  background: rgba(16, 185, 129, 0.06) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}
.continue-on-loss-wrap.active .text-slate-700 { color: #065f46 !important; }
.continue-on-loss-wrap.active .text-slate-400 { color: #6ee7b7 !important; }

/* Settings Grid */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .settings-grid { grid-template-columns: 1fr; } }
.info-panel { display: flex; flex-direction: column; gap: 12px; }
.info-section { background: rgba(255,255,255,0.5); padding: 14px; border-radius: 1rem; border: 1px solid rgba(226,232,240,0.4); }
.info-title { font-size: 11px; font-weight: 700; color: #1e293b; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.info-section p { font-size: 11px; color: #475569; line-height: 1.6; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; flex-direction: column; gap: 4px; }
.form-row label { font-size: 10px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }
.status-list { display: flex; flex-direction: column; gap: 8px; }
.status-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #334155; padding: 10px 12px; background: rgba(255,255,255,0.5); border-radius: 0.75rem; border: 1px solid rgba(226,232,240,0.4); }

/* ─── Material Symbols Icon Helpers ─────────────────────────────────────── */
.material-symbols-outlined.mi-xs { font-size: 14px; vertical-align: middle; }
.material-symbols-outlined.mi-sm { font-size: 18px; vertical-align: middle; }
.material-symbols-outlined.mi-md { font-size: 22px; vertical-align: middle; }
.material-symbols-outlined.green { color: #10b981; }
.material-symbols-outlined.red { color: #f43f5e; }
.material-symbols-outlined.blue { color: #3b82f6; }

/* ─── Global Scan Progress Bar ─────────────────────────────────────── */
#globalScanBar {
    height: 2px;
    width: 100%;
    background: rgba(226,232,240,0.4);
    flex-shrink: 0;
    overflow: hidden;
    display: none;
}
#globalScanBar.active { display: block; }
#globalScanFill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 40%, #10b981 60%, #059669 100%);
    background-size: 200% 100%;
    animation: scan-shimmer 1.4s linear infinite;
    border-radius: 0 2px 2px 0;
    transition: width 0.4s ease;
}
@keyframes scan-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Login Screen ─────────────────────────────────────── */
#loginScreen {
    position: fixed;
    inset: 0;
    background: rgb(249, 250, 252);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    font-family: 'Inter', sans-serif;
}
#loginScreen.hidden { display: none; }
.login-card {
    width: 100%;
    max-width: 380px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    border-radius: 2rem;
    padding: 36px 32px 32px;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.03),
        0 12px 40px rgba(0,0,0,0.08),
        0 0 0 1px rgba(255,255,255,0.9);
    border: 1px solid rgba(226,232,240,0.6);
}
.login-logo {
    width: 48px; height: 48px;
    border-radius: 1rem;
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(30,41,59,0.2);
}
.login-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.login-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 28px;
    font-weight: 500;
}
.login-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    margin-bottom: 6px;
}
.login-input {
    width: 100%;
    padding: 11px 14px;
    border-radius: 0.875rem;
    border: 1px solid rgba(226,232,240,0.8);
    background: rgba(248,250,252,0.7);
    font-size: 13px;
    color: #1e293b;
    outline: none;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}
.login-input:focus {
    border-color: #94a3b8;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 0 0 3px rgba(148,163,184,0.15);
}
.login-btn {
    width: 100%;
    padding: 12px;
    border-radius: 0.875rem;
    background: #1e293b;
    color: white;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 20px;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.login-btn:hover { background: #334155; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30,41,59,0.2); }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ════════════════════════════════════════════════════════
   POZİSYON KARTI AKORDİYON — Coin detay paneli
   ════════════════════════════════════════════════════════ */

/* Tıklanabilir pozisyon satırı */
.pos-row {
  transition: all 0.2s ease;
  user-select: none;
}
.pos-row:hover td { background: rgba(248,250,252,0.8); }
.pos-row.expanded td { background: rgba(241,245,249,0.5) !important; border-bottom: none !important; }

/* Küçük "genişlet" oku — butona dönüştürüldü (Positions sayfası) */
.pos-expand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(100,116,139,0.1);
  transition: transform 0.25s ease, background 0.2s;
  flex-shrink: 0;
  margin-left: 4px;
}
.pos-expand-icon .material-symbols-outlined { font-size: 16px; color: #64748b; line-height: 1; }
.pos-row.expanded .pos-expand-icon {
  transform: rotate(180deg);
  background: rgba(99,102,241,0.15);
}
.pos-row.expanded .pos-expand-icon .material-symbols-outlined { color: #6366f1; }

/* Buton olarak kullanıldığında sıfırla */
button.pos-expand-btn {
  border: none;
  padding: 0;
  background: rgba(100,116,139,0.1);
  cursor: pointer;
  outline: none;
}
button.pos-expand-btn:hover { background: rgba(99,102,241,0.15); }

/* Detay satırı wrapper — varsayılan olarak gizli */
.pos-detail-row { display: none; }
.pos-detail-row.open { display: table-row; }
.pos-detail-row td { padding: 0 !important; border: none !important; }

/* Akordiyon iç kapsayıcı — max-height animasyonu */
.pos-detail-inner {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out;
}
.pos-detail-inner.open {
  max-height: 1800px;
  transition: max-height 0.4s ease-in;
}

/* Panel içi kapatıcı */
.pos-detail-panel {
  overflow: hidden;
}
.pos-detail-content {
  padding: 24px;
  background: #ffffff;
  border-top: 1px solid rgba(226,232,240,0.6);
  box-shadow: inset 0 3px 6px rgba(0,0,0,0.01);
}

/* Periyot seçici butonları */
.chart-period-btn {
  padding: 4px 10px;
  border-radius: 0.375rem;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: 1px solid rgba(226,232,240,0.8);
  cursor: pointer;
  transition: all 0.15s;
}
.chart-period-btn:hover { background: #f8fafc; color: #334155; }
.chart-period-btn.active {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

/* Grafik alanı */
.chart-area-wrap {
  position: relative;
  height: 160px;
  background: #ffffff;
  border-radius: 0.5rem;
  border: 1px solid rgba(226,232,240,0.6);
  overflow: hidden;
  margin-top: 16px;
  margin-bottom: 20px;
}
.chart-area-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Yükleniyor katmanı */
.chart-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.9);
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  gap: 8px;
  transition: opacity 0.2s;
  z-index: 10;
}
.chart-loading-overlay.hidden { opacity: 0; pointer-events: none; }
.chart-spinner {
  width: 16px; height: 16px;
  border: 2px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: chartSpin 0.7s linear infinite;
}

/* List Log */
.chart-log-list {
  background: rgba(248,250,252,0.6);
  border-radius: 0.5rem;
  border: 1px solid rgba(226,232,240,0.5);
  padding: 8px 12px;
  max-height: 110px;
  overflow-y: auto;
}
.chart-log-entry {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(226,232,240,0.4);
  font-size: 11px;
}
.chart-log-entry:last-child { border-bottom: none; }
.chart-log-entry .log-ts { color: #94a3b8; flex-shrink: 0; font-size: 9px; font-variant-numeric: tabular-nums; }
.chart-log-entry .log-lvl {
  font-weight: 700; font-size: 9px; flex-shrink: 0;
  padding: 2px 6px; border-radius: 4px;
}
.chart-log-entry .log-lvl.INFO    { background: #f8fafc; color: #64748b; }
.chart-log-entry .log-lvl.SUCCESS { background: #ecfdf5; color: #10b981; }
.chart-log-entry .log-lvl.WARN    { background: #fffbeb; color: #f59e0b; }
.chart-log-entry .log-lvl.ERROR   { background: #fef2f2; color: #ef4444; }
.chart-log-entry .log-msg { color: #475569; flex: 1; min-width: 0; line-height: 1.4; }

/* Mobil uyum */
@media (max-width: 767px) {
  .pos-detail-content { padding: 16px; }
  .chart-area-wrap { height: 140px; margin-top: 12px; margin-bottom: 16px; }
  .chart-period-btn { padding: 4px 8px; font-size: 10px; }
}

.login-error {
    font-size: 11px;
    color: #e11d48;
    background: rgba(225,29,72,0.06);
    border: 1px solid rgba(225,29,72,0.12);
    border-radius: 0.75rem;
    padding: 9px 12px;
    margin-top: 12px;
    display: none;
}
.login-error.show { display: block; }
.login-divider {
    height: 1px;
    background: rgba(226,232,240,0.6);
    margin: 20px 0;
}
.login-footer {
    font-size: 10px;
    color: #cbd5e1;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════════
   MOBİL RESPONSIVE DÜZELTMELER  (≤ 767px)
   ═══════════════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* ── Tablo hücre padding & font küçültülür ── */
  .tbl th { padding: 6px 6px; font-size: 8px; }
  .tbl td { padding: 6px 6px; font-size: 10px; }
  .tbl .empty { padding: 16px; }

  /* ── Kart (stone-container) iç boşluk azaltılır ── */
  .stone-container.p-6 { padding: 0.875rem !important; }
  .stone-container.p-5 { padding: 0.75rem !important; }

  /* ── KPI Card — Küçük ekranda kompakt ── */
  .kpi-card {
    padding: 10px 12px !important;
    gap: 8px !important;
    border-radius: 1rem !important;
  }
  .kpi-label { font-size: 9px !important; }
  .kpi-value { font-size: 1.05rem !important; line-height: 1.2 !important; }
  .kpi-sub   { font-size: 9px !important; }
  .kpi-icon  { width: 32px !important; height: 32px !important; border-radius: 0.75rem !important; }
  .kpi-icon .material-symbols-outlined { font-size: 16px !important; }

  /* ── Bot günlük / log yüksekliği ── */
  .bot-log { height: 180px !important; }

  /* ── Kriterler grid → tek sütun ── */
  .criteria-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  .criterion-card { padding: 16px !important; }
  .crit-header { margin-bottom: 10px !important; }
  .crit-desc { font-size: 11px !important; margin-bottom: 10px !important; }
  .crit-params { gap: 8px !important; }
  .param-row input { font-size: 13px !important; padding: 8px 10px !important; }

  /* ── Bot çalışıyor banner ── */
  #botActiveBanner.show {
    padding: 6px 12px;
    flex-wrap: wrap;
    gap: 3px;
    font-size: 11px;
  }

  /* ── Paper mode banner ── */
  #paperModeBanner {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 6px 12px !important;
    gap: 3px !important;
    font-size: 11px !important;
  }
  #paperModeBanner span[style*="font-size:13px"] { font-size: 11px !important; }
  #paperModeBanner span.hidden { display: none !important; }

  /* ── Bot mod kart ── */
  .mode-badge { display: none !important; }
  .mode-card { padding: 8px 10px !important; gap: 6px !important; }
  .mode-desc { font-size: 9px !important; }

  /* ── Paper stats ── */
  #paperStatsGrid { gap: 6px !important; }
  #paperStatsGrid .text-base { font-size: 12px !important; }
  #paperStatsGrid .text-sm  { font-size: 10px !important; }

  /* ── Stream module ── */
  .stream-module { padding: 7px 5px !important; }
  .stream-module-name { font-size: 8px !important; }
  .stream-module-status { font-size: 8px !important; }
  .stream-module .material-symbols-outlined { font-size: 16px !important; }

  /* ── Dashboard live log ── */
  #dashBotLog { min-height: 140px !important; max-height: 180px !important; }

  /* ── Settings form ── */
  .form-row { flex-direction: column; align-items: flex-start !important; gap: 4px; }
  .form-row label { min-width: unset !important; }
  .form-row input, .form-row select { width: 100% !important; }

  /* ── Modal ── */
  .modal { width: 94% !important; max-height: 88vh !important; }

  /* ── Tab butonları ── */
  .crit-tab { padding: 5px 8px; font-size: 9px; }

  /* ── Health item ── */
  .health-item { padding: 7px 9px !important; }

  /* ── Mobile Nav ── */
  .mobile-nav-btn { padding: 6px 8px; gap: 2px; width: 58px; }
  .mobile-nav-btn span:last-child { font-size: 9px; }
  .mobile-nav-btn .material-symbols-outlined { font-size: 20px; }

  /* ── Stone container header padding ── */
  .stone-container .px-6 { padding-left: 0.875rem !important; padding-right: 0.875rem !important; }
  .stone-container .py-4 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }

  /* ── Quick stats strip (akış kontrolü) ── */
  .stone-inset.p-2\.5 { padding: 6px 8px !important; }
  .stone-inset .text-\[8px\] { font-size: 7px !important; }

  /* ── Scan progress bar gizle ── */
  #globalScanBar { display: none !important; }

  /* ── Pozisyon tablosu — mobilde küçük fontlar ── */
  .pos-row td { padding: 6px 4px !important; }
  .pos-row .text-\[15px\] { font-size: 12px !important; }
  .pos-row .text-\[13px\] { font-size: 11px !important; }
  .pos-row .text-\[16px\] { font-size: 13px !important; }
  .pos-row .text-\[11px\] { font-size: 10px !important; }
  .pos-row .coin-icon-wrap img,
  .pos-row .coin-icon-wrap span { width: 24px !important; height: 24px !important; font-size: 9px !important; }
  .pos-row .gap-3 { gap: 6px !important; }
  .pos-row button { padding: 4px 6px !important; font-size: 10px !important; }
  .pos-row button .material-symbols-outlined { font-size: 12px !important; }

  /* ── Scanner / Bot kontroller — mobilde kompakt ── */
  .scanner-controls-right .btn { padding: 5px 8px !important; font-size: 9px !important; }
  .scanner-controls-right .cselect-trigger { padding: 5px 24px 5px 8px !important; font-size: 11px !important; min-width: 60px !important; }
  #stopBotBtn, #startBotBtn { padding: 8px 12px !important; font-size: 11px !important; }
  #stopBotBtn .material-symbols-outlined,
  #startBotBtn .material-symbols-outlined { font-size: 16px !important; }
}

/* ── Çok küçük ekranlar (≤ 380px, iPhone SE vb.) ── */
@media (max-width: 380px) {
  .kpi-card { padding: 8px 10px !important; gap: 6px !important; }
  .kpi-value { font-size: 0.95rem !important; }
  .kpi-label { font-size: 8px !important; letter-spacing: 0.04em !important; }

  .mobile-nav-btn { width: 52px; padding: 5px 4px; }
  .mobile-nav-btn span:last-child { font-size: 8px; }

  #mobileHeader { padding-left: 10px !important; padding-right: 10px !important; }

  .stream-module { padding: 5px 3px !important; }
  .stream-module-name { display: none !important; }
}

/* ─── Profil Avatar Stilleri ──────────────────────────────────────────────── */
.profile-avatar-wrap {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: visible;
  flex-shrink: 0;
  /* Varsayılan çerçeve — JS sınıflarıyla üstüne yazılır */
  box-shadow: 0 0 0 2.5px #cbd5e1, 0 0 0 4.5px rgba(255,255,255,0.9);
}

.profile-avatar-wrap.active-ring {
  box-shadow: 0 0 0 2.5px #10b981, 0 0 0 5px rgba(16,185,129,0.15);
}

.profile-avatar-wrap.inactive-ring {
  box-shadow: 0 0 0 2.5px #cbd5e1, 0 0 0 4.5px rgba(255,255,255,0.9);
  filter: grayscale(0.7) opacity(0.7);
}

.profile-avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* Aktif/pasif durum noktası */
.profile-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #fff;
  z-index: 2;
}
.profile-status-dot.active  { background: #10b981; }
.profile-status-dot.inactive { background: #94a3b8; }

/* Mobil mini avatar (üst üste binmeli) */
.profile-avatar-mini {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  overflow: hidden;
  flex-shrink: 0;
  background: #e2e8f0;
}

/* Presence panel konumu */
#presencePanel {
  animation: fadeDown 0.15s ease-out;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* İsim Modal */
#nameModal {
  animation: fadeInModal 0.25s ease-out;
}

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

/* Modal avatar dairesi */
#nameModalAvatar {
  border-radius: 50% !important;
  overflow: hidden;
  box-shadow: 0 0 0 3px #e2e8f0, 0 0 0 6px rgba(99,102,241,0.10);
  transition: box-shadow 0.3s;
}

#nameModalAvatar.known-user {
  box-shadow: 0 0 0 3px #10b981, 0 0 0 6px rgba(16,185,129,0.18);
}

/* ─── Liquid Glass — Firefox SVG displacement enhancement ── */
@supports (backdrop-filter: url('#x')) {
    .stone-container { backdrop-filter: url('#liqglass') blur(16px) saturate(150%); }
    .kpi-card        { backdrop-filter: url('#liqglass') blur(12px) saturate(140%); }
    .modal           { backdrop-filter: url('#liqglass') blur(24px) saturate(170%); }
    .cselect-panel   { backdrop-filter: url('#liqglass') blur(20px) saturate(160%); }
    .toast           { backdrop-filter: url('#liqglass') blur(18px) saturate(150%); }
}

/* ─── Liquid Glass — Reduced Motion ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .kpi-card { transition: none; }
    .kpi-card:hover { transform: none; }
}
