/* HIRECRM Enterprise Clean SaaS Final V2 Hardening
   UI-only final hardening layer:
   - removes public debug/demo visual leaks;
   - strengthens consistent control rhythm;
   - protects mobile/tablet layouts;
   - keeps internal chrome stable.
*/

:root {
  --ecsv2-bg: #f8fafc;
  --ecsv2-surface: #ffffff;
  --ecsv2-soft: #fbfcfe;
  --ecsv2-border: #e7ecf3;
  --ecsv2-border-soft: #edf2f7;
  --ecsv2-text: #0f172a;
  --ecsv2-muted: #64748b;
  --ecsv2-accent: #2563eb;
  --ecsv2-focus: 0 0 0 3px rgba(37, 99, 235, .14);
}

/* Public/auth pages: never show internal chrome or diagnostics. */
[data-public-page] .topbar,
[data-public-page] .sidebar,
[data-public-page] .global-search,
[data-public-page] .command-palette,
[data-public-page] .global-ai-widget,
[data-public-page] .worker-ai-chat,
[data-public-page] .mobile-bottom-nav,
[data-public-page] [data-global-search],
[data-public-page] [data-command-palette],
[data-public-page] [data-global-ai-widget],
[data-public-page] [data-pwa-install],
[data-public-page] [data-install-prompt],
[data-public-page] [class*="debug"],
[data-public-page] [class*="dev"],
[data-public-page] [data-system-diagnostics],
[data-public-page] .presentation-demo-ready-strip {
  display: none !important;
}

/* Final typography and controls consistency. */
.page-shell h1,
.enterprise-page h1,
.workspace-shell h1,
.page-intro__title,
.page-title {
  font-size: 1.5rem !important;
  line-height: 1.2 !important;
  font-weight: 850 !important;
  letter-spacing: -0.03em !important;
  color: var(--ecsv2-text) !important;
  overflow: visible !important;
}

.card-title,
.panel-card__title,
.section-title,
.registry-card__title,
.card [class$="__title"],
.panel-card [class$="__title"],
.section-card [class$="__title"] {
  font-size: .875rem !important;
  line-height: 1.28 !important;
  font-weight: 800 !important;
  color: var(--ecsv2-text) !important;
}

.btn,
.button,
button:not(.sidebar *):not(.topbar *):not(.global-ai-widget *):not(.worker-ai-chat *),
input[type="submit"],
input[type="button"] {
  min-height: 34px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  font-size: .8125rem !important;
  line-height: 1.25 !important;
  font-weight: 750 !important;
  overflow: visible !important;
  box-shadow: none !important;
}

.btn-sm,
.btn.btn-sm,
td .btn,
.table-actions .btn {
  min-height: 30px !important;
  padding-inline: 10px !important;
  font-size: .75rem !important;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
.form-input,
.form-select {
  min-height: 34px !important;
  border-radius: 8px !important;
  border: 1px solid var(--ecsv2-border) !important;
  font-size: .8125rem !important;
  background: #fff !important;
}

textarea,
.form-textarea {
  min-height: 38px !important;
  border-radius: 8px !important;
  border: 1px solid var(--ecsv2-border) !important;
  font-size: .8125rem !important;
  line-height: 1.4 !important;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
.btn:focus-visible,
.button:focus-visible,
a:focus-visible {
  outline: none !important;
  box-shadow: var(--ecsv2-focus) !important;
}

/* Tables */
.table-card,
.table-container,
.table-responsive,
.platform-table-wrapper,
.registry-table-wrapper {
  max-width: 100% !important;
  overflow-x: auto !important;
  background: var(--ecsv2-surface) !important;
  border: 1px solid var(--ecsv2-border) !important;
  border-radius: 12px !important;
}

table thead th {
  background: var(--ecsv2-soft) !important;
  font-size: .6875rem !important;
  line-height: 1.2 !important;
  font-weight: 850 !important;
  color: var(--ecsv2-muted) !important;
}

table tbody td {
  font-size: .8125rem !important;
  line-height: 1.35 !important;
}

/* Responsive */
@media (max-width: 1440px), (max-height: 850px) {
  .page-shell h1,
  .enterprise-page h1,
  .workspace-shell h1,
  .page-intro__title,
  .page-title {
    font-size: 1.375rem !important;
  }

  .btn,
  .button,
  button:not(.sidebar *):not(.topbar *):not(.global-ai-widget *):not(.worker-ai-chat *) {
    min-height: 32px !important;
  }
}

@media (max-width: 768px) {
  .page-shell h1,
  .enterprise-page h1,
  .workspace-shell h1,
  .page-intro__title,
  .page-title,
  .public-auth-heading h1 {
    font-size: 1.25rem !important;
  }

  .page-container,
  [data-role-page-container="1"] {
    padding-inline: 10px !important;
  }
}

@media (max-width: 390px) {
  html,
  body {
    overflow-x: hidden !important;
  }

  .page-container,
  [data-role-page-container="1"] {
    padding-inline: 8px !important;
  }

  .public-auth-card {
    max-width: calc(100vw - 24px) !important;
  }
}

/* Protected CRM chrome. */
.sidebar,
.sidebar *,
.topbar,
.topbar *,
.global-search,
.global-search *,
.global-ai-widget,
.global-ai-widget *,
.worker-ai-chat,
.worker-ai-chat *,
.mobile-bottom-nav,
.mobile-bottom-nav * {
  text-rendering: auto;
}
