/* =============================================================
   Simba Agent Portal — Main Stylesheet
   Design system: Deep navy / teal / dark
   ============================================================= */

:root {
  --bg-base:      #0a0a1a;
  --bg-surface:   #1a1a2e;
  --bg-card:      #16213e;
  --bg-input:     #0f1729;
  --sidebar-w:    260px;
  --accent:       #00d4aa;
  --accent-hover: #00b894;
  --primary:      #0b41d4;
  --danger:       #e74c3c;
  --warning:      #f39c12;
  --text-main:    #e8eaf6;
  --text-muted:   #8892a4;
  --border:       rgba(255,255,255,.08);
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 4px 24px rgba(0,0,0,.45);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* =============================================================
   AUTH LAYOUT
   ============================================================= */
.auth-wrap {
  display: flex;
  min-height: 100vh;
}

.auth-panel {
  flex: 0 0 420px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 40px;
}

.auth-deco {
  flex: 1;
  background: linear-gradient(135deg, #0f3460 0%, #1a1a6e 35%, #00d4aa22 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.auth-deco::before {
  content:'';
  position:absolute; inset:0;
  background: radial-gradient(ellipse 60% 60% at 50% 40%, rgba(0,212,170,.15) 0%, transparent 70%);
}

.auth-deco-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  z-index: 1;
  text-align: center;
}
.auth-deco-title span { color: var(--accent); }
.auth-deco-sub {
  margin-top: 16px;
  font-size: 1.05rem;
  color: rgba(232,234,246,.65);
  z-index: 1;
  text-align: center;
  max-width: 340px;
}
.auth-deco-circles {
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  border: 1px solid rgba(0,212,170,.12);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
}
.auth-deco-circles::before {
  content:'';
  position:absolute;
  inset: 60px;
  border-radius: 50%;
  border: 1px solid rgba(0,212,170,.08);
}
.auth-deco-circles::after {
  content:'';
  position:absolute;
  inset:-80px;
  border-radius: 50%;
  border: 1px solid rgba(0,212,170,.05);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
}
.auth-logo svg { width: 36px; height: 36px; }
.auth-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}
.auth-logo-text span { color: var(--accent); }

.auth-heading { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.auth-sub { color: var(--text-muted); font-size: .9rem; margin-bottom: 28px; }

/* =============================================================
   PORTAL LAYOUT (sidebar + main)
   ============================================================= */
.portal-wrap {
  display: flex;
  min-height: 100vh;
}

.portal-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  border-right: 1px solid var(--border);
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.sidebar-logo svg { width: 32px; height: 32px; }
.sidebar-logo-text { font-size: 1.1rem; font-weight: 700; }
.sidebar-logo-text span { color: var(--accent); }

.sidebar-nav { flex: 1; padding: 8px 12px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  transition: all .2s;
  margin-bottom: 2px;
  cursor: pointer;
  border: none; background: transparent; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: var(--text-main); }
.nav-item.active { background: rgba(0,212,170,.1); color: var(--accent); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.agent-mini-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  margin-bottom: 12px;
}
.agent-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.agent-avatar img { width: 100%; height: 100%; object-fit: cover; }
.agent-mini-name { font-size: .85rem; font-weight: 600; line-height: 1.2; }
.agent-mini-company { font-size: .75rem; color: var(--text-muted); }

.portal-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.portal-topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0; z-index: 50;
}
.topbar-title { font-size: 1.2rem; font-weight: 700; }
.topbar-status {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; color: var(--text-muted);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.portal-main {
  flex: 1;
  padding: 32px;
}

/* =============================================================
   FORMS
   ============================================================= */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-main);
  font-size: .9rem;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,170,.15);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control.is-invalid { border-color: var(--danger); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.invalid-feedback { color: var(--danger); font-size: .78rem; margin-top: 4px; }

/* OTP input */
.otp-wrap {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 8px 0;
}
.otp-digit {
  width: 52px; height: 62px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.otp-digit:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,170,.15);
}
.otp-hidden { display: none !important; }

