@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─── Design Tokens ─── */
:root {
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --blue-50: #eff6ff; --blue-100: #dbeafe; --blue-200: #bfdbfe; --blue-500: #3b82f6;
  --blue-600: #2563eb; --blue-700: #1d4ed8; --blue-800: #1e40af; --blue-900: #1e3a5f;
  --gray-50: #fafafa; --gray-100: #f4f4f5; --gray-200: #e4e4e7; --gray-300: #d4d4d8;
  --gray-400: #a1a1aa; --gray-500: #71717a; --gray-600: #52525b; --gray-700: #3f3f46;
  --gray-800: #27272a; --gray-900: #18181b; --gray-950: #09090b;
  --green-50: #dcfce7; --green-500: #22c55e; --green-600: #16a34a; --green-800: #166534; --green-900: #15803d;
  --red-50: #fee2e2; --red-500: #ef4444; --red-600: #dc2626; --red-800: #991b1b; --red-900: #b91c1c;
  --amber-50: #fefce8; --amber-100: #fef3c7; --amber-200: #fde68a; --amber-500: #f59e0b; --amber-800: #92400e; --amber-900: #a16207;
  --sky-50: #f0f9ff; --sky-200: #bae6fd; --sky-600: #0284c7; --sky-800: #075985; --sky-900: #0c4a6e;
  --pink-50: #fdf2f8; --pink-500: #ec4899;
  --purple-200: #f5d0fe;
  --editor-bg: #0b0f17; --editor-border: #1f2937; --editor-tab-bg: #1e293b;
  --editor-text: #e2e8f0; --editor-muted: #94a3b8; --editor-dark: #0f172a;
  --code-keyword: #7dd3fc; --code-string: #bef264; --code-number: #fda4af;
  --code-boolean: #f5d0fe; --code-comment: #64748b; --code-line: #475569;
  --ease-out: cubic-bezier(.16,1,.3,1); --ease-in-out: cubic-bezier(.45,0,.55,1);
  --dur-fast: 150ms; --dur-normal: 200ms; --dur-slow: 300ms;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.04); --shadow-md: 0 4px 12px rgba(16,24,40,.08);
  --shadow-lg: 0 8px 24px rgba(16,24,40,.12);
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-full: 9999px;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--gray-100); font-family: var(--font-sans); color: var(--gray-900); font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
select { font-family: inherit; }
input { font-family: inherit; }

/* ─── Shell ─── */
.shell { width: 1440px; margin: 0 auto; display: flex; min-height: 100vh; background: var(--gray-50); }

/* ─── Sidebar ─── */
.sidebar { width: 248px; background: #fff; border-right: 1px solid var(--gray-200); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; flex-shrink: 0; z-index: 10; }
.brand { padding: 18px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--gray-200); }
.brand-logo { width: 28px; height: 28px; border-radius: 7px; background: var(--blue-600); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }
.brand-name { font-weight: 600; font-size: 14px; color: var(--gray-900); }
.brand-sub { font-size: 11px; color: var(--gray-500); margin-top: 1px; }
.nav-section { padding: 14px 12px 4px; font-size: 11px; letter-spacing: .06em; color: var(--gray-400); text-transform: uppercase; font-weight: 600; }
.nav { padding: 0 8px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); color: var(--gray-700); font-size: 13.5px; font-weight: 500; cursor: pointer; margin-bottom: 2px; transition: background var(--dur-fast) var(--ease-out); }
.nav-item:hover { background: var(--gray-100); }
.nav-item.active { background: var(--blue-50); color: var(--blue-700); }
.nav-item .ico { width: 16px; height: 16px; color: var(--gray-500); flex-shrink: 0; }
.nav-item.active .ico { color: var(--blue-600); }
.nav-item .badge { margin-left: auto; font-size: 10px; background: var(--gray-100); color: var(--gray-600); padding: 2px 6px; border-radius: 10px; font-weight: 600; }
.nav-item.active .badge { background: var(--blue-100); color: var(--blue-700); }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--gray-200); display: flex; align-items: center; gap: 10px; }
.sidebar-foot .logout-btn { margin-left: auto; color: var(--gray-400); cursor: pointer; padding: 4px; border-radius: var(--radius-sm); transition: color var(--dur-fast); }
.sidebar-foot .logout-btn:hover { color: var(--red-500); }
.avatar { width: 32px; height: 32px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; flex-shrink: 0; }
.who { font-size: 12.5px; font-weight: 600; color: var(--gray-900); }
.who-sub { font-size: 11px; color: var(--gray-500); }

