/* Developer Dashboard CSS */

/* ===== CSS Variables — Trooply marketing system (emerald + Geist + Fraunces).
   Swapped from the old slate+blue+purple scheme so the entire dev portal
   inherits the new brand automatically. Keep the token NAMES stable — every
   rule downstream references --primary / --accent / --success etc. ===== */
:root {
    --primary: #1E8F3E;
    --primary-dark: #17722F;
    --primary-light: #4FB069;
    --primary-soft: rgba(30, 143, 62, 0.09);
    --accent: #1E8F3E;
    --accent-ink: #FFFFFF;
    --secondary: rgba(20, 22, 19, 0.72);
    --success: #1E8F3E;
    --success-light: rgba(30, 143, 62, 0.10);
    --danger: #C0392B;
    --danger-light: rgba(192, 57, 43, 0.10);
    --warning: #B45309;
    --warning-light: rgba(180, 83, 9, 0.10);
    --info: #1E8F3E;
    --info-light: rgba(30, 143, 62, 0.10);

    /* Layered surface system — matches landing/pricing/docs */
    --bg-dark: #F4F6F3;   /* page background (sage-tinted off-white) */
    --bg-darker: #EDF0EC; /* alternating band */
    --bg-card: #FFFFFF;   /* elevated card */
    --bg-card-hover: #F9FBF8;
    --bg-input: #FFFFFF;

    --text-primary: #141613;
    --text-secondary: rgba(20, 22, 19, 0.72);
    --text-muted: rgba(20, 22, 19, 0.50);

    --border-color: rgba(23, 25, 22, 0.09);
    --border-light: rgba(23, 25, 22, 0.05);

    --sidebar-width: 260px;
    --header-height: 64px;

    --shadow-sm: 0 1px 2px rgba(20, 22, 19, 0.04);
    --shadow-md: 0 4px 12px -2px rgba(20, 22, 19, 0.08);
    --shadow-lg: 0 12px 28px -6px rgba(20, 22, 19, 0.12), 0 4px 10px -4px rgba(20, 22, 19, 0.06);

    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Type stack (mirrors landing.css) */
    --font-sans:  "Geist", "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
    --font-serif: "Fraunces", "Times New Roman", serif;
    --font-mono:  "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.mt-8 {
    margin-top: 8px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-24 {
    margin-top: 24px;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.gap-16 {
    gap: 16px;
}

.gap-24 {
    gap: 24px;
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary-soft) 0%, transparent 70%);
    border-radius: 50%;
    top: -250px;
    right: -250px;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(30, 143, 62, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -200px;
    left: -200px;
    pointer-events: none;
}

.login-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header .logo {
    margin: 0 auto 18px;
    display: inline-flex;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--primary);
    color: var(--accent-ink);
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 36px;
    font-weight: 400;
    line-height: 1;
}

.login-header h1 {
    font-family: var(--font-serif);
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.login-header h1 em {
    font-style: italic;
    color: var(--primary);
}

.login-header p {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-top: 6px;
}

.login-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #fecaca;
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-error::before {
    content: '';
    font-size: 16px;
    flex-shrink: 0;
}

.login-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid #e2e6ed;
}

.login-footer p {
    color: #9ca3af;
    font-size: 14px;
}

.login-footer a {
    color: #1E8F3E;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.login-footer a:hover {
    color: #17722F;
    text-decoration: underline;
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 143, 62, 0.09);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* ===== Login Page Form Overrides ===== */
.login-container .form-group {
    margin-bottom: 20px;
}

.login-container .form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #252424;
    margin-bottom: 10px;
}

.login-container .form-group input {
    padding: 14px 18px;
    background: #f7f8fa;
    border: 1.5px solid #e2e6ed;
    border-radius: 10px;
    color: #252424;
    font-size: 15px;
    transition: all 0.3s ease;
}

.login-container .form-group input:hover {
    background: #f0f1f3;
    border-color: rgba(30, 143, 62, 0.24);
}

.login-container .form-group input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.login-container .form-group input::placeholder {
    color: var(--text-muted);
}

.login-container .btn-large {
    margin-top: 8px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    background: var(--primary);
    color: var(--accent-ink);
    box-shadow: 0 2px 8px rgba(30, 143, 62, 0.18);
    transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
}

