/* public/css/b2b.css — B2B onboarding & dashboard styles.
   Dark theme matching the ThreadTag brand. */

/* ── ONBOARDING ─────────────────────────────────────────────────── */
.ob-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.ob-header { text-align: center; margin-bottom: 3rem; }
.ob-eyebrow {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--green); font-weight: 500; margin-bottom: 0.875rem;
}
.ob-headline {
  font-family: var(--font-serif); font-size: clamp(2rem,5vw,3rem);
  font-weight: 300; color: var(--text); line-height: 1.1;
  margin-bottom: 0.875rem;
}
.ob-sub { font-size: 1rem; color: var(--text-muted); line-height: 1.7; max-width: 480px; margin: 0 auto; }

/* Progress steps */
.ob-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 3rem;
}
.ob-step-item { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.ob-step-circle {
  width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem; font-weight: 600; color: var(--text-muted);
  background: var(--surface); transition: all 0.25s;
}
.ob-step-item.ob-step--active .ob-step-circle { border-color: var(--green); color: var(--green); }
.ob-step-item.ob-step--done .ob-step-circle { background: var(--green); border-color: var(--green); color: var(--bg); }
.ob-step-item span { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.ob-step-item.ob-step--active span { color: var(--green); }
.ob-step-line { flex: 1; height: 1px; background: var(--border); margin: 0 0.75rem; min-width: 40px; }

/* Error */
.ob-error {
  background: var(--red-dim); border: 1px solid rgba(224,82,82,0.3);
  color: var(--red); border-radius: 8px; padding: 0.875rem 1rem;
  font-size: 0.875rem; margin-bottom: 1.5rem;
}

/* Panel */
.ob-panel { display: none; }
.ob-panel--active { display: block; }
.ob-panel-header { margin-bottom: 2rem; }
.ob-panel-header h2 {
  font-family: var(--font-serif); font-size: 1.5rem; font-weight: 400;
  color: var(--text); margin-bottom: 0.5rem;
}
.ob-panel-header p { font-size: 0.9375rem; color: var(--text-muted); }

/* Form fields */
.ob-field { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }
.ob-field label { font-size: 0.8125rem; font-weight: 500; color: var(--text); }
.ob-optional { font-weight: 400; color: var(--text-muted); margin-left: 0.5rem; font-size: 0.75rem; }
.ob-field input, .ob-field select {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.75rem 1rem;
  font-size: 0.9375rem; color: var(--text); font-family: var(--font-sans);
  transition: border-color 0.15s;
}
.ob-field input:focus, .ob-field select:focus {
  outline: none; border-color: var(--green);
}
.ob-field input::placeholder { color: var(--text-muted); }
.ob-field select { cursor: pointer; }
.ob-field select option { background: var(--surface-2); }

/* Actions */
.ob-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.ob-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: 8px;
  font-size: 0.9375rem; font-weight: 500; font-family: var(--font-sans);
  cursor: pointer; border: 1px solid transparent; transition: all 0.15s;
}
.ob-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ob-btn--primary {
  background: var(--green); color: var(--bg); border-color: var(--green);
}
.ob-btn--primary:hover:not(:disabled) { background: #34c072; }
.ob-btn--ghost {
  background: transparent; color: var(--text-muted); border-color: var(--border);
}
.ob-btn--ghost:hover { border-color: var(--text-muted); color: var(--text); }

/* API Key display */
.ob-key-display { margin-bottom: 2rem; }
.ob-key-generating {
  display: flex; align-items: center; gap: 0.875rem;
  color: var(--text-muted); font-size: 0.9375rem;
}
.ob-key-spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--green); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ob-key-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.5rem;
}
.ob-key-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.75rem; }
.ob-key-value {
  font-family: monospace; font-size: 0.9375rem; color: var(--green);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.875rem 1rem; word-break: break-all;
  margin-bottom: 0.875rem;
}
.ob-key-hint {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 1rem;
}
.ob-copy-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.5rem 1rem;
  font-size: 0.8125rem; color: var(--text); font-family: var(--font-sans);
  cursor: pointer; transition: border-color 0.15s;
}
.ob-copy-btn:hover { border-color: var(--green); color: var(--green); }

