@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
@import "tailwindcss";

@theme {
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --color-primary: #6d28d9;
  --color-primary-light: #8b5cf6;
  --color-primary-dark: #4c1d95;
}

:root {
  --background: #eef1f5;
  --foreground: #334155;
  --primary: #6d28d9;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --stroke: rgba(148, 163, 184, 0.38);
  --soft-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 10px 24px -22px rgba(15, 23, 42, 0.18);
  --soft-shadow-lg: 0 2px 5px rgba(15, 23, 42, 0.08), 0 16px 34px -26px rgba(15, 23, 42, 0.26);
  --soft-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --motion-fast: 0.18s;
  --motion-base: 0.26s;
  --accent-grape: #6d28d9;
  --accent-dark-magenta: #8b5cf6;
  --accent-telemagenta: #9333ea;
  --accent-tomato: #e11d48;
  --accent-sandy: #f59e0b;
  --palette-executive-ink: #111827;
  --palette-executive-ink-soft: #1e1b4b;
  --palette-executive-violet: #7c3aed;
  --palette-proof-teal: #0d9488;
  --palette-proof-teal-strong: #0f766e;
  --palette-attention-copper: #f59e0b;
  --palette-attention-copper-strong: #b45309;
  --palette-escalation-rose: #e11d48;
  --palette-warm-ivory: #fcfdff;
  --palette-warm-ivory-rgb: 252, 253, 255;
  --palette-soft-pearl-rgb: 244, 247, 251;
  --palette-canvas-wash: #eceff3;
  --palette-panel-wash: #ffffff;
  --palette-panel-stroke: rgba(148, 163, 184, 0.42);
}

body {
  margin: 0;
  background: #eef1f5;
  color: var(--foreground);
  font-family: var(--font-sans);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bg-white {
  background-color: #ffffff !important;
}

.bg-slate-50 {
  background-color: #f5f7fa !important;
}

.border-slate-100 {
  border-color: rgba(203, 213, 225, 0.72) !important;
}

.border-slate-200 {
  border-color: rgba(148, 163, 184, 0.42) !important;
}

.shadow-sm {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07), 0 8px 18px -18px rgba(15, 23, 42, 0.2) !important;
}


#root {
  min-height: 100vh;
}

.glass {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--stroke);
  box-shadow: var(--soft-shadow);
}

.glass-dark {
  background: rgba(248, 250, 252, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--stroke);
  box-shadow: var(--soft-shadow);
}

.glass-purple {
  background: rgba(109, 40, 217, 0.1);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(109, 40, 217, 0.2);
  box-shadow: var(--soft-shadow);
}

.soft-canvas {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, #f0f3f7 0%, #e9edf2 100%);
}

.soft-canvas::before,
.soft-canvas::after {
  display: none;
}

.soft-canvas::before {
  width: 23rem;
  height: 23rem;
  top: -8rem;
  right: -7rem;
  background: rgba(148, 163, 184, 0.14);
}

.soft-canvas::after {
  width: 20rem;
  height: 20rem;
  bottom: -9rem;
  left: -6rem;
  background: rgba(203, 213, 225, 0.18);
}

.soft-surface {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--stroke);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.soft-lift {
  box-shadow: var(--soft-shadow-lg);
}

button,
input,
select,
textarea {
  transition: all var(--motion-base) var(--soft-ease);
}

button {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

button:not(:disabled):hover {
  transform: translateY(-1px);
}

.ui-soft-btn {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.34);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: all var(--motion-base) var(--soft-ease);
}

.ui-soft-btn:hover {
  background: #f8fafc;
  border-color: rgba(109, 40, 217, 0.28);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.ui-sidebar-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(221, 214, 254, 0.12);
  box-shadow: none;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.ui-sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(221, 214, 254, 0.26);
  box-shadow: none;
}

.ui-shell-sidebar .ui-sidebar-active {
  background: rgba(255, 255, 255, 0.11) !important;
  border-color: rgba(221, 214, 254, 0.34) !important;
  color: #ffffff !important;
  box-shadow:
    inset 3px 0 0 rgba(196, 181, 253, 0.82),
    0 0 0 1px rgba(196, 181, 253, 0.16),
    0 10px 26px -18px rgba(168, 85, 247, 0.5) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.ui-shell-sidebar .ui-sidebar-active:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(221, 214, 254, 0.34) !important;
}

.ui-shell-sidebar .ui-sidebar-active-collapsed {
  background: rgba(255, 255, 255, 0.11) !important;
  border-color: rgba(221, 214, 254, 0.34) !important;
  color: #ffffff !important;
  box-shadow:
    inset 3px 0 0 rgba(196, 181, 253, 0.82),
    0 0 0 1px rgba(196, 181, 253, 0.16),
    0 10px 26px -18px rgba(168, 85, 247, 0.5) !important;
}

