/* CRM Pro — Design System (Cabinet Grotesk + IBM Plex Sans + Pearl/Cobalt & Midnight/Emerald) */

:root {
  /* Font stacks */
  --font-display: 'Cabinet Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* Light Mode: Pearl & Cobalt */
  --bs-body-bg: #F5F6F8;
  --bs-body-color: #0F172A;
  --bs-primary: #0047FF;
  --bs-primary-rgb: 0,71,255;
  --bs-border-color: rgba(15,23,42,0.1);
  --bs-border-radius: 0.75rem;
  --bs-border-radius-lg: 1.25rem;
  --bs-font-sans-serif: var(--font-body);
  --bs-font-monospace: var(--font-mono);
  --bs-secondary-color: #475569;

  --surface-solid: #FFFFFF;
  --surface-alt: #EEF1F6;
  --text-main: #0F172A;
  --text-muted: #475569;
  --primary: #0047FF;
  --primary-hover: #003BD3;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --emerald: #059669;

  /* Glass */
  --glass-bg: rgba(255,255,255,0.72);
  --glass-blur: 24px;
  --glass-border: rgba(255,255,255,0.5);
  --glass-shadow: 0 8px 32px rgba(15,23,42,0.08);
}

[data-bs-theme="dark"] {
  --bs-body-bg: #0B0F19;
  --bs-body-color: #F8F9FA;
  --bs-primary: #3B82F6;
  --bs-border-color: rgba(255,255,255,0.12);
  --bs-secondary-color: #94A3B8;

  --surface-solid: #111827;
  --surface-alt: #0F172A;
  --text-main: #F8F9FA;
  --text-muted: #94A3B8;
  --primary: #3B82F6;
  --primary-hover: #60A5FA;
  --success: #34D399;
  --warning: #FBBF24;
  --danger: #F87171;
  --emerald: #10B981;

  --glass-bg: rgba(17,24,39,0.6);
  --glass-border: rgba(255,255,255,0.08);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* Base */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1,h2,h3,h4,h5,h6,.display-1,.display-2,.display-3,.display-4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
}
h1,.display-1,.display-2 { letter-spacing: -0.03em; font-weight: 800; }

.text-muted { color: var(--text-muted) !important; }
.font-mono { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }

/* Glass surface */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--bs-border-radius-lg);
}

.surface {
  background: var(--surface-solid);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg);
}

/* Navbar */
.top-nav {
  position: sticky; top: 0; z-index: 1030;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--bs-border-color);
}
.top-nav .brand {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.4rem;
}
.top-nav .brand-dot {
  display: inline-block; width: 10px; height: 10px; margin-right: 8px;
  background: var(--primary); border-radius: 3px; transform: rotate(45deg);
}
.top-nav a.nav-link { color: var(--text-main); font-weight: 500; }
.top-nav a.nav-link:hover { color: var(--primary); }

/* Buttons */
.btn { transition: transform 0.2s ease, background-color 0.2s ease; font-weight: 500; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); transform: translateY(-1px); }
.btn-pill { border-radius: 50rem; padding: 0.6rem 1.4rem; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

/* Cards */
.card { background: var(--surface-solid); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg); }
.card.kpi { padding: 1.4rem; }
.kpi-label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }
.kpi-value { font-family: var(--font-display); font-weight: 800; font-size: 2rem; margin-top: 0.4rem; letter-spacing: -0.02em; }
.kpi-delta { font-size: 0.8rem; margin-top: 0.35rem; color: var(--emerald); }