/* ─── Main ─── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ─── Topbar ─── */
.topbar { height: 60px; background: #fff; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; padding: 0 28px; gap: 16px; position: sticky; top: 0; z-index: 5; }
.crumbs { font-size: 13px; color: var(--gray-500); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.crumbs b { color: var(--gray-900); font-weight: 600; }
.crumbs .sep { color: var(--gray-300); }
.crumbs a { cursor: pointer; }
.crumbs a:hover { color: var(--gray-900); }
.search { flex: 1; max-width: 420px; margin-left: 18px; position: relative; }
.search input { width: 100%; height: 34px; border-radius: var(--radius-md); border: 1px solid var(--gray-200); background: var(--gray-50); padding: 0 12px 0 34px; font-size: 13px; font-family: inherit; color: var(--gray-900); outline: none; transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.search input:focus { border-color: var(--blue-600); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.search svg { position: absolute; left: 11px; top: 9px; color: var(--gray-400); }
.kbd { position: absolute; right: 8px; top: 7px; font-size: 10.5px; color: var(--gray-500); background: #fff; border: 1px solid var(--gray-200); border-radius: 4px; padding: 2px 5px; font-family: var(--font-mono); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 34px; height: 34px; border-radius: var(--radius-md); border: 1px solid var(--gray-200); background: #fff; display: grid; place-items: center; color: var(--gray-600); cursor: pointer; position: relative; transition: background var(--dur-fast); }
.icon-btn:hover { background: var(--gray-100); }
.icon-btn:active { transform: scale(.95); }
.dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; background: var(--red-500); border-radius: 50%; border: 2px solid #fff; }
.env-pill { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: var(--radius-md); background: var(--amber-50); border: 1px solid var(--amber-200); font-size: 12.5px; font-weight: 600; color: var(--amber-800); }
.env-pill .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--amber-500); }

/* ─── Content ─── */
.content { padding: 24px 28px 60px; display: flex; flex-direction: column; gap: 20px; animation: fadeIn var(--dur-normal) var(--ease-out); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--gray-950); letter-spacing: -.01em; }
.page-sub { color: var(--gray-500); font-size: 13.5px; margin-top: 4px; max-width: 640px; }
.head-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ─── Buttons ─── */
.btn { height: 36px; padding: 0 14px; border-radius: var(--radius-md); font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent; transition: all var(--dur-fast) var(--ease-out); white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-secondary { background: #fff; border-color: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-100); }
.btn-primary { background: var(--blue-600); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.btn-primary:hover { background: var(--blue-700); }
.btn-primary:disabled, .btn-primary[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary:disabled:active { transform: none; }
.btn-danger { background: var(--red-500); color: #fff; }
.btn-danger:hover { background: var(--red-600); }
.btn-sm { height: 30px; font-size: 12px; padding: 0 10px; }
.btn-icon { width: 36px; padding: 0; justify-content: center; }

/* ─── Tabs ─── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--gray-200); margin-top: 4px; }
.tab { padding: 10px 14px; font-size: 13px; font-weight: 500; color: var(--gray-500); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--dur-fast); }
.tab.active { color: var(--gray-900); border-bottom-color: var(--blue-600); }
.tab:hover:not(.active) { color: var(--gray-700); }
.tab .count { background: var(--gray-100); border-radius: 10px; padding: 1px 7px; font-size: 11px; margin-left: 6px; color: var(--gray-600); font-weight: 600; }

/* ─── Cards ─── */
.card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-h { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.card-t { font-size: 13.5px; font-weight: 600; color: var(--gray-900); }
.card-st { font-size: 11.5px; color: var(--gray-500); }
.card-b { padding: 14px 16px; }

/* ─── Three-Column Grid ─── */
.grid { display: grid; grid-template-columns: 300px 1fr 380px; gap: 20px; align-items: start; }

/* ─── Scenario Library ─── */
.group-label { font-size: 11px; font-weight: 600; color: var(--gray-500); letter-spacing: .04em; text-transform: uppercase; padding: 8px 4px 6px; }
.scenario { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: var(--radius-md); cursor: pointer; border: 1px solid transparent; transition: background var(--dur-fast); }
.scenario:hover { background: var(--gray-50); }
.scenario.active { background: var(--blue-50); border-color: var(--blue-200); }
.sc-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.sc-dot.green { background: var(--green-500); }
.sc-dot.red { background: var(--red-500); }
.sc-dot.amber { background: var(--amber-500); }
.sc-dot.blue { background: var(--blue-500); }
.sc-dot.gray { background: var(--gray-400); }
.sc-title { font-size: 13px; font-weight: 500; color: var(--gray-900); line-height: 1.3; }
.sc-meta { font-size: 11.5px; color: var(--gray-500); margin-top: 2px; font-family: var(--font-mono); }

/* ─── Form Controls ─── */
.builder-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 500; color: var(--gray-700); }
.field .hint { font-size: 11px; color: var(--gray-400); }
.ctl { height: 34px; border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 0 10px; background: #fff; font-size: 13px; color: var(--gray-900); font-family: inherit; outline: none; width: 100%; transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.ctl:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer; }
.select-wrap svg { position: absolute; right: 8px; top: 9px; pointer-events: none; color: var(--gray-500); }

/* ─── Code Editor ─── */
.editor { border: 1px solid var(--gray-200); border-radius: 10px; overflow: hidden; background: var(--editor-bg); }
.editor-h { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--editor-bg); border-bottom: 1px solid var(--editor-border); }
.ed-tabs { display: flex; gap: 2px; }
.ed-tab { font-family: var(--font-mono); font-size: 11.5px; padding: 5px 10px; color: var(--editor-muted); border-radius: var(--radius-sm); cursor: pointer; transition: all var(--dur-fast); }
.ed-tab.active { background: var(--editor-tab-bg); color: var(--editor-text); }
.ed-tab:hover:not(.active) { color: var(--editor-text); }
.ed-tools { display: flex; gap: 6px; align-items: center; }
.ed-chip { font-family: var(--font-mono); font-size: 10.5px; color: var(--editor-muted); padding: 2px 7px; background: var(--editor-dark); border: 1px solid var(--editor-border); border-radius: 5px; }
.ed-chip.valid { color: #86efac; border-color: #14532d; }
pre.code { margin: 0; padding: 14px 16px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; color: var(--editor-text); background: var(--editor-bg); overflow-x: auto; }
pre.code .line:hover { background: rgba(255,255,255,.03); }
.k { color: var(--code-keyword); }
.s { color: var(--code-string); }
.n { color: var(--code-number); }
.b { color: var(--code-boolean); }
.c { color: var(--code-comment); font-style: italic; }
.ln { color: var(--code-line); display: inline-block; width: 24px; text-align: right; margin-right: 14px; user-select: none; }

/* ─── Response Console ─── */
.resp-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--gray-100); flex-wrap: wrap; }
.status-pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; gap: 6px; }
.pill-ok { background: var(--green-50); color: var(--green-900); }
.pill-warn { background: var(--amber-100); color: var(--amber-900); }
.pill-err { background: var(--red-50); color: var(--red-900); }
.resp-meta { display: flex; gap: 18px; font-size: 12px; color: var(--gray-500); margin-left: auto; }
.resp-meta b { color: var(--gray-900); font-weight: 600; font-family: var(--font-mono); }
.sub-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--gray-100); padding: 0 8px; }
.sub-tab { font-size: 12.5px; padding: 9px 12px; color: var(--gray-500); border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px; font-weight: 500; transition: color var(--dur-fast); white-space: nowrap; }
.sub-tab.active { color: var(--gray-900); border-bottom-color: var(--gray-900); }
.sub-tab:hover:not(.active) { color: var(--gray-700); }

/* ─── Mapping Table ─── */
.mapping { padding: 6px 0; }
.map-row { display: grid; grid-template-columns: 1fr 24px 1fr 80px; gap: 12px; padding: 9px 16px; align-items: center; border-bottom: 1px solid var(--gray-100); font-size: 12.5px; transition: background var(--dur-fast); }
.map-row:last-child { border: 0; }
.map-row:not(.hd):hover { background: var(--gray-50); }
.map-row.hd { background: var(--gray-50); font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; }
.mono { font-family: var(--font-mono); font-size: 12px; color: var(--gray-900); }
.mono .muted { color: var(--gray-400); }
.arrow { color: var(--gray-400); text-align: center; }
.tag { font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 5px; display: inline-block; text-align: center; width: 64px; text-transform: uppercase; }
.tag.ok { background: var(--green-50); color: var(--green-800); }
.tag.warn { background: var(--amber-100); color: var(--amber-800); }
.tag.err { background: var(--red-50); color: var(--red-800); }

/* ─── Stats & Progress ─── */
.stat { display: flex; justify-content: space-between; padding: 7px 0; font-size: 12.5px; }
.stat .lab { color: var(--gray-500); }
.stat .val { color: var(--gray-900); font-weight: 500; font-family: var(--font-mono); }
.progress { height: 6px; background: var(--gray-100); border-radius: var(--radius-full); overflow: hidden; margin: 8px 0 4px; }
.progress > div { height: 100%; background: var(--blue-600); border-radius: var(--radius-full); transition: width var(--dur-slow) var(--ease-out); }
.checklist { display: flex; flex-direction: column; gap: 7px; margin-top: 6px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--gray-700); }
.check .cb { width: 14px; height: 14px; border-radius: 4px; display: grid; place-items: center; color: #fff; font-size: 10px; flex-shrink: 0; }
.check.ok .cb { background: var(--green-600); }
.check.fail .cb { background: var(--red-600); }
.check.skip .cb { background: var(--gray-400); }

/* ─── History Rows ─── */
.history-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--gray-100); font-size: 12.5px; cursor: pointer; transition: background var(--dur-fast); }
.history-row:last-child { border: 0; }
.history-row:hover { background: var(--gray-50); margin: 0 -16px; padding-left: 16px; padding-right: 16px; border-radius: var(--radius-md); }
.h-id { font-family: var(--font-mono); font-size: 11.5px; color: var(--gray-500); }
.h-name { color: var(--gray-900); font-weight: 500; flex: 1; }
.h-time { color: var(--gray-400); font-size: 11.5px; }
.h-stat { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ─── PII Compliance Card ─── */
.pii { display: flex; gap: 10px; background: var(--sky-50); border: 1px solid var(--sky-200); border-radius: 10px; padding: 12px; font-size: 12.5px; color: var(--sky-800); }
.pii svg { flex-shrink: 0; color: var(--sky-600); }
.pii b { color: var(--sky-900); }
.pii .link { color: var(--sky-600); text-decoration: underline; cursor: pointer; font-weight: 600; }

/* ─── Method Badges ─── */
.method-badge { font-size: 10px; font-weight: 700; font-family: var(--font-mono); padding: 2px 6px; border-radius: 4px; text-transform: uppercase; display: inline-block; min-width: 42px; text-align: center; }
.method-get { background: var(--blue-50); color: var(--blue-700); }
.method-post { background: var(--green-50); color: var(--green-800); }
.method-put { background: var(--amber-100); color: var(--amber-800); }
.method-delete { background: var(--red-50); color: var(--red-800); }
.method-patch { background: var(--purple-200); color: #6b21a8; }

/* ─── Tables ─── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--gray-200); background: var(--gray-50); white-space: nowrap; }
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--gray-900); }
.data-table th .sort-icon { display: inline-block; margin-left: 4px; opacity: .4; }
.data-table th.sorted .sort-icon { opacity: 1; color: var(--blue-600); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); color: var(--gray-900); vertical-align: middle; }
.data-table tr:hover td { background: var(--gray-50); }
.data-table tr.clickable { cursor: pointer; }

/* ─── Schema Table ─── */
.schema-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.schema-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--gray-200); background: var(--gray-50); }
.schema-table td { padding: 8px 10px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.schema-table td:first-child { font-family: var(--font-mono); font-size: 12px; color: var(--blue-700); font-weight: 500; white-space: nowrap; }
.schema-table .required-dot { display: inline-block; width: 6px; height: 6px; background: var(--red-500); border-radius: 50%; margin-left: 6px; vertical-align: middle; }
.type-badge { font-size: 10.5px; font-family: var(--font-mono); color: var(--gray-600); background: var(--gray-100); padding: 1px 6px; border-radius: 4px; }

/* ─── Toast ─── */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 12px 16px; box-shadow: var(--shadow-lg); animation: slideInRight var(--dur-normal) var(--ease-out); font-size: 13px; color: var(--gray-900); min-width: 280px; }
.toast.success { border-left: 3px solid var(--green-500); }
.toast.error { border-left: 3px solid var(--red-500); }
.toast.info { border-left: 3px solid var(--blue-600); }
.toast.warning { border-left: 3px solid var(--amber-500); }
.toast-icon { flex-shrink: 0; }
.toast-icon.success { color: var(--green-600); }
.toast-icon.error { color: var(--red-600); }
.toast-icon.info { color: var(--blue-600); }
.toast-icon.warning { color: var(--amber-500); }
.toast-dismiss { margin-left: auto; color: var(--gray-400); cursor: pointer; padding: 2px; }
.toast-dismiss:hover { color: var(--gray-600); }
.toast.exiting { animation: slideOutRight var(--dur-normal) var(--ease-out) forwards; }

/* ─── Modal ─── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1000; display: grid; place-items: center; animation: fadeIn var(--dur-fast) var(--ease-out); }
.modal-box { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 480px; max-height: 80vh; overflow-y: auto; animation: scaleIn var(--dur-normal) var(--ease-out); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--gray-200); }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { color: var(--gray-400); cursor: pointer; padding: 4px; border-radius: var(--radius-sm); border: none; background: none; }
.modal-close:hover { color: var(--gray-900); background: var(--gray-100); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--gray-200); }

/* ─── Login ─── */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); }
.login-box { width: 460px; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.login-header { padding: 32px 32px 24px; text-align: center; }
.login-header .logo { width: 48px; height: 48px; border-radius: 12px; background: var(--blue-600); display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 20px; margin-bottom: 12px; }
.login-header h1 { font-size: 20px; font-weight: 700; color: var(--gray-900); }
.login-header p { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.login-users { padding: 0 32px 16px; display: flex; flex-direction: column; gap: 8px; }
.login-card { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 2px solid var(--gray-200); border-radius: var(--radius-lg); cursor: pointer; transition: all var(--dur-fast) var(--ease-out); }
.login-card:hover { border-color: var(--blue-200); background: var(--blue-50); }
.login-card.selected { border-color: var(--blue-600); background: var(--blue-50); }
.login-card .card-info { flex: 1; }
.login-card .card-name { font-weight: 600; font-size: 13.5px; color: var(--gray-900); }
.login-card .card-role { font-size: 12px; color: var(--gray-500); }
.login-form { padding: 0 32px 32px; }
.login-form .field-group { margin-bottom: 12px; }
.login-form label { font-size: 12px; font-weight: 500; color: var(--gray-700); display: block; margin-bottom: 4px; }
.login-form input { width: 100%; height: 38px; border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 0 12px; font-size: 13px; outline: none; }
.login-form input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.login-form .login-btn { width: 100%; height: 40px; background: var(--blue-600); color: #fff; border: none; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 8px; transition: background var(--dur-fast); }
.login-form .login-btn:hover { background: var(--blue-700); }
.login-form .login-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ─── Empty States ─── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; text-align: center; color: var(--gray-500); }
.empty-state svg { color: var(--gray-300); margin-bottom: 16px; }
.empty-state h4 { font-size: 15px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.empty-state p { font-size: 13px; max-width: 320px; }
.empty-state .btn { margin-top: 16px; }

/* ─── Skeleton Loading ─── */
.skeleton { background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-md); }
.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-line:last-child { width: 60%; }
.skeleton-block { height: 120px; margin-bottom: 12px; }

/* ─── API Docs Layout ─── */
.api-layout { display: grid; grid-template-columns: 300px 1fr; gap: 0; min-height: calc(100vh - 160px); }
.api-sidebar { border-right: 1px solid var(--gray-200); background: #fff; overflow-y: auto; }
.api-sidebar .search-box { padding: 12px; border-bottom: 1px solid var(--gray-200); }
.api-sidebar .filter-row { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--gray-200); flex-wrap: wrap; }
.filter-chip { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-full); border: 1px solid var(--gray-200); background: #fff; color: var(--gray-600); cursor: pointer; transition: all var(--dur-fast); }
.filter-chip:hover { background: var(--gray-100); }
.filter-chip.active { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }
.endpoint-group { padding: 4px 0; }
.endpoint-group-label { font-size: 11px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: .04em; padding: 10px 16px 4px; }
.endpoint-item { display: flex; align-items: center; gap: 8px; padding: 8px 16px; cursor: pointer; transition: background var(--dur-fast); border-left: 2px solid transparent; }
.endpoint-item:hover { background: var(--gray-50); }
.endpoint-item.active { background: var(--blue-50); border-left-color: var(--blue-600); }
.endpoint-item .ep-path { font-family: var(--font-mono); font-size: 12px; color: var(--gray-700); }
.endpoint-item.active .ep-path { color: var(--blue-700); font-weight: 500; }
.api-detail { padding: 28px; overflow-y: auto; }
.api-detail h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.api-detail .ep-description { font-size: 13.5px; color: var(--gray-500); margin-bottom: 24px; line-height: 1.6; }
.api-section { margin-bottom: 28px; }
.api-section h3 { font-size: 14px; font-weight: 600; color: var(--gray-900); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.auth-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: var(--radius-sm); background: var(--amber-50); border: 1px solid var(--amber-200); color: var(--amber-800); }
.error-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.error-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--gray-200); background: var(--gray-50); }
.error-table td { padding: 8px 10px; border-bottom: 1px solid var(--gray-100); }
.error-table td:first-child { font-family: var(--font-mono); font-size: 11.5px; color: var(--red-800); font-weight: 500; }
.retryable-yes { color: var(--green-800); font-weight: 500; }
.retryable-no { color: var(--gray-400); }