.ui-soft-chip {
  background: rgba(109, 40, 217, 0.08);
  border: 1px solid rgba(109, 40, 217, 0.16);
  color: #6d28d9;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ui-metric-pill {
  border-radius: 1rem;
  border-width: 1px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ui-metric-pill--neutral {
  border-color: rgba(100, 116, 139, 0.24);
  background: rgba(255, 255, 255, 0.86);
  color: #334155;
}

.ui-metric-pill--good {
  border-color: rgba(13, 148, 136, 0.3);
  background: rgba(13, 148, 136, 0.035);
  color: #0f766e;
}

.ui-metric-pill--warn {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.04);
  color: #b45309;
}

.ui-metric-pill--risk {
  border-color: rgba(225, 29, 72, 0.3);
  background: rgba(225, 29, 72, 0.038);
  color: #e11d48;
}

.ui-accent-chip-grape {
  border-color: rgba(109, 40, 217, 0.24) !important;
  background: rgba(109, 40, 217, 0.1) !important;
  color: #6d28d9 !important;
}

.ui-accent-chip-magenta {
  border-color: rgba(139, 92, 246, 0.24) !important;
  background: rgba(139, 92, 246, 0.1) !important;
  color: #6d28d9 !important;
}

.ui-accent-chip-tele {
  border-color: rgba(147, 51, 234, 0.24) !important;
  background: rgba(147, 51, 234, 0.1) !important;
  color: #6b21a8 !important;
}

.ui-accent-chip-tomato {
  border-color: rgba(225, 29, 72, 0.28) !important;
  background: rgba(225, 29, 72, 0.12) !important;
  color: #e11d48 !important;
}

/* CEO Operations Hub palette pilot: richer executive surfaces without changing global tokens yet. */
.ceo-ops-palette {
  position: relative;
}