/* Hero */
.hero {
  position: relative;
  padding: 6rem 0 5rem;
  overflow: hidden;
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--text-muted);
  padding: 0.35rem 0.85rem; border: 1px solid var(--bs-border-color);
  border-radius: 50rem; background: var(--glass-bg);
}
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1.02; margin-top: 1.4rem; }
.hero .accent { color: var(--primary); font-style: italic; font-weight: 300; }
.hero p.lead { color: var(--text-muted); max-width: 34rem; margin-top: 1.2rem; font-size: 1.15rem; }
.hero .stat-strip { display: flex; gap: 2rem; margin-top: 3rem; flex-wrap: wrap; }
.hero .stat-strip .stat .n { font-family: var(--font-display); font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.hero .stat-strip .stat .l { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); }
.hero .visual-card {
  position: relative;
  border-radius: 1.75rem;
  overflow: hidden;
  aspect-ratio: 4/5;
  background: linear-gradient(135deg, #0F172A, #0047FF 60%, #06B6D4);
}
.hero .visual-card img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; mix-blend-mode: luminosity; }
.hero .floating-tile {
  position: absolute;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  font-size: 0.85rem;
  color: var(--text-main);
}

/* Category chips */
.chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.9rem; border-radius: 50rem; border: 1px solid var(--bs-border-color); font-size: 0.85rem; font-family: var(--font-mono); background: var(--surface-solid); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Service card */
.service-card { padding: 1.6rem; display: flex; flex-direction: column; gap: 0.8rem; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.service-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(15,23,42,0.08); }
.service-card .price { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; }
.service-card .price small { color: var(--text-muted); text-decoration: line-through; font-weight: 400; font-size: 0.9rem; margin-right: 0.4rem; }
.service-card .cat-tag { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--primary); }

/* Bento grid */
.bento { display: grid; gap: 1.25rem; grid-template-columns: repeat(12, 1fr); }
.bento > * { grid-column: span 12; }
@media (min-width: 768px) {
  .bento > .b-4 { grid-column: span 4; }
  .bento > .b-6 { grid-column: span 6; }
  .bento > .b-8 { grid-column: span 8; }
  .bento > .b-12 { grid-column: span 12; }
}

/* Testimonials */
.testimonial { padding: 1.5rem; }
.testimonial .stars { color: #F59E0B; letter-spacing: 0.1em; }
.testimonial .body { margin-top: 0.6rem; color: var(--text-muted); }
.testimonial .who { margin-top: 1rem; font-size: 0.9rem; }
.testimonial .who .name { font-weight: 600; }

/* Section */
section.section { padding: 5rem 0; }
.section-eyebrow { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--primary); }
.section-title { font-family: var(--font-display); font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin: 0.6rem 0 0; max-width: 32rem; }

/* Dashboard shell */
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.app-sidebar {
  background: var(--surface-solid);
  border-right: 1px solid var(--bs-border-color);
  padding: 1.3rem 1rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.app-sidebar .brand { padding: 0 0.5rem 1.4rem; }
.app-sidebar a.side-link {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.85rem; border-radius: 0.75rem;
  color: var(--text-main); text-decoration: none; font-weight: 500; font-size: 0.94rem;
  margin-bottom: 0.15rem;
}
.app-sidebar a.side-link:hover { background: var(--surface-alt); }
.app-sidebar a.side-link.active { background: var(--primary); color: #fff; }
.app-sidebar a.side-link i[data-lucide] { width: 18px; height: 18px; }
.app-sidebar .group-label { font-family: var(--font-mono); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); padding: 1rem 0.85rem 0.5rem; }

.app-topbar { background: var(--glass-bg); backdrop-filter: blur(20px) saturate(150%); border-bottom: 1px solid var(--bs-border-color); padding: 0.85rem 1.5rem; position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; }
.app-content { padding: 1.75rem 1.75rem 3rem; }

@media (max-width: 991px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { position: fixed; left: -280px; width: 260px; z-index: 1050; transition: left 0.3s ease; box-shadow: 0 10px 40px rgba(0,0,0,0.15); }
  .app-sidebar.open { left: 0; }
  .side-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1040; }
}

/* Timeline */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--bs-border-color); }
.timeline-item { position: relative; padding-bottom: 1.5rem; }
.timeline-item::before { content: ""; position: absolute; left: -1.5rem; top: 0.35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--surface-solid); }
.timeline-item.done::before { background: var(--success); }

