@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&family=Poppins:wght@600;700;800&family=Saira:wght@600;700;800&display=swap');

:root {
  /* Crizant Official Identity Palette (Brand Guidelines v1.0) */
  --crizant-navy-900: #0A2240; /* Primary — wordmark, dark surfaces */
  --crizant-navy-700: #12386B; /* Secondary dark, hover state */
  --crizant-blue-600: #0057D9; /* Primary action, links, button fills */
  --crizant-blue-500: #0080F0; /* Gradient midtone, chart accents */
  --crizant-cyan-400: #00A9EF; /* Accent, highlights, mark pixels */
  --crizant-ice-200: #B9E4FA;  /* Tints, chart fills, muted text on dark */
  --crizant-ice-050: #EAF6FE;  /* Light accent surface */
  --crizant-slate-600: #5A6675;/* Muted body text on light */
  --crizant-slate-300: #C7D0DA;/* Borders, dividers */
  --crizant-mist-100: #F3F6F9; /* Light page tint */
  --crizant-white: #FFFFFF;    /* Base surface */
  --crizant-gradient: linear-gradient(135deg, #0057D9 0%, #0080F0 50%, #00A9EF 100%);

  /* Applied Light Tokens */
  --bg: #F3F6F9;
  --surface: #FFFFFF;
  --line: #C7D0DA;
  --ink: #0A2240;
  --ink-2: #5A6675;
  --ink-3: #758394;
  
  --brand: #0057D9;
  --brand-2: #00A9EF;
  --brand-soft: #EAF6FE;
  --brand-glow: rgba(0, 87, 217, 0.22);
  
  --side: #0A2240;
  --side-2: #12386B;
  --side-hover: #12386B;

  --ok: #10b981; 
  --warn: #f59e0b; 
  --bad: #ef4444;

  /* Crizant Radius Scale */
  --r-sm: 4px;
  --r-md: 8px;
  --r-pill: 999px;
  --r: 8px;

  /* Crizant Spacing Scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;

  --shadow-sm: 0 1px 3px rgba(10, 34, 64, 0.05), 0 1px 2px rgba(10, 34, 64, 0.03);
  --shadow-1: 0 4px 6px -1px rgba(10, 34, 64, 0.07), 0 2px 4px -1px rgba(10, 34, 64, 0.04);
  --shadow-2: 0 10px 15px -3px rgba(10, 34, 64, 0.08), 0 4px 6px -2px rgba(10, 34, 64, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(10, 34, 64, 0.12), 0 10px 10px -5px rgba(10, 34, 64, 0.04);
  
  /* Crizant Typography */
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --head: 'Saira', 'Poppins', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
  
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

[data-theme='dark'] {
  --bg: #061528;
  --surface: #0A2240;
  --line: #12386B;
  --ink: #FFFFFF;
  --ink-2: #B9E4FA;
  --ink-3: #89B3CD;
  --brand: #00A9EF;
  --brand-2: #0057D9;
  --brand-soft: #12386B;
  --brand-glow: rgba(0, 169, 239, 0.3);
  --side: #051324;
  --side-hover: #0A2240;
  --shadow-1: 0 4px 6px -1px rgba(0, 0, 0, 0.4); 
  --shadow-2: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html, body, #root {
  margin: 0;
  height: 100%;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
}
html {
  overflow-x: hidden;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  font-family: var(--sans);
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { font-family: var(--head); letter-spacing: -0.01em; font-weight: 700; color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); border-radius: var(--r-md); touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--crizant-cyan-400); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
#root { max-width: 100vw; width: 100%; margin: 0; padding: 0; text-align: left; border: 0; overflow-x: hidden; }

/* Persona picker (login landing) */
.pick { min-height: 100%; display: grid; place-items: center; padding: 40px 20px;
  background: radial-gradient(1200px 600px at 10% -10%, hsl(235 85% 60% / 0.15), transparent),
              radial-gradient(900px 500px at 100% 0%, hsl(270 85% 65% / 0.15), transparent), var(--bg); }
.pick-inner { width: min(1080px, 100%); }
.pick h1 { color: var(--ink); font-size: 42px; margin: 0 0 12px; font-weight: 700; letter-spacing: -0.03em; display: flex; align-items: center; gap: 12px; }
.pick p.lead { color: var(--ink-2); margin: 0 0 32px; font-size: 16px; max-width: 600px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.pcard { text-align: left; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); color: var(--ink); padding: 20px; border-radius: var(--r);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); position: relative; overflow: hidden; }
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.pcard::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--brand-glow), transparent); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.pcard:hover::after { opacity: 1; }
.pcard .grp { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); margin-bottom: 8px; }
.pcard .nm { font-family: var(--head); font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.pcard .ds { font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }
.pcard .us { margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--brand); display: flex; align-items: center; gap: 4px; }
.pcard:hover .us { color: var(--brand-2); }

/* Shell Layout & Container */
.shell { 
  display: grid; 
  grid-template-columns: 260px 1fr; 
  height: 100vh; 
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  position: relative;
  overflow: hidden;
  transition: grid-template-columns 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 1024px) {
  .shell.sidebar-collapsed {
    grid-template-columns: 70px 1fr;
  }
}

.max-container {
  max-width: 1680px;
  margin: 0 auto;
  width: 100%;
}

.side { 
  background: var(--crizant-navy-900, #0A2240); 
  color: #e2e8f0; 
  display: flex; 
  flex-direction: column; 
  width: 260px;
  height: 100vh;
  max-height: 100vh;
  padding: 16px 14px 12px; 
  border-right: 1px solid rgba(255,255,255,0.06); 
  min-height: 0;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s;
  z-index: 30;
  user-select: none;
}

.side.collapsed {
  width: 70px;
  padding: 16px 8px 12px;
}

.brandrow { 
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  gap: 10px; 
  padding: 4px 6px 16px; 
  border-bottom: 1px solid rgba(255,255,255,0.08); 
  margin-bottom: 8px; 
  position: relative;
}

.brandrow-logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  outline: none;
  background: transparent;
  border: 0;
  padding: 0;
  min-width: 0;
}
.brandrow-logo-group:hover .logo-card {
  transform: scale(1.04);
}