.ceo-ops-metric-strip .ui-metric-pill {
  border-color: rgba(100, 116, 139, 0.22);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

/* Shared command hero grammar for executive/cockpit modules. */
.ui-command-hero,
.ceo-ops-cockpit-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 1.85rem;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.ui-command-hero::after,
.ceo-ops-cockpit-hero::after {
  display: none;
}

.ui-command-tile,
.ceo-ops-cockpit-tile {
  border: 1px solid rgba(100, 116, 139, 0.2);
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.ui-command-status,
.ceo-ops-cockpit-status {
  border: 1px solid rgba(124, 58, 237, 0.22);
  background:
    radial-gradient(18rem 12rem at 15% 0%, color-mix(in srgb, var(--palette-executive-violet) 20%, transparent), transparent 68%),
    linear-gradient(135deg, #111827, #1e1b4b 68%, #111827);
  box-shadow: 0 22px 56px -38px rgba(17, 24, 39, 0.72);
}

.ceo-ops-metric-strip .ui-metric-pill--good {
  border-color: color-mix(in srgb, var(--palette-proof-teal) 34%, transparent);
  background: rgba(240, 253, 250, 0.9);
  color: var(--palette-proof-teal-strong);
}

.ceo-ops-metric-strip .ui-metric-pill--warn {
  border-color: rgba(100, 116, 139, 0.26);
  background: #ffffff;
  color: #475569;
}

.ceo-ops-metric-strip .ui-metric-pill--risk {
  border-color: color-mix(in srgb, var(--palette-escalation-rose) 38%, transparent);
  background: rgba(255, 241, 242, 0.92);
  color: var(--palette-escalation-rose);
}

.ui-executive-panel,
.ceo-ops-panel {
  border-color: var(--palette-panel-stroke) !important;
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07), 0 12px 26px -24px rgba(15, 23, 42, 0.24) !important;
}

.ui-executive-panel > div:first-child,
.ceo-ops-panel > div:first-child {
  border-bottom-color: rgba(100, 116, 139, 0.16) !important;
}

.ui-executive-panel h2,
.ceo-ops-panel h2 {
  color: var(--palette-executive-ink-soft) !important;
}

.ceo-ops-command-panel {
  border-color: rgba(124, 58, 237, 0.22) !important;
  background:
    radial-gradient(26rem 18rem at 18% 0%, color-mix(in srgb, var(--palette-executive-violet) 24%, transparent), transparent 62%),
    linear-gradient(135deg, #111827, #1e1b4b 60%, #111827) !important;
  box-shadow: 0 26px 72px -40px rgba(17, 24, 39, 0.72) !important;
}

.ceo-ops-command-panel > div:first-child {
  border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

.ceo-ops-command-panel h2,
.ceo-ops-command-panel > div:first-child p {
  color: rgba(255, 255, 255, 0.92) !important;
}

.ceo-ops-command-panel > div:first-child p {
  color: rgba(226, 232, 240, 0.7) !important;
}

.ui-executive-signal-card,
.ceo-ops-signal-card {
  border-color: rgba(100, 116, 139, 0.2) !important;
  background: #ffffff !important;
}

.ui-smooth-reveal {
  overflow: hidden;
  will-change: opacity, transform, height;
}

.ui-smooth-reveal__inner {
  transform-origin: top center;
}

.ceo-ops-priority-card {
  border-color: rgba(100, 116, 139, 0.2) !important;
  background: #ffffff !important;
  box-shadow: inset 3px 0 0 rgba(109, 40, 217, 0.28);
}

.ceo-ops-brief-card {
  border-color: color-mix(in srgb, var(--palette-proof-teal) 24%, transparent) !important;
  background: rgba(240, 253, 250, 0.88) !important;
}

.ceo-ops-alert-card {
  border-color: color-mix(in srgb, var(--palette-escalation-rose) 32%, transparent) !important;
  background: rgba(255, 241, 242, 0.92) !important;
}

/* Dashboard palette pilot: aligns Ecosystem Intelligence with the CEO cockpit cadence. */
.dashboard-ops-palette {
  position: relative;
}

.dashboard-ops-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.48);
  border-radius: 1.85rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 22px 44px -34px rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(14px) saturate(132%);
  -webkit-backdrop-filter: blur(14px) saturate(132%);
}

.dashboard-ops-hero::after {
  display: none;
}

.dashboard-ops-tile {
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.dashboard-ops-status {
  border: 1px solid rgba(46, 36, 86, 0.32);
  background:
    radial-gradient(18rem 12rem at 15% 0%, color-mix(in srgb, var(--palette-executive-violet) 26%, transparent), transparent 68%),
    linear-gradient(135deg, var(--palette-executive-ink), var(--palette-executive-ink-soft));
  box-shadow: 0 20px 52px -40px rgba(17, 24, 39, 0.68);
}

.dashboard-ops-panel {
  border-color: rgba(148, 163, 184, 0.48) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 18px 38px -32px rgba(15, 23, 42, 0.32) !important;
  backdrop-filter: blur(14px) saturate(132%);
  -webkit-backdrop-filter: blur(14px) saturate(132%);
}

.dashboard-ops-signal-card {
  border-color: rgba(148, 163, 184, 0.38) !important;
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dashboard-ops-profile-card {
  border-color: rgba(148, 163, 184, 0.48) !important;
  background: rgba(255, 255, 255, 0.97) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 14px 30px -26px rgba(15, 23, 42, 0.28) !important;
  backdrop-filter: blur(12px) saturate(132%);
  -webkit-backdrop-filter: blur(12px) saturate(132%);
}

.dashboard-ops-validity-card {
  border-color: color-mix(in srgb, var(--palette-proof-teal) 30%, rgba(148, 163, 184, 0.3)) !important;
  background: rgba(255, 255, 255, 0.97) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 14px 30px -26px rgba(15, 23, 42, 0.28) !important;
  backdrop-filter: blur(12px) saturate(132%);
  -webkit-backdrop-filter: blur(12px) saturate(132%);
}

.dashboard-deferred-section {
  content-visibility: auto;
  contain-intrinsic-size: 720px;
}

.dashboard-heat-tile {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  contain: paint;
  transform: translateZ(0);
  transition-property: transform, box-shadow, border-color, opacity;
}

.ui-accent-chip-sandy {
  border-color: rgba(245, 158, 11, 0.34) !important;
  background: rgba(245, 158, 11, 0.12) !important;
  color: #b45309 !important;
}

.ui-soft-icon {
  opacity: 0.78;
  transition: opacity var(--motion-base) var(--soft-ease), transform var(--motion-base) var(--soft-ease), color var(--motion-base) var(--soft-ease);
}

.group:hover .ui-soft-icon {
  opacity: 1;
  transform: translateY(-1px);
}

@keyframes copilot-float {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.04);
  }
}

.copilot-float {
  animation: copilot-float 2.8s ease-in-out infinite;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.1);
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.2);
}

.scrollbar-hide {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.incident-list-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.48) rgba(226, 232, 240, 0.7);
}

.incident-list-scrollbar::-webkit-scrollbar {
  width: 10px;
}

.incident-list-scrollbar::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.58);
  border-radius: 999px;
}

.incident-list-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.58);
  border: 2px solid rgba(248, 250, 252, 0.92);
  border-radius: 999px;
}

.incident-list-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.68);
}

.copilot-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.34) rgba(226, 232, 240, 0.42);
}

.copilot-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.copilot-scrollbar::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.42);
  border-radius: 999px;
}

.copilot-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.34);
  border-radius: 999px;
  border: 2px solid rgba(248, 250, 252, 0.82);
}

.copilot-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(79, 70, 229, 0.42);
}

.ui-empty-state {
  border: 1px dashed rgba(148, 163, 184, 0.38);
  background: rgba(248, 250, 252, 0.78);
  border-radius: 1.25rem;
  padding: 1.25rem;
  text-align: center;
  color: #64748b;
}

