/* ── TradingOS · Atide Platform · Dark UI ── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-base: #0d0d14;
  --bg-surface: #13131f;
  --bg-card: #1a1a2e;
  --bg-hover: #1e1e35;
  --border: #2d2d45;
  --border-light: #3d3d5c;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --blue: #3b82f6;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body { background: var(--bg-base); color: #cbd5e1; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #5d5d80; }

/* ── Sidebar nav ── */
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: #94a3b8;
  text-decoration: none; transition: all 0.15s;
}
.nav-link:hover { background: var(--bg-hover); color: #e2e8f0; }
.nav-link.active { background: rgba(99,102,241,0.15); color: #818cf8; }
.nav-link svg { flex-shrink: 0; }
.w-4\.5 { width: 1.125rem; }
.h-4\.5 { height: 1.125rem; }

/* ── Cards ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14px; font-weight: 600; color: #f1f5f9; }

/* ── KPI Cards ── */
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s, transform 0.2s;
}
.kpi-card:hover { border-color: var(--border-light); transform: translateY(-1px); }

.kpi-mini {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.kpi-mini-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: #64748b; font-weight: 600; margin-bottom: 4px; }
.kpi-mini-value { font-size: 18px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }

/* ── Form elements ── */
.form-input, .form-select, .form-textarea {
  display: block; width: 100%;
  background: #0d0d14;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: #f1f5f9;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-input::placeholder { color: #475569; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; padding-right: 32px; }
.form-select option { background: #1a1a2e; color: #f1f5f9; }

/* Checkboxes */
input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.label {
  display: block;
  font-size: 12px; font-weight: 500;
  color: #94a3b8;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white; font-size: 13px; font-weight: 600;
  border-radius: 8px; border: none; cursor: pointer;
  text-decoration: none; transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(99,102,241,0.25);
}
.btn-primary:hover { background: linear-gradient(135deg, #4f46e5, #7c3aed); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.35); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: var(--bg-card);
  color: #94a3b8; font-size: 13px; font-weight: 500;
  border-radius: 8px; border: 1px solid var(--border); cursor: pointer;
  text-decoration: none; transition: all 0.15s;
}
.btn-secondary:hover { border-color: var(--border-light); color: #e2e8f0; background: var(--bg-hover); }

.btn-success {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3);
  color: #10b981; font-size: 13px; font-weight: 600;
  border-radius: 8px; cursor: pointer; text-decoration: none; transition: all 0.15s;
}
.btn-success:hover { background: rgba(16,185,129,0.25); }

.btn-warning {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3);
  color: #f59e0b; font-size: 13px; font-weight: 600;
  border-radius: 8px; cursor: pointer; text-decoration: none; transition: all 0.15s;
}
.btn-warning:hover { background: rgba(245,158,11,0.25); }

.btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444; font-size: 13px; font-weight: 600;
  border-radius: 8px; cursor: pointer; text-decoration: none; transition: all 0.15s;
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 7px;
  color: #64748b; text-decoration: none; transition: all 0.15s;
  border: 1px solid transparent;
}
.icon-btn:hover { background: var(--bg-hover); color: #e2e8f0; border-color: var(--border); }

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table thead tr { border-bottom: 1px solid var(--border); }
.data-table th {
  padding: 10px 16px;
  text-align: left; font-size: 11px; font-weight: 600;
  color: #64748b; text-transform: uppercase; letter-spacing: 0.06em;
  white-space: nowrap;
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid rgba(45,45,69,0.5); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.1s; }

/* ── Status badges ── */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; border-width: 1px; border-style: solid;
  white-space: nowrap;
}

/* ── Tech badges ── */
.badge-tech {
  display: inline-block;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
  background: rgba(99,102,241,0.1); color: #818cf8;
  border: 1px solid rgba(99,102,241,0.2);
  font-family: 'JetBrains Mono', monospace;
}

/* ── Permission badges ── */
.perm-badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  border: 1px solid; font-family: 'JetBrains Mono', monospace;
}

/* ── Tab buttons ── */
.tab-btn {
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  border: none; background: none; cursor: pointer;
  border-bottom: 2px solid transparent;
  color: #64748b; transition: all 0.15s; margin-bottom: -1px;
}
.tab { color: #64748b; border-bottom-color: transparent; }
.tab:hover { color: #94a3b8; }
.tab-active { color: #818cf8; border-bottom-color: #6366f1; font-weight: 600; }

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
main { animation: fadeIn 0.2s ease-out; }

/* ── Responsive ── */
@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); }
  .ml-64 { margin-left: 0; }
}

/* ── Gradient text ── */
.gradient-text {
  background: linear-gradient(135deg, #818cf8, #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* Textarea fix */
textarea.form-input { resize: vertical; min-height: 80px; }
