/* ============================================================
   1LINK Aggregator Portal — Custom Styles
   ============================================================ */
:root {
  --brand: #0d6efd;
  --brand-dark: #0950b8;
  --sidebar-bg: #1e293b;
  --sidebar-fg: #cbd5e1;
  --sidebar-active: #3b82f6;
  --surface: #f8fafc;
}

body { background: var(--surface); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

/* ---------- Login ---------- */
.login-body { min-height: 100vh; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%); padding: 20px; }
.login-wrap { width: 100%; max-width: 420px; }
.login-card { border: none; border-radius: 14px; }
.brand-circle { width:64px; height:64px; border-radius:50%; background:linear-gradient(135deg,#0d6efd,#6610f2);
  display:flex; align-items:center; justify-content:center; color:#fff; font-size:28px; }
.brand-circle.small { width:36px; height:36px; font-size:16px; }

/* ---------- Portal layout ---------- */
.portal-wrap { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--sidebar-bg); color: var(--sidebar-fg);
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 1040; display: flex; flex-direction: column;
  transition: transform .2s;
}
.sidebar-brand { display: flex; gap: 10px; align-items: center; padding: 18px 20px; border-bottom: 1px solid #334155; color:#fff; }
.sidebar-brand .brand-text { line-height: 1.1; }
.sidebar-brand .brand-text small { display:block; color:#94a3b8; font-size: 11px; }
.sidebar-nav { list-style: none; padding: 10px 0; margin: 0; flex: 1; overflow-y: auto; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: var(--sidebar-fg);
  text-decoration: none; font-size: 14px; border-left: 3px solid transparent; }
.sidebar-nav a:hover { background: #334155; color: #fff; }
.sidebar-nav a.active { background: #0f172a; color: #fff; border-left-color: var(--sidebar-active); }
.sidebar-nav a i { width: 18px; text-align: center; }

.portal-main { margin-left: 240px; flex: 1; min-width: 0; }
.topbar {
  display:flex; align-items:center; gap: 12px; height: 58px; padding: 0 20px; background:#fff;
  border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 1020;
}
.topbar-title { font-weight: 600; flex: 1; font-size: 15px; color:#334155; }
.topbar-right { display:flex; align-items:center; gap: 6px; font-size: 14px; }
.sidebar-toggle { display:none; padding: 0 6px; font-size: 20px; color:#334155; }
.main-content { padding: 24px; }

/* ---------- Mobile ---------- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 30px rgba(0,0,0,0.3); }
  .portal-main { margin-left: 0; }
  .sidebar-toggle { display: inline-flex; }
}

/* ---------- Cards / tables / misc ---------- */
.stat-card { border: none; border-radius: 10px; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.stat-card .card-body { padding: 18px; }
.stat-label { font-size: 12px; color:#64748b; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 22px; font-weight: 700; color:#0f172a; margin-top: 4px; }
.stat-icon { width:42px; height:42px; border-radius: 10px; display:flex; align-items:center; justify-content:center;
  font-size: 18px; color:#fff; }
.stat-icon.bg-primary-soft { background: linear-gradient(135deg,#0d6efd,#6610f2); }
.stat-icon.bg-success-soft { background: linear-gradient(135deg,#10b981,#059669); }
.stat-icon.bg-warning-soft { background: linear-gradient(135deg,#f59e0b,#ea580c); }
.stat-icon.bg-info-soft    { background: linear-gradient(135deg,#06b6d4,#0891b2); }
.stat-icon.bg-danger-soft  { background: linear-gradient(135deg,#ef4444,#dc2626); }

.table-card { border: none; box-shadow: 0 1px 3px rgba(15,23,42,.06); border-radius: 10px; }
.table-card .card-header { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 14px 18px; font-weight: 600; }

.breadcrumb { font-size: 13px; }

.api-credential-box { background:#0f172a; color:#a7f3d0; border-radius:6px; padding:10px 14px; font-family:monospace; font-size:13px; }

.pjax-loading .main-content { opacity: .5; pointer-events: none; }
.toast-container { z-index: 2000; }
.form-label { font-weight: 500; font-size: 13px; color:#334155; }

.badge-soft-warning { background:#fef3c7; color:#92400e; }

/* ---------- Endpoint cards (cURL / Body / Response tabs) ---------- */
.nav-tabs-sm .nav-link { font-size: 12px; padding: 4px 10px; color: #64748b; border-bottom-width: 0; }
.nav-tabs-sm .nav-link.active { color: #0f172a; font-weight: 600; background: #f8fafc; border-color: #dee2e6 #dee2e6 #f8fafc; }
.nav-tabs-sm .nav-link i { font-size: 11px; }
.tab-content pre { font-family: 'Consolas', 'Courier New', monospace; font-size: 12px; line-height: 1.45; white-space: pre; }
