/* ==========================================================================
   RADAR PRO - moderan fintech UI (tamna tema, staklene površine, mobile-first tabele)
   ========================================================================== */

:root {
    --bg: #05080d;
    --bg-soft: #0a1119;
    --surface: rgba(16, 25, 36, 0.78);
    --surface-solid: #0f1823;
    --surface-2: #121d2a;
    --surface-hover: rgba(24, 38, 54, 0.9);
    --line: rgba(148, 163, 184, 0.13);
    --line-strong: rgba(148, 163, 184, 0.26);

    --text: #cbd5e1;
    --text-strong: #f8fafc;
    --muted: #7b8ba1;

    --green: #00f2a5;
    --green-soft: rgba(0, 242, 165, 0.12);
    --green-line: rgba(0, 242, 165, 0.38);
    --red: #ff5470;
    --red-soft: rgba(255, 84, 112, 0.13);
    --red-line: rgba(255, 84, 112, 0.4);
    --yellow: #f0b90b;
    --yellow-soft: rgba(240, 185, 11, 0.14);
    --yellow-line: rgba(240, 185, 11, 0.45);
    --orange: #fb923c;
    --blue: #38bdf8;
    --blue-soft: rgba(56, 189, 248, 0.12);

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    --glow: 0 0 0 1px var(--green-line), 0 8px 40px rgba(0, 242, 165, 0.12);

    --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;

    --topbar-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; color-scheme: dark; scroll-behavior: smooth; }

body {
    background:
        radial-gradient(1000px 520px at 12% -8%, rgba(0, 242, 165, 0.09), transparent 60%),
        radial-gradient(900px 480px at 100% 0%, rgba(56, 189, 248, 0.07), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }

a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { color: var(--text-strong); letter-spacing: -0.01em; }
code { font-family: var(--mono); font-size: 12px; background: rgba(148, 163, 184, 0.12); padding: 1px 6px; border-radius: 6px; color: var(--text-strong); }
[hidden] { display: none !important; }

.icon {
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.2em;
}

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }

/* ---------- Topbar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: var(--topbar-h);
    padding: 10px 28px;
    background: rgba(6, 10, 16, 0.72);
    backdrop-filter: saturate(160%) blur(18px);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; flex-shrink: 0; }

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 242, 165, 0.2), rgba(56, 189, 248, 0.16));
    border: 1px solid var(--green-line);
    color: var(--green);
    font-size: 20px;
    box-shadow: 0 0 24px rgba(0, 242, 165, 0.18);
}
.brand-mark.large { width: 68px; height: 68px; border-radius: 20px; font-size: 32px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { color: var(--text-strong); font-size: 17px; font-weight: 800; letter-spacing: 0.04em; }
.brand-text strong em, .login-brand h1 em {
    font-style: normal;
    background: linear-gradient(90deg, var(--green), var(--blue));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.brand-text small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; }

.main-nav { display: flex; gap: 4px; padding: 4px; background: rgba(148, 163, 184, 0.07); border-radius: 12px; }
.main-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    padding: 7px 14px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 13px;
    transition: color 0.2s, background 0.2s;
}
.main-nav a:hover { color: var(--text-strong); }
.main-nav a.active { color: var(--text-strong); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.main-nav a.active .icon { color: var(--green); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.stat-chip { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.stat-label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }
.stat-chip strong { color: var(--text-strong); font-size: 16px; font-variant-numeric: tabular-nums; }
.stat-chip strong.accent { color: var(--green); }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
    white-space: nowrap;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; flex-shrink: 0; }
.status-ok { color: var(--green); background: var(--green-soft); border-color: var(--green-line); }
.status-starting { color: var(--blue); background: var(--blue-soft); border-color: rgba(56, 189, 248, 0.35); }
.status-stale { color: var(--orange); background: rgba(251, 146, 60, 0.12); border-color: rgba(251, 146, 60, 0.4); }
.status-error { color: var(--red); background: var(--red-soft); border-color: var(--red-line); }
.status-ok .status-dot { animation: pulse 2s infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: rgba(148, 163, 184, 0.06);
    color: var(--muted);
    font: 600 12px/1 var(--font);
    cursor: pointer;
    transition: 0.2s;
}
.icon-btn:hover { color: var(--text-strong); border-color: var(--text); }
.icon-btn.active { color: var(--green); border-color: var(--green-line); background: var(--green-soft); }
.icon-btn.ringing, #nav-sound.ringing { animation: ring 0.9s ease-in-out infinite; }

@keyframes ring {
    0%, 100% { transform: rotate(0); box-shadow: 0 0 0 0 rgba(0, 242, 165, 0.5); }
    20% { transform: rotate(-12deg); }
    40% { transform: rotate(10deg); }
    60% { transform: rotate(-6deg); box-shadow: 0 0 0 10px rgba(0, 242, 165, 0); }
    80% { transform: rotate(4deg); }
}

.icon-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
}
.icon-x:hover { color: var(--red); border-color: var(--red-line); }

.user-chip { display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 1px solid var(--line); }
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), var(--blue));
    color: #03140e;
    font-weight: 800;
    font-size: 13px;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { color: var(--text-strong); font-weight: 700; font-size: 13px; }
.user-role { font-size: 10px; text-transform: uppercase; color: var(--yellow); letter-spacing: 0.08em; }
.logout-link { color: var(--muted); display: inline-flex; padding: 6px; border-radius: 8px; font-size: 17px; transition: 0.2s; }
.logout-link:hover { color: var(--red); background: var(--red-soft); }

/* ---------- Panel zvuka i upozorenja ---------- */