.ob-key-meta { display: flex; gap: 1.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.ob-key-meta-item { display: flex; flex-direction: column; gap: 0.25rem; }
.ob-key-meta-label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.ob-key-meta-val { font-size: 0.875rem; color: var(--text); }

/* Launch screen */
.ob-launch { text-align: center; padding: 1rem 0; }
.ob-launch-icon { position: relative; width: 80px; height: 80px; margin: 0 auto 2rem; }
.ob-launch-ring { position: absolute; border-radius: 50%; border: 1px solid; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.ob-launch-ring--1 { width: 80px; height: 80px; border-color: rgba(46,168,104,0.2); }
.ob-launch-ring--2 { width: 60px; height: 60px; border-color: rgba(46,168,104,0.35); }
.ob-launch-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 48px; height: 48px; background: var(--green); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ob-launch h2 { font-family: var(--font-serif); font-size: 2rem; font-weight: 300; color: var(--text); margin-bottom: 0.75rem; }
.ob-launch p { font-size: 1rem; color: var(--text-muted); margin-bottom: 2rem; }

.ob-verification-notice {
  display: inline-flex; align-items: flex-start; gap: 0.625rem;
  background: var(--amber-dim); border: 1px solid rgba(200,120,14,0.3);
  border-radius: 8px; padding: 1rem 1.25rem;
  font-size: 0.875rem; color: var(--text-muted); text-align: left;
  margin-bottom: 2rem; max-width: 500px;
}
.ob-verification-notice svg { flex-shrink: 0; margin-top: 2px; color: var(--amber); }
.ob-verification-notice strong { color: var(--amber); }

.ob-launch-actions { display: flex; justify-content: center; gap: 1rem; }

/* ── DASHBOARD LOGIN ────────────────────────────────────────────── */
.dl-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.5rem;
}
.dl-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 2.5rem;
}
.dl-brand {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 2.5rem;
}
.dl-logo { width: 20px; height: 20px; border: 1.5px solid var(--green); border-radius: 50%; position: relative; }
.dl-logo::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 7px; height: 7px; background: var(--green); border-radius: 50%; }
.dl-name { font-family: var(--font-serif); font-size: 1rem; font-weight: 600; color: var(--text); }
.dl-sep { color: var(--border); }
.dl-product { font-size: 0.875rem; color: var(--text-muted); }

.dl-header { margin-bottom: 2rem; }
.dl-header h1 { font-family: var(--font-serif); font-size: 1.75rem; font-weight: 300; color: var(--text); margin-bottom: 0.5rem; }
.dl-header p { font-size: 0.9375rem; color: var(--text-muted); }

.dl-alert { border-radius: 8px; padding: 0.875rem 1rem; font-size: 0.875rem; margin-bottom: 1.5rem; }
.dl-alert--error { background: var(--red-dim); border: 1px solid rgba(224,82,82,0.3); color: var(--red); }
.dl-alert--success { background: var(--green-dim); border: 1px solid rgba(46,168,104,0.3); color: var(--green); }

.dl-form { display: flex; flex-direction: column; gap: 1.25rem; }
.dl-field { display: flex; flex-direction: column; gap: 0.5rem; }
.dl-field label { font-size: 0.8125rem; font-weight: 500; color: var(--text); }
.dl-field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.dl-field-link { font-size: 0.8125rem; color: var(--text-muted); text-decoration: none; }
.dl-field-link:hover { color: var(--green); }
.dl-field input {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.75rem 1rem;
  font-size: 0.9375rem; color: var(--text); font-family: var(--font-sans);
  transition: border-color 0.15s;
}
.dl-field input:focus { outline: none; border-color: var(--green); }

