/* ============================================================
   OG API Test — Design System (Postman-inspired, mobile-first)
   Load AFTER bootstrap.min.css
   ============================================================ */

:root {
  /* Brand */
  --brand-navy:       #0d1a2e;
  --brand-navy-deep:  #06101f;
  --brand-orange:     #FF6C37;
  --brand-orange-h:   #eb5f2e;

  /* Neutrals */
  --bg:              #f6f7f9;
  --surface:         #ffffff;
  --surface-hover:   #f0f2f5;
  --border:          #e5e7eb;
  --border-strong:   #d1d5db;
  --text:            #1f2937;
  --text-muted:      #6b7280;
  --text-faint:      #9ca3af;

  /* Status */
  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #3b82f6;

  /* HTTP method colors */
  --method-get:     #10b981;
  --method-post:    #f59e0b;
  --method-put:     #3b82f6;
  --method-patch:   #8b5cf6;
  --method-delete:  #ef4444;
  --method-head:    #6b7280;
  --method-options: #6b7280;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', 'Menlo', monospace;

  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;

  --sidebar-w:    240px;
  --topbar-h:     52px;
}

/* ============================================================
   BASE — mobile-first
   ============================================================ */
* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body {
  background: var(--bg) !important;
  font-family: var(--font-sans) !important;
  font-size: 13.5px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  margin: 0;
}
code, pre, .font-mono { font-family: var(--font-mono) !important; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

/* -------- Sidebar (mobile default: hidden overlay) -------- */
.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: 260px;
  height: 100vh;
  background: var(--brand-navy);
  color: #e2e8f0;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 1050;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .2s ease;
  box-shadow: 4px 0 20px rgba(0,0,0,.15);
}
.sidebar.open { transform: translateX(0); }
.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1040;
  display: none;
}
.sidebar-backdrop.open { display: block; }

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  margin-bottom: 6px;
}
.sidebar-brand img {
  width: 30px; height: 30px;
  background: #fff; border-radius: 7px; padding: 3px;
}
.sidebar-brand .name { color: #fff; font-weight: 700; font-size: 13.5px; line-height: 1.1; }
.sidebar-brand .sub  { color: #94a3b8; font-size: 10.5px; margin-top: 2px; }

.sidebar-section {
  color: #64748b;
  font-size: 10px; font-weight: 700; letter-spacing: .8px;
  padding: 12px 10px 4px;
  text-transform: uppercase;
}
.sidebar a.nav-item {
  color: #cbd5e1; text-decoration: none;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px;
  font-size: 13px; font-weight: 500;
  transition: background .1s, color .1s;
}
.sidebar a.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar a.nav-item.active {
  background: var(--brand-orange); color: #fff;
}
.sidebar a.nav-item i { width: 16px; font-size: 15px; }

/* -------- Main -------- */
.main {
  flex: 1;
  min-width: 0;
  width: 100%;
}
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar h4 {
  margin: 0;
  font-size: 14px; font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar h4 .muted { color: var(--text-faint); font-weight: 400; }

.mobile-menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 16px;
  flex-shrink: 0;
}

.content-area { padding: 14px 12px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 1px 2px rgba(15,23,42,.04) !important;
}
.card-body { padding: 14px; }
.card-title, .card h6 {
  font-size: 11.5px; font-weight: 700; color: var(--text-muted);
  letter-spacing: .5px; text-transform: uppercase;
  margin-bottom: 10px !important;
}

.kpi-card { padding: 14px; }
.kpi-card .kpi-label { color: var(--text-muted); font-size: 11.5px; font-weight: 500; }
.kpi-card .kpi-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; margin-top: 2px; }
.kpi-card .kpi-sub   { color: var(--text-faint); font-size: 11px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  border-radius: var(--radius-sm) !important;
  font-weight: 500 !important;
  font-size: 13px;
}
.btn-sm { font-size: 12px !important; padding: .3rem .6rem !important; }
.btn-accent {
  background: var(--brand-orange); color: #fff; border: 0;
}
.btn-accent:hover, .btn-accent:focus { background: var(--brand-orange-h); color: #fff; }
.btn-accent:disabled { background: var(--brand-orange); opacity: .6; color: #fff; }

.btn-outline-secondary { border-color: var(--border-strong); color: var(--text-muted); }
.btn-outline-secondary:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); }

/* ============================================================
   TABLES
   ============================================================ */
.table { color: var(--text); font-size: 13px; }
.table > :not(caption) > * > * { padding: 9px 10px; }
.table-hover > tbody > tr:hover > * { background: var(--surface-hover); }
.table thead { background: #fafbfc; }
.table thead th {
  font-weight: 600; color: var(--text-muted); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .4px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { border-color: var(--border) !important; vertical-align: middle; }
.table code { font-size: 11.5px; color: #7c3aed; background: transparent; padding: 0; }

/* ============================================================
   FORMS
   ============================================================ */
.form-control, .form-select {
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 13px; color: var(--text);
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-orange) !important;
  box-shadow: 0 0 0 3px rgba(255,108,55,.15) !important;
}
.form-control.font-mono { font-family: var(--font-mono) !important; font-size: 12.5px; }
.form-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .3px;
  margin-bottom: 4px;
}

/* ============================================================
   BADGES / METHOD PILLS / STATUS
   ============================================================ */
.badge { font-weight: 600; font-size: 10.5px; padding: 3px 7px; border-radius: 4px; }

.method {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 700;
  padding: 3px 6px; border-radius: 4px;
  color: #fff; letter-spacing: .3px;
  min-width: 48px; text-align: center;
}
.method-GET     { background: var(--method-get); }
.method-POST    { background: var(--method-post); }
.method-PUT     { background: var(--method-put); }
.method-PATCH   { background: var(--method-patch); }
.method-DELETE  { background: var(--method-delete); }
.method-HEAD    { background: var(--method-head); }
.method-OPTIONS { background: var(--method-options); }

.pill-pass    { background: #d1fae5; color: #065f46; }
.pill-fail    { background: #fee2e2; color: #991b1b; }
.pill-error   { background: #fef3c7; color: #92400e; }
.pill-skip    { background: #e5e7eb; color: #374151; }
.pill-running { background: #dbeafe; color: #1e40af; }
.pill {
  display: inline-block;
  font-size: 10.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 12px;
}

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot-pass  { background: var(--success); }
.dot-fail  { background: var(--danger); }
.dot-error { background: var(--warning); }
.dot-skip  { background: var(--text-faint); }

/* ============================================================
   POSTMAN-STYLE URL BAR
   ============================================================ */
.url-bar {
  display: flex; gap: 6px; align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 5px;
  flex-wrap: wrap;
}
.url-bar select.method-select {
  border: 0 !important;
  background: var(--surface-hover) !important;
  font-family: var(--font-mono);
  font-weight: 700; font-size: 12.5px;
  color: var(--text) !important;
  width: auto; min-width: 100px;
  border-radius: var(--radius-sm) !important;
  padding: 4px 8px !important;
}
.url-bar input.url-input {
  border: 0 !important;
  background: transparent !important;
  font-family: var(--font-mono); font-size: 12.5px;
  flex: 1; min-width: 200px;
  color: var(--text);
}
.url-bar input.url-input:focus { box-shadow: none !important; }

/* ============================================================
   TABS — FIX BULLET DOTS + mobile scroll
   ============================================================ */
.pm-tabs {
  list-style: none !important;
  padding-left: 0 !important;
  margin-bottom: 0 !important;
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pm-tabs::-webkit-scrollbar { display: none; }
.pm-tabs li {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.pm-tabs li::before, .pm-tabs li::marker { content: none !important; }
.pm-tabs .tab {
  padding: 9px 14px;
  cursor: pointer;
  font-size: 12.5px; font-weight: 500;
  color: var(--text-muted);
  border: 0; border-bottom: 2px solid transparent;
  background: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.pm-tabs .tab:hover { color: var(--text); }
.pm-tabs .tab.active {
  color: var(--brand-orange);
  border-bottom-color: var(--brand-orange);
  font-weight: 600;
}
.tab-content { padding: 14px 0 0; }

/* ============================================================
   KEY-VALUE EDITOR
   ============================================================ */
.kv-editor .kv-row {
  display: flex; gap: 4px; margin-bottom: 4px;
  flex-wrap: wrap;
}
.kv-editor .kv-key   { flex: 1 1 45%; min-width: 120px; }
.kv-editor .kv-value { flex: 2 1 45%; min-width: 120px; }
.kv-editor .kv-remove {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-faint);
  border-radius: var(--radius-sm);
  width: 32px; flex: 0 0 32px;
}
.kv-editor .kv-remove:hover { color: var(--danger); border-color: var(--danger); }

/* ============================================================
   CODE / PRE
   ============================================================ */
pre.code-block {
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #1f2937;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  overflow: auto;
  max-width: 100%;
}
pre.code-block.dark { background: #0d1a2e; color: #e2e8f0; border-color: #0d1a2e; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
  padding: 10px 14px;
}
.alert-success { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.alert-danger  { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert-info    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }

.text-muted { color: var(--text-muted) !important; }
.text-faint { color: var(--text-faint) !important; }
.hr-soft { border: 0; height: 1px; background: var(--border); margin: 12px 0; }

.progress { border-radius: 999px; background: var(--border); }
.progress-bar { transition: none; }

/* ============================================================
   LOGIN
   ============================================================ */
body.login-page {
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-deep) 100%) !important;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  min-height: 100vh;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  padding: 24px;
}
.login-card .brand-block { text-align: center; margin-bottom: 20px; }
.login-card .brand-block img { width: 54px; height: 54px; margin-bottom: 10px; }
.login-card .brand-block h3 { margin: 0; font-weight: 700; color: var(--brand-navy); font-size: 20px; }
.login-card .brand-block small { color: var(--text-muted); }

/* ============================================================
   TABLE-ON-MOBILE fixes
   ============================================================ */
.table-responsive { -webkit-overflow-scrolling: touch; }

/* ============================================================
   TABLET & UP (>= 768px)
   ============================================================ */
@media (min-width: 768px) {
  body { font-size: 14px; }
  .content-area { padding: 20px; }
  .card-body { padding: 16px 18px; }
  .topbar { padding: 0 20px; height: 56px; }
  .topbar h4 { font-size: 15px; }
  .kpi-card .kpi-value { font-size: 26px; }

  /* Show sidebar permanently, hide hamburger */
  .mobile-menu-btn { display: none; }
  .sidebar {
    position: sticky;
    transform: translateX(0);
    width: var(--sidebar-w);
    box-shadow: none;
    padding: 12px 10px;
  }
  .sidebar-backdrop { display: none !important; }
  .card { border-radius: var(--radius-lg) !important; }
  .card-body { padding: 16px 18px; }

  .pm-tabs .tab { padding: 10px 16px; font-size: 13px; }
}

/* ============================================================
   DESKTOP (>= 1200px) — a touch more breathing room
   ============================================================ */
@media (min-width: 1200px) {
  .content-area { padding: 24px; }
}
