:root {
  --bg: #0b0f17;
  --panel: #121826;
  --panel-2: #0f1520;
  --border: #1f2a3d;
  --text: #e6edf7;
  --muted: #8b98ad;
  --accent: #38bdf8;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  font-size: 15px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, #16233a 0%, var(--bg) 55%);
  color: var(--text);
  font-family: "Segoe UI", "Inter", system-ui, sans-serif;
  min-height: 100vh;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 14px 22px;
  background: rgba(13, 19, 31, .92);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
}
.brand { font-weight: 800; letter-spacing: 3px; font-size: 1.15rem; display: flex; align-items: center; gap: 9px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.brand-sub { font-size: .65rem; letter-spacing: 1px; color: var(--muted); font-weight: 600; align-self: flex-end; margin-bottom: 2px; text-transform: uppercase; }
.kpis { display: flex; gap: 28px; flex-wrap: wrap; margin-left: 8px; }
.kpi { display: flex; flex-direction: column; }
.kpi-label { font-size: .68rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.kpi-value { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-small { font-size: .9rem; font-weight: 600; }
.pl-up { color: var(--green); }
.pl-down { color: var(--red); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.bot-btn {
  display: flex; align-items: center; gap: 9px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 18px; cursor: pointer; font-weight: 700; font-size: .85rem;
  letter-spacing: .5px; transition: border-color .2s;
}
.bot-btn:hover { border-color: var(--accent); }
.bot-led { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.bot-on .bot-led { background: var(--green); box-shadow: 0 0 10px var(--green); }
.bot-off .bot-led { background: var(--red); box-shadow: 0 0 10px var(--red); }
.logout { color: var(--muted); text-decoration: none; font-size: .85rem; }
.logout:hover { color: var(--text); }

/* ---------- Grid & carduri ---------- */
.grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  padding: 22px; max-width: 1400px; margin: 0 auto;
}
.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.card-wide { grid-column: 1 / -1; }
.card h2 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: 1.6px;
  color: var(--muted); margin-bottom: 14px; font-weight: 700;
}
.badge-usd { font-size: .65rem; background: var(--border); border-radius: 6px; padding: 2px 7px; margin-left: 6px; color: var(--accent); }
.chart-wrap { height: 300px; }

/* ---------- Tabele ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th {
  text-align: left; color: var(--muted); font-size: .68rem;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 6px 10px; border-bottom: 1px solid var(--border);
}
td { padding: 8px 10px; border-bottom: 1px solid rgba(31, 42, 61, .55); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .5px; }
.tag-buy { background: rgba(52, 211, 153, .15); color: var(--green); }
.tag-sell { background: rgba(248, 113, 113, .15); color: var(--red); }
.tag-us { background: rgba(56, 189, 248, .15); color: var(--accent); }
.tag-bvb { background: rgba(251, 191, 36, .15); color: var(--amber); }
.tag-hold { background: rgba(139, 152, 173, .12); color: var(--muted); }
.rsi { font-weight: 700; }
.rsi-low { color: var(--green); }
.rsi-high { color: var(--red); }
.empty { color: var(--muted); font-size: .85rem; padding: 10px 2px; }
.foot { text-align: center; color: var(--muted); font-size: .75rem; padding: 8px 20px 26px; }

/* ---------- Status piete in antet ---------- */
.mkt-status { display: flex; gap: 10px; }
.mkt-chip {
  display: flex; align-items: center; gap: 7px;
  font-size: .72rem; font-weight: 700; letter-spacing: 1px;
  color: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 13px;
}
.mkt-led { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.mkt-open { color: var(--text); }
.mkt-open .mkt-led { background: var(--green); box-shadow: 0 0 8px var(--green); }
.mkt-closed .mkt-led { background: var(--red); opacity: .7; }

/* ---------- Tiles indici & valute ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.tile {
  background: var(--bg); border: 1px solid var(--border); border-radius: 11px;
  padding: 13px 16px; display: flex; flex-direction: column; gap: 3px;
}
.tile-label { font-size: .68rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); font-weight: 700; }
.tile-value { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile > span:last-child { font-size: .8rem; font-weight: 700; }

/* ---------- Stiri: ticker pe un singur rand ---------- */
.news-ticker { overflow: hidden; position: relative; -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.news-track { display: flex; gap: 14px; width: max-content; animation: ticker linear infinite; }
.news-ticker:hover .news-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.news-card {
  flex: 0 0 280px; display: flex; flex-direction: column; text-decoration: none; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; transition: border-color .18s;
}
.news-card:hover { border-color: var(--accent); }
.news-img { height: 130px; background-size: cover; background-position: center; background-color: var(--panel-2); }
.news-img-empty { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #16233a, #0f1520); }
.news-img-empty span { font-size: 1rem; font-weight: 800; letter-spacing: 1px; color: var(--accent); opacity: .85; }
.news-body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 6px; }
.news-meta { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.news-src { color: var(--accent); font-weight: 700; }
.news-title { font-size: .88rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Notificari (bife) ---------- */
.notif-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; align-items: start; }
.check { display: flex; gap: 12px; cursor: pointer; align-items: flex-start; }
.check input { display: none; }
.check-box {
  flex: 0 0 22px; height: 22px; margin-top: 2px;
  border: 2px solid var(--border); border-radius: 6px;
  background: var(--bg); position: relative; transition: all .15s;
}
.check input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check-box::after {
  content: ''; position: absolute; left: 6px; top: 2px;
  width: 5px; height: 10px; border: solid #06121f;
  border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.check small { color: var(--muted); line-height: 1.35; display: inline-block; margin-top: 2px; }
.notif-fixed {
  color: var(--green); font-size: .82rem; font-weight: 600;
  border: 1px dashed rgba(52, 211, 153, .4); border-radius: 9px;
  padding: 10px 14px; align-self: center;
}

/* ---------- Cont demo (aspect platforma de trading) ---------- */
.demo-card { background: linear-gradient(180deg, #10192b 0%, #0c1220 100%); border-color: #24344d; }
.badge-demo { font-size: .62rem; background: rgba(56,189,248,.15); color: var(--accent); border-radius: 6px; padding: 3px 8px; margin-left: 8px; letter-spacing: .5px; text-transform: uppercase; }
.badge-demo.badge-on { background: rgba(52,211,153,.16); color: var(--green); }
.badge-demo.badge-off { background: rgba(251,191,36,.16); color: var(--amber); }
.demo-lead { font-size: .95rem; color: #c3cddc; margin-bottom: 16px; }
.demo-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; margin-bottom: 12px; }
.demo-input { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--accent); border-radius: 10px; padding: 0 14px; }
.demo-cur { color: var(--accent); font-weight: 800; font-size: 1.2rem; margin-right: 6px; }
.demo-input input { background: transparent; border: none; color: var(--text); font-size: 1.4rem; font-weight: 700; width: 160px; padding: 12px 0; font-variant-numeric: tabular-nums; }
.demo-input input:focus { outline: none; }
.demo-btn { background: var(--green); color: #052015; border: none; border-radius: 10px; padding: 0 26px; font-size: .95rem; font-weight: 800; letter-spacing: .5px; cursor: pointer; }
.demo-btn:hover { filter: brightness(1.1); }
.demo-note { font-size: .78rem; color: var(--muted); }

.demo-kpis { display: flex; gap: 26px; flex-wrap: wrap; align-items: center; padding: 4px 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.demo-kpi { display: flex; flex-direction: column; gap: 2px; }
.demo-kpi-label { font-size: .66rem; text-transform: uppercase; letter-spacing: 1.1px; color: var(--muted); }
.demo-kpi-value { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.demo-controls { margin-left: auto; display: flex; gap: 10px; }
.demo-mini { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 15px; font-weight: 700; font-size: .82rem; cursor: pointer; }
.demo-mini:hover { border-color: var(--accent); }
.demo-mini-ghost { color: var(--muted); }
.demo-chart-wrap { height: 220px; margin-bottom: 18px; }
.demo-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.demo-tables h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--accent); margin-bottom: 10px; }
.demo-sms-check { margin-top: 18px; max-width: 480px; }
@media (max-width: 860px) { .demo-tables { grid-template-columns: 1fr; } }

/* ---------- Conectare broker (Alpaca) ---------- */
.broker-card { background: linear-gradient(180deg, #131a2b 0%, #0c1220 100%); border-color: #263a55; }
.broker-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; max-width: 760px; align-items: end; }
.broker-field { display: flex; flex-direction: column; gap: 6px; }
.broker-field span { font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.broker-field input { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 9px; padding: 11px 13px; font-size: .95rem; font-family: ui-monospace, monospace; }
.broker-field input:focus { outline: none; border-color: var(--accent); }
.broker-mode { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: .85rem; color: #c3cddc; cursor: pointer; }
.broker-mode input { display: none; }
.broker-mode .check-box { flex: 0 0 20px; height: 20px; }
.broker-mode input:checked + .check-box { background: var(--green); border-color: var(--green); }
.broker-mode input:checked + .check-box::after { content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 9px; border: solid #052015; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.broker-card .demo-btn { grid-column: 1 / -1; justify-self: start; padding: 12px 30px; }
.broker-card a { color: var(--accent); }
.broker-connected { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.broker-check { width: 34px; height: 34px; border-radius: 50%; background: rgba(52,211,153,.16); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 900; flex: 0 0 34px; }
.broker-meta { font-size: .8rem; color: var(--muted); font-family: ui-monospace, monospace; margin-top: 2px; }
.broker-connected .demo-mini { margin-left: auto; }

/* ---------- Tinta de profit ---------- */
.demo-target { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 16px; }
.demo-target-head { display: flex; justify-content: space-between; font-size: .8rem; }
.demo-target-head .muted-inline { color: var(--muted); }
.demo-bar { height: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.demo-bar-fill { height: 100%; background: linear-gradient(90deg, #38bdf8, #34d399); border-radius: 999px; transition: width .4s; }
.demo-reached { color: var(--green); font-weight: 700; }
.demo-field-inline { display: flex; align-items: center; gap: 8px; }
.demo-field-inline label { font-size: .8rem; color: var(--muted); }
.demo-target-input { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 0 10px; }
.demo-target-input span { color: var(--green); font-weight: 800; }
.demo-target-input input { background: transparent; border: none; color: var(--text); font-size: 1rem; font-weight: 700; width: 90px; padding: 9px 4px; }
.demo-target-input input:focus { outline: none; }

/* ---------- Ghid ---------- */
.guide-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.guide h3 { font-size: .85rem; color: var(--accent); margin-bottom: 8px; letter-spacing: .5px; }
.guide p, .guide li { font-size: .86rem; color: #c3cddc; line-height: 1.55; }
.guide ul { padding-left: 18px; }
.guide li { margin-bottom: 5px; }

/* ---------- Login ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 36px 34px; width: 340px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.login-card .brand { justify-content: center; margin-bottom: 26px; }
.login-card label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin-bottom: 7px; }
.login-card input {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 11px 13px; font-size: 1rem; margin-bottom: 16px;
  letter-spacing: 1px;
}
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card button {
  width: 100%; background: var(--accent); color: #06121f;
  border: none; border-radius: 9px; padding: 12px;
  font-size: .95rem; font-weight: 800; letter-spacing: .5px; cursor: pointer;
}
.login-card button:hover { filter: brightness(1.1); }
.alert { background: rgba(248, 113, 113, .12); color: var(--red); border: 1px solid rgba(248, 113, 113, .3); border-radius: 9px; padding: 10px 13px; font-size: .85rem; margin-bottom: 16px; }
.info { background: rgba(52, 211, 153, .12); color: var(--green); border: 1px solid rgba(52, 211, 153, .3); border-radius: 9px; padding: 10px 13px; font-size: .85rem; margin-bottom: 16px; }
.btn-secondary { width: 100%; background: var(--panel-2) !important; color: var(--accent) !important; border: 1px solid var(--accent) !important; border-radius: 9px; padding: 12px; font-size: .95rem; font-weight: 800; letter-spacing: .5px; cursor: pointer; margin-bottom: 8px; transition: opacity .2s; }
.btn-secondary:hover:not(:disabled) { background: rgba(56, 189, 248, .1) !important; }
.btn-secondary:disabled { opacity: .4; cursor: not-allowed; border-color: var(--border) !important; color: var(--muted) !important; }
.brand-dot.arm { border: none; padding: 0; cursor: pointer; transition: all .2s; position: relative; }
.brand-dot.arm:hover { transform: scale(1.25); }
.brand-dot.arm.armed { background: var(--red); box-shadow: 0 0 14px var(--red); }
.brand-dot.arm::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; }
.arm-hint { font-size: .74rem; color: var(--muted); text-align: center; margin-bottom: 22px; line-height: 1.4; }
.muted { color: var(--muted); font-size: .8rem; margin-top: 12px; text-align: center; }

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .kpis { gap: 18px; }
  .kpi-value { font-size: 1.05rem; }
}
