/* Final contrast and typography guardrails. Loaded after every feature stylesheet. */

/* Dark surfaces must opt in to light headings because the global heading color is dark. */
.connect-hero h1,
.connect-hero h2,
.connect-hero h3,
.admin-hero h1,
.admin-hero h2,
.admin-hero h3,
.auth-visual h1,
.auth-visual h2,
.auth-visual h3 {
  color: #ffffff;
}

.connect-hero { background-color: #151a25; }
.admin-hero { background-color: #191b29; }
.auth-visual { background-color: #171928; }

/* Use one stable local font stack everywhere, including the authentication gate. */
.auth-gate,
.auth-gate button,
.auth-gate input,
.auth-gate select,
.auth-gate textarea,
.admin-view,
.admin-view button,
.admin-view input,
.admin-view select,
.admin-view textarea {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Sidebar */
.sidebar .brand strong { color: #ffffff; }
.workspace-logo,
.marketplace-logo.kaspi { color: #ffffff; background: #c5221f; }
.nav-item em { font-size: 10px; }
.version {
  color: #9ca3af;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* Onboarding and auth dark panels */
.feature-list > div > span { font-size: 10px; }
.auth-brand-mark { color: #ffffff; background: #4338ca; }
.auth-brand strong { color: #ffffff; }
.auth-brand small { color: #c1c7d0; font-size: 11px; letter-spacing: .04em; }
.auth-hero span { color: #e1e5ec; font-size: 11px; letter-spacing: .04em; }
.auth-hero p { color: #c5cad4; }
.auth-point b { color: #ffffff; background: rgba(0,0,0,.22); }
.auth-point strong { color: #ffffff; font-size: 13px; }
.auth-point small { color: #b9c0cb; font-size: 11px; }
.auth-user-copy strong { color: #f9fafb; font-size: 12px; }
.auth-user-copy small { color: #b3bac7; font-size: 11px; }
.auth-note { color: #667085; font-size: 11px; }
.auth-tabs button { color: #596273; }
.auth-tabs button.active { color: #111827; }

/* Forms and marketplace states */
.marketplace-card-head p.connected { color: #0f704b; }
.profile-actions .primary-button { background: #4338ca; }
.primary-button b { background: rgba(0,0,0,.14); }
.profile-saved-badge { font-size: 10px; }
.catalog-scan-form label > span { color: #596273; }
.catalog-scan-head > button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  display: grid;
  place-items: center;
}
.abc-badge { font-size: 10px; }

/* Admin is a professional operations console, not a micro-text diagnostic screen. */
.admin-hero-copy p { color: #c4c2d0; font-size: 11px; letter-spacing: .06em; }
.admin-hero-copy small { color: #d3d2dc; font-size: 12px; }
.admin-owner-badge { color: #f1efff; font-size: 11px; }
.admin-tabs button { color: #596273; font-size: 11px; }
.admin-tabs button.active { color: #ffffff; }
.admin-loading { font-size: 12px; }
.admin-error { color: #8f2634; font-size: 11px; }
.admin-empty { font-size: 12px; }
.admin-toolbar > small { font-size: 11px; }
.admin-search input { font-size: 12px; }
.admin-user-card-head strong { font-size: 12px; }
.admin-user-card-head small { font-size: 11px; }
.admin-user-card-body p { font-size: 11px; }
.admin-open-cabinet { font-size: 11px; }
.admin-cabinet-toolbar p { font-size: 10px; }
.admin-cabinet-toolbar small { font-size: 11px; }
.admin-cabinet-toolbar label span { font-size: 10px; }
.admin-cabinet-toolbar select { font-size: 12px; }
.admin-readonly-notice strong { font-size: 12px; }
.admin-readonly-notice span { font-size: 11px; }
.admin-kpi span { font-size: 10px; }
.admin-kpi small { font-size: 11px; }
.admin-kpi.primary span,
.admin-kpi.primary small { color: #ffffff; }
.admin-section-head p { font-size: 10px; }
.admin-section-head small { font-size: 11px; }
.admin-cabinet-facts span { font-size: 10px; }
.admin-cabinet-facts strong { font-size: 11px; }
.admin-table th { font-size: 10px; }
.admin-table td { font-size: 11px; }
.admin-setting strong { font-size: 11px; }
.admin-setting small { font-size: 10px; }
.admin-setting b { font-size: 10px; }

/* Explicit semantic contrast on light surfaces. */
.connection-badge.connected { color: #0f6b46; background: #ecfdf3; border-color: #b7e5ce; }
.warning { color: #704b08; background: #fff9e8; border-color: #efd89d; }
.error-message,
.settings-message { color: #a92736; }
.settings-message.success,
.auth-message.success { color: #0f704b; }
.order-status.completed { color: #0f6b46; background: #eaf8f1; }
.order-status.cancelled { color: #a32d3b; background: #fff0f2; }
.order-status.returned { color: #81530a; background: #fff7df; }
.order-status.processing { color: #5b2f99; background: #f3edff; }

/* Keep disabled controls intentionally subdued; all active controls remain fully readable. */
button:not(:disabled),
[role="button"]:not([aria-disabled="true"]) {
  text-rendering: optimizeLegibility;
}

@media (max-width: 680px) {
  .secondary-button {
    width: auto;
    min-width: 40px;
    padding: 0 13px;
    font-size: 12px;
  }
  .catalog-scan-actions .secondary-button,
  .settings-card-actions .secondary-button,
  .fixture-panel .secondary-button {
    width: auto;
    min-width: 88px;
    font-size: 12px;
  }
}
