/* Neon Trading theme */
:root{
  --bg:#0A1931;
  --card:#0F2747;
  --card2:#142F55;
  --border:#1E3A62;
  --text:#EAF2FF;
  --muted:#A9BDD9;
  --muted2:#6F86A7;
  --green:#00FFA3;
  --blue:#00C8FF;
  --purple:#8A2BE2;
  --warn:#FFB020;
  --danger:#FF4D6D;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
  --radius2: 22px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  background: radial-gradient(1200px 600px at 20% 0%, rgba(0,200,255,.10), transparent 60%),
              radial-gradient(900px 500px at 90% 20%, rgba(138,43,226,.12), transparent 55%),
              linear-gradient(180deg, rgba(0,255,163,.06), transparent 25%),
              var(--bg);
  color:var(--text);
}
a{color:var(--blue); text-decoration:none}
a:hover{text-decoration:underline}
.app{min-height:100%; display:flex; flex-direction:column}
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  backdrop-filter: blur(8px);
  background: rgba(10,25,49,.55);
  position:sticky; top:0; z-index:10;
}
.brand{display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:.2px}
.brand-dot{display:inline-block;width:10px;height:10px;border-radius:50%;background:var(--green);box-shadow:0 0 18px rgba(0,255,163,.45)}
.badge{
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--border);
  color:var(--muted);
  background: rgba(15,39,71,.6);
}
.actions{display:flex; gap:10px; align-items:center}
.btn{
  border:1px solid var(--border);
  background: rgba(15,39,71,.6);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  transition: transform .08s ease, border-color .12s ease, background .12s ease;
  user-select:none;
  font-weight:600;
}
.btn:hover{border-color: rgba(0,200,255,.55)}
.btn:active{transform:translateY(1px)}
.btn.primary{border:0; background: linear-gradient(90deg, rgba(0,255,163,.95), rgba(0,200,255,.9)); color:#031018;}
.btn.ghost{background:transparent}
.btn.small{padding:7px 10px; border-radius:10px; font-size:13px}
.container{width:100%; max-width:none; margin:0; padding:12px 12px 18px 12px; flex:1}
.card{background: rgba(15,39,71,.70); border:1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);}
.grid{display:grid; grid-template-columns:minmax(220px, 270px) 1fr; gap:12px; align-items:start}
@media (max-width: 980px){ .grid{grid-template-columns:1fr} }

.center{min-height: calc(100vh - 64px); display:flex; align-items:center; justify-content:center; padding:18px;}
.login{width:min(520px, 100%); padding:20px;}
.login h1{margin:0 0 8px 0; font-size:22px}
.login p{margin:0 0 16px 0; color:var(--muted); line-height:1.4}

.field{display:flex; flex-direction:column; gap:6px; margin:12px 0}
.label{font-size:12px; color:var(--muted2)}
.input{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(20,47,85,.45);
  color:var(--text);
  outline:none;
}
.input:focus{border-color: rgba(0,200,255,.6)}
.row{display:flex; gap:10px; align-items:center; justify-content:space-between}
.hint{font-size:12px; color:var(--muted2)}
.error{color: var(--danger); font-size:13px; margin-top:10px; display:none}

