
:root {
  --background: 210 30% 95%;
  --foreground: 222 47% 11%;
  --card: 210 30% 93%;
  --card-foreground: 222 47% 11%;
  --popover: 210 30% 93%;
  --popover-foreground: 222 47% 11%;
  --primary: 221 83% 53%;
  --primary-foreground: 0 0% 100%;
  --secondary: 210 30% 89%;
  --secondary-foreground: 222 47% 11%;
  --muted: 210 30% 89%;
  --muted-foreground: 215 25% 45%;
  --accent: 221 83% 53%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 210 40% 98%;
  --border: 214 32% 91%;
  --input: 214 32% 91%;
  --ring: 221 83% 53%;
  --chart-1: 221 83% 53%;
  --chart-2: 160 60% 45%;
  --chart-3: 30 80% 55%;
  --chart-4: 280 65% 60%;
  --chart-5: 340 75% 55%;
  --success: 142 71% 45%;
  --warning: 38 92% 50%;
  --radius: 0.75rem;
  --font-heading: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sidebar-background: 210 30% 93%;
  --sidebar-foreground: 222 47% 11%;
  --sidebar-primary: 221 83% 53%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 210 30% 89%;
  --sidebar-accent-foreground: 222 47% 11%;
  --sidebar-border: 214 32% 91%;
  --sidebar-ring: 221 83% 53%;
}
.dark {
  --background: 222 47% 11%;
  --foreground: 210 40% 98%;
  --card: 222 47% 11%;
  --card-foreground: 210 40% 98%;
  --popover: 222 47% 11%;
  --popover-foreground: 210 40% 98%;
  --primary: 199 93% 60%;
  --primary-foreground: 0 0% 0%;
  --secondary: 222 47% 18%;
  --secondary-foreground: 210 40% 98%;
  --muted: 222 47% 18%;
  --muted-foreground: 214 20% 65%;
  --accent: 222 47% 18%;
  --accent-foreground: 210 40% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 210 40% 98%;
  --border: 222 47% 20%;
  --input: 222 47% 20%;
  --ring: 199 93% 60%;
  --chart-1: 199 93% 60%;
  --chart-2: 160 60% 45%;
  --chart-3: 30 80% 55%;
  --chart-4: 280 65% 60%;
  --chart-5: 340 75% 55%;
  --success: 142 71% 45%;
  --warning: 38 92% 50%;
  --sidebar-background: 222 47% 11%;
  --sidebar-foreground: 210 40% 98%;
  --sidebar-primary: 199 93% 60%;
  --sidebar-primary-foreground: 0 0% 0%;
  --sidebar-accent: 222 47% 18%;
  --sidebar-accent-foreground: 210 40% 98%;
  --sidebar-border: 222 47% 20%;
  --sidebar-ring: 199 93% 60%;
}
.nexus-shell {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  font-family: var(--font-body);
  color: hsl(var(--foreground));
  background-color: #0d3a95;
  background-image: url("https://media.base44.com/images/public/6a3726dc7dd8208ff70c98dd/6a27315c3_generated_image.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  z-index: 50;
}
.nexus-shell * { box-sizing: border-box; }

/* ── Page body background (ensures MSP / Sign-In match CC before shell mounts) ── */
body {
  background-color: #0d3a95;
  background-image: url("https://media.base44.com/images/public/6a3726dc7dd8208ff70c98dd/6a27315c3_generated_image.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: #fff;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  min-height: 100vh;
}
.dark body {
  background-color: #0d3a95;
  background-image: url("https://media.base44.com/images/public/6a3726dc7dd8208ff70c98dd/6a27315c3_generated_image.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: hsl(var(--foreground, 210 40% 98%));
}

/* Header */
.nexus-header {
  height: 56px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: hsl(var(--card) / 0.8);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border) / 0.5);
  position: sticky; top: 0; z-index: 40;
}
.nexus-header-left { display: flex; align-items: center; gap: 16px; }
.nexus-sidebar-toggle {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid hsl(var(--border));
  background: transparent; color: hsl(var(--foreground)); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.nexus-sidebar-toggle:hover { background: hsl(var(--muted)); }
.nexus-logo { height: 30px; object-fit: contain; cursor: pointer; }
.nexus-welcome { display: flex; flex-direction: column; line-height: 1.2; margin-left: 8px; }
.nexus-welcome b { font-size: 13px; font-weight: 700; }
.nexus-welcome span { font-size: 11px; color: hsl(var(--muted-foreground)); }
.nexus-header-slot { flex: 1; display: flex; align-items: center; gap: 16px; margin-left: 24px; }
.nexus-header-slot a {
  font-size: 13px; font-weight: 500; color: hsl(var(--foreground) / .7);
  padding: 8px 12px; border-radius: 6px; text-decoration: none; transition: color .15s, background .15s;
}
.nexus-header-slot a:hover { color: hsl(var(--foreground)); background: hsl(var(--muted)); }
.nexus-header-slot a.active { color: hsl(var(--primary)); }
.nexus-header-right { display: flex; align-items: center; gap: 8px; }
.nexus-icon-btn {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: hsl(var(--foreground)); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.nexus-icon-btn:hover { background: hsl(var(--muted)); }
.nexus-text-btn {
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  border-radius: 8px; border: 1px solid transparent; background: transparent;
  color: hsl(var(--foreground)); cursor: pointer; font-size: 13px; font-weight: 500;
  font-family: var(--font-body); transition: background .15s;
}
.nexus-text-btn:hover { background: hsl(var(--muted)); }

/* Body */
.nexus-body { flex: 1; display: flex; overflow: hidden; }
.nexus-sidebar {
  width: 240px; flex-shrink: 0; background: hsl(var(--sidebar-background) / 0.8);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid hsl(var(--border) / 0.5); display: flex; flex-direction: column;
  transition: width .25s ease; overflow: hidden;
}
.nexus-sidebar.collapsed { width: 64px; }
.nexus-sidebar-toggle-wrap { padding: 8px; border-bottom: 1px solid hsl(var(--border) / 0.5); display: flex; justify-content: flex-end; }
.nexus-sidebar-section { padding: 12px 8px; display: flex; flex-direction: column; gap: 4px; }
.nexus-sidebar-section-title { padding: 6px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: hsl(var(--muted-foreground)); }
.nexus-sidebar.collapsed .nexus-sidebar-section-title { display: none; }
.nexus-sidebar-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px;
  color: hsl(var(--sidebar-foreground)); background: transparent; border: none; cursor: pointer;
  font-size: 13px; text-align: left; width: 100%; font-family: var(--font-body); transition: background .15s;
}
.nexus-sidebar-item:hover { background: hsl(var(--primary) / 0.08); color: hsl(var(--primary)); }
.nexus-sidebar-item.active { background: hsl(var(--primary) / 0.12); color: hsl(var(--primary)); font-weight: 600; }
.nexus-sidebar-item .nexus-si-icon { flex-shrink: 0; display: flex; }
.nexus-sidebar.collapsed .nexus-sidebar-item span { display: none; }
.nexus-sidebar-spacer { flex: 1; }
.nexus-sidebar-user { padding: 12px; border-top: 1px solid hsl(var(--border) / 0.5); display: flex; align-items: center; gap: 10px; }
.nexus-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: hsl(var(--primary) / .2); border: 1px solid hsl(var(--primary));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: hsl(var(--primary));
}
.nexus-sidebar-user-info { min-width: 0; }
.nexus-sidebar-user-info b { font-size: 12px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nexus-sidebar-user-info span { font-size: 10px; color: hsl(var(--muted-foreground)); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nexus-sidebar.collapsed .nexus-sidebar-user-info { display: none; }
.nexus-content { flex: 1; overflow: auto; background: transparent; }

/* ═══════════════════════════════════════════════════════════════════════
   CARD COMPLIANCE ENFORCEMENT
   Forces white translucent glass on ANY card-like element in the content
   area, regardless of local CSS overrides. Matches ERP reference design.
   ═══════════════════════════════════════════════════════════════════════ */
.nexus-content [class*="card"]:not(.nexus-header):not(.nexus-sidebar):not(.nexus-footer),
.nexus-content [class*="Card"]:not(.nexus-header):not(.nexus-sidebar):not(.nexus-footer),
.nexus-content [class*="kpi"]:not(.nexus-header):not(.nexus-sidebar):not(.nexus-footer),
.nexus-content [class*="Kpi"]:not(.nexus-header):not(.nexus-sidebar):not(.nexus-footer),
.nexus-content [class*="widget"]:not(.nexus-header):not(.nexus-sidebar):not(.nexus-footer),
.nexus-content [class*="metric"]:not(.nexus-header):not(.nexus-sidebar):not(.nexus-footer),
.nexus-content [class*="directive"]:not(.nexus-header):not(.nexus-sidebar):not(.nexus-footer) {
  background-color: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-radius: 1rem !important;
  box-shadow: 0 8px 32px -8px rgba(0,0,0,0.15) !important;
  color: #1f2937 !important;
}

.nexus-content [class*="card"] h1, .nexus-content [class*="card"] h2, .nexus-content [class*="card"] h3, .nexus-content [class*="card"] h4, .nexus-content [class*="card"] p, .nexus-content [class*="card"] span, .nexus-content [class*="card"] label,
.nexus-content [class*="Card"] h1, .nexus-content [class*="Card"] h2, .nexus-content [class*="Card"] h3, .nexus-content [class*="Card"] h4, .nexus-content [class*="Card"] p, .nexus-content [class*="Card"] span, .nexus-content [class*="Card"] label,
.nexus-content [class*="kpi"] h1, .nexus-content [class*="kpi"] h2, .nexus-content [class*="kpi"] h3, .nexus-content [class*="kpi"] h4, .nexus-content [class*="kpi"] p, .nexus-content [class*="kpi"] span, .nexus-content [class*="kpi"] label,
.nexus-content [class*="Kpi"] h1, .nexus-content [class*="Kpi"] h2, .nexus-content [class*="Kpi"] h3, .nexus-content [class*="Kpi"] h4, .nexus-content [class*="Kpi"] p, .nexus-content [class*="Kpi"] span, .nexus-content [class*="Kpi"] label,
.nexus-content [class*="directive"] h1, .nexus-content [class*="directive"] h2, .nexus-content [class*="directive"] h3, .nexus-content [class*="directive"] h4, .nexus-content [class*="directive"] p, .nexus-content [class*="directive"] span, .nexus-content [class*="directive"] label,
.nexus-content [class*="metric"] h1, .nexus-content [class*="metric"] h2, .nexus-content [class*="metric"] h3, .nexus-content [class*="metric"] h4, .nexus-content [class*="metric"] p, .nexus-content [class*="metric"] span, .nexus-content [class*="metric"] label,
.nexus-content [class*="widget"] h1, .nexus-content [class*="widget"] h2, .nexus-content [class*="widget"] h3, .nexus-content [class*="widget"] h4, .nexus-content [class*="widget"] p, .nexus-content [class*="widget"] span, .nexus-content [class*="widget"] label {
  color: #1f2937 !important;
}

/* Footer */
.nexus-footer {
  height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; background: hsl(var(--card) / 0.8);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid hsl(var(--border) / 0.5); gap: 24px;
}
.nexus-footer-left { display: flex; align-items: center; gap: 8px; flex: 1; }
.nexus-footer-left img { height: 16px; object-fit: contain; }
.nexus-footer-left span { font-size: 11px; color: hsl(var(--muted-foreground)); }
.nexus-footer-center { display: flex; align-items: center; gap: 6px; flex: 1; justify-content: center; }
.nexus-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.nexus-footer-center span { font-size: 11px; color: hsl(var(--muted-foreground)); }
.nexus-footer-right { display: flex; align-items: center; gap: 20px; flex: 1; justify-content: flex-end; }
.nexus-footer-right a { font-size: 11px; color: hsl(var(--muted-foreground)); text-decoration: none; transition: color .15s; }
.nexus-footer-right a:hover { color: hsl(var(--foreground)); }
