/* Customer portal — auth, dashboard, integration docs.
   Gold links in content only; sidebar uses admin .nav-item / .admin-brand (not gold). */
a:not(.btn):not(.nav-item) {
  color: #d4af37;
}
a:not(.btn):not(.nav-item):hover {
  color: #f1d67a;
}
.admin-sidebar .admin-brand a {
  color: var(--text, #e8eaf6);
  text-decoration: none;
}
.admin-sidebar .admin-brand a:hover {
  color: var(--accent, #6c63ff);
}
.portal-auth-wrap {
  min-height: calc(100vh - 8rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.portal-auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card, #12141c);
  border: 1px solid var(--line, #252a3a);
  border-radius: 20px;
  padding: 2rem 2rem 1.75rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.portal-auth-card h2 {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}
.portal-auth-card .sub {
  color: var(--muted, #8b95b2);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.portal-auth-card .form-group label {
  font-size: 0.85rem;
  font-weight: 600;
}
.portal-auth-card input[type="email"],
.portal-auth-card input[type="password"],
.portal-auth-card input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line, #252a3a);
  background: #0c0e14;
  color: var(--text, #e8eaf6);
  font-size: 1rem;
}
.portal-auth-card input:focus {
  outline: none;
  border-color: var(--accent2, #00d2ff);
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.15);
}
.portal-auth-card .btn-primary {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 1rem;
}
.portal-auth-links {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted, #8b95b2);
}
.portal-auth-links a {
  color: var(--accent2, #00d2ff);
  text-decoration: none;
}
.portal-auth-links a:hover {
  text-decoration: underline;
}
.portal-plan-hint {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(108, 99, 255, 0.08);
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--muted, #8b95b2);
  line-height: 1.5;
}

/* Layout — align with admin: sidebar + main; content width readable */
.portal-shell-main {
  min-width: 0;
}
.portal-main-auth {
  min-height: 100vh;
}
.portal-main-auth .admin-top-bar {
  text-align: center;
}
.portal-main-auth .admin-top-bar .admin-page-header,
.portal-main-auth .admin-top-bar .flash {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  text-align: start;
}
.portal-main-auth .admin-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex: 1 1 auto;
  padding-top: 1rem;
}
.portal-main-auth .portal-auth-wrap {
  width: 100%;
  max-width: 420px;
}
.portal-wrap {
  max-width: 960px;
  overflow: visible;
}
.portal-platform-notice {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.45);
  color: #e8d4a8;
}
.portal-catalog-notice {
  margin-bottom: 1.25rem;
  border-color: rgba(108, 99, 255, 0.45);
  background: rgba(108, 99, 255, 0.08);
}
.portal-sidebar {
  border-right-color: rgba(108, 99, 255, 0.2);
}

/* Dashboard */
.portal-dash-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 720px) {
  .portal-dash-hero {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}
.portal-dash-intro {
  padding: 1.25rem 1.35rem;
  border-radius: 16px;
  border: 1px solid var(--line, #252a3a);
  background: linear-gradient(145deg, rgba(108, 99, 255, 0.12), rgba(18, 20, 28, 0.9));
}
.portal-dash-intro h2 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}
.portal-dash-intro p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted, #8b95b2);
  line-height: 1.55;
}
.portal-dash-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}
.portal-dash-quick a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line, #252a3a);
  color: var(--accent2, #00d2ff);
  text-decoration: none;
  background: rgba(0, 210, 255, 0.06);
}
.portal-dash-quick a:hover {
  border-color: var(--accent2, #00d2ff);
  background: rgba(0, 210, 255, 0.12);
}

.portal-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.portal-stat-card {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--line, #252a3a);
  background: var(--card, #12141c);
}
.portal-stat-card .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #8b95b2);
  margin-bottom: 0.35rem;
}
.portal-stat-card .value {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  color: var(--text, #e8eaf6);
}
.portal-stat-card .sub {
  font-size: 0.8rem;
  color: var(--muted, #8b95b2);
  margin-top: 0.35rem;
}

.portal-panel {
  margin-bottom: 1.25rem;
}
.portal-panel h2,
.portal-panel h3 {
  font-size: 1.05rem;
  margin-bottom: 0.65rem;
}
.portal-panel-muted {
  color: var(--muted, #8b95b2);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* Integration / docs */
.portal-doc-lead {
  color: var(--muted, #8b95b2);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}
.portal-doc-section {
  margin-bottom: 2rem;
}
.portal-doc-section h2 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line, #252a3a);
}
.portal-doc-section h3 {
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
  color: var(--text, #e8eaf6);
}
.portal-doc-callout {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid rgba(255, 193, 7, 0.25);
  font-size: 0.88rem;
  color: var(--muted, #b8c0d4);
  margin: 0.75rem 0;
}
.portal-doc-steps {
  margin: 0.5rem 0 1rem;
  padding-left: 1.15rem;
  color: var(--muted, #8b95b2);
  font-size: 0.9rem;
  line-height: 1.65;
}
.portal-doc-steps li {
  margin-bottom: 0.35rem;
}

.portal-code-block {
  position: relative;
  margin: 0.75rem 0 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--line, #252a3a);
  background: #0a0c12;
  overflow: hidden;
}
.portal-code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: rgba(37, 42, 58, 0.6);
  border-bottom: 1px solid var(--line, #252a3a);
}
.portal-code-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #8b95b2);
}
.portal-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--line, #353b4f);
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent2, #00d2ff);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.portal-copy-btn:hover {
  background: rgba(108, 99, 255, 0.28);
  border-color: var(--accent2, #00d2ff);
}
.portal-copy-btn .portal-copy-icon {
  font-size: 1rem;
  line-height: 1;
}
.portal-pre {
  margin: 0;
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, 'JetBrains Mono', 'Consolas', monospace;
  color: #c8d0e0;
}
.portal-pre code {
  font-family: inherit;
}

.portal-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  margin: 0.75rem 0;
}
.portal-table-wrap .admin-table {
  min-width: 560px;
}

.key-reveal-portal {
  word-break: break-all;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Disabled panels (operator feature flags) */
.portal-panel-disabled {
  opacity: 0.85;
}
.portal-panel-disabled button:not(:disabled),
.portal-panel-disabled input:not(:disabled),
.portal-panel-disabled select:not(:disabled),
.portal-panel-disabled textarea:not(:disabled) {
  cursor: not-allowed;
}

/* Onboarding wizard */
.portal-onboarding-steps {
  margin: 1rem 0 0;
  padding-left: 0;
  list-style: none;
}
.portal-onb-step {
  position: relative;
  margin-bottom: 1.25rem;
  padding: 1rem 1rem 1rem 3.25rem;
  border-radius: 14px;
  border: 1px solid var(--line, #252a3a);
  background: rgba(18, 20, 28, 0.65);
  transition: border-color 0.2s, background 0.2s;
}
.portal-onb-step.portal-onb-done {
  border-color: rgba(0, 210, 255, 0.35);
  background: rgba(0, 210, 255, 0.06);
}
.portal-onb-step h3 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.portal-onb-num {
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(108, 99, 255, 0.25);
  color: var(--text, #e8eaf6);
}
.portal-onb-done .portal-onb-num {
  background: rgba(0, 210, 255, 0.35);
}
.portal-onb-toggle {
  margin-top: 0.75rem;
}
.portal-onb-actions {
  margin-top: 1rem;
}
.portal-job-log {
  font-size: 0.78rem;
}
.portal-ollama-form input[type="url"] {
  width: 100%;
  max-width: 520px;
}

.portal-help-tip {
  display: inline-flex;
  width: 1.1rem;
  height: 1.1rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line, #252a3a);
  color: var(--muted, #8b95b2);
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
  cursor: help;
}

.portal-model-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
.portal-model-card {
  border: 1px solid var(--line, #252a3a);
  border-radius: 12px;
  padding: 0.75rem;
  background: rgba(18, 20, 28, 0.65);
}
.portal-model-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.portal-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line, #252a3a);
  color: var(--muted, #8b95b2);
  font-size: 0.75rem;
}

.portal-pull-jobs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}
.portal-job-card {
  border: 1px solid var(--line, #252a3a);
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
  background: rgba(18, 20, 28, 0.6);
}
.portal-job-head,
.portal-job-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.portal-job-status {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid var(--line, #252a3a);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}
.portal-job-status-running { color: #7cc7ff; }
.portal-job-status-succeeded { color: #79e2a4; }
.portal-job-status-failed { color: #ff8b8b; }
.portal-job-status-cancelled { color: #f2c66d; }
.portal-job-progress {
  margin: 0.5rem 0 0.4rem;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.portal-job-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(0, 210, 255, 0.7), rgba(108, 99, 255, 0.8));
}
.portal-register-progress {
  margin-top: 0.6rem;
}
.portal-job-progress-bar-indeterminate {
  width: 40% !important;
  animation: portalIndeterminateSlide 1.2s ease-in-out infinite;
}
@keyframes portalIndeterminateSlide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(260%);
  }
}
.portal-job-meta {
  font-size: 0.8rem;
  color: var(--muted, #8b95b2);
}
