/* ═══════════════════════════════════════════════════════════

   GridBase Digital Solutions — Jay Rent Car Design System v3

   Gridbase Design Kit · Premium Charcoal · Inter · Full

   ═══════════════════════════════════════════════════════════ */

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



:root {

  /* ── Gridbase Design Kit Tokens ── */

  --bg-app: #F4F5F7;

  --bg-sidebar: #FFFFFF;

  --bg-card: #FFFFFF;

  --bg-hover: #F3F4F6;

  --bg-active: #F3F4F6;

  --color-bg-primary: #FFFFFF;

  --color-bg-secondary: #F4F5F7;



  --color-text-primary: #111827;

  --color-text-secondary: #4B5563;

  --color-text-muted: #9CA3AF;



  --color-border: #E5E7EB;

  --color-border-hover: #D1D5DB;



  --color-primary: #111827;

  --color-primary-hover: #1F2937;

  --color-primary-light: #E5E7EB;



  --color-success-bg: #DEF7EC;

  --color-success-text: #03543F;

  --color-success-icon: #10B981;



  --color-danger-bg: #FDE8E8;

  --color-danger-text: #9B1C1C;

  --color-danger-icon: #EF4444;



  --color-warning-bg: #FEF3C7;

  --color-warning-text: #92400E;



  /* Translucent variables for esmerilado native glass effect */

  --bg-translucent-topbar: rgba(249, 250, 251, 0.85);

  --bg-translucent-tabbar: rgba(255, 255, 255, 0.82);

  --bg-translucent-sticky: rgba(255, 255, 255, 0.92);

  --border-topbar: rgba(0, 0, 0, 0.06);



  /* Spacing */

  --spacing-xs: 4px;

  --spacing-sm: 8px;

  --spacing-md: 12px;

  --spacing-lg: 16px;

  --spacing-xl: 24px;

  --spacing-xxl: 32px;



  /* Border Radii */

  --radius-xs: 4px;

  --radius-sm: 6px;

  --radius-md: 8px;

  --radius-lg: 12px;

  --radius-xl: 16px;

  --radius-full: 9999px;



  /* Elevation */

  --shadow-sm: 0px 1px 2px rgba(0,0,0,0.05);

  --shadow-md: 0px 4px 6px -1px rgba(0,0,0,0.03), 0px 2px 4px -1px rgba(0,0,0,0.02);

  --shadow-lg: 0px 10px 15px -3px rgba(0,0,0,0.05), 0px 4px 6px -2px rgba(0,0,0,0.02);

  --shadow-inset: inset 0 2px 4px 0 rgba(0,0,0,0.03);



  /* Transitions */

  --transition-fast: 0.15s cubic-bezier(0.4,0,0.2,1);

  --transition-normal: 0.25s cubic-bezier(0.4,0,0.2,1);



  /* ── Backward-Compatible Aliases ── */

  --bg: var(--bg-app);

  --bg-elevated: var(--bg-hover);

  --bg-white: var(--bg-card);



  --accent: var(--color-primary);

  --accent-light: #F3F4F6;

  --accent-dark: #030712;



  --blue: #2563EB;  --blue-light: #DBEAFE;

  --green: #059669; --green-light: #DEF7EC;

  --amber: #D97706; --amber-light: #FEF3C7;

  --red: #DC2626;   --red-light: #FDE8E8;

  --purple: #7C3AED; --purple-light: #EDE9FE;



  --contrast-high: var(--color-text-primary);

  --contrast-medium: var(--color-text-secondary);

  --contrast-low: var(--color-text-muted);

  --contrast-border: var(--color-border);



  --border-color: var(--color-border);

  --border: var(--color-border);

  --primary: var(--color-primary);

  --text-muted: var(--color-text-muted);

  --text-secondary: var(--color-text-secondary);



  --transition: var(--transition-fast);

  --sidebar-w: 250px;

}



[data-theme="dark"] {

  /* ── Neutral / Charcoal Premium Dark Mode (No colors / grays) ── */

  --bg-app: #0A0A0A;

  --bg-sidebar: #171717;

  --bg-card: #171717;

  --bg-hover: #262626;

  --bg-active: #262626;

  --color-bg-primary: #171717;

  --color-bg-secondary: #0A0A0A;



  --color-text-primary: #FAFAFA;

  --color-text-secondary: #D4D4D4;

  --color-text-muted: #737373;



  --color-border: #262626;

  --color-border-hover: #404040;



  --color-primary: #FFFFFF;

  --color-primary-hover: #F5F5F5;

  --color-primary-light: #262626;



  --color-success-bg: rgba(16, 185, 129, 0.15);

  --color-success-text: #34D399;

  --color-success-icon: #34D399;



  --color-danger-bg: rgba(239, 68, 68, 0.15);

  --color-danger-text: #F87171;

  --color-danger-icon: #F87171;



  --color-warning-bg: rgba(245, 158, 11, 0.15);

  --color-warning-text: #FBBF24;



  /* Translucent variables for dark glassmorphism */

  --bg-translucent-topbar: rgba(10, 10, 10, 0.85);

  --bg-translucent-tabbar: rgba(10, 10, 10, 0.82);

  --bg-translucent-sticky: rgba(10, 10, 10, 0.92);

  --border-topbar: rgba(255, 255, 255, 0.06);



  /* Elevation (tailored shadows for dark depth) */

  --shadow-sm: 0px 1px 2px rgba(0,0,0,0.6);

  --shadow-md: 0px 4px 6px -1px rgba(0,0,0,0.7), 0px 2px 4px -1px rgba(0,0,0,0.5);

  --shadow-lg: 0px 10px 15px -3px rgba(0,0,0,0.8), 0px 4px 6px -2px rgba(0,0,0,0.6);

  --shadow-inset: inset 0 2px 4px 0 rgba(0,0,0,0.7);



  /* Backward-Compatible Aliases */

  --bg: var(--bg-app);

  --bg-elevated: var(--bg-hover);

  --bg-white: var(--bg-card);



  --accent: var(--color-primary);

  --accent-light: #262626;

  --accent-dark: #FFFFFF;



  --blue: #3B82F6;  --blue-light: rgba(59, 130, 246, 0.15);

  --green: #10B981; --green-light: rgba(16, 185, 129, 0.15);

  --amber: #F59E0B; --amber-light: rgba(245, 158, 11, 0.15);

  --red: #EF4444;   --red-light: rgba(239, 68, 68, 0.15);

  --purple: #8B5CF6; --purple-light: rgba(139, 92, 246, 0.15);



  --contrast-high: var(--color-text-primary);

  --contrast-medium: var(--color-text-secondary);

  --contrast-low: var(--color-text-muted);

  --contrast-border: var(--color-border);



  --border-color: var(--color-border);

  --border: var(--color-border);

  --primary: var(--color-primary);

  --text-muted: var(--color-text-muted);

  --text-secondary: var(--color-text-secondary);

}



/* ── Reset & Typography ── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  background: var(--bg-app);

  color: var(--color-text-primary);

  line-height: 1.5;

  overflow-x: hidden;

}

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; background: none; border: none; outline: none; }

hr { border: 0; border-top: 1px solid var(--color-border); margin: var(--spacing-lg) 0; }



/* ═══════════════════════════════════════════════════════════

   LAYOUT & APP CONTAINER

   ═══════════════════════════════════════════════════════════ */

.app-container {

  display: flex;

  height: 100vh;

  width: 100vw;

  overflow: hidden;

}



/* Also support old class name */

.app-layout { display: flex; width: 100vw; height: 100vh; overflow: hidden; }



.main-content {

  flex: 1;

  overflow-y: auto;

  padding: var(--spacing-lg) var(--spacing-xl);

  display: flex;

  flex-direction: column;

  background-color: var(--bg-app);

}



.workspace-panel {

  background-color: var(--bg-card);

  border: 1px solid var(--color-border);

  border-radius: var(--radius-xl);

  padding: var(--spacing-xl) var(--spacing-xxl);

  flex: 1;

  min-height: auto;

  box-shadow: 0 1px 3px rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.04);

}



/* ═══════════════════════════════════════════════════════════

   SIDEBAR — White Background with Vertical Active Line

   ═══════════════════════════════════════════════════════════ */

.sidebar {

  width: var(--sidebar-w);

  background-color: var(--bg-sidebar);

  border-right: 1px solid var(--color-border);

  display: flex;

  flex-direction: column;

  height: 100%;

  flex-shrink: 0;

  transition: var(--transition-normal);

  overflow: hidden;

  position: relative;

}



.sidebar-logo {

  padding: var(--spacing-xl);

  display: flex;

  align-items: center;

  gap: var(--spacing-sm);

  font-size: 18px;

  font-weight: 700;

  letter-spacing: -0.02em;

  border-bottom: 1px solid transparent;

}

#sidebar-logo-img,
.sidebar-logo img {
  max-width: 100%;
  height: 57px;
  max-height: 57px;
  object-fit: contain;
}



.sidebar-nav {

  position: relative;

  flex: 1;

  overflow-y: auto;

  padding: 0 var(--spacing-md) var(--spacing-sm) 20px;

  scrollbar-width: none;

}

.sidebar-nav::-webkit-scrollbar { display: none; }



.sidebar-section-title {

  font-size: 11px;

  font-weight: 600;

  color: var(--color-text-muted);

  text-transform: uppercase;

  letter-spacing: 0.05em;

  margin: var(--spacing-lg) 0 var(--spacing-sm) var(--spacing-sm);

}



.sidebar-menu {

  list-style: none;

  display: flex;

  flex-direction: column;

  gap: 2px;

}



.sidebar-link {

  display: flex;

  align-items: center;

  justify-content: space-between;

  padding: var(--spacing-sm) var(--spacing-md);

  border-radius: var(--radius-md);

  color: var(--color-text-secondary);

  font-weight: 500;

  font-size: 13px;

  cursor: pointer;

  transition: var(--transition-fast);

  position: relative;

  user-select: none;

  text-decoration: none;

  border: none;

  background: transparent;

  width: 100%;

  text-align: left;

}



.sidebar-link-content {

  display: flex;

  align-items: center;

  gap: var(--spacing-md);

}



.sidebar-link svg {

  width: 18px;

  height: 18px;

  color: var(--color-text-secondary);

  transition: var(--transition-fast);

  flex-shrink: 0;

}



.sidebar-link:hover { background-color: var(--bg-hover); color: var(--color-text-primary); }

.sidebar-link:hover svg { color: var(--color-text-primary); }



.sidebar-link.active { background-color: transparent; color: var(--color-text-primary); font-weight: 600; }

.sidebar-link.active svg { color: var(--color-text-primary); }

.sidebar-link.active::before {
  display: none !important;
}

.sidebar-bounce-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: var(--color-primary, #00a460);
  box-shadow: 0 0 8px rgba(0, 164, 96, 0.6);
  pointer-events: none;
  z-index: 25;
  will-change: transform;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.sidebar-bounce-dot.is-visible {
  opacity: 1;
}



/* Sidebar Footer — Profile Card */

.sidebar-footer {

  padding: 4px var(--spacing-lg) var(--spacing-lg);

  border-top: none;

}



.profile-card {

  display: flex;

  align-items: center;

  justify-content: space-between;

  padding: var(--spacing-sm);

  background-color: var(--bg-hover);

  border-radius: var(--radius-lg);

  cursor: pointer;

  transition: var(--transition-fast);

}

.profile-card:hover { background-color: var(--color-border); }

.profile-avatar {
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: visible;
  border: none;
  box-shadow: none;
  position: relative;
  cursor: pointer;
}

.profile-avatar svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: block !important;
  overflow: visible !important;
  filter: drop-shadow(0 4px 12px color-mix(in srgb, var(--mo-head, #00A460) 35%, transparent));
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.28s ease;
}

.profile-card:hover .profile-avatar svg {
  transform: translateY(-2px) scale(1.09) rotate(2deg);
  filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--mo-head, #00A460) 65%, transparent));
}

.profile-avatar img {
  width: 100% !important;
  height: 100% !important;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.profile-avatar .mo-eyes,
.mo-eyes {
  --mo-track-travel: 9.5px;
}

/* Interactive click animations for avatar mascot */
@keyframes avatar-bounce-anim {
  0% { transform: scale(1); }
  25% { transform: scale(0.82, 1.25) translateY(-8px); }
  50% { transform: scale(1.2, 0.82) translateY(3px); }
  75% { transform: scale(0.94, 1.06) translateY(-2px); }
  100% { transform: scale(1) translateY(0); }
}
.profile-avatar.avatar-bounce svg {
  animation: avatar-bounce-anim 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes avatar-spin-anim {
  0% { transform: rotate(0deg) scale(1); }
  40% { transform: rotate(180deg) scale(1.22); }
  100% { transform: rotate(360deg) scale(1); }
}
.profile-avatar.avatar-spin svg {
  animation: avatar-spin-anim 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes avatar-squish-anim {
  0% { transform: scale(1); }
  30% { transform: scale(1.32, 0.68) translateY(4px); }
  60% { transform: scale(0.86, 1.18) translateY(-4px); }
  100% { transform: scale(1) translateY(0); }
}
.profile-avatar.avatar-squish svg {
  animation: avatar-squish-anim 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}



.profile-info { flex: 1; margin-left: var(--spacing-sm); overflow: hidden; }

.profile-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.profile-role { font-size: 11px; color: var(--color-text-muted); }

.profile-card > svg { width: 16px; height: 16px; color: var(--color-text-secondary); flex-shrink: 0; }



/* ═══════════════════════════════════════════════════════════
   TOPBAR HEADER
   ═══════════════════════════════════════════════════════════ */

.topbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: var(--spacing-xl);
  flex-shrink: 0;
  gap: var(--spacing-lg);
  flex-wrap: nowrap !important;
  min-height: 48px;
  background: transparent;
}

.topbar-left {
  display: flex !important;
  align-items: center !important;
  gap: 16px;
  min-width: 0;
  flex: 1;
  flex-wrap: nowrap !important;
}

.topbar-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
  flex-wrap: nowrap !important;
}

/* ── Topbar Modern Action Buttons (Refined & Seamless) ── */
.topbar .btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 50% !important;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

[data-theme="light"] .topbar .btn-icon {
  background-color: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.topbar .btn-icon:hover {
  background-color: var(--bg-hover);
  color: var(--color-text-primary);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .topbar .btn-icon:hover {
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.topbar .btn-icon:active {
  transform: scale(0.94);
}

.topbar .btn-icon svg {
  width: 17px;
  height: 17px;
  transition: transform 0.25s ease;
}

.topbar #theme-toggle:hover svg {
  transform: rotate(25deg);
}

.topbar #notification-toggle:hover svg {
  transform: rotate(-12deg);
}

/* Notification badge on circular button */
.topbar #notification-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.8), 0 0 0 1.5px var(--bg-app);
}

/* ── SpecularButton (React Bits Variant: JS + CSS) ── */
.specular-button {
  --sb-radius: 14px;
  --sb-tint: #ffffff;
  --sb-tint-opacity: 0;
  --sb-blur: 0px;
  --sb-text-color: #f8fafc;
  --sb-bg: #151515;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  margin: 0;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--sb-text-color);
  background: var(--sb-bg);
  border-radius: var(--sb-radius);
  backdrop-filter: blur(var(--sb-blur));
  -webkit-backdrop-filter: blur(var(--sb-blur));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 14px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  outline: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  height: 38px;
  padding: 0 18px;
  font-size: 13.5px;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
}

[data-theme="light"] .specular-button {
  --sb-bg: #151515;
  --sb-text-color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 3px 10px rgba(15, 23, 42, 0.22);
}

.specular-button:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 6px 20px rgba(0, 0, 0, 0.32);
}

.specular-button:active {
  transform: scale(0.97);
}

.specular-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.4);
  outline-offset: 3px;
}

.specular-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.specular-button:disabled:active {
  transform: none;
}

/* Canvas extends past the button so the rim glow can bleed outside the edge */
.specular-button__fx {
  position: absolute;
  inset: -20px;
  pointer-events: none;
  z-index: 1;
}

.specular-button__fx canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.specular-button__label {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.specular-button__label svg {
  display: block;
  flex-shrink: 0;
}

/* ── DGII Status Pill Refinements ── */
#dgii-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.25px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

#dgii-status-pill:hover {
  filter: brightness(1.12);
  transform: translateY(-0.5px);
}

#dgii-status-pill:active {
  transform: scale(0.97);
}

#dgii-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

@media (max-width: 768px) {
  #dgii-status-pill {
    display: none !important;
  }
}

#greeting-text.greeting-hidden {
  display: none !important;
}

@media (max-width: 900px) and (min-width: 769px) {
  #greeting-text {
    display: none !important;
  }
}

/* ── Search Wrapper (Wider) ── */

.search-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 1 460px;
  width: 100%;
  max-width: 460px;
  min-width: 200px;
}

.search-input {
  width: 100%;
  height: 38px;
  box-sizing: border-box;
  background-color: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0 54px 0 36px;

  font-size: 13px;

  line-height: 38px;

  color: var(--color-text-primary);

  transition: var(--transition-fast);

}

.search-input::placeholder { color: var(--color-text-muted); }

.search-input:focus { border-color: var(--color-border-hover); box-shadow: 0 0 0 2px rgba(17,24,39,0.05); }

.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--color-text-muted); pointer-events: none; }

.search-shortcuts { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; gap: 3px; pointer-events: none; align-items: center; }

.keycap {

  display: inline-flex; align-items: center; justify-content: center;

  font-size: 10px; font-weight: 600;

  color: var(--color-text-secondary);

  background-color: var(--bg-hover);

  border: 1px solid var(--color-border);

  border-radius: var(--radius-xs);

  width: 18px; height: 18px;

  box-shadow: 0px 1px 1px rgba(0,0,0,0.05), inset 0px -1px 0px rgba(0,0,0,0.05);

  line-height: 1;

}



.vertical-divider {

  width: 1px; height: 24px;

  background-color: var(--color-border);

  margin: 0 var(--spacing-sm);

  align-self: center;

}



/* Page Header */

.page-header {

  display: flex;

  align-items: center;

  justify-content: space-between;

  margin-bottom: var(--spacing-xl);

}

.page-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--color-text-primary); }

.page-subtitle { font-size: 13px; color: var(--color-text-secondary); margin-top: 2px; }



/* ═══════════════════════════════════════════════════════════

   BUTTONS — Gradient Primary, Bordered Secondary

   ═══════════════════════════════════════════════════════════ */

.btn {

  display: inline-flex; align-items: center; justify-content: center;

  gap: var(--spacing-sm);

  font-weight: 500;

  padding: 8px 14px;

  border-radius: var(--radius-md);

  cursor: pointer;

  transition: var(--transition-fast);

  white-space: nowrap;

  user-select: none;

  font-size: 13px;

  text-decoration: none;

}

.btn svg { width: 16px; height: 16px; }



.btn-primary {

  background-color: #111827;

  background-image: linear-gradient(180deg, #1F2937 0%, #111827 100%);

  color: #FFFFFF;

  border: 1px solid #111827;

  box-shadow: 0px 1px 2px rgba(0,0,0,0.05), inset 0px 1px 0px rgba(255,255,255,0.1);

  font-weight: 600;

}

.btn-primary:hover { background-image: linear-gradient(180deg, #2D3748 0%, #1F2937 100%); border-color: #1F2937; }



.btn-secondary {

  background-color: var(--bg-card);

  color: var(--color-text-primary);

  border: 1px solid var(--color-primary);

  box-shadow: var(--shadow-sm);

  font-weight: 600;

}

.btn-secondary:hover { background-color: var(--bg-hover); border-color: var(--color-primary-hover); }

[data-theme="dark"] .btn-secondary {
  border-color: var(--color-border);
}

[data-theme="dark"] .btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background-color: var(--bg-hover);
}



.btn-ghost { background: transparent; color: var(--color-text-secondary); border: none; }

.btn-ghost:hover { background: var(--bg-hover); color: var(--color-text-primary); }



.btn-success { background: var(--green); color: #FFFFFF; border: 1px solid var(--green); font-weight: 600; }

.btn-success:hover { background: #047857; border-color: #047857; }



.btn-danger { background: var(--color-danger-bg); color: var(--red); border: 1px solid rgba(220,38,38,0.15); }

.btn-danger:hover { background: var(--red); color: #FFFFFF; border-color: var(--red); }



.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: var(--radius-sm); }

.btn-lg { padding: 11px 24px; font-size: 14px; }



.btn-icon {

  width: 38px; height: 38px; padding: 0;

  border-radius: var(--radius-md);

  background-color: var(--bg-card);

  color: var(--color-text-secondary);

  border: 1px solid var(--color-border);

  display: inline-flex; align-items: center; justify-content: center;

  cursor: pointer; transition: var(--transition-fast);

}

.btn-icon:hover { background-color: var(--bg-hover); color: var(--color-text-primary); border-color: var(--color-border-hover); }

.btn-icon svg { width: 18px; height: 18px; }

/* ── Back Navigation Button (Breadcrumbs) ── */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  line-height: 1.3;
}

.btn-back:hover {
  background-color: var(--bg-hover);
  color: var(--color-text-primary);
  border-color: var(--color-border-hover);
}

.btn-back svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  transition: transform 0.15s ease;
}

.btn-back:hover svg {
  transform: translateX(-2px);
}

[data-theme="dark"] .btn-back {
  box-shadow: none;
}





/* ═══════════════════════════════════════════════════════════

   SEGMENTED CONTROLS / TABS

   ═══════════════════════════════════════════════════════════ */

.segmented-control-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  width: 100%;
  margin-bottom: var(--spacing-lg);
}

.segmented-control-wrapper .segmented-control {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.segmented-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--bg-card);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.segmented-arrow:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--color-text-primary);
  border-color: var(--color-text-muted);
}

.segmented-arrow:active:not(:disabled) {
  transform: scale(0.92);
}

.segmented-arrow:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

.segmented-control {
  --fade-start: 0px;
  --fade-end: 0px;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  background-color: #262626;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 4px;
  gap: 0;
  margin-bottom: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-sizing: border-box;
  cursor: grab;
  user-select: none;
}

[data-theme="light"] .segmented-control {
  background-color: #F1F2F4;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.segmented-control.is-dragging {
  cursor: grabbing !important;
  user-select: none;
}

.segmented-control.is-dragging * {
  cursor: grabbing !important;
  user-select: none;
}

.segmented-control::-webkit-scrollbar {
  display: none;
}

/* Sliding selection pill (UI Arc morph spring animation) */
.segmented-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  height: calc(100% - 8px);
  border-radius: 12px;
  background-color: #171717;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  pointer-events: none;
  z-index: 1;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.15s ease;
  will-change: transform, width;
}