/* =============================================================
   BUTTONS
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #0a0a1a;
}
.btn-primary:hover { background: var(--accent-hover); color: #0a0a1a; }
.btn-full { width: 100%; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .8rem; border-radius: 6px; }

/* =============================================================
   CARDS
   ============================================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1rem; font-weight: 700; }
.card-subtitle { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }

/* stat cards */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(0,212,170,.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; color: var(--accent); }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }

/* =============================================================
   ALERT / FLASH
   ============================================================= */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: rgba(0,212,170,.12); border: 1px solid rgba(0,212,170,.3); color: var(--accent); }
.alert-danger  { background: rgba(231,76,60,.12);  border: 1px solid rgba(231,76,60,.3);  color: #e74c3c; }
.alert-warning { background: rgba(243,156,18,.12); border: 1px solid rgba(243,156,18,.3); color: #f39c12; }

/* =============================================================
   CREDENTIAL / CODE BLOCK
   ============================================================= */
.cred-block {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.cred-label { font-size: .75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.cred-value {
  font-family: 'Fira Code', 'JetBrains Mono', monospace;
  font-size: .85rem;
  color: var(--accent);
  word-break: break-all;
}
.cred-masked { filter: blur(5px); transition: filter .3s; cursor: pointer; }
.cred-masked:hover { filter: none; }
.copy-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  color: var(--text-muted);
  font-size: .72rem;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* =============================================================
   API DOCS
   ============================================================= */
.docs-sidebar {
  width: 220px;
  flex-shrink: 0;
}
.docs-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}
.docs-body { flex: 1; min-width: 0; }
.docs-nav-item {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: .85rem;
  margin-bottom: 2px;
  transition: all .2s;
}
.docs-nav-item:hover, .docs-nav-item.active { background: rgba(0,212,170,.1); color: var(--accent); }

.endpoint-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
}
.method-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .03em;
  font-family: monospace;
}
.method-get  { background: rgba(0,212,170,.15); color: var(--accent); }
.method-post { background: rgba(11,65,212,.25);  color: #7ba7ff; }
.method-put  { background: rgba(243,156,18,.15); color: #f39c12; }
.method-del  { background: rgba(231,76,60,.15);  color: #e74c3c; }

.endpoint-path {
  font-family: monospace;
  font-size: .88rem;
  color: var(--text-main);
}
.endpoint-desc { font-size: .82rem; color: var(--text-muted); margin-left: auto; }
.endpoint-body {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
}
pre.code-block {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: .78rem;
  line-height: 1.7;
  overflow-x: auto;
  color: #a9caff;
  font-family: 'Fira Code', monospace;
}
.param-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.param-table th { text-align: left; padding: 6px 10px; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border); }
.param-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.03); vertical-align: top; }
.param-required { color: var(--danger); font-size: .72rem; font-weight: 700; }
.param-type { color: #7ba7ff; font-family: monospace; font-size: .78rem; }

/* =============================================================
   TABS
   ============================================================= */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 18px;
  border: none; background: transparent;
  color: var(--text-muted); font-size: .88rem; font-weight: 600;
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all .2s;
}
.tab-btn.active { color: var(--accent); border-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* =============================================================
   MISC
   ============================================================= */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
}
.badge-active    { background: rgba(0,212,170,.15); color: var(--accent); }
.badge-suspended { background: rgba(231,76,60,.15);  color: #e74c3c; }
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .82rem; }
.mt-1 { margin-top:4px; } .mt-2 { margin-top:8px; } .mt-3 { margin-top:16px; } .mt-4 { margin-top:24px; }
.mb-1 { margin-bottom:4px; } .mb-2 { margin-bottom:8px; } .mb-3 { margin-bottom:16px; } .mb-4 { margin-bottom:24px; }
.gap-2 { gap: 8px; } .gap-3 { gap:16px; }
.d-flex { display:flex; } .align-center { align-items:center; } .justify-between { justify-content:space-between; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:20px; }

@media (max-width: 900px) {
  .auth-deco { display: none; }
  .auth-panel { flex: 1; }
  .form-row, .grid-2, .grid-3 { grid-template-columns: 1fr !important; }
  .portal-sidebar { transform: translateX(-100%); }
  .portal-content { margin-left: 0; }
  .docs-layout { flex-direction: column; }
}
