* { box-sizing:border-box; margin:0; padding:0; }
body { font-family:system-ui,sans-serif; background:#fff; color:#333; overflow-x:hidden; }
header { background:#f8f9fa; padding:1rem; border-bottom:1px solid #ddd; }
nav { max-width:960px; margin:0 auto; display:flex; justify-content:space-between; }
.logo { font-size:1.5rem; text-decoration:none; color:#222; }
.button { background:#007bff; color:#fff; padding:0.5em 1em; border-radius:4px; text-decoration:none; }
.button:hover { background:#0056b3; }
button {
  border: 1px solid #d1d5db;
  padding: 0.25rem 0.5rem;
  background-color: #f3f4f6;
  cursor: pointer;
}
button:hover {
  background-color: #e5e7eb;
}
main { max-width:960px; margin:2rem auto; padding:0 1rem; }
footer { text-align:center; padding:1rem; background:#f1f1f1; font-size:0.9rem; }

/* Styles for the floating OpenAI bar */
#openai-bar {
  position: fixed;
  bottom: 16px;
  left: 16px;
  width: 300px;
  max-height: 70vh;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  resize: vertical;
}
#openai-bar header {
  cursor: move;
  background: #f0f0f0;
  padding: 5px 30px 5px 5px;
  font-weight: bold;
  position: relative;
}
#openai-bar header button {
  position: absolute;
  right: 4px;
  top: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: #374151;
}
#openai-bar textarea {
  width: 100%;
  height: 60px;
  resize: vertical;
}
#openai-bar .close-btn {
  color: #374151;
  background: transparent;
  border: none;
  cursor: pointer;
}
#openai-bar .response {
  margin-top: 8px;
  max-height: 150px;
  overflow: auto;
}
#openai-bar button.send-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

#openai-toggle {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 50;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

@media (max-width: 600px) {
  #openai-bar {
    width: 90vw;
    left: 5vw;
    bottom: 10px;
  }
  #openai-toggle {
    left: 10px;
    bottom: 10px;
  }
}

.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
}

.toast {
  background: #f8fafc;
  border: 1px solid #ddd;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  animation: fade-slide 0.3s ease;
  user-select: text;
  white-space: pre-wrap;
  word-break: break-word;
}

.toast-success { color: #16a34a; }
.toast-error { color: #dc2626; }

@keyframes fade-slide {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Sticky layout helpers */
.sticky-header {
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}

.sticky-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
}

.table-container {
  max-height: 70vh;
  overflow-x: auto;
  overflow-y: auto;
}

/* Improve visibility for multi-select lists */
select[multiple] {
  min-height: 8rem;
  min-width: 12rem;
}

/* Joyride tooltip theming */
.react-joyride__tooltip {
  background: #f8fafc;
  color: #0f172a;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.35);
  max-width: min(360px, 90vw);
  z-index: 12020;
}

.react-joyride__spotlight,
.react-joyride__overlay {
  z-index: 12000;
}

.react-joyride__tooltip-header {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.react-joyride__tooltip-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: inherit;
}

.react-joyride__tooltip-content {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #1e293b;
}

.react-joyride__tooltip-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.react-joyride__tooltip-button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease,
    color 0.15s ease, border-color 0.15s ease;
}

.react-joyride__tooltip-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.react-joyride__tooltip-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.react-joyride__tooltip-button--primary {
  --primary: linear-gradient(135deg, #2563eb, #1d4ed8);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
}

.react-joyride__tooltip-button--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(37, 99, 235, 0.35);
}

.react-joyride__tooltip-button--primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

.react-joyride__tooltip-button--back {
  --back: #e2e8f0;
  background: var(--back);
  color: #1f2937;
  border-color: #cbd5f5;
}

.react-joyride__tooltip-button--back:hover:not(:disabled) {
  background: #cbd5f5;
}

.react-joyride__tooltip-button--skip {
  --skip: transparent;
  background: var(--skip);
  color: #475569;
  border-color: transparent;
}

.react-joyride__tooltip-button--skip:hover:not(:disabled) {
  color: #1f2937;
}

.react-joyride__tooltip-button--skip:active:not(:disabled) {
  color: #0f172a;
}

.react-joyride__tooltip-button--end {
  --end: linear-gradient(135deg, #f97316, #ef4444);
  background: var(--end);
  color: #ffffff;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 16px 32px rgba(239, 68, 68, 0.35);
}

.react-joyride__tooltip-button--end:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 22px 40px rgba(239, 68, 68, 0.45);
  filter: brightness(1.05);
}

.react-joyride__tooltip-button--end:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 12px 24px rgba(239, 68, 68, 0.4);
  filter: brightness(0.98);
}