.dl-btn {
  width: 100%; padding: 0.875rem; background: var(--green); color: var(--bg);
  border: none; border-radius: 8px; font-size: 0.9375rem; font-weight: 600;
  font-family: var(--font-sans); cursor: pointer; transition: background 0.15s;
  margin-top: 0.5rem;
}
.dl-btn:hover { background: #34c072; }

.dl-footer { text-align: center; margin-top: 1.5rem; }
.dl-footer p { font-size: 0.875rem; color: var(--text-muted); }
.dl-footer a { color: var(--green); }
.dl-footer a:hover { text-decoration: underline; }

/* ── DASHBOARD HOME ─────────────────────────────────────────────── */
.dash-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.875rem 2rem; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 50;
}
.dash-nav-brand { display: flex; align-items: center; gap: 0.625rem; }
.dash-logo { width: 22px; height: 22px; border: 1.5px solid var(--green); border-radius: 50%; position: relative; }
.dash-logo::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 8px; height: 8px; background: var(--green); border-radius: 50%; }
.dash-name { font-family: var(--font-serif); font-size: 1rem; font-weight: 600; color: var(--text); }
.dash-nav-links { display: flex; gap: 2rem; }
.dash-nav-link { font-size: 0.875rem; color: var(--text-muted); text-decoration: none; transition: color 0.15s; }
.dash-nav-link:hover, .dash-nav-link--active { color: var(--text); }
.dash-nav-user { display: flex; align-items: center; gap: 1rem; }
.dash-user-name { font-size: 0.875rem; color: var(--text-muted); }
.dash-logout-btn { background: none; border: none; font-size: 0.8125rem; color: var(--text-muted); cursor: pointer; font-family: var(--font-sans); padding: 0; }
.dash-logout-btn:hover { color: var(--red); }

.dash-layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 57px); }

.dash-sidebar { padding: 2rem 1.5rem; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 1.5rem; }

.dash-org-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.dash-org-name { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 0.625rem; }
.dash-verification-badge {
  display: inline-flex; align-items: center; gap: 0.375rem;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em;
  padding: 0.25rem 0.625rem; border-radius: 4px; text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.dash-verification-badge--pending { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(200,120,14,0.3); }
.dash-verification-badge--under_review { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(200,120,14,0.3); }
.dash-verification-badge--verified { background: var(--green-dim); color: var(--green); border: 1px solid rgba(46,168,104,0.3); }
.dash-verification-badge--rejected { background: var(--red-dim); color: var(--red); border: 1px solid rgba(224,82,82,0.3); }
.dash-org-meta { font-size: 0.75rem; color: var(--text-muted); }

.dash-sidebar-section { display: flex; flex-direction: column; gap: 0.375rem; }
.dash-sidebar-label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.dash-sidebar-val { font-size: 0.875rem; color: var(--text); }
.dash-sidebar-link { font-size: 0.875rem; color: var(--green); }
.dash-sidebar-link:hover { text-decoration: underline; }

.dash-api-summary { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.dash-api-summary-label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.5rem; }
.dash-api-summary-count { font-family: var(--font-serif); font-size: 2rem; font-weight: 300; color: var(--text); line-height: 1; }
.dash-api-summary-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; margin-bottom: 0.875rem; }
.dash-api-summary-link { font-size: 0.8125rem; color: var(--green); }

/* Main */
.dash-main { padding: 2rem 2.5rem; display: flex; flex-direction: column; gap: 2rem; }

.dash-alert {
  display: flex; align-items: flex-start; gap: 0.75rem;
  border-radius: 10px; padding: 1rem 1.25rem; font-size: 0.875rem;
}
.dash-alert svg { flex-shrink: 0; margin-top: 2px; }
.dash-alert--info { background: rgba(30,80,180,0.1); border: 1px solid rgba(30,80,180,0.3); color: #6090e0; }
.dash-alert--warn { background: var(--amber-dim); border: 1px solid rgba(200,120,14,0.3); color: var(--text); }

.dash-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
.dash-stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.25rem;
}
.dash-stat-num { font-family: var(--font-serif); font-size: 2rem; font-weight: 300; color: var(--text); line-height: 1; margin-bottom: 0.25rem; }
.dash-stat-num--green { color: var(--green); }
.dash-stat-num--red { color: var(--red); }
.dash-stat-num--amber { color: var(--amber); }
.dash-stat-unit { font-size: 0.875rem; color: var(--text-muted); }
.dash-stat-label { font-size: 0.8125rem; font-weight: 500; color: var(--text); margin-bottom: 0.125rem; }
.dash-stat-sub { font-size: 0.75rem; color: var(--text-muted); }

