@custom-variant dark (&:is(.dark *));

:root {
  --font-size: 16px;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --background: #fff;
  --foreground: oklch(.145 0 0);
  --card: #fff;
  --card-foreground: oklch(.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(.145 0 0);
  --primary: #030213;
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(.95 .0058 264.53);
  --secondary-foreground: #030213;
  --muted: #ececf0;
  --muted-foreground: #717182;
  --accent: #e9ebef;
  --accent-foreground: #030213;
  --destructive: #d4183d;
  --destructive-foreground: #fff;
  --border: #0000001a;
  --input: transparent;
  --input-background: #f3f3f5;
  --switch-background: #cbced4;
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  --ring: oklch(.708 0 0);
  --chart-1: oklch(.646 .222 41.116);
  --chart-2: oklch(.6 .118 184.704);
  --chart-3: oklch(.398 .07 227.392);
  --chart-4: oklch(.828 .189 84.429);
  --chart-5: oklch(.769 .188 70.08);
  --radius: .625rem;
  --sidebar: oklch(.985 0 0);
  --sidebar-foreground: oklch(.145 0 0);
  --sidebar-primary: #030213;
  --sidebar-primary-foreground: oklch(.985 0 0);
  --sidebar-accent: oklch(.97 0 0);
  --sidebar-accent-foreground: oklch(.205 0 0);
  --sidebar-border: oklch(.922 0 0);
  --sidebar-ring: oklch(.708 0 0);
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-input-background: var(--input-background);
  --color-switch-background: var(--switch-background);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }

  body {
    @apply text-foreground;
    background: #0a0e27;
    position: relative;
    overflow-x: hidden;
  }

  body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
      radial-gradient(circle at 20% 50%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
      radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
      radial-gradient(circle at 40% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    animation: gradientMove 20s ease infinite;
    z-index: 0;
    pointer-events: none;
  }

  body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(10, 14, 39, 0.4) 100%);
    z-index: 0;
    pointer-events: none;
  }

  @keyframes gradientMove {

    0%,
    100% {
      transform: translate(0, 0) rotate(0deg);
    }

    33% {
      transform: translate(5%, 5%) rotate(5deg);
    }

    66% {
      transform: translate(-5%, 3%) rotate(-5deg);
    }
  }
}

/**
 * Base typography. Apply base styles unless the element itself has a Tailwind
 * `text-...` class. This keeps these rules simple and broadly compatible
 * across browsers (avoids relying on complex ancestor `:has()` checks).
 */
@layer base {

  /* Apply base typography unless an ancestor explicitly sets Tailwind text utilities */
  h1 {
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
  }

  h2 {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
  }

  h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
  }

  h4 {
    font-size: var(--text-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
  }

  p {
    font-size: var(--text-base);
    font-weight: var(--font-weight-normal);
    line-height: 1.5;
  }

  label {
    font-size: var(--text-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
  }

  button {
    font-size: var(--text-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
  }

  input {
    font-size: var(--text-base);
    font-weight: var(--font-weight-normal);
    line-height: 1.5;
  }

  /* If an ancestor carries a Tailwind `text-` utility, avoid applying these base sizes */
  [class*="text-"] h1,
  [class*="text-"] h2,
  [class*="text-"] h3,
  [class*="text-"] h4,
  [class*="text-"] p,
  [class*="text-"] label,
  [class*="text-"] button,
  [class*="text-"] input {
    font-size: unset;
    font-weight: unset;
    line-height: unset;
  }
}

html {
  font-size: var(--font-size);
}

/* Hide scrollbar by default, show on hover - Modern thick style */
.scrollbar-hidden {
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

.scrollbar-hidden::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.scrollbar-on-hover {
  scrollbar-width: thin;
  /* Firefox */
  scrollbar-color: rgba(6, 182, 212, 0.4) rgba(30, 41, 59, 0.3);
  /* Firefox - cyan scrollbar on dark track */
}

.scrollbar-on-hover::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.scrollbar-on-hover::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.3);
  border-radius: 10px;
  margin: 4px;
}

.scrollbar-on-hover::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.6) 0%, rgba(37, 99, 235, 0.6) 100%);
  border-radius: 10px;
  border: 2px solid rgba(30, 41, 59, 0.3);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.submenu-link:hover {
  transform: translateX(2px);
}

/* Tooltip for collapsed sidebar: show on hover/focus of the parent toggle */
#sidebar.w-\[80px\] .tooltip {
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  transform: translateY(-50%) translateX(0);
  z-index: 40;
}