/* ─── Test Results Table ─── */
.results-filters { display: flex; gap: 12px; align-items: center; }
.filter-select { height: 34px; border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 0 28px 0 10px; font-size: 13px; background: #fff; color: var(--gray-900); cursor: pointer; appearance: none; -webkit-appearance: none; }
.filter-select-wrap { position: relative; }
.filter-select-wrap svg { position: absolute; right: 8px; top: 9px; pointer-events: none; color: var(--gray-500); }

/* ─── Defect Log ─── */
.defect-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.defect-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--gray-200); background: var(--gray-50); }
.defect-table td { padding: 8px 10px; border-bottom: 1px solid var(--gray-100); }
.severity-badge { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-full); }
.severity-critical { background: var(--red-50); color: var(--red-800); }
.severity-major { background: var(--amber-100); color: var(--amber-800); }
.severity-minor { background: var(--gray-100); color: var(--gray-600); }

/* ─── Trace Timeline ─── */
.trace-timeline { padding: 16px; }
.trace-step { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.trace-step:not(:last-child)::before { content: ''; position: absolute; left: 11px; top: 34px; bottom: -10px; width: 2px; background: var(--gray-200); }
.trace-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 10px; color: #fff; }
.trace-dot.ok { background: var(--green-600); }
.trace-dot.err { background: var(--red-600); }
.trace-dot.warn { background: var(--amber-500); }
.trace-dot.info { background: var(--blue-600); }
.trace-info .trace-label { font-size: 13px; font-weight: 500; color: var(--gray-900); }
.trace-info .trace-time { font-size: 11.5px; color: var(--gray-400); font-family: var(--font-mono); }

/* ─── Animations ─── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOutRight { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes pulseStatus { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }

.stagger-item { animation: fadeIn var(--dur-normal) var(--ease-out) backwards; }

/* ─── Tooltip ─── */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after { content: attr(data-tooltip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding: 4px 8px; background: var(--gray-900); color: #fff; font-size: 11px; border-radius: 4px; white-space: nowrap; z-index: 100; margin-bottom: 4px; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ─── Log Defect Button Inline ─── */
.map-row .log-defect-btn { font-size: 10.5px; color: var(--blue-600); cursor: pointer; font-weight: 500; background: none; border: none; padding: 2px 4px; border-radius: 4px; }
.map-row .log-defect-btn:hover { background: var(--blue-50); }

/* ─── Dropdown ─── */
.dropdown-wrap { position: relative; display: inline-block; }
.dropdown-panel { position: absolute; top: 100%; left: 0; min-width: 180px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-md); box-shadow: var(--shadow-md); z-index: 50; margin-top: 4px; display: none; }
.dropdown-panel.open { display: block; animation: fadeIn var(--dur-fast) var(--ease-out); }
.dropdown-item { padding: 8px 12px; font-size: 13px; color: var(--gray-700); cursor: pointer; display: flex; align-items: center; gap: 8px; }
.dropdown-item:hover { background: var(--gray-50); }
.dropdown-item:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.dropdown-item:last-child { border-radius: 0 0 var(--radius-md) var(--radius-md); }
.dropdown-item.active { color: var(--blue-600); font-weight: 500; }

/* Textarea */
textarea.ctl { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; }