.dash-section { display: flex; flex-direction: column; gap: 1.25rem; }
.dash-section-header { display: flex; align-items: center; justify-content: space-between; }
.dash-section-title { font-size: 1rem; font-weight: 600; color: var(--text); }
.dash-section-link { font-size: 0.8125rem; color: var(--green); }
.dash-section-link:hover { text-decoration: underline; }

/* Empty state */
.dash-empty { display: flex; flex-direction: column; gap: 1.25rem; }
.dash-empty-icon { color: var(--text-muted); }
.dash-empty p { font-size: 0.9375rem; color: var(--text-muted); }
.dash-api-quickstart { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; }
.dash-api-quickstart-label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.875rem; }
.dash-api-code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1rem; overflow-x: auto; }
.dash-api-code code { font-family: 'Courier New', monospace; font-size: 0.8125rem; color: var(--text-muted); line-height: 1.7; }

/* Auth list */
.dash-auth-list { display: flex; flex-direction: column; gap: 0.75rem; }
.dash-auth-item {
  display: flex; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.875rem 1.25rem;
}
.dash-auth-img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.dash-auth-info { flex: 1; min-width: 0; }
.dash-auth-brand { font-size: 0.9375rem; font-weight: 500; color: var(--text); }
.dash-auth-date { font-size: 0.75rem; color: var(--text-muted); }
.dash-auth-score-bar { width: 80px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.dash-auth-score-fill { height: 100%; border-radius: 2px; transition: width 0.8s cubic-bezier(0.22,1,0.3,1); }
.dash-auth-score-fill--verified { background: var(--green); }
.dash-auth-score-fill--flagged { background: var(--red); }
.dash-auth-score-fill--needs_review { background: var(--amber); }
.dash-auth-score-num { font-size: 0.875rem; font-weight: 600; width: 28px; text-align: right; flex-shrink: 0; }
.dash-auth-score-num--verified { color: var(--green); }
.dash-auth-score-num--flagged { color: var(--red); }
.dash-auth-score-num--needs_review { color: var(--amber); }
.dash-auth-badge { font-size: 0.625rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.25rem 0.5rem; border-radius: 4px; flex-shrink: 0; }
.dash-auth-badge--verified { background: var(--green-dim); color: var(--green); }
.dash-auth-badge--flagged { background: var(--red-dim); color: var(--red); }
.dash-auth-badge--needs_review { background: var(--amber-dim); color: var(--amber); }

/* ── ERROR PAGES ────────────────────────────────────────────────── */
.err-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; }
.err-code { font-family: var(--font-serif); font-size: 6rem; font-weight: 300; color: var(--border); line-height: 1; margin-bottom: 1rem; }
.err-title { font-family: var(--font-serif); font-size: 1.75rem; font-weight: 300; color: var(--text); margin-bottom: 0.875rem; }
.err-message { font-size: 1rem; color: var(--text-muted); margin-bottom: 2.5rem; }
.err-home { color: var(--green); font-size: 0.9375rem; }
.err-home:hover { text-decoration: underline; }