.logo-card { 
  background: #ffffff; 
  padding: 5px 10px; 
  border-radius: var(--r-md, 8px); 
  box-shadow: 0 2px 8px rgba(0,0,0,0.15); 
  display: flex; 
  align-items: center; 
  flex-shrink: 0;
  transition: transform 0.15s, padding 0.15s;
}
.brand-logo-img { 
  height: 24px; 
  width: auto; 
  display: block; 
}
.brand-suite { 
  display: flex; 
  flex-direction: column; 
  gap: 1px; 
  white-space: nowrap;
}
.suite-tag { 
  font-family: var(--head, 'Saira', sans-serif); 
  font-size: 13px; 
  font-weight: 800; 
  color: #FFFFFF; 
  letter-spacing: 0.08em; 
  line-height: 1.1; 
}
.suite-sub { 
  font-family: var(--mono, monospace); 
  font-size: 9.5px; 
  color: var(--crizant-cyan-400, #00A9EF); 
  letter-spacing: 0.14em; 
  font-weight: 600; 
}

.sidebar-collapse-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #CBD5E1;
  font-size: 15px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
  background: rgba(0, 169, 239, 0.2);
  color: #FFFFFF;
  border-color: var(--crizant-cyan-400, #00A9EF);
  transform: scale(1.05);
}

.side.collapsed .brandrow {
  justify-content: center;
  padding: 4px 0 14px;
}
.side.collapsed .brandrow-logo-group {
  justify-content: center;
}
.side.collapsed .logo-card {
  padding: 4px 6px;
}
.side.collapsed .brand-logo-img {
  height: 20px;
}
.side.collapsed .brand-suite,
.side.collapsed .sidebar-collapse-btn.desktop-only {
  display: none;
}

.drawer-close-btn {
  display: none;
  background: transparent;
  border: 0;
  color: #cbd5e1;
  font-size: 18px;
  margin-left: auto;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}
.drawer-close-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.nav-scroll { 
  flex: 1; 
  overflow-y: auto; 
  overflow-x: hidden;
  padding-right: 2px; 
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.nav-scroll::-webkit-scrollbar {
  width: 4px;
}
.nav-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}

.gl { 
  font-family: var(--mono, monospace); 
  font-size: 10.5px; 
  font-weight: 600; 
  letter-spacing: 0.14em; 
  text-transform: uppercase; 
  color: #7188A4; 
  padding: 14px 8px 6px; 
  white-space: nowrap;
}

.side.collapsed .gl {
  font-size: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 10px 4px;
  padding: 0;
  overflow: hidden;
}

.nav { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  width: 100%; 
  border: 0; 
  background: transparent; 
  color: #A0B2C6;
  padding: 9px 12px; 
  border-radius: var(--r-md, 8px); 
  text-align: left; 
  transition: all 0.15s; 
  font-size: 13.5px; 
  font-weight: 500; 
  min-height: 38px;
  cursor: pointer;
  position: relative;
}
.nav:hover { 
  background: var(--crizant-navy-700, #12386B); 
  color: #FFFFFF; 
}
.nav.on { 
  background: rgba(0, 169, 239, 0.14); 
  color: #FFFFFF; 
  border-left: 3px solid var(--crizant-cyan-400, #00A9EF); 
  border-radius: 2px 8px 8px 2px; 
  font-weight: 600; 
}
.nav .nav-icon {
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  flex-shrink: 0;
}
.nav .nav-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav .tag { 
  margin-left: auto; 
  font-size: 9.5px; 
  padding: 2px 6px; 
  border-radius: 999px; 
  background: rgba(255,255,255,0.12); 
  color: #CBD5E1; 
  font-weight: 600; 
  font-family: var(--mono, monospace); 
}

/* Collapsed nav styling */
.side.collapsed .nav {
  justify-content: center;
  padding: 10px 0;
  border-left: 0;
  border-radius: 8px;
}
.side.collapsed .nav .nav-title,
.side.collapsed .nav .tag {
  display: none;
}
.side.collapsed .nav.on {
  border-left: 0;
  background: rgba(0, 169, 239, 0.22);
}
.side.collapsed .nav.on::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--crizant-cyan-400, #00A9EF);
  border-radius: 4px;
}

/* Floating tooltip when sidebar is collapsed */
.side.collapsed .nav:hover::after {
  content: attr(data-tooltip);
  position: fixed;
  left: 78px;
  background: var(--crizant-navy-900, #0A2240);
  color: #FFFFFF;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.16);
  letter-spacing: 0.02em;
}

.side-foot { 
  padding: 12px 6px 4px; 
  border-top: 1px solid rgba(255,255,255,0.08); 
  margin-top: auto; 
}
.corp-label { 
  font-family: var(--mono, monospace); 
  font-size: 9.5px; 
  font-weight: 600; 
  letter-spacing: 0.14em; 
  color: #7188A4; 
  text-transform: uppercase; 
}
.corp-sub { 
  font-size: 11px; 
  color: #A0B2C6; 
  margin-top: 2px; 
}

.side-collapse-toggle-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #A0B2C6;
  font-size: 11px;
  font-family: var(--mono, monospace);
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.side-collapse-toggle-foot:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.2);
}
.side-collapse-toggle-foot .toggle-kbd {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0,0,0,0.3);
  color: #94a3b8;
  border: 1px solid rgba(255,255,255,0.1);
}

.side.collapsed .side-foot {
  padding: 8px 0 4px;
  text-align: center;
}
.side.collapsed .corp-sub,
.side.collapsed .corp-label,
.side.collapsed .toggle-kbd {
  display: none;
}
.side.collapsed .side-collapse-toggle-foot {
  padding: 8px 0;
  justify-content: center;
}