.sidebar{padding:14px}
.sidebar h2{margin:0 0 10px 0; font-size:15px; color:var(--muted)}
.pillbar{display:flex; gap:8px; margin-bottom:10px}
.pill{
  flex:1; text-align:center; padding:8px 10px; border-radius:999px;
  border:1px solid var(--border); color:var(--muted);
  background: rgba(20,47,85,.25); cursor:pointer; font-weight:700; font-size:12px; user-select:none;
}
.pill.active{color:#04141f; border:0; background: linear-gradient(90deg, rgba(0,255,163,.95), rgba(0,200,255,.9));}
.search{margin:10px 0 12px 0}
.account-list{display:flex; flex-direction:column; gap:10px}
.acct{
  padding:12px; border-radius:14px; border:1px solid var(--border);
  background: rgba(20,47,85,.28); cursor:pointer; display:flex; justify-content:space-between; gap:10px;
}
.acct:hover{border-color: rgba(0,200,255,.45)}
.acct.active{border-color: rgba(0,255,163,.65); background: rgba(0,255,163,.07)}
.acct .name{font-weight:800; font-size:14px}
.acct .sub{font-size:12px; color:var(--muted2); margin-top:4px}
.acct .meta{display:flex; flex-direction:column; align-items:flex-end; gap:6px}

.status{
  font-size:11px; padding:4px 8px; border-radius:999px;
  border:1px solid var(--border); color:var(--muted); background: rgba(15,39,71,.5); white-space:nowrap;
}
.status.ok{border-color: rgba(0,255,163,.35); color: rgba(0,255,163,.95)}
.status.warn{border-color: rgba(255,176,32,.35); color: rgba(255,176,32,.95)}

.dots{
  width:28px; height:28px; border-radius:10px; display:grid; place-items:center;
  border:1px solid var(--border); background: rgba(15,39,71,.45); cursor:pointer; user-select:none;
}
.dots:hover{border-color: rgba(0,200,255,.45)}

.menu{position:relative}
.menu-panel{
  position:absolute; right:0; top:36px;
  background: rgba(10,25,49,.92);
  border:1px solid var(--border);
  border-radius:14px;
  padding:8px;
  min-width: 200px;
  box-shadow: var(--shadow);
  display:none;
  z-index:5;
}
.menu-panel button{
  width:100%; text-align:left; border:0; background:transparent; color:var(--text);
  padding:10px 10px; border-radius:12px; cursor:pointer; font-weight:800;
}
.menu-panel button:hover{background: rgba(0,200,255,.08)}
.divider{height:1px; background: var(--border); margin:6px 0}

.main{padding:14px}
.header{display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:12px}
.title h1{margin:0; font-size:18px}
.title .sub{margin-top:6px; color:var(--muted); font-size:13px; line-height:1.35}

.summary{
  display:grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap:8px;
  margin: 12px 0 14px 0;
}
@media(max-width: 980px){ .summary{grid-template-columns: repeat(2, minmax(0,1fr))} }
.kpi{padding:12px; border-radius:14px; border:1px solid var(--border); background: rgba(20,47,85,.25);}
.kpi .k{font-size:12px; color:var(--muted2); font-weight:700}
.kpi .v{margin-top:6px; font-size:16px; font-weight:900}
.kpi .v.pos{color: rgba(0,255,163,.95)}
.kpi .v.neg{color: rgba(255,77,109,.95)}

.chart{
  padding:12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(20,47,85,.18);
  margin: 12px 0 12px 0;
}
.chart-head{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px}
.chart-title{font-weight:900}
.chart-actions{display:flex; gap:8px; align-items:center}
canvas{max-width:100%}
.mini{font-size:12px; color:var(--muted2); margin-top:6px; line-height:1.35}

.filters{
  display:flex; flex-wrap:wrap; gap:10px; align-items:end;
  padding:12px; border:1px solid var(--border); border-radius:14px;
  background: rgba(20,47,85,.18); margin-bottom: 12px;
}
.filters .field{margin:0; min-width:160px}
.filters .field.small{min-width:120px}
.table-wrap{border:1px solid var(--border); border-radius:14px; overflow:hidden; background: rgba(20,47,85,.18);}
table{width:100%; border-collapse:collapse; font-size:13px}
th, td{padding:10px 10px; border-bottom:1px solid rgba(30,58,98,.65); vertical-align:top}
th{position:sticky; top:0; background: rgba(10,25,49,.92); z-index:1; text-align:left; color: var(--muted); font-size:12px; letter-spacing:.2px;}
tr:hover td{background: rgba(0,200,255,.04)}
.pnl.pos{color: rgba(0,255,163,.95); font-weight:900}
.pnl.neg{color: rgba(255,77,109,.95); font-weight:900}

.note{
  width:100%; min-height:36px; border-radius:10px;
  border:1px solid rgba(30,58,98,.75);
  background: rgba(10,25,49,.35);
  color: var(--text);
  padding: 8px 8px;
  outline:none;
  font-size: 13px;
  resize: vertical;
}
.note:focus{border-color: rgba(0,200,255,.6)}
.note-save{display:flex; justify-content:flex-end; gap:8px; margin-top:6px}

.tag-select{
  width:100%;
  padding:8px 8px;
  border-radius:10px;
  border:1px solid rgba(30,58,98,.75);
  background: rgba(10,25,49,.35);
  color: var(--text);
  outline:none;
  font-size:13px;
}
.tag-select:focus{border-color: rgba(0,200,255,.6)}

.pagination{display:flex; gap:10px; align-items:center; justify-content:space-between; padding:12px 10px; color: var(--muted); font-size:12px}
.pager{display:flex; gap:8px; align-items:center}

.toast{
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: rgba(10,25,49,.92);
  border:1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px;
  box-shadow: var(--shadow);
  max-width: 380px;
  display:none;
  z-index: 999;
}
.toast .t{font-weight:900}
.toast .m{margin-top:6px; color: var(--muted); font-size: 13px; line-height:1.35}

.modal-back{position: fixed; inset:0; background: rgba(0,0,0,.55); display:none; z-index: 999; padding: 18px; overflow:auto;}
.modal{width:min(560px, 100%); margin: 80px auto; padding: 16px; border-radius: var(--radius2); border: 1px solid var(--border); background: rgba(10,25,49,.96); box-shadow: var(--shadow);}
.modal-head{display:flex; justify-content:space-between; align-items:center; gap:10px}
.muted{color: var(--muted)}
code.inline{
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(30,58,98,.75);
  background: rgba(20,47,85,.35);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}
.keybox{
  padding: 10px;
  border-radius: 14px;
  border:1px dashed rgba(0,200,255,.55);
  background: rgba(0,200,255,.06);
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height:1.35;
  color: var(--text);
}
.empty-hint{padding:14px; color: var(--muted)}


/* Responsive tweaks to prevent horizontal overflow */
@media (max-width: 1200px){ .summary{grid-template-columns: repeat(4, minmax(0,1fr));} }
@media (max-width: 920px){ .summary{grid-template-columns: repeat(2, minmax(0,1fr));} }
body{overflow-x:hidden;}
.table-wrap{overflow:auto;}
@media (max-width: 980px){ .main{padding:12px} th,td{padding:8px 8px} }

/* Left align on ultra-wide screens */
@media (min-width: 1400px){ .container{padding-left:16px; padding-right:16px;} }