.login-container .btn-large:hover {
    background: var(--primary);
    filter: brightness(1.05);
    box-shadow: 0 6px 18px rgba(30, 143, 62, 0.28);
    transform: translateY(-1px);
}

.login-container .btn-large:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(30, 143, 62, 0.18);
}

.login-container .btn-large:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

/* ===== Main Dashboard Layout ===== */
#main-dashboard {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-darker);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.logo-small {
    flex-shrink: 0;
    display: inline-flex;
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: var(--primary);
    color: var(--accent-ink);
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 400;
    line-height: 1;
}

.logo-text {
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.logo-subtext {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 16px 16px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    margin-bottom: 4px;
    cursor: pointer;
    font-size: 14px;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-item.active svg {
    color: white;
}

.nav-item svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1E8F3E 0%, #17722F 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-logout {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: var(--bg-card);
    color: var(--danger);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
}

/* ===== Page Sections ===== */
.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #047857;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #b45309;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-danger:disabled {
    background: #7f1d1d;
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: rgba(30, 143, 62, 0.07);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}

.btn-ghost:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
    width: 100%;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-icon.danger:hover {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

/* ===== Copy Button ===== */
.btn-copy {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    white-space: nowrap;
}

.btn-copy:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.btn-copy.copied {
    background: var(--success-light);
    color: var(--success);
    border-color: var(--success);
}

.btn-copy svg {
    width: 14px;
    height: 14px;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: #f7f8fa;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.blue {
    background: rgba(30, 143, 62, 0.09);
    color: var(--primary);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.stat-icon.amber {
    background: rgba(243, 175, 17, 0.12);
    color: #F3AF11;
}

.stat-icon.orange {
    background: rgba(243, 175, 17, 0.12);
    color: var(--warning);
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.stat-limit {
    font-size: 13px;
    color: var(--text-muted);
}

.stat-change {
    font-size: 13px;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* ===== Badge ===== */
.badge {
    display: inline-flex;
    padding: 4px 10px;
    background: var(--bg-card-hover);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active,
.status-badge.success {
    background: var(--success-light);
    color: var(--success);
    font-family: var(--font-mono);
    font-weight: 600;
}

.status-badge.inactive,
.status-badge.error {
    background: var(--danger-light);
    color: var(--danger);
    font-family: var(--font-mono);
    font-weight: 600;
}

.status-badge.pending,
.status-badge.warning {
    background: var(--warning-light);
    color: var(--warning);
    font-family: var(--font-mono);
    font-weight: 600;
}

/* ===== Code Panels (tab-controlled visibility) ===== */
.code-panel { display: none; }
.code-panel.active { display: block; }

/* ===== Code Blocks ===== */
.code-block {
    background: #1e1e2e;
    border-radius: var(--radius-md);
    padding: 20px 24px;
    overflow-x: auto;
    position: relative;
}

.code-block code,
.code-block pre {
    font-family: 'Monaco', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: #cdd6f4;
    white-space: pre;
    margin: 0;
}

.code-block .code-line {
    display: block;
}

.code-block .code-comment {
    color: #6c7086;
}

.code-block .code-string {
    color: #a6e3a1;
}

.code-block .code-keyword {
    color: #cba6f7;
}

.code-block .code-function {
    color: #89b4fa;
}

.code-block .code-number {
    color: #fab387;
}

.code-block .code-property {
    color: #89dceb;
}

.code-block .code-url {
    color: #89b4fa;
    text-decoration: underline;
}

.code-block .btn-copy {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #9ca3af;
}

.code-block .btn-copy:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.code-block .btn-copy.copied {
    background: rgba(5, 150, 105, 0.3);
    color: #a6e3a1;
    border-color: rgba(5, 150, 105, 0.5);
}

/* Inline code — only applies to <code> OUTSIDE a <pre> (body copy, banners,
   callouts). Without :not(pre) the rule would stamp a pale-sage box onto
   every line inside .code-block, hiding the syntax-highlighted text. */
:not(pre) > code {
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 2px 8px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

/* Explicit reset in case a sibling rule tries to re-decorate <pre><code>. */
.code-block pre,
.code-block pre code,
pre > code {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #cdd6f4;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    white-space: pre;
}

/* ===== Code Tabs ===== */
.code-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0;
    overflow-x: auto;
}

.code-tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.code-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.code-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.code-tab-content {
    display: none;
}

.code-tab-content.active {
    display: block;
}

.code-tabs-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.code-tabs-container .code-block {
    border-radius: 0;
    border: none;
    margin: 0;
}

/* ===== Method Badges ===== */
.method-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 60px;
    font-family: var(--font-mono);
}

/* HTTP-method colour convention — GET/POST/PUT/DELETE coding is universal
   in API docs (Swagger, Scalar, Stripe, Stoplight). Keep the semantics but
   route through Trooply tokens so the palette stays on-brand. */
.method-badge.get {
    background: var(--primary-soft);
    color: var(--primary);
}

.method-badge.post {
    background: rgba(30, 58, 138, 0.10);
    color: #1E40AF;
}

.method-badge.put,
.method-badge.patch {
    background: var(--warning-soft, rgba(180, 83, 9, 0.10));
    color: var(--warning-color, var(--warning, #B45309));
}

.method-badge.delete {
    background: var(--danger-soft, rgba(192, 57, 43, 0.10));
    color: var(--danger-color, var(--danger, #C0392B));
}

/* ===== API Reference ===== */
.api-category {
    margin-bottom: 32px;
}

.api-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.api-category-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.api-category-header .badge {
    font-size: 12px;
}

.api-category-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.api-endpoint {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    background: var(--bg-card);
    transition: all 0.2s ease;
    cursor: pointer;
}

.api-endpoint:hover {
    border-color: var(--primary-light);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-sm);
}

.api-endpoint .method-badge {
    flex-shrink: 0;
}

.api-endpoint-path {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 240px;
}

.api-endpoint-desc {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
}

.api-endpoint-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.api-endpoint:hover .api-endpoint-arrow {
    transform: translateX(4px);
    color: var(--primary);
}

/* API Endpoint Detail */
.api-detail {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.api-detail-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
}

.api-detail-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.api-detail-body {
    padding: 24px;
}

.api-param-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.api-param-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-dark);
}

.api-param-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.api-param-table tr:last-child td {
    border-bottom: none;
}

.api-param-name {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.api-param-required {
    font-size: 11px;
    font-weight: 600;
    color: var(--danger);
    margin-left: 6px;
}

.api-param-optional {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 6px;
}

.api-param-type {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-dark);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

/* ===== API Tester ===== */
.api-tester {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.tester-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.tester-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tester-panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.tester-panel-body {
    padding: 20px;
}

/* Request Panel */
.tester-url-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

/* API Tester form — note: the markup uses short classes (.method-select,
   .url-input, .request-row, .api-tester-form, .json-textarea) but the older
   stylesheet only defined .tester-* variants that never matched the DOM.
   Aliased below so both names work. */
.api-tester-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.request-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
}

.tester-method-select,
.method-select {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 100px;
    font-family: var(--font-sans);
    text-decoration: none;
    line-height: 1.4;
}

.tester-method-select:focus,
.method-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.tester-url-input,
.url-input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.4;
}

.tester-url-input::placeholder,
.url-input::placeholder {
    color: var(--text-muted);
    text-decoration: none;
    font-style: normal;
}

.tester-url-input:focus,
.url-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.json-textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    resize: vertical;
    min-height: 160px;
    transition: border-color .12s ease, box-shadow .12s ease;
}

.json-textarea::placeholder {
    color: var(--text-muted);
    font-style: normal;
    text-decoration: none;
}

.json-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.tester-section {
    margin-bottom: 16px;
}

.tester-section-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.tester-body-textarea {
    width: 100%;
    min-height: 160px;
    padding: 14px 16px;
    background: #1e1e2e;
    border: 1px solid #313244;
    border-radius: var(--radius-md);
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #cdd6f4;
    resize: vertical;
}

.tester-body-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 143, 62, 0.09);
}

.tester-body-textarea::placeholder {
    color: #6c7086;
}

.tester-headers {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tester-header-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    align-items: center;
}

.tester-header-row input {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

.tester-header-row input:focus {
    outline: none;
    border-color: var(--primary);
}

.tester-send-btn {
    width: 100%;
    margin-top: 8px;
}

/* Response Panel */
.tester-response-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.response-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.response-status.success {
    background: var(--success-light);
    color: #065f46;
}

.response-status.error {
    background: var(--danger-light);
    color: #991b1b;
}

.response-status.warning {
    background: var(--warning-light);
    color: #92400e;
}

.response-time {
    font-size: 13px;
    color: var(--text-muted);
}

.response-size {
    font-size: 13px;
    color: var(--text-muted);
}

.tester-response-body {
    background: #1e1e2e;
    border-radius: var(--radius-md);
    padding: 20px;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.tester-response-body pre {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: #cdd6f4;
    white-space: pre;
    margin: 0;
}

.tester-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: var(--text-muted);
    text-align: center;
    gap: 12px;
}

.tester-empty svg {
    color: var(--border-color);
}

.tester-empty p {
    font-size: 14px;
}

/* ===== Credentials ===== */
.credential-row {
    margin-bottom: 16px;
}

.credential-row:last-child {
    margin-bottom: 0;
}

.credential-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.credential-value {
    display: flex;
    gap: 8px;
    align-items: center;
}

.credential-value code {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* D-10 (Apr 20 audit): was emerald green which reads as "success" —
   misleading semantic for a security caution. Now amber/warning token. */
.credential-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--warning);
    line-height: 1.5;
}

.credential-warning svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--warning);
}