/* ── ONBOARDING STEP 4: AUTH TEST ──────────────────────────────── */
.ob-test-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; margin-bottom: 1.5rem; }
.ob-test-label { font-size: 0.8125rem; font-weight: 500; color: var(--text); margin-bottom: 0.5rem; }
.ob-test-url-input, .ob-test-select {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.75rem 1rem;
  font-size: 0.875rem; color: var(--text); font-family: var(--font-sans);
  transition: border-color 0.15s;
}
.ob-test-url-input:focus, .ob-test-select:focus { outline: none; border-color: var(--green); }
.ob-test-url-input::placeholder { color: var(--text-muted); }
.ob-test-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.375rem; }
.ob-test-select option { background: var(--surface-2); }
.ob-test-result {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.5rem; min-height: 180px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ob-test-result-placeholder { display: flex; flex-direction: column; align-items: center; gap: 0.875rem; color: var(--text-muted); }
.ob-test-result-ring { width: 40px; height: 40px; border: 1.5px solid var(--border); border-radius: 50%; animation: pulse-ring 2.5s ease-in-out infinite; }
@keyframes pulse-ring { 0%,100% { opacity: 0.4; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
.ob-test-result-placeholder span { font-size: 0.8125rem; }
.ob-test-result-badge { font-size: 0.625rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.25rem 0.625rem; border-radius: 4px; margin-bottom: 0.875rem; align-self: flex-start; }
.badge--verified { background: var(--green-dim); color: var(--green); border: 1px solid rgba(46,168,104,0.3); }
.badge--flagged { background: var(--red-dim); color: var(--red); border: 1px solid rgba(224,82,82,0.3); }
.badge--needs_review { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(200,120,14,0.3); }
.ob-test-result-score-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; width: 100%; }
.ob-test-score-bar { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.ob-test-score-fill { height: 100%; border-radius: 3px; transition: width 0.8s cubic-bezier(0.22,1,0.3,1); }
.ob-test-score-fill--pass { background: var(--green); }
.ob-test-score-fill--fail { background: var(--red); }
.ob-test-score-num { font-size: 0.9375rem; font-weight: 600; color: var(--text); flex-shrink: 0; }
.ob-test-result-brand { font-size: 0.9375rem; font-weight: 600; color: var(--text); margin-bottom: 0.75rem; align-self: flex-start; }
.ob-test-reasons { list-style: none; display: flex; flex-direction: column; gap: 0.375rem; align-self: flex-start; width: 100%; }
.ob-test-reasons li { font-size: 0.8125rem; color: var(--text-muted); padding-left: 0.875rem; border-left: 2px solid var(--border); line-height: 1.5; }
.ob-test-result-error { display: flex; flex-direction: column; align-items: center; gap: 0.625rem; color: var(--red); text-align: center; }
.ob-test-result-error span { font-size: 0.875rem; }
#step4-continue:not(:disabled) { opacity: 1; cursor: pointer; }
#step4-continue:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ob-steps { gap: 0; }
  .ob-step-line { min-width: 24px; }
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .dash-stats { grid-template-columns: repeat(2,1fr); }
  .dash-nav-links { display: none; }
}

/* ── PARTNER CONSOLE: API KEYS ────────────────────────────────── */
.pc-tier-summary {
  display: flex; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.pc-tier-summary-label {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
}
.pc-tier-summary-rpm {
  font-size: 0.9375rem; color: var(--text); margin-left: auto;
  font-family: monospace;
}

.pc-tier-pill {
  display: inline-flex; align-items: center;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 0.25rem 0.625rem;
  border-radius: 4px;
}
.pc-tier-pill--starter { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.pc-tier-pill--pro { background: var(--green-dim); color: var(--green); border: 1px solid rgba(46,168,104,0.3); }
.pc-tier-pill--enterprise {
  background: rgba(220,38,38,0.08); color: var(--red);
  border: 1px solid rgba(220,38,38,0.3);
}

.pc-tier-summary { flex-wrap: wrap; row-gap: 0.5rem; }
.pc-tier-summary-sla {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem; border-radius: 4px;
}
.pc-tier-summary-sla--priority { color: var(--green); background: var(--green-dim); border: 1px solid rgba(46,168,104,0.3); }
.pc-tier-summary-sla--standard { color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); }

.pc-usage-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}
.pc-usage-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 0.5rem;
}
.pc-usage-count {
  font-family: monospace; font-size: 0.9375rem; color: var(--text);
  text-transform: none; letter-spacing: 0;
}
.pc-usage-bar {
  height: 6px; background: var(--surface-2); border-radius: 999px;
  overflow: hidden; margin-bottom: 0.5rem;
}
.pc-usage-bar-fill {
  height: 100%; background: var(--green); border-radius: 999px;
  transition: width 0.2s ease;
}
.pc-usage-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8125rem; color: var(--text-muted);
}
.pc-usage-prefix code { font-family: monospace; color: var(--text-muted); }