/* Kanban */
.kanban { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; }
.kanban-col { min-width: 300px; flex: 0 0 300px; background: var(--surface-alt); border-radius: 1rem; padding: 0.85rem; }
.kanban-col h6 { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); }
.kanban-card { background: var(--surface-solid); border: 1px solid var(--bs-border-color); border-radius: 0.75rem; padding: 0.85rem; margin-top: 0.6rem; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }

/* Chat */
.chat-shell { display: grid; grid-template-columns: 1fr; gap: 1rem; height: calc(100vh - 12rem); min-height: 500px; }
.chat-panel { background: var(--surface-solid); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg); display: flex; flex-direction: column; overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.chat-bubble { max-width: 72%; padding: 0.6rem 0.9rem; border-radius: 1rem; }
.chat-bubble.self { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 0.3rem; }
.chat-bubble.other { align-self: flex-start; background: var(--surface-alt); color: var(--text-main); border-bottom-left-radius: 0.3rem; }
.chat-meta { font-family: var(--font-mono); font-size: 0.65rem; opacity: 0.7; margin-top: 0.2rem; }
.chat-input { border-top: 1px solid var(--bs-border-color); padding: 0.75rem; display: flex; gap: 0.5rem; align-items: end; background: var(--surface-solid); }
.chat-input textarea { flex: 1; resize: none; border: 1px solid var(--bs-border-color); border-radius: 0.75rem; padding: 0.6rem 0.85rem; background: var(--bs-body-bg); color: var(--text-main); }
.chat-input textarea:focus { outline: none; border-color: var(--primary); }

/* Tables */
.table { --bs-table-bg: transparent; color: var(--text-main); }
.table > :not(caption) > * > * { padding: 0.9rem 1rem; border-bottom-color: var(--bs-border-color); }
.table thead th { font-family: var(--font-mono); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.14em; color: var(--text-muted); font-weight: 500; border-bottom: 1px solid var(--bs-border-color); }
.table tbody tr:hover { background: var(--surface-alt); }

/* Badges */
.badge { font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.05em; padding: 0.35rem 0.55rem; text-transform: uppercase; font-size: 0.7rem; }

/* Form controls */
.form-control, .form-select { background: var(--bs-body-bg); color: var(--text-main); border: 1px solid var(--bs-border-color); border-radius: 0.75rem; padding: 0.65rem 0.9rem; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,71,255,0.14); background: var(--surface-solid); }
[data-bs-theme="dark"] .form-control:focus, [data-bs-theme="dark"] .form-select:focus { box-shadow: 0 0 0 3px rgba(59,130,246,0.24); }

.form-label { font-weight: 500; margin-bottom: 0.4rem; font-size: 0.9rem; }

/* Footer */
.site-footer { background: var(--surface-solid); border-top: 1px solid var(--bs-border-color); padding: 3rem 0 2rem; margin-top: 4rem; }
.site-footer h6 { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); }
.site-footer a { color: var(--text-main); text-decoration: none; display: block; padding: 0.3rem 0; }
.site-footer a:hover { color: var(--primary); }