.credential-warning code {
    background: rgba(180, 83, 9, 0.12);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
    color: var(--warning);
}

/* D-04 (Apr 20 audit): inline hint shown when the Show button is clicked
   but no secret is cached in memory (it's only exposed once at creation). */
.credential-hint {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}
.credential-hint:empty { display: none; }

.credential-actions {
    display: flex;
    gap: 8px;
}

.credential-value .btn-copy {
    flex-shrink: 0;
    padding: 8px 12px;
}

.credential-value .btn-danger {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 12px;
}

/* Key status */
.key-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.key-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.key-status-dot.active {
    background: var(--success);
}

.key-status-dot.inactive {
    background: var(--danger);
}

.key-status-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Downloads Grid ===== */
.downloads-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.download-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    transition: all 0.2s ease;
}

.download-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.download-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.download-icon.blue {
    background: rgba(30, 143, 62, 0.09);
    color: var(--primary);
}

.download-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.download-icon.amber {
    background: rgba(243, 175, 17, 0.12);
    color: #F3AF11;
}

.download-icon.purple {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

.download-icon.orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.download-icon.red {
    background: rgba(220, 38, 38, 0.12);
    color: var(--danger);
}

.download-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.download-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.download-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.download-card .btn {
    width: 100%;
    margin-top: auto;
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 480px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--primary);
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.toast-message {
    flex: 1;
    font-size: 14px;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast.removing {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===== Quick Endpoint Buttons ===== */
.quick-endpoints {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.quick-endpoint-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-family: inherit;
}

.quick-endpoint-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(30, 143, 62, 0.05);
}

.quick-endpoint-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.quick-endpoint-btn .method-badge {
    padding: 2px 6px;
    font-size: 9px;
    min-width: auto;
    border-radius: 4px;
}

/* ===== Progress Bar ===== */
.progress-bar {
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.green {
    background: var(--success);
}

.progress-fill.orange {
    background: var(--warning);
}

.progress-fill.red {
    background: var(--danger);
}

/* ===== Quota ===== */
.quota-item {
    margin-bottom: 20px;
}

.quota-item:last-child {
    margin-bottom: 0;
}

.quota-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.quota-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.quota-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Data Table ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: var(--bg-dark);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

/* ===== Alerts ===== */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-info {
    background: var(--info-light);
    color: #1e40af;
    border: 1px solid rgba(30, 143, 62, 0.18);
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

/* ===== Settings / Info Rows ===== */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== Danger Zone ===== */
.danger-zone {
    border-color: var(--danger);
}

.danger-zone .card-header {
    border-color: rgba(239, 68, 68, 0.3);
}

.danger-zone .card-header h3 {
    color: var(--danger);
}

.danger-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.danger-action p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== Modals ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.modal-content.modal-small {
    max-width: 400px;
}

.modal-content.modal-large {
    max-width: 780px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-content.modal-large .modal-body {
    overflow-y: auto;
    flex: 1;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== Search Input ===== */
.search-input {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    width: 250px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

select {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

/* ===== Loading ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245, 246, 248, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    gap: 16px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 14px;
}

.loading-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.loading-inline .spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.pagination button {
    padding: 8px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.pagination button:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.pagination button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Webhook / Log Styles ===== */
.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-timestamp {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 140px;
}

.log-method {
    flex-shrink: 0;
}

.log-path {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
}

.log-status {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.log-status.success {
    background: var(--success-light);
    color: #065f46;
}

.log-status.error {
    background: var(--danger-light);
    color: #991b1b;
}

/* ===== Empty State ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    color: var(--border-color);
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 14px;
    max-width: 360px;
}

/* ===== Tabs (generic) ===== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
}

.tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== Responsive ===== */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .downloads-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .api-tester {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }

    .sidebar-header .logo-text,
    .sidebar-header .logo-subtext,
    .nav-item span,
    .nav-section-label,
    .user-details {
        display: none;
    }

    .sidebar-header {
        justify-content: center;
    }

    .nav-item {
        justify-content: center;
        padding: 12px;
    }

    .sidebar-footer {
        flex-direction: column;
        gap: 8px;
    }

    .main-content {
        margin-left: 80px;
    }

    .downloads-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .api-endpoint-desc {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
    }

    .page-header {
        flex-direction: column;
        gap: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .downloads-grid {
        grid-template-columns: 1fr;
    }

    .api-tester {
        grid-template-columns: 1fr;
    }

    .api-endpoint {
        flex-wrap: wrap;
        gap: 8px;
    }

    .api-endpoint-path {
        min-width: auto;
        width: 100%;
    }

    .api-endpoint-desc {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .search-input {
        width: 100%;
    }

    .card-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .card-actions {
        width: 100%;
    }

    .credential-value {
        flex-direction: column;
    }

    .credential-value code {
        width: 100%;
    }

    .credential-actions {
        width: 100%;
    }

    .tester-url-row {
        flex-direction: column;
    }

    .tester-method-select {
        min-width: auto;
    }

    .quick-endpoints {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
    }

    .quick-endpoint-btn {
        flex-shrink: 0;
    }

    .toast-container {
        top: auto;
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }

    .modal-content.modal-large {
        max-width: 100%;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
    }

    .header-actions .btn {
        width: 100%;
    }
}

/* ===== Scrollbar Styling ===== */
.code-block::-webkit-scrollbar,
.tester-response-body::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.code-block::-webkit-scrollbar-track,
.tester-response-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.code-block::-webkit-scrollbar-thumb,
.tester-response-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.code-block::-webkit-scrollbar-thumb:hover,
.tester-response-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

/* ===== Selection ===== */
::selection {
    background: rgba(30, 143, 62, 0.18);
    color: inherit;
}

.code-block ::selection {
    background: rgba(137, 180, 250, 0.3);
    color: #fff;
}

.code-block code,
.code-block pre {
    -webkit-text-fill-color: currentColor;
}

/* ===== Focus Visible ===== */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===================================================================
   April 20, 2026 design-audit batch — patches for D-02, D-07, D-08,
   D-09, D-15, D-16, D-19, D-21. Individual fixes are annotated inline.
   =================================================================== */

/* D-02 — prevent the browser's overscroll-back gesture on Mac/Linux
   trackpads from triggering history.back() when the user scrolls up
   past the top of Quick Start. popstate fires, the SPA router reads
   the previous URL, and the page spontaneously switches. `contain`
   keeps overscroll local to the document. */
html, body { overscroll-behavior-y: contain; }

/* D-21 — normalise heading sizes across the portal. Was previously 4
   different computed sizes depending on which page/context h3 rendered
   in. Single source of truth now; inline overrides are removed. */
.main-content h1 { font-size: 1.5rem;  line-height: 1.25; font-weight: 700; }
.main-content h2 { font-size: 1.25rem; line-height: 1.3;  font-weight: 600; }
.main-content h3 { font-size: 1rem;    line-height: 1.35; font-weight: 600; }

/* D-07 — API Tester response-panel tabs. When the active tab had just
   `btn btn-small` (no btn-outline), it rendered as an empty hollow box.
   Add an explicit active state that's visible. */
.response-tabs { display: flex; gap: 0; padding: 8px 16px; border-bottom: 1px solid var(--border-color); }
.response-tab {
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background .14s, color .14s;
}
.response-tab:first-child { border-radius: 6px 0 0 6px; border-right: none; }
.response-tab:last-child  { border-radius: 0 6px 6px 0; }
.response-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.response-tab:not(.active):hover {
    background: var(--primary-soft);
    color: var(--primary);
}

/* D-08 — long response headers (content-security-policy, report-to)
   overflowed 2076px wide inside a 1363px viewport, forcing the whole
   page to scroll sideways. Wrap inside the response panel; clamp the
   overflow to the panel itself. */
.response-area,
#response-body-tab,
#response-headers-tab {
    overflow-x: auto;
    max-width: 100%;
}
.response-area pre,
#response-body-tab pre,
#response-headers-tab pre {
    white-space: pre-wrap;
    word-break: break-all;
    max-width: 100%;
}

/* D-15 — Coming Soon addon cards were getting CSS-grid stretched to
   match the taller "Available" CS-Cart card, creating awkward empty
   space. Pin cards to their natural height; push the CTA to the
   bottom with margin-top:auto on the button. */
.downloads-grid { align-items: start; }
.download-card { display: flex; flex-direction: column; }

/* D-16 — give the Copy button visible in-button feedback so developers
   aren't relying on toast notifications alone. Paired with the JS
   change in copyCode() that adds/removes the .copied class. */
.copy-btn.copied,
.btn-copy.copied {
    background: var(--primary);
    color: var(--text-on-primary, #fff);
    border-color: var(--primary);
}

/* D-19 — extract the "Two things to know" banner to a reusable class.
   Previously inline style="..." on the <div> — not themeable. */
.playground-notice {
    background: var(--primary-soft);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 1rem;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-secondary);
}
.playground-notice strong { color: var(--text-primary); }
.playground-notice code {
    background: rgba(30, 143, 62, 0.12);
    color: var(--primary);
}
.playground-notice-icon {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--primary);
}
.playground-notice-inner { display: flex; align-items: flex-start; gap: 10px; }

/* D-11 — Plan Information rows had no label-vs-value distinction and
   rendered as one unbroken string ("Current Plan Premium"). Add proper
   two-column layout with typographic hierarchy. */
.plan-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.plan-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.plan-row:last-child { border-bottom: none; }
.plan-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.plan-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-mono);
    text-align: right;
}

/* D-09 — mobile hamburger. Hidden on desktop; visible + drawer-open
   below 768px. Paired with a backdrop overlay that dismisses on tap.
   The sidebar's existing `.open` class is what the JS toggles. */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1050;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--primary);
    color: var(--text-on-primary, #fff);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    align-items: center;
    justify-content: center;
}
.mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(14, 17, 15, 0.45);
    z-index: 998;
    animation: fadeIn .18s ease;
}
.mobile-nav-backdrop.show { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .sidebar { width: 200px; }
    .main-content { margin-left: 200px; }
}
@media (max-width: 768px) {
    .sidebar { position: fixed; left: -260px; z-index: 999; transition: left 0.3s; }
    .sidebar.open { left: 0; box-shadow: 0 16px 40px -10px rgba(0,0,0,.3); }
    .main-content { margin-left: 0; padding: 16px 16px 16px 72px; }
    .mobile-nav-toggle { display: inline-flex; }
    /* Mobile: badge on its own top row, path+desc stacked below it, Try button
       flips under. Keeps long descriptions readable instead of hidden. */
    .endpoint-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "badge  try"
            "path   path"
            "desc   desc";
        column-gap: 8px;
        row-gap: 4px;
    }
    .code-tabs { flex-wrap: wrap; }
    .qs-step-content { flex-direction: column; }
    .response-area pre { font-size: 11px; }
}
@media (max-width: 480px) {
    .page-header h1 { font-size: 1.2rem; }
    .stat-card { min-width: 100%; }
    .code-block { padding: 12px; font-size: 11px; }
    .tester-form { padding: 12px; }
}