/* Allow tooltip to escape parent overflow when sidebar is collapsed and show on hover/focus
   for submenu-toggle, nav links and nav buttons */
#sidebar.w-\[80px\] .submenu-toggle,
#sidebar.w-\[80px\] nav a,
#sidebar.w-\[80px\] nav button {
  overflow: visible;
  /* tooltip is positioned outside the element, so allow it to show */
}

#sidebar.w-\[80px\] .submenu-toggle:hover .tooltip,
#sidebar.w-\[80px\] .submenu-toggle:focus .tooltip,
#sidebar.w-\[80px\] .submenu-toggle:focus-within .tooltip,
#sidebar.w-\[80px\] nav a:hover .tooltip,
#sidebar.w-\[80px\] nav a:focus .tooltip,
#sidebar.w-\[80px\] nav a:focus-within .tooltip,
#sidebar.w-\[80px\] nav button:hover .tooltip,
#sidebar.w-\[80px\] nav button:focus .tooltip,
#sidebar.w-\[80px\] nav button:focus-within .tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(6px);
}

/* Ensure tooltip doesn't show when sidebar expanded */
#sidebar:not(.w-\[80px\]) .tooltip {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Helper class toggled by JS when hovering/focusing a collapsed parent */
.tooltip-visible {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(-50%) translateX(6px) !important;
}

/* Floating tooltip appended to body for collapsed sidebar (JS-driven) */
.floating-tooltip {
  position: fixed;
  z-index: 9999;
  background: #0b1220;
  /* matches sidebar tooltip look */
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.6);
  white-space: nowrap;
}


/* Submenu open/close animation helpers */
.submenu {
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  max-height: 0;
  transition: opacity 220ms ease, transform 220ms ease, max-height 260ms ease;
}

.submenu-open {
  opacity: 1;
  transform: translateY(0);
  /* allow height to follow content instead of clamping to a fixed max */
  max-height: none;
}

/* Optional small fade for submenu links */
.submenu-link {
  transition: opacity 160ms ease, transform 160ms ease;
}

.submenu-link:hover {
  transform: translateX(2px);
}

.scrollbar-on-hover::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.8) 0%, rgba(37, 99, 235, 0.8) 100%);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.5);
}

.scrollbar-on-hover::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, rgba(6, 182, 212, 1) 0%, rgba(37, 99, 235, 1) 100%);
}


.table-container {
  max-height: 85vh;
  /* Limit height for scrollability */
  overflow-y: auto;
  border-radius: 1rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Sticky header */
#prospectTable thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Style for the input fields during edit mode */
.edit-input {
  background-color: #1e293b;
  /* slate-800 */
  color: #e2e8f0;
  /* slate-200 */
  border: 1px solid #475569;
  /* slate-600 */
  padding: 4px 8px;
  border-radius: 6px;
  width: 100%;
  font-size: 0.875rem;
  /* text-sm */
  line-height: 1.25rem;
  outline: none;
  transition: border-color 0.2s;
}

.edit-input:focus {
  border-color: #6366f1;
  /* indigo-500 */
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Date input calendar icon styling */
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  border-radius: 4px;
  margin-right: 8px;
  opacity: 1;
  filter: invert(1) brightness(1.2);
  width: 14px;
  height: 14px;
  position: absolute;
  right: 0;
}

input[type="date"] {
  position: relative;
}

/* Themed select and option colors to match requested palette */
select,
select option {
  background: #0f172b !important;
  /* dark navy */
  color: #fff !important;
}

/* Hover state for options (may be honored differently across browsers) */
select option:hover {
  background: #151f33 !important;
  /* slightly lighter navy on hover */
  color: #fff !important;
}

/* On Edge/IE hide the native expand glyph if desired (keeps layout clean) */
select::-ms-expand {
  display: none;
}

/* Firefox: keep option text visible when focused */
select:-moz-focusring {
  color: transparent;
  /* text-shadow: 0 0 0 #fff; */
}

.custom-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.8) transparent;
}

.custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.8);
    border-radius: 999px;
}

@media (max-width: 768px) {
  a[href*="logout.php"] {
    font-size: 0;
    justify-content: center;
    padding-left: 10px;
    padding-right: 0;
  }

  a[href*="logout.php"] svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 400px) {
  header .text-slate-300 {
        font-size: 12px !important;
          line-height: normal  !important;
  }
}