/* =============================================================
   NIZUES TRADING BOT — Styles globaux
   Thème sombre professionnel, couleurs trading
   ============================================================= */

:root {
  --bg-primary:    #0f1117;
  --bg-secondary:  #1a1d27;
  --bg-card:       #1f2335;
  --bg-hover:      #252a3d;
  --border:        #2d3250;
  --text-primary:  #e8eaf0;
  --text-secondary:#8892b0;
  --text-muted:    #495670;
  --green:         #00d4a0;
  --green-dim:     #00d4a020;
  --red:           #ff4d6d;
  --red-dim:       #ff4d6d20;
  --blue:          #4a9eff;
  --blue-dim:      #4a9eff20;
  --yellow:        #ffd166;
  --yellow-dim:    #ffd16620;
  --purple:        #a78bfa;
  --radius:        10px;
  --shadow:        0 4px 20px rgba(0,0,0,0.4);
}

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

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: 220px; height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  display: flex; flex-direction: column;
  z-index: 100;
}

.sidebar-logo {
  padding: 0 20px 24px;
  font-size: 18px; font-weight: 700;
  color: var(--blue);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-logo span { color: var(--text-secondary); font-size: 11px; display: block; font-weight: 400; margin-top: 2px; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: var(--text-secondary);
  text-decoration: none; transition: all 0.2s;
  font-size: 13px; border-left: 3px solid transparent;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-left-color: var(--blue);
}
.nav-link .icon { width: 18px; text-align: center; }

.sidebar-footer {
  margin-top: auto; padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}

/* ── MAIN CONTENT ── */
.main {
  margin-left: 220px;
  padding: 24px;
  min-height: 100vh;
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-title { font-size: 22px; font-weight: 700; }
.page-subtitle { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }

/* ── STATUS BADGE ── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.badge-green  { background: var(--green-dim);  color: var(--green); }
.badge-red    { background: var(--red-dim);    color: var(--red); }
.badge-blue   { background: var(--blue-dim);   color: var(--blue); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dot.pulse { animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ── CARDS ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-label {
  font-size: 12px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.card-value {
  font-size: 26px; font-weight: 700;
  line-height: 1.2;
}
.card-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.card-value.green { color: var(--green); }
.card-value.red   { color: var(--red); }

/* ── TABLES ── */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600;
}
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 12px 16px;
  text-align: left; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

.td-symbol { font-weight: 600; color: var(--text-primary); }
.td-long   { color: var(--green); font-weight: 600; }
.td-short  { color: var(--red);   font-weight: 600; }
.td-green  { color: var(--green); }
.td-red    { color: var(--red); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 6px;
  font-size: 13px; font-weight: 600;
  border: none; cursor: pointer;
  text-decoration: none; transition: all 0.2s;
}
.btn-primary { background: var(--blue);  color: #fff; }
.btn-primary:hover { opacity: 0.85; }
.btn-success { background: var(--green); color: #000; }
.btn-danger  { background: var(--red);   color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-outline {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-secondary); }
.form-input {
  width: 100%; padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-primary);
  font-size: 14px; outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--blue); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── SCORE BAR ── */
.score-bar {
  height: 6px; background: var(--border); border-radius: 3px;
  overflow: hidden; margin-top: 4px;
}
.score-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--green));
  transition: width 0.3s;
}

/* ── ALERTS ── */
.alert {
  padding: 12px 16px; border-radius: 8px;
  font-size: 13px; margin-bottom: 16px;
}
.alert-success { background: var(--green-dim); border-left: 3px solid var(--green); color: var(--green); }
.alert-error   { background: var(--red-dim);   border-left: 3px solid var(--red);   color: var(--red); }
.alert-info    { background: var(--blue-dim);  border-left: 3px solid var(--blue);  color: var(--blue); }

/* ── TOGGLE SWITCH ── */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border); border-radius: 24px;
  transition: 0.3s;
}
.toggle-slider:before {
  content: ''; position: absolute;
  height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%;
  transition: 0.3s;
}
input:checked + .toggle-slider { background: var(--green); }
input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #1a1d27 0%, #0f1117 100%);
}
.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px; width: 380px;
  box-shadow: var(--shadow);
}
.login-title {
  text-align: center; font-size: 24px;
  font-weight: 700; margin-bottom: 8px;
}
.login-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 32px; font-size: 13px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo, .nav-link span, .sidebar-footer { display: none; }
  .main { margin-left: 60px; padding: 16px; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
}