.sound-panel {
    position: fixed;
    top: calc(var(--topbar-h) + 8px);
    right: 24px;
    z-index: 70;
    width: min(370px, calc(100vw - 24px));
    max-height: calc(100vh - var(--topbar-h) - 24px);
    overflow-y: auto;
    padding: 16px 18px 18px;
    background: rgba(12, 19, 28, 0.94);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: pop-in 0.18s ease-out;
}

.sp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sp-head strong { color: var(--text-strong); font-size: 15px; }

.switch-row, .select-row, .range-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    color: var(--text-strong);
    font-size: 13px;
}
.switch-row small { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; font-size: 11px; }
.range-row { flex-direction: column; align-items: stretch; gap: 8px; }
.range-row label { display: flex; justify-content: space-between; }
.range-row output { color: var(--green); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--green); height: 22px; cursor: pointer; }
.select-row select { max-width: 190px; }

.switch { position: relative; flex-shrink: 0; width: 42px; height: 24px; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #243241; transition: 0.2s; }
.switch i::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #94a3b8;
    transition: 0.2s;
}
.switch input:checked + i { background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green-line); }
.switch input:checked + i::after { transform: translateX(18px); background: var(--green); }
.switch input:disabled + i { opacity: 0.4; }
.switch input:focus-visible + i { outline: 2px solid var(--green); outline-offset: 2px; }

.test-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
.btn-test { background: transparent; border-color: var(--line-strong); color: var(--text-strong); }
.btn-test-buy { color: var(--green); border-color: var(--green-line); background: var(--green-soft); }
.btn-test-sell { color: var(--yellow); border-color: var(--yellow-line); background: var(--yellow-soft); }
.btn-test-stop { color: var(--red); border-color: var(--red-line); background: var(--red-soft); }
.btn-test:hover { filter: brightness(1.25); }

/* ---------- Banneri upozorenja ---------- */

.unlock-bar {
    position: fixed;
    left: 50%;
    bottom: calc(18px + var(--safe-b));
    transform: translateX(-50%);
    z-index: 150;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100vw - 24px);
    padding: 11px 18px;
    border-radius: 999px;
    border: 1px solid var(--yellow-line);
    background: rgba(40, 30, 6, 0.92);
    color: var(--yellow);
    font: 700 12px/1.3 var(--font);
    cursor: pointer;
    box-shadow: var(--shadow);
    animation: pop-in 0.25s ease-out;
}