.pc-keys-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.pc-keys-table thead th {
  text-align: left; font-size: 0.6875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.pc-keys-table td {
  padding: 0.875rem 1.25rem; font-size: 0.875rem;
  color: var(--text); border-bottom: 1px solid var(--border);
}
.pc-keys-table tr:last-child td { border-bottom: none; }
.pc-key-row--revoked td { opacity: 0.5; }
.pc-key-prefix {
  font-family: monospace; font-size: 0.8125rem; color: var(--text-muted);
}

.pc-env-badge {
  display: inline-block; font-size: 0.625rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.2rem 0.5rem; border-radius: 4px;
}
.pc-env-badge--production { background: rgba(46,168,104,0.10); color: var(--green); border: 1px solid rgba(46,168,104,0.3); }
.pc-env-badge--sandbox { background: rgba(217,119,6,0.10); color: var(--amber); border: 1px solid rgba(217,119,6,0.3); }

.pc-status {
  display: inline-block; font-size: 0.625rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 0.2rem 0.5rem; border-radius: 4px;
}
.pc-status--active { background: var(--green-dim); color: var(--green); border: 1px solid rgba(46,168,104,0.3); }
.pc-status--revoked { background: rgba(220,38,38,0.08); color: var(--red); border: 1px solid rgba(220,38,38,0.3); }

.pc-generate-form {
  display: flex; flex-direction: column; gap: 0;
  max-width: 520px;
}

.pc-onetime-key {
  margin-top: 1.5rem; padding: 1.5rem;
  background: var(--surface); border: 1px solid var(--green);
  border-radius: 12px;
}
.pc-onetime-banner {
  background: var(--amber-dim);
  border: 1px solid rgba(217,119,6,0.3);
  border-radius: 8px; padding: 0.875rem 1rem;
  margin-bottom: 1.25rem; font-size: 0.875rem; color: var(--amber);
}

@media (max-width: 768px) {
  .pc-keys-table { font-size: 0.75rem; }
  .pc-keys-table thead th, .pc-keys-table td { padding: 0.625rem 0.75rem; }
}

/* ── PARTNER USAGE ─────────────────────────────────────────────── */
.pc-window-row {
  display: flex; align-items: center; gap: 0.625rem;
  margin-bottom: 1.25rem;
}
.pc-window-pill {
  display: inline-flex; align-items: center;
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.06em;
  padding: 0.4rem 0.875rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); text-decoration: none; transition: all 0.15s;
}
.pc-window-pill:hover { color: var(--text); border-color: var(--text-muted); }
.pc-window-pill--active {
  background: var(--bg); color: var(--text);
  border-color: var(--red);
}
.pc-window-label {
  margin-left: auto; font-size: 0.6875rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
}

.pc-error-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.pc-error-table thead th {
  text-align: left; font-size: 0.6875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.pc-error-table td {
  padding: 0.75rem 1.25rem; font-size: 0.875rem;
  color: var(--text); border-bottom: 1px solid var(--border);
}
.pc-error-table tr:last-child td { border-bottom: none; }
.pc-error-num { font-family: monospace; text-align: right; }
.pc-error-num:last-child { width: 96px; }
.pc-error-badge {
  display: inline-block; font-family: monospace;
  font-size: 0.6875rem; font-weight: 600;
  padding: 0.15rem 0.5rem; border-radius: 4px;
  margin-right: 0.5rem;
}
.pc-error-badge--429 { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(217,119,6,0.3); }
.pc-error-badge--4xx { background: rgba(220,38,38,0.08); color: var(--red); border: 1px solid rgba(220,38,38,0.3); }
.pc-error-badge--5xx { background: rgba(220,38,38,0.10); color: var(--red); border: 1px solid rgba(220,38,38,0.4); }

.pc-burn-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 1rem;
}
.pc-burn-num {
  font-family: var(--font-serif); font-size: 2rem; font-weight: 300;
  color: var(--text); line-height: 1;
}
.pc-burn-label {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-top: 0.25rem;
}
.pc-burn-cap { text-align: right; }
.pc-burn-cap-num {
  font-family: monospace; font-size: 1.125rem; font-weight: 600;
  color: var(--text);
}
.pc-burn-cap-label {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-top: 0.25rem;
}

.pc-burn-chart {
  width: 100%; height: 160px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 0; display: block;
}
.pc-burn-axis { stroke: var(--border); stroke-width: 1; }
.pc-burn-cap-line {
  stroke: var(--red); stroke-width: 1.25;
  stroke-dasharray: 4 3; opacity: 0.85;
}
.pc-burn-cap-label-svg {
  fill: var(--red); font-size: 10px; font-family: var(--font-sans);
}
.pc-burn-bar {
  fill: var(--text); opacity: 0.85; transition: opacity 0.15s;
}
.pc-burn-bar:hover { opacity: 1; fill: var(--red); }
.pc-burn-tick {
  fill: var(--text-muted); font-size: 10px;
  font-family: var(--font-sans);
}