/* ========================================================================== */
/* Automatic Expansion on Hover when Sidebar is Collapsed (Desktop Only)     */
/* ========================================================================== */
@media (min-width: 1024px) and (hover: hover) {
  .shell.sidebar-collapsed .side:hover {
    width: 260px;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    box-shadow: 0 12px 36px rgba(10, 34, 64, 0.55);
    padding: 16px 14px 12px;
    background: var(--crizant-navy-900, #0A2240);
  }

  .shell.sidebar-collapsed .side:hover .brand-suite,
  .shell.sidebar-collapsed .side:hover .gl,
  .shell.sidebar-collapsed .side:hover .nav-title,
  .shell.sidebar-collapsed .side:hover .tag,
  .shell.sidebar-collapsed .side:hover .corp-sub,
  .shell.sidebar-collapsed .side:hover .corp-label,
  .shell.sidebar-collapsed .side:hover .toggle-kbd {
    display: block !important;
    opacity: 1;
    animation: fadeIn 0.15s ease-out;
  }

  .shell.sidebar-collapsed .side:hover .brandrow {
    justify-content: space-between;
    padding: 4px 6px 16px;
  }

  .shell.sidebar-collapsed .side:hover .brandrow-logo-group {
    justify-content: flex-start;
  }

  .shell.sidebar-collapsed .side:hover .logo-card {
    padding: 5px 10px;
  }

  .shell.sidebar-collapsed .side:hover .brand-logo-img {
    height: 24px;
  }

  .shell.sidebar-collapsed .side:hover .sidebar-collapse-btn.desktop-only {
    display: inline-flex !important;
  }

  .shell.sidebar-collapsed .side:hover .gl {
    font-size: 10.5px;
    height: auto;
    margin: 0;
    padding: 14px 8px 6px;
  }

  .shell.sidebar-collapsed .side:hover .nav {
    justify-content: flex-start;
    padding: 9px 12px;
  }

  .shell.sidebar-collapsed .side:hover .nav .nav-icon {
    font-size: 17px;
    width: 22px;
  }

  .shell.sidebar-collapsed .side:hover .nav.on {
    border-left: 3px solid var(--crizant-cyan-400, #00A9EF);
    border-radius: 2px 8px 8px 2px;
  }

  .shell.sidebar-collapsed .side:hover .nav.on::before {
    display: none !important;
  }

  .shell.sidebar-collapsed .side:hover .nav::after {
    display: none !important;
  }

  .shell.sidebar-collapsed .side:hover .side-foot {
    padding: 12px 6px 4px;
    text-align: left;
  }

  .shell.sidebar-collapsed .side:hover .side-collapse-toggle-foot {
    padding: 7px 10px;
    justify-content: space-between;
  }
}

/* ========================================================================== */
/* Main Content Layout & Guaranteed Scroll Container                          */
/* ========================================================================== */
.main { 
  display: flex; 
  flex-direction: column; 
  min-width: 0; 
  min-height: 0;
  height: 100vh; 
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  background: var(--bg); 
  overflow: hidden; 
}

.top { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  padding: 10px 20px; 
  background: var(--surface); 
  border-bottom: 1px solid var(--line); 
  position: sticky; 
  top: 0; 
  z-index: 20; 
  box-shadow: 0 1px 3px rgba(10,34,64,0.03);
  flex-shrink: 0;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.top::-webkit-scrollbar {
  display: none;
}

.hamb-btn { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  width: 36px; 
  height: 36px; 
  min-height: 36px; 
  border: 1px solid var(--line); 
  border-radius: 8px; 
  background: var(--surface); 
  color: var(--ink); 
  font-size: 17px; 
  cursor: pointer; 
  transition: all 0.15s; 
  flex-shrink: 0;
}
.hamb-btn:hover { 
  background: var(--bg); 
  border-color: var(--crizant-blue-600, #0057D9); 
  color: var(--crizant-blue-600, #0057D9); 
  transform: translateY(-1px);
}
.hamb-btn:active {
  transform: translateY(0);
}
.mob-search-btn, .ibtn.mob-search-btn { display: none; }

.top-title-area {
  min-width: 0;
}
.crumb-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--mono, monospace);
  color: var(--ink-3);
  margin-bottom: 2px;
}
.crumb-sep {
  opacity: 0.5;
}
.crumb { color: var(--ink-3); font-size: 12px; font-weight: 500; margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.05em; font-family: var(--mono, monospace); }
.top h1 { margin: 0; font-size: 20px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.sp { flex: 1; }

.sys-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 11.5px;
  font-weight: 600;
  color: #047857;
  font-family: var(--mono, monospace);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
[data-theme='dark'] .sys-status-pill {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}
@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.search { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  border: 1px solid var(--line); 
  background: var(--bg); 
  color: var(--ink-3);
  padding: 7px 12px; 
  border-radius: 8px; 
  min-width: 140px; 
  max-width: 260px;
  flex-shrink: 1;
  transition: all 0.2s; 
  font-size: 13px; 
  min-height: 36px;
  cursor: pointer;
}
.search-short { display: none; }
.search:hover { border-color: var(--crizant-blue-600, #0057D9); background: var(--surface); color: var(--ink); }
.search kbd { margin-left: auto; font-size: 11px; font-weight: 600; border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; background: var(--surface); color: var(--ink-2); font-family: var(--mono, monospace); }

.tenant-selector {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 13px;
  min-height: 36px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  flex-shrink: 0;
}
.tenant-selector:hover {
  border-color: var(--crizant-blue-600, #0057D9);
  background: var(--crizant-ice-050, #EAF6FE);
}
.tenant-icon {
  font-size: 15px;
  display: inline-flex;
  align-items: center;
}
.tenant-select {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  max-width: 170px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ibtn { 
  border: 1px solid var(--line); 
  background: var(--surface); 
  color: var(--ink); 
  border-radius: 8px; 
  padding: 7px 11px; 
  font-weight: 500; 
  transition: all 0.2s; 
  box-shadow: var(--shadow-sm); 
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  min-height: 36px;
  flex-shrink: 0;
  cursor: pointer;
}
.ibtn:hover { background: var(--bg); border-color: var(--ink-3); }
.ibtn.tour-pill {
  background: var(--crizant-ice-050, #EAF6FE);
  color: var(--crizant-blue-600, #0057D9);
  border-color: #B9E4FA;
  font-weight: 600;
}

.user { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  padding-left: 8px; 
  border-left: 1px solid var(--line); 
  flex-shrink: 0;
}
.av { width: 34px; height: 34px; border-radius: 8px; background: var(--crizant-gradient); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.user-meta strong { font-size: 13px; display: block; color: var(--ink); line-height: 1.2; white-space: nowrap; }
.user-meta small { display: block; color: var(--ink-3); font-size: 11px; margin-top: 1px; white-space: nowrap; }

/* Scrollable main view canvas - Scrolls up and down smoothly */
.content { 
  flex: 1 1 0; 
  min-height: 0; 
  overflow-y: auto; 
  overflow-x: auto; 
  -webkit-overflow-scrolling: touch; 
  overscroll-behavior-y: contain; 
  padding: 24px 28px; 
}
.canvas { background: transparent; min-height: 400px; animation: rise 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }

.planned { display: grid; place-items: center; text-align: center; padding: 60px 20px; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-md, 8px); }
.planned .big { font-size: 52px; margin-bottom: 12px; opacity: 0.6; }
.planned h2 { color: var(--ink); margin: 0 0 8px; font-size: 22px; }
.planned p { max-width: 400px; margin: 0 auto; font-size: 14.5px; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); margin-top: 16px; font-family: var(--mono, monospace); }

/* Command palette */
.scrim { position: fixed; inset: 0; background: rgba(10, 34, 64, 0.6); backdrop-filter: blur(8px); display: grid; place-items: start center; padding-top: 15vh; z-index: 100; animation: fadeIn 0.2s; }
.pal { width: min(600px, calc(100vw - 32px)); max-width: 600px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--line); animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1); box-sizing: border-box; }
.pal input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 18px 22px; font-size: 16px; background: transparent; color: var(--ink); outline: none; }
.pal input::placeholder { color: var(--ink-3); }
.pal ul { list-style: none; margin: 0; padding: 10px; max-height: 400px; overflow: auto; }
.pal li { margin-bottom: 4px; }
.pal li button { width: 100%; text-align: left; border: 0; background: transparent; color: var(--ink); padding: 10px 14px; border-radius: 8px; display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 500; transition: background 0.1s; }
.pal li button:hover, .pal li button.hl { background: var(--bg); color: var(--brand); }
.pal li button span:first-child { font-size: 18px; }

.bnav { display: none; }
.drawer-scrim { display: none; }


/* ========================================================================== */
/* Unified Host Layout Grid — Eliminate Redundant MFE Outer Padding          */
/* ========================================================================== */
.reports-wrapper,
.quote-container,
.admin-module,
.claims-container,
.finance-container,
.crm-container {
  padding: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
}

/* ========================================================================== */
/* Fluid Horizontal Scroll Containers for Tables                             */
/* ========================================================================== */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-md, 8px);
  scrollbar-width: thin;
  margin-bottom: 16px;
}
.table-responsive::-webkit-scrollbar {
  height: 6px;
}
.table-responsive::-webkit-scrollbar-track {
  background: rgba(10, 34, 64, 0.05);
  border-radius: 999px;
}
.table-responsive::-webkit-scrollbar-thumb {
  background: var(--line, #cbd5e1);
  border-radius: 999px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
  background: var(--brand, #0057D9);
}

/* ========================================================================== */
/* Breakpoint: Fluid Responsive Top Bar (Screens <= 1536px)                  */
/* Automatically collapse text labels into clean icons, compact tenant badge, */
/* and reduce search input to expandable icon trigger / compact pill.        */
/* ========================================================================== */
@media (max-width: 1536px) {
  .top {
    padding: 8px 14px;
    gap: 8px;
  }
  
  /* Compact Search Input */
  .search {
    min-width: 36px;
    max-width: 140px;
    width: clamp(120px, 12vw, 150px);
    padding: 6px 10px;
    font-size: 12.5px;
    transition: width 0.22s ease, border-color 0.2s;
  }
  .search-text {
    display: none;
  }
  .search-short {
    display: inline;
  }
  .search kbd {
    display: none;
  }
  .search:focus-within,
  .search:hover {
    width: 180px;
    max-width: 220px;
  }

  /* Compact Tenant Badge */
  .tenant-selector {
    padding: 4px 6px;
    gap: 4px;
  }
  .tenant-select {
    max-width: 86px;
    font-size: 12px;
  }

  /* Clean Icons: Collapse text labels */
  .tour-text,
  .sign-out-text,
  .view-as-text {
    display: none !important;
  }
  .tour-pill,
  .sign-out-btn,
  .view-as-btn {
    padding: 7px 9px;
    font-size: 13px;
    min-width: 36px;
    justify-content: center;
  }

  /* Compact User Meta */
  .user-meta small {
    display: none;
  }
  .user-meta strong {
    font-size: 12.5px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Compact System Status Indicator */
  .sys-status-pill .status-label {
    display: none;
  }
  .sys-status-pill {
    padding: 4px 6px;
  }
}

/* On smaller laptops / viewports <= 1280px, collapse user text to avatar icon */
@media (max-width: 1280px) {
  .user-meta {
    display: none;
  }
  .user {
    padding-left: 6px;
  }
  .tenant-select {
    max-width: 70px;
  }
}

/* ========================================================================== */
/* Auto-Collapsible Sidebar Rail on Laptops (1024px – 1440px)                */
/* Default 70px icon rail, expands gracefully to 260px on hover               */
/* Freeing up 190px of horizontal workspace for tables and dashboards.        */
/* ========================================================================== */
@media (min-width: 1024px) and (max-width: 1440px) {
  .shell:not(.sidebar-pinned) {
    grid-template-columns: 70px 1fr !important;
  }
  
  .shell:not(.sidebar-pinned) .side {
    width: 70px !important;
    padding: 16px 8px 12px;
    transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease;
  }
  
  /* Collapsed Rail Elements */
  .shell:not(.sidebar-pinned) .side .brandrow {
    justify-content: center;
    padding: 4px 0 14px;
  }
  .shell:not(.sidebar-pinned) .side .brandrow-logo-group {
    justify-content: center;
  }
  .shell:not(.sidebar-pinned) .side .logo-card {
    padding: 4px;
    margin: 0;
  }
  .shell:not(.sidebar-pinned) .side .brand-logo-img {
    height: 22px;
  }
  .shell:not(.sidebar-pinned) .side .brand-suite,
  .shell:not(.sidebar-pinned) .side .sidebar-collapse-btn.desktop-only,
  .shell:not(.sidebar-pinned) .side .corp-sub,
  .shell:not(.sidebar-pinned) .side .corp-label,
  .shell:not(.sidebar-pinned) .side .toggle-kbd {
    display: none !important;
  }
  .shell:not(.sidebar-pinned) .side .gl {
    font-size: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 10px 4px;
    padding: 0;
    overflow: hidden;
  }
  .shell:not(.sidebar-pinned) .side .nav {
    justify-content: center;
    padding: 10px 0;
    border-left: 0;
    border-radius: 8px;
    margin: 3px 0;
    position: relative;
  }
  .shell:not(.sidebar-pinned) .side .nav .nav-title,
  .shell:not(.sidebar-pinned) .side .nav .tag {
    display: none !important;
  }
  .shell:not(.sidebar-pinned) .side .nav .nav-icon {
    font-size: 19px;
  }
  .shell:not(.sidebar-pinned) .side .nav.on {
    border-left: 0;
    background: rgba(0, 169, 239, 0.22);
  }
  .shell:not(.sidebar-pinned) .side .side-foot {
    padding: 8px 0 4px;
    text-align: center;
  }
  .shell:not(.sidebar-pinned) .side .side-collapse-toggle-foot {
    padding: 8px 0;
    justify-content: center;
  }

  /* Graceful Expansion on Hover when Collapsed */
  .shell:not(.sidebar-pinned) .side:hover {
    position: absolute !important;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px !important;
    z-index: 60;
    box-shadow: 8px 0 32px rgba(10, 34, 64, 0.45);
    background: var(--crizant-navy-900, #0A2240);
  }
  .shell:not(.sidebar-pinned) .side:hover .brandrow {
    justify-content: space-between;
    padding: 4px 8px 14px;
  }
  .shell:not(.sidebar-pinned) .side:hover .brandrow-logo-group {
    justify-content: flex-start;
  }
  .shell:not(.sidebar-pinned) .side:hover .logo-card {
    padding: 4px 8px;
  }
  .shell:not(.sidebar-pinned) .side:hover .brand-logo-img {
    height: 24px;
  }
  .shell:not(.sidebar-pinned) .side:hover .brand-suite,
  .shell:not(.sidebar-pinned) .side:hover .sidebar-collapse-btn.desktop-only {
    display: inline-flex !important;
  }
  .shell:not(.sidebar-pinned) .side:hover .gl {
    font-size: 11px;
    height: auto;
    background: transparent;
    margin: 16px 8px 6px;
    overflow: visible;
  }
  .shell:not(.sidebar-pinned) .side:hover .nav {
    justify-content: flex-start;
    padding: 9px 12px;
    border-left: 3px solid transparent;
    border-radius: 6px;
  }
  .shell:not(.sidebar-pinned) .side:hover .nav .nav-title {
    display: inline !important;
  }
  .shell:not(.sidebar-pinned) .side:hover .side-foot {
    padding: 14px 10px 4px;
    text-align: left;
  }
  .shell:not(.sidebar-pinned) .side:hover .corp-sub,
  .shell:not(.sidebar-pinned) .side:hover .corp-label,
  .shell:not(.sidebar-pinned) .side:hover .toggle-kbd {
    display: block !important;
  }
  .shell:not(.sidebar-pinned) .side:hover .side-collapse-toggle-foot {
    justify-content: space-between;
    padding: 7px 10px;
  }

  .content {
    padding: 20px 24px;
  }
}

/* ========================================================================== */
/* Breakpoint 2 & 3: Tablet & Mobile (< 1024px) — Complete Native Layout      */
/* ========================================================================== */
@media (max-width: 1023px) {
  /* Complete elimination of multi-column grid constraints on mobile/tablet */
  .shell,
  .shell.sidebar-collapsed,
  .shell.sidebar-pinned,
  .shell.is-mobile {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .main {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0% !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
  }

  /* Off-canvas Navigation Drawer */
  .side,
  .side.collapsed {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: min(320px, 84vw) !important;
    max-width: 320px !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    z-index: 100 !important;
    transform: translateX(-100%) !important;
    box-shadow: none !important;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.28s ease !important;
    padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)) !important;
    pointer-events: none !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .side.drawer-open {
    transform: translateX(0) !important;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.65) !important;
    pointer-events: auto !important;
  }

  /* Full labels & branding in Drawer when open */
  .side .brand-suite,
  .side.collapsed .brand-suite {
    display: flex !important;
    flex-direction: column !important;
  }
  .side .gl,
  .side.collapsed .gl {
    font-size: 10.5px !important;
    height: auto !important;
    margin: 14px 8px 6px !important;
    padding: 0 !important;
    background: transparent !important;
    color: #7188A4 !important;
    display: block !important;
  }
  .side .nav,
  .side.collapsed .nav {
    justify-content: flex-start !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    min-height: 44px !important;
  }
  .side .nav .nav-title,
  .side.collapsed .nav .nav-title {
    display: inline !important;
    font-size: 14px !important;
    font-weight: 500 !important;
  }
  .side .nav .tag,
  .side.collapsed .nav .tag {
    display: inline-block !important;
  }
  .side .nav .nav-icon,
  .side.collapsed .nav .nav-icon {
    font-size: 18px !important;
    width: 24px !important;
  }

  .drawer-close-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #CBD5E1;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.15s;
    touch-action: manipulation;
  }
  .drawer-close-btn:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.92);
  }

  .drawer-scrim {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(10, 34, 64, 0.65) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 95 !important;
    animation: fadeIn 0.2s ease-out !important;
    touch-action: none !important;
  }

  .sidebar-collapse-btn,
  .side-collapse-toggle-foot,
  .sys-status-pill {
    display: none !important;
  }
}

/* ========================================================================== */
/* Tablet (768px – 1023px) Header & Padding Rules                             */
/* ========================================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
  .top {
    padding: 10px 16px;
    gap: 10px;
  }
  .search {
    min-width: 110px;
    max-width: 150px;
    min-height: 36px;
    padding: 6px 10px;
  }
  .search-text { display: none; }
  .search-short { display: inline; }
  .search kbd { display: none; }
  .tenant-select { max-width: 110px; font-size: 12px; }
  .tour-text, .view-as-text, .sign-out-text { display: none; }
  .user-meta { display: none; }
  .content {
    padding: 18px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 0%;
  }
}

/* ========================================================================== */
/* Breakpoint: Native Mobile Phone Layout (<= 767px)                          */
/* Frosted App Bar, iOS Bottom Bar, Native Sheet Modals, 100vw Safe Content   */
/* ========================================================================== */
@media (max-width: 767px) {
  /* Native Frosted Navigation Header */
  .top {
    height: auto !important;
    min-height: 52px !important;
    padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)) !important;
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 0.5px solid var(--line) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: 100vw !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 30 !important;
    box-shadow: 0 1px 4px rgba(10, 34, 64, 0.04) !important;
  }

  [data-theme='dark'] .top {
    background: rgba(10, 34, 64, 0.88) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
  }

  .hamb-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    border: 1px solid var(--line) !important;
    border-radius: 10px !important;
    background: var(--surface) !important;
    color: var(--ink) !important;
    font-size: 18px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    touch-action: manipulation !important;
    transition: transform 0.12s ease, background 0.12s ease !important;
  }
  .hamb-btn:active {
    transform: scale(0.92) !important;
    background: var(--bg) !important;
  }

  .top-title-area {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    padding: 0 4px !important;
  }
  .top-title-area .crumb-row,
  .top-title-area .crumb {
    display: none !important;
  }
  .top h1 {
    font-family: var(--head, 'Saira', sans-serif) !important;
    font-size: 16.5px !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: var(--ink) !important;
    margin: 0 !important;
  }

  /* Desktop elements hidden on phone top bar */
  .search,
  .tour-pill,
  .user-meta,
  .view-as-btn,
  .sign-out-btn,
  .theme-toggle,
  .tenant-selector {
    display: none !important;
  }

  /* Mobile search trigger */
  .mob-search-btn,
  .ibtn.mob-search-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 10px !important;
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    font-size: 15px !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    color: var(--ink) !important;
    touch-action: manipulation !important;
    transition: transform 0.12s ease !important;
  }
  .mob-search-btn:active {
    transform: scale(0.92) !important;
  }

  .user {
    padding-left: 2px !important;
    border-left: 0 !important;
    flex-shrink: 0 !important;
  }
  .av {
    width: 34px !important;
    height: 34px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border-radius: 50% !important;
    background: var(--crizant-navy-900, #0A2240) !important;
    color: #FFFFFF !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 6px rgba(10,34,64,0.15) !important;
  }

  /* Main Scrollable Content View with Native Safe Insets */
  .content {
    padding: 14px 12px calc(76px + env(safe-area-inset-bottom)) 12px !important;
    width: 100vw !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex: 1 1 0% !important;
  }
  .canvas {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  /* iOS / Android Native Frosted Tab Bar */
  .bnav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: calc(56px + env(safe-area-inset-bottom)) !important;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    border-top: 0.5px solid var(--line) !important;
    z-index: 50 !important;
    padding: 4px 6px max(6px, env(safe-area-inset-bottom)) 6px !important;
    box-shadow: 0 -4px 20px rgba(10, 34, 64, 0.08) !important;
    box-sizing: border-box !important;
    justify-content: space-around !important;
  }

  [data-theme='dark'] .bnav {
    background: rgba(10, 34, 64, 0.92) !important;
    border-top-color: rgba(255, 255, 255, 0.08) !important;
  }

  .bnav button {
    flex: 1 1 0 !important;
    border: 0 !important;
    background: transparent !important;
    padding: 4px 2px 2px !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    font-family: var(--sans, inherit) !important;
    color: var(--ink-2) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    min-height: 48px !important;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    border-radius: 8px !important;
  }
  .bnav button:active {
    transform: scale(0.92) !important;
    background: rgba(0, 87, 217, 0.06) !important;
  }
  .bnav button.on {
    color: var(--crizant-blue-600, #0057D9) !important;
    font-weight: 700 !important;
  }
  .bnav button.on span:first-child {
    transform: scale(1.12) !important;
    filter: drop-shadow(0 2px 4px rgba(0, 87, 217, 0.3)) !important;
  }

  /* Persona picker on Mobile */
  .pick {
    padding: 24px 14px calc(48px + env(safe-area-inset-bottom)) !important;
    place-items: start center !important;
    width: 100vw !important;
    box-sizing: border-box !important;
  }
  .pick h1 {
    font-size: 22px !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
    line-height: 1.25 !important;
  }
  .pick p.lead {
    font-size: 13.5px !important;
    margin-bottom: 18px !important;
  }
  .pick-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
  }
  .pcard {
    padding: 16px !important;
    border-radius: 12px !important;
  }

  /* Bottom sheet modals (More menu, details) */
  .modal.bottom-sheet {
    max-height: 88dvh !important;
    padding-bottom: max(28px, env(safe-area-inset-bottom)) !important;
    border-radius: 20px 20px 0 0 !important;
  }
}

@media (max-width: 360px) {
  .top {
    padding: 6px 8px !important;
    gap: 6px !important;
  }
  .top h1 {
    font-size: 14px !important;
  }
}

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { border: 1px solid var(--line); border-radius: var(--r-md, 8px); padding: 14px 18px; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s; position: relative; overflow: hidden; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.kpi::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--crizant-blue-600, #0057D9), var(--crizant-cyan-400, #00A9EF)); opacity: 0; transition: opacity 0.2s; }
.kpi:hover::before { opacity: 1; }
.kpi small { color: var(--ink-2); display: block; font-weight: 600; margin-bottom: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--mono, monospace); }
.kpi strong { font-family: var(--head, 'Saira', sans-serif); font-size: 26px; font-weight: 700; color: var(--ink); }
.kpi em { font-style: normal; font-size: 12px; font-weight: 600; margin-left: 8px; padding: 2px 6px; border-radius: 4px; background: var(--bg); font-family: var(--mono, monospace); }
.bdg { font-family: var(--mono, monospace); font-size: 11.5px; padding: 3px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; border: 1px solid transparent; letter-spacing: 0.02em; }
.bdg.ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; } 
.bdg.warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.bdg.bad { background: #fef2f2; color: #b91c1c; border-color: #fecaca; } 
.bdg.info { background: #eff6ff; color: #0057D9; border-color: #bfdbfe; } 
.bdg.mute { background: var(--bg); color: var(--ink-2); border-color: var(--line); }
.kpi em.ok{color:var(--ok); background: #ecfdf5; } .kpi em.bad{color:var(--bad); background: #fef2f2; } .kpi em.warn{color:var(--warn); background: #fffbeb; }

.tbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.tbar .sp { flex: 1; }
.inp { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r-md, 8px); padding: 8px 12px; min-width: 180px; flex-shrink: 1; font-size: 13.5px; transition: border-color 0.2s, box-shadow 0.2s; font-family: var(--sans, inherit); }
.inp:focus { border-color: var(--crizant-blue-600, #0057D9); box-shadow: 0 0 0 3px rgba(0, 87, 217, 0.18); outline: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-md, 8px); overflow: hidden; background: var(--surface); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: 7px 15px; font-weight: 500; border-radius: 6px; transition: all 0.2s; font-size: 13.5px; }
.seg button:hover:not(.on) { background: var(--bg); color: var(--ink); }
.seg button.on { background: var(--crizant-blue-600, #0057D9); color: #fff; box-shadow: var(--shadow-sm); }
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r-md, 8px); padding: 9px 18px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s; box-shadow: var(--shadow-sm); font-size: 14px; font-family: var(--sans, inherit); }
.btn:hover { border-color: var(--ink-3); box-shadow: var(--shadow-1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn.pri { background: var(--crizant-blue-600, #0057D9); color: #fff; border: 0; font-family: var(--head, 'Saira', sans-serif); font-weight: 600; box-shadow: 0 4px 12px rgba(0, 87, 217, 0.25); }
.btn.pri:hover { background: var(--crizant-blue-500, #0080F0); box-shadow: 0 6px 16px rgba(0, 87, 217, 0.32); }
.btn.ok { background: var(--ok); color: #fff; border: 0; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25); }

.acts { display: flex; gap: 8px; }
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md, 8px); background: var(--surface); box-shadow: var(--shadow-sm); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { position: sticky; top: 0; background: var(--bg); text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--mono, monospace); color: var(--ink-2); padding: 13px 18px; border-bottom: 2px solid var(--line); z-index: 5; }
.tbl th.srt { cursor: pointer; transition: color 0.2s; }
.tbl th.srt:hover { color: var(--ink); }
.tbl th.frozen-col, .tbl td.frozen-col { position: sticky; left: 0; background: var(--surface); z-index: 4; border-right: 1px solid var(--line); }
.tbl th.frozen-col { z-index: 6; background: var(--bg); }
.tbl td { padding: 13px 18px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: middle; font-size: 14px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.clk { cursor: pointer; }  
.tbl tbody tr { transition: background 0.15s; }
.tbl tbody tr:hover { background: var(--bg); }
.sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }

/* Desktop vs Mobile Table Views */
.table-desktop { display: block; }
.table-mobile-cards { display: none; }

.mobile-data-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md, 8px);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s, border-color 0.15s;
}
.mobile-data-card:active {
  transform: scale(0.99);
  border-color: var(--crizant-blue-600, #0057D9);
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.card-primary-title {
  font-family: var(--head, 'Saira', sans-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.card-secondary-sub {
  font-size: 13px;
  color: var(--ink-2);
}
.card-secondary-sub .card-label {
  font-family: var(--mono, monospace);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--ink-3);
}
.card-accordion {
  margin-top: 6px;
}
.card-expand-btn {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-expanded-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.2s;
}
.card-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.card-field-label {
  font-family: var(--mono, monospace);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--ink-3);
}
.card-field-value {
  font-weight: 600;
  color: var(--ink);
}

.pager { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; color: var(--ink-2); font-size: 13px; font-weight: 500; border-top: 1px solid var(--line); background: var(--surface); }
.pager button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 8px 14px; transition: all 0.2s; font-weight: 500; min-height: 36px; }
.pager button:hover:not(:disabled) { background: var(--bg); border-color: var(--ink-3); }
.pager button:disabled { opacity: 0.38; cursor: not-allowed; }
.pager-controls { display: flex; align-items: center; gap: 8px; }
.pager-indicator { font-family: var(--mono, monospace); font-size: 12px; }

.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-md, 8px); }
.empty-icon { font-size: 44px; margin-bottom: 12px; opacity: 0.7; }
.empty h3 { font-size: 18px; color: var(--ink); margin: 0 0 6px; }
.empty p { font-size: 14px; margin: 0; max-width: 400px; margin: 0 auto; }
.empty-cta { margin-top: 18px; min-height: 40px; }

.kan { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; }
.col { background: var(--bg); border-radius: var(--r-md, 8px); padding: 16px; min-height: 400px; border: 1px solid var(--line); }
.col header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--line); }
.col header h4 { margin: 0; font-size: 15px; font-family: var(--head, sans-serif); }
.col header span { font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--surface); padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); font-family: var(--mono, monospace); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md, 8px); padding: 16px; margin-bottom: 12px; cursor: grab; box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; position: relative; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); border-color: var(--brand-soft); }
.card:active { cursor: grabbing; transform: scale(0.98); }
.card .title { font-weight: 600; font-size: 15px; margin-bottom: 8px; color: var(--ink); }
.card .row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 13px; color: var(--ink-2); }

.toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 12px; z-index: 100; pointer-events: none; }
.toast { background: var(--ink); color: var(--surface); padding: 14px 20px; border-radius: 10px; box-shadow: var(--shadow-lg); animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); font-weight: 500; font-size: 14px; display: flex; align-items: center; gap: 10px; pointer-events: auto; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: none; } }

.err { background: #fef2f2; color: #b91c1c; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid #fecaca; display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 13.5px; }
.busy { opacity: 0.6; pointer-events: none; filter: grayscale(20%); }

/* Scrim & Modal / Bottom Sheet */
.scrim { position: fixed; inset: 0; background: rgba(10, 34, 64, 0.6); backdrop-filter: blur(8px); display: grid; place-items: center; z-index: 60; padding: 20px; animation: fadeIn 0.2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal { background: var(--surface); color: var(--ink); width: 100%; max-width: 520px; border-radius: 12px; padding: 24px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }

.modal-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.modal-top h3 { margin: 0; font-size: 20px; font-family: var(--head, sans-serif); }
.modal-close { border: 0; background: var(--bg); border-radius: 999px; width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink-2); font-size: 15px; cursor: pointer; }
.modal-close:hover { color: var(--ink); background: var(--line); }
.sheet-handle-bar { display: none; }

.fld { display: flex; flex-direction: column; margin-bottom: 16px; gap: 6px; }
.fld-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.fld-hint { font-size: 11.5px; color: var(--ink-3); }
.fld-err-msg { font-size: 12px; color: #dc2626; font-weight: 500; display: flex; align-items: center; gap: 4px; }
.fld-error .inp { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }
.mact { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }

.skel-wrap { width: 100%; }
.skel { height: 16px; border-radius: 4px; margin: 14px 0; background: linear-gradient(90deg, var(--bg) 25%, var(--line) 50%, var(--bg) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* PLG Setup Guide Floating Assistant */
.setup-guide {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 45;
  font-family: var(--sans, inherit);
}
.setup-trigger-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--crizant-navy-900, #0A2240);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 8px 18px 8px 12px;
  box-shadow: 0 8px 24px rgba(10,34,64,0.25);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.setup-trigger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(10,34,64,0.35);
}
.setup-badge {
  background: var(--crizant-blue-600, #0057D9);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.setup-pct {
  background: rgba(255,255,255,0.15);
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--mono, monospace);
  font-size: 11px;
}
.setup-popover {
  position: absolute;
  bottom: 52px;
  right: 0;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 18px;
  animation: popIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--ink);
}
.setup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.setup-header strong {
  display: block;
  font-size: 15px;
  font-family: var(--head, sans-serif);
}
.setup-header small {
  color: var(--ink-2);
  font-size: 12px;
}
.setup-close {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 15px;
  cursor: pointer;
  padding: 4px;
}
.setup-progress-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}
.setup-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--crizant-blue-600, #0057D9), var(--crizant-cyan-400, #00A9EF));
  transition: width 0.3s;
}
.setup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.setup-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
}
.step-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.step-done .step-icon {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.step-pending .step-icon {
  background: var(--bg);
  color: var(--ink-3);
  border: 1px solid var(--line);
}
.step-done .step-title {
  text-decoration: line-through;
  opacity: 0.6;
}
.step-title {
  font-weight: 600;
  color: var(--ink);
}
.step-desc {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 2px;
}
.step-btn {
  margin-top: 6px;
  border: 0;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* ========================================================= */
/* Responsive & Multi-Device Breakpoint Matrix              */
/* ========================================================= */

/* Tablet & Mobile (<= 1023px) Interaction Rules: 48px touch targets */
@media (max-width: 1023px) {
  .btn, .inp, .seg button, .pager button {
    min-height: 48px;
    font-size: 14.5px;
  }
  .kpis {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

/* Mobile Devices (<= 767px): Data Cards, Bottom Sheets, Single Column Forms */
@media (max-width: 767px) {
  .table-desktop {
    display: none;
  }
  .table-mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .kpis {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .kpi {
    padding: 12px 14px;
  }
  .kpi strong {
    font-size: 20px;
  }
  .tbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .tbar .search-inp {
    min-width: 100%;
    width: 100%;
  }
  .tbar .seg {
    width: 100%;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .tbar .seg::-webkit-scrollbar {
    display: none;
  }
  .tbar .seg button {
    flex: 1;
    text-align: center;
    white-space: nowrap;
  }
  .tbar-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .tbar-actions .btn {
    flex: 1;
    justify-content: center;
  }

  /* 16px font-size prevents iOS Safari auto-zoom on input focus */
  .inp, select, textarea {
    font-size: 16px !important;
  }

  .btn, .seg button, .pager button {
    touch-action: manipulation;
  }

  .tw, .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }

  /* Bottom-Anchored Sheet for Modals */
  .scrim {
    place-items: end stretch;
    padding: 0;
  }
  .modal.bottom-sheet {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    width: 100%;
    max-height: 88dvh;
    padding: 16px 20px max(32px, env(safe-area-inset-bottom));
    border-bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: slideUpSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  .sheet-handle-bar {
    display: flex;
    justify-content: center;
    padding-bottom: 12px;
  }
  .sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: var(--line);
    display: block;
  }
  .modal-top {
    margin-bottom: 14px;
  }
  .modal-top h3 {
    font-size: 19px;
  }

  /* Hide floating setup guide on very small screens to avoid covering touch areas */
  .setup-guide {
    display: none;
  }
}

@media (max-width: 360px) {
  .kpis {
    grid-template-columns: 1fr;
  }
}

/*$vite$:1*/