:root {
  color-scheme: dark;
  --bg: #05080a;
  --panel: #080d10;
  --panel-2: #0b1115;
  --border: #26333a;
  --grid: rgba(95, 128, 141, .16);
  --text: #eef4f6;
  --muted: #8c9ba2;
  --cyan: #20c7e6;
  --cyan-soft: #2195b4;
  --red: #ff4048;
  --red-soft: #d52b31;
  --gray: #aeb6ba;
  --green: #65db57;
  --yellow: #f2c14e;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, Segoe UI, Arial, sans-serif; }
body { overflow-x: hidden; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(circle at 65% 10%, rgba(20, 103, 122, .06), transparent 34%), var(--bg); }
.topbar, .footerbar { min-height: 64px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: rgba(4, 8, 10, .96); }
.footerbar { min-height: 48px; border-top: 1px solid var(--border); border-bottom: 0; color: var(--cyan); font-size: 13px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 34px; height: 36px; display: flex; gap: 3px; align-items: center; }
.brand-mark span { width: 3px; background: var(--cyan); border-radius: 3px; box-shadow: 0 0 12px rgba(32,199,230,.35); }
.brand-mark span:nth-child(1), .brand-mark span:nth-child(5) { height: 13px; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(4) { height: 25px; }
.brand-mark span:nth-child(3) { height: 36px; }
.brand-title { font-size: 16px; letter-spacing: .14em; font-weight: 700; }
.brand-subtitle { margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: .18em; }
.top-status { display: flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: .05em; }
.status-dot, .mini-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #536068; margin-right: 7px; }
.status-dot.online, .mini-dot.online { background: var(--green); box-shadow: 0 0 10px rgba(101,219,87,.55); }
.status-dot.offline, .mini-dot.offline { background: var(--red); }
.divider { width: 1px; height: 25px; background: var(--border); margin: 0 12px; }
.dashboard { display: grid; grid-template-columns: 285px minmax(0, 1fr); gap: 14px; flex: 1; padding: 14px; }
.panel { border: 1px solid var(--border); background: linear-gradient(145deg, rgba(12,18,22,.96), rgba(6,10,13,.98)); border-radius: 12px; box-shadow: 0 15px 45px rgba(0,0,0,.20); }
.sidebar { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.sidebar section { padding: 24px; border-bottom: 1px solid var(--border); }
.sidebar section:last-child { border-bottom: 0; }
.eyebrow { color: var(--cyan); font-size: 12px; font-weight: 700; letter-spacing: .08em; margin-bottom: 18px; }
.symbol { font-size: 40px; font-weight: 700; letter-spacing: .01em; }
.meta-row { margin-top: 20px; display: flex; align-items: center; gap: 14px; color: var(--green); font-size: 12px; }
.pill { display: inline-flex; padding: 7px 9px; border: 1px solid var(--cyan-soft); border-radius: 4px; color: var(--cyan); }
.signal-section { position: relative; min-height: 250px; }
.main-signal { font-size: clamp(42px, 5vw, 68px); line-height: .96; font-weight: 800; letter-spacing: -.04em; word-break: break-word; }
.signal-code { position: absolute; top: 24px; right: 22px; width: 40px; height: 40px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; border: 1px solid currentColor; opacity: .9; }
.signal-action { margin-top: 26px; color: var(--text); font-size: 13px; line-height: 1.5; }
.signal-time { margin-top: 8px; color: var(--muted); font-size: 12px; }
.signal-buy .main-signal, .signal-buy .signal-code { color: var(--cyan); text-shadow: 0 0 28px rgba(32,199,230,.18); }
.signal-sell .main-signal, .signal-sell .signal-code { color: var(--red); text-shadow: 0 0 28px rgba(255,64,72,.18); }
.signal-ne .main-signal, .signal-ne .signal-code { color: var(--gray); }
.quick-stats { padding-top: 15px !important; padding-bottom: 15px !important; }
.stat-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 12px; color: var(--muted); }
.stat-row strong { color: var(--text); font-weight: 650; text-align: right; }
.legend { margin-top: auto; }
.legend > div:not(.eyebrow) { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 12px; }
.legend-chip { min-width: 35px; height: 28px; display: grid; place-items: center; border-radius: 4px; font-size: 11px; font-weight: 800; }
.legend-chip.buy { background: linear-gradient(180deg, #2bc5e2, #16738b); }
.legend-chip.sell { background: linear-gradient(180deg, #ef3e45, #9d171c); }
.legend-chip.neutral { background: linear-gradient(180deg, #c6cccf, #6c7478); color: #101417; }
.main-content { display: grid; grid-template-rows: minmax(360px, 1.55fr) minmax(250px, 1fr) auto; gap: 14px; min-width: 0; }
.chart-panel { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.panel-title-row { height: 54px; flex: 0 0 54px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; gap: 12px; }
.panel-title { color: var(--cyan); font-size: 12px; font-weight: 700; letter-spacing: .07em; }
.panel-subtitle, .score-note { color: var(--muted); font-size: 11px; margin-left: 12px; }
.range-control { color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.range-control select { margin-left: 8px; background: #0b1418; border: 1px solid var(--border); color: var(--text); border-radius: 5px; padding: 5px 8px; }
.canvas-wrap { position: relative; min-height: 0; flex: 1; }
canvas { width: 100%; height: 100%; display: block; }
.empty-state { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.empty-state.hidden { display: none; }
.details-panel { min-height: 190px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.detail-grid article { padding: 17px 20px; min-width: 0; border-right: 1px solid var(--border); }
.detail-grid article:last-child { border-right: 0; }
.detail-grid h3 { margin: 0 0 12px; color: var(--cyan); font-size: 10px; letter-spacing: .09em; }
.detail-grid p { margin: 6px 0; color: var(--muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.quality-badge { padding: 5px 9px; border: 1px solid var(--border); border-radius: 20px; color: var(--muted); font-size: 10px; }
.muted { color: var(--muted); }
.footer-icon { margin-right: 7px; }
@media (max-width: 1100px) {
  .dashboard { grid-template-columns: 235px minmax(0,1fr); }
  .sidebar section { padding: 18px; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid article:nth-child(2) { border-right: 0; }
  .detail-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 760px) {
  .topbar { padding: 0 14px; }
  .brand-subtitle { display: none; }
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .sidebar section { border-right: 1px solid var(--border); }
  .legend, .quick-stats { display: none; }
  .main-content { grid-template-rows: 420px 280px auto; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid article { border-right: 0; border-bottom: 1px solid var(--border); }
}


/* Secure remote additions */
.top-link {
  color: var(--cyan);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  background: #091015;
}
.top-link:hover { border-color: var(--cyan-soft); }
.logout-form { margin: 0; }
.top-button { cursor: pointer; font-family: inherit; }
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 12% 18%, rgba(32,199,230,.13), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(255,64,72,.08), transparent 28%),
    linear-gradient(160deg, #020608 0%, #071015 48%, #030709 100%);
}
.login-shell {
  width: min(1160px, 100%);
  display: grid;
  grid-template-columns: minmax(0,1.1fr) minmax(360px,.75fr);
  gap: 48px;
  align-items: center;
}
.login-brand { padding: 28px; }
.login-logo {
  width: 116px;
  height: 116px;
  object-fit: contain;
  margin-bottom: 28px;
  filter: drop-shadow(0 18px 38px rgba(0,0,0,.42));
}
.login-kicker,
.login-card-kicker {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  margin-bottom: 14px;
}
.login-brand h1 {
  margin: 0 0 18px;
  font-size: clamp(48px, 7vw, 86px);
  line-height: .92;
  letter-spacing: -.055em;
}
.login-brand p,
.login-card-copy {
  color: var(--muted);
  line-height: 1.7;
  max-width: 670px;
}
.login-card {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(12,18,22,.98), rgba(5,9,12,.99));
  border-radius: 20px;
  padding: 34px;
  box-shadow: 0 30px 80px rgba(0,0,0,.38);
}
.login-card h2 { margin: 0 0 8px; font-size: 30px; }
.login-form { display: grid; gap: 11px; margin-top: 24px; }
.login-form label {
  margin-top: 7px;
  color: #c5d0d5;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .06em;
}
.login-form input {
  width: 100%;
  border: 1px solid var(--border);
  background: #03080b;
  color: var(--text);
  border-radius: 8px;
  padding: 14px 15px;
  font-size: 16px;
  outline: none;
}
.login-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(32,199,230,.10);
}
.login-form button {
  margin-top: 14px;
  border: 0;
  border-radius: 8px;
  padding: 15px;
  background: linear-gradient(90deg, #20c7e6, #1b8eaa);
  color: #031014;
  font-weight: 900;
  letter-spacing: .09em;
  cursor: pointer;
}
.login-error,
.login-success {
  margin-top: 18px;
  border-radius: 8px;
  padding: 13px 15px;
  font-size: 13px;
}
.login-error {
  border: 1px solid rgba(255,64,72,.45);
  background: rgba(255,64,72,.09);
  color: #ff9ca1;
}
.login-success {
  border: 1px solid rgba(101,219,87,.45);
  background: rgba(101,219,87,.08);
  color: #a7f39d;
}
.login-error span { display: block; margin-top: 6px; }
.login-footnote {
  margin-top: 22px;
  color: #607179;
  font-size: 10px;
  letter-spacing: .08em;
}
.password-shell { width: min(540px, 100%); }
.password-card { width: 100%; }
.back-link {
  display: inline-block;
  margin-top: 22px;
  color: var(--cyan);
  text-decoration: none;
  font-size: 13px;
}
@media (max-width: 850px) {
  .login-shell { grid-template-columns: 1fr; gap: 10px; }
  .login-brand { text-align: center; padding: 10px; }
  .login-logo { width: 86px; height: 86px; margin-bottom: 16px; }
  .login-brand p { margin-left: auto; margin-right: auto; }
  .top-link { display: none; }
}


/* Multi-user administration */
.current-user {
  color: #c9d7dc;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  padding: 0 3px;
}
.users-page {
  align-items: start;
}
.users-shell {
  width: min(980px, 100%);
  margin: 20px auto;
}
.users-card {
  width: 100%;
}
.users-list {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.users-list-head,
.user-row {
  display: grid;
  grid-template-columns: 1.25fr .8fr .8fr 1.5fr;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
}
.users-list-head {
  background: #071015;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
}
.user-row {
  border-top: 1px solid var(--border);
  background: #050a0d;
  font-size: 13px;
}
.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.user-actions form {
  margin: 0;
}
.small-button {
  border: 1px solid var(--border);
  background: #0a1318;
  color: var(--cyan);
  border-radius: 5px;
  padding: 7px 9px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  cursor: pointer;
}
.danger-button {
  color: #ff858c;
  border-color: rgba(255,64,72,.38);
}
.user-enabled {
  color: #77e56a;
  font-weight: 800;
}
.user-disabled {
  color: #ff858c;
  font-weight: 800;
}
.new-user-block {
  margin-top: 28px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.new-user-block h3 {
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: .1em;
}
.user-form select {
  width: 100%;
  border: 1px solid var(--border);
  background: #03080b;
  color: var(--text);
  border-radius: 8px;
  padding: 14px 15px;
  font-size: 14px;
}
.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
}
.checkbox-row input {
  width: auto !important;
}
code {
  color: #a6eafa;
}
@media (max-width: 720px) {
  .users-list-head {
    display: none;
  }
  .user-row {
    grid-template-columns: 1fr;
  }
}