[data-theme="light"] .segmented-pill {
  background-color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.segment-item {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  height: 36px;
  padding: 0 20px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #D4D4D4;
  border-radius: 12px;
  cursor: pointer;
  transition: color 0.18s ease;
  user-select: none;
  border: none;
  background: transparent !important;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  box-sizing: border-box;
}

.segment-item:hover {
  color: #FFFFFF;
}

.segment-item.active {
  color: #FFFFFF !important;
  font-weight: 500;
  background: transparent !important;
}

[data-theme="light"] .segment-item {
  color: #6B7280;
}

[data-theme="light"] .segment-item:hover {
  color: #111827;
}

[data-theme="light"] .segment-item.active {
  color: #111827 !important;
  font-weight: 500;
  background: transparent !important;
}

/* Badge / Count */
.segment-item span[id$="-count"],
.segment-item .segment-count {
  font-size: 12.5px;
  font-weight: 400;
  opacity: 0.65;
  margin-left: 5px;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .segment-item.active span[id$="-count"],
[data-theme="dark"] .segment-item.active .segment-count {
  color: #A3A3A3;
  opacity: 0.85;
}

/* Initial fallback before JS mounts the pill */
.segmented-control:not([data-ready]) .segment-item.active {
  background-color: #171717 !important;
}

[data-theme="light"] .segmented-control:not([data-ready]) .segment-item.active {
  background-color: #FFFFFF !important;
}

/* Edge fading masks for scrollable tabs (UI Arc) */
.segmented-control-wrapper[data-left="true"] .segmented-control,
.tabs-list-shell[data-left="true"] .tabs-viewport {
  -webkit-mask-image: linear-gradient(to right, transparent, black 35px, black);
  mask-image: linear-gradient(to right, transparent, black 35px, black);
}

.segmented-control-wrapper[data-right="true"] .segmented-control,
.tabs-list-shell[data-right="true"] .tabs-viewport {
  -webkit-mask-image: linear-gradient(to right, black, black calc(100% - 35px), transparent);
  mask-image: linear-gradient(to right, black, black calc(100% - 35px), transparent);
}

.segmented-control-wrapper[data-left="true"][data-right="true"] .segmented-control,
.tabs-list-shell[data-left="true"][data-right="true"] .tabs-viewport {
  -webkit-mask-image: linear-gradient(to right, transparent, black 35px, black calc(100% - 35px), transparent);
  mask-image: linear-gradient(to right, transparent, black 35px, black calc(100% - 35px), transparent);
}

/* ═══════════════════════════════════════════════════════════
   UI ARC TABS COMPONENT (@uiarc/tabs)
   ═══════════════════════════════════════════════════════════ */

.tabs-root {
  position: relative;
  width: 100%;
}

.tabs-list-shell {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  background: #262626;
  box-sizing: border-box;
}

[data-theme="light"] .tabs-list-shell {
  background: #F1F2F4;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.tabs-viewport {
  min-width: 0;
  overflow-x: auto;
  border-radius: inherit;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tabs-viewport::-webkit-scrollbar {
  display: none;
}

.tabs-list {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 0;
  padding: 4px;
}

.tabs-scroll-btn {
  position: absolute;
  z-index: 3;
  top: 4px;
  bottom: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  border: none;
  background: #262626;
  color: #D4D4D4;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
}

[data-theme="light"] .tabs-scroll-btn {
  background: #F1F2F4;
  color: #6B7280;
}

.tabs-scroll-left {
  left: 4px;
  border-radius: 12px 0 0 12px;
}

.tabs-scroll-right {
  right: 4px;
  border-radius: 0 12px 12px 0;
}

.tabs-scroll-btn:hover {
  color: #FFFFFF;
}

[data-theme="light"] .tabs-scroll-btn:hover {
  color: #111827;
}

.tabs-scroll-btn:disabled {
  opacity: 0;
  pointer-events: none;
}

.tabs-trigger {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6.5px;
  min-width: 5.5rem;
  height: 36px;
  padding: 0 18px;
  background: transparent !important;
  border: none;
  border-radius: 12px;
  color: #D4D4D4;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  outline: none;
  transition: color 0.18s ease;
  box-sizing: border-box;
}

.tabs-trigger:hover {
  color: #FFFFFF;
}

.tabs-trigger.active,
.tabs-trigger[data-state="active"] {
  color: #FFFFFF !important;
  font-weight: 500;
}

[data-theme="light"] .tabs-trigger {
  color: #6B7280;
}

[data-theme="light"] .tabs-trigger:hover {
  color: #111827;
}

[data-theme="light"] .tabs-trigger.active,
[data-theme="light"] .tabs-trigger[data-state="active"] {
  color: #111827 !important;
}

.tabs-selection {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  height: calc(100% - 8px);
  border-radius: 12px;
  background-color: #171717;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  pointer-events: none;
  z-index: 1;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.15s ease;
  will-change: transform, width;
}

[data-theme="light"] .tabs-selection {
  background-color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Tab Panels container with height morphing */
.tabs-panels-container {
  position: relative;
  overflow: hidden;
  transition: height 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: height;
}

/* Directional panel slide animations */
.tabs-content,
.tab-content,
[id^="tab-"] {
  animation-duration: 0.28s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  animation-fill-mode: forwards;
}

.tab-anim-enter-right {
  animation-name: tabSlideEnterRight;
}

.tab-anim-enter-left {
  animation-name: tabSlideEnterLeft;
}

@keyframes tabSlideEnterRight {
  from {
    opacity: 0;
    transform: translate3d(12px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes tabSlideEnterLeft {
  from {
    opacity: 0;
    transform: translate3d(-12px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tabs-selection,
  .tabs-panels-container,
  .tabs-content,
  .tab-content,
  [id^="tab-"] {
    transition: none !important;
    animation: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   UI ARC BAR CHART (@uiarc/bar-chart)
   Single series column chart with average line and scrubbable headline
   ═══════════════════════════════════════════════════════════ */
.uiarc-bar-chart-root {
  width: 100%;
  position: relative;
}

.uiarc-bar-chart {
  display: grid;
  min-width: 0;
  gap: 16px;
  margin: 0;
  color: var(--color-text-primary, #FFFFFF);
  user-select: none;
}

.uiarc-bar-chart-header {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.uiarc-bar-chart-kind,
.uiarc-bar-chart-when {
  display: block;
  min-height: 18px;
  font-size: 12.5px;
  line-height: 1.4;
  transition: color 0.15s ease;
}

.uiarc-bar-chart-kind {
  color: var(--color-text-secondary, #9CA3AF);
  font-weight: 500;
}

.uiarc-bar-chart-when {
  color: var(--color-text-muted, #6B7280);
}

.uiarc-bar-chart-value {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 6px;
  font-family: 'Plus Jakarta Sans', var(--font-family, sans-serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-primary, #FFFFFF);
}

[data-theme="light"] .uiarc-bar-chart-value {
  color: #111827;
}

[data-theme="light"] .uiarc-bar-chart-kind {
  color: #4B5563;
}

[data-theme="light"] .uiarc-bar-chart-when {
  color: #6B7280;
}

/* Grid layout for plot and axes */
.uiarc-bar-chart-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  grid-template-rows: auto 24px;
  min-width: 0;
}

.uiarc-bar-chart-plot {
  position: relative;
  grid-area: 1 / 1;
  min-width: 0;
}

.uiarc-bar-chart-svg {
  display: block;
  overflow: hidden;
}

/* Grid lines and axes */
.uiarc-bar-chart-grid {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

[data-theme="light"] .uiarc-bar-chart-grid {
  stroke: rgba(0, 0, 0, 0.06);
}

.uiarc-bar-chart-baseline {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

[data-theme="light"] .uiarc-bar-chart-baseline {
  stroke: rgba(0, 0, 0, 0.12);
}

.uiarc-bar-chart-cursor {
  stroke: rgba(255, 255, 255, 0.38);
  stroke-width: 1;
  shape-rendering: crispEdges;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease;
}

[data-theme="light"] .uiarc-bar-chart-cursor {
  stroke: rgba(0, 0, 0, 0.28);
}

.uiarc-bar-chart-mean {
  stroke: #10B981;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  shape-rendering: crispEdges;
  opacity: 0.75;
}

/* Bars */
.uiarc-bar-chart-bar {
  fill: #10B981;
  opacity: 0.75;
  cursor: pointer;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), fill 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .uiarc-bar-chart-bar {
  fill: #059669;
  opacity: 0.82;
}

/* Scrubbing states (UI Arc specification) */
.uiarc-bar-chart-body[data-scrubbing="true"] .uiarc-bar-chart-bar {
  opacity: 0.26;
}

.uiarc-bar-chart-body[data-scrubbing="true"] .uiarc-bar-chart-cursor {
  opacity: 1;
}

.uiarc-bar-chart-body .uiarc-bar-chart-bar[data-active="true"] {
  opacity: 1 !important;
  fill: #10B981 !important;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.45));
}

[data-theme="light"] .uiarc-bar-chart-body .uiarc-bar-chart-bar[data-active="true"] {
  fill: #059669 !important;
  filter: drop-shadow(0 1px 4px rgba(5, 150, 105, 0.35));
}

/* Series color overrides */
.uiarc-bar-chart[data-series="expense"] .uiarc-bar-chart-bar {
  fill: #3B82F6;
}
[data-theme="light"] .uiarc-bar-chart[data-series="expense"] .uiarc-bar-chart-bar {
  fill: #2563EB;
}
.uiarc-bar-chart[data-series="expense"] .uiarc-bar-chart-mean {
  stroke: #3B82F6;
}
.uiarc-bar-chart[data-series="expense"] .uiarc-bar-chart-bar[data-active="true"] {
  fill: #3B82F6 !important;
  filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.45));
}
[data-theme="light"] .uiarc-bar-chart[data-series="expense"] .uiarc-bar-chart-bar[data-active="true"] {
  fill: #2563EB !important;
  filter: drop-shadow(0 1px 4px rgba(37, 99, 235, 0.35));
}

/* Right Gutter */
.uiarc-bar-chart-gutter {
  position: relative;
  grid-area: 1 / 2;
  min-width: 0;
}

.uiarc-bar-chart-tick,
.uiarc-bar-chart-mean-label {
  position: absolute;
  left: 10px;
  display: block;
  height: 0;
  white-space: nowrap;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.uiarc-bar-chart-tick-text {
  display: block;
  transform: translateY(-50%);
  color: var(--color-text-muted, #6B7280);
  font-size: 10.5px;
  line-height: 1;
}

.uiarc-bar-chart-mean-label .uiarc-bar-chart-tick-text {
  color: #10B981;
  font-weight: 600;
  font-size: 10px;
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 5px;
  border-radius: 4px;
}

[data-theme="light"] .uiarc-bar-chart-mean-label .uiarc-bar-chart-tick-text {
  background: rgba(5, 150, 105, 0.1);
  color: #047857;
}

.uiarc-bar-chart[data-series="expense"] .uiarc-bar-chart-mean-label .uiarc-bar-chart-tick-text {
  color: #3B82F6;
  background: rgba(59, 130, 246, 0.12);
}

[data-theme="light"] .uiarc-bar-chart[data-series="expense"] .uiarc-bar-chart-mean-label .uiarc-bar-chart-tick-text {
  color: #1D4ED8;
  background: rgba(37, 99, 235, 0.1);
}

/* Bottom Axis */
.uiarc-bar-chart-axis {
  position: relative;
  grid-area: 2 / 1;
  min-width: 0;
  overflow: hidden;
}

.uiarc-bar-chart-axis-label {
  position: absolute;
  top: 8px;
  color: var(--color-text-muted, #6B7280);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transform: translateX(-50%);
}

/* Scrubber interaction surface */
.uiarc-bar-chart-scrubber {
  position: absolute;
  inset: 0;
  outline: none;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
  z-index: 10;
}

.uiarc-bar-chart-scrubber:focus-visible {
  box-shadow: 0 0 0 2px var(--color-primary);
  border-radius: 8px;
}

.db-bar-chart-container {
  width: 100%;
  padding: 18px 20px 14px;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .db-bar-chart-container {
    padding: 12px 14px 10px;
  }
  .uiarc-bar-chart-value {
    font-size: 22px;
  }
}



/* ═══════════════════════════════════════════════════════════

   METRIC CARDS — KPIs

   ═══════════════════════════════════════════════════════════ */

.grid-metrics {

  display: grid;

  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));

  gap: var(--spacing-lg);

  margin-bottom: var(--spacing-xl);

}



#grid-metrics, .grid-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 106px;
}
.metric-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-hover);
  transform: translateY(-2px);
}

.metric-card-icon {
  position: absolute;
  right: -12px;
  bottom: -12px;
  width: 90px;
  height: 90px;
  opacity: 0.04;
  pointer-events: none;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  color: var(--color-text-primary);
}
.metric-card-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.25;
}
.metric-card:hover .metric-card-icon {
  transform: scale(1.12) rotate(-8deg);
}

.metric-card-icon.green { color: var(--color-success-icon); opacity: 0.05; }
.metric-card:hover .metric-card-icon.green { opacity: 0.09; }
.metric-card-icon.amber { color: var(--amber); opacity: 0.05; }
.metric-card:hover .metric-card-icon.amber { opacity: 0.09; }
.metric-card-icon.red { color: var(--color-danger-icon); opacity: 0.05; }
.metric-card:hover .metric-card-icon.red { opacity: 0.09; }
.metric-card-icon.purple { color: var(--purple); opacity: 0.05; }
.metric-card:hover .metric-card-icon.purple { opacity: 0.09; }

/* Dark mode specific adjustments for watermark contrast */
[data-theme="dark"] .metric-card-icon { opacity: 0.05; }
[data-theme="dark"] .metric-card-icon.green { opacity: 0.06; }
[data-theme="dark"] .metric-card:hover .metric-card-icon.green { opacity: 0.11; }
[data-theme="dark"] .metric-card-icon.amber { opacity: 0.06; }
[data-theme="dark"] .metric-card:hover .metric-card-icon.amber { opacity: 0.11; }
[data-theme="dark"] .metric-card-icon.red { opacity: 0.06; }
[data-theme="dark"] .metric-card:hover .metric-card-icon.red { opacity: 0.11; }
[data-theme="dark"] .metric-card-icon.purple { opacity: 0.06; }
[data-theme="dark"] .metric-card:hover .metric-card-icon.purple { opacity: 0.11; }

.metric-body { display: flex; align-items: baseline; gap: var(--spacing-sm); position: relative; z-index: 2; }
.metric-value { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; color: var(--color-text-primary); font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif; font-variant-numeric: tabular-nums; }
.metric-trend {
  font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--radius-full);
  margin-left: 8px;
}
.metric-trend.up { background: var(--color-success-bg); color: var(--color-success-text); }
.metric-trend.down { background: var(--color-danger-bg); color: var(--color-danger-text); }
.metric-title { font-size: 12px; font-weight: 500; color: var(--color-text-secondary); margin-top: 6px; position: relative; z-index: 2; }
.metric-sub { font-size: 11.5px; color: var(--color-text-muted); margin-top: 4px; position: relative; z-index: 2; }

/* Stat card alias for metric-card compatibility */
.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-hover);
  transform: translateY(-2px);
}
.stat-card-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}
.stat-card-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  line-height: 1.2;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-variant-numeric: tabular-nums;
}
.stat-card-sub {
  font-size: 11.5px;
  color: var(--color-text-muted);
  margin-top: 6px;
}

/* Premium Empty State within Tables */
.empty-state-cell {
  text-align: center;
  padding: 48px 16px !important;
}
.empty-state-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto;
}
.empty-state-icon {
  width: 40px;
  height: 40px;
  color: var(--color-text-muted);
  opacity: 0.5;
  margin-bottom: 4px;
}
.empty-state-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}
.empty-state-desc {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Micro-interaction for Ver Todas link icon */
.btn-view-all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-view-all svg.btn-arrow-icon {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast) ease;
  vertical-align: middle;
}
.btn-view-all:hover svg.btn-arrow-icon {
  transform: translateX(3px);
}

/* ═══════════════════════════════════════════════════════════
   PREMIUM OPERATIONS DASHBOARD v2 — Reference Redesign
   ═══════════════════════════════════════════════════════════ */

.inv-dashboard-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.inv-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.inv-title-area {
  display: flex;
  flex-direction: column;
}
.inv-page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-text-primary);
  letter-spacing: -0.03em;
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}
.inv-page-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 3px;
}
.inv-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── 4-Column Executive KPI Grid (Propuesta 1) ── */
.inv-kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 0;
}
@media (max-width: 1100px) {
  .inv-kpis-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .inv-kpis-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Modern Fintech KPI Cards (Estilo Limpio Bills) ── */
.inv-kpi-modern-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 20px 22px 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  box-shadow: none;
  transition: border-color 0.2s ease;
  overflow: hidden;
}
.inv-kpi-modern-card:hover {
  border-color: var(--color-border-hover);
}

/* Card 1 Hero Contrast (Adapts to Light & Dark) */
.inv-kpi-modern-card.hero-dark {
  background: var(--bg-card);
  color: var(--color-text-primary);
  border-color: var(--color-border);
  box-shadow: none;
}
.inv-kpi-modern-card.hero-dark:hover {
  border-color: var(--color-border-hover);
}

[data-theme="dark"] .inv-kpi-modern-card {
  background: #18181f;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}
[data-theme="dark"] .inv-kpi-modern-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
}
[data-theme="dark"] .inv-kpi-modern-card.hero-dark {
  background: #111115;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}
[data-theme="dark"] .inv-kpi-modern-card.hero-dark:hover {
  border-color: rgba(16, 185, 129, 0.3);
}

/* Top Row: Icon Bubble (left) and Circle Arrow Action (right) */
.inv-kpi-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* Clean, flat icon bubbles - Sin resplandores, adaptados a Bills */
.inv-kpi-bubble {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.inv-kpi-bubble.hero-green {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
[data-theme="dark"] .inv-kpi-bubble.hero-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.inv-kpi-bubble.green-subtle {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
[data-theme="dark"] .inv-kpi-bubble.green-subtle {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.inv-kpi-bubble.amber-subtle {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
[data-theme="dark"] .inv-kpi-bubble.amber-subtle {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.inv-kpi-bubble.red-subtle {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
[data-theme="dark"] .inv-kpi-bubble.red-subtle {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Action Circle Arrow Button ↗ */
.inv-kpi-arrow-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}
.hero-dark .inv-kpi-arrow-btn {
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}
[data-theme="dark"] .hero-dark .inv-kpi-arrow-btn {
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.85);
}
.inv-kpi-arrow-btn:hover {
  background: var(--bg-hover);
  color: var(--color-text-primary);
  border-color: var(--color-text-secondary);
  transform: scale(1.06);
}
.hero-dark .inv-kpi-arrow-btn:hover {
  background: var(--bg-hover);
  color: var(--color-text-primary);
  border-color: var(--color-border-hover);
}
[data-theme="dark"] .hero-dark .inv-kpi-arrow-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: #ffffff;
}
.inv-kpi-arrow-btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}
.inv-kpi-arrow-btn:hover svg {
  transform: translate(1.5px, -1.5px);
}

/* Middle Content */
.inv-kpi-mid-standard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.inv-kpi-mid-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.inv-kpi-mid-split-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.inv-kpi-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: -0.01em;
}
.hero-dark .inv-kpi-label {
  color: var(--color-text-secondary);
}
[data-theme="dark"] .hero-dark .inv-kpi-label {
  color: #9ca3af;
}

.inv-kpi-number {
  font-size: 28px;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.hero-dark .inv-kpi-number {
  color: var(--color-text-primary);
}
[data-theme="dark"] .hero-dark .inv-kpi-number {
  color: #ffffff;
}
.inv-kpi-number.valuation {
  font-size: 23px;
}

/* Gauge Wrap and SVG */
.inv-kpi-gauge-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.inv-gauge-svg {
  overflow: visible;
  display: block;
}
.inv-gauge-track {
  stroke: rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .inv-gauge-track {
  stroke: rgba(255, 255, 255, 0.08);
}
.inv-gauge-val {
  font-size: 13px;
  font-weight: 800;
  fill: var(--color-text-primary);
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  letter-spacing: -0.02em;
}
.inv-gauge-lbl {
  font-size: 8px;
  font-weight: 600;
  fill: var(--color-text-muted);
  letter-spacing: 0.01em;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

/* Footer Row */
.inv-kpi-footer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  font-size: 11.5px;
  color: var(--color-text-muted);
}
.hero-dark .inv-kpi-footer-row {
  border-color: var(--color-border);
  color: var(--color-text-muted);
}
[data-theme="dark"] .hero-dark .inv-kpi-footer-row {
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
}

.inv-kpi-trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.2;
}
.inv-kpi-trend-badge.hero-green {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}
[data-theme="dark"] .inv-kpi-trend-badge.hero-green {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
}
.inv-kpi-trend-badge.green {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}
[data-theme="dark"] .inv-kpi-trend-badge.green {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
}
.inv-kpi-trend-badge.amber {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}
[data-theme="dark"] .inv-kpi-trend-badge.amber {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}
.inv-kpi-trend-badge.red {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
[data-theme="dark"] .inv-kpi-trend-badge.red {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
}

.inv-kpi-foot-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  font-size: 11.5px;
}

.inv-kpi-foot-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  font-size: 11.5px;
}
.btn-pill-primary {
  background: #2563eb;
  color: #ffffff !important;
  border: none;
  border-radius: 9999px;
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all var(--transition-fast) ease;
}
.btn-pill-primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}
.btn-pill-secondary {
  background: var(--bg-card);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast) ease;
}
.btn-pill-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--color-border-hover);
}

/* Middle 3-Column Grid */
.inv-middle-grid {
  display: grid;
  grid-template-columns: 2fr 1.15fr 1fr;
  gap: 16px;
}
@media (max-width: 1200px) {
  .inv-middle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .inv-middle-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.inv-card {
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
}
.inv-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.inv-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary);
}

/* Analytic View & Heatmap */
.inv-analytic-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}
.inv-analytic-col {
  display: flex;
  flex-direction: column;
}
.inv-analytic-val {
  font-size: 26px;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--color-text-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.inv-analytic-val svg {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}
.inv-analytic-label {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.inv-heatmap-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
}
.inv-heatmap-matrix {
  display: grid;
  grid-template-columns: 24px repeat(12, 1fr);
  gap: 6px;
  align-items: center;
}
.inv-heatmap-row-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: right;
  padding-right: 6px;
}
.inv-heatmap-cell {
  height: 28px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.08);
  transition: transform 0.15s ease, background 0.15s ease;
  cursor: pointer;
  position: relative;
}
.inv-heatmap-cell:hover {
  transform: scale(1.1);
  z-index: 10;
}
.inv-heatmap-cell.lvl-0 { background: rgba(99, 102, 241, 0.08); }
.inv-heatmap-cell.lvl-1 { background: rgba(99, 102, 241, 0.28); }
.inv-heatmap-cell.lvl-2 { background: rgba(99, 102, 241, 0.65); }
.inv-heatmap-cell.lvl-3 { background: #3b82f6; }

[data-theme="dark"] .inv-heatmap-cell.lvl-0 { background: rgba(99, 102, 241, 0.12); }
[data-theme="dark"] .inv-heatmap-cell.lvl-1 { background: rgba(99, 102, 241, 0.35); }
[data-theme="dark"] .inv-heatmap-cell.lvl-2 { background: rgba(99, 102, 241, 0.75); }
[data-theme="dark"] .inv-heatmap-cell.lvl-3 { background: #3b82f6; }

.inv-heatmap-month-labels {
  display: grid;
  grid-template-columns: 24px repeat(12, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.inv-heatmap-month-name {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
}
.inv-heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}
.inv-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.inv-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* Item Inspector Card */
.inv-item-badge-pill {
  background: var(--bg-hover);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.inv-item-id-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-primary);
}
.inv-item-attr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px dashed var(--color-border);
  font-size: 12px;
}
.inv-item-attr-row:last-child {
  border-bottom: none;
}
.inv-item-attr-key {
  color: var(--color-text-muted);
}
.inv-item-attr-val {
  font-weight: 600;
  color: var(--color-text-primary);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}
.inv-operator-row {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.inv-operator-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inv-operator-avatar {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.inv-operator-avatar svg,
.inv-operator-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

/* Logistics / Route Map Card (GridBase Design System) */
.inv-map-card {
  padding: 0 !important;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 310px;
}
.inv-map-leaflet-wrapper {
  width: 100%;
  height: 100%;
  min-height: 310px;
  position: relative;
  background: var(--bg-card);
}
#inv-leaflet-map {
  width: 100%;
  height: 100%;
  min-height: 310px;
  z-index: 1;
}
.leaflet-container {
  font-family: inherit;
  background: var(--bg-card) !important;
}
/* Leaflet zoom controls styled like GridBase */
.leaflet-bar {
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
  box-shadow: var(--shadow-sm) !important;
}
.leaflet-bar a {
  background-color: var(--bg-card) !important;
  color: var(--color-text-primary) !important;
  border-bottom: 1px solid var(--color-border) !important;
  width: 28px !important;
  height: 28px !important;
  line-height: 28px !important;
  font-size: 14px !important;
}
.leaflet-bar a:hover {
  background-color: var(--bg-hover) !important;
  color: var(--color-text-primary) !important;
}
.leaflet-control-zoom {
  border: none !important;
  margin-right: 14px !important;
  margin-bottom: 14px !important;
}
/* Floating Location Badge matching GridBase Design System */
.inv-map-floating-badge {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 400;
  background: var(--bg-card);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md);
  color: var(--color-text-primary);
  max-width: calc(100% - 70px);
}
.inv-map-badge-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.inv-map-badge-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-muted);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.inv-map-badge-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.2;
  margin-top: 2px;
}
/* Top action button (expand/re-center) matching .btn-icon */
.inv-map-top-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 6px;
}
.inv-map-top-action {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast) ease;
}
.inv-map-top-action:hover {
  background: var(--bg-hover);
  color: var(--color-text-primary);
  border-color: var(--color-primary);
}
/* Pulse Markers */
.map-pulse-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.85);
  cursor: pointer;
}
.map-pulse-marker-dest {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.85);
  cursor: pointer;
}
.map-pulse-marker-mid {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.85);
  cursor: pointer;
}
.wh-picker-custom-pin {
  background: transparent !important;
  border: none !important;
}
.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--color-text-primary) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-md) !important;
  font-size: 11.5px !important;
  box-shadow: var(--shadow-md) !important;
}
.leaflet-popup-tip {
  background: var(--bg-card) !important;
}

/* Route Map Pop-up Modal (GridBase Design System) */
.route-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.route-modal-card {
  width: 100%;
  max-width: 1100px;
  height: 85vh;
  max-height: 840px;
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.route-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--bg-card);
  gap: 16px;
  flex-shrink: 0;
}

.route-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.route-modal-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-lg);
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.route-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.route-modal-subtitle {
  font-size: 11.5px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.route-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.route-modal-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.route-modal-sidebar {
  width: 370px;
  min-width: 330px;
  max-width: 400px;
  background: var(--bg-card);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.route-modal-sidebar-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-border);
  background: var(--bg-surface, var(--bg-card));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.route-modal-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

.route-modal-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.route-node-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  background: var(--bg-surface, var(--bg-card));
  transition: all var(--transition-fast) ease;
  cursor: pointer;
  position: relative;
}