.ui-loading-state {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 1.25rem;
  padding: 1rem 1.1rem;
  color: #64748b;
}

/* Shared module header hierarchy (custom pages not using PageHeader) */
.ui-module-eyebrow {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: #6d28d9;
}

.ui-module-title {
  font-size: 1.875rem;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #334155;
}

.ui-module-title-accent {
  color: #6d28d9;
}

.ui-module-subtitle {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.6;
  color: #64748b;
}

/* Shared card typography hierarchy */
.ui-card-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #94a3b8;
}

.ui-card-title {
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -0.012em;
  color: #0f172a;
}

.ui-card-subtitle {
  font-size: 0.8125rem;
  line-height: 1.5;
  font-weight: 600;
  color: #334155;
}

.ui-card-copy {
  font-size: 0.8125rem;
  line-height: 1.55;
  font-weight: 500;
  color: #64748b;
}

/* Evidence Vault: keep document/CAPA titles compact and stable */
.ui-vault-doc-title {
  font-size: 0.92rem !important;
  line-height: 1.28 !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
  color: #0f172a !important;
}

.ui-card-value {
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: -0.015em;
}

.ui-kpi-value {
  font-size: clamp(1.7rem, 2.2vw, 2.15rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.ui-kpi-value-sm {
  font-size: clamp(1.2rem, 1.45vw, 1.45rem);
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -0.016em;
}

/* Typography guardrails: normalize recurring card text patterns portal-wide */
[class*="text-base font-black tracking-tight"] {
  font-size: 1rem !important;
  line-height: 1.35 !important;
  font-weight: 800 !important;
  letter-spacing: -0.012em !important;
}

[class*="text-sm font-black text-slate-900"] {
  font-size: 0.875rem !important;
  line-height: 1.4 !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
}

[class*="text-[11px] font-medium leading-5 text-slate-500"],
[class*="text-[11px] font-medium leading-5 text-slate-600"],
[class*="text-sm font-medium leading-6 text-slate-600"],
[class*="text-sm font-medium leading-6 text-slate-700"] {
  font-size: 0.8125rem !important;
  line-height: 1.55 !important;
  font-weight: 500 !important;
}

@media (max-width: 1024px) {
  .ui-module-title {
    font-size: 1.75rem;
  }
}

/* Global tablet safety net: prevent horizontal drift + keep interaction stable */
@media (min-width: 768px) and (max-width: 1180px) {
  html,
  body,
  #root {
    overflow-x: hidden;
  }

  .custom-scrollbar,
  [class*="overflow-y-auto"] {
    -webkit-overflow-scrolling: touch;
  }

  .nav-transition,
  .sidebar-shell-transition,
  .sidebar-label-transition {
    transition-duration: 0.18s;
  }
}

.nav-transition {
  transition:
    width 0.34s var(--soft-ease),
    max-width 0.34s var(--soft-ease),
    opacity 0.34s var(--soft-ease),
    transform 0.34s var(--soft-ease),
    background-color 0.34s var(--soft-ease),
    color 0.34s var(--soft-ease),
    border-color 0.34s var(--soft-ease),
    box-shadow 0.34s var(--soft-ease);
  will-change: width, max-width, opacity, transform;
}

.sidebar-shell-transition {
  transition:
    width 0.12s var(--soft-ease),
    box-shadow 0.12s var(--soft-ease),
    border-color 0.12s var(--soft-ease),
    background-color 0.12s var(--soft-ease);
  will-change: width;
}

.sidebar-label-transition {
  transition:
    opacity 0.1s ease-out,
    transform 0.1s ease-out,
    max-height 0.1s ease-out,
    max-width 0.1s ease-out;
}

/* Shell-level visual tuning for a restrained institutional canvas. */
.ui-shell-sidebar {
  border-color: rgba(221, 214, 254, 0.16) !important;
  background:
    radial-gradient(12rem 16rem at 18% 0%, rgba(124, 58, 237, 0.24), transparent 72%),
    linear-gradient(180deg, #160d2f 0%, #21133f 48%, #0f1024 100%) !important;
  box-shadow:
    1px 0 0 rgba(221, 214, 254, 0.12),
    18px 0 42px -34px rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(18px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(140%) !important;
  contain: layout paint style;
  transform: translateZ(0);
}

.ui-sidebar-scroll {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  contain: layout paint style;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.ui-shell-sidebar .ui-sidebar-btn {
  background: rgba(255, 255, 255, 0.07) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

.ui-shell-sidebar .sidebar-logo-wrap {
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.18));
}

.ui-shell-sidebar .ui-shell-user-card {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(221, 214, 254, 0.16) !important;
  color: #ffffff !important;
}

.ui-shell-sidebar .ui-shell-user-card:hover {
  background: rgba(255, 255, 255, 0.14) !important;
}

.ui-shell-sidebar .ui-shell-user-card p,
.ui-shell-sidebar .ui-shell-user-card span {
  color: rgba(237, 233, 254, 0.82) !important;
}

.ui-shell-sidebar .ui-shell-user-card p:first-child {
  color: #ffffff !important;
}

.ui-shell-sidebar .ui-soft-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(244, 114, 182, 0.18) !important;
  color: #fda4af !important;
}

.ui-shell-sidebar .ui-soft-btn:hover {
  background: rgba(244, 63, 94, 0.12) !important;
  border-color: rgba(251, 113, 133, 0.28) !important;
}

.ui-shell-sidebar button:not(:disabled):hover {
  transform: none;
}

.ui-shell-topbar {
  isolation: isolate;
  overflow: visible;
  border-color: rgba(100, 116, 139, 0.24) !important;
  background: rgba(255, 255, 255, 0.82) !important;
  box-shadow:
    inset 0 -1px 0 rgba(148, 163, 184, 0.22),
    0 12px 34px -34px rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.ui-shell-topbar::before {
  display: none;
}

.ui-shell-topbar::after {
  display: none;
}

.ui-shell-topbar > * {
  position: relative;
  z-index: 2;
}

.ui-shell-topbar-status-rail {
  border-color: rgba(100, 116, 139, 0.18) !important;
  background: rgba(248, 250, 252, 0.72);
  border-radius: 1.25rem;
  padding-block: 0.65rem;
  padding-left: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ui-shell-user-card,
.ui-shell-popover,
.ui-shell-drawer {
  border-color: rgba(148, 163, 184, 0.28) !important;
  background: rgba(255, 255, 255, 0.78) !important;
  box-shadow: 0 20px 48px -30px rgba(15, 23, 42, 0.36) !important;
  backdrop-filter: blur(18px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(140%) !important;
}

.ui-notifications-popover {
  border-color: rgba(148, 163, 184, 0.28) !important;
  background: rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 22px 54px -30px rgba(15, 23, 42, 0.38) !important;
  backdrop-filter: blur(18px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(140%) !important;
}

.ui-shell-dropdown-veil {
  background:
    rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.ui-shell-floating-search {
  border-color: color-mix(in srgb, var(--palette-executive-violet) 14%, transparent) !important;
  background: rgba(255, 255, 255, 0.78) !important;
  box-shadow: 0 10px 28px -24px rgba(15, 23, 42, 0.36) !important;
  backdrop-filter: blur(16px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(140%) !important;
}

.ui-shell-floating-search:hover,
.ui-shell-floating-search:focus-within {
  border-color: color-mix(in srgb, var(--palette-executive-violet) 18%, transparent) !important;
  box-shadow:
    0 4px 16px -12px rgba(15, 23, 42, 0.34),
    0 0 0 1px rgba(124, 58, 237, 0.08) !important;
}

.ui-floating-search-input:focus,
.ui-floating-search-input:focus-visible {
  box-shadow: none !important;
  border-color: transparent !important;
}

.ui-shell-copilot {
  border-color: color-mix(in srgb, var(--palette-executive-violet) 20%, transparent) !important;
  background: rgba(255, 255, 255, 0.82) !important;
  box-shadow: 0 16px 34px -24px rgba(109, 40, 217, 0.34) !important;
  backdrop-filter: blur(16px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(140%) !important;
}

.ui-shell-toast {
  background: rgba(255, 255, 255, 0.84) !important;
  box-shadow: 0 18px 42px -26px rgba(15, 23, 42, 0.36) !important;
  backdrop-filter: blur(16px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(140%) !important;
}

/* Shared accessibility focus ring for all interactive controls */
:where(button, a, input, select, textarea):focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.88), 0 0 0 5px rgba(124, 58, 237, 0.34);
  border-color: rgba(124, 58, 237, 0.4) !important;
}

/* Motion comfort for long sessions and tablet devices */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  button:not(:disabled):hover,
  .group:hover .ui-soft-icon {
    transform: none !important;
  }
}

/* Markdown Rendering Styles */
.markdown-body {
  font-family: inherit;
  line-height: 1.6;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  font-weight: 800;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #334155;
  letter-spacing: -0.02em;
}

.markdown-body h1 { font-size: 1.5rem; }
.markdown-body h2 { font-size: 1.25rem; }
.markdown-body h3 { font-size: 1.125rem; }
.markdown-body h4 { font-size: 1rem; }

.markdown-body p {
  margin-bottom: 1rem;
}

.markdown-body ul, .markdown-body ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.markdown-body ul {
  list-style-type: disc;
}

.markdown-body ol {
  list-style-type: decimal;
}

.markdown-body li {
  margin-bottom: 0.5rem;
}

.markdown-body strong {
  font-weight: 700;
  color: #6d28d9;
}

.markdown-body code {
  background-color: rgba(124, 58, 237, 0.08);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-family: monospace;
  font-size: 0.875em;
}

/* Standardized AI narrative typography */
.ui-ai-copy {
  font-family: var(--font-sans) !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  line-height: 1.6 !important;
  letter-spacing: -0.003em !important;
}

.ui-ai-copy h1,
.ui-ai-copy h2,
.ui-ai-copy h3,
.ui-ai-copy h4 {
  font-size: 1em !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
  margin-top: 0 !important;
  margin-bottom: 0.4rem !important;
  color: inherit !important;
}

.ui-ai-copy p,
.ui-ai-copy li,
.ui-ai-copy strong,
.ui-ai-copy code {
  font-size: inherit !important;
  color: inherit !important;
}

@media (max-width: 1024px) {
  .ui-ai-copy {
    font-size: 0.8125rem !important;
    line-height: 1.55 !important;
  }
}

/* Gentle typographic remap for long-view comfort (Flowline-like soft greys) */
.text-slate-950 { color: #111827; }
.text-slate-900 { color: #1e293b; }
.text-slate-800 { color: #334155; }
.text-slate-700 { color: #475569; }
.text-slate-600 { color: #64748b; }
.text-slate-500 { color: #7b8797; }
.text-slate-400 { color: #94a3b8; }

/* Brand utility alignment: keep Tailwind violet/indigo classes inside the AccredAI palette. */
[class*="text-violet-500"],
[class*="text-violet-600"] {
  color: #6d28d9 !important;
}

[class*="text-violet-700"],
[class*="text-violet-800"] {
  color: #5b21b6 !important;
}

[class*="bg-violet-50"] {
  background-color: rgba(109, 40, 217, 0.07) !important;
}

[class*="bg-violet-100"] {
  background-color: rgba(109, 40, 217, 0.11) !important;
}

[class*="bg-violet-500"] {
  background-color: #7c3aed !important;
}

[class*="bg-violet-600"] {
  background-color: #6d28d9 !important;
}

[class*="bg-violet-700"],
[class*="hover:bg-violet-700"]:hover {
  background-color: #5b21b6 !important;
}

[class*="border-violet-100"] {
  border-color: rgba(109, 40, 217, 0.12) !important;
}

[class*="border-violet-200"] {
  border-color: rgba(109, 40, 217, 0.2) !important;
}

[class*="border-violet-300"] {
  border-color: rgba(109, 40, 217, 0.28) !important;
}

[class*="border-violet-500"] {
  border-color: rgba(109, 40, 217, 0.58) !important;
}

[class*="text-indigo-500"],
[class*="text-indigo-600"],
[class*="text-indigo-700"] {
  color: #4338ca !important;
}

[class*="bg-indigo-50"] {
  background-color: rgba(67, 56, 202, 0.07) !important;
}

[class*="bg-indigo-100"] {
  background-color: rgba(67, 56, 202, 0.11) !important;
}

[class*="bg-indigo-600"],
[class*="hover:bg-indigo-600"]:hover {
  background-color: #4338ca !important;
}

[class*="bg-indigo-700"],
[class*="hover:bg-indigo-700"]:hover {
  background-color: #3730a3 !important;
}

[class*="border-indigo-100"] {
  border-color: rgba(67, 56, 202, 0.12) !important;
}

[class*="border-indigo-200"] {
  border-color: rgba(67, 56, 202, 0.18) !important;
}

[class*="border-indigo-300"] {
  border-color: rgba(67, 56, 202, 0.28) !important;
}

.ui-shell-sidebar button:not(.ui-sidebar-active):not(.ui-sidebar-active-collapsed) {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: rgba(237, 233, 254, 0.84) !important;
  border-color: rgba(221, 214, 254, 0.12) !important;
  box-shadow: none !important;
}

.ui-shell-sidebar button:not(.ui-sidebar-active):not(.ui-sidebar-active-collapsed) .ui-soft-icon,
.ui-shell-sidebar button:not(.ui-sidebar-active):not(.ui-sidebar-active-collapsed) .ui-soft-icon i {
  color: rgba(221, 214, 254, 0.76) !important;
}

.ui-shell-sidebar button:not(.ui-sidebar-active):not(.ui-sidebar-active-collapsed):hover {
  background-color: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(221, 214, 254, 0.28) !important;
}

.ui-shell-sidebar button:not(.ui-sidebar-active):not(.ui-sidebar-active-collapsed):hover .ui-soft-icon,
.ui-shell-sidebar button:not(.ui-sidebar-active):not(.ui-sidebar-active-collapsed):hover .ui-soft-icon i {
  color: #ffffff !important;
}

.ui-shell-sidebar .ui-sidebar-active-collapsed .ui-soft-icon,
.ui-shell-sidebar .ui-sidebar-active-collapsed .ui-soft-icon i {
  color: #ffffff !important;
}

.ui-shell-sidebar button[class*="bg-violet-600"] .ui-soft-icon,
.ui-shell-sidebar button[class*="bg-violet-600"] .ui-soft-icon i {
  color: #ffffff !important;
}

/* Palette guardrail: keep semantic state colors consistent and restrained across modules. */
[class*="text-emerald-"],
[class*="text-green-"] {
  color: #0f766e !important;
}

[class*="bg-emerald-50"],
[class*="bg-emerald-100"],
[class*="bg-green-50"],
[class*="bg-green-100"] {
  background-color: rgba(13, 148, 136, 0.055) !important;
}

[class*="border-emerald-"],
[class*="border-green-"] {
  border-color: rgba(13, 148, 136, 0.26) !important;
}

[class*="text-amber-"],
[class*="text-yellow-"],
[class*="text-lime-"] {
  color: #b45309 !important;
}

[class*="bg-amber-50"],
[class*="bg-amber-100"],
[class*="bg-yellow-50"],
[class*="bg-yellow-100"],
[class*="bg-lime-50"],
[class*="bg-lime-100"] {
  background-color: rgba(245, 158, 11, 0.06) !important;
}

[class*="border-amber-"],
[class*="border-yellow-"],
[class*="border-lime-"] {
  border-color: rgba(245, 158, 11, 0.27) !important;
}

/* Critical palette standard: brick red for gaps, risks, reminders */
[class*="text-rose-"],
[class*="text-red-"] {
  color: #e11d48 !important;
}

[class*="bg-rose-50"],
[class*="bg-rose-100"],
[class*="bg-red-50"],
[class*="bg-red-100"] {
  background-color: rgba(225, 29, 72, 0.065) !important;
}

[class*="border-rose-"],
[class*="border-red-"] {
  border-color: rgba(225, 29, 72, 0.3) !important;
}

/* Keep browser autofill aligned with Flowline inputs (remove yellow autofill paint) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active {
  -webkit-text-fill-color: #475569 !important;
  caret-color: #475569 !important;
  box-shadow: 0 0 0px 1000px #f8fafc inset !important;
  -webkit-box-shadow: 0 0 0px 1000px #f8fafc inset !important;
  transition: background-color 9999s ease-out 0s !important;
}

/* Login fields: enforce Flowline fill even when keychain/password manager autofills */
.login-input,
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus,
.login-input:-webkit-autofill:active {
  -webkit-text-fill-color: #334155 !important;
  caret-color: #334155 !important;
  border-color: rgba(148, 163, 184, 0.55) !important;
  background-color: #f8fafc !important;
  box-shadow: 0 0 0px 1000px #f8fafc inset !important;
  -webkit-box-shadow: 0 0 0px 1000px #f8fafc inset !important;
}

.login-ambient {
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.1) 1px, transparent 1px);
  background-size: 52px 52px, 52px 52px, 100% 100%;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.08));
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.08));
}

.login-ambient::after {
  display: none;
}

@keyframes login-live-breathe {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.28);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.45);
    box-shadow: 0 0 0 5px rgba(124, 58, 237, 0);
    opacity: 1;
  }
}

.login-live-dot {
  animation: login-live-breathe 2.8s ease-in-out infinite;
}

/* Login viewport contract: one desktop appearance across Chrome, Safari, and Windows browsers. */
@media (min-width: 1024px) {
  .login-page {
    align-items: center !important;
    padding: clamp(1rem, 2.2vw, 2.5rem) !important;
  }

  .login-page .login-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1.45fr) 370px !important;
    width: clamp(1020px, 66vw, 1220px) !important;
    max-width: calc(100vw - 3rem) !important;
    height: clamp(660px, 74vh, 780px) !important;
    max-height: calc(100vh - 3rem) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    border-radius: clamp(2rem, 2.6vw, 3rem) !important;
  }

  .login-page .login-left {
    min-height: 0 !important;
    padding: clamp(2.75rem, 3.8vw, 4.75rem) !important;
  }

  .login-page .login-brandbar {
    margin-bottom: clamp(1.4rem, 3vh, 3rem) !important;
  }

  .login-page .login-logo {
    width: clamp(176px, 11vw, 228px) !important;
    height: auto !important;
  }

  .login-page .login-trust-badge {
    transform: scale(0.9) !important;
    transform-origin: top right !important;
  }

  .login-page .login-copy {
    justify-content: center !important;
    padding-top: 0 !important;
  }

  .login-page .login-message-stack {
    max-width: 50rem !important;
  }

  .login-page .login-copy-inner {
    max-width: 40rem !important;
  }

  .login-page .login-title {
    max-width: 43rem !important;
    margin-bottom: clamp(1rem, 2vh, 1.35rem) !important;
    font-size: clamp(1.65rem, 1.9vw, 2.15rem) !important;
    line-height: 1.1 !important;
  }

  .login-page .login-description {
    max-width: 36rem !important;
    margin-bottom: 0 !important;
    font-size: clamp(0.78rem, 0.78vw, 0.88rem) !important;
    line-height: 1.65 !important;
  }

  .login-page .login-bullets {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 37rem !important;
    gap: 0 1.5rem !important;
    margin-top: clamp(1.65rem, 3.2vh, 2.35rem) !important;
  }

  .login-page .login-proof-point {
    min-height: 3.05rem !important;
    align-items: flex-start !important;
    border-top: 1px solid rgba(255, 255, 255, 0.62) !important;
    padding: 0.8rem 0.1rem 0.7rem !important;
  }

  .login-page .login-bullet-label {
    font-size: clamp(0.7rem, 0.72vw, 0.78rem) !important;
    line-height: 1.35 !important;
  }

  .login-page .login-footer {
    padding-top: clamp(0.75rem, 1.3vh, 1rem) !important;
  }

  .login-page .login-form-panel {
    width: 370px !important;
    min-height: 0 !important;
    justify-content: center !important;
    overflow-y: auto !important;
    padding: clamp(2rem, 2.3vw, 2.75rem) !important;
  }

  .login-page .showroom-login-panel {
    overflow-y: hidden !important;
  }

  .login-page .login-form-heading {
    margin-bottom: clamp(1.2rem, 2vh, 2rem) !important;
  }

  .login-page .login-form-title {
    font-size: clamp(1.3rem, 1.45vw, 1.5rem) !important;
  }

  .login-page .login-form-subtitle {
    font-size: 0.62rem !important;
    line-height: 1.45 !important;
  }

  .login-page .login-form {
    gap: 0 !important;
  }

  .login-page .login-form > * + * {
    margin-top: clamp(0.9rem, 1.65vh, 1.4rem) !important;
  }

  .login-page .login-input {
    height: clamp(2.75rem, 4.8vh, 3rem) !important;
    border-radius: 1rem !important;
  }

  .login-page .login-resource-links {
    margin-top: clamp(1rem, 2vh, 2rem) !important;
    gap: 0.7rem !important;
  }
}

@media (min-width: 1024px) and (max-height: 780px) {
  .login-page .login-card {
    grid-template-columns: minmax(0, 1.35fr) 350px !important;
    width: clamp(960px, 68vw, 1120px) !important;
    height: calc(100vh - 1.5rem) !important;
  }

  .login-page .login-left {
    padding: 1.25rem 1.75rem !important;
  }

  .login-page .login-brandbar {
    margin-bottom: 0.35rem !important;
  }

  .login-page .login-logo {
    width: 154px !important;
  }

  .login-page .login-title {
    font-size: 1.22rem !important;
    margin-bottom: 0.65rem !important;
    line-height: 1.12 !important;
  }

  .login-page .login-description {
    margin-bottom: 0 !important;
    font-size: 0.68rem !important;
    line-height: 1.45 !important;
  }

  .login-page .login-bullets {
    gap: 0 0.8rem !important;
    margin-top: 0.9rem !important;
  }

  .login-page .login-proof-point {
    min-height: 2.25rem !important;
    padding: 0.45rem 0 !important;
  }

  .login-page .login-footer {
    display: none !important;
  }

  .login-page .login-form-panel {
    width: 350px !important;
    padding: 1.2rem !important;
  }

  .login-page .login-form-heading {
    margin-bottom: 0.75rem !important;
  }

  .login-page .login-form > * + * {
    margin-top: 0.65rem !important;
  }

  .login-page .login-input {
    height: 2.45rem !important;
  }

  .login-page .login-resource-links {
    display: none !important;
  }
}

/* Field standard: neutral gray at rest, purple only on active selection */
input:not([type="checkbox"]):not([type="radio"]):not(:focus):not(:focus-visible),
select:not(:focus):not(:focus-visible),
textarea:not(:focus):not(:focus-visible) {
  border-color: rgba(203, 213, 225, 0.92) !important;
  box-shadow: none !important;
}

/* Field focus standard: one subtle rounded border across forms and modals */
:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus,
:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus-visible {
  outline: none !important;
  border-color: rgba(124, 58, 237, 0.24) !important;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1) !important;
}

:where(input:not([type="checkbox"]):not([type="radio"]), select):focus,
:where(input:not([type="checkbox"]):not([type="radio"]), select):focus-visible {
  border-radius: 999px !important;
}

:where(textarea):focus,
:where(textarea):focus-visible {
  border-radius: 1.5rem !important;
}

:where(label):has(:where(input.bg-transparent, select.bg-transparent, textarea.bg-transparent):focus) {
  border-color: rgba(124, 58, 237, 0.24) !important;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1) !important;
}

:where(label) :where(input.bg-transparent, select.bg-transparent, textarea.bg-transparent):focus,
:where(label) :where(input.bg-transparent, select.bg-transparent, textarea.bg-transparent):focus-visible {
  border-color: transparent !important;
  box-shadow: none !important;
}
