:root {
  --bg: #0f1420; --panel: #161c2b; --line: #263049; --text: #dfe5f2; --muted: #8a94ab;
  --green: #22c55e; --red: #ef4444; --yellow: #eab308; --blue: #3b82f6; --orange: #f59e0b; --aqua: #22d3ee;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.4 "Segoe UI", system-ui, sans-serif; }
header { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 16px; }
#status { flex: 1; }
.muted { color: var(--muted); }
button { background: #222b40; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; cursor: pointer; }
button:hover { border-color: var(--blue); }
button.on, button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
main { display: grid; grid-template-columns: 380px 1fr 360px; gap: 10px; padding: 10px; height: calc(100vh - 90px); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow: auto; }
h2 { font-size: 13px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; }
#watch tbody tr { cursor: pointer; }
#watch tbody tr:hover, #watch tbody tr.sel { background: #1d2538; }
.up { color: var(--green); } .down { color: var(--red); }
.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-weight: 600; font-size: 11px; }
.b-buy { background: var(--green); color: #04130a; } .b-near { background: #4a3f12; color: var(--yellow); }
.b-sell { background: #4a1d1d; color: var(--red); }
.news-meta a { color: var(--muted); }
.b-top { outline: 2px solid #fff; }
.box { margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #121827; }
.note { color: var(--muted); font-size: 11px; }
#center { display: flex; flex-direction: column; }
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
#chartSym { font-weight: 700; font-size: 15px; }
.tfs button { margin-left: 4px; }
#chart { flex: 1; min-height: 300px; }
.legend { margin-top: 4px; font-size: 11px; }
.dot { display: inline-block; width: 10px; height: 3px; margin: 0 4px 2px 8px; vertical-align: middle; }
.dot.pre { background: rgba(41, 98, 255, 0.55); height: 8px; }
.dot.post { background: rgba(255, 152, 0, 0.5); height: 8px; }
.dot.orange { background: var(--orange); } .dot.aqua { background: var(--aqua); }
.tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.hidden { display: none; }
label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
input, select { width: 100%; margin-top: 2px; padding: 5px 7px; background: #0f1420; color: var(--text); border: 1px solid var(--line); border-radius: 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.kv { display: flex; justify-content: space-between; padding: 2px 0; }
.kv b { color: var(--text); }
.warn { color: var(--yellow); }
.news-item { padding: 7px 0; border-bottom: 1px solid var(--line); }
.news-item a { color: var(--text); text-decoration: none; }
.news-item a:hover { color: var(--blue); }
.news-meta { color: var(--muted); font-size: 11px; }
footer { padding: 0 16px; font-size: 11px; }
@media (max-width: 1200px) { main { grid-template-columns: 1fr; height: auto; } #chart { height: 420px; } }
.live-on { color: var(--green); font-weight: 600; }
.tfs { display: flex; align-items: center; }
.tfs input[type=date] { width: auto; margin: 0 0 0 4px; padding: 3px 6px; }
.hist-badge { color: var(--yellow); font-weight: 700; font-size: 11px; margin-right: 6px; }
#who { margin-left: 4px; }
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.login-box { width: 100%; max-width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 22px; }
.login-box .brand { font-size: 20px; margin-bottom: 4px; }
.login-box button { width: 100%; padding: 8px; margin-top: 6px; }
.login-box #msg { margin-top: 10px; min-height: 1em; }

/* --- Aplikacija (PWA) i telefon --- */
body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.ios-hint { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50; background: var(--panel); border: 1px solid var(--blue); border-radius: 10px; padding: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.5); }
.ios-hint button { margin-left: 8px; }
@media (max-width: 760px) {
  header { flex-wrap: wrap; gap: 6px 10px; padding: 8px 12px; }
  header #status { order: 10; flex-basis: 100%; font-size: 11px; }
  main { padding: 8px; gap: 8px; }
  .panel { padding: 8px; }
  th, td { padding: 4px 4px; font-size: 12px; }
  .chart-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .tfs { flex-wrap: wrap; gap: 4px; }
  .tfs button { margin-left: 0; padding: 5px 8px; }
  #chart { height: 360px; }
  .tabs { flex-wrap: wrap; }
  input, select, button { font-size: 16px; } /* iPhone ne zumira polja */
  .grid2 { grid-template-columns: 1fr; }
}