.route-node-card:hover {
  border-color: var(--color-primary);
  background: var(--bg-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.route-node-card.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1.5px var(--color-primary);
  background: var(--bg-hover);
}

.route-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.route-node-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.route-node-badge.origin {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.route-node-badge.transit {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.route-node-badge.dest {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.route-node-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.25;
}

.route-node-address {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 4px;
  line-height: 1.35;
}

.route-node-coords {
  font-size: 10.5px;
  font-family: monospace;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.route-node-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.btn-nav-app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--bg-card);
  color: var(--color-text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast) ease;
  line-height: 1;
}

.btn-nav-app:hover {
  background: var(--bg-hover);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Google Maps Official Button */
.btn-nav-app.btn-nav-google {
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}

.btn-nav-app.btn-nav-google:hover {
  background: #f8fafd;
  border-color: #4285f4;
  color: #1a73e8;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(66, 133, 244, 0.22);
}

[data-theme="dark"] .btn-nav-app.btn-nav-google {
  background: #202124;
  color: #e8eaed;
  border: 1px solid #3c4043;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .btn-nav-app.btn-nav-google:hover {
  background: #303134;
  border-color: #8ab4f8;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Waze Official Button */
.btn-nav-app.btn-nav-waze {
  background: #33ccff;
  color: #0b1329;
  border: 1px solid #00bdf2;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(51, 204, 255, 0.3);
}

.btn-nav-app.btn-nav-waze:hover {
  background: #00c4f4;
  border-color: #0099cc;
  color: #000000;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 196, 244, 0.45);
}

.btn-nav-app.btn-nav-waze svg {
  fill: #0b1329;
}

.btn-nav-app.btn-nav-waze:hover svg {
  fill: #000000;
}

.btn-nav-app.btn-nav-share {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--color-primary);
}

.btn-nav-app.btn-nav-share:hover {
  background: var(--color-primary);
  color: #ffffff;
}

.route-modal-footer-stats {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  background: var(--bg-surface, var(--bg-card));
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-text-muted);
}

.route-modal-map-wrap {
  flex: 1;
  position: relative;
  background: var(--bg-card);
  min-height: 0;
}

#inv-modal-leaflet-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.route-modal-map-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Operations Activities Toolbar & Filter Pills */
.inv-activities-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}
.inv-filter-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-hover);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  padding: 3px;
  gap: 3px;
}
.inv-filter-btn {
  background: transparent;
  border: none;
  border-radius: 9999px;
  padding: 5px 13px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast) ease;
}
.inv-filter-btn:hover {
  color: var(--color-text-primary);
}
.inv-filter-btn.active {
  background: var(--bg-card);
  color: var(--color-text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .inv-filter-btn.active {
  background: var(--bg-card);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.inv-search-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.inv-search-icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
  pointer-events: none;
}
.inv-search-input {
  background: var(--bg-hover);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  padding: 6px 12px 6px 30px;
  font-size: 12px;
  color: var(--color-text-primary);
  outline: none;
  transition: all var(--transition-fast) ease;
  width: 220px;
}
.inv-search-input:focus {
  border-color: #3b82f6;
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.inv-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}
.inv-status-pill::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.inv-status-pill.delivered {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.inv-status-pill.received {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.inv-status-pill.in_transit,
.inv-status-pill.transferred {
  background: rgba(14, 165, 233, 0.1);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.25);
}
.inv-status-pill.adjustment {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.25);
}
[data-theme="dark"] .inv-status-pill.delivered {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}
[data-theme="dark"] .inv-status-pill.received {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}
[data-theme="dark"] .inv-status-pill.in_transit,
[data-theme="dark"] .inv-status-pill.transferred {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}
[data-theme="dark"] .inv-status-pill.adjustment {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}




/* ═══════════════════════════════════════════════════════════

   DATA TABLE — Premium Table Component

   ═══════════════════════════════════════════════════════════ */

.table-outer {
  background-color: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.table-outer:has(.table-wrapper):not(:has(.be-table-mount)) {
  background-color: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-outer:has(.be-table-mount) .table-toolbar {
  background: transparent;
  border: none;
  padding: 0 0 16px 0;
}

.form-card {

  background-color: var(--bg-card);

  border: 1px solid var(--color-border);

  border-radius: var(--radius-xl);

  box-shadow: var(--shadow-sm);

}

.table-toolbar {

  padding: var(--spacing-lg) var(--spacing-xl);

  border-bottom: 1px solid var(--color-border);

  display: flex;

  align-items: center;

  justify-content: space-between;

  background-color: var(--bg-card);

}

.table-wrapper { overflow-x: auto; width: 100%; }

.mobile-card-list { display: none; }

.mobile-tab-bar { display: none; }



.data-table { width: 100%; border-collapse: collapse; text-align: left; }

.data-table th {

  background-color: var(--bg-card);

  padding: var(--spacing-md) var(--spacing-xl);

  font-size: 11px; font-weight: 600;

  color: var(--color-text-muted);

  text-transform: uppercase;

  letter-spacing: 0.05em;

  border-bottom: 1px solid var(--color-border);

  user-select: none;

}

.data-table td {

  padding: var(--spacing-md) var(--spacing-xl);

  border-bottom: 1px solid var(--color-border);

  color: var(--color-text-secondary);

  font-size: 13px;

  vertical-align: middle;

}

.data-table tbody tr { transition: var(--transition-fast); }

.data-table tbody tr:hover { background-color: var(--bg-hover); }

.data-table tbody tr:last-child td { border-bottom: none; }



/* Table Cell Styles */

.user-cell { display: flex; align-items: center; gap: var(--spacing-md); }

.user-avatar-sm {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.user-avatar-sm svg,
.user-avatar-sm img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.user-details { display: flex; flex-direction: column; }

.user-name { font-size: 13px; font-weight: 600; color: var(--color-text-primary); }

.user-email { font-size: 12px; color: var(--color-text-muted); }



.link-id {

  font-weight: 500;

  color: var(--color-text-primary);

  text-decoration: underline;

  text-underline-offset: 3px;

  text-decoration-color: var(--color-text-muted);

  transition: var(--transition-fast);

}

.link-id:hover { color: var(--color-primary-hover); text-decoration-color: var(--color-text-primary); }



.row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition-fast); }

.data-table tbody tr:hover .row-actions { opacity: 1; }



/* ═══════════════════════════════════════════════════════════

   BADGES — Status Pills

   ═══════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  line-height: 1;
  letter-spacing: 0.02em;
}

.badge-active, .badge-paid, .badge-accepted { background-color: var(--color-success-bg); color: var(--color-success-text); border: 1px solid rgba(16,185,129,0.1); }

.badge-inactive, .badge-overdue, .badge-rejected { background-color: var(--color-danger-bg); color: var(--color-danger-text); border: 1px solid rgba(239,68,68,0.1); }

.badge-onboarding, .badge-partial, .badge-paused { background-color: var(--color-warning-bg); color: var(--color-warning-text); border: 1px solid rgba(245,158,11,0.1); }

.badge-draft, .badge-cancelled { background-color: var(--bg-hover); color: var(--color-text-secondary); border: 1px solid var(--color-border); }

.badge-sent { background-color: var(--blue-light); color: var(--blue); border: 1px solid rgba(37,99,235,0.1); }

.badge-viewed, .badge-converted { background-color: var(--purple-light); color: var(--purple); border: 1px solid rgba(124,58,237,0.1); }



/* ═══════════════════════════════════════════════════════════

   FORMS & INPUTS

   ═══════════════════════════════════════════════════════════ */

.form-group { margin-bottom: 16px; }

.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--color-text-secondary); margin-bottom: 6px; }

.form-control {

  width: 100%; padding: 9px 14px;

  border: 1px solid var(--color-border);

  border-radius: var(--radius-md);

  font-family: inherit; font-size: 13px;

  color: var(--color-text-primary);

  background: var(--bg-card);

  transition: var(--transition-fast);

}

.form-control:focus { outline: none; border-color: var(--color-border-hover); box-shadow: 0 0 0 2px rgba(17,24,39,0.05); }

.form-control::placeholder { color: var(--color-text-muted); }

select.form-control {

  appearance: none;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239CA3AF' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");

  background-repeat: no-repeat;

  background-position: right 14px center;

  padding-right: 32px;

}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-hint { font-size: 11px; color: var(--color-text-muted); margin-top: 4px; }



/* ═══════════════════════════════════════════════════════════

   CARDS (Generic wrapper — still used in some places)

   ═══════════════════════════════════════════════════════════ */

.card {

  background: var(--bg-card);

  border: 1px solid var(--color-border);

  border-radius: var(--radius-xl);

  box-shadow: var(--shadow-sm);

  transition: border-color var(--transition-fast);

  margin-bottom: var(--spacing-xl);

}

.card:hover { border-color: var(--color-border-hover); }

.card-body { padding: var(--spacing-xl); }

.card-header {

  padding: var(--spacing-lg) var(--spacing-xl);

  border-bottom: 1px solid var(--color-border);

  display: flex; align-items: center; justify-content: space-between;

}

.card-title { font-size: 15px; font-weight: 600; color: var(--color-text-primary); }



/* ═══════════════════════════════════════════════════════════

   MODALS

   ═══════════════════════════════════════════════════════════ */

.modal-overlay {

  position: fixed; inset: 0;

  background: rgba(0,0,0,0.35);

  backdrop-filter: blur(4px);

  z-index: 200;

  display: none; align-items: center; justify-content: center;

  animation: fadeIn .2s ease;

}

.modal-overlay.open { display: flex; }

.modal {

  background: var(--bg-card);

  border: 1px solid var(--color-border);

  border-radius: var(--radius-xl);

  box-shadow: var(--shadow-lg);

  width: 90%; max-width: 640px; max-height: 90vh;

  display: flex; flex-direction: column;

  animation: slideUp .25s ease;

}

.modal-lg { max-width: 860px; }

.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--color-border); display: flex; align-items: center; justify-content: space-between; }

.modal-title { font-size: 17px; font-weight: 700; color: var(--color-text-primary); }

.modal-body { padding: 24px; overflow-y: auto; flex: 1; }

.modal-footer { padding: 16px 24px; border-top: 1px solid var(--color-border); display: flex; justify-content: flex-end; gap: 8px; }



/* ═══════════════════════════════════════════════════════════

/* ═══════════════════════════════════════════════════════════
   TOAST SYSTEM (Centered HUD with Ambient Radial Blur)
   ═══════════════════════════════════════════════════════════ */

/* Ambient Radial Blur Vignette - Disabled to avoid stuck backdrop blur artifacts */
.toast-ambient-backdrop {
  display: none !important;
}

.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  max-width: 440px;
  width: calc(100vw - 32px);
}

.toast {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 11px 12px;
  border-radius: 14px;
  min-width: 270px;
  max-width: 440px;

  /* Glassmorphism & Discreet Depth */
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 
    0 16px 36px -8px rgba(0, 0, 0, 0.14),
    0 6px 14px -3px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);

  color: var(--color-text-primary);
  font-family: inherit;

  /* Smooth Entrance */
  animation: toastSlideIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
}

[data-theme="dark"] .toast {
  background: rgba(20, 21, 27, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 20px 48px -10px rgba(0, 0, 0, 0.75),
    0 6px 18px -4px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.toast.toast-has-title {
  align-items: flex-start;
  padding-top: 11px;
  padding-bottom: 13px;
}

.toast:hover {
  transform: scale(1.02);
  box-shadow: 
    0 22px 52px -10px rgba(0, 0, 0, 0.2),
    0 8px 18px -3px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .toast:hover {
  box-shadow: 
    0 24px 56px -10px rgba(0, 0, 0, 0.85),
    0 8px 22px -4px rgba(0, 0, 0, 0.6);
}

.toast.toast-hiding {
  animation: toastSlideOut 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* Eliminate loud top accent line */
.toast-accent-line {
  display: none;
}

/* Icon Container: Compact, elegant pill/circle */
.toast-icon-wrapper {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.15s ease;
}

.toast.toast-has-title .toast-icon-wrapper {
  margin-top: 1px;
}

.toast-icon-wrapper svg {
  width: 14px;
  height: 14px;
}

.toast:hover .toast-icon-wrapper {
  transform: scale(1.06);
}

/* Content Area */
.toast-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5px;
}

.toast-title {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--color-text-primary);
}

[data-theme="dark"] .toast-title {
  color: #f4f4f5;
}

.toast-message {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--color-text-secondary);
  word-break: break-word;
}

[data-theme="dark"] .toast-message {
  color: #a1a1aa;
}

.toast-message.toast-single {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.3;
}

[data-theme="dark"] .toast-message.toast-single {
  color: #e4e4e7;
}

/* Close Button: Subtle, minimal */
.toast-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  opacity: 0.35;
  transition: all 0.15s ease;
  margin-right: -2px;
}

.toast.toast-has-title .toast-close {
  margin-top: 1px;
}

.toast-close:hover {
  opacity: 0.9;
  color: var(--color-text-primary);
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .toast-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f4f4f5;
}

/* Progress Bar at Bottom: Hairline, subtle indicator */
.toast-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.5px;
  background: rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

[data-theme="dark"] .toast-progress-bar {
  background: rgba(255, 255, 255, 0.04);
}

.toast-progress-fill {
  height: 100%;
  width: 100%;
  transform-origin: left;
  opacity: 0.45;
  animation: toastProgress linear forwards;
}

.toast:hover .toast-progress-fill {
  animation-play-state: paused;
}

.toast-progress-indeterminate {
  width: 100% !important;
  animation: toastShimmer 1.8s ease-in-out infinite !important;
}

/* ── Type Variations (Discreet & Attractive) ── */

/* 1. INFO */
.toast-info .toast-icon-wrapper {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}
[data-theme="dark"] .toast-info .toast-icon-wrapper {
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
}
.toast-info .toast-progress-fill {
  background: #3b82f6;
}

/* 2. SUCCESS */
.toast-success .toast-icon-wrapper {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}
[data-theme="dark"] .toast-success .toast-icon-wrapper {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
}
.toast-success .toast-progress-fill {
  background: #10b981;
}

/* 3. WARNING */
.toast-warning .toast-icon-wrapper {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}
[data-theme="dark"] .toast-warning .toast-icon-wrapper {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}
.toast-warning .toast-progress-fill {
  background: #f59e0b;
}

/* 4. ERROR */
.toast-error .toast-icon-wrapper {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
[data-theme="dark"] .toast-error .toast-icon-wrapper {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
}
.toast-error .toast-progress-fill {
  background: #ef4444;
}

/* ── Keyframe Animations ── */
@keyframes toastSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }
}

@keyframes toastProgress {
  0% { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}

@keyframes toastShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes toastSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.toast-spinner {
  animation: toastSpin 1s linear infinite;
}



/* ═══════════════════════════════════════════════════════════

   PAGINATION

   ═══════════════════════════════════════════════════════════ */

.pagination {

  display: flex; align-items: center; justify-content: space-between;

  padding: var(--spacing-md) var(--spacing-xl);

  border-top: 1px solid var(--color-border);

  background-color: var(--bg-card);

}

.pagination-info { font-size: 13px; color: var(--color-text-secondary); }

.pagination-nav { display: flex; align-items: center; gap: var(--spacing-xs); }

.pagination-btn {

  width: 28px; height: 28px;

  border: 1px solid var(--color-border);

  border-radius: var(--radius-md);

  display: inline-flex; align-items: center; justify-content: center;

  cursor: pointer; transition: var(--transition-fast);

  background-color: var(--bg-card); color: var(--color-text-secondary);

  font-size: 12px; font-weight: 500;

}

.pagination-btn:hover { background-color: var(--bg-hover); color: var(--color-text-primary); border-color: var(--color-border-hover); }

.pagination-btn.active { background-color: var(--bg-hover); color: var(--color-text-primary); border-color: var(--color-border-hover); font-weight: 600; }



/* ═══════════════════════════════════════════════════════════

   UTILITY CLASSES

   ═══════════════════════════════════════════════════════════ */

.flex { display: flex; }

.flex-col { flex-direction: column; }

.flex-between { display: flex; align-items: center; justify-content: space-between; }

.align-center { align-items: center; }

.justify-between { justify-content: space-between; }

.flex-1 { flex: 1; }

.gap-xs { gap: var(--spacing-xs); }

.gap-sm { gap: var(--spacing-sm); }

.gap-md { gap: var(--spacing-md); }

.gap-lg { gap: var(--spacing-lg); }



.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-xl); }

.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--spacing-xl); }

.dashboard-grid { display: grid; grid-template-columns: 6.5fr 3.5fr; gap: var(--spacing-xl); }



.mt-16 { margin-top: 16px; }

.mt-24 { margin-top: 24px; }

.mb-16 { margin-bottom: 16px; }

.mb-24 { margin-bottom: 24px; }

.text-right { text-align: right; }

.text-center { text-align: center; }

.text-left { text-align: left; }

.text-muted { color: var(--color-text-muted); }

.text-red { color: var(--red); }

.text-mono { font-family: 'JetBrains Mono', monospace; }

.font-semibold { font-weight: 600; }

.font-bold { font-weight: 700; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }



.text-xs { font-size: 11px; }

.text-sm { font-size: 13px; }

.text-lg { font-size: 16px; }

.text-xl { font-size: 20px; }

.text-2xl { font-size: 24px; }



/* ═══════════════════════════════════════════════════════════

   ANIMATIONS

   ═══════════════════════════════════════════════════════════ */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@keyframes slideIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  aspect-ratio: 1 / 1;
  border: 2.5px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  box-sizing: border-box;
  flex-shrink: 0;
  vertical-align: middle;
}

.spinner.mx-auto,
.mx-auto.spinner {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.spinner.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.spinner.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* Spinner inside buttons */
.btn .spinner,
button .spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
  vertical-align: -2px;
}

.btn .spinner:not(:only-child),
button .spinner:not(:only-child) {
  margin-right: 6px;
}

.btn-primary .spinner,
.btn-danger .spinner {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
}

.mx-auto { margin-left: auto; margin-right: auto; }



/* ═══════════════════════════════════════════════════════════

   LOGIN PAGE

   ═══════════════════════════════════════════════════════════ */

.login-page {
  min-height: 100vh; display: flex; align-items: stretch;
  background: #ffffff;
}