.alert-stack {
    position: fixed;
    top: calc(var(--topbar-h) + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    width: min(600px, calc(100vw - 20px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.alert-card {
    --tone: var(--green);
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 14px 13px 16px;
    border-radius: 16px;
    background: rgba(10, 17, 25, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid color-mix(in srgb, var(--tone) 55%, transparent);
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55), 0 0 36px color-mix(in srgb, var(--tone) 22%, transparent);
    animation: alert-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2), alert-glow 1.6s ease-in-out infinite 0.3s;
}
.alert-buy { --tone: var(--green); }
.alert-sell { --tone: var(--yellow); }
.alert-stop { --tone: var(--red); }

.alert-icon { width: 30px; height: 30px; color: var(--tone); }
.alert-body { flex: 1; min-width: 0; }
.alert-title { color: var(--tone); font-weight: 800; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.alert-test { margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(148, 163, 184, 0.2); color: var(--text); letter-spacing: 0.05em; }
.alert-text { color: var(--text-strong); font-size: 14px; overflow-wrap: anywhere; }
.alert-text strong { font-size: 16px; }
.alert-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.alert-btn {
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text-strong);
    padding: 8px 12px;
    border-radius: 10px;
    font: 700 12px/1 var(--font);
    cursor: pointer;
}
.alert-btn-main { background: var(--tone); border-color: var(--tone); color: #05080d; }
.alert-x { border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 6px; }
.alert-x:hover { color: var(--text-strong); }

@keyframes alert-in { from { opacity: 0; transform: translateY(-14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes alert-glow { 0%, 100% { box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55), 0 0 22px color-mix(in srgb, var(--tone) 18%, transparent); } 50% { box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55), 0 0 46px color-mix(in srgb, var(--tone) 42%, transparent); } }
.alert-card.alert-out { animation: alert-out 0.38s ease forwards; pointer-events: none; }
@keyframes alert-out { to { opacity: 0; transform: translateY(-12px) scale(0.96); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- Layout ---------- */

.page { max-width: 1680px; margin: 0 auto; padding: 26px 28px 56px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.live-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(148, 163, 184, 0.06);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2s infinite; }

.card {
    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 20px;
    scroll-margin-top: calc(var(--topbar-h) + 16px);
}

.card-head { margin-bottom: 16px; }
.card-head h2, .table-head h2 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-strong);
}
.card-head h2 .icon, .table-head h2 .icon { color: var(--green); font-size: 18px; }
.head-sub { color: var(--muted); font-weight: 500; font-size: 12px; }
.sub-title { font-size: 13px; margin: 22px 0 10px; color: var(--text-strong); }

.count-pill, .tab-count {
    display: inline-block;
    min-width: 22px;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.positions-card .count-pill { background: var(--green-soft); color: var(--green); }

/* ---------- KPI ---------- */

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

.kpi {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(22, 34, 48, 0.85), rgba(14, 22, 32, 0.85));
    border: 1px solid var(--line);
    overflow: hidden;
}
.kpi::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.kpi-accent { border-color: var(--green-line); box-shadow: 0 0 40px rgba(0, 242, 165, 0.08); }
.kpi-accent::after { background: linear-gradient(90deg, transparent, var(--green), transparent); }

.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; }
.kpi-label .icon { font-size: 15px; color: var(--green); }
.kpi-value { color: var(--text-strong); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: 12px; }

.positive { color: var(--green); font-weight: 700; }
.negative { color: var(--red); font-weight: 700; }
.muted { color: var(--muted); }
.strong { color: var(--text-strong); font-weight: 700; }
.small { font-size: 11px; }
.projected { font-style: italic; opacity: 0.88; }
.ok-text { color: var(--green); }

/* ---------- Flash poruke ---------- */

.flash-stack { margin-bottom: 16px; }
.flash { padding: 13px 16px; border-radius: 12px; margin-bottom: 12px; border: 1px solid transparent; font-weight: 500; }
.flash-success { background: var(--green-soft); border-color: var(--green-line); color: var(--green); }
.flash-error { background: var(--red-soft); border-color: var(--red-line); color: #fda4af; }
.flash-warning { background: rgba(251, 146, 60, 0.12); border-color: rgba(251, 146, 60, 0.4); color: #fdba74; }

/* ---------- Dugmad i forme ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: 11px;
    border: 1px solid transparent;
    font: 700 13px/1.1 var(--font);
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.2s, filter 0.2s, background 0.2s;
    white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary { background: linear-gradient(135deg, var(--green), #19d4c4); color: #03140e; }
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 24px rgba(0, 242, 165, 0.35); filter: brightness(1.08); }
.btn-yellow { background: var(--yellow); color: #111; }
.btn-yellow:hover:not(:disabled) { box-shadow: 0 6px 24px rgba(240, 185, 11, 0.35); filter: brightness(1.08); }
.btn-danger { background: var(--red-soft); color: #fda4af; border-color: var(--red-line); }
.btn-danger:hover:not(:disabled) { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled) { color: var(--text-strong); border-color: var(--text); }
.btn-small { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; padding: 13px; font-size: 14px; }

.btn-binance {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--yellow);
    color: #111;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.03em;
    transition: 0.2s;
}
.btn-binance:hover { background: #fcd535; box-shadow: 0 6px 22px rgba(240, 185, 11, 0.35); }

input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select {
    background: rgba(5, 8, 13, 0.6);
    border: 1px solid var(--line-strong);
    color: var(--text-strong);
    border-radius: 11px;
    padding: 10px 13px;
    font: 500 14px var(--font);
    min-width: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}
select { cursor: pointer; }
input:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 242, 165, 0.16); }
input::placeholder { color: #4b5b70; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-cancel-button { filter: invert(0.7); cursor: pointer; }
input[type="date"] { color-scheme: dark; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > span, .calc-field > span { color: var(--muted); font-size: 12px; font-weight: 600; }

.checkbox { display: flex; align-items: center; gap: 9px; color: var(--text); cursor: pointer; }
.checkbox input { accent-color: var(--green); width: 17px; height: 17px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px 22px; align-items: start; }
.form-actions { grid-column: 1 / -1; }
.form-row, .filter-form, .inline-form, .action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.card > .inline-form { margin-top: 16px; }
.form-hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.info-grid > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: rgba(148, 163, 184, 0.05); border: 1px solid var(--line); }
.info-grid strong { color: var(--text-strong); font-size: 15px; font-variant-numeric: tabular-nums; }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border-radius: 999px; font-weight: 700; font-size: 12px; border: 1px solid transparent; }
.chip button { background: rgba(255, 255, 255, 0.08); border: none; color: inherit; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; line-height: 1; }
.chip button:hover { background: rgba(255, 255, 255, 0.2); }
.chip-green { color: var(--green); background: var(--green-soft); border-color: var(--green-line); }
.chip-red { color: #fda4af; background: var(--red-soft); border-color: var(--red-line); }

.subnav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; scrollbar-width: none; position: sticky; top: var(--topbar-h); z-index: 10; padding-top: 8px; background: linear-gradient(180deg, var(--bg) 60%, transparent); }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex-shrink: 0; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); font-weight: 600; font-size: 12px; background: rgba(148, 163, 184, 0.05); }
.subnav a:hover { color: var(--text-strong); border-color: var(--text); }

.tip-list { margin: 12px 0 0 18px; display: grid; gap: 7px; color: var(--text); font-size: 13px; }
.lan-url { font-size: 20px; font-weight: 800; margin: 6px 0 4px; }
.lan-url a { color: var(--green); word-break: break-all; }

/* ---------- Kalkulator ---------- */

.calculator-bar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px 28px; padding: 16px 22px; }
.calc-fields { display: flex; gap: 14px; flex-wrap: wrap; }
.calc-field { display: flex; flex-direction: column; gap: 6px; }
.calc-field input { width: 180px; font-weight: 700; font-variant-numeric: tabular-nums; }
.calc-note { color: var(--muted); font-size: 12px; max-width: 520px; margin-left: auto; }

/* ---------- Tabele ---------- */

.table-card { padding: 0; overflow: hidden; }
.table-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.table-note { padding: 10px 24px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); background: rgba(148, 163, 184, 0.03); }
.table-scroll { overflow-x: auto; }

.positions-card { border-color: var(--green-line); box-shadow: var(--glow); }
.positions-card .table-head { background: linear-gradient(90deg, rgba(0, 242, 165, 0.11), transparent 70%); }
.positions-card .row-buy { background: rgba(0, 242, 165, 0.035); }

.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th {
    background: rgba(5, 8, 13, 0.4);
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 14px;
    font-weight: 700;
    white-space: nowrap;
}
.data-table th:first-child, .data-table td:first-child { padding-left: 20px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 20px; }
.data-table td { padding: 14px; border-bottom: 1px solid var(--line); font-size: 13px; white-space: nowrap; vertical-align: middle; }
.data-table tbody tr { transition: background 0.2s; }
.data-table tbody tr:hover { background: var(--surface-hover); }
.data-table tbody tr:last-child td { border-bottom: 0; }

.signal-row { cursor: pointer; }
.static-rows .signal-row, .static-rows .user-row { cursor: default; }
.empty-state { text-align: center; padding: 52px 18px; color: var(--muted); white-space: normal; }

.row-sell { box-shadow: inset 3px 0 0 var(--yellow); }
.row-buy { box-shadow: inset 3px 0 0 var(--green); }
.row-stop { box-shadow: inset 3px 0 0 var(--red); }
.row-stop td { opacity: 0.8; }

.row-enter { animation: row-in 0.9s ease-out; }
@keyframes row-in { 0% { background: rgba(0, 242, 165, 0.28); transform: translateX(-8px); opacity: 0; } 25% { opacity: 1; transform: none; } 100% { background: transparent; } }

.coin-box { display: flex; align-items: center; gap: 12px; }
.coin-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1b2c3d, #142130);
    border: 1px solid var(--line-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--text-strong);
    font-size: 11px;
    flex-shrink: 0;
}
.coin-name { font-weight: 800; color: var(--text-strong); font-size: 14px; }
.coin-sub { font-size: 10px; color: var(--muted); letter-spacing: 0.05em; }
.signal-row .coin-name { text-decoration: underline dotted rgba(148, 163, 184, 0.45); text-underline-offset: 3px; }
.static-rows .coin-name { text-decoration: none; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge-buy { color: var(--green); background: var(--green-soft); border-color: var(--green-line); }
.badge-sell { color: var(--yellow); background: var(--yellow-soft); border-color: var(--yellow-line); }
.badge-profit { color: var(--green); background: var(--green-soft); border-color: var(--green-line); }
.badge-stop { color: var(--red); background: var(--red-soft); border-color: var(--red-line); }
.badge-watch { color: #94a3b8; background: rgba(148, 163, 184, 0.1); border-color: rgba(148, 163, 184, 0.2); font-weight: 600; }
.badge-warn { color: var(--orange); background: rgba(251, 146, 60, 0.12); border-color: rgba(251, 146, 60, 0.35); }
.badge-breakout { color: #03140e; background: linear-gradient(135deg, var(--green), #38e8d0); border-color: var(--green); box-shadow: 0 0 16px rgba(0, 242, 165, 0.4); }

.trailing-line { color: var(--yellow); font-weight: 700; }

/* ---------- Tabovi ---------- */

.filter-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; background: rgba(148, 163, 184, 0.07); border-radius: 999px; }
.tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 0;
    color: var(--muted);
    border-radius: 999px;
    padding: 7px 14px;
    font: 700 12px var(--font);
    cursor: pointer;
    transition: 0.2s;
}
.tab:hover { color: var(--text-strong); }
.tab.active { background: var(--surface-2); color: var(--green); box-shadow: inset 0 0 0 1px var(--green-line); }

/* ---------- Modal ---------- */

.modal-overlay { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(3, 6, 10, 0.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade-in 0.2s ease-out; }
.modal {
    display: flex;
    flex-direction: column;
    width: min(1140px, 100%);
    max-height: calc(100vh - 40px);
    background: var(--surface-solid);
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    outline: none;
    animation: modal-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.modal-grab { display: none; }
.modal-head { display: flex; align-items: center; gap: 18px; padding: 16px 22px; border-bottom: 1px solid var(--line); background: rgba(5, 8, 13, 0.4); }
.modal-heading { flex: 1; min-width: 0; }
.modal-heading h2 { font-size: 20px; font-weight: 800; }
.modal-status { margin-top: 6px; }
.modal-price { font-size: 24px; font-weight: 800; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.modal-body { padding: 18px 22px; overflow-y: auto; overscroll-behavior: contain; }

.modal-chart { height: 420px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 14px; background: #0a1119; overflow: hidden; position: relative; }
.modal-chart iframe { position: relative; z-index: 1; width: 100%; height: 100%; border: 0; display: block; }
.chart-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; z-index: 0; color: var(--muted); font-size: 13px; padding: 20px; text-align: center; }

.modal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.modal-panel { background: rgba(148, 163, 184, 0.04); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.modal-panel h3 { display: flex; align-items: center; gap: 8px; color: var(--text-strong); font-size: 13px; margin-bottom: 10px; }
.modal-panel h3 .icon { color: var(--green); }

.kv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv-row:last-child { border-bottom: 0; }
.kv-label { color: var(--muted); }
.kv-value { color: var(--text-strong); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.kv-total { margin-top: 4px; padding-top: 9px; border-top: 1px solid var(--line-strong); }

.exhaustion { margin-top: 12px; padding: 10px 13px; border-radius: 10px; font-size: 12.5px; font-weight: 700; border: 1px solid transparent; }
.exhaustion-exhausted { color: var(--green); background: var(--green-soft); border-color: var(--green-line); }
.exhaustion-fading { color: var(--yellow); background: var(--yellow-soft); border-color: var(--yellow-line); }
.exhaustion-active { color: var(--red); background: var(--red-soft); border-color: var(--red-line); }
.exhaustion-none { color: #94a3b8; background: rgba(148, 163, 184, 0.1); border-color: rgba(148, 163, 184, 0.2); }
.modal-note { margin-top: 10px; color: var(--muted); font-size: 11.5px; }

.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); background: rgba(5, 8, 13, 0.4); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 10px;
    vertical-align: -2px;
    border: 2px solid var(--line-strong);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Login ---------- */

.login-body { display: flex; align-items: center; justify-content: center; overflow-x: hidden; }
.login-body .page { width: 100%; max-width: 460px; padding: 24px; position: relative; }
.login-orb { position: fixed; width: 520px; height: 520px; border-radius: 50%; filter: blur(90px); opacity: 0.32; pointer-events: none; z-index: 0; }
.orb-a { background: #00f2a5; top: -220px; left: -160px; }
.orb-b { background: #38bdf8; bottom: -240px; right: -180px; opacity: 0.22; }

.login-card {
    position: relative;
    z-index: 1;
    background: rgba(14, 22, 32, 0.82);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    padding: 38px 34px 28px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand h1 { font-size: 28px; font-weight: 800; letter-spacing: 0.05em; margin-top: 16px; }
.login-brand p { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; margin-top: 4px; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-form input[type="text"], .login-form input[type="password"] { padding: 13px 15px; font-size: 15px; width: 100%; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 46px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent; border: 0; color: var(--muted); padding: 8px; border-radius: 8px; cursor: pointer; font-size: 17px; }
.password-toggle:hover, .password-toggle.on { color: var(--green); }
.login-points { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 18px; list-style: none; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }
.login-points li { display: inline-flex; align-items: center; gap: 6px; }
.login-points .icon { color: var(--green); }

/* ---------- Dashboard: alatke u zaglavlju ---------- */

.head-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.calc-inline {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(148, 163, 184, 0.05);
}
.calc-inline .calc-field { gap: 3px; }
.calc-inline .calc-field > span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.calc-inline input { width: 120px; padding: 6px 10px; font-size: 14px; font-weight: 700; border-radius: 9px; }
.calc-inline .calc-field-small input { width: 74px; }

.kpi-dip .kpi-label .icon { color: var(--blue); }
.kpi-dip .kpi-value { color: var(--blue); }

/* ---------- Otvorene pozicije: kartice ---------- */

.positions-section { margin-bottom: 22px; }
.section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; }
.section-head h2 { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; }
.section-head h2 .icon { color: var(--green); font-size: 19px; }
.positions-section .count-pill { background: var(--green-soft); color: var(--green); }

.position-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.position-grid.is-empty { display: block; }

.positions-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1px dashed var(--line-strong);
    background: rgba(148, 163, 184, 0.04);
    color: var(--muted);
    font-weight: 500;
}
.positions-empty .icon { font-size: 20px; color: var(--green); opacity: 0.8; }

.pos-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 18px 14px;
    border-radius: var(--radius);
    background: linear-gradient(165deg, rgba(0, 242, 165, 0.09), rgba(14, 22, 32, 0.9) 42%);
    border: 1px solid var(--green-line);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35), 0 0 36px rgba(0, 242, 165, 0.07);
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.2s, border-color 0.2s;
    min-width: 0;
}
.pos-card:hover { transform: translateY(-2px); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 44px rgba(0, 242, 165, 0.14); }
.pos-card.is-trailing { border-color: rgba(0, 242, 165, 0.75); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35), 0 0 48px rgba(0, 242, 165, 0.2); }
.pos-card.is-loss { background: linear-gradient(165deg, rgba(255, 84, 112, 0.09), rgba(14, 22, 32, 0.9) 42%); border-color: var(--red-line); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }

.pos-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pos-top .badge { font-size: 11px; padding: 4px 9px; text-align: right; }

.pos-main { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pos-pct { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.pos-net { font-size: 14px; font-weight: 700; }

.range-bar { display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.rb-track { position: relative; height: 8px; margin: 8px 0 2px; border-radius: 999px; background: rgba(148, 163, 184, 0.16); }
.rb-fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, rgba(0, 242, 165, 0.35), var(--green)); }
.range-bar.is-down .rb-fill { background: linear-gradient(90deg, var(--red), rgba(255, 84, 112, 0.35)); }
.rb-tick { position: absolute; top: -5px; width: 3px; height: 18px; margin-left: -1.5px; border-radius: 2px; background: #94a3b8; }
.rb-be { background: var(--yellow); }
.rb-floor { background: var(--red); }
.rb-peak { background: var(--blue); }
.rb-price {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: var(--green);
    border: 3px solid #0b121a;
    box-shadow: 0 0 0 2px var(--green), 0 0 14px rgba(0, 242, 165, 0.7);
    transition: left 0.5s ease;
}
.range-bar.is-down .rb-price { background: var(--red); box-shadow: 0 0 0 2px var(--red), 0 0 14px rgba(255, 84, 112, 0.7); }
.rb-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.lg::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #94a3b8; vertical-align: 0; }
.lg-be::before { background: var(--yellow); }
.lg-floor::before { background: var(--red); }
.lg-peak::before { background: var(--blue); }
.lg-price::before { background: var(--green); }

.pos-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.pos-stat dt { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; line-height: 1.3; }
.pos-stat dd { margin-top: 2px; color: var(--text-strong); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }

.pos-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }

.card-enter { animation: card-in 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(0.97); box-shadow: 0 0 0 0 rgba(0, 242, 165, 0.6); } to { opacity: 1; transform: none; } }

/* ---------- Radar kandidati ---------- */

.radar-card .table-head { gap: 14px; }
.table-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.table-title h2 { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; }
.table-title h2 .icon { color: var(--green); font-size: 19px; }

.search-box { position: relative; display: flex; align-items: center; }
.search-box .icon { position: absolute; left: 12px; color: var(--muted); font-size: 16px; pointer-events: none; }
.search-box input { padding: 9px 13px 9px 36px; width: 220px; border-radius: 999px; font-size: 13px; }

.tabs-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: rgba(148, 163, 184, 0.025); }
.sort-hint { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11.5px; }
.tab-dip.active { color: var(--blue); box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45); }
.tab-dip .tab-count { background: var(--blue-soft); color: var(--blue); }
.tab-deep .tab-count { background: rgba(251, 146, 60, 0.14); color: var(--orange); }

.badge-dip { color: var(--blue); background: var(--blue-soft); border-color: rgba(56, 189, 248, 0.45); }
.row-dip { background: rgba(56, 189, 248, 0.05); box-shadow: inset 3px 0 0 var(--blue); }
.row-deep { box-shadow: inset 3px 0 0 var(--orange); }
.row-deep .coin-name { color: #fdba74; }

.cell-change { min-width: 120px; }
.cell-change > .num { display: block; font-weight: 800; font-size: 14px; }
.zone-meter { position: relative; width: 110px; height: 6px; margin-top: 7px; border-radius: 999px; background: rgba(148, 163, 184, 0.16); }
.zone-band { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: rgba(0, 242, 165, 0.42); }
.zone-dot { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #cbd5e1; border: 2px solid #0b121a; box-shadow: 0 0 0 1.5px #cbd5e1; transition: left 0.5s ease; }
.zone-meter.in-zone .zone-dot { background: var(--green); box-shadow: 0 0 0 1.5px var(--green), 0 0 12px rgba(0, 242, 165, 0.8); }

/* ---------- Mobilna navigacija ---------- */

.bottom-nav { display: none; }

/* ---------- Responsivnost ---------- */

@media (max-width: 1400px) and (min-width: 861px) {
    .data-table th, .data-table td { padding-left: 10px; padding-right: 10px; }
    .data-table th:first-child, .data-table td:first-child { padding-left: 16px; }
    .data-table th:last-child, .data-table td:last-child { padding-right: 16px; }
    .table-head, .tabs-bar, .table-note { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 1180px) {
    .stat-chip { display: none; }
    .main-nav a { padding: 7px 11px; }
}

@media (max-width: 860px) {
    :root { --topbar-h: 56px; }

    .topbar { padding: 8px 14px; gap: 12px; }
    .main-nav, #sound-toggle, .user-meta, .user-avatar { display: none; }
    .brand-mark { width: 36px; height: 36px; font-size: 18px; }
    .brand-text small { display: none; }
    .user-chip { padding-left: 0; border-left: 0; }
    .status-pill { padding: 6px 11px; font-size: 10px; }
    .logout-link { font-size: 19px; padding: 8px; }

    .page { padding: 16px 14px calc(96px + var(--safe-b)); }
    .page-title { font-size: 22px; }
    .card { padding: 18px 16px; border-radius: 14px; }
    .card.table-card { padding: 0; }
    .card.calculator-bar { padding: 14px; }
    .info-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .info-grid strong { font-size: 14px; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .kpi { padding: 14px 14px; }
    .kpi-value { font-size: 22px; }
    .kpi-label { font-size: 10px; letter-spacing: 0.06em; }
    .kpi-sub { font-size: 11px; }

    .calculator-bar { padding: 14px 14px; }
    .calc-fields { width: 100%; }
    .calc-field { flex: 1; }
    .calc-field input { width: 100%; }
    .calc-note { margin-left: 0; }

    .table-head { padding: 16px 14px; }
    .table-note { padding: 10px 14px; }
    .table-head h2 { font-size: 13px; }
    .filter-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .tab { flex-shrink: 0; }
    .filter-form { width: 100%; }
    .filter-form > * { flex: 1 1 140px; }

    /* Tabele postaju kartice */
    .table-scroll { overflow: visible; }
    .data-table, .data-table tbody { display: block; width: 100%; }
    .data-table thead { display: none; }
    .data-table tbody { display: flex; flex-direction: column; gap: 12px; padding: 12px; }
    .data-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 14px;
        padding: 14px;
        background: var(--surface-2);
        border: 1px solid var(--line);
        border-radius: 14px;
    }
    .data-table tr.empty-row { display: block; padding: 0; background: none; border: 0; }
    .data-table td { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; font-size: 14px; }
    .data-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        color: var(--muted);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }
    .data-table td.cell-coin, .data-table td.cell-status, .data-table td.cell-action, .data-table td.cell-wide { grid-column: 1 / -1; }
    .data-table td.cell-coin::before, .data-table td.cell-action::before { display: none; }
    .data-table td.cell-action .btn-binance { width: 100%; padding: 11px; }
    .data-table tbody tr:hover { background: var(--surface-2); }

    .row-buy, .row-sell, .row-stop { box-shadow: none; }
    .row-buy { border-left: 3px solid var(--green) !important; }
    .row-sell { border-left: 3px solid var(--yellow) !important; }
    .row-stop { border-left: 3px solid var(--red) !important; }
    .row-stop td { opacity: 0.85; }
    .data-table .empty-state { padding: 36px 12px; }

    /* Dashboard na telefonu */
    .data-table td:first-child, .data-table td:last-child { padding: 0; }
    .head-tools { width: 100%; }
    .calc-inline { flex: 1; }
    .calc-inline .calc-field { flex: 1; }
    .calc-inline input, .calc-inline .calc-field-small input { width: 100%; }
    .live-chip { padding: 6px 11px; font-size: 11px; }

    .section-head .head-sub { font-size: 11px; }
    .position-grid {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        margin: 0 -14px;
        padding: 4px 14px 10px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .position-grid::-webkit-scrollbar { display: none; }
    .position-grid.is-empty { display: block; overflow: visible; }
    .pos-card { flex: 0 0 88%; scroll-snap-align: center; }
    .pos-card:hover { transform: none; }
    .pos-pct { font-size: 28px; }
    .position-grid > .pos-card:only-child { flex-basis: 100%; }

    .search-box { width: 100%; }
    .search-box input { width: 100%; }
    .tabs-bar { padding: 10px 14px; flex-direction: column; align-items: stretch; }
    .tabs-bar .filter-tabs { border-radius: 14px; }
    .sort-hint { font-size: 11px; }
    .cell-change { min-width: 0; }
    .zone-meter { width: 100%; max-width: 160px; }
    .data-table td.cell-result { grid-column: 1 / -1; }
    .data-table td.cell-result:has(> .muted:only-child) { display: none; }
    .data-table tr.row-dip { background: rgba(56, 189, 248, 0.08); border-left: 3px solid var(--blue) !important; }
    .row-deep { border-left: 3px solid var(--orange) !important; }
    .row-dip, .row-deep { box-shadow: none; }

    /* Donja navigacija */
    .bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        padding: 6px 8px calc(6px + var(--safe-b));
        background: rgba(7, 11, 17, 0.88);
        backdrop-filter: saturate(160%) blur(20px);
        -webkit-backdrop-filter: saturate(160%) blur(20px);
        border-top: 1px solid var(--line-strong);
    }
    .bottom-nav a, .bottom-nav button {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding: 8px 4px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: var(--muted);
        font: 700 10px/1 var(--font);
        cursor: pointer;
        letter-spacing: 0.03em;
    }
    .bottom-nav .icon { font-size: 22px; }
    .bottom-nav a.active { color: var(--green); background: var(--green-soft); }

    /* Panel zvuka: donji sheet */
    .sound-panel {
        top: auto;
        right: 8px;
        left: 8px;
        bottom: calc(70px + var(--safe-b));
        width: auto;
        max-height: 70vh;
        border-radius: 20px;
    }

    /* Banneri preko celog ekrana */
    .alert-stack { top: calc(var(--topbar-h) + 6px); width: calc(100vw - 16px); }
    .alert-card { flex-wrap: wrap; padding: 12px; }
    .alert-actions { width: 100%; justify-content: flex-end; }
    .alert-btn-main { flex: 1; padding: 11px; font-size: 13px; }
    .unlock-bar { bottom: calc(76px + var(--safe-b)); width: calc(100vw - 24px); border-radius: 16px; text-align: left; }

    /* Modal kao donji sheet */
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal { width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; animation: sheet-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1); }
    .modal-grab { display: block; width: 44px; height: 4px; margin: 8px auto 0; border-radius: 999px; background: var(--line-strong); }
    .modal-head { padding: 12px 16px; gap: 12px; }
    .modal-heading h2 { font-size: 18px; }
    .modal-price { font-size: 19px; }
    .modal-body { padding: 14px 16px; }
    .modal-chart { height: 300px; }
    .modal-foot { padding: 12px 16px calc(12px + var(--safe-b)); }
    .modal-foot .btn { flex: 1; }
    .modal-grid { grid-template-columns: 1fr; }

    .login-card { padding: 30px 22px 22px; border-radius: 20px; }
}

@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }

@media (max-width: 380px) {
    .kpi-grid { grid-template-columns: 1fr; }
    #system-status-text { display: none; }
}

/* ---------- Učitavanje stranice ---------- */

html.booting, html.booting body { overflow: hidden; }

.boot {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 22px;
    background:
        radial-gradient(ellipse 48% 38% at 50% 42%, rgba(0, 242, 165, 0.1), transparent 70%),
        var(--bg);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.6s;
}
.boot.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.boot-radar { position: relative; width: 148px; height: 148px; }
.boot-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(0, 242, 165, 0.32);
    animation: boot-pulse 2.6s ease-in-out infinite;
}
.boot-ring.r1 { inset: 0; }
.boot-ring.r2 { inset: 20px; animation-delay: 0.25s; }
.boot-ring.r3 { inset: 40px; animation-delay: 0.5s; }
.boot-sweep {
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 70%, rgba(0, 242, 165, 0.08) 84%, rgba(0, 242, 165, 0.85) 100%);
    -webkit-mask: radial-gradient(circle, transparent 58%, #000 59%);
    mask: radial-gradient(circle, transparent 58%, #000 59.5%);
    animation: boot-spin 1.45s linear infinite;
    will-change: transform;
}
.boot-core {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 9px;
    margin: -4.5px 0 0 -4.5px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 18px var(--green);
}
.boot-blip {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px var(--green);
    animation: boot-blip 2.2s ease-in-out infinite;
}
.boot-blip.b1 { top: 18px; right: 34px; }
.boot-blip.b2 { bottom: 28px; left: 26px; background: var(--blue); box-shadow: 0 0 12px var(--blue); animation-delay: 0.7s; }

.boot-word {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.28em;
    color: var(--text-strong);
}
.boot-word em {
    font-style: normal;
    background: linear-gradient(100deg, var(--green), var(--blue));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.boot-track {
    width: 132px;
    height: 2px;
    border-radius: 99px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}
.boot-track span {
    display: block;
    height: 100%;
    width: 42%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, var(--green), var(--blue));
    animation: boot-slide 1.05s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes boot-spin { to { transform: rotate(360deg); } }
@keyframes boot-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}
@keyframes boot-blip {
    0%, 100% { transform: scale(0.55); opacity: 0.25; }
    50% { transform: scale(1); opacity: 1; }
}
@keyframes boot-slide {
    0% { transform: translateX(-130%); }
    100% { transform: translateX(340%); }
}

/* ---------- Uputstvo ---------- */

.guide { max-width: 860px; }
.guide-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.guide-toc a {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
}
.guide-toc a:hover { color: var(--text-strong); border-color: var(--green); }
.guide h2 { font-size: 20px; margin: 0 0 10px; letter-spacing: -0.02em; }
.guide h3 { font-size: 15px; margin: 18px 0 6px; color: var(--text-strong); }
.guide p, .guide li { color: var(--text); font-size: 15px; line-height: 1.6; }
.guide p { margin: 0 0 10px; }
.guide ul, .guide ol { margin: 6px 0 12px; padding-left: 1.25em; }
.guide li { margin: 5px 0; }
.guide strong { color: var(--text-strong); }
.guide .note {
    margin: 12px 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--yellow) 45%, transparent);
    background: color-mix(in srgb, var(--yellow) 8%, transparent);
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