/* ── PARTNER BILLING ─────────────────────────────────────────── */
.pc-billing-current {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.pc-billing-current-row {
  display: flex; align-items: baseline; gap: 1.25rem;
  flex-wrap: wrap;
}
.pc-billing-current-name {
  font-family: var(--font-serif); font-size: 1.5rem; font-weight: 300;
  color: var(--text);
}
.pc-billing-current-meta {
  font-family: monospace; font-size: 0.9375rem;
  color: var(--text-muted);
}
.pc-billing-price {
  text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 0.75rem; color: var(--text-muted);
}
.pc-billing-price strong { color: var(--text); font-family: monospace; font-size: 0.9375rem; }

.pc-billing-tier-grid {
  display: grid; gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .pc-billing-tier-grid { grid-template-columns: repeat(3, 1fr); }
}

.pc-billing-tier {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.875rem;
  position: relative;
}
.pc-billing-tier--current {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green-dim);
}
.pc-billing-tier-name {
  font-family: var(--font-serif); font-size: 1.25rem; font-weight: 400;
  color: var(--text);
}
.pc-billing-tier-rate {
  display: flex; align-items: baseline; gap: 0.625rem;
}
.pc-billing-tier-rate-num {
  font-family: monospace; font-size: 1.5rem; font-weight: 600;
  color: var(--text);
}
.pc-billing-tier-rate-unit {
  font-size: 0.75rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.pc-billing-tier-quota {
  font-size: 0.8125rem; color: var(--text-muted);
  font-family: monospace;
}
.pc-billing-tier-price {
  font-size: 0.875rem; color: var(--text);
}
.pc-billing-tier-price strong { font-family: monospace; }

.pc-billing-tier-actions {
  display: flex; align-items: center; gap: 0.625rem;
  margin-top: 0.5rem;
}
.pc-billing-tier-current-label {
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.25rem 0.625rem; border-radius: 4px;
  background: var(--green-dim); color: var(--green);
  border: 1px solid rgba(46,168,104,0.3);
}
.pc-billing-tier-downgrade {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
}
.pc-tier-btn {
  display: inline-flex; align-items: center;
  font-size: 0.8125rem; font-weight: 500;
  padding: 0.5rem 0.875rem; border-radius: 8px;
  cursor: pointer; border: 1px solid transparent;
  font-family: var(--font-sans); transition: all 0.15s;
}
.pc-tier-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pc-tier-btn--upgrade {
  background: var(--green); color: var(--bg); border-color: var(--green);
}
.pc-tier-btn--upgrade:hover:not(:disabled) { background: #34c072; }
.pc-tier-btn--downgrade {
  background: transparent; color: var(--text-muted);
  border-color: var(--border);
}
.pc-tier-btn--downgrade:hover:not(:disabled) { border-color: var(--red); color: var(--red); }

.pc-downgrade-warn {
  background: var(--amber-dim); border: 1px solid rgba(217,119,6,0.3);
  border-radius: 8px; padding: 0.875rem 1rem;
  display: flex; flex-direction: column; gap: 0.625rem;
}
.pc-downgrade-warn-text {
  font-size: 0.8125rem; color: var(--text);
  line-height: 1.5;
}
.pc-downgrade-warn-row {
  display: flex; align-items: center; gap: 0.625rem;
  flex-wrap: wrap;
}
.pc-downgrade-warn-label {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
}
.pc-downgrade-confirm-input {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.5rem 0.75rem;
  font-size: 0.875rem; color: var(--text); font-family: monospace;
  letter-spacing: 0.08em;
}
.pc-downgrade-confirm-input:focus { outline: none; border-color: var(--amber); }

.pc-billing-error {
  background: var(--red-dim); border: 1px solid rgba(224,82,82,0.3);
  color: var(--red); border-radius: 8px; padding: 0.875rem 1rem;
  font-size: 0.875rem; margin-bottom: 1rem;
}