/* Left panel — form */
.login-left {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 60px 64px; max-width: 520px; min-width: 340px;
  position: relative;
}
.login-brand {
  position: absolute; top: 32px; left: 64px;
}
.login-brand img { height: 79px; object-fit: contain; }
.login-brand-name { display: none; font-size: 18px; font-weight: 700; color: #111827; letter-spacing: -0.3px; }
.login-form-wrap { width: 100%; max-width: 380px; }
.login-title { font-size: 28px; font-weight: 700; margin: 0 0 6px; color: #111827; letter-spacing: -0.5px; }
.login-subtitle { font-size: 14px; color: #6B7280; margin: 0 0 32px; line-height: 1.5; }
.login-error { background: #FEF2F2; color: #DC2626; padding: 10px 14px; border-radius: 10px; font-size: 12px; margin-bottom: 16px; display: none; border: 1px solid rgba(220,38,38,.12); }
.login-field { margin-bottom: 20px; }
.login-field label {
  display: block; font-size: 13px; font-weight: 600; color: #374151;
  margin-bottom: 6px;
}
.login-field input {
  width: 100%; padding: 12px 14px; border: 1.5px solid #E5E7EB;
  border-radius: 10px; font-size: 14px; color: #111827;
  background: #FFFFFF; outline: none; transition: border-color .2s;
  font-family: inherit;
}
.login-field input:focus { border-color: #0B484C; box-shadow: 0 0 0 3px rgba(11,72,76,0.08); }
.login-field input::placeholder { color: #9CA3AF; }
.login-submit {
  width: 100%; padding: 13px 24px; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #0B484C 0%, #1a6b5a 50%, #0B484C 100%);
  background-size: 200% 200%; animation: loginGrad 4s ease infinite;
  transition: transform .15s, box-shadow .15s;
  margin-top: 8px;
}
.login-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(11,72,76,0.25); }
.login-submit:active { transform: translateY(0); }
@keyframes loginGrad { 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }
.login-footer { margin-top: 28px; font-size: 12px; color: #9CA3AF; }
.login-footer a { color: inherit; text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }
.login-footer span { color: #0B484C; font-weight: 600; }

/* Right panel — decorative */
.login-right {
  flex: 1.1; display: flex; flex-direction: column; justify-content: center;
  align-items: center; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #0a3d3f 0%, #0B484C 30%, #0d5249 60%, #0a3d3f 100%);
  padding: 60px;
}
.login-right::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(0,0,0,0.15) 0%, transparent 50%);
}
.login-hero-text {
  position: relative; z-index: 1; text-align: left; width: 100%; max-width: 460px;
}
.login-hero-text h2 {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: clamp(36px, 5vw, 52px); font-weight: 400; font-style: italic;
  color: rgba(255,255,255,0.92); line-height: 1.15; margin: 0 0 12px;
  letter-spacing: -0.5px;
}
.login-hero-text h2 span { display: block; font-style: normal; color: rgba(255,255,255,0.55); }
.login-hero-sub {
  font-size: 14px; color: rgba(255,255,255,0.45); line-height: 1.6; max-width: 340px;
  margin-top: 20px;
}

/* Floating card decoration */
.login-float-card {
  position: relative; z-index: 1; margin-top: 48px;
  background: rgba(255,255,255,0.95); border-radius: 16px;
  padding: 24px 28px; width: 100%; max-width: 340px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: loginFloat 6s ease-in-out infinite;
}
@keyframes loginFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.login-float-label { font-size: 11px; color: #6B7280; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.login-float-amount { font-size: 32px; font-weight: 700; color: #111827; margin: 6px 0 2px; letter-spacing: -0.5px; }
.login-float-sub { font-size: 12px; color: #0B484C; font-weight: 600; }
.login-float-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid #E5E7EB;
}
.login-float-row-item { display: flex; align-items: center; gap: 10px; }
.login-float-dot {
  width: 36px; height: 36px; border-radius: 10px; background: #0B484C;
  display: flex; align-items: center; justify-content: center;
}
.login-float-dot svg { width: 18px; height: 18px; color: #fff; }
.login-float-row-label { font-size: 12px; color: #6B7280; }
.login-float-row-val { font-size: 14px; font-weight: 700; color: #111827; }

/* Second mini floating card */
.login-float-mini {
  position: relative; z-index: 1; margin-top: 16px;
  background: rgba(255,255,255,0.85); border-radius: 12px;
  padding: 14px 20px; max-width: 260px; width: 100%;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  animation: loginFloat 6s ease-in-out 1s infinite;
  align-self: flex-end;
}
.login-float-mini-icon {
  width: 32px; height: 32px; border-radius: 8px; background: #0B484C;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.login-float-mini-icon svg { width: 16px; height: 16px; color: #fff; }
.login-float-mini-text { font-size: 12px; color: #374151; font-weight: 500; }
.login-float-mini-val { font-size: 13px; font-weight: 700; color: #111827; }

/* Mobile: hero on top + form below */
@media (max-width: 768px) {
  .login-page {
    flex-direction: column;
    min-height: 100vh; min-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Hero section — visible on mobile, reordered to top */
  .login-right {
    display: flex !important;
    flex-direction: column !important;
    flex: none !important;
    order: -1;
    width: 100%;
    height: auto !important;
    overflow: visible !important;
    padding: 40px 24px 32px;
    border-radius: 0 0 32px 32px;
    align-items: flex-start;
    justify-content: flex-start;
  }
  .login-right::before { border-radius: 0 0 32px 32px; }

  .login-hero-text {
    max-width: 100%; width: 100%; text-align: left;
    display: block !important; position: relative; z-index: 2;
  }
  .login-hero-text h2 {
    font-size: 28px; line-height: 1.2; margin-bottom: 8px;
    color: rgba(255,255,255,0.92) !important;
  }
  .login-hero-sub {
    font-size: 11px; max-width: 280px; margin-top: 6px;
    color: rgba(255,255,255,0.5); line-height: 1.4;
  }

  /* Floating stat card — compact */
  .login-float-card {
    margin-top: 24px; padding: 18px 20px;
    max-width: 100%; width: 100%;
    border-radius: 14px;
    animation: none !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    position: relative; z-index: 2;
    display: block !important;
  }
  .login-float-amount { font-size: 26px; }
  .login-float-label { font-size: 10px; }
  .login-float-sub { font-size: 11px; }
  .login-float-row { margin-top: 12px; padding-top: 12px; }
  .login-float-dot { width: 30px; height: 30px; border-radius: 8px; }
  .login-float-dot svg { width: 15px; height: 15px; }
  .login-float-row-label { font-size: 11px; }
  .login-float-row-val { font-size: 13px; }

  /* Mini floating card — compact */
  .login-float-mini {
    margin-top: 12px; padding: 12px 16px;
    max-width: 220px; border-radius: 10px;
    animation: none !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    align-self: flex-start;
    position: relative; z-index: 2;
    display: flex !important;
  }
  .login-float-mini-icon { width: 28px; height: 28px; border-radius: 7px; }
  .login-float-mini-icon svg { width: 14px; height: 14px; }
  .login-float-mini-text { font-size: 11px; }
  .login-float-mini-val { font-size: 12px; }

  /* Form section — below hero */
  .login-left {
    max-width: 100%; min-width: 0;
    padding: 0 0 32px 0;
    min-height: auto;
    justify-content: flex-start;
    flex: none;
    order: 1;
  }
  .login-left::before { display: none; }

  .login-brand {
    position: static;
    display: flex; align-items: center; justify-content: center;
    padding: 24px 16px 0;
  }
  .login-brand img { height: 79px; }

  .login-form-wrap {
    position: relative; z-index: 1;
    background: #fff;
    margin: 0; padding: 24px 16px 28px;
    border-radius: 0;
    box-shadow: none;
    max-width: 100%;
  }
  .login-title { font-size: 22px; text-align: center; }
  .login-subtitle { font-size: 13px; text-align: center; margin-bottom: 24px; color: #6B7280; }
  .login-field { margin-bottom: 16px; }
  .login-field label { font-size: 12px; }
  .login-field input { padding: 14px 14px; font-size: 16px; border-radius: 10px; }
  .login-submit { padding: 14px 24px; font-size: 16px; border-radius: 10px; }
  .login-footer { text-align: center; margin-top: 20px; font-size: 11px; }

  /* 2FA specific */
  #qr-canvas { max-width: 140px !important; max-height: 140px !important; }
}

/* iPhone SE / small phones */
@media (max-width: 375px) {
  .login-right { padding: 32px 20px 24px; }
  .login-hero-text h2 { font-size: 24px; }
  .login-float-card { padding: 14px 16px; }
  .login-float-amount { font-size: 22px; }
  .login-form-wrap { margin: 0 16px; padding: 20px 16px 24px; }
  .login-title { font-size: 20px; }
}

.login-card .form-control { background: var(--bg-app); }



/* ═══════════════════════════════════════════════════════════

   RESPONSIVE

   ═══════════════════════════════════════════════════════════ */

.sidebar-toggle { display: none; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35); backdrop-filter: blur(2px); z-index: 99; }

.sidebar-overlay.open { display: block; }



@media (max-width: 1024px) {

  .sidebar { position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; transform: translateX(-100%); box-shadow: none; }

  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }

  .main-content { margin-left: 0; }

  .sidebar-toggle { display: flex; }

  .grid-metrics { grid-template-columns: repeat(2, 1fr); }

  .grid-2, .grid-3, .dashboard-grid { grid-template-columns: 1fr; }

  .form-row { grid-template-columns: 1fr; }

}



@media (max-width: 768px) {

  html, body { max-width: 100%; overflow-x: hidden; width: 100%; }



  .sidebar, .sidebar-overlay, .sidebar-toggle { display: none !important; }

  .app-container, .app-layout {
    width: 100%;
    max-width: 100vw;
    height: auto !important;
    min-height: 100dvh;
    overflow: visible !important;
    flex-direction: column;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
    height: auto !important;
    overflow-y: visible !important;
    padding: 12px 12px calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .workspace-panel { border-radius: var(--radius-lg); padding: var(--spacing-lg); }



  .topbar { display: flex !important; flex-direction: row !important; gap: 8px; align-items: center !important; justify-content: space-between !important; margin-bottom: var(--spacing-md); }

  .topbar-center, .topbar .search-wrapper { display: none !important; }

  #greeting-text:not(.greeting-hidden) {
    display: inline-flex !important;
    align-items: center;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }



  .page-title { font-size: 20px; }

  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }



  .grid-metrics { grid-template-columns: 1fr; }

  .metric-card { padding: var(--spacing-md) var(--spacing-lg); }



  .table-outer { border-radius: var(--radius-lg); }

  .data-table th, .data-table td { padding: var(--spacing-sm) var(--spacing-md); font-size: 12px; }

  .table-toolbar { padding: var(--spacing-md) var(--spacing-lg); flex-wrap: wrap; gap: 8px; }



  .form-control { padding: 12px 14px; font-size: 14px; }

  .login-card { margin: 16px; padding: 28px; }

  .modal { width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; }



  .mobile-tab-bar {

    display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 56px;

    background: var(--bg-card); border-top: 1px solid var(--color-border);

    justify-content: space-around; align-items: center; z-index: 1000;

  }

  .tab-link {

    display: flex; flex-direction: column; align-items: center; justify-content: center;

    color: var(--color-text-muted); text-decoration: none;

    font-size: 10px; font-weight: 500; flex: 1; height: 100%;

    transition: color var(--transition-fast);

  }

  .tab-link.active { color: var(--color-primary); }

  .tab-link svg { width: 20px; height: 20px; margin-bottom: 3px; }

  .page-header { flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
}

@media (min-width: 641px) { .mobile-tab-bar { display: none !important; } }



/* ═══════════════════════════════════════════════════════════

   ADDITIONAL UTILITIES & COMPONENTS

   ═══════════════════════════════════════════════════════════ */



/* Spacing helpers */

.mb-24 { margin-bottom: 24px; }

.mt-24 { margin-top: 24px; }

.mb-16 { margin-bottom: 16px; }

.mt-16 { margin-top: 16px; }



/* Dashboard grid */

.dashboard-grid {

    display: grid;

    grid-template-columns: 2fr 1fr;

    gap: var(--spacing-xl);

    margin-top: var(--spacing-xl);

}

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



/* Row actions - shown on hover */

.row-actions {

    display: flex;

    gap: 4px;

    align-items: center;

    justify-content: flex-end;

    opacity: 0;

    transition: opacity var(--transition-fast);

}

tr:hover .row-actions { opacity: 1; }

@media (max-width: 768px) { .row-actions { opacity: 1; } }



/* Modal overlay */

.modal-overlay {

    position: fixed;

    top: 0; left: 0; right: 0; bottom: 0;

    background: rgba(0,0,0,0.45);

    backdrop-filter: blur(4px);

    display: flex;

    align-items: center;

    justify-content: center;

    z-index: 9999;

    animation: fadeIn var(--transition-base);

}

.modal {

    background: var(--bg-card);

    border-radius: var(--radius-xl);

    box-shadow: 0 24px 80px rgba(0,0,0,0.25);

    width: 90vw;

    max-width: 560px;

    animation: slideUp var(--transition-base);

}

.modal-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 20px var(--spacing-xl) 0;

}

.modal-title { font-size: 16px; font-weight: 700; color: var(--color-text-primary); }

.modal-body { padding: var(--spacing-xl); }

.modal-footer {

    display: flex;

    gap: 12px;

    justify-content: flex-end;

    padding: 0 var(--spacing-xl) 20px;

}



/* Additional badge variants */

.badge-active   { background: #D1FAE5; color: #065F46; }

.badge-inactive { background: #F3F4F6; color: #6B7280; }

.badge-onboarding { background: #FEF3C7; color: #92400E; }

.badge-cancelled  { background: #FEE2E2; color: #991B1B; }

.badge-converted  { background: #DBEAFE; color: #1E40AF; }

.badge-expired    { background: #FEE2E2; color: #991B1B; }

.badge-rejected   { background: #FEE2E2; color: #991B1B; }



/* Purple metric icon box */

.metric-icon-box.purple {

    background: #F3E8FF;

    color: #7C3AED;

}



/* Grid-2 */

.grid-2 {

    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 16px;

}

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



/* Text helpers */

.text-center { text-align: center; }

.text-right  { text-align: right; }

.text-muted  { color: var(--color-text-muted); }

.text-red    { color: var(--color-danger-icon); }

.font-semibold { font-weight: 600; }



/* ═══════════════════════════════════════════════════════════

   PRINT & SCROLLBAR

   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   PRINT & SCROLLBAR: INFORME EJECUTIVO DE INVENTARIO
   ═══════════════════════════════════════════════════════════ */
.inv-print-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    -webkit-backdrop-filter: blur(8px) saturate(180%);
    backdrop-filter: blur(8px) saturate(180%);
    -webkit-overflow-scrolling: touch;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding: 24px 16px;
}

.inv-print-modal-toolbar {
    width: 100%;
    max-width: 820px;
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    box-shadow: var(--shadow-lg);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 10;
}

.inv-print-paper-sheet {
    width: 100%;
    max-width: 820px;
    background: #ffffff !important;
    color: #0f172a !important;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    padding: 38px 44px;
    margin-bottom: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.45;
}

.inv-print-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 16px 0;
    font-size: 11px;
}

.inv-print-table th {
    background: #f1f5f9;
    color: #1e293b;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 9.5px;
    letter-spacing: 0.5px;
    padding: 7px 10px;
    border-bottom: 2px solid #cbd5e1;
    border-top: 1px solid #e2e8f0;
}

.inv-print-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    vertical-align: middle;
}

.inv-print-table tr:nth-child(even) td {
    background: #fafafa;
}

.inv-print-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 14px 0 18px 0;
}

.inv-print-kpi-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 12px;
}

.inv-print-kpi-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
    margin-bottom: 4px;
}

.inv-print-kpi-val {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.02em;
}

.inv-print-kpi-sub {
    font-size: 9.5px;
    color: #475569;
    margin-top: 2px;
}

.inv-print-section-title {
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0f172a;
    border-left: 3px solid #2563eb;
    padding-left: 8px;
    margin: 18px 0 8px 0;
}

.inv-print-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 32px;
    padding-top: 10px;
    page-break-inside: avoid;
}

.inv-print-sig-line {
    border-top: 1px solid #94a3b8;
    padding-top: 6px;
    text-align: center;
}

.inv-print-sig-name {
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
}

.inv-print-sig-role {
    font-size: 9.5px;
    color: #64748b;
    margin-top: 1px;
}

@media print {
    @page {
        size: letter portrait;
        margin: 12mm 15mm;
    }

    body {
        background: #ffffff !important;
        color: #0f172a !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .sidebar,
    .topbar,
    .app-layout,
    .main-content,
    #app-content,
    .inv-print-modal-toolbar,
    .no-print,
    .btn,
    button,
    .segmented-control,
    .page-header,
    .inv-dashboard-wrapper,
    .modal-backdrop:not(#inv-print-modal-backdrop) {
        display: none !important;
    }

    .inv-print-modal-backdrop {
        position: static !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
        overflow: visible !important;
        width: 100% !important;
    }

    .inv-print-paper-sheet {
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .inv-print-avoid-break {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}

::-webkit-scrollbar { width: 5px; height: 5px; }

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

::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: var(--radius-full); }

::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }



/* ==========================================

   GridBase Bills — Bulk Actions Floating Bar Style

/* ==========================================
   GridBase Bills — Expandable Action Bar (beUI Motion)
   beui.dev/components/motion/expandable-action-bar
   ========================================== */

.bulk-actions-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px) scale(0.94);
  opacity: 0;
  pointer-events: none;
  z-index: 1200;
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.bulk-actions-bar.active {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.eab-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  border-radius: 9999px;
  background: rgba(18, 18, 20, 0.95);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.70), 0 0 0 1px rgba(255, 255, 255, 0.04);
  color: #FFFFFF;
  max-width: calc(100vw - 32px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.eab-track::-webkit-scrollbar {
  display: none;
}

[data-theme="light"] .eab-track {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.04);
  color: #111827;
}

/* Sliding Highlight */
.eab-highlight {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
  opacity: 0;
  z-index: 1;
  transition: transform 0.20s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.20s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.20s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.15s ease;
}

[data-theme="light"] .eab-highlight {
  background: rgba(0, 0, 0, 0.08);
}

/* Selection Count Pill — Clean Monochrome Theme */
.eab-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  height: 32px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  z-index: 2;
  box-sizing: border-box;
}

[data-theme="light"] .eab-count-pill {
  background: rgba(0, 0, 0, 0.05);
  color: #111827;
  border-color: rgba(0, 0, 0, 0.08);
}

.eab-count-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

[data-theme="light"] .eab-count-pill:hover {
  background: rgba(0, 0, 0, 0.09);
  border-color: rgba(0, 0, 0, 0.14);
}

.eab-count-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #FFFFFF;
  opacity: 0.85;
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

[data-theme="light"] .eab-count-dot {
  background: #111827;
  box-shadow: none;
  opacity: 0.70;
}

.eab-count-close {
  font-size: 10px;
  opacity: 0.55;
  margin-left: 2px;
  transition: opacity 0.15s ease, transform 0.15s ease;
  line-height: 1;
}

.eab-count-pill:hover .eab-count-close {
  opacity: 1;
  transform: scale(1.15);
}

/* Divider */
.eab-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 3px;
  flex-shrink: 0;
  z-index: 2;
}

[data-theme="light"] .eab-divider {
  background: rgba(0, 0, 0, 0.10);
}

/* Items Wrapper */
.eab-items-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  z-index: 2;
}

/* Action Items — Pure Monochrome / Neutral */
.eab-item {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  width: 32px;
  min-width: 32px;
  padding: 0;
  margin: 0;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
  box-sizing: border-box;
  flex-shrink: 0;
  transition: width 0.30s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.30s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.15s ease,
              transform 0.15s ease;
}

[data-theme="light"] .eab-item {
  color: rgba(0, 0, 0, 0.65);
  background: transparent;
  border: none;
}

.eab-item:hover {
  color: #FFFFFF;
}

[data-theme="light"] .eab-item:hover {
  color: #111827;
}

.eab-item:active,
.eab-item.eab-pressed {
  transform: scale(0.96);
}

/* Icon — Perfectly Centered */
.eab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  line-height: 0;
  margin: 0;
  padding: 0;
}

.eab-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
}

/* Animated Label */
.eab-label {
  display: inline-block;
  max-width: 0;
  width: 0;
  opacity: 0;
  filter: blur(3px);
  transform: translateX(-4px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
  font-size: 13px;
  font-weight: 500;
  transition: max-width 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.20s ease,
              filter 0.20s ease,
              transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
              margin-left 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animated Shortcut — Subdued / No background */
.eab-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 0;
  width: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
  font-size: 11px;
  font-weight: 400;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.45);
  background: none;
  border: none;
  transition: max-width 0.26s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.26s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.18s ease,
              margin-left 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .eab-shortcut {
  color: rgba(0, 0, 0, 0.45);
  background: none;
}

/* EXPANDED STATE (Hovered or Focused) */
.eab-track.eab-expanded .eab-item {
  width: auto;
  min-width: 32px;
  padding: 0 10px;
}

.eab-track.eab-expanded .eab-label {
  max-width: 100px;
  width: auto;
  opacity: 1;
  filter: blur(0px);
  transform: translateX(0);
  margin-left: 7px;
  pointer-events: auto;
}

.eab-track.eab-expanded .eab-shortcut {
  max-width: 36px;
  width: auto;
  opacity: 1;
  margin-left: 5px;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .bulk-actions-bar,
  .eab-track,
  .eab-label,
  .eab-shortcut,
  .eab-highlight {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    filter: none !important;
  }
}

/* ── Dynamic Logo Support ── */
/* Custom logos are rendered within premium base color capsules directly in the HTML layout */

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* e-CF Badge Styles */
.badge-ecf {
  background-color: var(--color-primary);
  color: #FFFFFF;
  font-size: 8px;
  padding: 2px 5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  display: inline-block;
  line-height: 1;
}

[data-theme="dark"] .badge-ecf {
  color: #000000 !important;
}

/* Changelog Modal Animations */
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ── 2FA Security Reminder Card ── */
.security-reminder-card {
  background-color: var(--color-warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: fadeIn 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.security-reminder-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background-color: rgba(245, 158, 11, 0.2);
  color: var(--color-warning-text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.security-reminder-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--color-text-primary);
}

.security-reminder-sub {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.security-reminder-btn {
  background-color: var(--color-primary);
  color: #FFFFFF;
  border: none;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.security-reminder-btn:hover {
  opacity: 0.9;
}

[data-theme="dark"] .security-reminder-card {
  background-color: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
}

[data-theme="dark"] .security-reminder-icon {
  background-color: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
}

[data-theme="dark"] .security-reminder-btn {
  background-color: #FAFAFA;
  color: #171717;
}

/* ═══════════════════════════════════════════════════════════
   COMMAND PALETTE (Spotlight ⌘K Modal & Backdrop Blur)
   ═══════════════════════════════════════════════════════════ */
.cmd-palette-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12vh;
  padding-left: 16px;
  padding-right: 16px;
  opacity: 0;
  animation: cmdFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-sizing: border-box;
}

@keyframes cmdFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cmd-palette-modal {
  width: 100%;
  max-width: 640px;
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.96) translateY(-12px);
  animation: cmdSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-sizing: border-box;
}

@keyframes cmdSlideIn {
  from { transform: scale(0.96) translateY(-12px); }
  to { transform: scale(1) translateY(0); }
}

.cmd-palette-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
  background: var(--bg-card);
}

.cmd-palette-header svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

.cmd-palette-header input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-primary);
  font-family: inherit;
}

.cmd-palette-header input::placeholder {
  color: var(--color-text-muted);
}

.cmd-palette-esc {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-hover);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  cursor: pointer;
}

.cmd-palette-body {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 0;
}

.cmd-group-title {
  padding: 8px 20px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-text-muted);
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
  color: var(--color-text-primary);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}

.cmd-item:hover, .cmd-item.selected {
  background: var(--color-primary-light, rgba(11, 72, 76, 0.08));
  color: var(--color-primary, #0B484C);
}

[data-theme="dark"] .cmd-item:hover, [data-theme="dark"] .cmd-item.selected {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cmd-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-primary);
}

.cmd-item.selected .cmd-item-icon {
  background: var(--color-primary);
  color: #ffffff;
}

.cmd-item-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-item-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 1px;
}

.cmd-item-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--bg-hover);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.cmd-palette-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid var(--color-border);
  background: var(--bg-hover);
  font-size: 12px;
  color: var(--color-text-muted);
}

.cmd-palette-footer kbd {
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

/* ═══════════════════════════════════════════════════════════
   MODO DEMOSTRACIÓN (bdemo.gridbase.com.do)
   ═══════════════════════════════════════════════════════════ */

/* ── Topbar Demo Pill & Dropdown (Subtle & Non-Intrusive) ── */
.demo-topbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(16, 185, 129, 0.08);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.demo-topbar-pill:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

[data-theme="dark"] .demo-topbar-pill {
  background: rgba(52, 211, 153, 0.1);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.25);
}

[data-theme="dark"] .demo-topbar-pill:hover {
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.4);
}

.demo-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: demo-pulse-anim 2s infinite;
  flex-shrink: 0;
}

[data-theme="dark"] .demo-pulse-dot {
  background-color: #34d399;
}

@keyframes demo-pulse-anim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.demo-pill-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: #10b981;
  color: #ffffff;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1;
}

[data-theme="dark"] .demo-pill-tag {
  background: #059669;
  color: #ffffff;
}

.demo-pill-sep {
  opacity: 0.5;
}

.demo-pill-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
}

.demo-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-width: calc(100vw - 32px);
  z-index: 300;
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  animation: fadeIn 0.15s ease;
  text-align: left;
}

.demo-dropdown-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.demo-dropdown-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-dropdown-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.demo-dropdown-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.demo-dropdown-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.demo-dropdown-body {
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-timer-box {
  background: var(--bg-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-timer-label {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.demo-timer-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.demo-dropdown-desc {
  font-size: 11.5px;
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin: 0;
}

.demo-dropdown-admin {
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demo-dropdown-admin-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

.demo-admin-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.demo-admin-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--color-border);
  background: var(--bg-card);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.demo-admin-btn:hover {
  background: var(--bg-hover);
  border-color: var(--color-border-hover);
}

.demo-admin-btn.danger {
  color: #dc2626;
}

.demo-admin-btn.danger:hover {
  background: var(--color-danger-bg);
  border-color: rgba(220, 38, 38, 0.25);
}

.demo-dropdown-client-info {
  font-size: 11px;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 8px;
  line-height: 1.4;
}

.demo-mode-choice {
  border: 1.5px solid var(--color-border) !important;
  transition: all 0.2s ease;
}

.demo-mode-choice:hover {
  border-color: var(--color-primary) !important;
}

.demo-mode-choice:has(input:checked) {
  border-color: var(--color-primary) !important;
  background: rgba(11, 72, 76, 0.06) !important;
}

[data-theme="dark"] .demo-mode-choice:has(input:checked) {
  background: rgba(20, 184, 166, 0.12) !important;
  border-color: #14b8a6 !important;
}

.demo-dropdown-client-info a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
}

/* Demo Login Callout */
.demo-login-callout {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: rgba(11, 72, 76, 0.06);
  border: 1px solid rgba(11, 72, 76, 0.2);
  border-radius: 10px;
  text-align: left;
}

.demo-login-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #0b484c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.demo-login-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin-bottom: 10px;
}

.btn-demo-quick-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #0b484c;
  color: #ffffff;
  border: none;
  padding: 9px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-demo-quick-login:hover {
  background: #0d5c61;
}

/* Demo Extend Modal */
.demo-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.demo-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.demo-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.demo-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}

.demo-modal-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 20px;
  line-height: 1;
}

.demo-modal-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.demo-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.demo-opt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  background: var(--bg-hover);
  border: 2px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.demo-opt-btn:hover {
  border-color: #0b484c;
  background: rgba(11, 72, 76, 0.04);
}

.demo-opt-hours {
  font-size: 18px;
  font-weight: 800;
  color: #0b484c;
}

.demo-opt-days {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 2px;
}

@media (max-width: 640px) {
  .demo-dropdown-menu {
    right: -60px;
    width: 290px;
  }
  .demo-options-grid {
    grid-template-columns: 1fr;
  }
}

/* Demo Provisioning Form & Buttons */
.demo-login-buttons {
  display: flex;
  gap: 8px;
  flex-direction: column;
  margin-top: 10px;
}

.btn-demo-provision-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: #0b484c;
  border: 1.5px solid #0b484c;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-demo-provision-login:hover {
  background: rgba(11, 72, 76, 0.08);
}

.btn-demo-provision-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #0b484c;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-demo-provision-nav:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #09393c;
  transform: translateY(-1px);
}

[data-theme='dark'] .btn-demo-provision-login {
  color: #2dd4bf;
  border-color: #2dd4bf;
}

[data-theme='dark'] .btn-demo-provision-login:hover {
  background: rgba(45, 212, 191, 0.1);
}

[data-theme='dark'] .btn-demo-provision-nav {
  background: rgba(255, 255, 255, 0.95);
  color: #0b484c;
}

/* ═══════════════════════════════════════════════════════════
   SMART VOUCHER NODE GRAPH (SEGUIMIENTO POR NODOS)
   ═══════════════════════════════════════════════════════════ */

.node-graph-viewport {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  background-color: var(--color-bg-secondary);
  background-image: radial-gradient(rgba(100, 116, 139, 0.16) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 40px 30px;
  min-height: 480px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
  user-select: none;
}

[data-theme='dark'] .node-graph-viewport {
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1.5px, transparent 1.5px);
}

.node-graph-canvas {
  position: relative;
  display: flex;
  align-items: center;
  gap: 70px;
  min-width: max-content;
  padding: 20px 15px;
}

.node-svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.node-connector-path {
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2.5px;
  stroke-linecap: round;
  transition: stroke 0.25s ease, stroke-width 0.25s ease;
}

.node-connector-path.path-primary {
  stroke: #3b82f6;
}

.node-connector-path.path-credit {
  stroke: #ef4444;
  stroke-dasharray: 6 4;
}

.node-connector-path.path-debit {
  stroke: #f59e0b;
  stroke-dasharray: 6 4;
}

[data-theme='dark'] .node-connector-path.path-debit {
  stroke: #fbbf24;
}

.node-card.node-debit {
  border-color: rgba(245, 158, 11, 0.4);
}

.node-card.node-debit .node-port {
  border-color: #f59e0b;
}

[data-theme='dark'] .node-card.node-debit {
  border-color: rgba(245, 158, 11, 0.5);
}

.node-connector-path.path-payment {
  stroke: #10b981;
}

.node-connector-path.path-outcome {
  stroke: #6366f1;
}

.node-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  z-index: 2;
  align-items: center;
  justify-content: center;
}

.node-column-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-text-muted);
  background-color: var(--color-bg-primary) !important;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: -10px;
}

[data-theme='dark'] .node-column-header {
  background-color: #171717 !important;
}

/* Node Card */
.node-card {
  position: relative;
  width: 280px;
  background-color: var(--color-bg-primary) !important;
  border: 1.5px solid var(--color-border);
  border-radius: 14px;
  box-shadow: 0 4px 16px -2px rgba(0,0,0,0.06), 0 2px 6px -1px rgba(0,0,0,0.03);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: visible;
  isolation: isolate;
}

[data-theme='dark'] .node-card {
  background-color: #171717 !important;
}

.node-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -4px rgba(0,0,0,0.12), 0 4px 12px -2px rgba(0,0,0,0.05);
}