select[multiple] option:checked {
  background-color: #2563eb;
  color: #fff;
}

#sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

/* Sidebar container displays items vertically */
.sidebar {
  display: flex;
  flex-direction: column;
  width: 240px;
  height: 100vh;
  overflow-y: auto;
  background-color: #1f2937;
  color: white;
  gap: 0.5rem;
}

/* Top level menu items */
.sidebar > .menu-item {
  display: block;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #374151;
  cursor: pointer;
}

/* Submenus are always stacked vertically */
.submenu,
.subsubmenu {
  display: flex;
  flex-direction: column;
  padding-left: 1rem;
  gap: 0.25rem;
}

.submenu .menu-item,
.subsubmenu .menu-item {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Force column layout at all levels */
.menu-container,
.menu-group,
.sidebar,
.submenu,
.subsubmenu {
  flex-direction: column !important;
  display: flex !important;
}

.menu-container,
.menu-group,
.menu-item,
.submenu,
.subsubmenu {
  position: relative;
  z-index: 15010;
}

.account-menu {
  position: relative;
  z-index: 15020;
}

/* Account dropdown styling */
.account-menu {
  background-color: #1f2937; /* dark gray */
  color: #f9fafb; /* off-white text */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 0.75rem;
}
.account-menu li:hover {
  background-color: #374151; /* darker on hover */
}

/* Table cell behaviour */
td {
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
}

th {
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  padding: 0.5rem;
  font-weight: 600;
  text-align: left;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.6);
  z-index: 1000;
  pointer-events: none;
}

.loading-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #2563eb;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

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

.tab-button {
  padding: 0.25rem 0.5rem;
  margin-right: 0.5rem;
  border: 1px solid #ccc;
  background: #f0f0f0;
  cursor: pointer;
}

.tab-button.active {
  background: #d1d5db;
  font-weight: bold;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
    position: fixed;
    top: 48px;
    left: 0;
    z-index: 30;
    height: calc(100vh - 48px);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 20;
  }
}

@media (max-width: 480px) {
  table td,
  table th {
    padding: 0.25rem;
    font-size: 0.75rem;
  }
}

/* Tooltip styles */
.tooltip-wrapper[data-tooltip] {
  position: relative;
  display: inline-block;
  overflow: visible;
}

.tooltip-wrapper[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  background: #333;
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 50;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
}

/* Minimal Tailwind-like utility set to replace the removed CDN stylesheet */
.absolute { position: absolute; }
.relative { position: relative; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.z-10 { z-index: 10; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.flex { display: flex; }
.hidden { display: none; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-grow { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.h-screen { height: 100vh; }
.w-full { width: 100%; }
.w-64 { width: 16rem; }
.min-w-0 { min-width: 0; }
.min-w-full { min-width: 100%; }
.min-w-max { min-width: max-content; }
.max-h-\[70vh\] { max-height: 70vh; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-y-visible { overflow-y: visible; }
.whitespace-nowrap { white-space: nowrap; }
.align-top { vertical-align: top; }
.rounded { border-radius: 0.25rem; }
.shadow-md {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -2px rgba(0, 0, 0, 0.1);
}
.border {
  border-width: 1px;
  border-style: solid;
  border-color: #e5e7eb;
}
.border-b {
  border-bottom-width: 1px;
  border-style: solid;
  border-color: #e5e7eb;
}
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-indigo-200 { border-color: #c7d2fe; }
.border-indigo-300 { border-color: #a5b4fc; }
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-gray-800 { background-color: #1f2937; }
.bg-blue-600 { background-color: #2563eb; }
.bg-green-600 { background-color: #16a34a; }
.bg-indigo-50 { background-color: #eef2ff; }
.bg-indigo-100 { background-color: #e0e7ff; }
.bg-yellow-400 { background-color: #facc15; }
.text-white { color: #ffffff; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-900 { color: #111827; }
.text-green-700 { color: #15803d; }
.text-indigo-700 { color: #4338ca; }
.text-indigo-800 { color: #3730a3; }
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.italic { font-style: italic; }
.leading-tight { line-height: 1.25; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-64 { margin-left: 16rem; }
.space-x-2 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.5rem; }
.space-x-3 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.75rem; }
.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.odd\:bg-gray-50:nth-child(odd) { background-color: #f9fafb; }
.group { position: relative; }
.group-hover\:block { display: none; }
.group:focus-within .group-focus-within\:block { display: block; }
.group:hover .group-hover\:block { display: block; }
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
@media (min-width: 640px) {
  .sm\:hidden { display: none; }
  .sm\:flex-row { flex-direction: row; }
  .sm\:items-center { align-items: center; }
  .sm\:justify-between { justify-content: space-between; }
}