/* ==================== AUTH SPLIT LAYOUT ==================== */
.auth-hero { position: relative; overflow: hidden; background: var(--bs-body-bg); }
.auth-form-col {
  padding: 3rem clamp(1.5rem, 5vw, 5rem);
  min-height: 100vh;
}
.auth-form-inner { width: 100%; max-width: 460px; margin: 0 auto; }
.auth-headline {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  letter-spacing: -0.03em; line-height: 1.05;
  margin: 0.3rem 0 0.6rem;
}
.auth-visual {
  position: relative;
  background: #0B0F19;
  color: #F8F9FA;
  padding: 4rem clamp(1.5rem, 5vw, 5rem);
  overflow: hidden;
  min-height: 100vh;
}
.auth-visual-inner { position: relative; z-index: 2; max-width: 520px; }
.auth-visual .visual-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: rgba(255,255,255,0.7);
  padding: 0.4rem 0.9rem; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50rem; background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
}
.auth-visual .visual-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: #10B981; box-shadow: 0 0 0 4px rgba(16,185,129,0.2); }
.auth-visual .visual-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2rem, 3.2vw, 2.8rem);
  line-height: 1.05; letter-spacing: -0.03em; color: #fff;
  margin-top: 1.4rem;
}
.auth-visual .visual-title em { color: #60A5FA; font-style: italic; font-weight: 300; }
.auth-visual .visual-sub { color: rgba(255,255,255,0.72); margin-top: 1rem; font-size: 1.05rem; max-width: 32rem; }
.auth-visual .visual-quote {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(24px);
  color: #F8F9FA;
}
.auth-visual .visual-quote .stars { color: #F59E0B; letter-spacing: 0.2em; }
.auth-visual .visual-metrics { display: flex; gap: 3rem; margin-top: 3rem; flex-wrap: wrap; }
.auth-visual .visual-metrics .m-n { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; }
.auth-visual .visual-metrics .m-l { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(255,255,255,0.6); }
.auth-visual .visual-list li { color: rgba(255,255,255,0.85); padding: 0.4rem 0; font-size: 1rem; display: flex; align-items: center; gap: 0.6rem; }

.auth-visual-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(1000px circle at 100% 0%, rgba(59,130,246,0.35), transparent 45%),
    radial-gradient(800px circle at 0% 100%, rgba(16,185,129,0.25), transparent 40%),
    linear-gradient(135deg, #0B0F19 0%, #111827 100%);
}
.auth-glow {
  position: absolute; z-index: 1; width: 720px; height: 720px;
  bottom: -20%; right: -20%; pointer-events: none;
  background: conic-gradient(from 90deg, transparent, rgba(96,165,250,0.15), transparent);
  filter: blur(60px);
  animation: slowspin 40s linear infinite;
}
@keyframes slowspin { to { transform: rotate(360deg); } }

.demo-creds .cred-chip {
  cursor: pointer;
  padding: 0.7rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid var(--bs-border-color);
  background: var(--surface-solid);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.demo-creds .cred-chip:hover { transform: translateY(-2px); border-color: var(--primary); }
.demo-creds .cred-role { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--primary); }
.demo-creds .cred-mail { font-size: 0.82rem; margin-top: 0.15rem; }

@media (max-width: 991.98px) {
  .auth-visual { min-height: 40vh; padding: 3rem 1.5rem; }
  .auth-form-col { min-height: auto; padding: 3rem 1.5rem; }
}

/* Hide public site nav on auth pages by having auth section start at top */
body:has(.auth-hero) .top-nav { display: none; }
body:has(.auth-hero) .site-footer { display: none; }

/* Utilities */
.divider-dot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--text-muted); margin: 0 0.6rem; vertical-align: middle; opacity: 0.6; }
.grid-noise::before { content:""; position:absolute; inset:0; opacity:0.03; background-image: radial-gradient(circle, currentColor 1px, transparent 1px); background-size: 24px 24px; pointer-events: none; }
[wire\:loading] .wire-target { opacity: 0.5; transition: opacity 0.2s; }


/* Trust bar */
.trust-bar .trust-logo {
  font-family: var(--font-display); font-weight: 500; font-size: 1.05rem;
  letter-spacing: -0.02em; color: var(--text-muted); opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
  padding: 0.3rem 0;
}
.trust-bar .trust-logo:hover { opacity: 1; transform: translateY(-1px); color: var(--text-main); }

/* Enhanced KPI card */
.card.kpi .kpi-delta i { vertical-align: -2px; margin-right: 4px; }

/* Chart canvases */
canvas { max-width: 100%; }