.node-card.node-root {
  width: 310px;
  border-color: #3b82f6;
  box-shadow: 0 8px 24px -4px rgba(59, 130, 246, 0.2), 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.node-card.node-quote {
  border-color: #8b5cf6;
}

.node-card.node-credit {
  border-color: rgba(239, 68, 68, 0.4);
}

.node-card.node-payment {
  border-color: rgba(16, 185, 129, 0.4);
}

.node-card.node-outcome {
  border-color: rgba(99, 102, 241, 0.4);
  background-color: var(--color-bg-primary) !important;
}

[data-theme='dark'] .node-card.node-outcome {
  background-color: #171717 !important;
}

/* Ports */
.node-port {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background-color: var(--color-bg-primary) !important;
  border: 2.5px solid #94a3b8;
  z-index: 5;
  box-shadow: 0 0 0 2px var(--color-bg-primary);
  transition: all 0.2s ease;
}

[data-theme='dark'] .node-port {
  background-color: #171717 !important;
  box-shadow: 0 0 0 2px #171717;
}

.node-port.port-in {
  left: -7px;
}

.node-port.port-out {
  right: -7px;
}

.node-card.node-root .node-port {
  border-color: #3b82f6;
}

.node-card.node-quote .node-port {
  border-color: #8b5cf6;
}

.node-card.node-credit .node-port {
  border-color: #ef4444;
}

.node-card.node-payment .node-port {
  border-color: #10b981;
}

.node-card.node-outcome .node-port {
  border-color: #6366f1;
}

.node-card:hover .node-port {
  transform: translateY(-50%) scale(1.25);
}

.node-header {
  padding: 10px 14px;
  border-top-left-radius: 13px;
  border-top-right-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg-primary);
}

[data-theme='dark'] .node-header {
  background-color: #171717;
}

.node-body {
  padding: 14px;
  background-color: var(--color-bg-primary);
}

[data-theme='dark'] .node-body {
  background-color: #171717;
}

.node-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--color-border);
  background-color: var(--color-bg-secondary);
  border-bottom-left-radius: 13px;
  border-bottom-right-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

[data-theme='dark'] .node-footer {
  background-color: #1a1a1a;
}

/* Child doc notice banner */
.trail-child-doc-banner {
  padding: 12px 18px;
  background: var(--color-success-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.trail-child-doc-banner .banner-message {
  font-size: 13px;
  color: var(--color-text-primary);
}

.trail-child-doc-banner .banner-message strong {
  color: var(--color-success-text);
}

[data-theme='dark'] .trail-child-doc-banner {
  background: rgba(16, 185, 129, 0.1) !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
}

[data-theme='dark'] .trail-child-doc-banner .banner-message strong {
  color: #34d399 !important;
}

/* Node Outcome Breakdown box */
.node-breakdown-box {
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--color-bg-secondary);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  margin-top: 8px;
}

[data-theme='dark'] .node-breakdown-box {
  background: #121212 !important;
  border-color: #262626 !important;
}

/* Accounting Notice inside Outcome Node */
.trail-credit-notice {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: var(--radius-md);
  font-size: 11px;
  color: #0369a1;
  line-height: 1.4;
}

[data-theme='dark'] .trail-credit-notice {
  background: rgba(14, 165, 233, 0.12) !important;
  border-color: rgba(14, 165, 233, 0.25) !important;
  color: #38bdf8 !important;
}

.trail-credit-text {
  color: #0284c7;
}

[data-theme='dark'] .trail-credit-text {
  color: #38bdf8 !important;
}

/* Node headers dark mode styling */
[data-theme='dark'] .node-card.node-root .node-header {
  color: #60a5fa !important;
  background-color: rgba(59, 130, 246, 0.12) !important;
}

[data-theme='dark'] .node-card.node-quote .node-header {
  color: #a78bfa !important;
  background-color: rgba(139, 92, 246, 0.12) !important;
}

[data-theme='dark'] .node-card.node-credit .node-header {
  color: #f87171 !important;
  background-color: rgba(239, 68, 68, 0.12) !important;
}

[data-theme='dark'] .node-card.node-payment .node-header {
  color: #34d399 !important;
  background-color: rgba(16, 185, 129, 0.12) !important;
}

[data-theme='dark'] .node-card.status-settled .node-header {
  color: #34d399 !important;
  background-color: rgba(16, 185, 129, 0.12) !important;
}

[data-theme='dark'] .node-card.status-credit_in_favor .node-header {
  color: #38bdf8 !important;
  background-color: rgba(14, 165, 233, 0.12) !important;
}

[data-theme='dark'] .node-card.status-credited .node-header,
[data-theme='dark'] .node-card.status-cancelled .node-header {
  color: #f87171 !important;
  background-color: rgba(239, 68, 68, 0.12) !important;
}

[data-theme='dark'] .node-card.status-partial .node-header {
  color: #fbbf24 !important;
  background-color: rgba(245, 158, 11, 0.12) !important;
}

[data-theme='dark'] .node-card.status-pending .node-header {
  color: #60a5fa !important;
  background-color: rgba(59, 130, 246, 0.12) !important;
}

/* ═══════════════════════════════════════════════════════════
   RECENT VOUCHER CHIPS & ENHANCED NODE GRAPH (HUMAN-READABLE)
   ═══════════════════════════════════════════════════════════ */

.trail-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.trail-chip:hover {
  background: var(--color-bg-secondary);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

[data-theme='dark'] .trail-chip {
  background: #18181b !important;
  border-color: #27272a !important;
}

[data-theme='dark'] .trail-chip:hover {
  background: #27272a !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.trail-chip .chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.trail-chip .chip-dot.dot-doc { background: #3b82f6; box-shadow: 0 0 6px rgba(59, 130, 246, 0.4); }
.trail-chip .chip-dot.dot-consumer { background: #06b6d4; box-shadow: 0 0 6px rgba(6, 182, 212, 0.4); }
.trail-chip .chip-dot.dot-credit { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
.trail-chip .chip-dot.dot-debit { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); }

.trail-chip .chip-ncf {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--color-text-primary);
}

.trail-chip .chip-sep {
  color: var(--color-text-muted);
  opacity: 0.4;
  font-size: 10px;
}

.trail-chip .chip-amount {
  color: var(--color-text-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Node Sublane Divider */
.node-sublane-divider {
  width: 100%;
  max-width: 280px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  margin-bottom: -12px;
  margin-top: 4px;
}

.node-sublane-divider.lane-credit {
  background: rgba(239, 68, 68, 0.06);
  border: 1px dashed rgba(239, 68, 68, 0.25);
  color: #dc2626;
}

.node-sublane-divider.lane-payment {
  background: rgba(16, 185, 129, 0.06);
  border: 1px dashed rgba(16, 185, 129, 0.25);
  color: #059669;
}

[data-theme='dark'] .node-sublane-divider.lane-credit {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #f87171 !important;
}

[data-theme='dark'] .node-sublane-divider.lane-payment {
  background: rgba(16, 185, 129, 0.1) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  color: #34d399 !important;
}

.node-sublane-divider .lane-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.node-sublane-divider .lane-subtitle {
  font-size: 10px;
  color: var(--color-text-muted);
}

/* Node Running Balance Tag */
.node-running-tag {
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  line-height: 1.3;
}

.node-running-tag.tag-credit {
  background: rgba(239, 68, 68, 0.07);
  border: 1px solid rgba(239, 68, 68, 0.18);
  color: #b91c1c;
}

.node-running-tag.tag-payment {
  background: rgba(16, 185, 129, 0.07);
  border: 1px solid rgba(16, 185, 129, 0.18);
  color: #047857;
}

[data-theme='dark'] .node-running-tag.tag-credit {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
  color: #fca5a5 !important;
}

[data-theme='dark'] .node-running-tag.tag-payment {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
  color: #6ee7b7 !important;
}

.node-running-tag .step-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

[data-theme='dark'] .node-running-tag .step-badge {
  background: rgba(255, 255, 255, 0.12);
}

/* Visual Coverage Progress Bar in Outcome Node */
.node-coverage-wrap {
  margin-top: 10px;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

[data-theme='dark'] .node-coverage-wrap {
  background: #121212 !important;
  border-color: #262626 !important;
}

.node-coverage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.node-coverage-bar {
  display: flex;
  height: 7px;
  width: 100%;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: rgba(100, 116, 139, 0.15);
}

.node-coverage-bar .bar-seg {
  height: 100%;
  transition: width 0.4s ease;
}

.node-coverage-bar .seg-credit {
  background: #ef4444;
}

.node-coverage-bar .seg-payment {
  background: #10b981;
}

.node-coverage-bar .seg-pending {
  background: #f59e0b;
}

.node-coverage-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.node-coverage-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.node-coverage-legend .legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.node-coverage-legend .dot-credit { background: #ef4444; }
.node-coverage-legend .dot-payment { background: #10b981; }
.node-coverage-legend .dot-pending { background: #f59e0b; }
.node-coverage-legend .dot-settled { background: #10b981; }

/* ═══════════════════════════════════════════════════════════
   NOTICE / CALLOUT BANNERS (LIGHT & DARK THEME SUPPORT)
   ═══════════════════════════════════════════════════════════ */

.notice-banner {
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin: 12px 0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: var(--transition-fast);
  box-sizing: border-box;
}

.notice-banner .notice-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}

.notice-banner .notice-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.notice-banner .notice-content {
  font-size: 13px;
  line-height: 1.55;
  flex: 1;
}

.notice-banner .notice-title {
  font-weight: 700;
  display: inline-block;
  margin-bottom: 2px;
}

.notice-banner .notice-sub {
  margin-top: 4px;
  font-size: 12.5px;
  opacity: 0.9;
}

/* ── Info Variant (Blue - e.g. Formato 607) ── */
.notice-info {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #93c5fd;
  color: #1e40af;
}
.notice-info .notice-icon { stroke: #2563eb; }
.notice-info .notice-title { color: #1e3a8a; }
.notice-info .notice-badge { background: #2563eb; color: #fff; }

[data-theme='dark'] .notice-info {
  background: rgba(37, 99, 235, 0.12) !important;
  border-color: rgba(96, 165, 250, 0.28) !important;
  color: #bfdbfe !important;
}
[data-theme='dark'] .notice-info .notice-icon { stroke: #60a5fa !important; }
[data-theme='dark'] .notice-info .notice-title { color: #e0f2fe !important; }
[data-theme='dark'] .notice-info .notice-badge { background: #3b82f6 !important; color: #fff !important; }

/* ── Danger Variant (Red - e.g. Formato 608) ── */
.notice-danger {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border: 1px solid #fca5a5;
  color: #991b1b;
}
.notice-danger .notice-icon { stroke: #dc2626; }
.notice-danger .notice-title { color: #7f1d1d; }
.notice-danger .notice-badge { background: #dc2626; color: #fff; }

[data-theme='dark'] .notice-danger {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(248, 113, 113, 0.28) !important;
  color: #fecaca !important;
}
[data-theme='dark'] .notice-danger .notice-icon { stroke: #f87171 !important; }
[data-theme='dark'] .notice-danger .notice-title { color: #fee2e2 !important; }
[data-theme='dark'] .notice-danger .notice-badge { background: #ef4444 !important; color: #fff !important; }

/* ── Success Variant (Green - e.g. IT-1 / Válido) ── */
.notice-success {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #86efac;
  color: #166534;
}
.notice-success .notice-icon { stroke: #16a34a; }
.notice-success .notice-title { color: #14532d; }
.notice-success .notice-badge { background: #16a34a; color: #fff; }

[data-theme='dark'] .notice-success {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(52, 211, 153, 0.28) !important;
  color: #bbf7d0 !important;
}
[data-theme='dark'] .notice-success .notice-icon { stroke: #34d399 !important; }
[data-theme='dark'] .notice-success .notice-title { color: #dcfce7 !important; }
[data-theme='dark'] .notice-success .notice-badge { background: #10b981 !important; color: #fff !important; }

/* ── Purple Variant (Purple - e.g. IR-2) ── */
.notice-purple {
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border: 1px solid #c4b5fd;
  color: #5b21b6;
}
.notice-purple .notice-icon { stroke: #7c3aed; }
.notice-purple .notice-title { color: #4c1d95; }
.notice-purple .notice-badge { background: #7c3aed; color: #fff; }

[data-theme='dark'] .notice-purple {
  background: rgba(139, 92, 246, 0.12) !important;
  border-color: rgba(167, 139, 250, 0.28) !important;
  color: #ddd6fe !important;
}
[data-theme='dark'] .notice-purple .notice-icon { stroke: #a78bfa !important; }
[data-theme='dark'] .notice-purple .notice-title { color: #ede9fe !important; }
[data-theme='dark'] .notice-purple .notice-badge { background: #8b5cf6 !important; color: #fff !important; }

/* ── Warning Variant (Amber - e.g. Presets / Warnings) ── */
.notice-warning {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fcd34d;
  color: #92400e;
}
.notice-warning .notice-icon { stroke: #d97706; }
.notice-warning .notice-title { color: #78350f; }
.notice-warning .notice-badge { background: #d97706; color: #fff; }

[data-theme='dark'] .notice-warning {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(251, 191, 36, 0.28) !important;
  color: #fde68a !important;
}
[data-theme='dark'] .notice-warning .notice-icon { stroke: #fbbf24 !important; }
[data-theme='dark'] .notice-warning .notice-title { color: #fef9c3 !important; }
[data-theme='dark'] .notice-warning .notice-badge { background: #f59e0b !important; color: #fff !important; }

/* Global dark overrides for inline style banners */
[data-theme='dark'] div[style*="linear-gradient(135deg,#eff6ff,#dbeafe)"],
[data-theme='dark'] div[style*="linear-gradient(135deg, #eff6ff, #dbeafe)"] {
  background: rgba(37, 99, 235, 0.12) !important;
  border-color: rgba(96, 165, 250, 0.28) !important;
  color: #bfdbfe !important;
}
[data-theme='dark'] div[style*="linear-gradient(135deg,#eff6ff,#dbeafe)"] *,
[data-theme='dark'] div[style*="linear-gradient(135deg, #eff6ff, #dbeafe)"] * {
  color: inherit !important;
}
[data-theme='dark'] div[style*="linear-gradient(135deg,#eff6ff,#dbeafe)"] svg,
[data-theme='dark'] div[style*="linear-gradient(135deg, #eff6ff, #dbeafe)"] svg {
  stroke: #60a5fa !important;
}

[data-theme='dark'] div[style*="linear-gradient(135deg,#fef2f2,#fee2e2)"],
[data-theme='dark'] div[style*="linear-gradient(135deg, #fef2f2, #fee2e2)"] {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(248, 113, 113, 0.28) !important;
  color: #fecaca !important;
}
[data-theme='dark'] div[style*="linear-gradient(135deg,#fef2f2,#fee2e2)"] *,
[data-theme='dark'] div[style*="linear-gradient(135deg, #fef2f2, #fee2e2)"] * {
  color: inherit !important;
}
[data-theme='dark'] div[style*="linear-gradient(135deg,#fef2f2,#fee2e2)"] svg,
[data-theme='dark'] div[style*="linear-gradient(135deg, #fef2f2, #fee2e2)"] svg {
  stroke: #f87171 !important;
}

[data-theme='dark'] div[style*="linear-gradient(135deg,#f0fdf4,#dcfce7)"],
[data-theme='dark'] div[style*="linear-gradient(135deg, #f0fdf4, #dcfce7)"] {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(52, 211, 153, 0.28) !important;
  color: #bbf7d0 !important;
}
[data-theme='dark'] div[style*="linear-gradient(135deg,#f0fdf4,#dcfce7)"] *,
[data-theme='dark'] div[style*="linear-gradient(135deg, #f0fdf4, #dcfce7)"] * {
  color: inherit !important;
}

[data-theme='dark'] div[style*="linear-gradient(135deg,#f5f3ff,#ede9fe)"],
[data-theme='dark'] div[style*="linear-gradient(135deg, #f5f3ff, #ede9fe)"] {
  background: rgba(139, 92, 246, 0.12) !important;
  border-color: rgba(167, 139, 250, 0.28) !important;
  color: #ddd6fe !important;
}
[data-theme='dark'] div[style*="linear-gradient(135deg,#f5f3ff,#ede9fe)"] *,
[data-theme='dark'] div[style*="linear-gradient(135deg, #f5f3ff, #ede9fe)"] * {
  color: inherit !important;
}

[data-theme='dark'] div[style*="background:#fef3c7"],
[data-theme='dark'] div[style*="background: #fef3c7"],
[data-theme='dark'] div[style*="background:#fef9c3"] {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(251, 191, 36, 0.28) !important;
  color: #fde68a !important;
}
[data-theme='dark'] div[style*="background:#fef3c7"] *,
[data-theme='dark'] div[style*="background: #fef3c7"] * {
  color: inherit !important;
}

[data-theme='dark'] div[style*="background:#fef2f2"],
[data-theme='dark'] div[style*="background: #fef2f2"] {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(248, 113, 113, 0.28) !important;
  color: #fecaca !important;
}
[data-theme='dark'] div[style*="background:#fef2f2"] *,
[data-theme='dark'] div[style*="background: #fef2f2"] * {
  color: inherit !important;
}

[data-theme='dark'] div[style*="background:#ecfdf5"],
[data-theme='dark'] div[style*="background: #ecfdf5"] {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(52, 211, 153, 0.28) !important;
  color: #bbf7d0 !important;
}
[data-theme='dark'] div[style*="background:#ecfdf5"] *,
[data-theme='dark'] div[style*="background: #ecfdf5"] * {
  color: inherit !important;
}

[data-theme='dark'] div[style*="background:#f5f3ff"],
[data-theme='dark'] div[style*="background: #f5f3ff"] {
  background: rgba(139, 92, 246, 0.12) !important;
  border-color: rgba(167, 139, 250, 0.28) !important;
  color: #ddd6fe !important;
}
[data-theme='dark'] div[style*="background:#f5f3ff"] *,
[data-theme='dark'] div[style*="background: #f5f3ff"] * {
  color: inherit !important;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR SECONDARY / SUPPORT SECTION
   ═══════════════════════════════════════════════════════════ */
.sidebar-help-section {
  flex-shrink: 0;
  background: transparent;
  border-top: none;
  padding: 8px 12px 4px 20px !important;
}
.sidebar-help-section .sidebar-menu {
  gap: 2px;
}
.hover-row:hover {
  background-color: var(--bg-hover) !important;
}






/* ═══════════════════════════════════════════════════════════
/* ═══════════════════════════════════════════════════════════
   GRIDBASE AI — ANIMATED SOFT GLOW & POPUP MODAL (COMMAND PALETTE STYLE)
   ═══════════════════════════════════════════════════════════ */

/* ── Keyframe Animations for Moving Soft Glow ── */
@keyframes aiGlowShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes aiPulseAura {
  0%, 100% {
    opacity: 0.4;
    filter: blur(10px);
  }
  50% {
    opacity: 0.72;
    filter: blur(16px);
  }
}

/* ── Circular AI Trigger Button in TopBar (With Moving Glow Border) ── */
.btn-ai-circular {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px;
    border: none;
    background: linear-gradient(120deg, #06b6d4, #6366f1, #d946ef, #f43f5e, #06b6d4);
    background-size: 300% 300%;
    animation: aiGlowShift 6s ease infinite;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 8px;
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.35);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
    box-sizing: border-box;
}

.btn-ai-circular::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: linear-gradient(120deg, #06b6d4, #6366f1, #d946ef, #f43f5e, #06b6d4);
  background-size: 300% 300%;
  animation: aiGlowShift 6s ease infinite, aiPulseAura 4s ease-in-out infinite;
  filter: blur(8px);
  opacity: 0.55;
  z-index: -1;
  pointer-events: none;
}

.btn-ai-circular-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-primary);
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-ai-circular:hover {
  transform: scale(1.08);
  box-shadow: 0 0 22px rgba(217, 70, 239, 0.55);
}

[data-theme="dark"] .btn-ai-circular-inner {
  background: #18181b;
  color: #FAFAFA;
}

/* ── Command Palette AI Trigger Button in Header ── */
.cmd-palette-ai-trigger {
  position: relative;
  padding: 1.5px;
  border-radius: 8px;
  background: linear-gradient(120deg, #06b6d4, #6366f1, #d946ef, #f43f5e, #06b6d4);
  background-size: 300% 300%;
  animation: aiGlowShift 6s ease infinite;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cmd-palette-ai-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(217, 70, 239, 0.45);
}

.cmd-palette-ai-trigger-inner {
  background: var(--bg-card);
  border-radius: 6.5px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-primary);
  transition: background 0.15s ease;
}

[data-theme="dark"] .cmd-palette-ai-trigger-inner {
  background: #18181b;
  color: #FAFAFA;
}

/* ── Command Palette AI Entry ── */
.cmd-item-ai {
  position: relative;
  border-left: 3px solid transparent;
  background: rgba(99, 102, 241, 0.04);
}

.cmd-item-ai::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: linear-gradient(180deg, #06b6d4, #6366f1, #d946ef);
  background-size: 100% 200%;
  animation: aiGlowShift 4s ease infinite;
}

.cmd-item-icon-ai {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .cmd-item-icon-ai {
  background: rgba(129, 140, 248, 0.16);
  color: #a5b4fc;
}

.badge-ai-glow {
  background: linear-gradient(120deg, rgba(6, 182, 212, 0.12), rgba(99, 102, 241, 0.15), rgba(217, 70, 239, 0.12));
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #6366f1;
  font-weight: 700;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .badge-ai-glow {
  color: #a5b4fc;
  border-color: rgba(165, 180, 252, 0.4);
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.3);
}

/* ── Centered AI Pop-up Modal (Matching Command Palette Modal) ── */
.gb-ai-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 10vh;
  padding-left: 16px;
  padding-right: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.gb-ai-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Wrapper with moving glowing border and ambient aura */
.gb-ai-modal-wrapper {
  position: relative;
  width: 100%;
  max-width: 680px;
  border-radius: 36px;
  padding: 1px;
  background: linear-gradient(120deg, #06b6d4, #6366f1, #d946ef, #f43f5e, #06b6d4);
  background-size: 300% 300%;
  animation: aiGlowShift 8s ease infinite;
  box-shadow: 0 0 32px rgba(99, 102, 241, 0.28), 0 24px 60px -12px rgba(0, 0, 0, 0.45);
  transform: scale(0.96) translateY(-12px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.gb-ai-backdrop.open .gb-ai-modal-wrapper {
  transform: scale(1) translateY(0);
}

.gb-ai-modal-wrapper::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 40px;
  background: linear-gradient(120deg, #06b6d4, #6366f1, #d946ef, #f43f5e, #06b6d4);
  background-size: 300% 300%;
  animation: aiGlowShift 8s ease infinite, aiPulseAura 5s ease-in-out infinite;
  filter: blur(16px);
  opacity: 0.55;
  z-index: -1;
  pointer-events: none;
}

.gb-ai-modal {
  width: 100%;
  background: var(--bg-card);
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 82vh;
  box-sizing: border-box;
}

[data-theme="dark"] .gb-ai-modal {
  background: #141416;
}

.gb-ai-header {
  padding: 26px 33px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f0f11;
  flex-shrink: 0;
}

[data-theme="light"] .gb-ai-header {
  background: #ffffff;
}

.gb-ai-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gb-ai-header-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-primary);
  opacity: 0.85;
}

.gb-ai-header-icon svg {
  width: 100%;
  height: 100%;
}

.gb-ai-header-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.2px;
}

.gb-ai-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gb-ai-esc-pill {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  font-family: inherit;
  line-height: 1.4;
}

[data-theme="light"] .gb-ai-esc-pill {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}

.gb-ai-esc-pill:hover {
  color: var(--color-text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .gb-ai-esc-pill:hover {
  border-color: #cbd5e1;
  color: #0f172a;
}

/* Context Strip hidden for pure minimal look */
.gb-ai-context-strip {
  display: none !important;
}

/* ── Modal Body / Thread ── */
.gb-ai-body {
  flex: 1;
  overflow-y: auto;
  max-height: 52vh;
  min-height: 220px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-app);
}

[data-theme="dark"] .gb-ai-body {
  background: #0f0f11;
}

/* ── Welcome Screen (Watermark "GridBase AI" 25% Opacity & Context Chips) ── */
.gb-ai-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  text-align: center;
  background: transparent;
  border: none;
  min-height: 220px;
  box-sizing: border-box;
  gap: 14px;
}

.gb-ai-watermark {
  font-size: clamp(34px, 6vw, 90px);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--color-text-primary);
  opacity: 0.25;
  user-select: none;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ── Messages Formatting ── */
.gb-ai-msg {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.15s ease;
}

.gb-ai-msg-user {
  align-items: flex-end;
}

.gb-ai-msg-agent {
  align-items: flex-start;
}

.gb-ai-msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  padding-left: 2px;
}

.gb-ai-msg-role-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #6366f1;
  letter-spacing: 0.2px;
}

.gb-ai-msg-role-icon {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .gb-ai-msg-role-tag {
  color: #a5b4fc;
}

.gb-ai-msg-meta {
  font-size: 10px;
  color: var(--color-text-muted);
}

.gb-ai-bubble {
  max-width: 90%;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  box-sizing: border-box;
}

.gb-ai-bubble-user {
  background: var(--color-primary);
  color: #ffffff;
  border-bottom-right-radius: 3px;
}

[data-theme="dark"] .gb-ai-bubble-user {
  background: #27272a;
  color: #f4f4f5;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gb-ai-bubble-agent {
  max-width: 100%;
  background: var(--bg-card);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 3px;
}

[data-theme="dark"] .gb-ai-bubble-agent {
  background: #18181b;
}

.gb-ai-action-badge {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: #065f46;
}

[data-theme="dark"] .gb-ai-action-badge {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.gb-ai-action-badge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  flex-shrink: 0;
  margin-top: 1px;
}

.gb-ai-action-badge-text {
  flex: 1;
}

.gb-ai-action-badge-text strong {
  font-weight: 600;
  margin-right: 4px;
}

.gb-ai-bubble-user .gb-ai-msg-meta {
  margin-top: 6px;
  text-align: right;
  opacity: 0.75;
  color: inherit;
}

/* ── Markdown Content Inside Bubbles ── */
.gb-ai-msg-content p {
  margin: 0 0 8px 0;
}

.gb-ai-msg-content p:last-child {
  margin-bottom: 0;
}

.gb-ai-list {
  margin: 4px 0 8px 18px;
  padding: 0;
}

.gb-ai-list li {
  margin-bottom: 4px;
}

.gb-ai-inline-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .gb-ai-inline-code {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.gb-ai-code-block {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  background: #0d1117;
  color: #e6edf3;
  padding: 10px 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
}

.gb-ai-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.gb-ai-link:hover {
  text-decoration: none;
}

[data-theme="dark"] .gb-ai-link {
  color: #60a5fa;
}

/* ── Typing Indicator ── */
.gb-ai-bubble-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.gb-ai-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gb-ai-typing-indicator span {
  width: 6px;
  height: 6px;
  background-color: #6366f1;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.gb-ai-typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.gb-ai-typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.gb-ai-loading-text {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ── ThoughtLine Component (React Bits) ── */
.thought-line {
  --tl-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --tl-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --tl-font: 14px;
  --tl-color: currentColor;
  --tl-glyph: currentColor;
  --tl-settle: 350ms;
  --tl-blur: 2px;
  --tl-shimmer: 1.8s;
  --tl-breath-period: 1.6s;
  --tl-trough: 0.55;
  --tl-done: 0.72;
  --tl-timer: 0.55;

  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  color: var(--tl-color);
  font-family: inherit;
  font-size: var(--tl-font);
  font-weight: 500;
  line-height: 1.25;
  user-select: none;
  -webkit-user-select: none;
}

.thought-line__head {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin: 0;
  padding: 3px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  white-space: nowrap;
  outline: none;
  cursor: default;
}

.thought-line__head[data-toggle] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.thought-line__glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 1.15em;
  height: 1.15em;
  margin-right: 0.25em;
  color: var(--tl-glyph);
}

.thought-line__glyph svg {
  display: block;
  width: 100%;
  height: 100%;
}

.thought-line[data-working] .thought-line__glyph {
  animation: thought-line-glyph-breath var(--tl-breath-period) var(--tl-ease-in-out) infinite;
}

@keyframes thought-line-glyph-breath {
  0%, 100% {
    opacity: var(--tl-trough);
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.thought-line:not([data-working]) .thought-line__glyph {
  opacity: 0.55;
  transform: scale(1);
  transition: opacity var(--tl-settle) var(--tl-ease-out), transform var(--tl-settle) var(--tl-ease-out);
}

.thought-line__dot {
  width: 0.45em;
  height: 0.45em;
  margin: auto;
  border-radius: 50%;
  background: currentColor;
}

.thought-line__label {
  display: inline-grid;
  position: relative;
}

.thought-line__text {
  grid-area: 1 / 1;
  width: max-content;
  opacity: 0;
  filter: blur(var(--tl-blur));
  pointer-events: none;
  transition:
    opacity var(--tl-settle) var(--tl-ease-out),
    filter var(--tl-settle) var(--tl-ease-out);
}

.thought-line__text[data-active] {
  opacity: 1;
  filter: blur(0);
  pointer-events: auto;
}

.thought-line__text--done[data-active] {
  opacity: var(--tl-done);
}

.thought-line__breath {
  display: inline-block;
}

.thought-line[data-working] .thought-line__breath[data-shimmer] {
  background: linear-gradient(
    100deg,
    rgba(148, 163, 184, 0.45) 30%,
    var(--tl-color) 50%,
    rgba(148, 163, 184, 0.45) 70%
  );
  background-size: 250% 100%;
  background-position: 125% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: thought-line-shimmer var(--tl-shimmer) linear infinite;
}

@supports (color: color-mix(in srgb, red, blue)) {
  .thought-line[data-working] .thought-line__breath[data-shimmer] {
    background: linear-gradient(
      100deg,
      color-mix(in srgb, var(--tl-color) 45%, transparent) 30%,
      var(--tl-color) 50%,
      color-mix(in srgb, var(--tl-color) 45%, transparent) 70%
    );
    background-size: 250% 100%;
    background-position: 125% 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: thought-line-shimmer var(--tl-shimmer) linear infinite;
  }
}

@keyframes thought-line-shimmer {
  to {
    background-position: -125% 0;
  }
}

.thought-line__timer {
  font-variant-numeric: tabular-nums;
  opacity: var(--tl-timer);
  margin-left: 0.25em;
  transition:
    opacity var(--tl-settle) ease,
    transform var(--tl-settle) var(--tl-ease-in-out);
}

.thought-line__timer[data-done] {
  opacity: var(--tl-done);
}

.thought-line__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.15em;
  width: 1em;
  height: 1em;
  opacity: 0;
  transition:
    opacity 200ms ease,
    transform 220ms var(--tl-ease-out);
}

.thought-line__chevron svg {
  display: block;
  width: 100%;
  height: 100%;
}

.thought-line__chevron[data-on] {
  opacity: 0.55;
}

.thought-line[data-open] .thought-line__chevron {
  transform: rotate(180deg);
}

.thought-line__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.thought-line__trace {
  display: grid;
  grid-template-rows: 0fr;
  width: 0;
  min-width: 100%;
  transition: grid-template-rows var(--tl-settle) var(--tl-ease-out);
}

.thought-line__trace[data-open] {
  grid-template-rows: 1fr;
}

.thought-line__fold {
  min-height: 0;
  overflow: hidden;
}

.thought-line__steps {
  display: flex;
  flex-direction: column;
  gap: 0.45em;
  width: max-content;
  padding: 0.6em 0 0.2em 1.6em;
  font-size: 0.88em;
  font-weight: 400;
  white-space: nowrap;
}

.thought-line__step {
  display: flex;
  align-items: center;
  gap: 0.55em;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 200ms var(--tl-ease-out),
    transform 200ms var(--tl-ease-out);
}

.thought-line__mark {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 1em;
  height: 1em;
  opacity: 0.65;
  color: var(--tl-glyph);
}

.thought-line__mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.thought-line__pulse {
  display: block;
  width: 0.4em;
  height: 0.4em;
  border-radius: 50%;
  background: currentColor;
  animation: thought-line-pulse 1.6s var(--tl-ease-in-out) infinite;
}

@keyframes thought-line-pulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.thought-line__step-text {
  transition: opacity var(--tl-settle) ease;
}

.thought-line__step[data-done] .thought-line__step-text {
  opacity: 0.55;
}

.thought-line__step[data-done] .thought-line__mark {
  color: #10b981;
  opacity: 0.9;
}

/* Modal Integration in GridBase AI */
.gb-ai-thought-container {
  display: flex;
  flex-direction: column;
  padding: 4px 0 6px;
}

.gb-ai-bubble .thought-line {
  color: var(--color-text-secondary);
  --tl-glyph: #6366f1;
}

[data-theme="dark"] .gb-ai-bubble .thought-line {
  color: #94a3b8;
  --tl-glyph: #818cf8;
}

.gb-ai-bubble-has-thought .gb-ai-thought-container {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 10px;
  padding-bottom: 8px;
}

[data-theme="dark"] .gb-ai-bubble-has-thought .gb-ai-thought-container {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* ── Error Notices ── */
.gb-ai-notice-error {
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  color: #b91c1c;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

[data-theme="dark"] .gb-ai-notice-error {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.gb-ai-retry-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.gb-ai-footer {
  padding: 10px 20px 20px;
  background: #0f0f11;
  border-top: none;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[data-theme="light"] .gb-ai-footer {
  background: #ffffff;
}



.gb-ai-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
}

/* Minimal input card */
.gb-ai-input-card {
  position: relative;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #18181b;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

[data-theme="light"] .gb-ai-input-card {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #ffffff;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.05);
}

.gb-ai-input-card:focus-within {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25), 0 8px 28px -4px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .gb-ai-input-card:focus-within {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2), 0 8px 24px -4px rgba(0, 0, 0, 0.08);
}

.gb-ai-input-inner {
  background: transparent;
  border-radius: 21px;
  padding: 12px 14px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}

[data-theme="light"] .gb-ai-input-inner {
  background: transparent;
}

.gb-ai-input-main-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.gb-ai-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 450;
  resize: none;
  min-height: 42px;
  max-height: 120px;
  padding: 2px 0 0 0;
  outline: none;
  line-height: 1.5;
  box-sizing: border-box;
}

.gb-ai-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.65;
}

.gb-ai-card-sparkle {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c084fc;
  opacity: 0.85;
  margin-top: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.gb-ai-input-card:focus-within .gb-ai-card-sparkle {
  opacity: 1;
  transform: scale(1.1);
}

/* Bottom tools row inside card */
.gb-ai-card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2px;
}

.gb-ai-tools-left {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.gb-ai-tool-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.gb-ai-tool-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-primary);
  transform: translateY(-1px);
}

[data-theme="light"] .gb-ai-tool-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.gb-ai-tool-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
}

[data-theme="light"] .gb-ai-tool-divider {
  background: #e2e8f0;
}

.gb-ai-actions-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Squircle Send Button */
.gb-ai-squircle-send {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: #ffffff;
  color: #09090b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  padding: 0;
}

[data-theme="light"] .gb-ai-squircle-send {
  background: #09090b;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.gb-ai-squircle-send:hover {
  transform: translateY(-1px) scale(1.04);
  filter: brightness(1.06);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.gb-ai-squircle-send:active {
  transform: translateY(0) scale(0.95);
}

.gb-ai-squircle-send.loading {
  opacity: 0.5;
  cursor: wait;
  pointer-events: none;
}

/* Fallbacks for older references */
.gb-ai-send-btn {
  composes: gb-ai-squircle-send;
}

/* Squircle Mic Button (Voice Interaction) */
.gb-ai-squircle-mic {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #a1a1aa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

[data-theme="light"] .gb-ai-squircle-mic {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.04);
  color: #52525b;
}

.gb-ai-squircle-mic:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px) scale(1.04);
}

[data-theme="light"] .gb-ai-squircle-mic:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #09090b;
  border-color: rgba(0, 0, 0, 0.2);
  transform: translateY(-1px) scale(1.04);
}

.gb-ai-squircle-mic:active {
  transform: translateY(0) scale(0.95);
}

/* Active Recording State (Pulse animation) */
.gb-ai-squircle-mic.is-recording {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35), 0 2px 10px rgba(239, 68, 68, 0.45);
  animation: gb-mic-pulse 1.3s ease-in-out infinite;
}

@keyframes gb-mic-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6), 0 2px 10px rgba(239, 68, 68, 0.45);
  }
  60% {
    transform: scale(1.06);
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0), 0 4px 14px rgba(239, 68, 68, 0.55);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), 0 2px 10px rgba(239, 68, 68, 0.45);
  }
}

.gb-ai-msg-meta-row {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gb-ai-speak-btn {
  background: transparent;
  border: none;
  color: #71717a;
  padding: 3px 5px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  opacity: 0.7;
}

.gb-ai-speak-btn:hover {
  opacity: 1;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.gb-ai-speak-btn.speaking {
  opacity: 1;
  color: #10b981;
  background: rgba(16, 185, 129, 0.18);
  animation: gb-mic-pulse 1.5s ease-in-out infinite;
}

/* ── Contextual Shortcuts (Chips by View) ── */
.gb-ai-context-header {
  display: block;
  text-align: center;
  margin-bottom: 4px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.gb-ai-context-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary, #737373);
  letter-spacing: -0.01em;
  text-transform: none;
}

[data-theme="dark"] .gb-ai-context-header {
  background: transparent;
  border: none;
}

[data-theme="dark"] .gb-ai-context-title {
  color: var(--color-text-secondary, #a3a3a3);
}

.gb-ai-context-dot {
  display: none;
}

.gb-ai-chips-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 580px;
  width: 100%;
}

.gb-ai-context-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

[data-theme="light"] .gb-ai-context-chip {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #f8fafc;
  color: #334155;
}

.gb-ai-context-chip:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.08);
  color: #6366f1;
  transform: translateY(-1px);
}

[data-theme="dark"] .gb-ai-context-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.gb-ai-chip-bullet {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

/* ── Generative UI Interactive Widgets ── */
.gb-ai-widget {
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(24, 24, 27, 0.85);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

[data-theme="light"] .gb-ai-widget {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.06);
}

.gb-ai-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .gb-ai-widget-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: #f8fafc;
}

.gb-ai-widget-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gb-ai-widget-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 6px;
}

.gb-ai-badge-quote {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.gb-ai-badge-profit {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.gb-ai-badge-pref {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.gb-ai-badge-guard {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.gb-ai-widget-code, .gb-ai-widget-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.gb-ai-widget-state, .gb-ai-widget-period {
  font-size: 11px;
  color: var(--color-text-muted);
}

.gb-ai-widget-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gb-ai-widget-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.gb-ai-meta-label {
  color: var(--color-text-muted);
  font-weight: 500;
}

.gb-ai-meta-value {
  color: var(--color-text-primary);
  font-weight: 600;
}

.gb-ai-widget-items-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .gb-ai-widget-items-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.gb-ai-widget-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.gb-ai-widget-item-name {
  color: var(--color-text-primary);
  flex: 1;
}

.gb-ai-widget-item-qty {
  color: var(--color-text-muted);
  margin: 0 10px;
}

.gb-ai-widget-item-price {
  font-weight: 600;
  color: var(--color-text-primary);
}

.gb-ai-widget-totals-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .gb-ai-widget-totals-box {
  border-top-color: #e2e8f0;
}

.gb-ai-totals-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-muted);
}

.gb-ai-totals-grand {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary);
  padding-top: 4px;
}

.gb-ai-widget-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

[data-theme="light"] .gb-ai-widget-actions {
  background: #f8fafc;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.gb-ai-widget-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.gb-ai-widget-btn-primary {
  background: #6366f1;
  color: #ffffff;
}

.gb-ai-widget-btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

.gb-ai-widget-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .gb-ai-widget-btn-secondary {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.gb-ai-widget-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

[data-theme="light"] .gb-ai-widget-btn-secondary:hover {
  background: #f1f5f9;
}

/* Profitability Card Styles */
.gb-ai-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.gb-ai-kpi-card {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

[data-theme="light"] .gb-ai-kpi-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.gb-ai-kpi-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.gb-ai-kpi-label {
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.gb-ai-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gb-ai-progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-text-muted);
}

.gb-ai-progress-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

[data-theme="light"] .gb-ai-progress-bar {
  background: #e2e8f0;
}

.gb-ai-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #10b981, #059669);
  transition: width 0.4s ease;
}

.gb-ai-matrix-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gb-ai-matrix-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 11px;
}

[data-theme="light"] .gb-ai-matrix-row {
  background: #f8fafc;
}

.gb-ai-matrix-name-col {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gb-ai-matrix-name {
  font-weight: 500;
  color: var(--color-text-primary);
}

.gb-ai-matrix-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

.gb-ai-quad-star {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.gb-ai-quad-cow {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.gb-ai-quad-rev {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.gb-ai-quad-opp {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.gb-ai-matrix-stat-col {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gb-ai-matrix-margin {
  font-weight: 600;
  color: var(--color-text-primary);
}

.gb-ai-matrix-rev {
  color: var(--color-text-muted);
}

/* Preferences and Safeguard Card Styles */
.gb-ai-pref-row {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gb-ai-pref-key {
  color: var(--color-text-muted);
  font-weight: 500;
}

.gb-ai-pref-val {
  color: var(--color-text-primary);
  font-weight: 600;
}

.gb-ai-pref-note, .gb-ai-refusal-text {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   BLOBATAR ANIMATION & GAZE TRACKING (blobatar.dev)
   ═══════════════════════════════════════════════════════════ */

@property --mo-amp { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --mo-esx { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --mo-esy { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --mo-tilt { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --mo-edy { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --mo-edx { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --mo-esx2 { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --mo-esy2 { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --mo-tilt2 { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --mo-edy2 { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --mo-lock { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --mo-shake { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --mo-rock { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --mo-rockp { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --mo-bdy { syntax: "<number>"; inherits: true; initial-value: 0; }

@property --mo-track-x { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --mo-track-y { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --mo-track-travel { syntax: "<length>"; inherits: true; initial-value: 0; }
@property --mo-track-hold { syntax: "<number>"; inherits: true; initial-value: 0; }

.mo-root, .mo-breathe, .mo-bob {
  transform-box: view-box;
  transform-origin: center;
}

.mo-root {
  --mo-amp: 0;
  --mo-morph: calc(0.4s * var(--mo-rate, 1));
  --mo-morph-ease: ease-in-out;
  --mo-tp: --mo-esx, --mo-esy, --mo-tilt, --mo-edy, --mo-edx, --mo-esx2, --mo-esy2, --mo-tilt2, --mo-edy2, --mo-lock, --mo-shake, --mo-rock, --mo-bdy;
  --mo-md: var(--mo-morph), var(--mo-morph), var(--mo-morph), var(--mo-morph), var(--mo-morph), var(--mo-morph), var(--mo-morph), var(--mo-morph), var(--mo-morph), var(--mo-morph), var(--mo-morph), var(--mo-morph), var(--mo-morph);
  --mo-me: var(--mo-morph-ease), var(--mo-morph-ease), var(--mo-morph-ease), var(--mo-morph-ease), var(--mo-morph-ease), var(--mo-morph-ease), var(--mo-morph-ease), var(--mo-morph-ease), var(--mo-morph-ease), var(--mo-morph-ease), var(--mo-morph-ease), var(--mo-morph-ease), var(--mo-morph-ease);
  transition-property: --mo-amp, transform, var(--mo-tp);
  transition-duration: calc(0.4s * var(--mo-rate, 1)), calc(0.16s * var(--mo-rate, 1)), var(--mo-md);
  transition-timing-function: ease-out, cubic-bezier(0.23, 1, 0.32, 1), var(--mo-me);
  animation: mo-shake calc(0.112s * var(--mo-rate, 1)) linear infinite;
}

.mo-bob > g:not(.mo-eyes) {
  fill: var(--mo-head);
  transition: fill var(--mo-morph) var(--mo-morph-ease);
}

.mo-eyes {
  fill: var(--mo-eye);
  transition: fill var(--mo-morph) var(--mo-morph-ease);
}

@keyframes mo-shake {
  0%, 100% { translate: calc(0.62px * var(--mo-shake)) calc(-0.34px * var(--mo-shake)); }
  25% { translate: calc(-0.7px * var(--mo-shake)) calc(0.22px * var(--mo-shake)); }
  50% { translate: calc(0.38px * var(--mo-shake)) calc(0.66px * var(--mo-shake)); }
  75% { translate: calc(-0.44px * var(--mo-shake)) calc(-0.6px * var(--mo-shake)); }
}

.mo-root.mo-expr {
  --mo-morph: calc(0.3s * var(--mo-rate, 1));
  --mo-morph-ease: cubic-bezier(0.45, 0.05, 0.5, 1);
}

.mo-root:hover {
  --mo-amp: 1;
  transition-duration: calc(0.4s * var(--mo-rate, 1)), calc(0.22s * var(--mo-rate, 1)), var(--mo-md);
  transform: translateY(-1.5px) scale(1.04);
}

.mo-root.mo-always {
  --mo-amp: 1;
}

.mo-breathe {
  animation-name: mo-breathe;
  animation-duration: calc(2.4s * var(--mo-rate, 1));
  animation-delay: calc(var(--mo-phase, 0s) * var(--mo-rate, 1));
  animation-iteration-count: infinite;
  animation-direction: alternate;
  animation-timing-function: ease-in-out;
}

@keyframes mo-breathe {
  0% {
    transform: scaleX(1) scaleY(1);
  }
  100% {
    transform: scaleX(calc(1 + 0.048 * var(--mo-amp))) scaleY(calc(1 - 0.042 * var(--mo-amp)));
  }
}

.mo-bob {
  translate: 0 calc(var(--mo-bdy) * 1px);
  animation-name: mo-bob;
  animation-duration: calc(2.2s * var(--mo-rate, 1));
  animation-delay: calc(var(--mo-bob-phase, 0s) * var(--mo-rate, 1));
  animation-iteration-count: infinite;
  animation-direction: alternate;
  animation-timing-function: ease-in-out;
}

@keyframes mo-bob {
  0% { transform: translateY(0); }
  100% { transform: translateY(calc(-3.5px * var(--mo-amp))); }
}

.mo-eye {
  transform-box: view-box;
  --mo-sel: calc((var(--mo-wrap, 1) + 1) / 2);
  --mo-x: calc(var(--mo-esx) + var(--mo-esx2) * var(--mo-sel));
  --mo-y: calc(var(--mo-esy) + var(--mo-esy2) * var(--mo-sel));
  --mo-t: calc(var(--mo-tilt) + var(--mo-tilt2) * var(--mo-sel));
  --mo-ph: calc(var(--mo-sel) * (1 - var(--mo-rock)) + var(--mo-rock) * ((1 + var(--mo-wrap, 1) * var(--mo-rockp)) / 2));
  translate: calc(var(--mo-edx) * var(--mo-wrap, 1) * 1px) calc((var(--mo-edy) + var(--mo-edy2) * var(--mo-ph)) * 1px);
  rotate: calc((var(--mo-t) * var(--mo-wrap, 1) - var(--mo-lean, 0) * var(--mo-lock)) * 1deg);
  transform: rotate(calc(var(--mo-lean, 0) * 1deg)) scaleX(var(--mo-x)) scaleY(var(--mo-y)) rotate(calc(var(--mo-lean, 0) * -1deg));
  animation-name: mo-rock;
  animation-duration: calc(0.9s * var(--mo-rate, 1));
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

@container style(--mo-rock: 0) {
  .mo-eye { animation-name: none; }
}

@keyframes mo-rock {
  0%, 100% { --mo-rockp: 1; }
  50% { --mo-rockp: -1; }
}

.mo-eye > * {
  transform-box: fill-box;
  transform-origin: center;
  animation-name: mo-blink, mo-wrap;
  animation-duration: calc(var(--mo-blink, 4.2s) * var(--mo-rate, 1)), calc(var(--mo-saccade, 5.2s) * var(--mo-rate, 1));
  animation-delay: calc(var(--mo-blink-phase, 0s) * var(--mo-rate, 1)), calc(var(--mo-saccade-phase, 0s) * var(--mo-rate, 1));
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

@keyframes mo-blink {
  0%, 94% {
    transform: rotate(calc(var(--mo-lean, 0) * 1deg)) scaleY(1) rotate(calc(var(--mo-lean, 0) * -1deg));
    animation-timing-function: ease-in;
  }
  96% {
    transform: rotate(calc(var(--mo-lean, 0) * 1deg)) scaleY(calc(1 - 0.95 * var(--mo-amp))) rotate(calc(var(--mo-lean, 0) * -1deg));
    animation-timing-function: ease-out;
  }
  98%, 100% {
    transform: rotate(calc(var(--mo-lean, 0) * 1deg)) scaleY(1) rotate(calc(var(--mo-lean, 0) * -1deg));
  }
}

.mo-eyes {
  animation-name: mo-saccade;
  animation-duration: calc(var(--mo-saccade, 5.2s) * var(--mo-rate, 1));
  animation-delay: calc(var(--mo-saccade-phase, 0s) * var(--mo-rate, 1));
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

@keyframes mo-saccade {
  0%, 15% { translate: 0; }
  16.5%, 31% { translate: calc(-1.4px * var(--mo-look-x, 1.4) * var(--mo-amp)) calc(-1.2px * var(--mo-look-y, 1.1) * var(--mo-amp)); }
  32.5%, 47% { translate: calc(1.6px * var(--mo-look-x, 1.4) * var(--mo-amp)) calc(0.3px * var(--mo-look-y, 1.1) * var(--mo-amp)); }
  48.5%, 63% { translate: calc(-0.4px * var(--mo-look-x, 1.4) * var(--mo-amp)) calc(1.3px * var(--mo-look-y, 1.1) * var(--mo-amp)); }
  64.5%, 79% { translate: calc(1.3px * var(--mo-look-x, 1.4) * var(--mo-amp)) calc(-1.1px * var(--mo-look-y, 1.1) * var(--mo-amp)); }
  80.5%, 98.5% { translate: calc(-1.5px * var(--mo-look-x, 1.4) * var(--mo-amp)) calc(-0.3px * var(--mo-look-y, 1.1) * var(--mo-amp)); }
  100% { translate: 0; }
}

@keyframes mo-wrap {
  0%, 15% { scale: 1; rotate: none; }
  16.5%, 31% {
    scale: calc(1 - 0.0176 * var(--mo-look-mx, 1.4) * var(--mo-amp) + 0.008 * var(--mo-look-x, 1.4) * var(--mo-wrap, 1) * var(--mo-amp)) calc(1 - 0.027 * var(--mo-look-my, 1.1) * var(--mo-amp));
    rotate: calc(0.648deg * var(--mo-look-x, 1.4) * var(--mo-look-y, 1.1) * var(--mo-wrap, 1) * var(--mo-amp));
  }
  32.5%, 47% {
    scale: calc(1 - 0.022 * var(--mo-look-mx, 1.4) * var(--mo-amp) - 0.01 * var(--mo-look-x, 1.4) * var(--mo-wrap, 1) * var(--mo-amp)) calc(1 - 0.003 * var(--mo-look-my, 1.1) * var(--mo-amp));
    rotate: calc(0.09deg * var(--mo-look-x, 1.4) * var(--mo-look-y, 1.1) * var(--mo-wrap, 1) * var(--mo-amp));
  }
  48.5%, 63% {
    scale: calc(1 - 0.0033 * var(--mo-look-mx, 1.4) * var(--mo-amp) + 0.0015 * var(--mo-look-x, 1.4) * var(--mo-wrap, 1) * var(--mo-amp)) calc(1 - 0.0255 * var(--mo-look-my, 1.1) * var(--mo-amp));
    rotate: calc(-0.115deg * var(--mo-look-x, 1.4) * var(--mo-look-y, 1.1) * var(--mo-wrap, 1) * var(--mo-amp));
  }
  64.5%, 79% {
    scale: calc(1 - 0.0165 * var(--mo-look-mx, 1.4) * var(--mo-amp) - 0.0075 * var(--mo-look-x, 1.4) * var(--mo-wrap, 1) * var(--mo-amp)) calc(1 - 0.024 * var(--mo-look-my, 1.1) * var(--mo-amp));
    rotate: calc(-0.54deg * var(--mo-look-x, 1.4) * var(--mo-look-y, 1.1) * var(--mo-wrap, 1) * var(--mo-amp));
  }
  80.5%, 98.5% {
    scale: calc(1 - 0.022 * var(--mo-look-mx, 1.4) * var(--mo-amp) + 0.01 * var(--mo-look-x, 1.4) * var(--mo-wrap, 1) * var(--mo-amp)) calc(1 - 0.0045 * var(--mo-look-my, 1.1) * var(--mo-amp));
    rotate: calc(0.135deg * var(--mo-look-x, 1.4) * var(--mo-look-y, 1.1) * var(--mo-wrap, 1) * var(--mo-amp));
  }
  100% { scale: 1; rotate: none; }
}

/* Gaze Tracking Rules */
.mo-root .mo-eye {
  --mo-gz-dx: calc(var(--mo-gz-dx1, 0) + (var(--mo-gz-dx2, 0) - var(--mo-gz-dx1, 0)) * var(--mo-sel));
  --mo-gz-dy: calc(var(--mo-gz-dy1, 0) + (var(--mo-gz-dy2, 0) - var(--mo-gz-dy1, 0)) * var(--mo-sel));
  --mo-gz-sx: calc(var(--mo-gz-sx1, 1) + (var(--mo-gz-sx2, 1) - var(--mo-gz-sx1, 1)) * var(--mo-sel));
  --mo-gz-sy: calc(var(--mo-gz-sy1, 1) + (var(--mo-gz-sy2, 1) - var(--mo-gz-sy1, 1)) * var(--mo-sel));
  --mo-gz-t: calc(var(--mo-gz-t1, 0) + (var(--mo-gz-t2, 0) - var(--mo-gz-t1, 0)) * var(--mo-sel));
  translate: calc((var(--mo-edx) * var(--mo-wrap, 1) + var(--mo-gz-dx)) * 1px) calc((var(--mo-edy) + var(--mo-edy2) * var(--mo-ph) + var(--mo-gz-dy)) * 1px);
  rotate: calc((var(--mo-t) * var(--mo-wrap, 1) - var(--mo-lean, 0) * var(--mo-lock) + var(--mo-gz-t)) * 1deg);
  transform: rotate(calc(var(--mo-lean, 0) * 1deg)) scaleX(calc(var(--mo-x) * var(--mo-gz-sx))) scaleY(calc(var(--mo-y) * var(--mo-gz-sy))) rotate(calc(var(--mo-lean, 0) * -1deg));
}

svg:has(> .mo-root) {
  --mo-look-seed-x: var(--mo-look-x, 1.4);
  --mo-look-seed-y: var(--mo-look-y, 1.1);
  --mo-look-seed-mx: var(--mo-look-mx, 1.4);
  --mo-look-seed-my: var(--mo-look-my, 1.1);
}

.mo-root {
  --mo-look-x: calc(var(--mo-look-seed-x, 1.4) * (1 - var(--mo-track-hold)));
  --mo-look-y: calc(var(--mo-look-seed-y, 1.1) * (1 - var(--mo-track-hold)));
  --mo-look-mx: calc(var(--mo-look-seed-mx, 1.4) * (1 - var(--mo-track-hold)));
  --mo-look-my: calc(var(--mo-look-seed-my, 1.1) * (1 - var(--mo-track-hold)));
}

@media not ((hover: hover) and (pointer: fine)) {
  .mo-root:hover { --mo-amp: 0; transform: none; }
  .mo-root.mo-always { --mo-amp: 1; }
  .mo-root:not(.mo-always), .mo-root:not(.mo-always) * { animation-play-state: paused; }
  .mo-root.mo-expr:not(.mo-always) .mo-eye { animation-play-state: running; }
}

@media (prefers-reduced-motion: reduce) {
  .mo-root, .mo-breathe, .mo-bob, .mo-eyes, .mo-eye, .mo-eye > * {
    animation: none;
    transition: none;
  }
  .mo-bob > g:not(.mo-eyes) { transition: none; }
}

/* ═══════════════════════════════════════════════════════════
   BEUI DATA TABLE — beui.dev/components/motion/table
   Virtualized, sortable, resizable, sticky header, selection
   ═══════════════════════════════════════════════════════════ */

.be-table-root {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.be-table-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  font-size: 12px;
  color: var(--color-text-muted);
  user-select: none;
}

.be-table-rows-count {
  font-weight: 400;
  color: var(--color-text-muted);
}

.be-table-selected-count {
  font-weight: 500;
  color: var(--color-primary);
}

.be-table-container {
  background-color: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl, 16px);
  box-shadow: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
}

[data-theme="dark"] .be-table-container {
  background-color: var(--bg-card);
  border-color: var(--color-border);
}

.be-table-scroll-viewport {
  overflow: auto;
  width: 100%;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.be-table-scroll-viewport::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.be-table-scroll-viewport::-webkit-scrollbar-track {
  background: transparent;
}

.be-table-scroll-viewport::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: 9999px;
}

.be-table-scroll-viewport::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-text-muted);
}

.be-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  text-align: left;
  table-layout: fixed;
  font-size: 13.5px;
}

.be-table-th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: none;
  letter-spacing: normal;
  user-select: none;
  height: 52px;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

[data-theme="dark"] .be-table-th {
  background-color: var(--bg-card);
  border-bottom-color: var(--color-border);
  color: var(--color-text-muted);
}

.be-table-th-inner {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0 12px;
  overflow: hidden;
  gap: 2px;
  box-sizing: border-box;
}

.be-table-th-select,
.be-table-td-select {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  padding: 0 !important;
  text-align: center;
}

.be-table-checkbox-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* BeUI Squircle Button Checkbox */
.be-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1.5px solid rgba(0, 0, 0, 0.28);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
  outline: none;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.be-checkbox:hover {
  border-color: rgba(0, 0, 0, 0.6);
}

.be-checkbox:active {
  transform: scale(0.92);
}

.be-checkbox.is-checked,
.be-checkbox.is-indeterminate {
  background-color: #00a460 !important;
  border-color: #00a460 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 164, 96, 0.3);
}

[data-theme="dark"] .be-checkbox {
  border-color: rgba(255, 255, 255, 0.24);
  background: transparent;
}

[data-theme="dark"] .be-checkbox:hover {
  border-color: rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] .be-checkbox.is-checked,
[data-theme="dark"] .be-checkbox.is-indeterminate {
  background-color: #00a460 !important;
  border-color: #00a460 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(0, 164, 96, 0.45);
}

.be-checkbox-icon {
  display: block;
  stroke: currentColor;
}

/* 6-dot vertical grip icon (GripVertical) */
.be-table-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 100%;
  color: var(--color-text-muted, #8e8e99);
  opacity: 0.25;
  cursor: grab;
  border: none;
  background: transparent;
  padding: 0;
  margin-right: 2px;
  transition: opacity 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.be-table-th:hover .be-table-grip {
  opacity: 0.75;
  color: var(--color-text-primary);
}

.be-table-grip:active {
  cursor: grabbing;
}

.be-table-th-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  letter-spacing: inherit;
  outline: none;
  transition: color var(--transition-fast);
  min-width: 0;
  overflow: hidden;
}

.be-table-th-btn:hover {
  color: var(--color-text-primary);
}

.be-table-th.be-th-sorted .be-table-th-btn {
  color: var(--color-text-primary);
}

.be-table-th-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  font-size: 13px;
}

.be-table-th-static {
  display: inline-flex;
  align-items: center;
  height: 100%;
}

.be-table-sort-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  margin-left: 2px;
  transform: rotate(0deg);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
  flex-shrink: 0;
}

.be-table-th:hover .be-table-sort-chevron {
  opacity: 0.35;
}

.be-table-sort-chevron.is-active {
  opacity: 1 !important;
  color: var(--color-text-primary);
}

.be-table-sort-chevron.is-desc {
  transform: rotate(180deg);
}

.be-table-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 20;
  user-select: none;
  touch-action: none;
}

.be-table-resize-handle::after {
  content: "";
  position: absolute;
  top: 25%;
  bottom: 25%;
  right: 0;
  width: 2px;
  background-color: transparent;
  transition: background-color 0.15s ease;
}

.be-table-resize-handle:hover::after,
.be-table-resize-handle.is-resizing::after {
  background-color: var(--color-primary, #00a460);
}

body.be-table-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}

.be-table-row {
  height: 52px;
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--transition-fast);
}

.be-table-row:last-child {
  border-bottom: none;
}

.be-table-row:hover {
  background-color: var(--bg-hover);
}

[data-theme="light"] .be-table-row {
  border-bottom-color: var(--color-border);
}

[data-theme="light"] .be-table-row:hover {
  background-color: var(--bg-hover);
}

[data-theme="dark"] .be-table-row {
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .be-table-row:hover {
  background-color: var(--bg-hover);
}

.be-table-row.is-selected {
  background-color: rgba(0, 164, 96, 0.08) !important;
}

[data-theme="light"] .be-table-row.is-selected {
  background-color: rgba(0, 164, 96, 0.06) !important;
}

[data-theme="dark"] .be-table-row.is-selected {
  background-color: rgba(0, 164, 96, 0.12) !important;
}

.be-table-td {
  padding: 0 12px;
  color: var(--color-text-secondary);
  font-size: 13.5px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.be-tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.be-align-left {
  text-align: left;
}

.be-align-center {
  text-align: center;
}

.be-align-right {
  text-align: right;
}

.be-align-right .be-table-th-inner,
.be-align-right .be-table-th-btn {
  justify-content: flex-end;
}

.be-table-th-spacer,
.be-table-td-spacer {
  padding: 0 !important;
  width: 1px !important;
}

.be-table-empty-cell {
  padding: 48px 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}

.be-skeleton-pulse {
  background-color: var(--bg-hover);
  animation: beSkeletonPulse 1.6s ease-in-out infinite;
}

@keyframes beSkeletonPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.95; }
}

/* ═══════════════════════════════════════════════════════════
   BEUI STATUS PILLS — Matching official BeUI badges
   ═══════════════════════════════════════════════════════════ */
.be-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}

.be-status-active,
.be-status-paid,
.be-status-accepted,
.be-status-done {
  background-color: rgba(16, 185, 129, 0.12);
  color: #10b981;
}
[data-theme="dark"] .be-status-active,
[data-theme="dark"] .be-status-paid,
[data-theme="dark"] .be-status-accepted,
[data-theme="dark"] .be-status-done {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.be-status-invited,
.be-status-sent,
.be-status-pending,
.be-status-partial,
.be-status-paused {
  background-color: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}
[data-theme="dark"] .be-status-invited,
[data-theme="dark"] .be-status-sent,
[data-theme="dark"] .be-status-pending,
[data-theme="dark"] .be-status-partial,
[data-theme="dark"] .be-status-paused {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.be-status-converted {
  background-color: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}
[data-theme="dark"] .be-status-converted {
  background-color: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.be-status-suspended,
.be-status-overdue,
.be-status-rejected,
.be-status-cancelled,
.be-status-expired,
.be-status-inactive {
  background-color: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
}
[data-theme="dark"] .be-status-suspended,
[data-theme="dark"] .be-status-overdue,
[data-theme="dark"] .be-status-rejected,
[data-theme="dark"] .be-status-cancelled,
[data-theme="dark"] .be-status-expired,
[data-theme="dark"] .be-status-inactive {
  background-color: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

.be-status-draft,
.be-status-contingency,
.be-status-portal_pending,
.be-status-completed {
  background-color: rgba(148, 163, 184, 0.12);
  color: #64748b;
}
[data-theme="dark"] .be-status-draft,
[data-theme="dark"] .be-status-contingency,
[data-theme="dark"] .be-status-portal_pending,
[data-theme="dark"] .be-status-completed {
  background-color: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}


@media (prefers-reduced-motion: reduce) {
  .be-table-sort-chevron {
    transition: none !important;
  }
  .be-skeleton-pulse {
    animation: none !important;
  }
}

@media (max-width: 640px) {
  .be-table-root,
  .be-table-mount,
  .be-table-container {
    display: none !important;
  }
}






/* ═══════════════════════════════════════════════════════════════
   GRIDBASE OFFICIAL STATISTICS, KPIS, EQUALIZERS & CHARTS
   ═══════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════
                       DASHBOARD v5 — Reference-based Redesign
                       ═══════════════════════════════════════════ */
                    .db {
                        display: flex;
                        flex-direction: column;
                        gap: 20px;
                        width: 100%;
                        padding-bottom: 24px;
                        animation: dbIn 0.35s ease both;
                    }
                    @keyframes dbIn {
                        from { opacity: 0; transform: translateY(6px); }
                        to   { opacity: 1; transform: none; }
                    }

                    /* ── Top Header ── */
                    .db-header {
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                    }
                    .db-welcome {
                        font-size: 28px;
                        font-weight: 700;
                        color: var(--color-text-primary);
                        letter-spacing: -0.025em;
                        line-height: 1.15;
                        display: inline-block;
                        cursor: default;
                        user-select: none;
                        -webkit-user-select: none;
                    }
                    .db-date {
                        display: inline-flex;
                        align-items: center;
                        gap: 8px;
                        font-size: 13px;
                        font-weight: 500;
                        color: var(--color-text-secondary);
                        background: var(--bg-card);
                        border: 1px solid var(--color-border);
                        border-radius: var(--radius-md);
                        padding: 7px 14px;
                    }
                    .db-date svg { width: 15px; height: 15px; color: var(--color-text-muted); }

                    /* ── Top 3 KPI Row ── */
                    .db-kpi-row {
                        display: grid;
                        grid-template-columns: 1.4fr 1fr 1fr;
                        gap: 16px;
                    }
                    .db-kpi {
                        background: var(--bg-card);
                        border: 1px solid var(--color-border);
                        border-radius: 20px;
                        padding: 22px 24px;
                        box-shadow: var(--shadow-sm);
                        display: flex;
                        flex-direction: column;
                        transition: border-color 0.2s ease, background-color 0.2s ease;
                    }
                    [data-theme="dark"] .db-kpi {
                        background: #0e0f11;
                        border: 1px solid rgba(255, 255, 255, 0.07);
                        border-radius: 20px;
                        color: #f2f1ee;
                        box-shadow: none;
                    }
                    [data-theme="dark"] .db-kpi:hover {
                        border-color: rgba(255, 255, 255, 0.12);
                    }
                    .db-kpi-top {
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                        margin-bottom: 14px;
                    }
                    .db-kpi-label {
                        font-size: 13px;
                        font-weight: 500;
                        color: var(--color-text-secondary);
                    }
                    .db-kpi-caption-sub {
                        font-size: 11px;
                        font-weight: 600;
                        color: var(--color-text-muted);
                        text-transform: uppercase;
                        letter-spacing: 0.05em;
                        opacity: 0.75;
                    }
                    .db-kpi-quick-actions {
                        display: inline-flex;
                        align-items: center;
                        gap: 6px;
                    }
                    .db-kpi-action-pill {
                        display: inline-flex;
                        align-items: center;
                        gap: 5px;
                        padding: 4px 10px;
                        font-size: 11.5px;
                        font-weight: 600;
                        border-radius: 9999px;
                        background: var(--bg-hover);
                        color: var(--color-text-secondary);
                        border: 1px solid var(--color-border);
                        text-decoration: none;
                        transition: all 0.16s ease;
                        line-height: 1.2;
                    }
                    [data-theme="dark"] .db-kpi-action-pill {
                        background: rgba(255, 255, 255, 0.05);
                        border-color: rgba(255, 255, 255, 0.09);
                        color: #f2f1ee;
                    }
                    .db-kpi-action-pill:hover {
                        background: var(--color-border);
                        color: var(--color-text-primary);
                        transform: translateY(-1px);
                    }
                    [data-theme="dark"] .db-kpi-action-pill:hover {
                        background: rgba(255, 255, 255, 0.12);
                        border-color: rgba(255, 255, 255, 0.2);
                        color: #ffffff;
                    }
                    .db-kpi-action-pill svg {
                        width: 12px;
                        height: 12px;
                        opacity: 0.8;
                    }
                    .db-kpi-amount {
                        font-size: 30px;
                        font-weight: 800;
                        color: var(--color-text-primary);
                        letter-spacing: -0.03em;
                        line-height: 1.1;
                    }
                    [data-theme="dark"] .db-kpi-amount {
                        color: #f2f1ee;
                    }
                    .db-kpi-tag {
                        display: inline-flex;
                        align-items: center;
                        gap: 3px;
                        font-size: 12px;
                        font-weight: 600;
                        padding: 3px 8px;
                        border-radius: var(--radius-full);
                        margin-left: 10px;
                        vertical-align: middle;
                    }
                    .db-kpi-tag.up {
                        background: var(--color-success-bg);
                        color: var(--color-success-text);
                    }
                    .db-kpi-tag.down {
                        background: var(--color-danger-bg);
                        color: var(--color-danger-text);
                    }
                    .db-kpi-tag svg { width: 11px; height: 11px; }
                    .db-kpi-compare {
                        font-size: 12px;
                        color: var(--color-text-muted);
                        margin-top: 8px;
                    }
                    .db-kpi-compare .trend-val { font-weight: 600; }
                    .db-kpi-compare .trend-val.up { color: var(--color-success-icon); }
                    .db-kpi-compare .trend-val.down { color: var(--color-danger-icon); }

                    /* ── Bencho ProgressTicks Component ── */
                    .tik-wrap {
                        margin-top: auto;
                        padding-top: 16px;
                        display: flex;
                        flex-direction: column;
                        width: 100%;
                    }
                    .tik-head {
                        align-items: baseline;
                        justify-content: space-between;
                        margin-bottom: 8px;
                        display: flex;
                    }
                    .tik-stat {
                        display: flex;
                        align-items: baseline;
                        gap: 8px;
                    }
                    .tik-fig {
                        font-family: inherit;
                        letter-spacing: -0.035em;
                        color: var(--color-text-primary);
                        font-variant-numeric: tabular-nums;
                        font-size: 26px;
                        font-weight: 700;
                        line-height: 1;
                    }
                    [data-theme="dark"] .tik-fig {
                        color: #f2f1ee;
                    }
                    .tik-fig i {
                        opacity: 0.35;
                        margin-left: 2px;
                        font-size: 15px;
                        font-style: normal;
                        font-weight: 500;
                    }
                    .tik-delta {
                        font-family: inherit;
                        letter-spacing: 0.01em;
                        color: var(--color-text-muted);
                        opacity: 0;
                        font-variant-numeric: tabular-nums;
                        font-size: 13px;
                        font-weight: 600;
                        transition: opacity 0.14s ease, color 0.14s ease;
                    }
                    .tik-delta[data-show="true"] {
                        opacity: 1;
                    }
                    .tik-delta[data-up="true"] {
                        color: #10b981;
                    }
                    .tik-delta[data-up="false"] {
                        color: #ef4444;
                    }

                    .tick-row {
                        touch-action: pan-y;
                        border-radius: 6px;
                        align-items: flex-end;
                        gap: 2.5px;
                        height: 46px;
                        display: flex;
                        width: 100%;
                        overflow: hidden;
                        cursor: crosshair;
                        user-select: none;
                        -webkit-user-select: none;
                        padding: 2px 0;
                    }
                    .tick {
                        background: rgba(242, 241, 238, 0.16);
                        border-radius: 2px;
                        flex: 1;
                        min-width: 2px;
                        transform-origin: bottom;
                        transition: background 0.16s ease, height 0.32s cubic-bezier(0.22, 1, 0.36, 1), transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
                    }
                    [data-theme="light"] .tick {
                        background: rgba(23, 23, 26, 0.12);
                    }
                    .tick[data-on="true"] {
                        background: #f2f1ee;
                    }
                    [data-theme="light"] .tick[data-on="true"] {
                        background: #18181b;
                    }
                    .tick[data-frontier="true"],
                    .tick[data-cursor="true"] {
                        background: #10b981 !important;
                    }

                    /* Main KPI extra elements */
                    .db-kpi-main-amount-row { display: flex; align-items: baseline; }
                    .db-kpi-main .db-kpi-amount { font-size: 34px; }
                    .db-kpi-main .db-kpi-meta {
                        font-size: 13px;
                        color: var(--color-text-muted);
                        margin-top: 6px;
                        display: flex;
                        align-items: center;
                        gap: 8px;
                    }
                    .db-kpi-actions {
                        display: flex;
                        gap: 8px;
                        margin-top: 18px;
                    }
                    .db-kpi-btn {
                        padding: 8px 18px;
                        font-size: 13px;
                        font-weight: 600;
                        border-radius: var(--radius-md);
                        cursor: pointer;
                        transition: all 0.15s ease;
                        text-decoration: none;
                        display: inline-flex;
                        align-items: center;
                        gap: 6px;
                        border: none;
                    }
                    .db-kpi-btn svg { width: 15px; height: 15px; }
                    .db-kpi-btn-primary {
                        background: #111827;
                        color: #FFFFFF;
                    }
                    [data-theme="dark"] .db-kpi-btn-primary {
                        background: #F9FAFB;
                        color: #111827;
                    }
                    .db-kpi-btn-primary:hover { opacity: 0.88; }
                    .db-kpi-btn-secondary {
                        background: var(--bg-hover);
                        color: var(--color-text-primary);
                        border: 1px solid var(--color-border);
                    }
                    .db-kpi-btn-secondary:hover { background: var(--color-border); }

                    /* ── Two-column Body ── */
                    .db-body {
                        display: grid;
                        grid-template-columns: 1fr 1.5fr;
                        gap: 16px;
                        align-items: start;
                    }
                    .db-col {
                        display: flex;
                        flex-direction: column;
                        gap: 16px;
                    }

                    /* ── Card Wrapper (shared) ── */
                    .db-card {
                        background: var(--bg-card);
                        border: 1px solid var(--color-border);
                        border-radius: var(--radius-xl);
                        box-shadow: var(--shadow-sm);
                        overflow: hidden;
                    }
                    .db-card-head {
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                        padding: 18px 24px 14px;
                    }
                    .db-card-title {
                        font-size: 16px;
                        font-weight: 700;
                        color: var(--color-text-primary);
                    }
                    .db-card-badge {
                        font-size: 12px;
                        font-weight: 500;
                        color: var(--color-text-muted);
                        background: var(--bg-hover);
                        padding: 4px 12px;
                        border-radius: var(--radius-full);
                        border: 1px solid var(--color-border);
                    }

                    /* ── Activity Table ── */
                    .db-activity-head {
                        display: grid;
                        grid-template-columns: 1fr auto auto;
                        gap: 16px;
                        padding: 0 24px 10px;
                        font-size: 11px;
                        font-weight: 600;
                        color: var(--color-text-muted);
                        text-transform: uppercase;
                        letter-spacing: 0.04em;
                    }
                    .db-activity-row {
                        display: grid;
                        grid-template-columns: 1fr auto auto;
                        gap: 16px;
                        align-items: center;
                        padding: 14px 24px;
                        border-top: 1px solid var(--color-border);
                        text-decoration: none;
                        color: inherit;
                        transition: background 0.12s ease;
                    }
                    .db-activity-row:hover { background: var(--bg-hover); }
                    .db-activity-who {
                        display: flex;
                        align-items: center;
                        gap: 12px;
                        min-width: 0;
                    }
                    .db-activity-avatar {
                        width: 36px; height: 36px;
                        border-radius: var(--radius-full);
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        font-weight: 700;
                        font-size: 13px;
                        flex-shrink: 0;
                        color: #FFFFFF;
                        overflow: hidden;
                    }
                    .db-activity-avatar svg,
                    .db-activity-avatar img {
                        width: 100%;
                        height: 100%;
                        display: block;
                        border-radius: inherit;
                        object-fit: cover;
                    }
                    .db-av-green  { background: #059669; }
                    .db-av-blue   { background: #2563EB; }
                    .db-av-purple { background: #7C3AED; }
                    .db-av-amber  { background: #D97706; }
                    .db-av-red    { background: #DC2626; }
                    .db-av-gray   { background: #6B7280; }
                    .db-activity-name {
                        font-size: 13px;
                        font-weight: 600;
                        color: var(--color-text-primary);
                        white-space: nowrap;
                        overflow: hidden;
                        text-overflow: ellipsis;
                    }
                    .db-activity-sub {
                        font-size: 12px;
                        color: var(--color-text-muted);
                        margin-top: 1px;
                    }
                    .db-activity-date {
                        font-size: 13px;
                        color: var(--color-text-secondary);
                        white-space: nowrap;
                    }
                    .db-activity-amount {
                        font-size: 14px;
                        font-weight: 700;
                        white-space: nowrap;
                        text-align: right;
                    }
                    .db-amount-positive { color: var(--color-success-icon); }
                    .db-amount-neg { color: var(--color-text-primary); }
                    .db-amount-danger { color: #dc2626; font-weight: 700; }
                    .db-amount-zero { color: var(--color-text-muted); font-weight: 600; }

                    /* ── Cashflow / Chart Card ── */
                    .db-chart-info {
                        padding: 0 24px 4px;
                    }
                    .db-chart-label {
                        font-size: 12px;
                        color: var(--color-text-muted);
                        font-weight: 500;
                    }
                    .db-chart-amount-row {
                        display: flex;
                        align-items: baseline;
                        gap: 10px;
                        margin-top: 4px;
                    }
                    .db-chart-amount {
                        font-size: 28px;
                        font-weight: 800;
                        color: var(--color-text-primary);
                        letter-spacing: -0.03em;
                    }
                    .db-chart-legend {
                        display: flex;
                        align-items: center;
                        gap: 8px;
                        margin-left: auto;
                        align-self: center;
                    }
                    .db-legend-btn {
                        display: inline-flex;
                        align-items: center;
                        gap: 6px;
                        padding: 4px 10px;
                        border-radius: 9999px;
                        border: 1px solid var(--color-border);
                        background: var(--bg-hover);
                        font-size: 11px;
                        font-weight: 600;
                        color: var(--color-text-secondary);
                        cursor: pointer;
                        transition: all 0.15s ease;
                        user-select: none;
                        line-height: 1;
                        outline: none;
                    }
                    .db-legend-btn:hover {
                        background: var(--color-border);
                        color: var(--color-text-primary);
                        transform: translateY(-1px);
                    }
                    .db-legend-btn:active {
                        transform: translateY(0);
                    }
                    .db-legend-btn.is-hidden {
                        opacity: 0.45;
                        background: transparent;
                        border-style: dashed;
                        color: var(--color-text-muted);
                    }
                    .db-legend-btn.is-hidden .db-legend-dot {
                        filter: grayscale(1);
                        opacity: 0.5;
                    }
                    .db-legend-dot {
                        width: 8px;
                        height: 8px;
                        border-radius: 50%;
                        flex-shrink: 0;
                        transition: transform 0.15s ease;
                    }
                    .db-legend-btn:hover .db-legend-dot {
                        transform: scale(1.2);
                    }
                    .db-area-chart {
                        width: 100%;
                        min-height: 220px;
                        padding: 0 12px;
                    }

                    /* ── Overdue Section ── */
                    .db-overdue-item {
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                        padding: 14px 24px;
                        border-top: 1px solid var(--color-border);
                        text-decoration: none;
                        color: inherit;
                        transition: background 0.12s ease;
                    }
                    .db-overdue-item:hover { background: var(--bg-hover); }
                    .db-overdue-left {
                        display: flex;
                        flex-direction: column;
                    }
                    .db-overdue-name {
                        font-size: 14px;
                        font-weight: 700;
                        color: var(--color-text-primary);
                    }
                    .db-overdue-sub {
                        font-size: 12px;
                        color: var(--color-text-muted);
                        margin-top: 1px;
                    }
                    .db-overdue-amount {
                        font-size: 15px;
                        font-weight: 800;
                        color: var(--color-text-primary);
                        letter-spacing: -0.02em;
                    }
                    .db-overdue-bar-wrap {
                        margin-top: 8px;
                        width: 100%;
                        height: 6px;
                        background: var(--bg-hover);
                        border-radius: var(--radius-full);
                        overflow: hidden;
                    }
                    .db-overdue-bar {
                        height: 100%;
                        border-radius: var(--radius-full);
                        background: var(--color-danger-icon);
                        transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
                    }

                    /* Overdue split cards */
                    .db-overdue-grid {
                        display: grid;
                        grid-template-columns: 1fr 1fr;
                        gap: 0;
                    }
                    .db-overdue-cell {
                        padding: 18px 20px;
                        border-top: 1px solid var(--color-border);
                        text-decoration: none;
                        color: inherit;
                        transition: background 0.12s ease;
                    }
                    .db-overdue-cell:first-child {
                        border-right: 1px solid var(--color-border);
                    }
                    .db-overdue-cell:hover { background: var(--bg-hover); }
                    .db-overdue-cell-title {
                        font-size: 13px;
                        font-weight: 700;
                        color: var(--color-text-primary);
                    }
                    .db-overdue-cell-sub {
                        font-size: 11px;
                        color: var(--color-text-muted);
                        margin-top: 1px;
                    }
                    .db-overdue-cell-amount {
                        font-size: 16px;
                        font-weight: 800;
                        color: var(--color-text-primary);
                        margin-top: 6px;
                        letter-spacing: -0.02em;
                    }

                    /* Pulse dot */
                    .db-pulse {
                        width: 7px; height: 7px;
                        border-radius: 50%;
                        background: var(--color-danger-icon);
                        display: inline-block;
                        margin-right: 6px;
                        box-shadow: 0 0 0 0 rgba(239,68,68,0.6);
                        animation: dbPulse 2s infinite;
                    }
                    @keyframes dbPulse {
                        0%  { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
                        70% { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
                        100%{ box-shadow: 0 0 0 0 rgba(239,68,68,0); }
                    }

                    .db-empty {
                        padding: 32px 24px;
                        text-align: center;
                        color: var(--color-text-muted);
                        font-size: 13px;
                    }

                    /* Desktop-hidden mobile elements */
                    .db-mobile-logo-wrap,
                    .db-mobile-brand-section,
                    .db-welcome-mobile { display: none !important; }
                    .db-mobile-cards { display: none; }
                    .db-mobile-overdue-pill { display: none; }
                    .db-mobile-date-chip { display: none; }
                    .highlight-tax { color: #D97706; }
                    [data-theme="dark"] .highlight-tax { color: #FCD34D; }

                    /* ═══ Responsive ═══ */
                    @media (max-width: 1100px) {
                        .db-kpi-row { grid-template-columns: 1fr 1fr; }
                        .db-kpi-main { grid-column: 1 / -1; }
                        .db-kpi-main .db-kpi-amount { font-size: 28px; }
                    }
                    @media (max-width: 960px) {
                        .db-body { grid-template-columns: 1fr; }
                    }

                    /* ── Minimalist Mobile Dashboard (<= 768px / iPhone & Smartphones) ── */
                    @media (max-width: 768px) {
                        .db {
                            padding: 8px 16px calc(84px + env(safe-area-inset-bottom, 0px));
                            gap: 20px;
                        }

                        /* Header — hidden on mobile */
                        .db-header { display: none !important; }

                        /* Centered Bills Logo & Mobile Greeting */
                        .db-mobile-brand-section {
                            display: flex !important;
                            flex-direction: column;
                            align-items: center;
                            justify-content: center;
                            width: 100%;
                            padding-top: 24px;
                            margin-bottom: 2px;
                            text-align: center;
                        }
                        .db-mobile-logo-wrap {
                            display: flex !important;
                            justify-content: center;
                            align-items: center;
                            width: 100%;
                            margin-bottom: 12px;
                        }
                        .db-welcome-mobile {
                            display: block !important;
                            font-size: 22px;
                            font-weight: 700;
                            color: var(--color-text-primary);
                            letter-spacing: -0.025em;
                            line-height: 1.2;
                            text-align: center;
                            cursor: pointer;
                            user-select: none;
                            -webkit-user-select: none;
                            margin: 0 0 2px 0;
                        }
                        .db-mobile-logo {
                            height: 115px;
                            width: auto;
                            object-fit: contain;
                            user-select: none;
                            -webkit-user-drag: none;
                            filter: drop-shadow(0 0 24px rgba(0, 164, 96, 0.45)) drop-shadow(0 0 120px rgba(0, 164, 96, 0.25));
                            transition: filter 0.3s ease;
                        }
                        .db-logo-dark { display: none !important; }
                        .db-logo-light { display: block !important; }

                        [data-theme="dark"] .db-logo-light { display: none !important; }
                        [data-theme="dark"] .db-logo-dark { display: block !important; }
                        [data-theme="dark"] .db-mobile-logo {
                            filter: drop-shadow(0 0 24px rgba(0, 164, 96, 0.6)) drop-shadow(0 0 164px rgba(0, 164, 96, 0.3));
                        }

                        /* Hero Balance — Mobile */
                        .db-kpi-main {
                            grid-column: 1 / -1;
                            padding: 20px 20px 18px !important;
                            background: var(--bg-card) !important;
                            border: 1px solid var(--color-border) !important;
                            border-radius: 20px !important;
                            box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
                            text-align: center !important;
                            display: flex !important;
                            flex-direction: column !important;
                            align-items: center !important;
                        }
                        [data-theme="dark"] .db-kpi-main {
                            background: #0e0f11 !important;
                            border: 1px solid rgba(255, 255, 255, 0.07) !important;
                            border-radius: 20px !important;
                            box-shadow: none !important;
                        }
                        .db-kpi-main .db-kpi-top {
                            margin-bottom: 6px;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            gap: 8px;
                        }
                        .db-kpi-main .db-kpi-label {
                            font-size: 13px !important;
                            font-weight: 500 !important;
                            color: var(--color-text-secondary) !important;
                            text-transform: none !important;
                            letter-spacing: normal !important;
                        }
                        .db-kpi-main-amount-row {
                            display: flex !important;
                            align-items: center !important;
                            justify-content: center !important;
                            gap: 8px !important;
                        }
                        .db-kpi-main .db-kpi-amount {
                            font-size: 38px !important;
                            font-weight: 800 !important;
                            letter-spacing: -0.04em !important;
                            color: var(--color-text-primary) !important;
                            line-height: 1.05 !important;
                        }
                        .db-kpi-main .db-kpi-meta {
                            font-size: 12.5px !important;
                            color: var(--color-text-muted) !important;
                            margin-top: 8px !important;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            gap: 6px;
                        }
                        .db-kpi-actions { display: none !important; }

                        /* Mobile Date Chip */
                        .db-mobile-date-chip {
                            display: inline-flex !important;
                            align-items: center;
                            font-size: 11.5px;
                            font-weight: 500;
                            color: var(--color-text-muted);
                            background: var(--bg-hover);
                            padding: 3px 10px;
                            border-radius: var(--radius-full);
                            border: 1px solid var(--color-border);
                        }

                        /* 2 Key Secondary Metrics Only (Facturado & Por Cobrar) */
                        .db-kpi-row {
                            grid-template-columns: 1fr 1fr;
                            gap: 12px;
                        }
                        .db-kpi {
                            padding: 16px 16px;
                            border-radius: 20px;
                            background: var(--bg-card);
                            border: 1px solid var(--color-border);
                            box-shadow: 0 1px 2px rgba(0,0,0,0.02);
                        }
                        [data-theme="dark"] .db-kpi {
                            background: #0e0f11 !important;
                            border-radius: 20px !important;
                            box-shadow: none !important;
                        }
                        .tik-wrap {
                            padding-top: 10px;
                            margin-top: auto;
                            width: 100%;
                        }
                        .tik-fig {
                            font-size: 20px;
                        }
                        .tik-fig i {
                            font-size: 13px;
                        }
                        .tick-row {
                            height: 34px;
                            gap: 1.5px;
                            width: 100%;
                        }
                        .db-kpi-caption-sub {
                            display: none;
                        }
                        .db-kpi-action-pill {
                            display: none !important;
                        }

                        /* Hero Card Specific Equalizer on Mobile (Full-width adapted) */
                        .db-kpi-main .tik-wrap {
                            width: 100% !important;
                            align-self: stretch !important;
                            padding-top: 14px;
                        }
                        .db-kpi-main .tik-head {
                            justify-content: center !important;
                            margin-bottom: 8px;
                        }
                        .db-kpi-main .tick-row {
                            width: 100% !important;
                            height: 42px;
                            gap: 2px;
                        }

                        .db-kpi .db-kpi-top { margin-bottom: 6px; }
                        .db-kpi .db-kpi-label {
                            font-size: 11px !important;
                            font-weight: 600 !important;
                            color: var(--color-text-muted) !important;
                            text-transform: uppercase !important;
                            letter-spacing: 0.04em !important;
                        }
                        .db-kpi .db-kpi-amount {
                            font-size: 19px !important;
                            font-weight: 800 !important;
                            letter-spacing: -0.02em !important;
                            line-height: 1.2 !important;
                        }
                        .db-kpi .db-kpi-compare {
                            font-size: 11px !important;
                            color: var(--color-text-muted) !important;
                            margin-top: 5px !important;
                            white-space: nowrap;
                            overflow: hidden;
                            text-overflow: ellipsis;
                        }

                        /* Overdue Alert Banner */
                        .db-mobile-overdue-pill {
                            display: flex !important;
                            align-items: center;
                            gap: 10px;
                            background: rgba(239, 68, 68, 0.05);
                            border: 1px solid rgba(239, 68, 68, 0.18);
                            border-radius: var(--radius-xl);
                            padding: 12px 16px;
                            text-decoration: none;
                            color: inherit;
                            transition: background 0.15s ease;
                        }
                        .db-mobile-overdue-pill:active {
                            background: rgba(239, 68, 68, 0.1);
                        }
                        .db-overdue-pill-text {
                            font-size: 12.5px;
                            color: var(--color-text-primary);
                            flex: 1;
                        }
                        .db-overdue-pill-amount {
                            font-weight: 700;
                            color: var(--color-danger-icon);
                            margin-left: 2px;
                        }
                        .db-overdue-pill-arrow {
                            color: var(--color-danger-icon);
                            display: flex;
                            align-items: center;
                        }

                        /* Hide desktop Tax card, desktop overdue and desktop exchange rates on mobile */
                        .db-tax-card { display: none !important; }
                        .db-rates-card-desktop { display: none !important; }
                        .db-overdue-card-desktop { display: none !important; }

                        /* Body single column */
                        .db-body { grid-template-columns: 1fr; gap: 20px; }

                        /* Cards */
                        .db-card {
                            border-radius: var(--radius-xl);
                            border: 1px solid var(--color-border);
                            background: var(--bg-card);
                            box-shadow: 0 1px 2px rgba(0,0,0,0.02);
                            overflow: hidden;
                        }
                        .db-card-head {
                            padding: 16px 18px 12px;
                            display: flex;
                            align-items: center;
                            justify-content: space-between;
                            border-bottom: 1px solid var(--color-border);
                        }
                        .db-card-title {
                            font-size: 14.5px;
                            font-weight: 700;
                            color: var(--color-text-primary);
                        }
                        .db-card-badge {
                            font-size: 11px;
                            font-weight: 600;
                            padding: 3px 9px;
                        }

                        /* Chart — Minimalist Sparkline style */
                        .db-chart-info { display: none !important; }
                        .db-area-chart {
                            min-height: 110px !important;
                            padding: 0 4px 6px !important;
                        }

                        /* Activity — Clean, airy list with generous padding */
                        .db-activity-head { display: none !important; }
                        .db-desktop-rows { display: none !important; }
                        .db-mobile-cards {
                            display: flex !important;
                            flex-direction: column;
                        }
                        .db-activity-row {
                            padding: 15px 18px !important;
                            display: grid !important;
                            grid-template-columns: 1fr auto !important;
                            gap: 12px !important;
                            align-items: center !important;
                            border-bottom: 1px solid var(--color-border-subtle, rgba(0,0,0,0.04)) !important;
                            text-decoration: none !important;
                            color: inherit !important;
                            transition: background 0.15s ease;
                        }
                        .db-activity-row:last-child {
                            border-bottom: none !important;
                        }
                        .db-activity-row:active {
                            background: var(--bg-hover) !important;
                        }
                        .db-activity-avatar {
                            width: 34px !important;
                            height: 34px !important;
                            font-size: 12px !important;
                            border-radius: 10px !important;
                        }
                        .db-activity-name {
                            font-size: 13.5px !important;
                            font-weight: 600 !important;
                            color: var(--color-text-primary) !important;
                        }
                        .db-activity-sub {
                            font-size: 11.5px !important;
                            color: var(--color-text-muted) !important;
                            margin-top: 2px !important;
                        }
                        .db-activity-amount {
                            font-size: 14px !important;
                            font-weight: 700 !important;
                        }
                    }

                    /* ── Extra small phones (≤375px, iPhone SE/Mini) ── */
                    @media (max-width: 375px) {
                        .db {
                            padding: 6px 12px calc(84px + env(safe-area-inset-bottom, 0px));
                            gap: 18px;
                        }
                        .db-kpi-main { padding: 16px 14px 14px !important; }
                        .db-kpi-main .db-kpi-amount { font-size: 32px !important; }
                        .db-kpi-main .tick-row { gap: 1.5px !important; height: 36px !important; }
                        .db-kpi .db-kpi-amount { font-size: 17px !important; }
                        .db-activity-row { padding: 13px 14px !important; }
                    }
                    /* ── Tax / ITBIS Widget (Desktop - Segmented Tick Equalizer) ── */
                    .db-tax-card {
                        background: var(--bg-card);
                        border: 1px solid var(--color-border);
                        border-radius: var(--radius-xl);
                        box-shadow: var(--shadow-sm);
                        overflow: hidden;
                    }
                    .db-tax-head {
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                        padding: 18px 24px 14px;
                        border-bottom: 1px solid var(--color-border);
                    }
                    .db-tax-title {
                        display: flex;
                        align-items: center;
                        gap: 10px;
                        font-size: 15px;
                        font-weight: 700;
                        color: var(--color-text-primary);
                    }
                    .db-tax-badge {
                        font-size: 11px;
                        font-weight: 600;
                        padding: 4px 10px;
                        border-radius: var(--radius-full);
                        background: #FEF3C7;
                        color: #92400E;
                        border: 1px solid #FDE68A;
                    }
                    [data-theme="dark"] .db-tax-badge {
                        background: rgba(251,191,36,0.12);
                        color: #FCD34D;
                        border-color: rgba(251,191,36,0.2);
                    }

                    .db-tax-live-pill {
                        font-size: 11px;
                        font-weight: 600;
                        padding: 3px 9px;
                        border-radius: var(--radius-full);
                        background: var(--bg-hover);
                        color: var(--color-text-secondary);
                        border: 1px solid var(--color-border);
                        margin-left: 8px;
                        opacity: 0;
                        transition: opacity 0.2s ease;
                        display: inline-flex;
                        align-items: center;
                        gap: 6px;
                    }
                    .db-tax-live-pill strong {
                        color: var(--color-text-primary);
                    }

                    /* Body & Tick Equalizer Bar */
                    .db-tax-body {
                        padding: 22px 24px 22px;
                    }
                    .db-tax-bar-wrap {
                        margin-bottom: 22px;
                        width: 100%;
                    }
                    .db-tax-bar {
                        display: flex;
                        align-items: flex-end;
                        height: 52px;
                        width: 100%;
                        cursor: crosshair;
                        user-select: none;
                        -webkit-user-select: none;
                        touch-action: pan-y;
                        padding: 2px 0;
                    }
                    .db-tax-segment {
                        display: flex;
                        align-items: flex-end;
                        gap: 3px;
                        height: 52px;
                        min-width: 0;
                        cursor: crosshair;
                        transition: opacity 0.2s ease;
                    }
                    .db-tax-bar.is-hovered .db-tax-segment:not(.is-active) {
                        opacity: 0.35;
                    }
                    .db-tax-seg-gap {
                        flex-shrink: 0;
                    }
                    .db-tax-tick {
                        flex: 1;
                        min-width: 4px;
                        border-radius: 2.5px;
                        transform-origin: bottom;
                        transition: height 0.32s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.16s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
                    }
                    .db-tax-tick.tick-orange {
                        background: #F97316;
                    }
                    [data-theme="dark"] .db-tax-tick.tick-orange {
                        background: #FB923C;
                    }
                    .db-tax-tick.tick-yellow {
                        background: #F59E0B;
                    }
                    [data-theme="dark"] .db-tax-tick.tick-yellow {
                        background: #FBBF24;
                    }
                    .db-tax-tick.tick-muted {
                        background: #E4E4E7;
                    }
                    [data-theme="dark"] .db-tax-tick.tick-muted {
                        background: #3F3F46;
                    }
                    .db-tax-tick[data-cursor="true"] {
                        background: #FFFFFF !important;
                        box-shadow: 0 0 8px rgba(255, 255, 255, 0.85);
                        transform: scaleY(1.1);
                    }
                    [data-theme="light"] .db-tax-tick[data-cursor="true"] {
                        background: #18181b !important;
                        box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
                    }

                    /* 3 Data Columns (Image 1 style with interactive focus) */
                    .db-tax-grid {
                        display: grid;
                        grid-template-columns: repeat(3, minmax(0, 1fr));
                        gap: 20px;
                    }
                    .db-tax-col {
                        display: flex;
                        flex-direction: column;
                        min-width: 0;
                        padding: 8px 12px;
                        margin: -8px -12px;
                        border-radius: var(--radius-lg);
                        transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
                        cursor: pointer;
                    }
                    .db-tax-col:hover,
                    .db-tax-col.is-active {
                        background: var(--bg-hover);
                        transform: translateY(-2px);
                    }
                    .db-tax-col.is-active .db-tax-dot {
                        box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.3);
                    }
                    .db-tax-col.is-active .db-tax-dot.dot-yellow {
                        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.3);
                    }
                    .db-tax-col.is-active .db-tax-dot.dot-muted {
                        box-shadow: 0 0 0 4px rgba(161, 161, 170, 0.3);
                    }
                    .db-tax-col-header {
                        display: flex;
                        align-items: center;
                        gap: 8px;
                        margin-bottom: 6px;
                    }
                    .db-tax-dot {
                        width: 8px;
                        height: 8px;
                        border-radius: 50%;
                        flex-shrink: 0;
                        transition: box-shadow 0.2s ease;
                    }
                    .db-tax-dot.dot-orange {
                        background: #F97316;
                    }
                    [data-theme="dark"] .db-tax-dot.dot-orange {
                        background: #FB923C;
                    }
                    .db-tax-dot.dot-yellow {
                        background: #F59E0B;
                    }
                    [data-theme="dark"] .db-tax-dot.dot-yellow {
                        background: #FBBF24;
                    }
                    .db-tax-dot.dot-muted {
                        background: #A1A1AA;
                    }
                    [data-theme="dark"] .db-tax-dot.dot-muted {
                        background: #71717A;
                    }
                    .db-tax-col-label {
                        font-size: 13.5px;
                        font-weight: 500;
                        color: var(--color-text-secondary);
                        white-space: nowrap;
                        overflow: hidden;
                        text-overflow: ellipsis;
                    }
                    .db-tax-col-amount {
                        font-size: 21px;
                        font-weight: 700;
                        color: var(--color-text-primary);
                        letter-spacing: -0.02em;
                        font-variant-numeric: tabular-nums;
                        line-height: 1.25;
                        white-space: nowrap;
                        overflow: hidden;
                        text-overflow: ellipsis;
                    }
                    .db-tax-col-amount.highlight {
                        color: #D97706;
                    }
                    [data-theme="dark"] .db-tax-col-amount.highlight {
                        color: #FCD34D;
                    }
                    .db-tax-col-sub {
                        font-size: 11px;
                        color: var(--color-text-muted);
                        margin-top: 4px;
                        white-space: nowrap;
                        overflow: hidden;
                        text-overflow: ellipsis;
                    }

                    .db-tax-footer {
                        padding: 12px 24px;
                        background: var(--bg-hover);
                        font-size: 12px;
                        color: var(--color-text-muted);
                        display: flex;
                        align-items: center;
                        gap: 6px;
                        border-top: 1px solid var(--color-border);
                    }
                    .db-tax-footer svg { width: 13px; height: 13px; flex-shrink: 0; }
